/groundwork:source-architecture-from-codefrom groundwork
Keeps architecture.md synchronized with actual implementation decisions by analyzing codebase changes and session history.
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, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Keeps {{specs_dir}}/architecture.md synchronized with actual implementation decisions.
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 Sonnet or Opus. Otherwise ask via AskUserQuestion (header "Model check"; options "Continue anyway" / "Cancel — I'll switch first"):
"Do you want to switch? Architecture impact analysis from session changes benefits from consistent reasoning.
Recommended: Sonnet or Opus at high effort.
To switch: cancel, run
/effort high(and/model sonnetif on Haiku), 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}}/architecture.md{{specs_dir}}/architecture/ (content split across files)Detection: Check for a single file first (it takes precedence), then a directory. Read a directory as all its .md files recursively — _index.md first, then numerically-prefixed files, then alphabetically.
Run this skill at the end of a session in which:
/groundwork:source-architecture-from-codeReview the current session for:
Explicit Decisions:
Implicit Decisions (from implementation):
Deviations:
| Category | Signal | Single file section | Directory mode file |
|---|---|---|---|
| New component | New service/module created | §4 Component Details | 04-components/<component-slug>.md (new file) |
| Tech change | Different library/framework used | §3 System Overview, relevant DR | 03-system-overview.md or 11-decisions/DR-NNN.md |
| Data change | Schema migration, new store | §5 Data Architecture | 05-data.md |
| Integration | New external service | §6 Integration Architecture | 06-integration.md |
| Security | Auth/encryption changes | §7 Security Architecture | 07-security.md |
| Infra | New environment, deployment change | §8 Infrastructure | 08-infrastructure.md |
| Decision | Explicit "let's do X" statement | §11 Decision Records | 11-decisions/DR-NNN.md (new file) |
For each detected change, propose a specific update:
## Proposed Architecture Updates
### 1. New Decision Record
**Trigger:** You decided to use Redis for session caching instead of DynamoDB.
**Proposed addition to §11 Decision Records:**
### DR-00X: Session Cache Technology
**Status:** Accepted
**Date:** [today]
**Context:** [extracted from session]
**Options Considered:**
1. **DynamoDB** - Originally planned
- Pros: AWS native, no new service
- Cons: Overkill for simple key-value, higher latency
2. **Redis (ElastiCache)** - New choice
- Pros: Sub-millisecond latency, built for sessions
- Cons: Additional service to manage
**Decision:** Redis via ElastiCache
**Rationale:** [from session discussion]
---
### 2. Component Update
**Trigger:** Added new `NotificationService` module.
**Proposed addition to §4 Component Details:**
### 4.X Notification Service
**Responsibility:** Send transactional emails and push notifications
**Technology:** AWS SES + SNS
**Interfaces:**
- Exposes: Internal event handlers
- Consumes: EventBridge events
**Related Requirements:** PRD-XXX-REQ-NNN
---
Approve these updates? (yes/no/modify)
On approval:
{{specs_dir}}/architecture.md.md files from {{specs_dir}}/architecture/{{specs_dir}}/architecture.md directly{{specs_dir}}/architecture/11-decisions/<DR-NNN>.md{{specs_dir}}/architecture/04-components/<component>.md{{specs_dir}}/architecture/05-data.md{{specs_dir}}/architecture/07-security.mdImportant: Preserve existing content. Add to sections, don't replace unless explicitly correcting an error.
Skip this step if the architecture doc is already in directory mode.
After applying changes to the single-file architecture doc, 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/."If neither threshold is crossed, continue silently.
Strong signals (likely architectural):
Weak signals (maybe architectural):
Focus on strong signals. Ask about weak signals only if they seem significant.
When done, report:
## Architecture Sync Summary
**Session Date:** [date]
### Changes Detected:
1. [Change 1] → Proposed DR-00X
2. [Change 2] → Updated §4.3
3. [Change 3] → No architecture impact (implementation detail)
### Architecture Document:
- [X] Updated with approved changes
- [ ] No changes needed
- [ ] Changes pending user review
### Open Items:
- [Any unresolved architectural questions from session]
What 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 fix/design-architectureUse when the user asks to design system architecture, make architectural decisions, or translate PRD into technical design/design-it-twiceUse before committing to a non-trivial module, service boundary, or public API - generate 2-3 divergent interface designs, compare them on depth/locality/seam, and recommend oneGenerated from the plugin's indexed repository (etr/groundwork) — no native marketplace selected
npx claudepluginhub p/etr-groundworkOther plugins' skills for the same job