From devflow
Defines or updates the technical architecture for a project. Includes brownfield analysis of existing code, technology selection, system design, and Architecture Decision Records (ADRs). Use this after the PRD is defined to establish the technical design.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-4 --plugin codingthefuturewithai-claude-code-primitivesThis skill is limited to using the following tools:
**Say exactly:** "SKILL INVOKED: pm/define-architecture"
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Say exactly: "SKILL INVOKED: pm/define-architecture"
You are helping the user define or update the architecture for their project. This includes technology selection, system design, and capturing key decisions as Architecture Decision Records (ADRs).
Produce an architecture document and ADRs that describe HOW the system will be built at a high level — separate from the PRD (which describes WHAT). For brownfield projects, account for the existing system. For greenfield, make deliberate technology and design choices.
Load configuration: Read ~/.claude/plugins/config/devflow/config.md for available backends. Check .devflow/project.md for upstream artifacts (problem statement, PRD).
Find upstream artifacts: If a PRD exists (check project manifest), load it — the architecture must address all PRD functional requirements. If no PRD exists, ask the user for the information you need directly.
Check for team conventions: Use the convention-checker agent (via Task tool) to search configured doc backends for team conventions (output of capture-conventions). This is a quick, cheap lookup — the agent uses model haiku for speed. If conventions are found, the agent returns relevant sections. If not found, proceed without them. Conventions are context, not constraints.
Analyze existing system (brownfield): If there's an existing codebase, use the brownfield-analyzer agent (via Task tool) to analyze the existing architecture — tech stack, project structure, key dependencies, integration points, existing patterns, code health. This is heavy codebase reading that MUST be a subagent to preserve main context.
Steps 3 and 4 can run in parallel — convention-checker searches external doc backends, brownfield-analyzer reads the codebase. Fully independent. Use two Task tool calls simultaneously.
Follow the ingestion workflow: If the user has existing architecture docs, read references/ingestion-guide.md for the multi-source ingestion approach.
Guide the design: Use references/architecture-template.md as the structural guide. Work through technology selection, component design, data model, API design. For technology research, use the tech-researcher agent (via Task tool) to look up current documentation via Context7 MCP — this prevents Context7 tokens from filling the main context. Use Mermaid MCP for architecture diagrams.
Capture decisions as ADRs: For each significant decision, prompt: "This seems like a significant decision. Create an ADR for it?" Use references/adr-template.md for structure.
Check for scaffolding need (greenfield only): Detect whether source code exists:
ls -la and check for framework indicators (composer.json, package.json, Cargo.toml, etc.).devflow/ exists but NO source code → user is in planning directory (Path A)"I see you've defined the architecture but no codebase exists yet.
Would you like me to:
1. Scaffold [Framework] now and migrate .devflow/ for you
2. Give you the scaffold command to run manually
3. Skip scaffolding (you'll do it later)"
mv .devflow ../[project-name]/ after scaffoldingStore and baseline: Present storage options. Store architecture doc and ADRs. Update .devflow/project.md. If you migrated .devflow/, update paths to reflect new location.
Skill complete.