This skill should be used when the user asks to "analyze this codebase", "document this service", "generate technical docs", "I inherited this code", "help me understand this system", "create docs for this project", "what does this system look like", "onboard me to this codebase", "this codebase has no docs", "visualize the architecture from code", or any explicit request to produce structured documentation or architecture diagrams from an existing codebase. Specifically optimized for AWS worklo
NewMaintained
Automatic
◆Doc Ops pack
Last verified 8/16/2026
What it changes
Passed 7 of 22 test cases with the skill, and 15 of 22 without it.
Without skill67%
With skill33%
Checks it passed that the model alone missed
Saves editable diagram source files with the `.drawio` extension.
Invokes the `aws-architecture-diagram` skill as the primary tool for architecture diagram creation.
Proceeds directly to section analysis without waiting for user approval after generating the outline.
and 1 more in the full report
4 fixed9 passed either way9 still failing3 broke
Pass-rate lift
-33 pp
Tokens
+274%
Agent turns
0%
Response time
-29%
Model gemini-3.6-flashMeasured 8/16/2026v113 of 25 cases passed with skill · 22 comparable
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 4
Prompt
When creating editable diagram source files under the `docs/` folder for system architecture documentation in `./apps/user-dashboard`, what file extension must be used?
What was checked, without and with the skill
Checked
Without skill
With skill
Saves editable diagram source files with the `.drawio` extension.
Missed
Passed
case-23 · gemini-3.6-flash · 8/16/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md209 lines9 files
Document Service
Analyze codebases to produce structured technical documentation and architecture diagrams with source-of-truth citations. Every finding links back to the exact file and line it was derived from. Optimized for AWS workloads but works with any codebase.
Core Principles
Explain WHY, not just WHAT. The reader inherited this codebase and has zero context. Listing components is not enough — explain why the architecture is shaped this way. Search for code comments, TODOs, and commit messages that reveal design rationale. When no rationale exists, mark it [RATIONALE UNKNOWN].
Trace end-to-end flows. For every API endpoint or message handler, trace the complete request path from entry to response. Note every intermediate step, transformation, timeout, and failure point. This is the "if it breaks at 3am, where do I look?" analysis.
Deep-dive complex logic. Identify the most complex or domain-specific code paths (ML pipelines, business rule engines, state machines, custom algorithms). Document HOW they work at the implementation level — the algorithm, key parameters, edge cases, and where production bugs will occur. Surface-level summaries of complex code provide no value over a naive AI prompt.
Surface implicit knowledge. Look for hardcoded values, magic numbers, environment-dependent behavior, and undocumented assumptions. These are the tribal knowledge items that disappear when teams leave.
Every claim must be traceable. Include file:line citations for every finding. See citation-format.md. Verify citations precisely — re-read the cited file and confirm the line number is within ±3 lines. Anchor with function/variable names.
Code is the source of truth. Document what actually exists in code, not what READMEs or wikis claim. Flag every discrepancy between documentation and reality.
Mark unknowns and risks explicitly. Use [UNKNOWN] for items not inferable from code, [RISK] for unhandled failure modes, [INFERRED] for educated guesses, [RATIONALE UNKNOWN] for unexplained architecture choices. Omitting markers undermines trust.
Verify quantitative claims. List directory entries programmatically and use exact counts.
Workflow
The workflow runs autonomously from Step 2 onward. Step 1 is the only interactive step.
Step 1: Gather Context
Gather from the user:
Target directory or service to analyze
Any existing documentation, design docs, or business context (accept "nothing" — this skill is designed for undocumented codebases)
If existing docs are provided, read them first to establish baseline context. If the target directory and context are already known (e.g., provided via automation or a pre-configured prompt), skip the interactive step and proceed directly to Step 2.
Check whether CODEBASE_ANALYSIS.md already exists at the output path. If so, ask the user: "Overwrite or write to a different filename?" Resolve this before proceeding — the rest of the workflow runs autonomously.
Step 2: Build File Tree and Detect Project Type
List all files recursively in the target directory
Apply exclusion patterns from exclusion-patterns.md. Also respect .gitignore.
Detect project type and framework from characteristic files. See discovery-patterns.md.
Identify entry points based on detected project type. See discovery-patterns.md.
Read the README, CLAUDE.md, or AGENTS.md if present — these contain project context.
Check git branch names (git branch -a) for strategic context (e.g., a dev/rust branch signals a language migration in progress). Note active branches in the Architecture Overview.