clean-comments
Remove comments that fail ~/.claude/rules/comments.md from source files. Use when user wants to clean comments, remove redundant comments, strip obvious comments, or run /clean-comments on staged files before committing.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- clean-comments
- model
- haiku
- description
- Remove comments that fail ~/.claude/rules/comments.md from source files. Use when user wants to clean comments, remove redundant comments, strip obvious comments, or run /clean-comments on staged files before committing.
03 SKILL.md 正文
Clean comments
The standard
~/.claude/rules/comments.md decides what earns a comment. It is the only
copy. Read it before editing a file and apply it as written.
Do not restate it here, and do not work from memory of it. A subagent running
this skill may not have it loaded, so read the file. If a case it does not
cover comes up, the fix belongs in comments.md, not in this skill.
Deleting a load-bearing directive is the one unrecoverable mistake this skill
can make. Leave these alone: //go:build, // +build, //go:generate,
// prettier-ignore, # fmt:, # -*- coding:, shebangs.
Suppressions are not on that list. @ts-ignore, eslint-disable,
# type: ignore, //nolint are debt under comments.md § Suppressions.
Report them and say what each is silencing. Never delete one in this pass:
removing a suppression breaks the build or the lint run, which is a code
change, and this skill does not make those.
Quick start
Run on staged files before a commit:
/clean-comments
Run on specific files:
/clean-comments src/foo.ts src/bar.go
Workflow
- Read
~/.claude/rules/comments.md - If arguments are provided, treat them as file paths to clean
- If no arguments, get staged files:
git diff --cached --name-only --diff-filter=ACM - Filter to code files (
.go,.ts,.tsx,.js,.jsx,.py,.rs) - For each file, read it, remove the comments that fail the standard, write it back
- Re-stage any modified files:
git add <file> - Report what was removed and from which files; if nothing needed removing, say so
Comment-only edits. Never change code in the same pass.
The commit hook
~/.claude/hooks/check-staged-comments.sh runs on PreToolUse for Bash and
blocks git commit when the staged diff adds comment lines. It ignores
directives, and reads # as a comment marker in Python only.
Trimming a long doc comment counts as adding lines, so a cleanup pass trips it. When every remaining comment earns its place, say so and commit with:
CC_COMMENTS_REVIEWED=1 git commit ...
04 同仓库更多 Skills
obsidian-develop
Build, prototype, extend, debug and review Obsidian community plugins against a live vault: inspect the running app's UI, DOM, console and plugin state, prototype in the runtime, then verify each change with a build, reload and check loop. Use whenever the user is working on an Obsidian plugin, even when they just say "add a command", "make a sidebar view", "my settings tab is blank", "why isn't my view updating" or "get this ready for the community directory"; when they ask about the plugin API (obsidian.d.ts, Workspace, leaves, Vault, MetadataCache, FileManager, views, modals, settings tabs, CodeMirror 6 editor extensions, markdown post-processors, events); or when they want a running Obsidian instance's DOM, CSS, console or plugins inspected. Not for general note-taking, Obsidian Markdown syntax, themes without a plugin, or managing vault content (use ingest, to-vault or vault-recall for those).
vault-recall
Answer the user's conceptual or technical question using their Obsidian vault as well as general knowledge. Use when the user asks a question (not a task) whose topic appears in the vault MOC digest from session start. Not for task instructions, not mid-task, and not for writing to the vault (that is to-vault).
ingest
Ingest one external source (an article, course lesson, doc, PDF or URL) into the user's Obsidian vault: save the original to raw/, then build wiki/ pages per the vault's § Ingest. Use when the user types /ingest, or says "ingest this", "add this source to my wiki", "put this article/lesson in the vault as a wiki page". Works from any repo. Routing rule: someone else's words go to wiki/ (this skill); the user's own learnings and decisions go to notes/ (/to-vault).
to-tickets
Breaks a source into independently-grabbable GitHub tickets. For a code feature the source is the plan (`docs/plans/<feature>.md`, from /to-plan) and every new or changed symbol lands in exactly one ticket, its signatures copied into the ticket body; a non-code feature is cut from the PRD's slices. Cuts tickets for one feature per run. If a code feature has no approved plan, offers /to-plan instead of cutting from prose. In a repo that runs command-centre, also emits `[[task]]` blocks into its config; in a plain treepad repo, emits a Batch Manifest instead so the tickets materialise as stacked worktrees.
to-seams
Records an agreed-but-unlanded cross-repo interface as a seam: the file a consumer's agent gets pasted into its prompt as ground truth, plus the `[[seam]]` block command-centre reads for the retirement pointer. Use when two repos need to build against an interface neither has landed yet — "record a seam for X", "we agreed on this schema, seam it", "add a seam so Y can build against Z's new field". Halts for approval before writing either file.
to-roadmap
Prioritises settled features into a Now / Next / Later kanban board, rendered as a self-contained ./ideas/roadmap.html. Each card is a feature, not a ticket — one card later becomes several tickets via /to-prd -> /to-plan -> /to-tickets. Boards the features in ./docs/approach.md, or the "## Accepted ideas" in ./ideas/CONTEXT.md when there is no approach doc. The approach doc is settled truth: this assigns tiers and reasons about ordering, it never re-litigates what was decided.