plugins/python-development/skills/python-comments/SKILL.md
Write and audit Python code comments using antirez's 9-type taxonomy. Two modes - write (add/improve comments in code) and audit (classify and assess existing comments with structured report). Applies systematic comment classification with Python-specific mapping (docstrings, inline comments, type hints). TRIGGER WHEN: users request comment improvements, docstring additions, comment quality reviews, or documentation audits DO NOT TRIGGER WHEN: the task is outside the specific scope of this component.
npx skillsauth add acaprino/alfio-claude-plugins python-commentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Two operational modes for Python code comments:
Core principle: comments explain why, code explains what. Type hints explain types.
Write mode triggers:
Audit mode triggers:
Nine comment types from antirez's "Writing system software: code comments". See references/taxonomy.md for full detail.
| Type | Name | Python Form | Purpose |
|------|------|-------------|---------|
| 1 | Function | Docstring | What the function/class/module does |
| 2 | Design | Docstring or # | Architecture rationale, API design choices |
| 3 | Why | Inline # | Non-obvious reasoning behind code |
| 4 | Teacher | Inline # | Domain knowledge, algorithm explanation |
| 5 | Checklist | Inline # | Steps that must not be skipped or reordered |
| 6 | Guide | # section headers | Navigation aids in long modules |
| Type | Name | Detection | Fix |
|------|------|-----------|-----|
| 7 | Trivial | Restates the code | Delete |
| 8 | Debt | TODO, FIXME, HACK | Resolve or create issue |
| 9 | Backup | Commented-out code | Delete (git preserves history) |
"""...""") - Types 1-2. Describe interface (what, args, returns, raises). Follow PEP 257.#) - Types 3-6. Describe implementation (why, how, context).# BAD: Comment duplicates type hint
def process(data: list[dict]) -> bool:
"""Process data.
Args:
data: A list of dictionaries # Redundant - type hint says this
"""
# GOOD: Docstring adds semantic meaning
def process(data: list[dict]) -> bool:
"""Process sensor readings and flag anomalies.
Args:
data: Sensor readings keyed by timestamp, each containing
'value', 'unit', and optional 'calibration_offset'
"""
"""Return the user's full name.""" (imperative mood, period)Execute in four phases.
Output: Inventory of existing documentation and code structure.
For each code element, determine what's missing:
Prioritize gaps by impact:
Output: Prioritized gap list with comment type needed for each.
Apply comments following these rules:
# for types 3-6references/docstring-styles.mdWriting rules per type:
references/docstring-styles.md# --- Section Name --- or # region/# endregionOutput: Commented code.
Output: Final commented code passing all checks.
Execute in four phases.
#, block #)Output: Comment inventory with locations.
For each comment, assign:
Quality criteria per type - see references/taxonomy.md for detail:
Output: Classified comment inventory with quality assessments.
Identify what's missing:
Severity levels:
Output: Gap analysis with severity ratings.
Generate structured audit report.
## Comment Audit Report
### Summary
- **Files analyzed:** N
- **Total comments:** N (docstrings: N, inline: N)
- **Comment density:** N comments per 100 LOC
- **Type distribution:** Type 1: N, Type 2: N, ... Type 9: N
- **Quality score:** N/10
### Critical Gaps
- [ ] {file}:{line} - {element} - Missing {type} comment - {impact}
### Issues Found
#### Negative Comments (fix or remove)
- {file}:{line} - Type {N} ({name}) - "{comment text}" - Action: {delete/resolve/rewrite}
#### Outdated Comments
- {file}:{line} - "{comment text}" - Mismatch: {description}
#### Quality Issues
- {file}:{line} - Type {N} - Issue: {description}
### Coverage Metrics
| Scope | With Docstring | Without | Coverage |
|-------|---------------|---------|----------|
| Modules | N | N | N% |
| Classes | N | N | N% |
| Public functions | N | N | N% |
| Public methods | N | N | N% |
### Recommendations
1. **Priority 1:** {action} - {N elements affected}
2. **Priority 2:** {action} - {N elements affected}
3. **Priority 3:** {action} - {N elements affected}
### Comment Style
- **Detected style:** {Google/NumPy/Sphinx/mixed}
- **Consistency:** {consistent/inconsistent}
- **Recommendation:** {standardize on X style}
See references/examples/audit-mode-examples.md for complete report examples.
x += 1, do not add # increment x"""Process data.""" on a complex function is worse than nothing__init__.py docstrings) follows type 1+2 patternsdevelopment
Quality gates for multi-reviewer code review pipelines: adversarial verification panel, completeness critic, reviewer pipeline conventions, and the context sharing pattern for parallel reviewers. TRIGGER WHEN: running /senior-review:team-review quality gates; running /senior-review:code-review Steps 4b/4c (adversarial verification and completeness check); consolidating or deduplicating findings from multiple parallel reviewers. DO NOT TRIGGER WHEN: single-reviewer style review without a consolidation phase, or generic team coordination (the upstream agent-teams skills cover that).
development
Knowledge base for pure-architecture decisions on when to unify duplicated logic into a shared abstraction versus leave it duplicated. Covers the canonical theory (Rule of Three, DRY/WET/AHA, Wrong Abstraction, Locality of Behaviour, Bounded Contexts, Tidy First options framing, CUPID vs SOLID), 12 essential-duplication patterns that justify unification, 12 wrong-abstraction patterns that justify inlining or decomposition, an operational decision frame, and a verified reading list. TRIGGER WHEN: the user is making an architectural decision about whether to centralize, extract, or remove a layer; reviewing an abstraction for premature generality; auditing scattered cross-cutting concerns; spawned by the abstraction-architect agent during /abstraction-architect:audit or as the Abstraction dimension of /senior-review:team-review or /senior-review:code-review; the user asks "should I extract this into a service" / "is this DRY enough" / "is this wrong abstraction". DO NOT TRIGGER WHEN: the task is code formatting and readability cleanup (use clean-code:clean-code), Python-specific refactoring with metrics (use python-development:python-refactor), generic dead-code removal (use senior-review:cleanup-dead-code), security review (use senior-review:security-auditor), or pure pattern-consistency review without an architecture lens (use senior-review:code-auditor).
development
Unified web frontend knowledge base covering CSS architecture, UX psychology, UI components, distinctive aesthetics, and interface design generation. TRIGGER WHEN: working on web styling, design systems, component decisions, responsive strategy, distinctive frontend aesthetics, or exploring multiple interface designs. DO NOT TRIGGER WHEN: the task is purely backend or unrelated to web frontend.
development
Stripe payments knowledge base - API patterns, checkout optimization, subscription lifecycle, pricing strategies, webhook reliability, Firebase integration, cost analysis, and revenue modeling. Loaded by stripe-integrator and revenue-optimizer agents; also consumable directly when the user asks for Stripe-specific patterns without needing an agent. TRIGGER WHEN: working with Stripe API (Payment Intents, Customers, Subscriptions, Checkout Sessions, Connect, webhooks, tax, usage-based billing), pricing strategy, or revenue modeling. DO NOT TRIGGER WHEN: payment work is non-Stripe (PayPal, Square, crypto) or the task is generic e-commerce unrelated to payments.