@pasko70/pibo 1.9.11 → 1.9.13

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.
Files changed (111) hide show
  1. package/README.md +183 -183
  2. package/context/codex-base-prompt.md +148 -148
  3. package/context/compute-worker.md +23 -23
  4. package/context/pibo-compaction-prompt.md +100 -100
  5. package/context/pibo-native-tooling.md +18 -18
  6. package/context/pibo-system-prompt.md +77 -77
  7. package/dist/apps/chat/agent-store.js +248 -248
  8. package/dist/apps/chat/data/project-service.js +168 -168
  9. package/dist/apps/chat/data/read-state-service.js +18 -18
  10. package/dist/apps/chat/data/session-query-service.js +25 -25
  11. package/dist/apps/chat/data/timeline-query-service.js +25 -14
  12. package/dist/apps/chat/static-assets.js +854 -854
  13. package/dist/apps/chat/trace.js +2 -0
  14. package/dist/apps/chat/web-app.js +7 -0
  15. package/dist/apps/chat/workflow-persistence.js +255 -255
  16. package/dist/apps/chat-ui/index.html +16 -16
  17. package/dist/apps/chat-ui/manifest.webmanifest +25 -25
  18. package/dist/apps/chat-ui/sw.js +47 -47
  19. package/dist/apps/chat-vscode-web/index.html +12 -12
  20. package/dist/apps/cli-ui/cliSessionsCommand.js +23 -23
  21. package/dist/apps/context-files-ui/index.html +11 -11
  22. package/dist/apps/vscode-artifacts/latest.vsix +0 -0
  23. package/dist/apps/vscode-artifacts/pibo-vscode-ext-1.9.13.vsix +0 -0
  24. package/dist/cli.js +39 -39
  25. package/dist/compute/cli.js +54 -54
  26. package/dist/cron/cli.js +15 -15
  27. package/dist/cron/store.js +49 -49
  28. package/dist/data/cli.js +23 -23
  29. package/dist/data/event-log.js +23 -23
  30. package/dist/data/ingest-service.js +7 -0
  31. package/dist/data/message-store.js +31 -20
  32. package/dist/data/navigation-store.js +9 -9
  33. package/dist/data/observation-store.js +4 -4
  34. package/dist/data/payload-store.js +17 -17
  35. package/dist/data/schema.js +433 -431
  36. package/dist/data/session-store.js +4 -4
  37. package/dist/data/telemetry-queries.js +54 -54
  38. package/dist/data/telemetry.js +197 -197
  39. package/dist/debug/events.js +12 -12
  40. package/dist/debug/failures.js +6 -6
  41. package/dist/debug/index.js +227 -227
  42. package/dist/debug/messages.js +6 -6
  43. package/dist/debug/pty.js +124 -124
  44. package/dist/debug/session.js +29 -29
  45. package/dist/debug/tools.js +5 -5
  46. package/dist/debug/web-snapshot-browser-scripts.js +294 -294
  47. package/dist/debug/web-streaming-browser-library.js +925 -925
  48. package/dist/debug/web-streaming-browser-scripts.js +232 -232
  49. package/dist/debug/web-streaming-provider-telemetry.js +4 -4
  50. package/dist/debug/web.js +93 -93
  51. package/dist/gateway/cli.js +19 -19
  52. package/dist/mcp/config-command.js +53 -53
  53. package/dist/mcp/index.js +21 -21
  54. package/dist/mcp/registry.js +11 -11
  55. package/dist/pi-packages/cli.js +11 -11
  56. package/dist/plugins/context-files-store.js +110 -110
  57. package/dist/plugins/context-files.js +4 -4
  58. package/dist/ralph/cli.js +18 -18
  59. package/dist/ralph/templates.js +140 -140
  60. package/dist/reliability/store.js +226 -226
  61. package/dist/resources/lifecycle.js +4 -6
  62. package/dist/resources/reaper-state.js +30 -3
  63. package/dist/resources/reaper.js +43 -15
  64. package/dist/sessions/pibo-data-store.js +16 -16
  65. package/dist/sessions/sqlite-store.js +53 -53
  66. package/dist/setup/cli.js +58 -58
  67. package/dist/shared/trace-engine.js +3 -2
  68. package/dist/shared/trace-event-projection.js +26 -0
  69. package/dist/tools/agent-browser-wrapper.js +80 -80
  70. package/dist/tools/browser-use-cdp.js +12 -12
  71. package/dist/tools/browser-use-wrapper.js +762 -762
  72. package/dist/tools/guides.js +538 -538
  73. package/dist/tools/index.js +99 -99
  74. package/dist/tools/runtime/node-worker-source.js +205 -205
  75. package/dist/tools/runtime/python-worker-source.js +177 -177
  76. package/dist/vscode/cli.js +9 -9
  77. package/dist/web-annotations/cdp.js +900 -900
  78. package/dist/web-annotations/store.js +96 -96
  79. package/docs/README.md +23 -23
  80. package/docs/ops/install-developer-host.md +112 -112
  81. package/docs/ops/install-user-host.md +96 -96
  82. package/docs/ops/upgrade-user-to-developer-host.md +69 -69
  83. package/docs/ops/vscode-extension-release.md +160 -160
  84. package/package.json +95 -95
  85. package/skills/builtin/graphify/SKILL.md +52 -52
  86. package/skills/builtin/pi-agent-harness/SKILL.md +319 -319
  87. package/skills/builtin/pi-agent-harness/agents/openai.yaml +4 -4
  88. package/skills/builtin/pibo-docker-system/SKILL.md +170 -170
  89. package/skills/builtin/pibo-spec-writing/SKILL.md +330 -330
  90. package/skills/builtin/prd/SKILL.md +143 -143
  91. package/skills/builtin/ralph-loop/SKILL.md +359 -359
  92. package/skills/builtin/ralph-prd-json/SKILL.md +123 -123
  93. package/skills/builtin/skill-creator/LICENSE.txt +201 -201
  94. package/skills/builtin/skill-creator/SKILL.md +513 -513
  95. package/skills/builtin/skill-creator/agents/analyzer.md +274 -274
  96. package/skills/builtin/skill-creator/agents/comparator.md +202 -202
  97. package/skills/builtin/skill-creator/agents/grader.md +223 -223
  98. package/skills/builtin/skill-creator/assets/eval_review.html +146 -146
  99. package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -471
  100. package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -1325
  101. package/skills/builtin/skill-creator/references/schemas.md +430 -430
  102. package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -401
  103. package/skills/builtin/skill-creator/scripts/generate_report.py +326 -326
  104. package/skills/builtin/skill-creator/scripts/improve_description.py +247 -247
  105. package/skills/builtin/skill-creator/scripts/package_skill.py +136 -136
  106. package/skills/builtin/skill-creator/scripts/quick_validate.py +102 -102
  107. package/skills/builtin/skill-creator/scripts/run_eval.py +310 -310
  108. package/skills/builtin/skill-creator/scripts/run_loop.py +328 -328
  109. package/skills/builtin/skill-creator/scripts/utils.py +47 -47
  110. package/skills/builtin/web-annotations/SKILL.md +93 -93
  111. package/src/mcp/LICENSE.mcp-cli +21 -21
