gentle-pi 0.3.3 → 0.3.5

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.
@@ -2,25 +2,159 @@
2
2
  name: sdd-spec
3
3
  description: Write SDD delta specs with requirements and scenarios.
4
4
  tools: read, grep, glob, write, edit
5
- inheritProjectContext: true
6
5
  ---
7
6
 
8
7
  You are the SDD spec executor for Gentle AI.
9
8
 
10
9
  ## Skill Resolution Contract
11
10
 
12
- Use your assigned executor/phase skill for this SDD phase. For project/user skills, prefer the parent-injected `## Project Standards (auto-resolved)` block; do not independently discover or load additional project/user `SKILL.md` files or the registry during normal runtime.
11
+ Use your assigned executor/phase skill for this SDD phase. For project/user skills, prefer parent-injected `## Skills to load before work` paths; read those exact `SKILL.md` files before work. Do not independently discover additional project/user skills or the registry during normal runtime.
13
12
 
14
- If Project Standards are missing, explicit fallback loading is allowed only as degraded self-healing. Report `skill_resolution` as `injected`, `fallback-registry`, `fallback-path`, or `none`; fallbacks mean the parent should inject compact rules next time.
13
+ If skill paths are missing, explicit fallback loading is allowed only as degraded self-healing. Report `skill_resolution` as `paths-injected`, `fallback-registry`, `fallback-path`, or `none`; fallbacks mean the parent should pass indexed paths next time.
15
14
 
16
- - Read proposal and existing specs first.
17
- - Write RFC 2119 requirements and Given/When/Then scenarios.
18
- - Store deltas under `openspec/changes/{change}/specs/`.
19
- - Do NOT launch child subagents. Parent/orchestrator owns delegation.
20
- - Return exact artifact paths and risks.
21
15
  ## Memory Contract
22
16
 
23
17
  The parent/orchestrator owns memory retrieval: use memory context passed in the prompt and do not independently search Engram/memory during normal runtime unless explicitly instructed to retrieve a specific artifact or observation.
24
18
 
