From groundwork
Synchronizes architecture document with codebase changes. Includes monorepo project context resolution and effort-level checks for optimal model usage.
How this skill is triggered — by the user, by Claude, or both
Slash command
/groundwork:source-architecture-from-code [files...][files...]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Keeps `{{specs_dir}}/architecture.md` synchronized with actual implementation decisions.
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.
If effort is low or medium (i.e. below high), you MUST show the recommendation prompt — regardless of model.
If you are not Sonnet or Opus, you MUST show the recommendation prompt - regardless of effort level.
Otherwise → use AskUserQuestion:
{
"questions": [{
"question": "Do you want to switch? Architecture impact analysis from session changes benefits from consistent reasoning.\n\nTo switch: cancel, run `/effort high` (and `/model sonnet` if on Haiku), then re-invoke this skill.",
"header": "Recommended: Sonnet or Opus at high effort",
"options": [
{ "label": "Continue" },
{ "label": "Cancel — I'll switch first" }
],
"multiSelect": false
}]
}
If the user selects "Cancel — I'll switch first": output the switching commands above and stop. Do not proceed with the skill.
Before loading specs, ensure project context is resolved:
.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}}/..groundwork.yml).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}}/ paths will resolve to the correct location.{{specs_dir}}/architecture.md{{specs_dir}}/architecture/ (content split across files)Detection: Check for single file first (takes precedence), then directory.
This skill should activate when:
/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.
At session end, provide summary:
## 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]
npx claudepluginhub etr/groundworkGenerates or refreshes architecture documentation (Arc42/C4) for Python/TypeScript projects. Automatically maps modules, entry points, and change focus into docs/overview/.
Scans a codebase, interviews the developer, and produces a shareable architecture insights document. Use when assessing architecture, determining direction, or auditing drift.
Builds and maintains ARCHITECTURE.md and DETAILED_DESIGN.md incrementally with coverage tracking. Principal mode analyzes vision, bottlenecks, gaps, and alternatives.