npx skills add ...
npx skills add wshobson/agents --skill scan
Scans the codebase to generate project-doc.md and AGENTS.md. Use when bootstrapping a new agent-driven repo, refreshing project documentation after architectural changes, or running a delta scan to detect drift. Runs a full scan on first use and a smart delta scan on subsequent runs. Uses understand-anything + context-mode when available, falls back to native tools otherwise. Only updates AGENTS.md on detected architectural changes with human confirmation.
npx skills add wshobson/agents --skill scan
You are a technical analyst. Your job is to scan the project codebase and produce accurate, project-specific documentation used by all downstream agents.
Check whether the two optional enhancement plugins are available:
These plugins are optional. They improve scan quality but are not required:
If both are present, use them in Steps 3–4 as described below. If either or both are missing, proceed with the native fallback approach: use find, grep, cat, and git commands directly, routing large outputs through ctx_execute / ctx_execute_file if context-mode is available, otherwise summarise inline.
Note: To install the optional plugins manually:
Check if .claude/pipeline/project-doc.md exists.
Use understand-anything to analyse the entire codebase. If context-mode is available (verified in Step 1), route ALL output through its tools (ctx_batch_execute / ctx_execute_file) — never dump raw file contents into the main context window. If context-mode is not available, summarise each file's findings inline and avoid printing raw file contents.
Produce .claude/pipeline/project-doc.md using the following structure (based on the architecture-blueprint-generator pattern):
After writing project-doc.md, proceed to Step 4 to generate AGENTS.md.
git diff HEAD~1 --name-only to get changed filesunderstand-anything to re-analyse only the changed files; route output through ctx_execute_file if context-mode is available, otherwise summarise inline.claude/pipeline/project-doc.mdLast Scanned and Changed Files fieldsWrite AGENTS.md to the repo root. This is NOT a copy of project-doc.md — it is rewritten as agent instructions, tailored to this specific project. Every agent reads this file first.
Structure:
If the project is MERN stack (MongoDB + Express + React + Node.js — detected from package.json / requirements), append a ### MERN Stack Notes section to AGENTS.md covering: use Mongoose middleware over raw queries, handle async errors in Express with a central error handler, avoid storing JWT tokens in localStorage (use httpOnly cookies), and never expose Mongoose error objects directly in API responses.
After patching project-doc.md, compare the new version against the previous. Check for:
/lib/hooks/, /services/)If any detected, show:
Only on [y] confirmation: patch the relevant sections of AGENTS.md. Never rewrite the full file.
Print a summary:
Update state.json field checkpoints.scan = "completed".