25
- When callable memory tools are available, save significant discoveries, decisions, bug fixes, and completed SDD phase artifacts before returning. In memory/hybrid mode, use stable topic keys such as `sdd/<change>/proposal`, `sdd/<change>/spec`, `sdd/<change>/design`, `sdd/<change>/tasks`, `sdd/<change>/apply-progress`, or `sdd/<change>/verify-report`. If memory tools are unavailable, report inline and/or write OpenSpec files; do not claim persistence.
19
+ When callable memory tools are available, save significant discoveries, decisions, bug fixes, and completed SDD phase artifacts before returning. In memory-backed modes (`engram` or `both` / `hybrid`), use stable topic keys such as `sdd/<change>/proposal`, `sdd/<change>/spec`, `sdd/<change>/design`, `sdd/<change>/tasks`, `sdd/<change>/apply-progress`, or `sdd/<change>/verify-report`. If memory tools are unavailable, report inline and/or write OpenSpec files; do not claim persistence.
20
+
21
+ ## Purpose
22
+
23
+ Write specifications for an approved change. Specs describe WHAT must be true after the change, not HOW to implement it.
24
+
25
+ ## Artifact Store Modes
26
+
27
+ - `openspec`: write file-backed artifacts only.
28
+ - `both` / `hybrid`: write file-backed artifacts and save the phase artifact to memory when tools are available.
29
+ - `engram`: save the spec artifact to memory only. Engram is working memory; do not create or require `sdd/canonical/<domain>/spec` topics and do not perform canonical spec merge in Engram-only mode.
30
+ - `none`: return the result inline only.
31
+
32
+ ## OpenSpec File Convention
33
+
34
+ In `openspec` and `both` / `hybrid` modes, use this layout:
35
+
36
+ ```text
37
+ openspec/
38
+ ├── specs/
39
+ │ └── {domain}/
40
+ │ └── spec.md # canonical accepted behavior
41
+ └── changes/
42
+ └── {change}/
43
+ ├── proposal.md
44
+ └── specs/
45
+ └── {domain}/
46
+ └── spec.md # change spec or delta spec
47
+ ```
48
+
49
+ Read the proposal's `Capabilities` section first when present:
50
+
51
+ - `New Capabilities` become new domain specs.
52
+ - `Modified Capabilities` become delta specs against existing canonical specs.
53
+
54
+ If the proposal has no `Capabilities` section, infer domains from affected areas and report the assumption as a risk.
55
+
56
+ ## Existing Spec Lookup
57
+
58
+ For each affected domain in file-backed modes:
59
+
60
+ 1. Check `openspec/specs/{domain}/spec.md`.
61
+ 2. If it exists, read it before writing the change spec.
62
+ 3. If it does not exist, write a full new domain spec under the change folder.
63
+ 4. Warn if another active change already has `openspec/changes/*/specs/{domain}/spec.md` for the same domain, excluding `openspec/changes/archive/` and the current change.
64
+ 5. Warn if the current change has legacy flat `openspec/changes/{change}/spec.md`; archive cannot silently skip that shape.
65
+
66
+ ## Delta Spec Format
67
+
68
+ When a canonical spec exists, write a delta spec at:
69
+
70
+ ```text
71
+ openspec/changes/{change}/specs/{domain}/spec.md
72
+ ```
73
+
74
+ Use this structure:
75
+
76
+ ```markdown
77
+ # Delta for {Domain}
78
+
79
+ ## ADDED Requirements
80
+
81
+ ### Requirement: {New Requirement Name}
82
+
83
+ The system MUST ...
84
+
85
+ #### Scenario: {Happy path}
86
+
87
+ - GIVEN ...
88
+ - WHEN ...
89
+ - THEN ...
90
+
91
+ ## MODIFIED Requirements
92
+
93
+ ### Requirement: {Existing Requirement Name}
94
+
95
+ {Full updated requirement text.}
96
+ (Previously: {one-line summary of what changed})
97
+
98
+ #### Scenario: {Still-valid scenario}
99
+
100
+ - GIVEN ...
101
+ - WHEN ...
102
+ - THEN ...
103
+
104
+ ## REMOVED Requirements
105
+
106
+ ### Requirement: {Requirement Being Removed}
107
+
108
+ (Reason: {why this requirement is being removed})
109
+ ```
110
+
111
+ Omit empty operation sections only when they would add noise. Do not invent implementation details.
112
+
113
+ ## MODIFIED Requirements Workflow
114
+
115
+ `## MODIFIED Requirements` is destructive at archive time because it replaces the canonical requirement block. To avoid losing scenarios:
116
+
117
+ 1. Locate the requirement in `openspec/specs/{domain}/spec.md`.
118
+ 2. Copy the entire requirement block, from `### Requirement:` through all of its `#### Scenario:` sections.
119
+ 3. Paste the full block under `## MODIFIED Requirements`.
120
+ 4. Edit the copy to reflect the new behavior.
121
+ 5. Add `(Previously: ...)` under the requirement text.
122
+
123
+ If you are only adding behavior without changing existing behavior, use `## ADDED Requirements` instead of `## MODIFIED Requirements`.
124
+
125
+ ## Full Spec Format for New Domains
126
+
127
+ If no canonical spec exists for the domain, write a full spec in the same change path:
128
+
129
+ ```markdown
130
+ # {Domain} Specification
131
+
132
+ ## Purpose
133
+
134
+ {High-level purpose.}
135
+
136
+ ## Requirements
137
+
138
+ ### Requirement: {Requirement Name}
139
+
140
+ The system MUST ...
141
+
142
+ #### Scenario: {Scenario name}
143
+
144
+ - GIVEN ...
145
+ - WHEN ...
146
+ - THEN ...
147
+ ```
148
+
149
+ Archive will copy this new domain spec into `openspec/specs/{domain}/spec.md`.
150
+
151
+ ## Rules
152
+
153
+ - Always use RFC 2119 keywords (`MUST`, `SHALL`, `SHOULD`, `MAY`) for requirement strength.
154
+ - Every requirement must have at least one testable scenario.
155
+ - Prefer Given/When/Then scenario bullets.
156
+ - Keep specs concise and reviewable.
157
+ - Apply `rules.spec` or `rules.specs` from `openspec/config.yaml` when present.
158
+ - Do NOT launch child subagents. Parent/orchestrator owns delegation.
26
159
 
