document-service
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 workloads (CDK, CloudFormation, Terraform) with source-of-truth citations. Do NOT activate for code reviews, single-function explanations, generating new code, or general coding tasks.
What this skill does
# 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](references/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 1. List all files recursively in the target directory 2. Apply exclusion patterns from [exclusion-patterns.md](references/exclusion-patterns.md). Also respect `.gitignore`. 3. Detect project type and framework from characteristic files. See [discovery-patterns.md](references/discovery-patterns.md). 4. Identify entry points based on detected project type. See [discovery-patterns.md](references/discovery-patterns.md). 5. Read the README, CLAUDE.md, or AGENTS.md if present — these contain project context. 6. 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. ### Step 3: Generate Documentation Outline Produce a hierarchical outline mapping each documentation section to specific source files: ```markdown ## Documentation Outline 1. Architecture Overview → [entry points, IaC stack files] — explain WHY, not just WHAT 2. [Module A: detected name] → [source files for module A] 3. [Module B: detected name] → [source files for module B] 4. Shared Utilities → [shared/common source files] 5. Request Lifecycle → [trace end-to-end flows through the system] 6. Domain Logic Deep-Dive → [core services at implementation level: algorithms, parameters, edge cases] 7. Startup and Initialization → [boot sequence, model loading, cache warmup, dependency checks] 8. API Contracts → [route definitions, OpenAPI specs] 9. Data Models → [schema files, ORM models] 10. Deployment → [IaC files, Dockerfiles] 11. Configuration → [config files, .env.example, prompt templates, YAML configs, secrets refs] 12. Monitoring and Observability → [log groups, metrics, tracing, alarms, dashboards] 13. Security → [auth, encryption, IAM, network isolation] 14. Local Development → [how to run/test locally, CPU fallback, dev environment setup] 15. Discrepancies → (cross-reference README/metadata vs actual code) 16. Failure Modes → (cross-cutting — include detection + recovery) 17. Timeout and Dependency Chain → (map cascading timeouts across layers) ``` Follow the section structure in [technical-doc-template.md](references/technical-doc-template.md) but adapt to the actual codebase — add sections for significant modules, skip sections that don't apply. Aim for balance: each section should map to a meaningful subset of files. If a module maps to more than ~30 files, consider splitting it into sub-sections. **Do NOT pause for user review.** Proceed immediately to analysis. ### Step 4: Analyze Two core analysis paths: #### Path A: Application Code For each outline section, read mapped source files and extract: 1. API and service definitions — route handlers, controllers, gRPC services, GraphQL resolvers 2. Data model definitions — database schemas, ORM models, type definitions 3. Internal dependencies — imports between modules, shared utilities, event handlers 4. External integrations — SDK clients, HTTP calls, queue producers/consumers 5. Configuration — environment variables, feature flags, secrets references Consult [framework-patterns.md](references/framework-patterns.md) for framework-specific extraction patterns. #### Path B: Infrastructure-as-Code When IaC files are detected (CDK, CloudFormation, Terraform, Serverless Framework): 1. Parse resource definitions. Identify AWS resource types, relationships, and networking topology. 2. Map infrastructure to application components that use them. 3. Extract networking topology — VPCs, subnets, security groups. 4. Consult MCP servers — use `awsiac` to confirm resource interpretations, `awsknowledge` for service descriptions. When no IaC is found, infer infrastructure from application code (SDK clients, connection strings, environment variables) and mark components as `[INFERRED]`. **Note on CDK projects:** In CDK codebases, the IaC IS application code (TypeScript/Python constructs). Process CDK files in a single pass covering both Path A and Path B rather than treating them as separate analyses. Extract both the resource definitions (Path B) and the application logic interleaved with them (Lambda bundling, environment wiring, IAM grants — Path A) simultaneously. #### Writing Sections For each outline section: 1. Re-read mapped source files for exact line numbers — do not rely on memory from earlier steps. 2. Use grep for patterns — route definitions, model declarations, error handlers. 3. Write content with inline citations. See [citation-format.md](references/citation-format.md). 4. **Document every source file.** Enumerate ALL non-generated source files. Every file should appear somewhere in the documentation — in a module table, component table, or at minimum a file inventory. Files that define symbols never imported by any execution path should be flagged as `[UNUSED]` potential dead code. 5. **Analyze the test suite.** Document what tests verify,
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.