skills/docs-diagram/SKILL.md
Generate Mermaid diagrams from codebase analysis including architecture, database schema, deployment, and security diagrams. This skill should be used when users want to create system diagrams, ER diagrams, architecture visualizations, or deployment diagrams.
npx skillsauth add mgiovani/cc-arsenal docs-diagramInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Cross-Platform AI Agent Skill This skill works with any AI agent platform that supports the skills.sh standard.
Generate Mermaid diagrams including architecture, database schema, deployment, and security architecture.
CRITICAL: Diagrams must represent REAL components. Before adding ANY element:
| Type | Output File | Description |
|------|------------|-------------|
| er | docs/data-model.md | Entity-Relationship diagram from database models |
| arch | docs/architecture.md | System architecture and component relationships |
| deployment | docs/deployment.md | Deployment infrastructure and CI/CD |
| security | docs/security.md | Security architecture and data flow |
Use the Explore agent to thoroughly analyze the codebase before generating diagrams:
command argumentser, arch, deployment, securityBefore generating, spawn parallel agents to verify different aspects. See references/detection-patterns.md for specific detection commands per diagram type.
Example: Generating an architecture diagram
Agent 1 - Verify Services:
- prompt: "Find all actual service files/classes in the codebase. Return a list of verified service names with their file paths. Do NOT assume - only return what you can find."
- agent-type: "Explore"
Agent 2 - Verify Databases:
- prompt: "Find all database configurations and connections. Look for DB URLs, ORM configs, connection pools. Return verified database technologies with evidence."
- agent-type: "Explore"
Agent 3 - Verify External Integrations:
- prompt: "Find all external API calls, third-party service integrations. Look for HTTP clients, SDK imports, webhook handlers. Return verified external dependencies."
- agent-type: "Explore"
Agent 4 - Verify Data Flow:
- prompt: "Trace how data flows between components. Look at imports, function calls, event handlers. Return verified connections between components."
- agent-type: "Explore"
Merge results -> Only include verified entities in diagram
**Verification checklist before adding to diagram**:
1. Read the actual source file to confirm it exists
2. For relationships, verify the import/reference exists in code
3. For counts (e.g., "5 services"), run: `find . -name "*service*" | wc -l`
4. Remove any component that cannot be verified with actual code
### Phase 4: Generate Mermaid Diagram
- Create appropriate Mermaid syntax based on type
- **ONLY include verified components** - no assumptions
- Include meaningful labels and relationships
- Add comments for clarity
- Keep diagram readable (not too complex)
For Mermaid syntax patterns per diagram type, see [references/mermaid-patterns.md](references/mermaid-patterns.md).
### Phase 5: Load and Populate Template
- Template location: `assets/templates/`
- Select based on diagram type:
- `er` -> `data-model.md`
- `arch` -> `architecture.md`
- `deployment` -> `deployment.md`
- `security` -> `security.md`
Replace placeholders:
- `{{PROJECT_NAME}}` - Git repo or directory name
- `{{DATE}}` - Current date
- `{{ER_DIAGRAM}}` or `{{DIAGRAM_CONTENT}}` - Generated Mermaid code
- `{{ENTITIES}}` or `{{COMPONENTS}}` - Entity/component descriptions
### Phase 6: Create or Update Documentation
- Output to appropriate file in `docs/`
- If file exists, ask before overwriting
- Preserve custom content if possible
### Phase 7: Report Results
- Show diagram type and output file
- Display summary of what was detected
- Provide next steps
## Usage Examples
Generate specific diagram type:
docs-diagram er docs-diagram arch docs-diagram deployment docs-diagram security With additional context:
docs-diagram er for user and order tables
docs-diagram arch for microservices architecture
docs-diagram deployment with Docker and Kubernetes
Show available types:
docs-diagram
er)arch)deployment)security)This skill includes the following Claude Code-specific enhancements:
Use the Explore agent to thoroughly analyze the codebase before generating diagrams:
Use Task tool with Explore agent:
- prompt: "For [DIAGRAM_TYPE] diagram, find all relevant components. For ER: find model/entity files and their relationships. For arch: find services, APIs, databases. For deployment: find Docker/K8s configs. Return ONLY verified files with their actual content structure."
- subagent_type: "Explore"
$ARGUMENTSer, arch, deployment, securityBefore generating, spawn parallel agents to verify different aspects. See references/detection-patterns.md for specific detection commands per diagram type.
Example: Generating an architecture diagram
Agent 1 - Verify Services:
- prompt: "Find all actual service files/classes in the codebase. Return a list of verified service names with their file paths. Do NOT assume - only return what you can find."
- subagent_type: "Explore"
Agent 2 - Verify Databases:
- prompt: "Find all database configurations and connections. Look for DB URLs, ORM configs, connection pools. Return verified database technologies with evidence."
- subagent_type: "Explore"
Agent 3 - Verify External Integrations:
- prompt: "Find all external API calls, third-party service integrations. Look for HTTP clients, SDK imports, webhook handlers. Return verified external dependencies."
- subagent_type: "Explore"
Agent 4 - Verify Data Flow:
- prompt: "Trace how data flows between components. Look at imports, function calls, event handlers. Return verified connections between components."
- subagent_type: "Explore"
Merge results -> Only include verified entities in diagram
Verification checklist before adding to diagram:
find . -name "*service*" | wc -lFor Mermaid syntax patterns per diagram type, see references/mermaid-patterns.md.
assets/templates/er -> data-model.mdarch -> architecture.mddeployment -> deployment.mdsecurity -> security.mdReplace placeholders:
{{PROJECT_NAME}} - Git repo or directory name{{DATE}} - Current date{{ER_DIAGRAM}} or {{DIAGRAM_CONTENT}} - Generated Mermaid code{{ENTITIES}} or {{COMPONENTS}} - Entity/component descriptionsdocs/development
Generate comprehensive test suites with coverage analysis and parallel test writing. Automatically activates when users want to write tests, add test coverage, generate test cases, improve testing, or analyze coverage gaps. Supports pytest, vitest, jest, and all major test frameworks.
development
Multi-agent PR review team orchestration with 7 specialized reviewers for security-sensitive or architectural PRs. Spawns architecture, security, performance, testing, style, docs/UX, and adversary reviewers as a coordinated team. Premium review for critical code changes.
development
Spec-driven team orchestration: adaptive development team scaling from 3 to 11 agents based on complexity.
development
Perform comprehensive security review targeting OWASP Top 10 2025 vulnerabilities for PRs, commits, or entire codebases. This skill should be used when a user wants to audit code security, scan for vulnerabilities, review security posture, or check for OWASP compliance. Analysis only - identifies vulnerabilities without modifying code.