scan
npx skills add https://github.com/continuedev/skills --skill scan
Agent 安装分布
Skill 文档
Codebase Scan
Audit the codebase against another skill’s criteria using a parallel agent team.
Workflow
1. Parse args & load skill
Extract the skill name from the args passed to this skill.
- If no skill name provided, list available skills in
.claude/skills/and ask the user which to scan against. - If skill doesn’t exist, list available skills and tell the user.
- Read
.claude/skills/<name>/SKILL.mdplus any files inreferences/andrules/subdirectories. - Distill the skill’s content into a numbered criteria checklist: a flat list of concrete, testable rules labeled C1, C2, C3, etc. Each criterion should be a single sentence describing what to check for.
- If the skill has no evaluable code criteria (e.g., workflow-only skills like
whythat don’t define code patterns or rules), tell the user it’s not scannable and stop.
2. Discover relevant files
Use the skill’s criteria to infer file scope:
- React/frontend criteria â
app/**/*.tsx,app/**/*.ts - Backend criteria â
services/**/*.ts - General/mixed â both of the above
- CSS/styling â
app/**/*.css,app/**/*.tsx
Always exclude: node_modules/, dist/, *.test.*, *.spec.*, **/migrations/**, **/*.d.ts, generated files.
Count candidate files. If zero, tell the user and stop.
3. Plan team composition
Split files into chunks by directory subtree so no file is assigned to two agents:
| Candidate files | Teammates |
|---|---|
| < 100 | 2 (or skip team for < 20) |
| 100â500 | 3 |
| 500+ | 4â5, split by top-level directory |
For very small scans (< 20 files), skip the team â scan inline and jump to step 6.
4. Spawn scan team
spawnTeamwith namescan-<skill-name>- Create one
TaskCreateper chunk with:- Subject:
Scan <directory-area> against <skill-name> criteria - Description: Include the full criteria checklist, the file scope (glob patterns), and the teammate instructions from
references/teammate-instructions.md
- Subject:
- Spawn teammates as
general-purposesubagent_type (they need Read, Glob, Grep + team communication) - Name teammates
scanner-1,scanner-2, etc. - Assign tasks via
TaskUpdatewithowner
5. Collect & synthesize
Wait for all teammates to complete their tasks. Each teammate reports findings in structured format:
FINDING: C<n> | SEVERITY | file/path.ts:LINE | Description
Collect all findings from teammate messages.
6. Generate report
Create .claude-scan/<skill-name>.md using the format in references/report-format.md.
Key sections:
- Executive Summary (2-3 sentences)
- Criteria Evaluated (table with violation counts)
- Findings by Severity (Critical â Warning â Info tables)
- Patterns Observed
- Statistics
- Recommended Fix Order (batched by non-overlapping file groups)
7. Cleanup & present
- If a team was spawned: send
shutdown_requestto all teammates, thencleanup - Display inline summary: total findings by severity, top violated criteria, scan scope
- Tell the user the full report is at
.claude-scan/<skill-name>.md - Ask: “Want me to spawn a fix team to address these findings?”
8. Fix team (if user says yes)
- Read the report’s “Recommended Fix Order” section
- Group fixes into non-overlapping file batches
spawnTeamwith namefix-<skill-name>- Create tasks per batch â each task description includes:
- The specific violations to fix (from the report)
- The relevant criteria definitions
- Instructions from
references/fix-team-instructions.md
- Spawn
general-purposeteammates namedfixer-1,fixer-2, etc. (need Edit/Write) - Assign tasks and wait for completion
- Shutdown and cleanup fix team
- Ask user if they want to re-scan to verify fixes