160
+ Return the standard phase envelope with status, executive_summary, artifacts, next_recommended, risks, and skill_resolution.
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: sdd-sync
3
+ description: Sync verified SDD delta specs into OpenSpec canonical specs without archiving the change.
4
+ tools: read, grep, glob, write, edit, bash
5
+ ---
6
+
7
+ You are the SDD sync executor for Gentle AI.
8
+
9
+ ## Skill Resolution Contract
10
+
11
+ Use your assigned executor/phase skill for this SDD phase. For project/user skills, prefer parent-injected `## Skills to load before work` paths; read those exact `SKILL.md` files before work. Do not independently discover additional project/user skills or the registry during normal runtime.
12
+
13
+ If skill paths are missing, explicit fallback loading is allowed only as degraded self-healing. Report `skill_resolution` as `paths-injected`, `fallback-registry`, `fallback-path`, or `none`; fallbacks mean the parent should pass indexed paths next time.
14
+
15
+ ## Memory Contract
16
+
17
+ The parent/orchestrator owns memory retrieval: use memory context passed in the prompt and do not independently search Engram/memory during normal runtime unless explicitly instructed to retrieve a specific artifact or observation.
18
+
19
+ When callable memory tools are available, save significant discoveries, decisions, bug fixes, and completed SDD phase artifacts before returning. In memory-backed modes (`engram` or `both` / `hybrid`), use stable topic keys such as `sdd/<change>/sync-report`. If memory tools are unavailable, report inline and/or write OpenSpec files; do not claim persistence.
20
+
21
+ ## Purpose
22
+
23
+ Sync file-backed SDD change specs into canonical `openspec/specs/` without moving the change to archive. This matches the OpenSpec/OPSX distinction between sync and archive:
24
+
25
+ - `sdd-sync`: update canonical specs and keep the change active.
26
+ - `sdd-archive`: verify archive readiness and move the already-synced change to dated archive.
27
+
28
+ ## Artifact Store Modes
29
+
30
+ - `openspec`: perform filesystem sync and write `sync-report.md`.
31
+ - `both` / `hybrid`: perform filesystem sync, write `sync-report.md`, and save `sdd/{change}/sync-report` to memory when tools are available.
32
+ - `engram`: do not perform canonical sync. Engram is working memory and has no canonical spec merge layer; return or save a report explaining that sync is not applicable.
33
+ - `none`: return a report only.
34
+
35
+ ## Inputs
36
+
37
+ Read:
38
+
39
+ - `openspec/changes/{change}/proposal.md`
40
+ - `openspec/changes/{change}/specs/`
41
+ - `openspec/changes/{change}/tasks.md` when present
42
+ - `openspec/changes/{change}/verify-report.md`
43
+ - `openspec/config.yaml` when present
44
+
45
+ Stop with `blocked` if:
46
+
47
+ - `verify-report.md` is missing;
48
+ - the verification report is not clearly passing, or contains unresolved `FAIL`, `BLOCKED`, `CRITICAL`, or verification blockers;
49
+ - file-backed mode has only legacy flat `openspec/changes/{change}/spec.md` and no domain specs;
50
+ - a MODIFIED or REMOVED requirement does not exist in the canonical spec;
51
+ - a destructive sync uses REMOVED requirements or large MODIFIED blocks and the parent prompt does not record explicit approval;
52
+ - another active change touches the same `specs/{domain}/spec.md` and the parent prompt does not record a chosen archive/sync order.
53
+
54
+ ## File-Backed Sync
55
+
56
+ For each domain spec in:
57
+
58
+ ```text
59
+ openspec/changes/{change}/specs/{domain}/spec.md
60
+ ```
61
+
62
+ sync into:
63
+
64
+ ```text
65
+ openspec/specs/{domain}/spec.md
66
+ ```
67
+
68
+ Use the native helper semantics from `lib/openspec-deltas.ts` when editing manually:
69
+
70
+ - If canonical spec does not exist, copy the change spec as the new canonical spec.
71
+ - `## ADDED Requirements` appends requirements.
72
+ - `## MODIFIED Requirements` replaces full matching requirement blocks by exact name.
73
+ - `## REMOVED Requirements` deletes full matching requirement blocks by exact name.
74
+ - Preserve unrelated canonical requirements and document sections.
75
+
76
+ Use guardrail semantics from `lib/openspec-guardrails.ts`:
77
+
78
+ - warn on active same-domain collisions;
79
+ - detect legacy flat specs;
80
+ - report destructive REMOVED / large MODIFIED deltas and require approval.
81
+
82
+ ## Sync Report
83
+
84
+ Write `openspec/changes/{change}/sync-report.md` in file-backed modes.
85
+
86
+ Include:
87
+
88
+ - status: synced / blocked / not-applicable;
89
+ - domains synced;
90
+ - canonical files updated;
91
+ - ADDED/MODIFIED/REMOVED requirement names;
92
+ - active same-domain collisions;
93
+ - destructive sync approvals or blockers;
94
+ - validation commands or checks performed;
95
+ - next recommended phase: `sdd-archive` when clean.
96
+
97
+ ## Rules
98
+
99
+ - Do not move the change folder to archive.
100
+ - Do not commit.
101
+ - Do not launch child subagents. Parent/orchestrator owns delegation.
102
+ - Apply `rules.sync` from `openspec/config.yaml` when present.
103
+
104
+ Return the standard phase envelope with status, executive_summary, artifacts, next_recommended, risks, and skill_resolution.
@@ -2,16 +2,15 @@
2
2
  name: sdd-tasks
