/groundwork:design-architecture [feature-name]from groundwork
Guides architectural decision-making by translating PRDs into technical designs through iterative trade-off analysis and ADR-style documentation.
Ships in groundwork. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Interactive workflow for translating product requirements into architecture through iterative decision-making.
{{specs_dir}}/product_specs.md (PRD with EARS requirements){{specs_dir}}/architecture.md (architecture document with decisions)Anchor decisions on the named principles in ${CLAUDE_PLUGIN_ROOT}/references/engineering-principles.md — favor deep modules (simple interface, substantial functionality), minimize the surface Hyrum's Law will freeze into a contract, and design it twice before committing to a module boundary. When a decision passes the decision-record gate (in the principles file), record it using the Decision Record Format (ADR-lite) below. Sharpen the shared vocabulary with [[domain-modeling]].
Your current effort level is {{effort_level}}. Skip this step silently if effort is high, xhigh, or max (the scale is low < medium < high < xhigh < max, so xhigh and max are already above high) AND you are Opus (1M context). Otherwise ask via AskUserQuestion (header "Model check"; options "Continue anyway" / "Cancel — I'll switch first"):
"Do you want to switch? Cross-decision conflict detection and trade-off synthesis across NFRs benefit from deeper reasoning.
Recommended: Opus (1M context) at high effort.
To switch: cancel, run
/model opus[1m]and/effort high, then re-invoke this skill."
If the user selects "Cancel — I'll switch first": output the switching commands and stop. Do not proceed with the skill. Ask once per conversation: a skill invoked by another skill skips this step when the recommendation was already shown. In a non-interactive run (--noninteractive, GROUNDWORK_RUNNER_MODE=true, or GROUNDWORK_BATCH_MODE=true), skip the prompt and continue on the current model.
.groundwork.yml exist at the repo root?
{{project_name}} non-empty?
Skill(skill="groundwork:select-project") to select a project, then restart this skill.{{project_name}}, specs at {{specs_dir}}/.--project.
.groundwork.yml: the repo root or the selected project's path → fine, proceed; no project's path → proceed without warning (shared directory).--noninteractive, keep the selected project and continue; otherwise warn via AskUserQuestion:
"You're working from
<cwd>(inside [cwd-project]), but the selected Groundwork project is [selected-project] ([selected-project-path]/). What would you like to do?"
- "Switch to [cwd-project]"
- "Stay with [selected-project]" If the user switches, invoke
Skill(skill="groundwork:select-project").
{{specs_dir}}/: Does a specs directory exist?
{{specs_dir}}/).Skill(skill="groundwork:setup-repo") to create .groundwork.yml, then continue.Read the product specs (may be single file or directory) and extract:
Detection: Check for a single file first (it takes precedence), then a directory ({{specs_dir}}/product_specs.md, then {{specs_dir}}/product_specs/). Read a directory as all its .md files recursively — _index.md first, then numerically-prefixed files, then alphabetically.
If PRD doesn't exist, prompt user to run /groundwork:design-product first.
On a repeat run, load the existing architecture first. When {{specs_dir}}/architecture.md (or the {{specs_dir}}/architecture/ directory) already exists, read its decision records and its section 12 before deciding anything. Settled decisions are constraints, not candidates to re-litigate; the open decisions and fog recorded there are this session's agenda, in order.
Summarize key architectural drivers:
"Based on your PRD, the key architectural drivers are:
- [Driver 1 from NFRs]
- [Driver 2 from features] I'll need to make decisions about [list 3-5 major areas]. Let's start with [most foundational one]."
Common architectural decision categories:
| Category | Example Decisions |
|---|---|
| Compute | Serverless vs containers vs VMs, orchestration |
| Data | Database type, multi-tenancy strategy, caching |
| API | REST vs GraphQL, gateway pattern, versioning |
| Frontend | SPA vs SSR, framework choice, state management |
| Auth | Identity provider, token strategy, authorization model |
| Integration | Sync vs async, message queues, event sourcing |
| Infrastructure | Cloud provider, IaC approach, environments |
| Observability | Logging, metrics, tracing, alerting |
| Security | Encryption, network isolation, secrets management |
| Cost | Pricing model alignment, reserved vs on-demand |
Prioritize decisions by dependency (foundational first).
Before presenting decision options, gather research on relevant technologies.
For each decision area identified:
Identify the primary technologies/frameworks being considered
Invoke the researcher agent:
Agent(
subagent_type="groundwork:researcher:researcher",
prompt="Research Topic: [technology]
Research Questions:
- What is the stable vs latest version?
- What is the recommended ecosystem for [use case]?
- What are common architectural pitfalls?
- What has been deprecated recently?
Project Context: [from PRD]
Constraints: [from user/PRD]"
)
Use research findings to:
Research Integration: When presenting options in Step 4, incorporate research findings:
For each decision point, present 2-4 options using this format:
## Decision: [Decision Name]
**Context:** [Why this decision matters, link to PRD requirements]
### Option A: [Name]
**Description:** [1-2 sentences]
**Pros:**
- [Pro 1, ideally linked to PRD requirement]
- [Pro 2]
**Cons:**
- [Con 1, note if it conflicts with PRD requirement]
- [Con 2]
**Cost implications:** [Rough estimate if relevant]
### Option B: [Name]
[Same structure]
### Option C: [Name] (if applicable)
[Same structure]
**My recommendation:** [Option X] because [reasoning tied to PRD].
What are your thoughts? Any constraints I should know about?
Presentation style:
When presenting options, ask questions to surface hidden constraints:
Before recording a decision, check for conflicts with earlier decisions:
Check against existing decisions:
If conflict detected:
"This decision may conflict with DR-NNN:
- DR-NNN chose [X] for [reason]
- This decision would require [Y], which is incompatible because [explanation]
Options:
- Proceed with new decision and update DR-NNN
- Modify this decision to align with DR-NNN
- Accept both and document the exception
Which approach?"
After user input:
Steps 3–4 chose what to build with. For any non-trivial new module, service boundary, or public API in this design, also decide how the interface is shaped — and your first shape is rarely the best.
Invoke Skill(skill="groundwork:design-it-twice"): frame the problem, generate 2–3 divergent designs (parallel Agent fan-out when available, sequential otherwise — no agent teams needed), compare them on depth / locality / seam, and carry an opinionated recommendation into the decision records. Skip for designs with no non-trivial new interface.
When all major decisions are made, write the architecture document using template in ${CLAUDE_PLUGIN_ROOT}/references/architecture/architecture-template.md — created on a first run, updated in place on a repeat run (earlier decision records stay; each open decision or patch of fog this session settled leaves section 12 and becomes a decision record).
Output location: {{specs_dir}}/architecture.md (single file by default)
Critical: Include every decision record that passes the gate — no fewer — each with its discarded options and reasoning. This is essential for future maintainers to understand why choices were made.
Write it in the project's domain language: when {{specs_dir}}/glossary.md exists, use its canonical terms and honor its Avoid lists, in decision records and component names alike. A concept the glossary lacks is one to flag for [[domain-modeling]], not a synonym to invent.
Record what you couldn't settle. Fill section 12 honestly: every question this session left unresolved goes in as an open decision (sharp enough to state precisely) or fog (sensed but not yet phraseable — never pre-sliced into fake-sharp questions). A question silently resolved to move on is a decision record without its rationale, and the next session will re-litigate it blind. An effort whose fog outweighs its decisions is too large for one session — say so in the document and route it through the lifecycle router rather than forcing task creation.
Present the complete document for review before writing.
Before writing the architecture document, validate it against the PRD:
Invoke the prd-architecture-checker agent with draft architecture content and PRD content:
Agent(
subagent_type="groundwork:prd-architecture-checker:prd-architecture-checker",
prompt="Validate architecture against PRD
Architecture Draft: [full draft content]
PRD Content: [product_specs.md content]
Feature List: [extracted features]
NFR List: [extracted NFRs]
Constraints: [budget, timeline, team from PRD]"
)
If verdict is request-changes:
If verdict is approve:
{{specs_dir}}/architecture.mdSkip this step if the architecture doc is already in directory mode.
After writing the architecture document, check whether it should be split:
wc -l {{specs_dir}}/architecture.md### DR-\d+ headings in the fileIf lines >= 500 OR decision records >= 10:
Skill(skill="groundwork:split-architecture") — this runs automatically with no user input needed.{{specs_dir}}/architecture/ for easier navigation."If neither threshold is crossed, continue silently.
After successfully updating the architecture document, ask what should be the next workflow step:
{
"questions": [{
"question": "What would you like to do next?",
"header": "Next step",
"options": [
{
"label": "Design UX",
"description": "Plan user experience designs and flows"
},
{
"label": "Create tasks",
"description": "Break product/architecture/UX down into tasks"
}
],
"multiSelect": false
}]
}
Handle the response:
/groundwork:ux-design (a user-run skill) to create UX designs, and stop/groundwork:create-tasks (a user-run skill) to create a list of executable tasks, and stopBefore offering Create tasks, check section 12: when open decisions remain that the tasks would depend on, say so in the question. Tasks built on an open decision are guesses; the next step is another design session that settles them first.
Record a decision only when it passes the decision-record gate (${CLAUDE_PLUGIN_ROOT}/references/engineering-principles.md): hard to reverse, surprising without context, and a real trade-off — otherwise just implement it. Each qualifying decision is captured inline in the architecture doc (no separate ADR files — housekeeper keeps these current) using this format:
### DR-NNN: [Decision Title]
**Status:** Accepted | Superseded by DR-XXX | Deprecated
**Date:** YYYY-MM-DD
**Context:** [Why this decision was needed]
**Options Considered:**
1. **[Option A]** - [Brief description]
- Pros: [list]
- Cons: [list]
2. **[Option B]** - [Brief description]
- Pros: [list]
- Cons: [list]
**Decision:** [Chosen option]
**Rationale:** [Why this option was selected, referencing PRD requirements]
**Consequences:**
- [Implication 1]
- [Implication 2]
${CLAUDE_PLUGIN_ROOT}/references/architecture/architecture-template.md - Template for architecture document${CLAUDE_PLUGIN_ROOT}/references/architecture/decision-examples.md - Example decision records from real projectsWhat SKILL.md sets; muted values are Claude Code's defaults
44 skills in this plugin
/build-unplannedBuild a feature from a description with worktree isolation and TDD. Optional flag - --on-unrelated-failure stop-and-ask|expand-and-fix|ignore-and-merge - how validation treats gate failures unrelated to the active project (default stop-and-ask)./check-specs-alignmentVerify alignment between code and specs./create-tasksGenerate implementation tasks from architecture document./debugUse when investigating bugs, unexpected behavior, test failures, or any code that does not work as expected - enforces systematic root cause analysis before any fixGenerated from the plugin's indexed repository (etr/groundwork) — no native marketplace selected
npx claudepluginhub p/etr-groundworkOther plugins' skills for the same job