Files
gh-cubical6-melly/commands/c4-code.md
2025-11-29 18:17:07 +08:00

45 lines
1.5 KiB
Markdown

---
description: Identify C4-level code elements from components
argument-hint: [c3-components-json-path]
allowed-tools: Task, Read, Bash
---
Analyze components and identify C4 code elements using C4 Model methodology.
## Context
- Input: $1 (default: c3-components.json)
- Status: !`test -f ${1:-c3-components.json} && echo "✓ exists" || echo "✗ missing"`
- Prerequisites: !`test -f init.json && test -f c1-systems.json && test -f c2-containers.json && test -f c3-components.json && echo "✓ ready" || echo "✗ run /melly:init, /melly:c1-systems, /melly:c2-containers, and /melly:c3-components first"`
## Workflow
**1. Validate Prerequisites**
Check that init.json, c1-systems.json, c2-containers.json, and c3-components.json exist.
If missing, inform user to run previous commands first.
**2. Launch c4-abstractor Agent**
Use Task tool to launch c4-abstractor agent:
- Input: c3-components.json path (${1:-c3-components.json})
- Agent will validate files, load c4model-c4 skill, analyze components, identify code elements, and generate c4-code.json
- Applies C4 methodology automatically
**3. Validate and Report**
After agent completion:
```bash
python3 ${CLAUDE_PLUGIN_ROOT}/validation/scripts/validate-c4-code.py c4-code.json
```
Report:
- Code elements identified (count and breakdown by type/component)
- Validation status
- Next step: /melly:doc-c4model
## Output
- **c4-code.json** - Code elements with observations, relations, metrics
- **Validation report** - Structure and relationship validation