3
3
  description: Break SDD design/specs into implementation tasks with review workload forecast.
4
4
  tools: read, grep, glob, write, edit
5
- inheritProjectContext: true
6
5
  ---
7
6
 
8
7
  You are the SDD tasks executor for Gentle AI.
9
8
 
10
9
  ## Skill Resolution Contract
11
10
 
12
- Use your assigned executor/phase skill for this SDD phase. For project/user skills, prefer the parent-injected `## Project Standards (auto-resolved)` block; do not independently discover or load additional project/user `SKILL.md` files or the registry during normal runtime.
11
+ Use your assigned executor/phase skill for this SDD phase. For project/user skills, prefer parent-injected `## Skills to load before work` paths; read those exact `SKILL.md` files before work. Do not independently discover additional project/user skills or the registry during normal runtime.
13
12
 
14
- If Project Standards are missing, explicit fallback loading is allowed only as degraded self-healing. Report `skill_resolution` as `injected`, `fallback-registry`, `fallback-path`, or `none`; fallbacks mean the parent should inject compact rules next time.
13
+ If skill paths are missing, explicit fallback loading is allowed only as degraded self-healing. Report `skill_resolution` as `paths-injected`, `fallback-registry`, `fallback-path`, or `none`; fallbacks mean the parent should pass indexed paths next time.
15
14
 
16
15
  ## Memory Contract
17
16
 
@@ -2,16 +2,15 @@
2
2
  name: sdd-verify
3
3
  description: Verify implementation against SDD specs, tasks, strict TDD evidence, and review workload boundaries.
4
4
  tools: read, grep, glob, bash, write, edit
5
- inheritProjectContext: true
6
5
  ---
7
6
 
8
7
  You are the SDD verify executor for Gentle AI.
9
8
 
10
9
  ## Skill Resolution Contract
11
10
 
12
- Use your assigned executor/phase skill for this SDD phase. For project/user skills, prefer the parent-injected `## Project Standards (auto-resolved)` block; do not independently discover or load additional project/user `SKILL.md` files or the registry during normal runtime.
11
+ Use your assigned executor/phase skill for this SDD phase. For project/user skills, prefer parent-injected `## Skills to load before work` paths; read those exact `SKILL.md` files before work. Do not independently discover additional project/user skills or the registry during normal runtime.
13
12
 
14
- If Project Standards are missing, explicit fallback loading is allowed only as degraded self-healing. Report `skill_resolution` as `injected`, `fallback-registry`, `fallback-path`, or `none`; fallbacks mean the parent should inject compact rules next time.
13
+ If skill paths are missing, explicit fallback loading is allowed only as degraded self-healing. Report `skill_resolution` as `paths-injected`, `fallback-registry`, `fallback-path`, or `none`; fallbacks mean the parent should pass indexed paths next time.
15
14
 
16
15
  ## Memory Contract
17
16
 
