/groundwork:source-product-specs-from-codefrom groundwork
Synchronizes product specification documents (PRDs) with codebase changes made during a session. Useful for keeping product specs up to date with implementation decisions.
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}}/product_specs.md synchronized with product decisions made during sessions.
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? Session change detection and EARS requirement update quality 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}}/product_specs.md{{specs_dir}}/product_specs/ (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-product-specs-from-codeReview the current session for:
New Requirements:
Requirement Changes:
Scope Changes:
New Edge Cases:
| Category | Signal | Single file section | Directory mode file |
|---|---|---|---|
| New feature | Discussion of new capability | §3 Feature List (new subsection) | 03-features/<feature-code>.md (new file) |
| New requirement | "System should..." statements | §3.X EARS Requirements | 03-features/<feature-code>.md (existing file) |
| Requirement change | Modifying existing behavior | §3.X EARS Requirements (edit) | 03-features/<feature-code>.md (edit) |
| NFR change | Performance, security, scale discussion | §2 Non-functional | 02-non-functional.md |
| Scope change | "Out of scope" or "must have for launch" | §3.X In/Out of scope | 03-features/<feature-code>.md (edit) |
| Open question | Unresolved product decision | §5 Open Questions | 05-open-questions.md |
| Question resolved | Answer to existing OQ | §5 Open Questions (remove) | 05-open-questions.md (remove) |
For each detected change, propose a specific update:
## Proposed PRD Updates
### 1. New Requirement
**Trigger:** You discussed that artists should be warned before their quota expires.
**Proposed addition to §3.3 Monetization:**
- `PRD-MON-REQ-005` When artist quota falls below 10% remaining then the system shall send a warning notification via email.
---
### 2. Requirement Modification
**Trigger:** Changed impersonation lockout from N to 5 attempts.
**Current:**
- `PRD-IMP-REQ-008` When impersonation attempts exceed N per day by same user then the system shall lock account pending admin review.
**Proposed:**
- `PRD-IMP-REQ-008` When impersonation attempts exceed 5 per day by same user then the system shall lock account pending admin review.
---
### 3. New Open Question
**Trigger:** Unresolved discussion about handling rate limits.
**Proposed addition to §5:**
- `OQ-008` How should the system handle rate-limited users - queue requests or reject immediately?
---
### 4. Scope Change
**Trigger:** Multi-artist collaborative models deferred to v2.
**Proposed update to §3.1 Out of scope:**
Add: "Multi-artist collaborative models (deferred to v2)"
---
Approve these updates? (yes/no/modify)
On approval:
{{specs_dir}}/product_specs.md.md files from {{specs_dir}}/product_specs/{{specs_dir}}/product_specs.md directly{{specs_dir}}/product_specs/03-features/<feature-code>.md{{specs_dir}}/product_specs/05-open-questions.md{{specs_dir}}/product_specs/02-non-functional.mdImportant:
Skip this step if the PRD is already in directory mode.
After applying changes to the single-file PRD, check whether it should be split:
wc -l {{specs_dir}}/product_specs.md### \d+\.\d+ headings in the fileIf lines >= 500 OR features >= 15:
Skill(skill="groundwork:split-specs") — this runs automatically with no user input needed.{{specs_dir}}/product_specs/."If neither threshold is crossed, continue silently.
All requirements must follow EARS syntax:
| Pattern | Template |
|---|---|
| Event-Driven | When <trigger> then the system shall <response> |
| State-Driven | While <state> the system shall <behavior> |
| Unwanted | If <condition> then the system shall <mitigation> |
| Optional | Where <feature enabled> the system shall <behavior> |
Strong signals (likely PRD change):
Weak signals (maybe PRD change):
Focus on strong signals. For weak signals, ask: "Should this be captured as a product requirement, or is it an implementation/design detail?"
When done, report:
## PRD Sync Summary
**Session Date:** [date]
### Changes Detected:
1. [Change 1] → New requirement PRD-XXX-REQ-NNN
2. [Change 2] → Modified PRD-YYY-REQ-NNN
3. [Change 3] → Added open question OQ-NNN
4. [Change 4] → No PRD impact (implementation detail)
### PRD Document:
- [X] Updated with approved changes
- [ ] No changes needed
- [ ] Changes pending user review
### Requirement IDs Added/Modified:
- PRD-XXX-REQ-NNN (new)
- PRD-YYY-REQ-NNN (modified)
### Open Items:
- [Any unresolved product questions from session]
This skill works in concert with:
/groundwork:design-product - For deliberate, interactive requirement creation/groundwork:source-architecture-from-code - PRD changes may trigger architecture updatesWhen both /groundwork:source-product-specs-from-code and /groundwork:source-architecture-from-code run:
/groundwork:source-product-specs-from-code first (product drives architecture)/groundwork:source-architecture-from-code with awareness of PRD changesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (etr/groundwork) — no native marketplace selected
npx claudepluginhub p/etr-groundwork44 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 oneOther plugins' skills for the same job