sdtk-spec-kit 0.5.0 → 0.6.1
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/assets/manifest/toolkit-bundle.manifest.json +23 -13
- package/assets/manifest/toolkit-bundle.sha256.txt +7 -5
- package/assets/toolkit/toolkit/AGENTS.md +31 -0
- package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +17 -7
- package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +15 -7
- package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +7 -2
- package/assets/toolkit/toolkit/skills/sdtk-evolve/SKILL.md +67 -0
- package/assets/toolkit/toolkit/skills/skills.catalog.yaml +22 -0
- package/assets/toolkit/toolkit/skills-claude/evolve/SKILL.md +64 -0
- package/bin/sdtk.js +0 -0
- package/package.json +1 -1
- package/src/lib/scope.js +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"sourceCommit": "
|
|
4
|
-
"fileCount":
|
|
2
|
+
"version": "0.6.1",
|
|
3
|
+
"sourceCommit": "958c734ede338089150af3f802b3e2a407c78748",
|
|
4
|
+
"fileCount": 100,
|
|
5
5
|
"files": [
|
|
6
6
|
{
|
|
7
7
|
"path": "toolkit/AGENTS.md",
|
|
8
|
-
"sha256": "
|
|
9
|
-
"size":
|
|
8
|
+
"sha256": "0871c6d46c64a093fc5f9d06af373db8143943cd27f144957dad0cc86893dc62",
|
|
9
|
+
"size": 15069
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"path": "toolkit/install.ps1",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"path": "toolkit/runtimes/claude/CLAUDE_TEMPLATE.md",
|
|
23
|
-
"sha256": "
|
|
24
|
-
"size":
|
|
23
|
+
"sha256": "5b013dde057ed5487b3c9859775bf751306123a4af30e7077811271aa1a1b842",
|
|
24
|
+
"size": 6486
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"path": "toolkit/runtimes/codex/CODEX_TEMPLATE.md",
|
|
28
|
-
"sha256": "
|
|
29
|
-
"size":
|
|
28
|
+
"sha256": "17420748e1812278fe31a82a5df366dad67331363daf3b250c79af0f5358de2b",
|
|
29
|
+
"size": 4841
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"path": "toolkit/scripts/agents/run-claude-task.ps1",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"path": "toolkit/scripts/install-claude-skills.ps1",
|
|
58
|
-
"sha256": "
|
|
59
|
-
"size":
|
|
58
|
+
"sha256": "8455f08e24e38c78aad925c36ebc3605983f1c7f9782190233402858be77b0c6",
|
|
59
|
+
"size": 6551
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"path": "toolkit/scripts/install-codex-skills.ps1",
|
|
@@ -138,6 +138,11 @@
|
|
|
138
138
|
"sha256": "a4f326e2cafff865aaaed8f8de9407f3baa3cfebe33979528a15eb26d2e8482b",
|
|
139
139
|
"size": 3915
|
|
140
140
|
},
|
|
141
|
+
{
|
|
142
|
+
"path": "toolkit/skills-claude/evolve/SKILL.md",
|
|
143
|
+
"sha256": "d345ac17251f28a3a7b428a20aa8d6a8675bf8c2cfd1c03c5ca35e22fb8f0041",
|
|
144
|
+
"size": 7660
|
|
145
|
+
},
|
|
141
146
|
{
|
|
142
147
|
"path": "toolkit/skills-claude/mailbox-dispatch/SKILL.md",
|
|
143
148
|
"sha256": "6fa2283aa1ebb7bf5b6e84d5d5d9d9ddf71082091b108bd46895923a5fca3e09",
|
|
@@ -233,6 +238,11 @@
|
|
|
233
238
|
"sha256": "749f0ff0865d8940cec9b16859706fd46f111a4d9bf54b6ccba381fe9db7a90e",
|
|
234
239
|
"size": 9409
|
|
235
240
|
},
|
|
241
|
+
{
|
|
242
|
+
"path": "toolkit/skills/sdtk-evolve/SKILL.md",
|
|
243
|
+
"sha256": "6fe9b6657f11dd4b9a9ecf2a40a1fefab80b9a743e1c1af057ca541be390421a",
|
|
244
|
+
"size": 7987
|
|
245
|
+
},
|
|
236
246
|
{
|
|
237
247
|
"path": "toolkit/skills/sdtk-mailbox-dispatch/SKILL.md",
|
|
238
248
|
"sha256": "df593d5ab4e7c5f4b05ac9ddb5078189b25bd954e546ab65c0147d024e4f4d59",
|
|
@@ -300,8 +310,8 @@
|
|
|
300
310
|
},
|
|
301
311
|
{
|
|
302
312
|
"path": "toolkit/skills/skills.catalog.yaml",
|
|
303
|
-
"sha256": "
|
|
304
|
-
"size":
|
|
313
|
+
"sha256": "ef4a40b0095556de4ba608de713cf327e126f9a04ea75b99f3de4588037e82e6",
|
|
314
|
+
"size": 14330
|
|
305
315
|
},
|
|
306
316
|
{
|
|
307
317
|
"path": "toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
0871c6d46c64a093fc5f9d06af373db8143943cd27f144957dad0cc86893dc62 toolkit/AGENTS.md
|
|
2
2
|
52bdc750984ee3c3598c1f1838cf3d72b2fc0ed06fca173ec3da79929b10f20c toolkit/install.ps1
|
|
3
3
|
0218dea84f0f9a25ddd2e68c6ae9995685ec471ff0950bd17d1eddcaa99f3e0e toolkit/README.md
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
5b013dde057ed5487b3c9859775bf751306123a4af30e7077811271aa1a1b842 toolkit/runtimes/claude/CLAUDE_TEMPLATE.md
|
|
5
|
+
17420748e1812278fe31a82a5df366dad67331363daf3b250c79af0f5358de2b toolkit/runtimes/codex/CODEX_TEMPLATE.md
|
|
6
6
|
8616291be4aaa4fb5cb0f1f4c738c108ab79090bf767ee2b4403d6d582c150c7 toolkit/scripts/agents/run-claude-task.ps1
|
|
7
7
|
4996e8e7aa50283dbf52c473c4e315af7ee951ebddb671ff59cc4bcde9843907 toolkit/scripts/agents/run-codex-task.ps1
|
|
8
8
|
6bcebe5fdb87451a7260101eaed32c6b61a2cf07832be754790f5432e028a503 toolkit/scripts/agents/validate-mailbox-formal-artifact.py
|
|
9
9
|
b9bdb2489c2881d03e965c7dd849468f797e2070d30e6730ab9ddf37b54b7879 toolkit/scripts/generate-code-handoff.ps1
|
|
10
10
|
2b456e0e9ebeb948db9bdd1a905195285a8ae44839b09b5f0bbefac597cfd67a toolkit/scripts/init-feature.ps1
|
|
11
|
-
|
|
11
|
+
8455f08e24e38c78aad925c36ebc3605983f1c7f9782190233402858be77b0c6 toolkit/scripts/install-claude-skills.ps1
|
|
12
12
|
3191823ec5a481c34128ef645e8103e3ee526a74dd108ba2206878edd7b50cda toolkit/scripts/install-codex-skills.ps1
|
|
13
13
|
f925a58e0cc92addc542762c2bf5f60be2d538dcca88e15de0b628b3a57048b1 toolkit/scripts/uninstall-claude-skills.ps1
|
|
14
14
|
db0e580a20b43bb0af399ff3e4f7f2d826423d67bd2fa9a8121a384337a47de1 toolkit/scripts/uninstall-codex-skills.ps1
|
|
@@ -25,6 +25,7 @@ c17bb4faff318032ee99ead56e5fa182811c7bcaa176e463d0377cefde213ac1 toolkit/skills
|
|
|
25
25
|
b4de86bc4730c4fcfe4f1bde8f9f64f03fd517825bb699e911199825cc3d4249 toolkit/skills-claude/dev-backend/SKILL.md
|
|
26
26
|
37b3ae11db18bc3f64a76b22bca95cea778d6cfbb8b038d46851bd44ff8ff8f1 toolkit/skills-claude/dev-frontend/SKILL.md
|
|
27
27
|
a4f326e2cafff865aaaed8f8de9407f3baa3cfebe33979528a15eb26d2e8482b toolkit/skills-claude/dev/SKILL.md
|
|
28
|
+
d345ac17251f28a3a7b428a20aa8d6a8675bf8c2cfd1c03c5ca35e22fb8f0041 toolkit/skills-claude/evolve/SKILL.md
|
|
28
29
|
6fa2283aa1ebb7bf5b6e84d5d5d9d9ddf71082091b108bd46895923a5fca3e09 toolkit/skills-claude/mailbox-dispatch/SKILL.md
|
|
29
30
|
aa086be1038e34b1b29f7f65bacf254b5c1bfdc1203bd3e643c27acca4f9c2fa toolkit/skills-claude/orchestrator/SKILL.md
|
|
30
31
|
e9e346ff0e1fc66236ceabf64a043c9a28926e7ff06296b26dd5836cf045802a toolkit/skills-claude/pm/SKILL.md
|
|
@@ -44,6 +45,7 @@ ce5af79e5c4902b9c8ceb7e8dae848a6a5a26d5b845eee94ee8aafff88990256 toolkit/skills
|
|
|
44
45
|
6c866b7f8dec193a4c26066e8ac43004ff809f6407ead467a3cb72d90425af52 toolkit/skills/sdtk-dev/prompts/implementer.md
|
|
45
46
|
55dd53b1ccbedd271ad23ca8df01afc317eced27ee17af3b37f31f0b9176ca8b toolkit/skills/sdtk-dev/prompts/spec-reviewer.md
|
|
46
47
|
749f0ff0865d8940cec9b16859706fd46f111a4d9bf54b6ccba381fe9db7a90e toolkit/skills/sdtk-dev/SKILL.md
|
|
48
|
+
6fe9b6657f11dd4b9a9ecf2a40a1fefab80b9a743e1c1af057ca541be390421a toolkit/skills/sdtk-evolve/SKILL.md
|
|
47
49
|
df593d5ab4e7c5f4b05ac9ddb5078189b25bd954e546ab65c0147d024e4f4d59 toolkit/skills/sdtk-mailbox-dispatch/SKILL.md
|
|
48
50
|
66ddb66fee3b12b008ea269baa57acde77f8614ac15a9f87cc994eae64ca63dc toolkit/skills/sdtk-orchestrator/SKILL.md
|
|
49
51
|
ae53d96b6a4fb4ea60fb5de6578b2620c3adb43e1d722a0469cdfa5a90b92903 toolkit/skills/sdtk-pm/SKILL.md
|
|
@@ -57,7 +59,7 @@ cad3bda4560548c329041c403edf3192c6e3864f47d56736fa02690ab175964c toolkit/skills
|
|
|
57
59
|
5ecd672a24dbe6fb845102e7a1986b876f4727bb77671233243814dfb2cc103e toolkit/skills/sdtk-screen-design-spec/SKILL.md
|
|
58
60
|
cd8e2801cdd7d5f931af4fa29e1a854cddf158629a06201f34ba19d4747dcb2f toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py
|
|
59
61
|
0782e52954f7268152f0ff2954b7c71773879cdc429d0cb367330e77d4f92c50 toolkit/skills/sdtk-test-case-spec/SKILL.md
|
|
60
|
-
|
|
62
|
+
ef4a40b0095556de4ba608de713cf327e126f9a04ea75b99f3de4588037e82e6 toolkit/skills/skills.catalog.yaml
|
|
61
63
|
b569125ca6f341cbf8e982fd0bbabe2adcf2b4de9773f515544e9bd7c5551b34 toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md
|
|
62
64
|
e34569c7721929c9ca14b5d2a4390fdb69d7ac766dfdb81b52683710fb2953e8 toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md
|
|
63
65
|
3c583826dae1e31f13ef5c439154f3e58dad7cb149d9929134e9c4327fb5235d toolkit/templates/docs/api/API_DESIGN_FLOWCHART_CREATION_RULES.md
|
|
@@ -32,6 +32,8 @@ When starting a new session, read context in this order when the files exist:
|
|
|
32
32
|
|
|
33
33
|
Do not read the entire historical session archive by default. Use `SDTK_SESSION_MEMORY_*.md` only when chronology or past acceptance details are required.
|
|
34
34
|
|
|
35
|
+
Active orchestration check: if `.sdtk/agent-runtime/runs/` holds a run whose state is not terminal (`running` or `waiting_for_approval`), surface it in one line (run id plus the blocking gate, if any) and offer `sdtk-agent run continue` before starting unrelated work, the same way `.sdtk/handoff/` items are surfaced.
|
|
36
|
+
|
|
35
37
|
## 3) Orchestrator-First Intake Protocol
|
|
36
38
|
For every unprefixed user request:
|
|
37
39
|
1. Classify the request intent before selecting PM/BA/ARCH/DEV/QA or a downstream product lane.
|
|
@@ -63,6 +65,7 @@ Use this compact matrix during intake so the agent picks the smallest sufficient
|
|
|
63
65
|
| Atlas graph build or viewer work | `sdtk-spec atlas` compatibility workflow or `sdtk-wiki atlas` for canonical SDTK-WIKI work | Local `.sdtk/atlas` compatibility graph or `.sdtk/wiki` SDTK-WIKI result |
|
|
64
66
|
| SDTK-WIKI Ask | `sdtk-wiki ask` | Grounded answer when `.sdtk/wiki/graph` plus `wiki.ask` entitlement/runtime preconditions are present, otherwise explicit blocker |
|
|
65
67
|
| Existing project scan: project ingest, project refresh, or project audit | Matching premium project workflow | Project-local foundation, refresh, or audit result without overclaiming entitlement |
|
|
68
|
+
| Multi-step durable workflow: 3+ dependent steps, human gates between steps, must survive a pause, or spans multiple lanes/sessions | Propose `sdtk-agent` orchestration (opt-in, token-aware, see the orchestration cost gate in section 5) | `.sdtk/agent-runtime/runs/<run_id>/` ledger plus `reports/final_report.md` |
|
|
66
69
|
| "what should we do next" | Orchestrator state review | Recommended next action with rationale and lane choice |
|
|
67
70
|
|
|
68
71
|
Guardrails:
|
|
@@ -78,6 +81,7 @@ Ask clarification when:
|
|
|
78
81
|
3. the target repo, project, or path is missing
|
|
79
82
|
4. implementation is requested without an acceptance boundary
|
|
80
83
|
5. the next command could mutate external state
|
|
84
|
+
6. the next step would spawn multiple sub-agents or incur significant token cost, such as dispatching an `sdtk-agent` run
|
|
81
85
|
|
|
82
86
|
Proceed when:
|
|
83
87
|
1. the intent and target are clear
|
|
@@ -85,6 +89,16 @@ Proceed when:
|
|
|
85
89
|
3. the user already approved the relevant plan or spec
|
|
86
90
|
4. the requested change is bounded and verifiable
|
|
87
91
|
|
|
92
|
+
### 5.1) Orchestration Cost Gate (sdtk-agent)
|
|
93
|
+
`sdtk-agent` chains multiple steps and dispatches each ready task through an adapter, so a single run can spawn many sub-agents and consume significant token budget. Because of that cost, orchestration is always opt-in:
|
|
94
|
+
|
|
95
|
+
1. Never auto-start an `sdtk-agent` run on the user's behalf. Only propose it.
|
|
96
|
+
2. Propose only when a routing trigger is hit (the multi-step row in section 4) and the workflow clears the minimum size (default: 3 dependent steps). One- or two-step bounded tasks route straight to a lane instead of orchestration.
|
|
97
|
+
3. When proposing, state the trade-off concretely and let the user decide, defaulting to "no / run inline". Run `sdtk-agent workflow validate` first (it does not spawn anything) to count tasks, human gates, and adapter dispatches, then quote a cost band: dispatch count 3 or fewer is Low, 4-8 is Medium, more than 8 or any loop/retry is High. Example:
|
|
98
|
+
> This request fits sdtk-agent: durable, resumable, with hard approval gates, but it will spawn several agents and cost more tokens than an inline run. Estimate: 9 steps, 3 gates, 11 dispatches (token cost: HIGH). Use sdtk-agent for this, or run it inline? (default: inline)
|
|
99
|
+
4. `run start` only creates the ledger and never spawns; treat it as the safe preview point. Dispatch happens on `run continue`, which is an explicit user action. Before a `run continue` that would dispatch several ready tasks at once, report how many tasks and which adapters are about to run, and let the user confirm or step through one task at a time.
|
|
100
|
+
5. Honor `.sdtk/agent-runtime/config.json` `orchestration.confirmationMode` (`always` by default): no mode ever allows dispatch without at least one confirmation per run.
|
|
101
|
+
|
|
88
102
|
## 6) Clarification Protocol
|
|
89
103
|
Apply for all roles (`/pm`, `/ba`, `/arch`, `/dev`, `/qa`):
|
|
90
104
|
1. If there is ambiguity or missing data, log `Open Questions` as `OQ-xx` in the current phase artifact.
|
|
@@ -122,6 +136,9 @@ Use the suite products according to task intent:
|
|
|
122
136
|
- requirements, BA, PRD, backlog, architecture, QA artifacts
|
|
123
137
|
- handoff generation and release-gate traceability
|
|
124
138
|
- entry: `/orchestrator` (recommended), `/pm`, `/ba`, `/arch`, `/dev`, `/qa`
|
|
139
|
+
- `SDTK-DESIGN`
|
|
140
|
+
- screen/layout design, visual tokens, prototype evidence, design handoff before coding
|
|
141
|
+
- use before `SDTK-CODE` when implementation needs reviewable screens or a design handoff
|
|
125
142
|
- `SDTK-CODE`
|
|
126
143
|
- build a feature
|
|
127
144
|
- fix a bug
|
|
@@ -138,6 +155,18 @@ Use the suite products according to task intent:
|
|
|
138
155
|
- monitoring, incident response, security-infra, backup, compliance
|
|
139
156
|
- entry: `ops-discover` (when boundary is unclear), `ops-plan`, `ops-deploy`, `ops-incident`, `ops-monitor`, `ops-backup`, `ops-verify`, `ops-debug`
|
|
140
157
|
|
|
158
|
+
Cross-cutting capabilities (not a linear lane; usable across every phase):
|
|
159
|
+
|
|
160
|
+
- `SDTK-WIKI` (memory)
|
|
161
|
+
- project knowledge graph, docs view, and grounded `sdtk-wiki ask`
|
|
162
|
+
- any lane may read from it for recall; build with `sdtk-wiki atlas build`
|
|
163
|
+
- `SDTK-AGENT` (orchestration)
|
|
164
|
+
- a durable, file-driven DAG controller that sits above `sdtk-code` agent-team; it does not own a phase, it chains steps across lanes
|
|
165
|
+
- surface: `sdtk-agent run start|continue|status|report`, `gate approve|reject`, `workflow validate`, `adapter hermes-kanban plan`
|
|
166
|
+
- use only when a workflow has 3+ dependent steps, needs human gates between steps, or must survive a pause; otherwise route straight to a lane
|
|
167
|
+
- opt-in and token-aware: always propose-then-confirm before dispatch (see the orchestration cost gate in section 5)
|
|
168
|
+
- the CLI is runtime-neutral and installs no skills; the engine is Free, and live external dispatch is not part of this release (hermes-kanban is dry-run only)
|
|
169
|
+
|
|
141
170
|
If the current project only has `SDTK-SPEC` runtime assets installed:
|
|
142
171
|
- keep `/dev` bounded to planning and `CODE_HANDOFF`
|
|
143
172
|
- do not overclaim that SDTK-CODE or SDTK-OPS runtime assets are already installed
|
|
@@ -156,6 +185,8 @@ If the current project only has `SDTK-SPEC` runtime assets installed:
|
|
|
156
185
|
- For SDTK-SPEC-only installs: keep `/dev` bounded to planning and `CODE_HANDOFF`; do not claim SDTK-CODE or SDTK-OPS are installed.
|
|
157
186
|
- For Codex runtimes: project-local skills require the explicit local `CODEX_HOME=<project>/.codex` contract; native `.codex/skills` auto-discovery is not claimed.
|
|
158
187
|
- Use `ops-parallel` or `code-parallel` only for truly independent slices. If parallel dispatch is unavailable in the active runtime, execute them sequentially in one controller session.
|
|
188
|
+
- `SDTK-AGENT` is runtime-neutral: it installs no skills and behaves identically on Claude and Codex. It is CLI-only, so do not invent a slash command for it.
|
|
189
|
+
- The `sdtk-agent` hermes-kanban adapter is dry-run only in this release; it never calls a live gateway or creates a real card. Live dispatch is a future Pro capability, so do not claim it.
|
|
159
190
|
|
|
160
191
|
## 11) Discovery And PM Readiness
|
|
161
192
|
- PM initiation starts only after `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` is marked `READY_FOR_PM_INITIATION`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# CLAUDE.md
|
|
2
2
|
|
|
3
|
-
Version: 2.
|
|
4
|
-
Last Updated: 2026-
|
|
3
|
+
Version: 2.3
|
|
4
|
+
Last Updated: 2026-07-01
|
|
5
5
|
Owner: SDTK-SPEC Core Team
|
|
6
6
|
|
|
7
7
|
This file defines runtime guidance for Claude Code sessions in projects using the SDTK Suite.
|
|
@@ -14,10 +14,14 @@ This file defines runtime guidance for Claude Code sessions in projects using th
|
|
|
14
14
|
5. `sdtk-spec.config.json`
|
|
15
15
|
|
|
16
16
|
## 2) Runtime Model
|
|
17
|
-
- Suite routing:
|
|
17
|
+
- Suite routing (lanes, by task intent):
|
|
18
18
|
- `SDTK-SPEC`: orchestration, specs, planning, architecture, QA artifacts
|
|
19
|
+
- `SDTK-DESIGN`: screen/layout design, visual tokens, prototype evidence, design handoff before coding
|
|
19
20
|
- `SDTK-CODE`: implementation, bug fixing, refactoring, verification, ship flow; workflow `start->plan->build->verify->ship`; entry for ambiguous slices: `code-brainstorm`
|
|
20
21
|
- `SDTK-OPS`: deploy, infra, CI/CD, monitoring, incident, ops verification
|
|
22
|
+
- Cross-cutting capabilities (not a lane; usable across every phase):
|
|
23
|
+
- `SDTK-WIKI`: memory layer — knowledge graph, docs view, grounded `sdtk-wiki ask`
|
|
24
|
+
- `SDTK-AGENT`: orchestration layer — a durable, file-driven DAG controller above `sdtk-code` agent-team; chains multi-step runs with human gates. CLI-only (installs no skills, no slash command). Opt-in and token-aware: a run can spawn many sub-agents, so always propose-then-confirm before dispatch; never auto-start a run. See the orchestration cost gate in `AGENTS.md`.
|
|
21
25
|
- Default unprefixed entry point: Orchestrator Intake.
|
|
22
26
|
- Orchestrator classifies the user request before selecting a role, product lane, or skill.
|
|
23
27
|
- `SDTK-SPEC` phase workflow remains: PM -> BA -> ARCH -> DEV -> QA after intake decides formal feature delivery is ready.
|
|
@@ -32,9 +36,10 @@ This file defines runtime guidance for Claude Code sessions in projects using th
|
|
|
32
36
|
## 2.1) Claude Session Start Checklist
|
|
33
37
|
Read these in order when they exist:
|
|
34
38
|
1. `AGENTS.md`
|
|
35
|
-
2.
|
|
36
|
-
3. `governance/ai/session/
|
|
37
|
-
4.
|
|
39
|
+
2. `.sdtk/evolve/LEARNED.md` — locally learned, owner-approved lessons (managed by `/evolve` + `sdtk evolve`; never edit it directly)
|
|
40
|
+
3. `governance/ai/session/SDTK_ACTIVE_BOOTSTRAP.md`
|
|
41
|
+
4. `governance/ai/session/SDTK_AGENT_WORKING_RULES.md`
|
|
42
|
+
5. issue-specific controller spec and implementation plan
|
|
38
43
|
|
|
39
44
|
Routing rules:
|
|
40
45
|
- Raw idea -> brainstorm / requirement clarification, then create or update `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` before PM initiation
|
|
@@ -44,8 +49,11 @@ Routing rules:
|
|
|
44
49
|
- Atlas graph/viewer, SDTK-WIKI Ask boundary, project ingest, project refresh, and project audit -> matching SDTK command or workflow
|
|
45
50
|
- "what should we do next" -> Orchestrator state review using the smallest sufficient workflow
|
|
46
51
|
|
|
52
|
+
Active orchestration check:
|
|
53
|
+
- If `.sdtk/agent-runtime/runs/` holds a run whose state is not terminal (`running` or `waiting_for_approval`), surface it in one line (run id plus the blocking gate, if any) and offer `sdtk-agent run continue` before starting unrelated work.
|
|
54
|
+
|
|
47
55
|
Proceed-vs-ask summary:
|
|
48
|
-
- Ask clarification when the outcome is ambiguous, the target path/repo is missing, there is no acceptance boundary for implementation,
|
|
56
|
+
- Ask clarification when the outcome is ambiguous, the target path/repo is missing, there is no acceptance boundary for implementation, the next step could mutate external state, or the next step would spawn multiple sub-agents / incur significant token cost (such as dispatching an `sdtk-agent` run).
|
|
49
57
|
- Proceed when intent and target are clear, the task is read-only analysis, the plan/spec is already approved, or the change is bounded and verifiable.
|
|
50
58
|
|
|
51
59
|
If only SPEC runtime assets are installed:
|
|
@@ -88,6 +96,8 @@ Skills are installed at `.claude/skills/` and provide slash commands:
|
|
|
88
96
|
|
|
89
97
|
Specialist rule reference files are installed inside each skill directory when that skill needs them (for example `.claude/skills/api-doc/references/`).
|
|
90
98
|
|
|
99
|
+
`sdtk-agent` is CLI-only: it installs no skill and has no slash command. Drive it through the `sdtk-agent` CLI (`run start|continue|status|report`, `gate approve|reject`, `workflow validate`), never a `/agent` command.
|
|
100
|
+
|
|
91
101
|
## 5) References
|
|
92
102
|
- `sdtk-spec.config.json`
|
|
93
103
|
- `governance/ai/session/SDTK_ACTIVE_BOOTSTRAP.md`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# CODEX.md
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
4
|
-
Last Updated: 2026-
|
|
3
|
+
Version: 1.3
|
|
4
|
+
Last Updated: 2026-07-01
|
|
5
5
|
Owner: SDTK-SPEC Core Team
|
|
6
6
|
|
|
7
7
|
This file defines runtime guidance for Codex sessions in projects using the SDTK Suite.
|
|
@@ -14,10 +14,14 @@ This file defines runtime guidance for Codex sessions in projects using the SDTK
|
|
|
14
14
|
5. Other supporting docs
|
|
15
15
|
|
|
16
16
|
## 2) Runtime Model
|
|
17
|
-
- Suite routing:
|
|
17
|
+
- Suite routing (lanes, by task intent):
|
|
18
18
|
- `SDTK-SPEC`: orchestration, specs, planning, architecture, QA artifacts
|
|
19
|
+
- `SDTK-DESIGN`: screen/layout design, visual tokens, prototype evidence, design handoff before coding
|
|
19
20
|
- `SDTK-CODE`: implementation, bug fixing, refactoring, verification, ship flow; workflow `start->plan->build->verify->ship`; entry for ambiguous slices: `code-brainstorm`
|
|
20
21
|
- `SDTK-OPS`: deploy, infra, CI/CD, monitoring, incident, ops verification
|
|
22
|
+
- Cross-cutting capabilities (not a lane; usable across every phase):
|
|
23
|
+
- `SDTK-WIKI`: memory layer — knowledge graph, docs view, grounded `sdtk-wiki ask`
|
|
24
|
+
- `SDTK-AGENT`: orchestration layer — a durable, file-driven DAG controller above `sdtk-code` agent-team; chains multi-step runs with human gates. Runtime-neutral and CLI-only (installs no skills, no slash command). Opt-in and token-aware: a run can spawn many sub-agents, so always propose-then-confirm before dispatch; never auto-start a run. See the orchestration cost gate in `AGENTS.md`.
|
|
21
25
|
- Default unprefixed entry point: Orchestrator Intake.
|
|
22
26
|
- Orchestrator classifies the user request before selecting a role, product lane, or skill.
|
|
23
27
|
- `SDTK-SPEC` phase workflow remains: PM -> BA -> ARCH -> DEV -> QA after intake decides formal feature delivery is ready.
|
|
@@ -30,9 +34,10 @@ This file defines runtime guidance for Codex sessions in projects using the SDTK
|
|
|
30
34
|
## 2.1) Codex Session Start Checklist
|
|
31
35
|
Read these in order when they exist:
|
|
32
36
|
1. `AGENTS.md`
|
|
33
|
-
2.
|
|
34
|
-
3. `governance/ai/session/
|
|
35
|
-
4.
|
|
37
|
+
2. `.sdtk/evolve/LEARNED.md` — locally learned, owner-approved lessons (managed by the `sdtk-evolve` skill + `sdtk evolve`; never edit it directly)
|
|
38
|
+
3. `governance/ai/session/SDTK_ACTIVE_BOOTSTRAP.md`
|
|
39
|
+
4. `governance/ai/session/SDTK_AGENT_WORKING_RULES.md`
|
|
40
|
+
5. issue-specific controller spec and implementation plan
|
|
36
41
|
|
|
37
42
|
Routing rules:
|
|
38
43
|
- Raw idea -> brainstorm / requirement clarification, then create or update `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` before PM initiation
|
|
@@ -42,8 +47,11 @@ Routing rules:
|
|
|
42
47
|
- Atlas graph/viewer, SDTK-WIKI Ask boundary, project ingest, project refresh, and project audit -> matching SDTK command or workflow
|
|
43
48
|
- "what should we do next" -> Orchestrator state review using the smallest sufficient workflow
|
|
44
49
|
|
|
50
|
+
Active orchestration check:
|
|
51
|
+
- If `.sdtk/agent-runtime/runs/` holds a run whose state is not terminal (`running` or `waiting_for_approval`), surface it in one line (run id plus the blocking gate, if any) and offer `sdtk-agent run continue` before starting unrelated work.
|
|
52
|
+
|
|
45
53
|
Proceed-vs-ask summary:
|
|
46
|
-
- Ask clarification when the outcome is ambiguous, the target path/repo is missing, there is no acceptance boundary for implementation,
|
|
54
|
+
- Ask clarification when the outcome is ambiguous, the target path/repo is missing, there is no acceptance boundary for implementation, the next step could mutate external state, or the next step would spawn multiple sub-agents / incur significant token cost (such as dispatching an `sdtk-agent` run).
|
|
47
55
|
- Proceed when intent and target are clear, the task is read-only analysis, the plan/spec is already approved, or the change is bounded and verifiable.
|
|
48
56
|
|
|
49
57
|
If only SPEC runtime assets are installed:
|
|
@@ -165,8 +165,13 @@ foreach ($skillName in @('arch', 'api-doc', 'api-design-spec', 'screen-design-sp
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
# Strict count assertions
|
|
169
|
-
|
|
168
|
+
# Strict count assertions. Expected skills derive from the payload source of
|
|
169
|
+
# truth (dirs shipping a SKILL.md) so the integrity check still catches copy
|
|
170
|
+
# failures without drifting every time a skill is added (BK-316 fix; the old
|
|
171
|
+
# hard-coded 14 broke install when the 15th skill landed).
|
|
172
|
+
$expectedSkills = @(Get-ChildItem -Path $skillsSource -Directory | Where-Object {
|
|
173
|
+
Test-Path -LiteralPath (Join-Path $_.FullName 'SKILL.md')
|
|
174
|
+
}).Count
|
|
170
175
|
$expectedManagedRefs = 12
|
|
171
176
|
if ($skillCount -ne $expectedSkills) {
|
|
172
177
|
throw "Claude install failed. Expected $expectedSkills skills but installed $skillCount."
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdtk-evolve
|
|
3
|
+
description: "Local self-improvement loop for SDTK (BK-316). Harvest the operator's own past agent sessions for recurring friction, score adopted lessons by recurrence, and stage at most 4 bounded, evidence-backed lesson edits to .sdtk/evolve/LEARNED.md for explicit human adoption. Use at the end of a substantial work session, when the same correction keeps repeating, or when the operator asks to evolve/learn from this."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SDTK Evolve — learn from your own sessions, behind a human gate
|
|
7
|
+
|
|
8
|
+
Every turn produced while executing this skill is part of an evolve cycle. Begin your first reply with the literal, versioned marker line `<!-- sdtk-evolve:harvest-session:v1 -->` — future harvests use it to skip evolve-generated content, so the loop never mines itself. (Harvest filters must also skip content carrying the legacy `SDTK-EVOLVE CYCLE` marker from older sessions.)
|
|
9
|
+
|
|
10
|
+
## Critical Constraints
|
|
11
|
+
- I propose **at most 4** bounded edits per cycle — `add`, `delete`, or `replace` of single bullets — and I never rewrite the learned document wholesale.
|
|
12
|
+
- I **never edit** `.sdtk/evolve/LEARNED.md`, `state.json`, or any live file myself. `sdtk evolve stage` is the only writer of staging; only the human's `sdtk evolve adopt` applies it (there is **no auto-adopt** — the flag does not exist), and `sdtk evolve revert` restores the pre-adopt backup.
|
|
13
|
+
- Every proposed edit carries **evidence** (which sessions, how many occurrences) and a pre-registered falsifiable **bet** ("friction signature X stops appearing"). No measurable bet → the edit is dropped, not softened.
|
|
14
|
+
- Redaction is **fail-closed**: secrets, tokens, PII, prompts, and full transcripts never enter a draft. When unsure whether content is sensitive, describe it — never copy it. (`sdtk evolve stage` re-scans and refuses on any hit.)
|
|
15
|
+
- I never guess the Codex session-log format: the Codex harvest path follows the format validated by the issue #247 report only, and stays **gated** until the marker-persistence integration proof exists — the Claude path proceeds regardless.
|
|
16
|
+
- Opinion-only lessons (no falsifiable claim) may enter only as preference bullets and never override correctness lessons.
|
|
17
|
+
|
|
18
|
+
## When to run
|
|
19
|
+
- End of a substantial session, especially one where the operator corrected you more than once.
|
|
20
|
+
- The operator says some variant of "I told you this before".
|
|
21
|
+
- `sdtk evolve status` reports unharvested sessions or a due dogfood checkpoint.
|
|
22
|
+
|
|
23
|
+
## Procedure
|
|
24
|
+
|
|
25
|
+
1. **Load state.** Run `sdtk evolve status`. Read `.sdtk/evolve/state.json` (last harvest time, adopted lessons with signatures) and `.sdtk/evolve/LEARNED.md` (current lessons + line count vs the **150**-line cap). If the CLI is unavailable, stop and tell the operator to update `sdtk-kit` (the `evolve` CLI ships with sdtk-kit ≥ 1.16.0) — do **not** hand-write staging files.
|
|
26
|
+
2. **Harvest.** Scan sessions since the last harvest:
|
|
27
|
+
- **Claude Code (if present on this machine):** `~/.claude/projects/<project-slug>/*.jsonl` — extract per-session digests: user intents, tool usage, and correction signals (negative: "vẫn sai", "làm lại", "that's wrong", "I told you", "again"; positive: "perfect", "đúng rồi", "great").
|
|
28
|
+
- **Codex — format validated, harvest GATED:** the on-disk format is ground-truthed by `governance/ai/reviews/shared/SDTK_BK316_CODEX_HARVEST_VALIDATION_R1_20260710.md` (Codex CLI 0.144.1). When enabled, follow its rules exactly: scan `$CODEX_HOME/sessions/**/*.jsonl` recursively as the primary source (CODEX_HOME defaults to `~/.codex`) plus `archived_sessions/*.jsonl` as legacy input deduped by session id; extract ONLY canonical `response_item` records with `payload.type=="message" && payload.role=="user"`, taking `content[]` blocks of type `input_text` — never `event_msg` duplicates of the same turn, never developer-role records, never `<environment_context>`/AGENTS wrappers; require a filename-matching `session_meta` with non-empty `cwd` (project attribution) or skip the file fail-closed; pre-scan the WHOLE file for the self-pollution marker (v1 or legacy) and exclude the entire file on a match; never read tool `arguments`/`output`; stream large files rather than loading them whole. **Codex harvest remains gated until an integration proof shows the marker persists in a real Codex evolve session (report §7 condition 6)** — until then, note "codex: gated (marker persistence proof pending)" in the report and harvest Claude only.
|
|
29
|
+
- **Filters (both sources):** skip meta prompts (bare skill invocations, pasted-text stubs, system noise) and skip any content carrying the `<!-- sdtk-evolve:harvest-session:v1 -->` marker or the legacy `SDTK-EVOLVE CYCLE` marker (self-pollution guard).
|
|
30
|
+
3. **Score recurrence** for every adopted lesson: did its signature re-appear in post-adoption sessions? Render the verdict table — `WORKING` (no recurrence) or `FAILING` (recurred). A lesson FAILING for 2 consecutive cycles **must** get a `replace` or `delete` proposal before any new `add`. The same rule applies when `LEARNED.md` is over the 150-line cap.
|
|
31
|
+
4. **Reflect.** From the harvested friction, draft **at most 4** edits targeting the lane sections of `LEARNED.md` (`## Chung`, `## SPEC`, `## CODE`, `## OPS`, `## DESIGN`). Prefer one excellent lesson over four mediocre ones. Write the draft to a scratch file using this contract:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"schema": "sdtk.evolve-draft.v1",
|
|
36
|
+
"generated_at": "<ISO-8601 UTC>",
|
|
37
|
+
"harvest": { "sources": ["claude"], "sessions_scanned": 0, "since": "<ISO-8601 or null>", "codex": "skipped (pending #247)" },
|
|
38
|
+
"recurrence": [
|
|
39
|
+
{ "lesson_id": "L-001", "signature": "<toolkit:area:slug>", "before": "4/10", "after": "0/14", "verdict": "WORKING" }
|
|
40
|
+
],
|
|
41
|
+
"edits": [
|
|
42
|
+
{
|
|
43
|
+
"op": "add",
|
|
44
|
+
"lane": "CODE",
|
|
45
|
+
"content": "<one bullet, imperative, self-contained>",
|
|
46
|
+
"anchor": "<required for delete/replace: substring of the target bullet>",
|
|
47
|
+
"evidence": ["<session/date>: <what happened>, <N> occurrences"],
|
|
48
|
+
"bet": "<friction signature that should stop appearing>",
|
|
49
|
+
"signature": "<toolkit:area:slug>"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
5. **Stage.** Run `sdtk evolve stage --from <draft-path>`. The CLI validates the draft (budget, ops, lanes, required `evidence`/`bet`/`signature` fields), runs the fail-closed redaction scan, and writes `.sdtk/evolve/staging/<ts>/` (`proposal.md`, `edits.json`, `report.md` with the recurrence table and scorecard).
|
|
56
|
+
6. **Present and stop.** Show the operator: the recurrence verdict table, each proposed edit with its evidence and bet, and the exact next commands — `sdtk evolve adopt` to apply (backup taken automatically) or discard the staging folder; `sdtk evolve revert` undoes the last adopt. **Do not adopt on the operator's behalf. End the cycle here.**
|
|
57
|
+
|
|
58
|
+
## What LEARNED.md is (and is not)
|
|
59
|
+
- It is the operator-approved, locally learned layer that sessions read at start (the AGENTS.md/CODEX template carries the pointer). It survives `sdtk update` and re-init because it lives outside every kit-managed file.
|
|
60
|
+
- It is **not** yours to edit directly, not a scratchpad, not a place for secrets or project data — lessons are about *how to work*, not *what the code is*.
|
|
61
|
+
- Git posture is the operator's choice (commit to share with a team, ignore for personal habits); `sdtk evolve status` shows the current posture.
|
|
62
|
+
|
|
63
|
+
## Runtime Entrypoint Truth (Codex)
|
|
64
|
+
- Project-local Codex support is bounded to explicit `CODEX_HOME=<project>/.codex`; presence of `sdtk-evolve` under `.codex/skills` does not prove direct built-in exposure. Invoke via "Use the sdtk-evolve skill." when no direct syntax is validated.
|
|
65
|
+
|
|
66
|
+
## Effectiveness discipline (BK-316 §8)
|
|
67
|
+
The loop measures itself: recurrence verdicts are the metric, FAILING lessons get culled, and `sdtk evolve status` reminds the operator when the dogfood checkpoint (4 weeks / 20 sessions) is due. Never claim a lesson "works" without the recurrence evidence — flat/noisy results are reported as exactly that.
|
|
@@ -328,3 +328,25 @@ skills:
|
|
|
328
328
|
runtime_support: [claude, codex]
|
|
329
329
|
dependencies: [sdtk-qa, sdtk-screen-design-spec]
|
|
330
330
|
pack: core
|
|
331
|
+
- name: sdtk-evolve
|
|
332
|
+
phase: orchestration
|
|
333
|
+
role_tag: /evolve
|
|
334
|
+
use_when: Harvest the operator's own past agent sessions for recurring friction, score adopted lessons by recurrence, and stage at most 4 bounded evidence-backed lesson edits to .sdtk/evolve/LEARNED.md for explicit human adoption.
|
|
335
|
+
primary_inputs:
|
|
336
|
+
- .sdtk/evolve/state.json
|
|
337
|
+
- .sdtk/evolve/LEARNED.md
|
|
338
|
+
- local agent session logs (Claude Code transcripts; Codex per issue #247 validation)
|
|
339
|
+
primary_outputs:
|
|
340
|
+
- .sdtk/evolve/staging/<ts>/proposal.md
|
|
341
|
+
- .sdtk/evolve/staging/<ts>/edits.json
|
|
342
|
+
- .sdtk/evolve/staging/<ts>/report.md
|
|
343
|
+
hard_gates:
|
|
344
|
+
- Never edit LEARNED.md or state.json directly; staging comes only from `sdtk evolve stage`, and only the human's `sdtk evolve adopt` applies it (no auto-adopt exists).
|
|
345
|
+
- At most 4 bounded add|delete|replace edits per cycle, each with evidence and a pre-registered falsifiable bet; redaction is fail-closed.
|
|
346
|
+
- Never guess the Codex session-log format; harvest Codex only per the issue #247 validated format.
|
|
347
|
+
references: []
|
|
348
|
+
prompts: []
|
|
349
|
+
scripts: []
|
|
350
|
+
runtime_support: [claude, codex]
|
|
351
|
+
dependencies: []
|
|
352
|
+
pack: core
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: evolve
|
|
3
|
+
description: Local self-improvement loop for SDTK (BK-316). Harvest the operator's own past agent sessions for recurring friction, score adopted lessons by recurrence, and stage at most 4 bounded, evidence-backed lesson edits to .sdtk/evolve/LEARNED.md for explicit human adoption. Use at the end of a substantial work session, when the same correction keeps repeating, or when the operator asks to "evolve"/"learn from this".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SDTK Evolve — learn from your own sessions, behind a human gate
|
|
7
|
+
|
|
8
|
+
Every turn produced while executing this skill is part of an evolve cycle. Begin your first reply with the literal, versioned marker line `<!-- sdtk-evolve:harvest-session:v1 -->` — future harvests use it to skip evolve-generated content, so the loop never mines itself. (Harvest filters must also skip content carrying the legacy `SDTK-EVOLVE CYCLE` marker from older sessions.)
|
|
9
|
+
|
|
10
|
+
## Critical Constraints
|
|
11
|
+
- I propose **at most 4** bounded edits per cycle — `add`, `delete`, or `replace` of single bullets — and I never rewrite the learned document wholesale.
|
|
12
|
+
- I **never edit** `.sdtk/evolve/LEARNED.md`, `state.json`, or any live file myself. `sdtk evolve stage` is the only writer of staging; only the human's `sdtk evolve adopt` applies it (there is **no auto-adopt** — the flag does not exist), and `sdtk evolve revert` restores the pre-adopt backup.
|
|
13
|
+
- Every proposed edit carries **evidence** (which sessions, how many occurrences) and a pre-registered falsifiable **bet** ("friction signature X stops appearing"). No measurable bet → the edit is dropped, not softened.
|
|
14
|
+
- Redaction is **fail-closed**: secrets, tokens, PII, prompts, and full transcripts never enter a draft. When unsure whether content is sensitive, describe it — never copy it. (`sdtk evolve stage` re-scans and refuses on any hit.)
|
|
15
|
+
- I never guess the Codex session-log format: the Codex harvest path follows the format validated by the issue #247 report only, and stays **gated** until the marker-persistence integration proof exists — the Claude path proceeds regardless.
|
|
16
|
+
- Opinion-only lessons (no falsifiable claim) may enter only as preference bullets and never override correctness lessons.
|
|
17
|
+
|
|
18
|
+
## When to run
|
|
19
|
+
- End of a substantial session, especially one where the operator corrected you more than once.
|
|
20
|
+
- The operator says some variant of "I told you this before".
|
|
21
|
+
- `sdtk evolve status` reports unharvested sessions or a due dogfood checkpoint.
|
|
22
|
+
|
|
23
|
+
## Procedure
|
|
24
|
+
|
|
25
|
+
1. **Load state.** Run `sdtk evolve status`. Read `.sdtk/evolve/state.json` (last harvest time, adopted lessons with signatures) and `.sdtk/evolve/LEARNED.md` (current lessons + line count vs the **150**-line cap). If the CLI is unavailable, stop and tell the operator to update `sdtk-kit` (the `evolve` CLI ships with sdtk-kit ≥ 1.16.0) — do **not** hand-write staging files.
|
|
26
|
+
2. **Harvest.** Scan sessions since the last harvest:
|
|
27
|
+
- **Claude Code:** `~/.claude/projects/<project-slug>/*.jsonl` — extract per-session digests: user intents, tool usage, and correction signals (negative: "vẫn sai", "làm lại", "that's wrong", "I told you", "again"; positive: "perfect", "đúng rồi", "great").
|
|
28
|
+
- **Codex — format validated, harvest GATED:** the on-disk format is ground-truthed by `governance/ai/reviews/shared/SDTK_BK316_CODEX_HARVEST_VALIDATION_R1_20260710.md` (Codex CLI 0.144.1). When enabled, follow its rules exactly: scan `$CODEX_HOME/sessions/**/*.jsonl` recursively as the primary source (CODEX_HOME defaults to `~/.codex`) plus `archived_sessions/*.jsonl` as legacy input deduped by session id; extract ONLY canonical `response_item` records with `payload.type=="message" && payload.role=="user"`, taking `content[]` blocks of type `input_text` — never `event_msg` duplicates of the same turn, never developer-role records, never `<environment_context>`/AGENTS wrappers; require a filename-matching `session_meta` with non-empty `cwd` (project attribution) or skip the file fail-closed; pre-scan the WHOLE file for the self-pollution marker (v1 or legacy) and exclude the entire file on a match; never read tool `arguments`/`output`; stream large files rather than loading them whole. **Codex harvest remains gated until an integration proof shows the marker persists in a real Codex evolve session (report §7 condition 6)** — until then, note "codex: gated (marker persistence proof pending)" in the report and harvest Claude only.
|
|
29
|
+
- **Filters (both sources):** skip meta prompts (bare slash commands, pasted-text stubs, system noise) and skip any content carrying the `<!-- sdtk-evolve:harvest-session:v1 -->` marker or the legacy `SDTK-EVOLVE CYCLE` marker (self-pollution guard).
|
|
30
|
+
3. **Score recurrence** for every adopted lesson: did its signature re-appear in post-adoption sessions? Render the verdict table — `WORKING` (no recurrence) or `FAILING` (recurred). A lesson FAILING for 2 consecutive cycles **must** get a `replace` or `delete` proposal before any new `add`. The same rule applies when `LEARNED.md` is over the 150-line cap.
|
|
31
|
+
4. **Reflect.** From the harvested friction, draft **at most 4** edits targeting the lane sections of `LEARNED.md` (`## Chung`, `## SPEC`, `## CODE`, `## OPS`, `## DESIGN`). Prefer one excellent lesson over four mediocre ones. Write the draft to a scratch file using this contract:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"schema": "sdtk.evolve-draft.v1",
|
|
36
|
+
"generated_at": "<ISO-8601 UTC>",
|
|
37
|
+
"harvest": { "sources": ["claude"], "sessions_scanned": 0, "since": "<ISO-8601 or null>", "codex": "skipped (pending #247)" },
|
|
38
|
+
"recurrence": [
|
|
39
|
+
{ "lesson_id": "L-001", "signature": "<toolkit:area:slug>", "before": "4/10", "after": "0/14", "verdict": "WORKING" }
|
|
40
|
+
],
|
|
41
|
+
"edits": [
|
|
42
|
+
{
|
|
43
|
+
"op": "add",
|
|
44
|
+
"lane": "CODE",
|
|
45
|
+
"content": "<one bullet, imperative, self-contained>",
|
|
46
|
+
"anchor": "<required for delete/replace: substring of the target bullet>",
|
|
47
|
+
"evidence": ["<session/date>: <what happened>, <N> occurrences"],
|
|
48
|
+
"bet": "<friction signature that should stop appearing>",
|
|
49
|
+
"signature": "<toolkit:area:slug>"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
5. **Stage.** Run `sdtk evolve stage --from <draft-path>`. The CLI validates the draft (budget, ops, lanes, required `evidence`/`bet`/`signature` fields), runs the fail-closed redaction scan, and writes `.sdtk/evolve/staging/<ts>/` (`proposal.md`, `edits.json`, `report.md` with the recurrence table and scorecard).
|
|
56
|
+
6. **Present and stop.** Show the operator: the recurrence verdict table, each proposed edit with its evidence and bet, and the exact next commands — `sdtk evolve adopt` to apply (backup taken automatically) or discard the staging folder; `sdtk evolve revert` undoes the last adopt. **Do not adopt on the operator's behalf. End the cycle here.**
|
|
57
|
+
|
|
58
|
+
## What LEARNED.md is (and is not)
|
|
59
|
+
- It is the operator-approved, locally learned layer that sessions read at start (the CLAUDE.md template carries the pointer). It survives `sdtk update` and re-init because it lives outside every kit-managed file.
|
|
60
|
+
- It is **not** yours to edit directly, not a scratchpad, not a place for secrets or project data — lessons are about *how to work*, not *what the code is*.
|
|
61
|
+
- Git posture is the operator's choice (commit to share with a team, ignore for personal habits); `sdtk evolve status` shows the current posture.
|
|
62
|
+
|
|
63
|
+
## Effectiveness discipline (BK-316 §8)
|
|
64
|
+
The loop measures itself: recurrence verdicts are the metric, FAILING lessons get culled, and `sdtk evolve status` reminds the operator when the dogfood checkpoint (4 weeks / 20 sessions) is due. Never claim a lesson "works" without the recurrence evidence — flat/noisy results are reported as exactly that.
|
package/bin/sdtk.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/lib/scope.js
CHANGED
|
@@ -56,15 +56,15 @@ function resolveSkillsDir(runtime, scope, projectPath) {
|
|
|
56
56
|
const MANAGED_CODEX_SKILLS = [
|
|
57
57
|
"sdtk-api-design-spec", "sdtk-api-doc", "sdtk-arch", "sdtk-ba",
|
|
58
58
|
"sdtk-design-layout", "sdtk-dev", "sdtk-dev-backend", "sdtk-dev-frontend",
|
|
59
|
-
"sdtk-
|
|
60
|
-
"sdtk-test-case-spec",
|
|
59
|
+
"sdtk-evolve", "sdtk-orchestrator", "sdtk-pm", "sdtk-qa",
|
|
60
|
+
"sdtk-screen-design-spec", "sdtk-test-case-spec",
|
|
61
61
|
];
|
|
62
62
|
|
|
63
63
|
const MANAGED_CLAUDE_SKILLS = [
|
|
64
64
|
"api-design-spec", "api-doc", "arch", "ba",
|
|
65
65
|
"design-layout", "dev", "dev-backend", "dev-frontend",
|
|
66
|
-
"
|
|
67
|
-
"test-case-spec",
|
|
66
|
+
"evolve", "orchestrator", "pm", "qa",
|
|
67
|
+
"screen-design-spec", "test-case-spec",
|
|
68
68
|
];
|
|
69
69
|
|
|
70
70
|
function managedSkillNames(runtime) {
|