mayurpise/draft/decompose
Claude Code and agent skill by mayurpise/draft
- community
Checking that the SKILL.md file is still in the repository.
Decompose project or track into modules with dependency mapping. Project scope updates architecture.md and derives .ai-context.md. Track scope generates hld.md (always) and lld.md (when --lld or High-complexity module triggers it) — design-mandated artifacts that drive implement, deploy-checklist, and upload sign-off.
Install
npx vskill@latest install mayurpise/draft/decomposeSKILL.md
The same SKILL.md was published earlier as mayurpise/draft/decompose.
Decompose
You are decomposing a project or track into modules with clear responsibilities, dependencies, and implementation order.
MANDATORY GRAPH LOOKUP (read before any analysis)
First resolve the bundled helpers:
When draft/graph/schema.yaml exists, this skill must follow the graph-first lookup contract in core/shared/graph-query.md §Mandatory Lookup Contract. Module identification (Step 3) and dependency mapping (Step 4) start from the graph:
- Query
"$DRAFT_TOOLS/graph-arch.sh" --repo .for the authoritative module list and fan-in/out. - Run
"$DRAFT_TOOLS/hotspot-rank.sh" --repo .to identify candidate modules to split. - Use
"$DRAFT_TOOLS/graph-callers.sh"/"$DRAFT_TOOLS/graph-impact.sh"on demand for symbols/callers inside a candidate module. - Run
"$DRAFT_TOOLS/cycle-detect.sh" --repo .to enumerate existing cycles before proposing new boundaries.
Filesystem grep/find for module discovery is only permitted after a documented graph miss, using the fallback sentence Graph returned no match for <X>; falling back to grep. and recorded in the Graph Usage Report.
Red Flags - STOP if you're
See shared red flags — applies to all code-touching skills. In particular, the Ground-Truth Red Flags are load-bearing for decompose: HLD/LLD are design-mandated artifacts and TBD citations on Modified modules fail review.
Template contract: HLD/LLD/Plan emissions conform to core/shared/template-contract.md and core/shared/template-hygiene.md. The _TBD_<field>_ sentinel convention replaces Author1 / xxx@example.com / [name] placeholders. After decompose runs, the verification gate chain in core/shared/verification-gates.md must pass clean on the regenerated set. Plan.md must back-link to ./discovery.md Phase 0 (Hotspots row IDs) per core/shared/discovery-schema.md.
Skill-specific:
- Defining modules without understanding the codebase
- Creating modules with circular dependencies
- Making modules too large (>3 files, excluding test files) or too small (single function)
- Skipping dependency analysis
- Not waiting for developer approval at checkpoints
- Emitting
Citation: TBDfor a module markedStatus: ModifiedorStatus: Existing(see §Step 5 Mandatory Citation Gate below) - Leaving HLD §Checklist sections (Performance / Scale / Security / Resiliency / Multi-tenancy / Upgrade / Cost) as raw
-placeholders instead of structured TBD bullets (see §Step 5a Checklist Scaffolding)
Standard File Metadata
ALL generated files MUST include the standard YAML frontmatter. This enables refresh tracking, sync verification, and traceability.
Gathering Git Information
Use the deterministic git-metadata.sh script (preferred) or the manual commands — both documented in core/shared/git-report-metadata.md, which contains the canonical resolver pattern for locating the script in any install layout. Both produce the same field set used in the YAML template below.
For track-scoped decomposition, also derive the human-readable track title used in the hld.md / lld.md H1:
{TRACK_TITLE}— first-level heading text from the active track'sspec.md(the# ...line). Ifspec.mdhas no H1, fall back to the{TRACK_ID}.
Also extract from spec.md frontmatter:
classification.criticality,classification.data_classification,classification.deployment_surface— copy verbatim into hld.md frontmatter.approvers.*— pre-fill the HLD Approvals table (tech_leads, arb_leads, cloudops_leads, qa_leads, pm_leads) and LLD Approvals table (team_leads, tech_leads, qa). If a field is empty in spec.md, leave the table cell empty — do not invent names.
Metadata Template
Insert this stable YAML frontmatter at the top of every generated file. Git state lives in tracks/<track_id>/metadata.json — never in per-file frontmatter (WS-8).
Note:generated_byusesdraft:commandformat (not/draft:command) for cross-platform compatibility.After writing HLD/LLD, updatetracks/<track_id>/metadata.jsonwith current git state andsynced_to_commit.
Step 1: Determine Scope
Parse $ARGUMENTS for flags first, then strip them before interpreting the remaining text as scope:
--lld→ LLD mode — generate Section 6 (Low-Level Design) in addition to HLD. Strip from arguments before scope detection.
Scope detection (on stripped arguments):
projector no argument with no active track → Project-wide decomposition →draft/architecture.md+draft/.ai-context.md- Track ID or active track exists → Track-scoped decomposition →
draft/tracks/<id>/hld.md(always) +draft/tracks/<id>/lld.md(when triggered)
LLD auto-trigger: Even without --lld, LLD is generated automatically when any module in Step 3 is marked Complexity: High. Tell the developer when this triggers: "One or more modules are High complexity — generating LLD automatically."
No legacy `track-architecture.md`: That artifact has been retired. New tracks always use hld.md (and lld.md when triggered). Existing tracks that have a track-architecture.md are not migrated automatically — leave them alone; new tracks get the new format.
Pre-Generation Sanity Checks (Track-Scoped Only)
Before Step 2, run these checks and prompt the developer when triggered. Do not silently proceed.
- Spec readiness — read
draft/tracks/<id>/spec.mdfrontmatter and first 20 lines:
- If
spec.mdis missing → ERROR: "No spec.md for track<id>. Run/draft:new-trackfirst." Halt. - If
spec.mdcontainsStatus: [ ] Draftingorspec-draft.mdstill exists → WARN: "Spec for<id>is still in draft. HLD generated against a draft spec will need rework. Continue anyway? [y/N]" — default No. - If
classification.criticalityis unset or still placeholder ({...}) → WARN: "Classification not set in spec.md frontmatter — HLD Approvals gate (/draft:upload) will not engage correctly for high-criticality tracks. Continue? [y/N]".
- Existing artifacts — check what already exists:
- If
hld.mdexists → ASK: "hld.mdalready exists for<id>. (1) Overwrite, (2) Skip HLD and only generate LLD, (3) Cancel." Default (3). - If
lld.mdexists and LLD will be regenerated → ASK same 3-way choice.
Only proceed to Step 2 after the developer resolves each prompt.
Step 2: Load Context
- Read
draft/product.mdfor product understanding - Read
draft/tech-stack.mdfor technical patterns - If track-scoped:
- Read track's
spec.mdfor requirements - Read track's
plan.mdfor existing task breakdown
For brownfield projects, scan the existing codebase using these concrete steps:
Codebase Scanning Patterns
Directory structure — Map top-level organization:
Entry points — Find main files and exports:
- Look for:
index.ts,main.ts,app.ts,mod.rs,__init__.py,main.go - Check
package.jsonmain/exportsfields,pyproject.tomlentry points,go.modmodule path
Existing module boundaries — Identify by:
- Directory-per-feature patterns (e.g.,
src/auth/,src/users/) - Package files (
package.jsonin subdirs,__init__.py,gopackage declarations) - Barrel exports (
index.tsre-exporting from a directory)
Dependency patterns — Trace imports:
- Search for
import/require/fromstatements across source files - Identify which directories import from which other directories
- Flag cross-cutting imports (e.g.,
utils/imported everywhere)
File type filters by language:
| Language | Source Extensions | Config Files | |
|---|---|---|---|
| TypeScript/JS | *.ts, *.tsx, *.js, *.jsx | tsconfig.json, package.json | |
| Python | *.py | pyproject.toml, setup.py, requirements.txt | |
| Go | *.go | go.mod, go.sum | |
| Rust | *.rs | Cargo.toml |
What to ignore: node_modules/, __pycache__/, target/, dist/, build/, .git/, vendored dependencies. Always respect .gitignore and .claudeignore.
Graph-Accelerated Discovery (MANDATORY when draft/graph/ exists)
When graph data is available, the graph is the primary (not optional) source for module discovery — manual scanning above is reserved for the graph-miss fallback path:
- Module boundaries: Query
"$DRAFT_TOOLS/graph-arch.sh" --repo .— module list with node counts and per-language file counts - Dependency edges: Weighted inter-module dependencies with exact include counts — replaces manual import tracing
- Cycle detection: Circular dependency paths already computed — use for identifying tight coupling and decomposition candidates
- Hotspots: Run
"$DRAFT_TOOLS/hotspot-rank.sh" --repo .— high-complexity files that may need further decomposition - Per-module detail: query
"$DRAFT_TOOLS/graph-callers.sh"/"$DRAFT_TOOLS/graph-impact.sh"for symbol/call detail within modules of interest
This data is deterministic and exhaustive. The manual scanning recipes above only run after the graph misses on the concept the user named — and the miss must be reported in the Graph Usage Report footer. See core/shared/graph-query.md §Concept-to-Files Recipe.
Step 3: Module Identification
Propose a module breakdown through dialogue:
For each module, define:
- Name - Short, descriptive identifier
- Responsibility - One sentence: what this module owns
- Files - Expected source files (existing or to be created)
- API Surface - Public functions, classes, or interfaces
- Dependencies - Which other modules it imports from
- Complexity - Low / Medium / High
Module Guidelines (see core/agents/architect.md)
- Each module should have a single responsibility
- Target 1-3 files per module
- Every module needs a clear API boundary
- Minimal Coupling — communicate through interfaces, not internals
- Modules should be testable in isolation
- Each module typically contains: API, control flow, execution state, functions
CHECKPOINT (MANDATORY)
STOP. Present the module breakdown to the developer.
Wait for developer approval. Developer may add, remove, rename, or reorganize modules.
Step 4: Dependency Mapping
After modules are approved:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/decompose/SKILL.md
Popularity
- Repository stars
- 39
- Repository forks
- 5
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mayurpise/draft/decompose)