Systematically explore and document a subsystem for the compound engineering knowledge base
Analyzes a code subsystem to document its structure, dependencies, and gaps for engineering knowledge.
npx claudepluginhub mberto10/mberto-compound<system/subsystem e.g. backend/api or frontend/auth>Systematically explore and document a subsystem for the compound engineering knowledge base.
System: $ARGUMENTS (format: system/subsystem, e.g., backend/api or frontend/first-value)
If no argument provided, ask the user which subsystem to explore.
All subsystem specs are stored in the project root at subsystems_knowledge/. This folder is repo-specific and persists independently of the plugin installation, so each project maintains its own knowledge base.
subsystems_knowledge/
├── backend/
│ ├── workflow.yaml
│ ├── validation.yaml
│ └── ...
├── design-system/
│ └── ...
└── frontend/
└── ...
If subsystems_knowledge/ does not exist yet in this project, create it before proceeding.
Read the project's architecture document (if it exists) to understand:
Check for architecture docs at common locations:
architecture.mddocs/architecture.mdCLAUDE.md (project instructions)Identify the exact files owned by this subsystem.
For Backend/Design System (technical subsystems):
For Frontend (goal-oriented subsystems):
Output: List of owned files with brief purpose annotations.
Inbound (what this subsystem depends on):
Outbound (what depends on this subsystem):
Output: Dependency graph showing subsystem relationships.
Find 3-10 statements that MUST remain true for this subsystem. Look for:
Sources:
Output: Numbered list of invariants.
Against the current milestone, evaluate:
| Aspect | Status | Evidence |
|---|---|---|
| Core functionality works | ||
| Error handling complete | ||
| Happy path tested | ||
| Edge cases handled | ||
| Integration with dependents verified |
Milestone mapping:
Output: Current milestone state with evidence.
List specific items missing to reach the next milestone:
Gaps:
- [ ] GAP-001: [Description] - blocks [functionality]
- [ ] GAP-002: [Description] - blocks [functionality]
Prioritize by:
Output: Prioritized gap list with blocking relationships.
Create or update a YAML spec file at subsystems_knowledge/{system}/{subsystem}.yaml:
id: {subsystem}
system: {system}
owners: []
description: |
Brief description of the subsystem's purpose and responsibility.
architecture:
overview: |
High-level diagram showing how this subsystem fits into the larger system.
components: |
For each major component, show its internal structure.
data_flow: |
Show a complete request/response flow through the subsystem.
paths:
owned:
- {glob patterns}
public_api:
- {exported interfaces}
dependencies:
compile_time: []
runtime: []
data: []
config: []
dependents: []
invariants:
- "{invariant 1}"
- "{invariant 2}"
tests:
tier0: "{unit test command}"
tier1: "{contract test command}"
tier2: "{integration test command}"
milestone:
current: {concept|prototype|alpha|beta|production}
target: alpha
recently_fixed: []
gaps:
- id: GAP-001
type: {feature|bugfix|optimization}
title: "{title}"
priority: {1-5}
blocks: ["{other gaps or subsystems}"]
done_when: "{acceptance criteria}"
helpful_skills: []
When creating the architecture section, follow these principles:
Use box-drawing characters for clean visuals:
+ - or unicode- | or unicode--> or unicodeShow decision points where behavior branches
Label data transformations between steps
Include key constraints inline
For complex subsystems, create multiple diagrams:
overview: System integration view{component_name}: Per-component detaildata_flow: End-to-end request traceOutput a markdown summary:
# Subsystem Exploration: {system}/{subsystem}
## Overview
- **Path Pattern:** {paths}
- **Current State:** {milestone}
## Key Findings
- {finding 1}
- {finding 2}
## Dependencies
- **Depends on:** {list}
- **Depended on by:** {list}
## Invariants
1. {invariant}
2. {invariant}
## Gaps ({count})
| ID | Title | Priority | Blocks |
|----|-------|----------|--------|
| | | | |
## Recommended Next Steps
1. {step}
2. {step}
After exploration, you should have:
subsystems_knowledge/{system}/{subsystem}.yaml specsubsystems_knowledge/ if it doesn't exist