front-comments
Installation
SKILL.md
Comment the file that is currently open or explicitly mentioned by the user.
Apply Level 1 comments by default, or Full (Level 1 + inline comments) if $ARGUMENTS contains full.
Detect the comment language from $ARGUMENTS:
- If
$ARGUMENTScontainslang:fr→ write all comments in French - If
$ARGUMENTScontainslang:es→ write all comments in Spanish - If
$ARGUMENTScontainslang:de→ write all comments in German - Otherwise → write all comments in English (default)
Step 1: Handle existing comments
Before applying any rules, scan the file for existing comments:
- Read all existing comments and identify which ones contain non-obvious information, business rules, browser workarounds, ticket references, architectural decisions, "why" explanations. Ignore trivial comments that only restate the code (e.g.
// increment counter). - Remove all existing comments from the file, including trivial ones, misplaced ones, and well-written ones alike.
- Apply the structured commenting rules (Steps 2–3 below) to the now comment-free file.
- Reintegrate the semantic content of the valuable comments identified in step 1, fold their information into the appropriate new structured blocks (file header, JSDoc description, inline comment…) rather than reinserting them verbatim.