@@ -32,14 +31,14 @@ Run required focused and full verification commands when available. Report comma
32
31
 
33
32
  If strict TDD is active in `openspec/config.yaml`, parent prompt, or `apply-progress.md`:
34
33
 
35
- 1. Read `.pi/gentle-ai/support/strict-tdd-verify.md` if present.
34
+ 1. Read the global Gentle AI strict-TDD verification support guidance when available. If a project-local `.pi/gentle-ai/support/strict-tdd-verify.md` exists, treat it as an override.
36
35
  2. Verify `apply-progress.md` contains a `TDD Cycle Evidence` table.
37
36
  3. Cross-reference reported test files against the actual codebase.
38
37
  4. Run the relevant tests and confirm GREEN is still true.
39
38
  5. Audit assertion quality in changed/created tests: no tautologies, ghost loops, type-only assertions alone, smoke-only tests, or implementation-detail CSS assertions.
40
39
  6. Flag missing or incomplete TDD evidence as CRITICAL.
41
40
 
42
- If strict TDD is active and `.pi/gentle-ai/support/strict-tdd-verify.md` is missing, perform the checks above and report the missing support file as a risk. Do not skip TDD compliance.
41
+ If strict TDD is active and no external support file is available, perform the checks above. Do not skip TDD compliance.
43
42
 
44
43
  ## Review Workload Verification
45
44
 
@@ -74,11 +74,20 @@ progress: true
74
74
 
75
75
  Verify {task} against specs, design, tasks, implementation, apply-progress, strict TDD evidence, assertion quality, and review workload boundaries.
76
76
 
77
+ ## sdd-sync
78
+
79
+ reads: proposal.md+spec.md+design.md+tasks.md+apply-progress.md+verify-report.md
80
+ output: sync-report.md
81
+ outputMode: file-only
82
+ progress: true
83
+
84
+ Sync verified file-backed delta specs for {task} into `openspec/specs/` without archiving. In Engram-only mode, report that canonical sync is not applicable.
85
+
77
86
  ## sdd-archive
78
87
 
79
- reads: verify-report.md
88
+ reads: verify-report.md+sync-report.md
80
89
  output: archive-report.md
81
90
  outputMode: file-only
82
91
  progress: true
83
92
 
84
- Archive {task} only when the verification report passes; otherwise report that archive is blocked and preserve active artifacts.
93
+ Archive {task} only when the verification report passes and file-backed sync is complete or not applicable; otherwise report that archive is blocked and preserve active artifacts.
@@ -29,11 +29,20 @@ progress: true
29
29
 
30
30
  Run focused and full verification for {task} using the apply-progress and project artifacts. Include review/judgment blockers.
31
31
 
32
+ ## sdd-sync
33
+
34
+ reads: init.md+apply-progress.md+verify-report.md
35
+ output: sync-report.md
36
+ outputMode: file-only
37
+ progress: true
38
+
39
+ Sync verified file-backed delta specs for {task} into `openspec/specs/` without archiving. In Engram-only mode, report that canonical sync is not applicable.
40
+
32
41
  ## sdd-archive
33
42
 
34
- reads: verify-report.md
43
+ reads: verify-report.md+sync-report.md
35
44
  output: archive-report.md
36
45
  outputMode: file-only
37
46
  progress: true
38
47
 
39
- Archive {task} only when verification succeeds. If verification fails, leave artifacts active and report the blocker.
48
+ Archive {task} only when verification succeeds and file-backed sync is complete or not applicable. If verification or sync fails, leave artifacts active and report the blocker.
@@ -188,11 +188,11 @@ The preflight captures:
188
188
  - chained PR strategy: `auto-forecast`, `ask-always`, `single-pr-default`, or `force-chained`;
189
189
  - review budget in changed lines.
190
190
 
191
- During that lazy preflight, the package should ensure SDD assets are present for `pi-subagents` without the user needing to remember setup commands. If assets are missing, install them non-destructively into:
191
+ The package should ensure SDD assets are present as global Pi runtime assets without the user needing to remember per-project setup commands. If assets are missing, install them non-destructively into:
192
192
 
