specjig 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/LICENSE +24 -0
- package/README.md +106 -2
- package/bin/specjig.mjs +7 -0
- package/harness.lock.json +61 -0
- package/package.json +54 -4
- package/src/cli.mjs +278 -0
- package/src/lib/install.mjs +242 -0
- package/src/lib/openspec.mjs +83 -0
- package/src/lib/util.mjs +86 -0
- package/templates/.claude/hooks/sdd-commit-guard.mjs +39 -0
- package/templates/.claude/hooks/sdd-fix-mode-guard.mjs +34 -0
- package/templates/.claude/hooks/sdd-lib/change-id.mjs +47 -0
- package/templates/.claude/hooks/sdd-lib/io.mjs +29 -0
- package/templates/.claude/hooks/sdd-lib/patterns.mjs +130 -0
- package/templates/.claude/hooks/sdd-prompt-guard.mjs +17 -0
- package/templates/.claude/hooks/sdd-protect-secrets.mjs +32 -0
- package/templates/.claude/rules/openspec.md +14 -0
- package/templates/.claude/rules/security.md +31 -0
- package/templates/.claude/rules/test-data.md +22 -0
- package/templates/.claude/settings.json +97 -0
- package/templates/.claude/skills/change-pr/SKILL.md +61 -0
- package/templates/.claude/skills/spec-challenge/SKILL.md +63 -0
- package/templates/.claude/skills/spec-compaction/SKILL.md +47 -0
- package/templates/.claude/skills/trace-why/SKILL.md +30 -0
- package/templates/.githooks/commit-msg +4 -0
- package/templates/.github/workflows/sdd-ci-triage.yml +61 -0
- package/templates/.github/workflows/sdd-confluence-sync.yml +24 -0
- package/templates/.github/workflows/sdd-drift-check.yml +50 -0
- package/templates/.github/workflows/sdd-fix-pr-guard.yml +25 -0
- package/templates/.github/workflows/sdd-release-notes.yml +45 -0
- package/templates/.github/workflows/sdd-security-review.yml +23 -0
- package/templates/.github/workflows/sdd-spec-gate.yml +23 -0
- package/templates/.github/workflows/sdd-spec-review.yml +51 -0
- package/templates/.mcp.json +8 -0
- package/templates/.sdd/harness.json +21 -0
- package/templates/.sdd/scripts/check-commit-msg.mjs +15 -0
- package/templates/.sdd/scripts/check-trailers.mjs +27 -0
- package/templates/.sdd/scripts/confluence-sync.mjs +110 -0
- package/templates/.sdd/scripts/drift-check.mjs +30 -0
- package/templates/.sdd/scripts/fix-pr-guard.mjs +17 -0
- package/templates/.sdd/scripts/lib.mjs +31 -0
- package/templates/.sdd/scripts/release-notes.mjs +63 -0
- package/templates/AGENTS.md +87 -0
- package/templates/CLAUDE.md +30 -0
- package/templates/openspec/config.yaml +38 -0
- package/templates/openspec/schemas/sdd/schema.yaml +379 -0
- package/templates/openspec/schemas/sdd/templates/design.md +29 -0
- package/templates/openspec/schemas/sdd/templates/impact.md +27 -0
- package/templates/openspec/schemas/sdd/templates/proposal.md +43 -0
- package/templates/openspec/schemas/sdd/templates/spec.md +13 -0
- package/templates/openspec/schemas/sdd/templates/tasks.md +15 -0
- package/templates/openspec/schemas/sdd/templates/tests.md +17 -0
- package/vendor/skills/grilling/.upstream.json +8 -0
- package/vendor/skills/grilling/SKILL.md +30 -0
- package/vendor/skills/receiving-code-review/.upstream.json +8 -0
- package/vendor/skills/receiving-code-review/SKILL.md +205 -0
- package/vendor/skills/systematic-debugging/.upstream.json +8 -0
- package/vendor/skills/systematic-debugging/SKILL.md +283 -0
- package/vendor/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/vendor/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/vendor/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/vendor/skills/systematic-debugging/find-polluter.sh +72 -0
- package/vendor/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/vendor/skills/test-driven-development/.upstream.json +8 -0
- package/vendor/skills/test-driven-development/SKILL.md +330 -0
- package/vendor/skills/test-driven-development/writing-good-tests.md +198 -0
- package/vendor/skills/two-axis-review/.upstream.json +8 -0
- package/vendor/skills/two-axis-review/SKILL.md +89 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@AGENTS.md
|
|
2
|
+
|
|
3
|
+
<!-- Project-owned: add Claude-specific notes above or below the specjig block. -->
|
|
4
|
+
|
|
5
|
+
<!-- specjig:begin -->
|
|
6
|
+
## Claude Code specifics
|
|
7
|
+
|
|
8
|
+
Skills installed by the harness (in `.claude/skills/`):
|
|
9
|
+
|
|
10
|
+
| Need | Skill |
|
|
11
|
+
|------|-------|
|
|
12
|
+
| Stress-test a plan or a change proposal | `grilling`, `spec-challenge` (proposal + delta specs, high risk) |
|
|
13
|
+
| Write code | `test-driven-development` (always) |
|
|
14
|
+
| Fix a bug or failing test | `systematic-debugging` |
|
|
15
|
+
| Review a diff against standards and the change's specs | `two-axis-review` (spec source: `openspec/changes/<id>/specs/`; no issue-tracker setup needed) |
|
|
16
|
+
| Security pass (PII/PHI, auth, tenant isolation) | built-in `/security-review`; rules in `.claude/rules/security.md` |
|
|
17
|
+
| Open a PR | `change-pr` |
|
|
18
|
+
| Answer review comments | `receiving-code-review` |
|
|
19
|
+
| Explain why a line exists | `trace-why` |
|
|
20
|
+
| Prune `openspec/specs/` | `spec-compaction` |
|
|
21
|
+
| Check UI / run e2e flows in a browser | Playwright MCP (`.mcp.json`) |
|
|
22
|
+
| OpenSpec workflow | `/openspec-propose`, `/openspec-explore`, `/openspec-apply-change`, `/openspec-archive-change` |
|
|
23
|
+
|
|
24
|
+
Hooks in `.claude/settings.json` block secret access, enforce the `Change-Id` trailer on
|
|
25
|
+
`git commit`, and freeze tests and `openspec/` when `SDD_MODE=fix`. A hook block is a policy
|
|
26
|
+
decision: adjust the action, do not retry it in another form.
|
|
27
|
+
|
|
28
|
+
Run the spec challenge and code reviews in a **subagent with a fresh context** so the author's
|
|
29
|
+
assumptions do not leak into the review.
|
|
30
|
+
<!-- specjig:end -->
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Created by specjig on init; project-owned afterwards (the harness never overwrites it).
|
|
2
|
+
schema: sdd
|
|
3
|
+
|
|
4
|
+
# Constraints an agent cannot infer by reading the code. Keep discoverable facts out.
|
|
5
|
+
context: |
|
|
6
|
+
Stack: TODO (language, framework, database, hosting)
|
|
7
|
+
Layers: TODO backend = <path>, frontend = <path> (same names as .sdd/harness.json)
|
|
8
|
+
Conventions: TODO (error format, API style, i18n, feature flags)
|
|
9
|
+
Data: synthetic data only in tests and fixtures; no PII/PHI in logs, URLs, specs or examples.
|
|
10
|
+
Client restrictions: TODO (or "none beyond AGENTS.md")
|
|
11
|
+
|
|
12
|
+
rules:
|
|
13
|
+
proposal:
|
|
14
|
+
- 'Include "## Risk" with "Level: low" or "Level: high" and a one-sentence reason.'
|
|
15
|
+
- 'Include "## Open questions" (owner per question, or "None"). Never omit the section.'
|
|
16
|
+
- 'State what is out of scope.'
|
|
17
|
+
specs:
|
|
18
|
+
- 'Every requirement touching auth, tenant data or PII/PHI has a negative scenario (unauthorized / other tenant / not logged).'
|
|
19
|
+
- 'Scenarios use synthetic example values only.'
|
|
20
|
+
impact:
|
|
21
|
+
- 'Use only layer names from .sdd/harness.json.'
|
|
22
|
+
tests:
|
|
23
|
+
- 'Every scenario maps to a test; prefer the lowest pyramid level that proves it.'
|
|
24
|
+
design:
|
|
25
|
+
- 'Security: for Risk high, add a Security section covering data classification, authn/authz, tenant boundary, new logged fields and how each is tested. No secrets, tokens or PII in logs, URLs or error messages.'
|
|
26
|
+
- 'Keep the Open Questions section; write "None" if none.'
|
|
27
|
+
tasks:
|
|
28
|
+
- 'One layer tag per task group; never mix layers in a group.'
|
|
29
|
+
|
|
30
|
+
operations:
|
|
31
|
+
apply:
|
|
32
|
+
guidance:
|
|
33
|
+
- 'Use the test-driven-development skill for every task; watch each test fail before implementing.'
|
|
34
|
+
- 'Commit with a "Change-Id: <change-id>" trailer.'
|
|
35
|
+
archive:
|
|
36
|
+
guidance:
|
|
37
|
+
- 'Run "npx openspec validate --all --strict" after archiving.'
|
|
38
|
+
- 'Summarize which main specs changed so release notes can reference them.'
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
# Managed by specjig. Fork of OpenSpec's `spec-driven` schema (see harness.lock.json for the
|
|
2
|
+
# version it was forked from). Adds risk levels, the `impact` and `tests` artifacts and
|
|
3
|
+
# layer-split tasks. Project-specific rules belong in openspec/config.yaml, not here.
|
|
4
|
+
name: sdd
|
|
5
|
+
version: 1
|
|
6
|
+
description: SDD workflow - proposal (risk) → specs → impact → tests → design → tasks (by layer)
|
|
7
|
+
artifacts:
|
|
8
|
+
- id: proposal
|
|
9
|
+
generates: proposal.md
|
|
10
|
+
description: Initial proposal document outlining the change
|
|
11
|
+
template: proposal.md
|
|
12
|
+
instruction: |
|
|
13
|
+
Create the proposal document that establishes WHY this change is needed.
|
|
14
|
+
|
|
15
|
+
Sections:
|
|
16
|
+
- **Why**: 1-2 sentences on the problem or opportunity. What problem does this solve? Why now?
|
|
17
|
+
- **What Changes**: Bullet list of changes. Be specific about new capabilities, modifications, or removals. Mark breaking changes with **BREAKING**.
|
|
18
|
+
- **Capabilities**: Identify which specs will be created or modified:
|
|
19
|
+
- **New Capabilities**: List capabilities being introduced. Each becomes a new `specs/<capability-path>/spec.md`. Name each capability for a durable system behavior (for example, `user-auth`), not the work in this change (for example, `add-login-endpoint`). Choose a cohesive boundary that can own related requirements as the system evolves; avoid broad catch-all capabilities. Use kebab-case for path segments you introduce (e.g., `user-auth` or `identity/user-auth`) and follow the project's existing spec organization.
|
|
20
|
+
- **Modified Capabilities**: List existing capabilities whose REQUIREMENTS are changing. Only include if spec-level behavior changes (not just implementation details). Each needs a delta spec file. Use the exact existing path under `openspec/specs/`. Leave empty if no requirement changes.
|
|
21
|
+
- **Impact**: Affected code, APIs, dependencies, or systems (one line each; impact.md details it).
|
|
22
|
+
- **Risk**: `Level: low` or `Level: high` plus one sentence of justification.
|
|
23
|
+
High when the change touches auth, permissions, tenant isolation, PII/PHI,
|
|
24
|
+
payments, data migrations, public API contracts, or more than one layer.
|
|
25
|
+
When unsure, choose high. High risk requires the spec challenge (challenge.md)
|
|
26
|
+
before impact/tests/design, and a Security section in design.md.
|
|
27
|
+
- **Open questions**: MANDATORY section. List every unresolved question with an
|
|
28
|
+
owner, or write "None". Questions that would change specs, approach or tasks
|
|
29
|
+
must be resolved before tasks.md is written.
|
|
30
|
+
|
|
31
|
+
IMPORTANT: The Capabilities section is critical. It creates the contract between
|
|
32
|
+
proposal and specs phases. Research existing specs before filling this in:
|
|
33
|
+
run `openspec list --specs` for the project's capability inventory, then
|
|
34
|
+
`openspec show "<spec-id>" --type spec --json --no-scenarios` for any that
|
|
35
|
+
look related - that returns a capability's purpose and requirement texts
|
|
36
|
+
without pulling whole spec files into context. Append `--store "<id>"` to
|
|
37
|
+
both commands only for a registered standalone store, and keep `--type
|
|
38
|
+
spec`: a change and a spec sharing a name is otherwise an ambiguous-item
|
|
39
|
+
error. `openspec list` without `--specs` lists in-flight changes, not
|
|
40
|
+
specs - it never shows what the project already covers. Reuse an existing
|
|
41
|
+
capability's exact path instead of introducing a near-duplicate name.
|
|
42
|
+
The filtered read is only an overview. Before deciding what is already
|
|
43
|
+
covered or what should change, read each relevant spec in full, including
|
|
44
|
+
scenarios, with `openspec show "<spec-id>" --type spec` (same `--store` rule).
|
|
45
|
+
Each capability listed here will need a corresponding spec file.
|
|
46
|
+
|
|
47
|
+
Every change must either declare at least one capability (new or
|
|
48
|
+
modified) or explicitly opt out of specs: `openspec validate` rejects a
|
|
49
|
+
change with zero deltas unless the change's `.openspec.yaml` sets
|
|
50
|
+
`skip_specs: true`. Use `skip_specs: true` only when no spec-level
|
|
51
|
+
behavior changes (pure refactor, tooling, docs) - specs describe
|
|
52
|
+
behavior, so if behavior does not change, no spec should change either.
|
|
53
|
+
Do not invent a requirement just to satisfy validation.
|
|
54
|
+
|
|
55
|
+
Keep it concise (1-2 pages). Focus on the "why" not the "how" -
|
|
56
|
+
implementation details belong in design.md.
|
|
57
|
+
|
|
58
|
+
This is the foundation - specs, design, and tasks all build on this.
|
|
59
|
+
requires: []
|
|
60
|
+
|
|
61
|
+
- id: specs
|
|
62
|
+
generates: "specs/**/*.md"
|
|
63
|
+
description: Detailed specifications for the change
|
|
64
|
+
template: spec.md
|
|
65
|
+
instruction: |
|
|
66
|
+
Create specification files that define WHAT the system should do.
|
|
67
|
+
|
|
68
|
+
A spec is a behavior contract, not an implementation plan.
|
|
69
|
+
|
|
70
|
+
Good spec content:
|
|
71
|
+
- Observable behavior users or downstream systems rely on
|
|
72
|
+
- Inputs, outputs, and error conditions
|
|
73
|
+
- External constraints (security, privacy, reliability, compatibility)
|
|
74
|
+
- Scenarios that can be tested or explicitly validated
|
|
75
|
+
|
|
76
|
+
Avoid in specs:
|
|
77
|
+
- Internal class/function names
|
|
78
|
+
- Library or framework choices
|
|
79
|
+
- Step-by-step implementation details
|
|
80
|
+
- Detailed execution plans (those belong in design.md or tasks.md)
|
|
81
|
+
|
|
82
|
+
Quick test: if the implementation can change without changing externally
|
|
83
|
+
visible behavior, it likely does not belong in the spec.
|
|
84
|
+
|
|
85
|
+
Create one spec file per capability listed in the proposal's Capabilities section.
|
|
86
|
+
`<capability-path>` is the spec directory relative to `specs/` (for example,
|
|
87
|
+
`user-auth` or `identity/user-auth`). Preserve the full path:
|
|
88
|
+
- New capabilities: use the exact path from the proposal at `specs/<capability-path>/spec.md`. Any path segment newly introduced in the proposal must be kebab-case. Follow the project's existing organization; do not add a new domain level when the project uses a flat layout.
|
|
89
|
+
- Modified capabilities: use the exact existing path from `openspec/specs/<capability-path>/` when creating the delta at `specs/<capability-path>/spec.md`. Run `openspec list --specs` to confirm that path before writing the delta, appending `--store "<id>"` only for a registered standalone store - a mistyped or invented path targets a capability that does not exist rather than the one you meant. Do not move or rename the capability.
|
|
90
|
+
|
|
91
|
+
Write the spec files one at a time, so the user sees progress and an
|
|
92
|
+
interrupted run keeps the files it already wrote:
|
|
93
|
+
- Before writing anything, compare the capabilities the proposal lists
|
|
94
|
+
with the `specs/<capability-path>/spec.md` files that already exist,
|
|
95
|
+
and start with the first capability that has no file. Do not rewrite
|
|
96
|
+
an existing file unless the user asks you to.
|
|
97
|
+
- Before each file, say in one line which capability you are writing.
|
|
98
|
+
- Write each file as soon as you have drafted it. Do not plan every file
|
|
99
|
+
before writing the first.
|
|
100
|
+
- Stop when every capability the proposal lists has its file.
|
|
101
|
+
|
|
102
|
+
There must be at least one spec file unless the change's `.openspec.yaml`
|
|
103
|
+
sets `skip_specs: true` (no spec-level behavior change) - `openspec validate`
|
|
104
|
+
rejects a zero-delta change without that marker. If the proposal lists no
|
|
105
|
+
capabilities and `skip_specs` is not set, revisit the proposal first.
|
|
106
|
+
|
|
107
|
+
Delta operations (use ## headers):
|
|
108
|
+
- **ADDED Requirements**: New capabilities
|
|
109
|
+
- **MODIFIED Requirements**: Changed behavior - MUST include full updated content
|
|
110
|
+
- **REMOVED Requirements**: Deprecated features - MUST include **Reason** and **Migration**
|
|
111
|
+
- **RENAMED Requirements**: Name changes only - use FROM:/TO: format
|
|
112
|
+
|
|
113
|
+
Format requirements:
|
|
114
|
+
- Each requirement: `### Requirement: <name>` followed by description
|
|
115
|
+
- Use SHALL/MUST for normative requirements (avoid should/may)
|
|
116
|
+
- Each scenario: `#### Scenario: <name>` with WHEN/THEN format
|
|
117
|
+
- **CRITICAL**: Scenarios MUST use exactly 4 hashtags (`####`). Using 3 hashtags or bullets will fail silently.
|
|
118
|
+
- Every requirement MUST have at least one scenario.
|
|
119
|
+
- Every scenario MUST have a WHEN/GIVEN step (its trigger) and a THEN step (its outcome). A scenario with only AND lines or plain prose still counts as a scenario, but `openspec validate` flags it as a warning: normal validation still passes, but `openspec validate --strict` fails on it.
|
|
120
|
+
- Keep each requirement's description (the text between `### Requirement:` and its first scenario) to 500 characters or fewer. `openspec validate` flags longer descriptions in ADDED requirements and in the main spec. This is a warning: normal validation still passes, but `openspec validate --strict` fails on it. When writing a new requirement, state one behavior per requirement: move examples and edge cases into scenarios, and split a requirement that covers several behaviors into separate `### Requirement:` blocks, each with its own scenarios. Under MODIFIED, keep the existing requirement block whole; never split, trim or rewrite existing text just to meet the length. Split an existing long requirement only when the user asks for it, in a change made for that purpose: under MODIFIED, keep its header and every scenario and cut its description down to one behavior without changing its meaning, then add each behavior you removed as its own ADDED requirement with its own scenarios.
|
|
121
|
+
|
|
122
|
+
New capabilities only: the delta spec's first section is `## Purpose` -
|
|
123
|
+
one or two sentences (50+ characters, or `openspec validate --strict`
|
|
124
|
+
reports it as too brief) describing what the capability is for. Archive
|
|
125
|
+
copies it into the main spec it creates; without it the new main spec is
|
|
126
|
+
left with a `TBD ... Update Purpose after archive` placeholder to fill in
|
|
127
|
+
by hand. Do NOT add `## Purpose` to a delta for an existing capability -
|
|
128
|
+
that spec already has one and the delta's is ignored. To change an
|
|
129
|
+
existing capability's Purpose - including a leftover `TBD` placeholder -
|
|
130
|
+
edit `<planningHome.root>/openspec/specs/<capability-path>/spec.md`
|
|
131
|
+
directly. `planningHome.root` comes from the `openspec instructions ...
|
|
132
|
+
--json` response. Always use it rather than a repo-relative path: it
|
|
133
|
+
resolves to the store whenever the change lives in one - whether that
|
|
134
|
+
came from `--store`, a project `store:` pointer, or a global default
|
|
135
|
+
store - and to the current repository otherwise. Do not try to work out
|
|
136
|
+
which case applies; the field already has.
|
|
137
|
+
|
|
138
|
+
MODIFIED requirements workflow:
|
|
139
|
+
1. Locate the existing requirement in `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (the same store-aware root as above)
|
|
140
|
+
2. Copy the ENTIRE requirement block (from `### Requirement:` through all scenarios)
|
|
141
|
+
3. Paste under `## MODIFIED Requirements` and edit to reflect new behavior
|
|
142
|
+
4. Ensure header text matches exactly (whitespace-insensitive)
|
|
143
|
+
|
|
144
|
+
Common pitfall: Using MODIFIED with partial content loses detail at archive time.
|
|
145
|
+
If adding new concerns without changing existing behavior, use ADDED instead.
|
|
146
|
+
|
|
147
|
+
Example (a new capability, so its first section is `## Purpose`):
|
|
148
|
+
```
|
|
149
|
+
# Spec Delta
|
|
150
|
+
|
|
151
|
+
## Purpose
|
|
152
|
+
|
|
153
|
+
Lets users take their data out of the product in a portable format.
|
|
154
|
+
|
|
155
|
+
## ADDED Requirements
|
|
156
|
+
|
|
157
|
+
### Requirement: User can export data
|
|
158
|
+
The system SHALL allow users to export their data in CSV format.
|
|
159
|
+
|
|
160
|
+
#### Scenario: Successful export
|
|
161
|
+
- **WHEN** user clicks "Export" button
|
|
162
|
+
- **THEN** system downloads a CSV file with all user data
|
|
163
|
+
|
|
164
|
+
## REMOVED Requirements
|
|
165
|
+
|
|
166
|
+
### Requirement: Legacy export
|
|
167
|
+
**Reason**: Replaced by new export system
|
|
168
|
+
**Migration**: Use new export endpoint at /api/v2/export
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Specs should be testable - each scenario is a potential test case.
|
|
172
|
+
requires:
|
|
173
|
+
- proposal
|
|
174
|
+
|
|
175
|
+
- id: impact
|
|
176
|
+
generates: impact.md
|
|
177
|
+
description: Where the change lands - layers, modules, data, APIs, security touchpoints
|
|
178
|
+
template: impact.md
|
|
179
|
+
instruction: |
|
|
180
|
+
Create impact.md: a map of WHERE this change lands, so tests, design and
|
|
181
|
+
tasks can be split by layer and reviewers know what to look at.
|
|
182
|
+
|
|
183
|
+
High risk: confirm `challenge.md` exists in the change folder (the
|
|
184
|
+
spec-challenge step). If it does not, stop and run the `spec-challenge`
|
|
185
|
+
skill first.
|
|
186
|
+
|
|
187
|
+
Research the code (search, read) before writing; do not guess module names.
|
|
188
|
+
|
|
189
|
+
Sections:
|
|
190
|
+
- **Layers**: table of layer (as named in .sdd/harness.json `layers`, e.g.
|
|
191
|
+
backend / frontend) → modules/paths touched → requirements (by name) it serves.
|
|
192
|
+
- **Data**: schema changes, migrations, backfills; data classification of every
|
|
193
|
+
new or changed field (public / internal / PII / PHI / secret).
|
|
194
|
+
- **Interfaces**: public API, events, CLI, UI routes added/changed/removed;
|
|
195
|
+
mark breaking changes **BREAKING** with the consumers affected.
|
|
196
|
+
- **Security & privacy**: authn/authz changes, tenant boundary, new logging of
|
|
197
|
+
fields, PII/PHI in URLs or logs. Write "None" explicitly if nothing applies.
|
|
198
|
+
- **Dependencies**: new libraries/services and why; feature flags.
|
|
199
|
+
- **Out of blast radius**: what is deliberately not touched.
|
|
200
|
+
|
|
201
|
+
Low risk: a short table of layers and paths plus "Security & privacy: None"
|
|
202
|
+
is enough.
|
|
203
|
+
requires:
|
|
204
|
+
- specs
|
|
205
|
+
|
|
206
|
+
- id: tests
|
|
207
|
+
generates: tests.md
|
|
208
|
+
description: Test plan mapping every scenario to a level of the test pyramid
|
|
209
|
+
template: tests.md
|
|
210
|
+
instruction: |
|
|
211
|
+
Create tests.md: the test plan derived from the delta specs. Tests are
|
|
212
|
+
written FIRST during apply (red → green), so this plan is what apply executes.
|
|
213
|
+
|
|
214
|
+
Map EVERY `#### Scenario:` in the change's delta specs to at least one test,
|
|
215
|
+
choosing the lowest pyramid level that can prove it:
|
|
216
|
+
- **unit**: pure logic, validation, calculations, mapping - no I/O.
|
|
217
|
+
- **integration**: a module with its real collaborators (DB, queue, HTTP
|
|
218
|
+
handler) behind its public interface; tenant isolation and authz checks live here.
|
|
219
|
+
- **e2e**: only user journeys that cross layers; keep them few.
|
|
220
|
+
|
|
221
|
+
Format: a table per capability:
|
|
222
|
+
| Requirement | Scenario | Level | Layer | Test location (file / describe name) |
|
|
223
|
+
|
|
224
|
+
Rules:
|
|
225
|
+
- Name tests after the scenario so a failing test points to the requirement.
|
|
226
|
+
- Every requirement touching security/privacy gets at least one negative test
|
|
227
|
+
(unauthorized, other tenant, PII not logged).
|
|
228
|
+
- Fixtures and test data are synthetic (seeded factories); state how they are generated.
|
|
229
|
+
- List scenarios deliberately NOT automated and why (with how they are verified).
|
|
230
|
+
- Use the layers from impact.md; tasks.md will split work by the same layers.
|
|
231
|
+
requires:
|
|
232
|
+
- specs
|
|
233
|
+
- impact
|
|
234
|
+
|
|
235
|
+
- id: design
|
|
236
|
+
generates: design.md
|
|
237
|
+
description: Technical design document with implementation details
|
|
238
|
+
template: design.md
|
|
239
|
+
instruction: |
|
|
240
|
+
Create the design document that explains HOW to implement the change.
|
|
241
|
+
|
|
242
|
+
design.md is always created. Full design is required when any apply:
|
|
243
|
+
- Risk: high (then a **Security** section is MANDATORY: data classification
|
|
244
|
+
touched, authn/authz, tenant boundary, logging of new fields, how each is tested)
|
|
245
|
+
- Cross-cutting change (multiple services/modules) or new architectural pattern
|
|
246
|
+
- New external dependency or significant data model changes
|
|
247
|
+
- Security, performance, or migration complexity
|
|
248
|
+
- Ambiguity that benefits from technical decisions before coding
|
|
249
|
+
Otherwise (low risk, none of the above) write only Context and Decisions in a
|
|
250
|
+
few lines, or "Not needed: <reason>".
|
|
251
|
+
|
|
252
|
+
Sections:
|
|
253
|
+
- **Context**: Only the current state and constraints needed to explain the approach. Reference the proposal for motivation instead of restating it (e.g., "See proposal.md - Why").
|
|
254
|
+
- **Goals / Non-Goals**: What this design achieves and explicitly excludes. Don't restate the proposal's scope - add only design-level boundaries.
|
|
255
|
+
- **Decisions**: Key technical choices with rationale (why X over Y?). Include alternatives considered for each decision.
|
|
256
|
+
- **Risks / Trade-offs**: Known limitations, things that could go wrong. Format: [Risk] → Mitigation
|
|
257
|
+
- **Migration Plan**: Steps to deploy, rollback strategy (if applicable)
|
|
258
|
+
- **Open Questions**: Unknowns that can safely be answered later without
|
|
259
|
+
changing the specs, the approach, or the task breakdown. Omit if none.
|
|
260
|
+
|
|
261
|
+
Open questions are for genuinely deferrable unknowns, not decisions you
|
|
262
|
+
skipped. If a question would change the specs, the chosen approach, or
|
|
263
|
+
the task breakdown, resolve it now - ask the user instead of guessing.
|
|
264
|
+
|
|
265
|
+
Focus on architecture and approach, not line-by-line implementation.
|
|
266
|
+
The proposal covers why and what; design covers how. Reference the
|
|
267
|
+
proposal for motivation and, once written, the specs for requirements -
|
|
268
|
+
if a section would only restate them, point to them instead.
|
|
269
|
+
|
|
270
|
+
Good design docs explain the "why" behind technical decisions.
|
|
271
|
+
requires:
|
|
272
|
+
- proposal
|
|
273
|
+
- impact
|
|
274
|
+
|
|
275
|
+
- id: tasks
|
|
276
|
+
generates: tasks.md
|
|
277
|
+
description: Implementation checklist with trackable tasks
|
|
278
|
+
template: tasks.md
|
|
279
|
+
instruction: |
|
|
280
|
+
Create the task list that breaks down the implementation work.
|
|
281
|
+
|
|
282
|
+
Before writing tasks, check design.md for Open Questions. If any of them
|
|
283
|
+
would change what gets built, resolve them with the user first - do not
|
|
284
|
+
bake an unstated assumption into the task list.
|
|
285
|
+
|
|
286
|
+
**IMPORTANT: Follow the template below for tracked tasks.** The apply phase parses
|
|
287
|
+
checkbox format to track progress. A box holding only `x` counts as done,
|
|
288
|
+
upper or lower case and with any spacing, so `- [ x]` is done too. Every
|
|
289
|
+
other marker, including `- [~]`, `- [-]` and an empty `- []`, reads as
|
|
290
|
+
unfinished. A line with no checkbox is not tracked at all.
|
|
291
|
+
|
|
292
|
+
Guidelines:
|
|
293
|
+
- Group related tracked tasks under ## numbered headings
|
|
294
|
+
- Each tracked task MUST be a checkbox: `- [ ] X.Y Task description`
|
|
295
|
+
- Tasks should be small enough to complete in one session
|
|
296
|
+
- Order tasks by dependency (what must be done first?)
|
|
297
|
+
- Track implementation and verification work that can be completed before
|
|
298
|
+
archive. If the requested workflow includes archive or work that requires
|
|
299
|
+
this change to be archived, preserve those steps as plain bullets in an
|
|
300
|
+
optional `## Workflow follow-up` section at the end of tasks.md. These
|
|
301
|
+
bullets are reference information outside tracked task progress.
|
|
302
|
+
- Each task MUST state how to verify completion (a test, command,
|
|
303
|
+
observable behavior, or delivered artifact). Put the verification in
|
|
304
|
+
that task's checkbox description. Use a separate verification task only
|
|
305
|
+
when it checks broader integration or system behavior that spans
|
|
306
|
+
multiple implementation tasks.
|
|
307
|
+
- Each task group MUST land the tests and documentation its own work
|
|
308
|
+
calls for. Do NOT collect testing or documentation into a final group -
|
|
309
|
+
when a late group first exercises work from an early one, the failures
|
|
310
|
+
cascade back through every group in between and force rework. A group
|
|
311
|
+
whose work calls for neither, such as scaffolding or dependency setup,
|
|
312
|
+
carries neither. A final group is for integration checks only, not for
|
|
313
|
+
the tests and docs an earlier group owed.
|
|
314
|
+
|
|
315
|
+
Split by layer (sdd):
|
|
316
|
+
- Every task group heading carries exactly one layer tag from impact.md:
|
|
317
|
+
`## 1. [backend] Export endpoint`. Shared setup uses `[shared]`; cross-layer
|
|
318
|
+
e2e checks use `[e2e]` and come last.
|
|
319
|
+
- A group never mixes layers, so `apply` can run once per layer
|
|
320
|
+
("apply <id> layer: backend") in a separate session / PR.
|
|
321
|
+
- Order layers by dependency: shared → backend → frontend → e2e, unless
|
|
322
|
+
impact.md says otherwise.
|
|
323
|
+
- Each implementation task names the test(s) from tests.md it makes pass
|
|
324
|
+
first (red → green): "2.1 Write failing integration test 'Successful export',
|
|
325
|
+
then implement ... ; verify: test passes".
|
|
326
|
+
|
|
327
|
+
Example:
|
|
328
|
+
```
|
|
329
|
+
# Tasks
|
|
330
|
+
|
|
331
|
+
## 1. [shared] Setup
|
|
332
|
+
|
|
333
|
+
- [ ] 1.1 Add CSV library dependency; verify install succeeds
|
|
334
|
+
|
|
335
|
+
## 2. [backend] Export endpoint
|
|
336
|
+
|
|
337
|
+
- [ ] 2.1 Failing integration test "Successful export" (tests.md), then implement GET /exports; verify: test passes
|
|
338
|
+
- [ ] 2.2 Failing integration test "Other tenant cannot export", then scope query by tenant; verify: test passes
|
|
339
|
+
|
|
340
|
+
## 3. [frontend] Export button
|
|
341
|
+
|
|
342
|
+
- [ ] 3.1 Failing component test "Export button downloads CSV", then implement; verify: test passes
|
|
343
|
+
|
|
344
|
+
## 4. [e2e] Journey
|
|
345
|
+
|
|
346
|
+
- [ ] 4.1 E2E "User exports data" passes against the dev stack
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
When applicable, append workflow follow-up as plain bullets, for example:
|
|
350
|
+
```
|
|
351
|
+
## Workflow follow-up
|
|
352
|
+
|
|
353
|
+
- Archive the change after the project's review requirements are satisfied.
|
|
354
|
+
- Verify the archived result.
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
Reference specs for what needs to be built, design for how to build it.
|
|
358
|
+
requires:
|
|
359
|
+
- tests
|
|
360
|
+
- design
|
|
361
|
+
|
|
362
|
+
apply:
|
|
363
|
+
requires: [tasks]
|
|
364
|
+
tracks: tasks.md
|
|
365
|
+
instruction: |
|
|
366
|
+
Read context files (proposal, specs, impact, tests, design), then work through
|
|
367
|
+
pending tasks, marking each complete as you go.
|
|
368
|
+
|
|
369
|
+
Layer: if the user named a layer ("layer: backend"), work ONLY on task groups
|
|
370
|
+
tagged with that layer (plus unfinished `[shared]` groups it depends on). Leave
|
|
371
|
+
other layers' tasks untouched for their own run.
|
|
372
|
+
|
|
373
|
+
For every task use the `test-driven-development` skill: write the test named in
|
|
374
|
+
tests.md, run it and watch it fail for the right reason, then write the minimal
|
|
375
|
+
code to pass. When a test fails unexpectedly, use `systematic-debugging`.
|
|
376
|
+
|
|
377
|
+
Commit with a `Change-Id: <change-id>` trailer. Do not edit openspec/specs/.
|
|
378
|
+
Pause if you hit blockers, an Open question that changes the plan, or a spec
|
|
379
|
+
that turns out wrong: propose the spec change instead of silently diverging.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Design
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
<!-- Current state and constraints that shape the approach. See proposal.md for motivation - don't restate it -->
|
|
6
|
+
|
|
7
|
+
## Goals / Non-Goals
|
|
8
|
+
|
|
9
|
+
**Goals:**
|
|
10
|
+
<!-- What this design aims to achieve -->
|
|
11
|
+
|
|
12
|
+
**Non-Goals:**
|
|
13
|
+
<!-- What is explicitly out of scope -->
|
|
14
|
+
|
|
15
|
+
## Decisions
|
|
16
|
+
|
|
17
|
+
<!-- Key design decisions with rationale and alternatives considered -->
|
|
18
|
+
|
|
19
|
+
## Risks / Trade-offs
|
|
20
|
+
|
|
21
|
+
<!-- Known risks and trade-offs -->
|
|
22
|
+
|
|
23
|
+
## Security
|
|
24
|
+
|
|
25
|
+
<!-- MANDATORY for Risk: high. Data classification touched, authn/authz, tenant boundary, logging of new fields, and how each is tested. -->
|
|
26
|
+
|
|
27
|
+
## Open Questions
|
|
28
|
+
|
|
29
|
+
<!-- Deferrable unknowns only (they must not change specs, approach or tasks). "None" if none. -->
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Impact
|
|
2
|
+
|
|
3
|
+
## Layers
|
|
4
|
+
|
|
5
|
+
| Layer | Modules / paths | Requirements served |
|
|
6
|
+
|-------|-----------------|---------------------|
|
|
7
|
+
| <!-- backend --> | <!-- src/server/exports/ --> | <!-- User can export data --> |
|
|
8
|
+
|
|
9
|
+
## Data
|
|
10
|
+
|
|
11
|
+
<!-- Schema changes, migrations, backfills. Classify every new/changed field: public / internal / PII / PHI / secret. -->
|
|
12
|
+
|
|
13
|
+
## Interfaces
|
|
14
|
+
|
|
15
|
+
<!-- Public API, events, CLI, UI routes added/changed/removed. Mark **BREAKING** with affected consumers. -->
|
|
16
|
+
|
|
17
|
+
## Security & privacy
|
|
18
|
+
|
|
19
|
+
<!-- authn/authz, tenant boundary, PII/PHI in logs or URLs. Write "None" if nothing applies. -->
|
|
20
|
+
|
|
21
|
+
## Dependencies
|
|
22
|
+
|
|
23
|
+
<!-- New libraries/services and why; feature flags. -->
|
|
24
|
+
|
|
25
|
+
## Out of blast radius
|
|
26
|
+
|
|
27
|
+
<!-- What is deliberately not touched. -->
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Proposal
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
<!-- Explain the motivation for this change. What problem does this solve? Why now? -->
|
|
6
|
+
|
|
7
|
+
## What Changes
|
|
8
|
+
|
|
9
|
+
<!-- Describe what will change. Be specific about new capabilities, modifications, or removals. -->
|
|
10
|
+
|
|
11
|
+
## Capabilities
|
|
12
|
+
|
|
13
|
+
### New Capabilities
|
|
14
|
+
<!-- Capabilities being introduced. Name each capability for a cohesive system
|
|
15
|
+
behavior that can own related requirements as the system evolves. Do not name
|
|
16
|
+
implementation tasks or proposal sections. Avoid broad catch-all names. Use
|
|
17
|
+
kebab-case for path segments you introduce (e.g., user-auth or identity/user-auth)
|
|
18
|
+
that follow the project's existing spec organization. Each creates
|
|
19
|
+
specs/<capability-path>/spec.md. -->
|
|
20
|
+
- `<capability-path>`: <brief description of what this capability covers>
|
|
21
|
+
|
|
22
|
+
### Modified Capabilities
|
|
23
|
+
<!-- Existing capabilities whose REQUIREMENTS are changing (not just implementation).
|
|
24
|
+
Only list here if spec-level behavior changes. Each needs a delta spec file.
|
|
25
|
+
Use the exact existing path under openspec/specs/. Leave empty if no requirement
|
|
26
|
+
changes. A change with no capabilities at all (pure refactor, tooling, docs)
|
|
27
|
+
must set `skip_specs: true` in its .openspec.yaml - openspec validate rejects
|
|
28
|
+
a zero-delta change without that marker. Do not invent a requirement just to
|
|
29
|
+
satisfy validation. -->
|
|
30
|
+
- `<existing-capability-path>`: <what requirement is changing>
|
|
31
|
+
|
|
32
|
+
## Impact
|
|
33
|
+
|
|
34
|
+
<!-- Affected code, APIs, dependencies, systems -->
|
|
35
|
+
|
|
36
|
+
## Risk
|
|
37
|
+
|
|
38
|
+
Level: <!-- low | high -->
|
|
39
|
+
<!-- One sentence: why. High = auth, permissions, tenant isolation, PII/PHI, payments, migrations, public API, or more than one layer. -->
|
|
40
|
+
|
|
41
|
+
## Open questions
|
|
42
|
+
|
|
43
|
+
<!-- Every unresolved question with an owner, or "None". Questions that change specs, approach or tasks must be resolved before tasks.md. -->
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Spec Delta
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
<!-- New capabilities only: one or two sentences (50+ characters) on what this capability is for. Delete this section for an existing capability. -->
|
|
5
|
+
|
|
6
|
+
## ADDED Requirements
|
|
7
|
+
|
|
8
|
+
### Requirement: <!-- requirement name -->
|
|
9
|
+
<!-- requirement text -->
|
|
10
|
+
|
|
11
|
+
#### Scenario: <!-- scenario name -->
|
|
12
|
+
- **WHEN** <!-- condition -->
|
|
13
|
+
- **THEN** <!-- expected outcome -->
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Tasks
|
|
2
|
+
|
|
3
|
+
<!-- One layer tag per group: [shared] [backend] [frontend] [e2e] (layers from impact.md). Never mix layers in a group. -->
|
|
4
|
+
|
|
5
|
+
## 1. [shared] <!-- Task Group Name -->
|
|
6
|
+
|
|
7
|
+
- [ ] 1.1 <!-- Task description; verify: ... -->
|
|
8
|
+
|
|
9
|
+
## 2. [backend] <!-- Task Group Name -->
|
|
10
|
+
|
|
11
|
+
- [ ] 2.1 <!-- Failing test "<scenario>" (tests.md), then implement ...; verify: test passes -->
|
|
12
|
+
|
|
13
|
+
## 3. [frontend] <!-- Task Group Name -->
|
|
14
|
+
|
|
15
|
+
- [ ] 3.1 <!-- Failing test "<scenario>" (tests.md), then implement ...; verify: test passes -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Test plan
|
|
2
|
+
|
|
3
|
+
<!-- Every scenario from the delta specs maps to at least one test at the lowest level that proves it. -->
|
|
4
|
+
|
|
5
|
+
## <!-- capability -->
|
|
6
|
+
|
|
7
|
+
| Requirement | Scenario | Level | Layer | Test location |
|
|
8
|
+
|-------------|----------|-------|-------|---------------|
|
|
9
|
+
| <!-- User can export data --> | <!-- Successful export --> | <!-- integration --> | <!-- backend --> | <!-- test/exports.test.ts › "Successful export" --> |
|
|
10
|
+
|
|
11
|
+
## Test data
|
|
12
|
+
|
|
13
|
+
<!-- How fixtures are generated (seeded factories / faker seed). Synthetic only. -->
|
|
14
|
+
|
|
15
|
+
## Not automated
|
|
16
|
+
|
|
17
|
+
<!-- Scenarios deliberately not automated, why, and how they are verified instead. Write "None" if all are automated. -->
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repo": "mattpocock/skills",
|
|
3
|
+
"path": "skills/productivity/grilling",
|
|
4
|
+
"sha": "7739eaed7f8f3915437a8def198a6d0d7206dbc7",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"url": "https://github.com/mattpocock/skills/tree/7739eaed7f8f3915437a8def198a6d0d7206dbc7/skills/productivity/grilling",
|
|
7
|
+
"note": "Vendored by specjig. Do not edit; bump the pin in harness.lock.json instead."
|
|
8
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grilling
|
|
3
|
+
description: Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Interview the user relentlessly until you reach a shared understanding. Map this as a **design tree**: every decision branches into the decisions that hang off it.
|
|
7
|
+
|
|
8
|
+
Work the tree in **rounds**. The **frontier** is every decision whose prerequisites are already settled: the questions you can ask _now_ without guessing at answers you haven't heard yet. Ask the whole frontier in one round: number each question and give your recommended answer. Then wait for the user's answers before the next round.
|
|
9
|
+
|
|
10
|
+
Format a round like so:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
❓ **Q1** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
|
|
14
|
+
|
|
15
|
+
➡️ <your recommended answer>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
❓ **Q2** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
|
|
20
|
+
|
|
21
|
+
➡️ <your recommended answer>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Word each question so "yes" accepts your recommended answer.
|
|
25
|
+
|
|
26
|
+
Each round the user answers reshapes the tree: settled decisions push the frontier outward and unblock questions that depended on them. Recompute the frontier and ask the next round. A question whose answer depends on another question still open in this round belongs to a _later_ round, not this one.
|
|
27
|
+
|
|
28
|
+
Finding _facts_ is your job, never the user's. When a frontier question needs a fact from the environment (filesystem, tools, etc.), dispatch a sub-agent with a fresh context window to find it; don't ask the user for anything you could look up yourself. Don't block on it: a running exploration is an unsettled prerequisite, so only the questions downstream of it wait for the sub-agent to report; ask the rest of the frontier now. The _decisions_ are the user's: put each to them and wait.
|
|
29
|
+
|
|
30
|
+
The session is done when the frontier is empty: every branch of the design tree visited, nothing left silently assumed. Do not act on it until the user confirms you have reached a shared understanding.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repo": "obra/superpowers",
|
|
3
|
+
"path": "skills/receiving-code-review",
|
|
4
|
+
"sha": "3fb75974186ea7fada621d8ab77b3b02169baf57",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"url": "https://github.com/obra/superpowers/tree/3fb75974186ea7fada621d8ab77b3b02169baf57/skills/receiving-code-review",
|
|
7
|
+
"note": "Vendored by specjig. Do not edit; bump the pin in harness.lock.json instead."
|
|
8
|
+
}
|