AgentSkillsCN

sdd:code-mapping

为代码库映射至专业文档提供模板与分析指导。sdd:code-mapper 代理利用此技能,生成 8 份聚焦于特定代码库的文档。

SKILL.md
--- frontmatter
name: sdd:code-mapping
description: Provides templates and analysis guidance for mapping codebases into specialized documentation. Used by the sdd:code-mapper agent to generate 8 focused codebase documents.

Codebase Mapping Skill

This skill provides templates and analysis guidance for generating comprehensive codebase documentation. It supports four focus areas, each producing two specialized documents.

Focus Area Routing

When invoked, check the focus parameter to determine which templates and analysis guides to use:

Focus AreaTemplates to UseAnalysis Guide
techstack.md, integrations.mdtech-analysis.md
archarchitecture.md, structure.mdarch-analysis.md
conventionsconventions.md, testing.mdconventions-analysis.md
securitysecurity.md, concerns.mdsecurity-analysis.md

Output Location

All documents are written to: .sdd/codebase/

Files use UPPERCASE naming: STACK.md, INTEGRATIONS.md, ARCHITECTURE.md, STRUCTURE.md, CONVENTIONS.md, TESTING.md, SECURITY.md, CONCERNS.md

Document Quality Requirements

Each generated document MUST:

  1. Be Actionable: Content should guide future development decisions
  2. Include File Paths: Reference actual paths in backticks for navigation (e.g., src/api/auth.py)
  3. Be Current: Reflect the actual state of the codebase at time of generation
  4. Focus on What Executes: Capture only what runs (languages, runtime, frameworks, dependencies)
  5. Limit Dependencies: Document 5-10 most important dependencies, not every entry
  6. Specify Versions: Only when compatibility matters
  7. Use Prescriptive Language: Guide future code generation with clear patterns

Exclusions by Document

Content belongs in specific documents - avoid duplication:

If Content Is About...Put It In...NOT In...
Languages, frameworks, versionsSTACK.mdARCHITECTURE.md
External APIs, databases, auth servicesINTEGRATIONS.mdSTACK.md
System design, patterns, data flowARCHITECTURE.mdSTRUCTURE.md
Directory layout, module boundariesSTRUCTURE.mdARCHITECTURE.md
Code style, naming, error handlingCONVENTIONS.mdTESTING.md
Test strategy, frameworks, patternsTESTING.mdCONVENTIONS.md
Auth, authorization, vulnerabilitiesSECURITY.mdCONCERNS.md
Tech debt, risks, TODOsCONCERNS.mdAny other doc

How to Use This Skill

  1. Read the focus-specific analysis guide from references/focus-guides/{focus}-analysis.md
  2. Load the relevant templates from references/templates/
  3. Analyze the codebase following the analysis guide instructions
  4. Fill templates with discovered information
  5. Write documents directly to .sdd/codebase/
  6. Return confirmation only: file paths + line counts

Template Files

Templates are located in references/templates/:

  • stack.md - Languages, frameworks, dependencies
  • integrations.md - External services, APIs, data stores
  • architecture.md - System design, patterns, data flow
  • structure.md - Directory layout, module boundaries
  • conventions.md - Code style, naming, patterns
  • testing.md - Test strategy, frameworks, patterns
  • security.md - Auth, authorization, vulnerabilities
  • concerns.md - Tech debt, risks, known issues

Focus Guides

Analysis guides are located in references/focus-guides/:

  • tech-analysis.md - How to analyze tech stack and integrations
  • arch-analysis.md - How to analyze architecture and structure
  • conventions-analysis.md - How to analyze conventions and testing
  • security-analysis.md - How to analyze security and concerns