一键导入
devmd-scan
Analyze an existing codebase and generate DevMD spec files. Supports single-file or full-project mode. Language-aware discovery with self-verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze an existing codebase and generate DevMD spec files. Supports single-file or full-project mode. Language-aware discovery with self-verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Plan-then-execute sprint orchestrator. Works like a real delivery team: split work into sprints (~1 human-week each), plan them all up front WITH the user, then autonomously run each sprint through a full cycle (research→plan→design→do→QA→fix→deploy) to completion. Multiple sprints can run at once (concurrent dispatch). The leader (main session) dynamically scaffolds project-local agents for whatever domain — not dev-only (marketing, research, ops, data all fit). bkit-aware: borrows bkit agents/skills internally when present, runs fully standalone otherwise. Not for single-file edits, one-shot bug fixes, or work under ~a few hours.
Invoke for "/cowork-insights" command or when the user asks to summarize, review, or report on past Claude Code sessions. Analyzes sessions to show key prompts (verbatim), structured assessments (goal/outcome/friction), tool usage patterns, and actionable insights. Produces HTML report + shareable Markdown for Jira/Notion/Slack. Three report formats — full (deep narrative), standard (core insights), minimal (quick team share). Supports --from/--to with absolute (2026-03-01) or relative (7d, 2w, 1m) dates. Trigger on phrases like weekly status update, sprint recap, what did I do with Claude, AI usage patterns, session history, minimal recap, what I worked on today, share with team, cowork-insights. DO NOT invoke for active tasks (debugging, refactoring, code review, project setup) or for commit-time recaps (use cowork-commit instead).
Trigger whenever the user asks to commit AND wants the commit message enriched with AI collaboration history. Creates a lightweight commit message (key decision highlights + link) and a full directive-log file with conversation transcript + recap. The key signal is the combination of (1) making a commit with (2) capturing how AI contributed. Trigger on phrases like commit with AI recap, attach collaboration history to commit, record AI work in commit, cowork-commit. DO NOT trigger for plain commits without AI documentation, standalone time-period recaps (use cowork-insights instead), PR reviews, or general git operations.
One-time bootstrap of an existing project's docs/ and source into the cowork-doc-sync taxonomy structure. After a detailed gap analysis, relocate docs to match the standard. Phase 1 = relocation only (no new creation, includes moving content between docs), Phase 2 = analyze source to create new docs (only after user approval). For ongoing maintenance use /cowork-doc-sync. Triggers: cowork-doc-init, /cowork-doc-init, init doc structure, relocate docs, organize existing docs, doc init, doc bootstrap
Ongoing doc-sync skill that aligns a project's docs/ with the current code/decision state. Call once at the very end, after implementation/refactoring is complete. Enforces a numbered taxonomy (00-reference~99-misc) + status model (LIVING/ACTIVE/FROZEN) + migration rules. To fit an existing project into this structure for the first time, use /cowork-doc-init. Triggers: cowork-doc-sync, /cowork-doc-sync, sync docs, align docs, organize docs, doc sync, doc alignment
Compare DevMD files against actual source code. Measures coverage, accuracy, and consistency with deterministic counting and evidence-backed findings.
| name | devmd-scan |
| description | Analyze an existing codebase and generate DevMD spec files. Supports single-file or full-project mode. Language-aware discovery with self-verification. |
| triggers | ["devmd scan","devmd generate","reverse document","역문서화"] |
| user-invocable | true |
| allowed-tools | ["Read","Write","Edit","Glob","Grep","Bash","Agent","AskUserQuestion"] |
Analyzes an existing codebase and generates DevMD specification files.
/devmd-scan # Full project scan (auto-detect tier)
/devmd-scan SCHEMA.md # Single file only
/devmd-scan SCHEMA.md,API.md # Multiple specific files
/devmd-scan --tier app # Force tier (starter|app|ai-native|enterprise)
/devmd-scan --overwrite # Overwrite existing DevMD files (default: preserve)
Run once before any file generation. Results are shared with all subsequent Agents.
if [ -f package.json ]; then LANG="JS/TS"
elif [ -f pyproject.toml ] || [ -f setup.py ] || [ -f requirements.txt ]; then LANG="Python"
elif [ -f go.mod ]; then LANG="Go"
elif [ -f Cargo.toml ]; then LANG="Rust"
elif [ -f pom.xml ] || [ -f build.gradle ] || [ -f build.gradle.kts ]; then LANG="Java/Kotlin"
else LANG="Unknown"; fi
echo "LANG=${LANG}"
FILE_COUNT=$(find . -type f -not -path '*node_modules*' -not -path '*.git*' -not -path '*vendor*' -not -path '*venv*' -not -path '*__pycache__*' -not -path '*dist*' -not -path '*build*' | wc -l)
echo "FILE_COUNT=${FILE_COUNT}"
for f in README.md CLAUDE.md AGENTS.md DESIGN.md CHANGELOG.md; do
[ -f "$f" ] && echo "EXISTS: $f ($(wc -l < "$f") lines)"
done
find . -maxdepth 2 -type d -not -path '*node_modules*' -not -path '*.git*' -not -path '*vendor*' | sort
Has AGENTS.md + agent/skill files + LLM env vars? → AI-Native (21)
+ Has CI/CD + k8s/terraform + ops runbooks? → Enterprise (25)
Has DB (migrations/ORM) + API (routes) + auth? → App (16)
Otherwise → Starter (8)
Tier gives a starting list, but not every file is needed for every project. After tier detection, present the full file list with per-file relevance hints and let the user deselect files that don't apply.
Relevance hints (auto-detect from recon context):
| Signal | Files to question |
|---|---|
| Internal tool / no public traffic | SEO — likely skip |
| No AI agent orchestration (just LLM API calls) | AGENTS, HARNESS, LIFECYCLE — likely skip |
| Solo dev / small team, no on-call | OPERATIONS — likely skip |
| No CI/CD pipeline yet / simple deploy | DEVOPS — likely skip |
| Greenfield project (no changelog yet) | CHANGELOG — likely skip |
| Background jobs described in FLOWS | RUNTIME — may be redundant |
Process:
| File | Phase | Purpose (one line) | Recommended? |If invoked with specific file names (/devmd-scan SCHEMA.md,API.md) or --all, skip this step.
Store as a text block (do NOT write to file). This summary is passed to every Agent prompt in subsequent phases.
RECON:
lang: JS/TS
scale: Medium (487 files)
tier: App (16)
existing_docs: README.md (45 lines), CLAUDE.md (120 lines)
top_dirs: src/, tests/, prisma/, docker/, .github/
package_manager: pnpm
framework: NestJS + React
Files are grouped into phases by dependency. Within each phase, files are generated in parallel via Agent calls.
Tier determines which files to generate:
| Tier | Files |
|---|---|
| Starter (8) | PRODUCT, DESIGN, UI, SEO, BRAND, CLAUDE, SCREENS, INFRA |
| App (16) | + SCHEMA, API, ERRORS, SECURITY, TESTING, LOGGING, FLOWS, ARCHITECTURE |
| AI-Native (21) | + AGENTS, HARNESS, LIFECYCLE, RUNTIME, CONFIG |
| Enterprise (25) | + DEVOPS, OPERATIONS, CHANGELOG, remaining |
Every Agent receives this exact structure. Fill in {variables} before dispatch.
You are generating {FILE_NAME} for an existing codebase.
## Recon
{RECON_SUMMARY from Phase 0}
## Discovery Patterns
Use these patterns to find relevant source files. The project language is {LANG}.
{PATTERNS from skills/common/patterns.md — only the section for this FILE_NAME and detected LANG}
## Steps
1. Run ALL Detect Glob/Grep patterns above (including subsections like "Enum/Value Object Discovery" for SCHEMA.md). List all hits.
2. If hits > 5, pick the 3 largest files per subsection. If hits = 0, report "N/A — no relevant source found" and stop.
3. Read each selected file (use offset/limit for files > 200 lines — read first 100 + last 50).
3a. For SCHEMA.md specifically: MUST read both ORM model files AND domain-layer enum/value-object files. When values differ between layers, use domain layer as authoritative and note the discrepancy.
4. {If Phase 2+}: Read these already-generated DevMD files for cross-reference context:
{LIST of Phase N-1 output file paths}
5. **MUST read the spec file BEFORE generating.** Read `spec/{FILE_NAME}` from the DevMD plugin directory. This is non-negotiable — generating without reading the spec produces non-compliant output.
6. Generate {FILE_NAME} following the spec:
### Required Frontmatter Fields
{Extracted from spec/{FILE_NAME} — REQUIRED fields only, with types}
### Required Body Sections (in order)
{Extracted from spec/{FILE_NAME} — REQUIRED sections only}
### Optional Body Sections (include if source evidence exists)
{Extracted from spec/{FILE_NAME} — OPTIONAL sections}
6. Include cross-references using @FILE.md#section syntax where relevant.
7. Self-verify:
a. Every REQUIRED frontmatter field is present and has a value
b. Every REQUIRED body section exists and has content (not empty)
c. Every @FILE.md reference points to a file that exists or will be generated in this scan
If any check fails, fix before outputting.
## Output
Write the file to {OUTPUT_PATH}/{FILE_NAME}.
Do NOT write anything else. No summary, no explanation.
{FILE_NAME} already exists at output path AND --overwrite is NOT set:
<!-- DevMD scan: merged {date} --> at the top--overwrite IS set: generate fresh, ignore existingWhen invoked as /devmd-scan SCHEMA.md:
After all files are generated, run spec compliance on each:
spec/{FILE_NAME} from the DevMD plugin.After all files pass spec compliance, output exactly:
DevMD Scan Complete
Project: {project name from package.json or directory name}
Language: {LANG}
Scale: {Small|Medium|Large} ({FILE_COUNT} files)
Tier: {tier} ({N} files)
Generated: {N} files
Preserved: {N} existing files (use --overwrite to regenerate)
Skipped: {N} files (no relevant source found)
Spec compliance: {N}/{N} PASS
Next: run /devmd-gap-analysis to verify against source code