@@ -1,330 +1,330 @@
1
- ---
2
- name: pibo-spec-writing
3
- description: Defines how Pibo specs are written, structured, reviewed, and split into proposals, capability specs, phase specs, designs, and tasks. Use this whenever the user asks to create, review, rewrite, compare, or implement a spec; mentions requirements, acceptance criteria, scope, roadmap, proposal, design plan, tasks, OpenSpec, Spec Kit, GSD, or spec-driven development; or asks where project documentation should live.
4
- ---
5
-
6
- # Pibo Spec Writing
7
-
8
- Use this skill when creating or reviewing specs for Pibo. A good Pibo spec is behavior-first, scoped, testable, concise, and traceable to implementation work. Keep implementation details out of the spec unless they are externally visible constraints.
9
-
10
- ## Core principles
11
-
12
- Write specs so another agent can implement and verify the work without reading the original chat.
13
-
14
- 1. Start with why the change matters.
15
- 2. Define the observable behavior, not the code shape.
16
- 3. Bound the scope with clear in-scope and out-of-scope lists.
17
- 4. Make every requirement testable.
18
- 5. Add scenarios or acceptance criteria for each important behavior.
19
- 6. Track assumptions and open questions instead of hiding them.
20
- 7. Link requirements to phases, tasks, or plans when the work is large.
21
- 8. Use clear prose: active voice, concrete words, short paragraphs, and no puffery.
22
- 9. For user-facing UI, CLI, TUI, gateway, runtime, or agent-routing changes, name the expected verification level instead of assuming unit tests are enough.
23
-
24
- ## Where specs live
25
-
26
- Follow the project documentation structure:
27
-
28
- ```text
29
- docs/
30
- project/ Current project docs and canonical documentation
31
- specs/ Product, technical, and implementation specifications
32
- plans/ Implementation plans and design plans
33
- reports/ Investigation, validation, and generated reports
34
- legacy/ Old documentation kept for reference
35
- ```
36
-
37
- Do not create new root-level `plans/`, `reports/`, or `specs/` directories.
38
-
39
- Use `docs/specs/` for durable specs. Use `docs/plans/` for implementation plans. Use `docs/reports/` for analyses, validations, and findings.
40
-
41
- ## Choose the right spec shape
42
-
43
- ### Capability spec
44
-
45
- Use a capability spec for durable system behavior, especially behavior that should remain true after the current change ships.
46
-
47
- Good path:
48
-
49
- ```text
50
- docs/specs/capabilities/<capability-name>.md
51
- ```
52
-
53
- Use this for auth behavior, session routing, profile behavior, tool registration, gateway contracts, API behavior, UI behavior, or other long-lived contracts.
54
-
55
- ### Change spec
56
-
57
- Use a change spec when proposing a feature, fix, or migration.
58
-
59
- Good path:
60
-
61
- ```text
62
- docs/specs/changes/<change-name>/
63
- proposal.md
64
- spec.md
65
- design.md # include when technical choices matter
66
- tasks.md # include when ready to implement
67
- ```
68
-
69
- ### Phase spec
70
-
71
- Use a phase spec for multi-step work that needs a roadmap.
72
-
73
- Good path:
74
-
75
- ```text
76
- docs/specs/phases/<NN-phase-name>/
77
- spec.md
78
- context.md # implementation decisions, references, existing-code notes
79
- ```
80
-
81
- ## Required structure for most Pibo specs
82
-
83
- Use this template unless the task clearly needs a smaller artifact.
84
-
85
- ```markdown
86
- # Spec: [Name]
87
-
88
- **Status:** Draft | Approved | Implementing | Done
89
- **Created:** YYYY-MM-DD
90
- **Requester / Source:** [user, issue, discussion, or change]
91
- **Related docs:** [links]
92
-
93
- ## Why
94
-
95
- [Problem, opportunity, or user need. One or two concrete paragraphs.]
96
-
97
- ## Goal
98
-
99
- [One precise sentence that says what changes from current state to target state.]
100
-
101
- ## Background / Current State
102
-
103
- [What exists today. What is broken, missing, confusing, slow, unsafe, or expensive.]
104
-
105
- ## Scope
106
-
107
- ### In Scope
108
-
109
- - [Concrete behavior or deliverable]
110
-
111
- ### Out of Scope
112
-
113
- - [Excluded item] — [reason]
114
-
115
- ## Requirements
116
-
117
- ### Requirement: [Name]
118
-
119
- The system MUST/SHALL [observable behavior].
120
-
121
- #### Current
122
-
123
- [Current behavior or absence of behavior.]
124
-
125
- #### Target
126
-
127
- [Desired behavior.]
128
-
129
- #### Acceptance
130
-
131
- [Concrete pass/fail check.]
132
-
133
- #### Scenario: [Name]
134
-
135
- - GIVEN [state]
136
- - WHEN [action/event]
137
- - THEN [expected outcome]
138
-
139
- ## Edge Cases
140
-
141
- - [Boundary, failure, permission, concurrency, or empty-state case]
142
-
143
- ## Constraints
144
-
145
- - **Compatibility:** ...
146
- - **Security / Privacy:** ...
147
- - **Performance:** ...
148
- - **Dependencies:** ...
149
-
150
- ## Success Criteria
151
-
152
- - [ ] SC-001: [Measurable or directly observable outcome]
153
- - [ ] SC-002: [Another pass/fail outcome]
154
-
155
- ## Assumptions and Open Questions
156
-
157
- ### Assumptions
158
-
159
- - [Reasonable default taken to keep progress moving]
160
-
161
- ### Open Questions
162
-
163
- - [Question that materially affects scope, UX, security, or architecture]
164
-
165
- ## Traceability
166
-
167
- | Requirement | Scenario / Story | Plan / Task | Status |
168
- |---|---|---|---|
169
- | REQ-001 | [Scenario] | [Plan or task] | Pending |
170
- ```
171
-
172
- ## Minimal spec
173
-
174
- For small work, use the shortest form that remains testable:
175
-
176
- ```markdown
177
- # Spec: [Name]
178
-
179
- ## Why
180
- ## Goal
181
- ## Scope
182
- ### In Scope
183
- ### Out of Scope
184
- ## Requirements
185
- ## Acceptance Criteria
186
- ## Assumptions / Open Questions
187
- ```
188
-
189
- Use the full template when the change touches multiple modules, changes public behavior, affects auth/security/data, or will be implemented across multiple sessions.
190
-
191
- ## Requirement rules
192
-
193
- Write requirements as behavior contracts.
194
-
195
- Good:
196
-
197
- ```markdown
198
- ### Requirement: Dev gateway status is discoverable
199
-
200
- The CLI MUST show whether the dev gateway is running, its PID when known, and the command to inspect logs.
201
-
202
- #### Scenario: Gateway is running
203
- - GIVEN the dev gateway process is active
204
- - WHEN an operator runs `pibo gateway dev status`
205
- - THEN the output includes status, PID, port, and next diagnostic command
206
- ```
207
-
208
- Weak:
209
-
210
- ```markdown
211
- ### Requirement: Improve gateway status
212
- Make gateway status better and more robust.
213
- ```
214
-
215
- A requirement is ready when a reviewer can say pass or fail without guessing.
216
-
217
- ## Reuse, parity, and verification clarity
218
-
219
- When a feature is described as "same as Web", "derived from Web", "reuse the view", "shared UI", "Terminal View", or similar, do not silently reduce that to shared data. State the intended reuse level:
220
-
221
- - data/state only
222
- - renderer-neutral view model
223
- - interaction/controller logic
224
- - renderer/component logic
225
- - visual and behavioral parity
226
-
227
- If visual or behavioral parity is required, add acceptance checks that compare the relevant surfaces with the same fixture or user flow. If parity is intentionally out of scope, say so and describe the user-visible difference.
228
-
229
- For user-facing UI, CLI, TUI, gateway, runtime, auth, or agent-routing specs, include at least one realistic validation scenario for the default user path when feasible. Fake data, demo mode, mocks, and render snapshots are useful, but they should not be the only acceptance evidence for behavior users will exercise directly unless the real path is unavailable or explicitly out of scope.
230
-
231
- ## Scenario rules
232
-
233
- Prefer GIVEN / WHEN / THEN for user-visible behavior and system contracts. Use WHEN / THEN only for simple event-response behavior.
234
-
235
- Cover at least:
236
-
237
- - primary success path
238
- - empty or missing state
239
- - invalid input or permission failure
240
- - migration or compatibility path when relevant
241
-
242
- ## Proposal structure
243
-
244
- Use `proposal.md` to explain intent before deep design.
245
-
246
- ```markdown
247
- # Proposal: [Change]
248
-
249
- ## Why
250
-
251
- ## What Changes
252
-
253
- ## Capabilities
254
-
255
- ### New Capabilities
256
- - `<kebab-name>`: [brief behavior area]
257
-
258
- ### Modified Capabilities
259
- - `<existing-name>`: [changed behavior]
260
-
261
- ## Impact
262
-
263
- - **Code:** ...
264
- - **APIs / CLI:** ...
265
- - **Data:** ...
266
- - **Auth / Security:** ...
267
- - **Docs:** ...
268
- ```
269
-
270
- ## Design structure
271
-
272
- Use `design.md` when technical choices matter. Keep requirements in the spec; put implementation choices here.
273
-
274
- ```markdown
275
- # Design: [Change]
276
-
277
- ## Context
278
- ## Goals / Non-Goals
279
- ## Decisions
280
- ### Decision: [Choice]
281
- - **Choice:** ...
282
- - **Rationale:** ...
283
- - **Alternatives considered:** ...
284
-
285
- ## Risks / Trade-offs
286
- ## Migration / Rollback
287
- ## Open Questions
288
- ```
289
-
290
- ## Tasks structure
291
-
292
- Use `tasks.md` only after the spec and design are stable enough to act on.
293
-
294
- ```markdown
295
- # Tasks: [Change]
296
-
297
- ## 1. Setup / Foundation
298
- - [ ] 1.1 [Concrete task with file path]
299
-
300
- ## 2. Requirement: [Name]
301
- - [ ] 2.1 [Test or validation task]
302
- - [ ] 2.2 [Implementation task]
303
-
304
- ## 3. Validation
305
- - [ ] 3.1 Run [command]
306
- - [ ] 3.2 Verify [observable behavior]
307
- ```
308
-
309
- Tasks should be small enough for one agent session. Include file paths and validation commands when known.
310
-
311
- ## Review checklist
312
-
313
- Before treating a spec as ready, check:
314
-
315
- - [ ] The `Why` names a real problem or opportunity.
316
- - [ ] The `Goal` is specific and measurable.
317
- - [ ] Scope has both in-scope and out-of-scope items.
318
- - [ ] Requirements use MUST or SHALL for mandatory behavior.
319
- - [ ] Each requirement has acceptance checks or scenarios.
320
- - [ ] Edge cases include failure and empty-state behavior where relevant.
321
- - [ ] Assumptions are visible.
322
- - [ ] Open questions are few and material.
323
- - [ ] Implementation details live in `design.md` or `tasks.md`, not in behavioral requirements.
324
- - [ ] The spec is concise, concrete, and free of promotional language.
325
-
326
- ## Writing style
327
-
328
- Write for humans and agents. Prefer short sentences. Use active voice. Omit needless words. Avoid vague adjectives such as robust, seamless, powerful, and cutting-edge. Replace them with concrete behavior.
329
-
330
- Use tables only when they make comparison or traceability easier. Do not decorate specs with excessive emoji or bold text.
1
+ ---
2
+ name: pibo-spec-writing
3
+ description: Defines how Pibo specs are written, structured, reviewed, and split into proposals, capability specs, phase specs, designs, and tasks. Use this whenever the user asks to create, review, rewrite, compare, or implement a spec; mentions requirements, acceptance criteria, scope, roadmap, proposal, design plan, tasks, OpenSpec, Spec Kit, GSD, or spec-driven development; or asks where project documentation should live.
4
+ ---
5
+
6
+ # Pibo Spec Writing
7
+
8
+ Use this skill when creating or reviewing specs for Pibo. A good Pibo spec is behavior-first, scoped, testable, concise, and traceable to implementation work. Keep implementation details out of the spec unless they are externally visible constraints.
9
+
10
+ ## Core principles
11
+
12
+ Write specs so another agent can implement and verify the work without reading the original chat.
13
+
14
+ 1. Start with why the change matters.
15
+ 2. Define the observable behavior, not the code shape.
16
+ 3. Bound the scope with clear in-scope and out-of-scope lists.
17
+ 4. Make every requirement testable.
18
+ 5. Add scenarios or acceptance criteria for each important behavior.
19
+ 6. Track assumptions and open questions instead of hiding them.
20
+ 7. Link requirements to phases, tasks, or plans when the work is large.
21
+ 8. Use clear prose: active voice, concrete words, short paragraphs, and no puffery.
22
+ 9. For user-facing UI, CLI, TUI, gateway, runtime, or agent-routing changes, name the expected verification level instead of assuming unit tests are enough.
23
+
24
+ ## Where specs live
25
+
26
+ Follow the project documentation structure:
27
+
28
+ ```text
29
+ docs/
30
+ project/ Current project docs and canonical documentation
31
+ specs/ Product, technical, and implementation specifications
32
+ plans/ Implementation plans and design plans
33
+ reports/ Investigation, validation, and generated reports
34
+ legacy/ Old documentation kept for reference
35
+ ```
36
+
37
+ Do not create new root-level `plans/`, `reports/`, or `specs/` directories.
38
+
39
+ Use `docs/specs/` for durable specs. Use `docs/plans/` for implementation plans. Use `docs/reports/` for analyses, validations, and findings.
40
+
41
+ ## Choose the right spec shape
42
+
43
+ ### Capability spec
44
+
45
+ Use a capability spec for durable system behavior, especially behavior that should remain true after the current change ships.
46
+
47
+ Good path:
48
+
49
+ ```text
50
+ docs/specs/capabilities/<capability-name>.md
51
+ ```
52
+
53
+ Use this for auth behavior, session routing, profile behavior, tool registration, gateway contracts, API behavior, UI behavior, or other long-lived contracts.
54
+
55
+ ### Change spec
56
+
57
+ Use a change spec when proposing a feature, fix, or migration.
58
+
59
+ Good path:
60
+
61
+ ```text
62
+ docs/specs/changes/<change-name>/
63
+ proposal.md
64
+ spec.md
65
+ design.md # include when technical choices matter
66
+ tasks.md # include when ready to implement
67
+ ```
68
+
69
+ ### Phase spec
70
+
71
+ Use a phase spec for multi-step work that needs a roadmap.
72
+
73
+ Good path:
74
+
75
+ ```text
76
+ docs/specs/phases/<NN-phase-name>/
77
+ spec.md
78
+ context.md # implementation decisions, references, existing-code notes
79
+ ```
80
+
81
+ ## Required structure for most Pibo specs
82
+
83
+ Use this template unless the task clearly needs a smaller artifact.
84
+
85
+ ```markdown
86
+ # Spec: [Name]
87
+
88
+ **Status:** Draft | Approved | Implementing | Done
89
+ **Created:** YYYY-MM-DD
90
+ **Requester / Source:** [user, issue, discussion, or change]
91
+ **Related docs:** [links]
92
+
93
+ ## Why
94
+
95
+ [Problem, opportunity, or user need. One or two concrete paragraphs.]
96
+
97
+ ## Goal
98
+
99
+ [One precise sentence that says what changes from current state to target state.]
100
+
101
+ ## Background / Current State
102
+
103
+ [What exists today. What is broken, missing, confusing, slow, unsafe, or expensive.]
104
+
105
+ ## Scope
106
+
107
+ ### In Scope
108
+
109
+ - [Concrete behavior or deliverable]
110
+
111
+ ### Out of Scope
112
+
113
+ - [Excluded item] — [reason]
114
+
115
+ ## Requirements
116
+
117
+ ### Requirement: [Name]
118
+
119
+ The system MUST/SHALL [observable behavior].
120
+
121
+ #### Current
122
+
123
+ [Current behavior or absence of behavior.]
124
+
125
+ #### Target
126
+
127
+ [Desired behavior.]
128
+
129
+ #### Acceptance
130
+
131
+ [Concrete pass/fail check.]
132
+
133
+ #### Scenario: [Name]
134
+
135
+ - GIVEN [state]
136
+ - WHEN [action/event]
137
+ - THEN [expected outcome]
138
+
139
+ ## Edge Cases
140
+
141
+ - [Boundary, failure, permission, concurrency, or empty-state case]
142
+
143
+ ## Constraints
144
+
145
+ - **Compatibility:** ...
146
+ - **Security / Privacy:** ...
147
+ - **Performance:** ...
148
+ - **Dependencies:** ...
149
+
150
+ ## Success Criteria
151
+
152
+ - [ ] SC-001: [Measurable or directly observable outcome]
153
+ - [ ] SC-002: [Another pass/fail outcome]
154
+
155
+ ## Assumptions and Open Questions
156
+
157
+ ### Assumptions
158
+
159
+ - [Reasonable default taken to keep progress moving]
160
+
161
+ ### Open Questions
162
+
163
+ - [Question that materially affects scope, UX, security, or architecture]
164
+
165
+ ## Traceability
166
+
167
+ | Requirement | Scenario / Story | Plan / Task | Status |
168
+ |---|---|---|---|
169
+ | REQ-001 | [Scenario] | [Plan or task] | Pending |
170
+ ```
171
+
172
+ ## Minimal spec
173
+
174
+ For small work, use the shortest form that remains testable:
175
+
176
+ ```markdown
177
+ # Spec: [Name]
178
+
179
+ ## Why
180
+ ## Goal
181
+ ## Scope
182
+ ### In Scope
183
+ ### Out of Scope
184
+ ## Requirements
185
+ ## Acceptance Criteria
186
+ ## Assumptions / Open Questions
187
+ ```
188
+
189
+ Use the full template when the change touches multiple modules, changes public behavior, affects auth/security/data, or will be implemented across multiple sessions.
190
+
191
+ ## Requirement rules
192
+
193
+ Write requirements as behavior contracts.
194
+
195
+ Good:
196
+
197
+ ```markdown
198
+ ### Requirement: Dev gateway status is discoverable
199
+
200
+ The CLI MUST show whether the dev gateway is running, its PID when known, and the command to inspect logs.
201
+
202
+ #### Scenario: Gateway is running
203
+ - GIVEN the dev gateway process is active
204
+ - WHEN an operator runs `pibo gateway dev status`
205
+ - THEN the output includes status, PID, port, and next diagnostic command
206
+ ```
207
+
208
+ Weak:
209
+
210
+ ```markdown
211
+ ### Requirement: Improve gateway status
212
+ Make gateway status better and more robust.
213
+ ```
214
+
215
+ A requirement is ready when a reviewer can say pass or fail without guessing.
216
+
217
+ ## Reuse, parity, and verification clarity
218
+
219
+ When a feature is described as "same as Web", "derived from Web", "reuse the view", "shared UI", "Terminal View", or similar, do not silently reduce that to shared data. State the intended reuse level:
220
+
221
+ - data/state only
222
+ - renderer-neutral view model
223
+ - interaction/controller logic
224
+ - renderer/component logic
225
+ - visual and behavioral parity
226
+
227
+ If visual or behavioral parity is required, add acceptance checks that compare the relevant surfaces with the same fixture or user flow. If parity is intentionally out of scope, say so and describe the user-visible difference.
228
+
229
+ For user-facing UI, CLI, TUI, gateway, runtime, auth, or agent-routing specs, include at least one realistic validation scenario for the default user path when feasible. Fake data, demo mode, mocks, and render snapshots are useful, but they should not be the only acceptance evidence for behavior users will exercise directly unless the real path is unavailable or explicitly out of scope.
230
+
231
+ ## Scenario rules
232
+
233
+ Prefer GIVEN / WHEN / THEN for user-visible behavior and system contracts. Use WHEN / THEN only for simple event-response behavior.
234
+
235
+ Cover at least:
236
+
237
+ - primary success path
238
+ - empty or missing state
239
+ - invalid input or permission failure
240
+ - migration or compatibility path when relevant
241
+
242
+ ## Proposal structure
243
+
244
+ Use `proposal.md` to explain intent before deep design.
245
+
246
+ ```markdown
247
+ # Proposal: [Change]
248
+
249
+ ## Why
250
+
251
+ ## What Changes
252
+
253
+ ## Capabilities
254
+
255
+ ### New Capabilities
256
+ - `<kebab-name>`: [brief behavior area]
257
+
258
+ ### Modified Capabilities
259
+ - `<existing-name>`: [changed behavior]
260
+
261
+ ## Impact
262
+
263
+ - **Code:** ...
264
+ - **APIs / CLI:** ...
265
+ - **Data:** ...
266
+ - **Auth / Security:** ...
267
+ - **Docs:** ...
268
+ ```
269
+
270
+ ## Design structure
271
+
272
+ Use `design.md` when technical choices matter. Keep requirements in the spec; put implementation choices here.
273
+
274
+ ```markdown
275
+ # Design: [Change]
276
+
277
+ ## Context
278
+ ## Goals / Non-Goals
279
+ ## Decisions
280
+ ### Decision: [Choice]
281
+ - **Choice:** ...
282
+ - **Rationale:** ...
283
+ - **Alternatives considered:** ...
284
+
285
+ ## Risks / Trade-offs
286
+ ## Migration / Rollback
287
+ ## Open Questions
288
+ ```
289
+
290
+ ## Tasks structure
291
+
292
+ Use `tasks.md` only after the spec and design are stable enough to act on.
293
+
294
+ ```markdown
295
+ # Tasks: [Change]
296
+
297
+ ## 1. Setup / Foundation
298
+ - [ ] 1.1 [Concrete task with file path]
299
+
300
+ ## 2. Requirement: [Name]
301
+ - [ ] 2.1 [Test or validation task]
302
+ - [ ] 2.2 [Implementation task]
303
+
304
+ ## 3. Validation
305
+ - [ ] 3.1 Run [command]
306
+ - [ ] 3.2 Verify [observable behavior]
307
+ ```
308
+
309
+ Tasks should be small enough for one agent session. Include file paths and validation commands when known.
310
+
311
+ ## Review checklist
312
+
313
+ Before treating a spec as ready, check:
314
+
315
+ - [ ] The `Why` names a real problem or opportunity.
316
+ - [ ] The `Goal` is specific and measurable.
317
+ - [ ] Scope has both in-scope and out-of-scope items.
318
+ - [ ] Requirements use MUST or SHALL for mandatory behavior.
319
+ - [ ] Each requirement has acceptance checks or scenarios.
320
+ - [ ] Edge cases include failure and empty-state behavior where relevant.
321
+ - [ ] Assumptions are visible.
322
+ - [ ] Open questions are few and material.
323
+ - [ ] Implementation details live in `design.md` or `tasks.md`, not in behavioral requirements.
324
+ - [ ] The spec is concise, concrete, and free of promotional language.
325
+
326
+ ## Writing style
327
+
328
+ Write for humans and agents. Prefer short sentences. Use active voice. Omit needless words. Avoid vague adjectives such as robust, seamless, powerful, and cutting-edge. Replace them with concrete behavior.
329
+
330
+ Use tables only when they make comparison or traceability easier. Do not decorate specs with excessive emoji or bold text.