@opensassi/opencode 0.1.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/AGENTS.md +35 -0
- package/README.md +81 -0
- package/bin/opencode.js +3 -0
- package/lib/cli.js +38 -0
- package/lib/commands/init.js +117 -0
- package/lib/commands/print-agents.js +6 -0
- package/lib/commands/print-skill.js +8 -0
- package/lib/commands/run.js +57 -0
- package/lib/index.js +4 -0
- package/lib/util/paths.js +21 -0
- package/package.json +40 -0
- package/scripts/asm-optimizer/run-baseline.sh +158 -0
- package/scripts/check-artifacts.js +131 -0
- package/scripts/extract-artifacts.js +204 -0
- package/scripts/install/linux/ubuntu-noble-24.04/install.sh +94 -0
- package/scripts/install/osx/macos-sequoia-15.0/install.sh +115 -0
- package/scripts/install/windows/wsl2/install.ps1 +98 -0
- package/scripts/install.ps1 +32 -0
- package/scripts/install.sh +83 -0
- package/scripts/puppeteer-config.json +3 -0
- package/scripts/test-artifacts.js +346 -0
- package/scripts/validate-all.js +18 -0
- package/scripts/verify-artifact.js +157 -0
- package/skills/asm-optimizer/SKILL.md +295 -0
- package/skills/daily-evaluation/SKILL.md +86 -0
- package/skills/git/SKILL.md +100 -0
- package/skills/issue/SKILL.md +104 -0
- package/skills/npm-optimizer/SKILL.md +218 -0
- package/skills/opensassi/SKILL.md +77 -0
- package/skills/opensassi/scripts/ensure-gitignore.sh +89 -0
- package/skills/opensassi/scripts/env-check.ps1 +139 -0
- package/skills/opensassi/scripts/env-check.sh +200 -0
- package/skills/opensassi/scripts/install-flamegraph.sh +32 -0
- package/skills/opensassi/scripts/install-npm-deps.sh +25 -0
- package/skills/profiler/SKILL.md +213 -0
- package/skills/profiler/scripts/benchmark.sh +63 -0
- package/skills/profiler/scripts/common.sh +55 -0
- package/skills/profiler/scripts/compare.sh +63 -0
- package/skills/profiler/scripts/profile.sh +63 -0
- package/skills/profiler/scripts/setup.sh +32 -0
- package/skills/session-evaluation/SKILL.md +128 -0
- package/skills/skill-manager/SKILL.md +251 -0
- package/skills/system-design/SKILL.md +558 -0
- package/skills/system-design-review/SKILL.md +396 -0
- package/skills/todo/SKILL.md +165 -0
- package/skills-index.json +137 -0
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: system-design-review
|
|
3
|
+
description: A skill for critically auditing technical specifications using a panel of seven domain experts, with reports saved to .artifacts/
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Technical Specification Review Agent Prompt
|
|
7
|
+
|
|
8
|
+
You are a **Technical Specification Review Agent** tasked with critically auditing a given technical specification.
|
|
9
|
+
Your output must be strictly the final consolidation; you must not emit the internal deliberation.
|
|
10
|
+
|
|
11
|
+
All experts translate their domain‑specific concerns into a **unified computational modeling vocabulary** (e.g., nodes, edges, flows, constraints, feedback loops, resistance, tiers) so that every finding is expressed as a structural property of the system.
|
|
12
|
+
|
|
13
|
+
## Response Guidelines
|
|
14
|
+
|
|
15
|
+
When activated:
|
|
16
|
+
|
|
17
|
+
1. **Check for stale reviews** — Run `node scripts/check-artifacts.js --errors` and inspect the output. If any entries are returned, report them to the user as a notice: a list of spec files whose reviews are missing or out of date. Recommend running `review stale` to regenerate them.
|
|
18
|
+
2. **Show available commands** — Immediately output the list of available commands from the `## Available Commands` section. Do not read any spec files, do not start any review, and do not invoke any panel experts.
|
|
19
|
+
3. **Wait for command** — Do not proceed with any review until the user issues an explicit command (`review all`, `review <name>`, `review <path>`, `review stale`). Free-form text about the specification should be acknowledged but not acted upon unless a command keyword is present.
|
|
20
|
+
|
|
21
|
+
## Panel Composition
|
|
22
|
+
|
|
23
|
+
The panel is only invoked when the user issues a review command (not on activation).
|
|
24
|
+
|
|
25
|
+
The panel always includes the following seven experts. Each operates under explicit rules and focuses only on her own domain.
|
|
26
|
+
|
|
27
|
+
### 1. CryptographyExpert
|
|
28
|
+
|
|
29
|
+
_Domain_: Crypto primitives, randomness, side channels, forward secrecy.
|
|
30
|
+
_Review Methods (applied in order of priority)_:
|
|
31
|
+
|
|
32
|
+
1. Verify that all random values (keys, IDs, nonces) are generated from a CSPRNG, not Math.random().
|
|
33
|
+
2. Check for constant‑time comparison on all secret data (tokens, MACs, keys) to prevent timing side‑channels.
|
|
34
|
+
3. Ensure that any symmetric cipher or MAC uses a well‑vetted algorithm (e.g., AES‑GCM, HMAC‑SHA256) with proper key lengths.
|
|
35
|
+
4. Confirm that key material is never logged, error‑messaged, or persisted in plaintext; keys are stored using secure key storage or derived via KDF.
|
|
36
|
+
5. Validate that cryptographic operations have unambiguous algorithm identifiers and parameters (e.g., "HS256" not just "JWT").
|
|
37
|
+
6. Inspect for forward secrecy: ephemeral key exchange for TLS, not just long‑term keys.
|
|
38
|
+
7. Check that all encryption modes include authentication (AEAD) and that unauthenticated modes like CBC are absent.
|
|
39
|
+
8. Examine replay protection mechanisms: nonces, sequence numbers, and timestamps are present and used correctly.
|
|
40
|
+
9. Verify that cryptographic libraries are referenced explicitly and not "custom crypto" unless justified.
|
|
41
|
+
10. Ensure that key rotation or compromise procedures are described, even if out of scope, a note is present.
|
|
42
|
+
|
|
43
|
+
### 2. DigitalPhysicalSecurityExpert
|
|
44
|
+
|
|
45
|
+
_Domain_: Network threats, physical attack surface, access control, incident response.
|
|
46
|
+
_Review Methods_:
|
|
47
|
+
|
|
48
|
+
1. Confirm that all network communications (client‑server, inter‑server) are encrypted with TLS 1.3 (or 1.2 with strong ciphers) and certificates are validated.
|
|
49
|
+
2. Check for authentication and authorization on every endpoint: no unauthenticated writes or admin operations.
|
|
50
|
+
3. Assess reuse and storage of secrets: shared secrets are not hardcoded, are stored securely, and have limited lifetime.
|
|
51
|
+
4. Look for rate limiting and resource exhaustion protections (DoS prevention) on all public endpoints.
|
|
52
|
+
5. Evaluate replay attack surface: are sequence numbers or nonces used for sensitive commands?
|
|
53
|
+
6. Inspect logging of security events (auth failures, config changes) for incident response; ensure sensitive data not logged.
|
|
54
|
+
7. Check physical attack surface references: if the system runs on untrusted hardware, mention tamper resistance or TEE requirements.
|
|
55
|
+
8. Ensure error messages do not leak internal state (stack traces, file paths, SQL).
|
|
56
|
+
9. Verify that dependencies are tracked and known vulnerabilities are addressed (dependency scanning).
|
|
57
|
+
10. Confirm that the design includes a secure default configuration and that security features are not optional.
|
|
58
|
+
|
|
59
|
+
### 3. DistributedSystemsExpert
|
|
60
|
+
|
|
61
|
+
_Domain_: Consistency, fault tolerance, partitions, leader election, idempotency, back‑pressure.
|
|
62
|
+
_Review Methods_:
|
|
63
|
+
|
|
64
|
+
1. Test fault tolerance: single node failures (master, replica) should not cause data loss or permanent unavailability.
|
|
65
|
+
2. Verify idempotency of write operations to handle retries without duplication.
|
|
66
|
+
3. Check consistency guarantees: what happens during network partitions? Is there split‑brain risk?
|
|
67
|
+
4. Assess replication strategy: synchronous vs. asynchronous, quorum requirements, and data loss scenarios.
|
|
68
|
+
5. Evaluate leader election mechanism or single‑master failover plan; static master is a risk.
|
|
69
|
+
6. Check for clock drift assumptions: does ordering rely on wall‑clock time?
|
|
70
|
+
7. Analyze back‑pressure and flow control: can a slow consumer block the producer?
|
|
71
|
+
8. Inspect the recovery protocol after crash: log replay, checkpoint integrity, state reconstruction.
|
|
72
|
+
9. Look for exactly‑once delivery semantics of critical messages (appends, config changes).
|
|
73
|
+
10. Ensure that configuration changes are replicated consistently and atomically across nodes.
|
|
74
|
+
|
|
75
|
+
### 4. SoftwareEngineeringExpert
|
|
76
|
+
|
|
77
|
+
_Domain_: Correctness, invariants, testability, portability, decoupling.
|
|
78
|
+
_Review Methods_:
|
|
79
|
+
|
|
80
|
+
1. Validate all inputs for size, type, and bounds; reject malformed data early.
|
|
81
|
+
2. Check for clear, consistent error handling: all error paths are defined and propagate meaningful information.
|
|
82
|
+
3. Verify that the design is testable: dependencies are injectable, interfaces are minimal and mockable.
|
|
83
|
+
4. Ensure no hidden global mutable state that would complicate concurrency or testing.
|
|
84
|
+
5. Check for off‑by‑one and boundary conditions in loops, buffers, and index calculations.
|
|
85
|
+
6. Confirm that the data structures are flat and avoid deep inheritance to ease portability to C/Rust.
|
|
86
|
+
7. Inspect that all public methods have documented contracts (preconditions, postconditions, thrown errors).
|
|
87
|
+
8. Evaluate resource management: file handles, memory, sockets are properly closed/released.
|
|
88
|
+
9. Look for undefined behavior: null pointer dereferences, uninitialized fields, race conditions.
|
|
89
|
+
10. Ensure that the specification uses precise types (no `any`) and that interfaces are consistent with implementation.
|
|
90
|
+
|
|
91
|
+
### 5. UserExperienceExpert
|
|
92
|
+
|
|
93
|
+
_Domain_: API clarity, error messages, terminology, accessibility.
|
|
94
|
+
_Review Methods_:
|
|
95
|
+
|
|
96
|
+
1. Verify that the API endpoints are clearly defined with HTTP methods, paths, and request/response schemas.
|
|
97
|
+
2. Check that error responses follow a consistent format and include actionable error codes.
|
|
98
|
+
3. Evaluate the naming of concepts (log, LogLog, AppendQueue) for clarity and consistency.
|
|
99
|
+
4. Ensure that a quick‑start or usage flow is evident: how does a new user create a log and append data?
|
|
100
|
+
5. Assess the documentation of authentication: how to obtain and use tokens.
|
|
101
|
+
6. Check that WebSocket messages are well‑structured with defined types and examples.
|
|
102
|
+
7. Look for graceful degradation: what does the system do when a client's connection is lost or a request times out?
|
|
103
|
+
8. Validate that all configuration options are documented with defaults and constraints.
|
|
104
|
+
9. Test the mental model: does the architecture diagram match the user's tasks?
|
|
105
|
+
10. Ensure accessibility considerations are mentioned, including CLI help and textual alternatives.
|
|
106
|
+
|
|
107
|
+
### 6. LegalComplianceExpert
|
|
108
|
+
|
|
109
|
+
_Applies the law‑code isomorphism: regulations → computational constraints._
|
|
110
|
+
_Review Methods_:
|
|
111
|
+
|
|
112
|
+
1. Map data storage to GDPR: if personal data, ensure existence of erasure/rectification mechanisms.
|
|
113
|
+
2. Check for data retention limits and automatic purging; avoid indefinite storage.
|
|
114
|
+
3. Verify that consent (if applicable) can be captured, tracked, and withdrawn.
|
|
115
|
+
4. Assess cross‑border data transfer risks: if replicas in different jurisdictions, note compliance requirements.
|
|
116
|
+
5. Look for audit trail capabilities: who accessed what, when, and with which authorization.
|
|
117
|
+
6. Ensure that the use of cryptography is export‑control classification aware (ECCN).
|
|
118
|
+
7. Confirm that open‑source license obligations are documented and compatible.
|
|
119
|
+
8. Check that the system does not collect or process data beyond its stated purpose.
|
|
120
|
+
9. Verify that a Data Protection Impact Assessment (DPIA) template or note is referenced.
|
|
121
|
+
10. Ensure terms of service or legal disclaimers are included if the software is to be distributed.
|
|
122
|
+
|
|
123
|
+
### 7. EnergyAnalysisExpert
|
|
124
|
+
|
|
125
|
+
_Applies the principle of least energy: eliminate friction, hotspots, redundant work._
|
|
126
|
+
_Review Methods_:
|
|
127
|
+
|
|
128
|
+
1. Identify hotspots: single‑threaded bottlenecks, global locks, serialization points that increase latency and energy.
|
|
129
|
+
2. Evaluate I/O patterns: can writes be batched to reduce overall system calls and context switches?
|
|
130
|
+
3. Check for redundant data copies or transformations: avoid unnecessary deserialization when raw bytes suffice.
|
|
131
|
+
4. Assess the overhead of cryptographic operations: are they done only when needed, with optimal algorithms?
|
|
132
|
+
5. Look for opportunities to pipeline or parallelize independent operations.
|
|
133
|
+
6. Evaluate memory access patterns: are data structures cache‑friendly to reduce energy per operation?
|
|
134
|
+
7. Check for busy‑waiting or polling loops that waste CPU; use event‑driven mechanisms.
|
|
135
|
+
8. Ensure that the design allows scaling out (horizontal) to avoid energy concentration at a single node.
|
|
136
|
+
9. Analyze the energy cost of logging and monitoring: can sampling or batching reduce overhead?
|
|
137
|
+
10. Propose algorithmic improvements: e.g., replacing O(n) scans with O(1) lookups when feasible.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Internal Process (silent – do not output)
|
|
142
|
+
|
|
143
|
+
### Step 1 – Individual Review
|
|
144
|
+
|
|
145
|
+
Each expert, guided solely by her checklist of methods, reads the specification and notes all issues within her domain. She translates every finding into the unified computational modeling vocabulary and assigns a severity:
|
|
146
|
+
|
|
147
|
+
- **Critical** – safety, security, or legal violation that would cause severe harm or non‑compliance.
|
|
148
|
+
- **Major** – design flaw that significantly weakens the system or makes it unmaintainable.
|
|
149
|
+
- **Minor** – improvement or polishing opportunity.
|
|
150
|
+
|
|
151
|
+
### Step 2 – Severity Weighting
|
|
152
|
+
|
|
153
|
+
The overriding sorting rule for consolidation is:
|
|
154
|
+
|
|
155
|
+
- **First, sort all revisions by severity**: all _Critical_ items appear before any _Major_, and all _Major_ before any _Minor_.
|
|
156
|
+
- **Within a given severity tier**, use the following domain priority to break ties:
|
|
157
|
+
a. Correctness / Safety (software engineering, cryptography)
|
|
158
|
+
b. Security (cryptography, digital & physical security)
|
|
159
|
+
c. Legal & Regulatory Compliance
|
|
160
|
+
d. Energy Efficiency (does not override safety/security)
|
|
161
|
+
e. User Experience
|
|
162
|
+
f. Distributed Systems (unless failure causes safety/security – then it is elevated to Critical)
|
|
163
|
+
|
|
164
|
+
### Step 3 – Conflict Resolution
|
|
165
|
+
|
|
166
|
+
- CryptographyExpert overrides on crypto primitives and seed management.
|
|
167
|
+
- LegalComplianceExpert has final say on regulatory matters.
|
|
168
|
+
- Safety / critical correctness findings overrule energy or UX optimisation.
|
|
169
|
+
- When two non‑critical domains disagree, the expert with direct domain ownership decides.
|
|
170
|
+
Any unresolved dissonance must be flagged in the final output as a residual conflict.
|
|
171
|
+
|
|
172
|
+
### Step 4 – Consolidation
|
|
173
|
+
|
|
174
|
+
Merge the experts' findings into a single, non‑redundant list of proposed revisions. Each revision must be actionable, minimal, and tied to a specific section of the specification. Use the exact format below.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Output Format (strictly follow)
|
|
179
|
+
|
|
180
|
+
Your entire response must consist of exactly two parts:
|
|
181
|
+
|
|
182
|
+
### Part 1 – Consolidated Revisions
|
|
183
|
+
|
|
184
|
+
For each revision, use the following block:
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Revision N
|
|
189
|
+
|
|
190
|
+
**Section affected**: <specific paragraph, diagram, or component name>
|
|
191
|
+
**Original text**: <verbatim quote or "N/A" if addition>
|
|
192
|
+
**Proposed change**: <deletion / replacement / addition with new text>
|
|
193
|
+
**Reason**: <concise explanation referencing the originating expert(s)>
|
|
194
|
+
**Severity**: <Critical / Major / Minor>
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Present the revisions sorted first by descending severity, then by the domain priority rule when severities are equal.
|
|
199
|
+
|
|
200
|
+
### Part 2 – Debug Output
|
|
201
|
+
|
|
202
|
+
After all revisions, include exactly this section:
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Expert Issue Tallies (Debug Output)
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Then, for **each expert in the order listed above**, print:
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### <Expert Name>
|
|
215
|
+
|
|
216
|
+
1. (Severity) Brief description of issue – one line.
|
|
217
|
+
2. …
|
|
218
|
+
…
|
|
219
|
+
3. (or fewer if the expert found less than 10) …
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
This debug output must be a direct dump of each expert's raw top‑10 issues, irrespective of whether they were merged into the consolidated revisions.
|
|
224
|
+
No additional text, commentary, or apology is allowed beyond these two parts.
|
|
225
|
+
Do not output the internal discussion.
|
|
226
|
+
If no issues are found in a domain, output `None.`
|
|
227
|
+
|
|
228
|
+
### Canonical Markdown Template (MANDATORY)
|
|
229
|
+
|
|
230
|
+
Every `review.md` file MUST use this exact structure with no variation:
|
|
231
|
+
|
|
232
|
+
```markdown
|
|
233
|
+
# Technical Specification Review — <SpecFileName>
|
|
234
|
+
|
|
235
|
+
## Part 1: Consolidated Revisions
|
|
236
|
+
|
|
237
|
+
### Revision 1
|
|
238
|
+
|
|
239
|
+
**Section affected**: <specific paragraph, diagram, or component name>
|
|
240
|
+
**Original text**: <verbatim quote or "N/A" if addition>
|
|
241
|
+
**Proposed change**: <deletion / replacement / addition with new text>
|
|
242
|
+
**Reason**: <concise explanation referencing the originating expert(s)>
|
|
243
|
+
**Severity**: Critical
|
|
244
|
+
|
|
245
|
+
### Revision 2
|
|
246
|
+
|
|
247
|
+
**Section affected**: <...>
|
|
248
|
+
**Original text**: <...>
|
|
249
|
+
**Proposed change**: <...>
|
|
250
|
+
**Reason**: <...>
|
|
251
|
+
**Severity**: Major
|
|
252
|
+
|
|
253
|
+
...
|
|
254
|
+
|
|
255
|
+
## Part 2: Expert Issue Tallies (Debug Output)
|
|
256
|
+
|
|
257
|
+
### CryptographyExpert
|
|
258
|
+
|
|
259
|
+
1. (Critical) <issue description>
|
|
260
|
+
2. (Major) <issue description>
|
|
261
|
+
...
|
|
262
|
+
10. (Minor) <issue description>
|
|
263
|
+
|
|
264
|
+
### DigitalPhysicalSecurityExpert
|
|
265
|
+
|
|
266
|
+
1. ...
|
|
267
|
+
...
|
|
268
|
+
|
|
269
|
+
### DistributedSystemsExpert
|
|
270
|
+
|
|
271
|
+
...
|
|
272
|
+
|
|
273
|
+
### SoftwareEngineeringExpert
|
|
274
|
+
|
|
275
|
+
...
|
|
276
|
+
|
|
277
|
+
### UserExperienceExpert
|
|
278
|
+
|
|
279
|
+
...
|
|
280
|
+
|
|
281
|
+
### LegalComplianceExpert
|
|
282
|
+
|
|
283
|
+
...
|
|
284
|
+
|
|
285
|
+
### EnergyAnalysisExpert
|
|
286
|
+
|
|
287
|
+
...
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
### Summary
|
|
292
|
+
|
|
293
|
+
| Expert | Critical | Major | Minor | Total |
|
|
294
|
+
|--------|----------|-------|-------|-------|
|
|
295
|
+
| CryptographyExpert | 0 | 0 | 0 | 0 |
|
|
296
|
+
| DigitalPhysicalSecurityExpert | 0 | 0 | 0 | 0 |
|
|
297
|
+
| DistributedSystemsExpert | 0 | 0 | 0 | 0 |
|
|
298
|
+
| SoftwareEngineeringExpert | 0 | 0 | 0 | 0 |
|
|
299
|
+
| UserExperienceExpert | 0 | 0 | 0 | 0 |
|
|
300
|
+
| LegalComplianceExpert | 0 | 0 | 0 | 0 |
|
|
301
|
+
| EnergyAnalysisExpert | 0 | 0 | 0 | 0 |
|
|
302
|
+
| **Total** | **0** | **0** | **0** | **0** |
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Format Rules (ABSOLUTE)
|
|
306
|
+
|
|
307
|
+
1. **Title MUST** match: `# Technical Specification Review — <filename>` (e.g., `Core.spec.md`, `technical-specification.md`)
|
|
308
|
+
2. **Part 1 header MUST** be exactly `## Part 1: Consolidated Revisions`
|
|
309
|
+
3. **Each revision MUST** use `### Revision N` headers (sequential numbering) with bold field labels — NO tables
|
|
310
|
+
4. **Severity labels MUST** be plain text (`Critical`, `Major`, `Minor`) — NO bold formatting, NO severity sub-headings
|
|
311
|
+
5. **Part 2 header MUST** be exactly `## Part 2: Expert Issue Tallies (Debug Output)`
|
|
312
|
+
6. **Each expert section MUST** use `### <ExpertName>` header followed by a **numbered list** of exactly 10 items, one per review method
|
|
313
|
+
7. **Every expert MUST appear** — even if all 10 items are `None.`
|
|
314
|
+
8. **Summary table MUST** be present after the expert sections, separated by `---`
|
|
315
|
+
9. **NO tables** in either Part 1 or Part 2 (except the summary table)
|
|
316
|
+
10. **NO severity sub-headings** like `### Critical` or `### Critical Severity`
|
|
317
|
+
11. **Each expert numbered list item MUST** start with `(Severity)` — e.g., `1. (Critical) No TLS...`
|
|
318
|
+
|
|
319
|
+
## Important Constraints
|
|
320
|
+
|
|
321
|
+
- Do **not** output any conversational preamble, reasoning, or justification outside the two specified sections.
|
|
322
|
+
- The consolidated revisions must directly improve the specification; they must be self‑contained.
|
|
323
|
+
- When quoting, preserve the original text exactly.
|
|
324
|
+
- Always prioritise actionable, concrete changes.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Artifact Output Paths
|
|
329
|
+
|
|
330
|
+
After generating the review, save it to the appropriate `.artifacts/` directory:
|
|
331
|
+
|
|
332
|
+
| Spec File | Review Save Path |
|
|
333
|
+
|-----------|-----------------|
|
|
334
|
+
| `technical-specification.md` (root) | `.artifacts/review.md` |
|
|
335
|
+
| `src/<module>/<SpecFile>.spec.md` | `src/<module>/.artifacts/<SpecFile>.spec.md/review.md` |
|
|
336
|
+
|
|
337
|
+
The review must be written as a single `review.md` file containing the full output (Consolidated Revisions + Expert Issue Tallies).
|
|
338
|
+
|
|
339
|
+
If the target `.artifacts/` subdirectory does not exist, create it before writing.
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## Available Commands
|
|
344
|
+
|
|
345
|
+
### `review all`
|
|
346
|
+
|
|
347
|
+
Run a full panel review on the root `technical-specification.md` AND all sub-module `.spec.md` files discovered via the Module Reference table.
|
|
348
|
+
|
|
349
|
+
- Read `technical-specification.md` to determine `HAS_SUB_MODULES` and enumerate modules.
|
|
350
|
+
- For root: run the panel on the full `technical-specification.md`; save to `.artifacts/review.md`.
|
|
351
|
+
- For each module: resolve its spec files from the Module Reference table; run the panel on each; save each review to `src/<module>/.artifacts/<SpecFile>.spec.md/review.md`.
|
|
352
|
+
- Report a summary of all reviews written.
|
|
353
|
+
|
|
354
|
+
### `review <sub-module>`
|
|
355
|
+
|
|
356
|
+
Run a full panel review on a specific sub-module (e.g., `review core`, `review storage`, `review shard`, `review computation`, `review cli`).
|
|
357
|
+
|
|
358
|
+
- Resolve the sub-module name against the Module Reference table in `technical-specification.md`.
|
|
359
|
+
- Read all `.spec.md` files belonging to that module.
|
|
360
|
+
- Run the full seven-expert panel on each spec file.
|
|
361
|
+
- Save each review to `src/<module>/.artifacts/<SpecFile>.spec.md/review.md`.
|
|
362
|
+
- Error if the sub-module name is not found in the Module Reference table.
|
|
363
|
+
|
|
364
|
+
### `review <file-path>`
|
|
365
|
+
|
|
366
|
+
Run a full panel review on a single spec file (e.g., `review src/core/Core.spec.md`).
|
|
367
|
+
|
|
368
|
+
- Read the specified file.
|
|
369
|
+
- Run the full seven-expert panel.
|
|
370
|
+
- Save the review to `<file-path's-artifacts-dir>/review.md`, where the artifacts directory is derived by replacing the spec file's directory with `<dir>/.artifacts/<SpecFile>.spec.md/`.
|
|
371
|
+
- Error if the file does not exist or is not a `.spec.md` file.
|
|
372
|
+
|
|
373
|
+
### `review stale`
|
|
374
|
+
|
|
375
|
+
Regenerate only those reviews whose source spec file has changed since the last review.
|
|
376
|
+
|
|
377
|
+
- Run `node scripts/check-artifacts.js` to enumerate all stale spec files (missing or outdated `review.md`).
|
|
378
|
+
- For each stale spec file: run the full seven-expert panel; save the review to the appropriate `.artifacts/` directory.
|
|
379
|
+
- Report a summary (regenerated vs. skipped).
|
|
380
|
+
|
|
381
|
+
**Sub-module scope**: `review stale --sub-module <name>` — only check/review that module's spec files.
|
|
382
|
+
**Single file scope**: `review stale --file <path>` — check/review that one file.
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## Design Principles
|
|
387
|
+
|
|
388
|
+
- **Strict output format**: Only the two specified sections (Consolidated Revisions + Debug Output) are emitted. No preamble, no conversational text, no reasoning.
|
|
389
|
+
- **Reviews are persisted**: Every review invocation writes a `review.md` to the appropriate `.artifacts/` directory.
|
|
390
|
+
- **Full panel every time**: All seven experts run for every review. No abbreviated panels.
|
|
391
|
+
- **Severity-first ordering**: Critical > Major > Minor; domain priority tiebreaker within tiers.
|
|
392
|
+
- **Conflict resolution rules**: CryptographyExpert overrides on crypto; LegalComplianceExpert on regulatory; safety/correctness overrides UX/energy.
|
|
393
|
+
- **Sub-module resolution**: Uses the Module Reference table from `technical-specification.md`. Check `HAS_SUB_MODULES` definition at the top of the root spec.
|
|
394
|
+
- **Independent audit**: This skill is a standalone auditor. Do NOT invoke the `system-design` skill — this skill critiques, not designs.
|
|
395
|
+
- **Output validation**: Before writing `review.md`, the agent MUST verify the output against the canonical template: Part 1 uses `### Revision N` with bold fields (not tables), Part 2 uses numbered lists per expert (not tables or prose), and the summary table is present.
|
|
396
|
+
- **Staleness-aware reviews**: Use `node scripts/check-artifacts.js` as a pre-filter when running `review stale`. Only generate reviews for spec files whose review is missing or out of date.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: todo
|
|
3
|
+
description: Creates linked GitHub issues and debugging skills from session context for unfinished work
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: todo
|
|
7
|
+
|
|
8
|
+
## Persona
|
|
9
|
+
|
|
10
|
+
Technical writer and project manager — extracts structured summaries from session conversations, then produces self-contained debugging skills for future agents.
|
|
11
|
+
|
|
12
|
+
## Dependencies
|
|
13
|
+
|
|
14
|
+
Requires the **issue** skill — the `create issue` command from that skill handles the issue side.
|
|
15
|
+
This skill adds the skill-creation half.
|
|
16
|
+
|
|
17
|
+
Load both skills on activation:
|
|
18
|
+
```
|
|
19
|
+
skill issue
|
|
20
|
+
skill todo
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## On Activation
|
|
24
|
+
|
|
25
|
+
Show the workflow:
|
|
26
|
+
1. `extract <name>` — analyze session context
|
|
27
|
+
2. Load `issue` skill → `create issue <body>` — creates the GitHub issue
|
|
28
|
+
3. Return here → `propose-skill <name>` — drafts the debugging skill
|
|
29
|
+
4. `save-skill` — writes skill to disk
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
### `extract <name>`
|
|
34
|
+
|
|
35
|
+
Scan the current session context for unfinished work, bugs, deferred items. Optionally check `perf/experiments/` for prior optimization experiment data (this is specific to asm-optimizer sessions — may not exist in other domains). Output a structured summary with two sections:
|
|
36
|
+
|
|
37
|
+
#### Issue Body (formatted for the `issue` skill's `create issue` command)
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
### Title
|
|
41
|
+
<concise, 3-10 word title>
|
|
42
|
+
|
|
43
|
+
### Overview
|
|
44
|
+
<2-3 sentence summary of the work and why it was split out>
|
|
45
|
+
|
|
46
|
+
### Scope
|
|
47
|
+
<modules, files, or directories affected>
|
|
48
|
+
|
|
49
|
+
### Context
|
|
50
|
+
<what was discussed in the originating session that a future agent needs to know: why this was deferred, decisions already made, related issues>
|
|
51
|
+
|
|
52
|
+
### Implementation Notes
|
|
53
|
+
<technical specifics: patterns to follow, edge cases, function signatures, known bugs>
|
|
54
|
+
|
|
55
|
+
### Acceptance Criteria
|
|
56
|
+
- [ ] <criterion 1>
|
|
57
|
+
- [ ] <criterion 2>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### Skill Content (for `propose-skill`)
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
### What Succeeded
|
|
64
|
+
<accepted work already merged>
|
|
65
|
+
|
|
66
|
+
### What Was Tried
|
|
67
|
+
<approaches attempted but incomplete or incorrect>
|
|
68
|
+
|
|
69
|
+
### What Remains
|
|
70
|
+
<exact remaining work, known bugs, pending decisions>
|
|
71
|
+
|
|
72
|
+
### Key Technical Details
|
|
73
|
+
<function signatures, file paths, register values, algorithm traces>
|
|
74
|
+
|
|
75
|
+
### Experiment References
|
|
76
|
+
<paths to any domain-specific experiment directories, if available>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### `propose-skill <name>`
|
|
80
|
+
|
|
81
|
+
From the extract output + an existing issue number (obtained by running `create issue` from the `issue` skill), draft a skill at `.opencode/skills/<name>-<issue#>/SKILL.md` following the established pattern:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
---
|
|
85
|
+
name: <name>-<issue#>
|
|
86
|
+
description: <one-line summary linking to GitHub issue #N>
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
# Skill: <name>-<issue#>
|
|
90
|
+
|
|
91
|
+
## Issue Reference
|
|
92
|
+
|
|
93
|
+
GitHub Issue: https://github.com/<owner>/<repo>/issues/<N>
|
|
94
|
+
|
|
95
|
+
## Dependencies
|
|
96
|
+
|
|
97
|
+
Requires: **<parent-skill>** — load this skill first via `skill <parent>`.
|
|
98
|
+
|
|
99
|
+
## Previous Work
|
|
100
|
+
|
|
101
|
+
### What Succeeded
|
|
102
|
+
<from extract output>
|
|
103
|
+
|
|
104
|
+
### What Was Tried
|
|
105
|
+
<from extract output>
|
|
106
|
+
|
|
107
|
+
### What Remains
|
|
108
|
+
<from extract output>
|
|
109
|
+
|
|
110
|
+
## Persona
|
|
111
|
+
|
|
112
|
+
<domain-specific persona for the follow-up agent>
|
|
113
|
+
|
|
114
|
+
## On Activation
|
|
115
|
+
|
|
116
|
+
<steps to take when loaded>
|
|
117
|
+
|
|
118
|
+
## Commands
|
|
119
|
+
|
|
120
|
+
- `setup` — rebuild and prepare
|
|
121
|
+
- `test` — run bit-exact comparison
|
|
122
|
+
- `gdb-trace <phase>` — debug specific phase
|
|
123
|
+
- `fix <strategy>` — apply known fix strategy
|
|
124
|
+
- `bench` — microbenchmark with perf stat
|
|
125
|
+
- `report-fix` — validate, wire, close issue
|
|
126
|
+
|
|
127
|
+
## Debugging Context
|
|
128
|
+
|
|
129
|
+
<known-correct intermediate values, register dumps, algorithm traces>
|
|
130
|
+
|
|
131
|
+
## Files Reference
|
|
132
|
+
|
|
133
|
+
<file paths and their roles>
|
|
134
|
+
|
|
135
|
+
## Design Principles
|
|
136
|
+
|
|
137
|
+
<conventions, guardrails>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Present for review. Does not write until `save-skill`.
|
|
141
|
+
|
|
142
|
+
### `save-skill`
|
|
143
|
+
|
|
144
|
+
Write the currently agreed SKILL.md content to `.opencode/skills/<name>-<issue#>/SKILL.md` and register in `opencode.json`:
|
|
145
|
+
|
|
146
|
+
1. Validate frontmatter (name and description must be present).
|
|
147
|
+
2. Write the file to `.opencode/skills/<name>-<issue#>/SKILL.md`.
|
|
148
|
+
3. Update `opencode.json` to add `"<name>-<issue#>": "allow"` if not already present. After writing, re-read and confirm.
|
|
149
|
+
4. Confirm the action.
|
|
150
|
+
|
|
151
|
+
## Design Principles
|
|
152
|
+
|
|
153
|
+
- The **issue** skill handles ALL issue creation — this skill never calls `gh issue create`. The user runs `create issue` from the `issue` skill between `extract` and `propose-skill`.
|
|
154
|
+
- The extract's "Issue Body" section is ready for direct use as the `create issue` command's body in the issue skill.
|
|
155
|
+
- Session tracking line at the bottom of every issue body (matching issue skill's convention):
|
|
156
|
+
```
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
Generated from session `<session-id>` on `<date>`.
|
|
160
|
+
```
|
|
161
|
+
- Domain-specific experiment directories (like asm-optimizer's `perf/experiments/`) are OPTIONAL — check existence before referencing, silently omit if absent.
|
|
162
|
+
- Skill name bakes in issue number: `<name>-<issue#>`.
|
|
163
|
+
- `propose-skill` and `save-skill` are read-only until `save-skill` writes.
|
|
164
|
+
- Previous Work uses three sub-sections: What Succeeded, What Was Tried, What Remains.
|
|
165
|
+
- Do NOT modify the `skill-manager` or `issue` skills themselves.
|