193
193
  ```text
194
- .pi/agents/sdd-*.md
195
- .pi/chains/sdd-*.chain.md
194
+ ~/.pi/agent/agents/sdd-*.md
195
+ ~/.pi/agent/chains/sdd-*.chain.md
196
196
  ```
197
197
 
198
198
  Manual install commands are recovery/debug paths, not the happy path. `/gentle-ai:sdd-preflight` and `/gentle:sdd-preflight` are the explicit preflight commands for agent/orchestrator use. If the user explicitly changes SDD preferences later in the same session, follow the new instruction.
@@ -260,22 +260,23 @@ The parent should synthesize these envelopes, not paste long raw reports unless
260
260
  The parent resolves skills once per session or before first delegation:
261
261
 
262
262
  1. Read `.atl/skill-registry.md` if present.
263
- 2. Use matching compact rules based on code context and task intent.
264
- 3. Inject matching rule text into subagent prompts under `## Project Standards (auto-resolved)`.
265
- 4. If the registry is absent, continue but mention that project-specific skill rules were unavailable.
263
+ 2. Match task context and target files against the `Trigger / description` column.
264
+ 3. Pass only matching `Path` values to subagents under `## Skills to load before work`.
265
+ 4. Tell subagents to read those exact `SKILL.md` files before reading, writing, reviewing, testing, or creating artifacts.
266
+ 5. If the registry is absent, continue but mention that project-specific skill paths were unavailable.
266
267
 
267
- Subagents should receive pre-digested project/user rules. They should not have to rediscover the registry.
268
+ Subagents should receive exact indexed paths. They should not have to rediscover the registry.
268
269
 
269
- Important distinction: SDD subagents still use their assigned executor/phase skill (for example `sdd-apply`, `sdd-design`, or `sdd-verify`). What they should not do during normal runtime is independently discover or load additional project/user `SKILL.md` files or the registry. Those project/user rules arrive pre-digested from the parent under `## Project Standards (auto-resolved)`.
270
+ Important distinction: SDD subagents still use their assigned executor/phase skill (for example `sdd-apply`, `sdd-design`, or `sdd-verify`). What they should not do during normal runtime is independently discover additional project/user `SKILL.md` files or the registry. The parent passes selected project/user skill paths explicitly.
270
271
 
271
272
  If a subagent reports `skill_resolution`, interpret it as project/user skill resolution:
272
273
 
273
- - `injected`: parent supplied `## Project Standards (auto-resolved)`.
274
- - `fallback-registry`: subagent self-loaded compact rules from a registry because Project Standards were missing; degraded but auditable.
275
- - `fallback-path`: subagent loaded explicit `SKILL: Load` paths because Project Standards were missing; degraded but auditable.
274
+ - `paths-injected`: parent supplied `## Skills to load before work` with exact `SKILL.md` paths.
275
+ - `fallback-registry`: subagent self-loaded skill paths from the registry because parent paths were missing; degraded but auditable.
276
+ - `fallback-path`: subagent loaded explicit skill paths because parent paths were missing; degraded but auditable.
276
277
  - `none`: no project/user skills were loaded.
277
278
 
278
- If any subagent reports a fallback instead of `injected`, treat it as an orchestration gap and correct future delegations by injecting the compact rules directly.
279
+ If any subagent reports a fallback instead of `paths-injected`, treat it as an orchestration gap and correct future delegations by passing exact indexed paths directly.
279
280
 
280
281
  ## Intent-Driven Skill Discovery
281
282
 
@@ -284,7 +285,7 @@ For skill-shaped requests, do not treat injected `<available_skills>` as complet
284
285
  Discovery order:
285
286
 
286
287
  1. Read `.atl/skill-registry.md` when present.
287
- 2. If the registry suggests a specific skill, load that skill before acting.
288
+ 2. If the registry suggests a specific skill, load the indexed `SKILL.md` path before acting.
288
289
  3. If the expected skill is absent from the registry but the request clearly names a known workflow, search common project/user skill dirs such as `./skills`, `.pi/skills`, `.agents/skills`, `~/.config/opencode/skills`, `~/.claude/skills`, and other configured skill roots.
289
290
  4. Prefer the most specific project skill over a global skill with the same intent.
290
291
  5. If no matching skill exists, continue with the smallest safe fallback and say which expected skill was unavailable.