@hegemonart/get-design-done 1.50.1 → 1.51.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +46 -0
- package/README.md +2 -0
- package/SKILL.md +2 -1
- package/agents/design-reflector.md +33 -0
- package/dist/claude-code/.claude/skills/apply-reflections/SKILL.md +17 -0
- package/dist/claude-code/.claude/skills/extract-learnings/SKILL.md +16 -0
- package/dist/claude-code/.claude/skills/instinct/SKILL.md +111 -0
- package/hooks/gdd-decision-injector.js +115 -6
- package/package.json +1 -1
- package/reference/instinct-format.md +120 -0
- package/reference/registry.json +7 -0
- package/reference/schemas/events.schema.json +1 -1
- package/reference/schemas/instinct.schema.json +91 -0
- package/reference/skill-graph.md +2 -1
- package/scripts/lib/instinct-store.cjs +677 -0
- package/scripts/lib/manifest/skills.json +8 -0
- package/skills/apply-reflections/SKILL.md +17 -0
- package/skills/extract-learnings/SKILL.md +16 -0
- package/skills/instinct/SKILL.md +111 -0
|
@@ -84,6 +84,23 @@ Incubator drafts authored by `scripts/lib/incubator-author.cjs` (Phase 29-04) ap
|
|
|
84
84
|
|
|
85
85
|
KFM-catalogue proposals authored by `scripts/lib/reflector-kfm-proposer.cjs` (Phase 30.5-03 D-05) appear as a 6th proposal class. Drafts at `.design/reflections/incubator/kfm-<slug>/CATALOGUE-ENTRY.md`; pre-filled 11-field schema with `TODO:` placeholders for `pattern` + `fix`. Two upstream signals share the surface (D-06): `capability_gap` clusters (≥3, no existing match) + `kfm-candidate` events (whitelist-matched articles, 1-shot). User chooses **accept** | **reject** | **defer** | **edit**. `applyAccept` appends to `reference/known-failure-modes.md` + `reference/registry.json` (`origin: incubator-kfm`); `applyReject` removes the incubator subdir; `applyDefer` stamps `deferred_until`; `applyEdit` returns the draft path for `$EDITOR`. Full procedure: `./apply-reflections-procedure.md` §[KFM-CANDIDATE].
|
|
86
86
|
|
|
87
|
+
## [INSTINCT]
|
|
88
|
+
|
|
89
|
+
Atomic instinct units emitted by `design-reflector` (and surfaced from `/gdd:extract-learnings`) appear as a distinct proposal class, alongside `[INCUBATOR]` and `[KFM-CANDIDATE]`. Each unit is a fenced `yaml` block under the reflector's `## Atomic instincts` section, shaped per `reference/instinct-format.md` (`id`, `trigger`, `confidence`, `domain`, `scope`, `project_id`, `source`, `cycles_seen`, `first_seen`, `last_seen`, plus a short body). A unit is a proposal, never a stored fact - nothing lands until the user accepts it.
|
|
90
|
+
|
|
91
|
+
Mirror the `[INCUBATOR]` flow:
|
|
92
|
+
|
|
93
|
+
1. Discover the units: parse every `yaml` block under `## Atomic instincts` in the reflections file. Skip malformed blocks (warn on stderr, keep going).
|
|
94
|
+
2. For each unit: show the parsed `trigger`, `domain`, `confidence`, and body so the user sees what would be stored.
|
|
95
|
+
3. Prompt: `(a) accept (r) reject (d) defer (e) edit (q) quit`.
|
|
96
|
+
|
|
97
|
+
**Per-action behavior:**
|
|
98
|
+
|
|
99
|
+
1. **accept** - call `scripts/lib/instinct-store.cjs` `add(unit, { scope, baseDir })` with the unit at its emitted `confidence`. The store owns de-duplication and `cycles_seen` bookkeeping. On success print `Stored instinct <id> (<domain>, confidence <n>).` and append `**Applied**: <date>` to the proposal block.
|
|
100
|
+
2. **reject** - do not store the unit. Append `**Reviewed: rejected**` to the reflections file.
|
|
101
|
+
3. **defer** - no-op; the unit re-surfaces next run. Append `**Reviewed: deferred**`.
|
|
102
|
+
4. **edit** - let the user adjust `trigger`, `confidence`, or `domain`, then accept the edited unit through the same `add(...)` call. Default `scope: 'project'` (write `global` only when the unit's frontmatter says so); never edit `.design/instincts/instincts.json` directly, and promote to global via the separate gated `/gdd:instinct promote`.
|
|
103
|
+
|
|
87
104
|
## Do Not
|
|
88
105
|
|
|
89
106
|
- Do not apply any proposal without the user explicitly choosing `a` or `e`.
|
|
@@ -53,6 +53,22 @@ Layout of `.design/learnings/LEARNINGS.md`:
|
|
|
53
53
|
---
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
### Step 3b - Dual-emit atomic instinct units (Phase 51)
|
|
57
|
+
|
|
58
|
+
Alongside the prose `LEARNINGS.md`, emit atomic instinct units for every learning the extractor tags as an `instinct-candidate`. A learning is an `instinct-candidate` when it states a single trigger plus a one-line response - the same shape the reflector emits. Broader narrative learnings stay prose-only.
|
|
59
|
+
|
|
60
|
+
For each `instinct-candidate`, build a unit per `reference/instinct-format.md` (frontmatter: `id`, `trigger`, `confidence` from 0.3 to 0.9, `domain`, `scope`, `project_id`, `source`, `cycles_seen`, `first_seen`, `last_seen`, plus a short body). Set `source: extract-learnings`. Carry the learning's confidence (high / medium / low) into the numeric field (roughly 0.8 / 0.55 / 0.35), capped at 0.9.
|
|
61
|
+
|
|
62
|
+
Write each unit through the store engine `scripts/lib/instinct-store.cjs` rather than by hand:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/lib/instinct-store.cjs" add --scope project
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If the engine exposes a module API only, drive `add(unit, { scope: 'project', baseDir })` from a short `node -e` script. The engine owns de-duplication and `cycles_seen` bookkeeping; do not pre-merge.
|
|
69
|
+
|
|
70
|
+
The prose `LEARNINGS.md` is **retained read-only for one minor version** so existing readers keep working while tooling migrates to the units. Keep writing it; do not drop the prose path in this version.
|
|
71
|
+
|
|
56
72
|
### Step 4 - Reference file proposal (optional)
|
|
57
73
|
|
|
58
74
|
After writing LEARNINGS.md, check each learning entry with `Proposed reference update: yes`.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-instinct
|
|
3
|
+
description: "Inspects and manages atomic instinct learning units - small, scoped, confidence-weighted patterns the pipeline accumulates across cycles. Lists the project and global instinct stores, searches them by keyword, and promotes a vetted project instinct to the global store once it has cleared the cross-project gate. Use when the user wants to see what instincts exist, find an instinct by topic, or promote one to global scope. Activates for requests involving instincts, learned patterns, instinct promotion, instinct search, or the instinct store."
|
|
4
|
+
argument-hint: "[list | query <keyword> | promote <id>] [--scope project|global] [--domain <d>]"
|
|
5
|
+
tools: Read, Bash
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /gdd:instinct
|
|
10
|
+
|
|
11
|
+
**Role:** Front end for the atomic instinct store. An instinct is a single learned pattern with a trigger, a confidence between 0.3 and 0.9, a domain, and a scope. This skill lists, searches, and promotes instincts. It never edits stored units by hand and never invents new ones - the reflector and `/gdd:extract-learnings` author them.
|
|
12
|
+
|
|
13
|
+
The store engine ships at `scripts/lib/instinct-store.cjs` (authored elsewhere - this skill only calls it). Unit shape (YAML frontmatter plus a short body) is specified in `reference/instinct-format.md`. The project store lives at `.design/instincts/instincts.json`; the global store at `~/.claude/gdd/global-instincts.json`.
|
|
14
|
+
|
|
15
|
+
Invoke the engine with `node`, the same way other skills call a `scripts/lib` helper:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/lib/instinct-store.cjs" <subcommand> [args]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If the engine exposes only a module API rather than a CLI, drive it from a short `node -e` script:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
node -e "const s=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/instinct-store.cjs'); console.log(JSON.stringify(s.list({scope:process.env.SCOPE})))"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Invocation Modes
|
|
28
|
+
|
|
29
|
+
| Command | Behavior |
|
|
30
|
+
|---|---|
|
|
31
|
+
| `/gdd:instinct list` | Compact table of stored instincts (default mode). |
|
|
32
|
+
| `/gdd:instinct query "<keyword>"` | Search instincts by keyword; show the top matches. |
|
|
33
|
+
| `/gdd:instinct promote <id>` | Promote one project instinct to the global store (gated). |
|
|
34
|
+
|
|
35
|
+
Flags apply across modes:
|
|
36
|
+
|
|
37
|
+
- `--scope project|global` selects which store to read. Default is `project`.
|
|
38
|
+
- `--domain <d>` filters to one domain (the domain enum is defined in `reference/instinct-format.md`).
|
|
39
|
+
|
|
40
|
+
## list
|
|
41
|
+
|
|
42
|
+
Read the requested store and print a compact table. Call `instinct-store.list({ scope, domain, baseDir })`:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
node -e "const s=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/instinct-store.cjs'); \
|
|
46
|
+
const rows=s.list({ scope: process.env.SCOPE || 'project', domain: process.env.DOMAIN || undefined }); \
|
|
47
|
+
console.log(JSON.stringify(rows));"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Render one row per instinct. Keep it scannable:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
ID DOMAIN CONF CYCLES TRIGGER
|
|
54
|
+
in-7f3a tokens 0.72 3 palette has no neutral ramp
|
|
55
|
+
in-91bc layout 0.55 2 cards overflow on the 320px breakpoint
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- `CONF` is the stored confidence (0.3 to 0.9).
|
|
59
|
+
- `CYCLES` is `cycles_seen`.
|
|
60
|
+
- Truncate `TRIGGER` to keep each line on one row.
|
|
61
|
+
|
|
62
|
+
If the store is empty, print: `No instincts in the <scope> store yet. Run /gdd:reflect or /gdd:extract-learnings to accumulate some.`
|
|
63
|
+
|
|
64
|
+
## query
|
|
65
|
+
|
|
66
|
+
Search by keyword and show the closest matches. Call `instinct-store.query(keyword, { scope, baseDir, limit })`. The engine uses an FTS5 index when one is present and falls back to a plain scan otherwise; either path returns the same row shape.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
node -e "const s=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/instinct-store.cjs'); \
|
|
70
|
+
const hits=s.query(process.env.KW, { scope: process.env.SCOPE || 'project', limit: 10 }); \
|
|
71
|
+
console.log(JSON.stringify(hits));"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Print the top matches in the same table shape as `list`, ordered by the engine's relevance ranking. If there are no matches, say so plainly and suggest a broader keyword. Quote multi-word keywords so the shell passes one argument.
|
|
75
|
+
|
|
76
|
+
## promote
|
|
77
|
+
|
|
78
|
+
Promote a single project instinct into the global store so it applies across every project. Promotion is **gated**: `instinct-store.promote(id, { baseDir })` only succeeds when the instinct has been seen across at least K cycles (K=2) spanning at least M distinct project ids (M=2). The engine enforces the gate; this skill surfaces the outcome and asks the user to confirm before the write.
|
|
79
|
+
|
|
80
|
+
Confirm first. Prefer `@clack/prompts`, and fall back to `AskUserQuestion` when it is absent (mirror the probe in `/gdd:new-skill`):
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
node -e "try { require.resolve('@clack/prompts'); console.log('clack'); } catch { console.log('fallback'); }"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- `clack`: drive `clack.confirm({ message: 'Promote <id> to the global store?' })` from a short Node script.
|
|
87
|
+
- `fallback`: ask the same yes or no question with `AskUserQuestion`.
|
|
88
|
+
|
|
89
|
+
On a confirmed yes, run the promotion:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
node -e "const s=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/instinct-store.cjs'); \
|
|
93
|
+
console.log(JSON.stringify(s.promote(process.env.ID, {})));"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Branch on the engine result:
|
|
97
|
+
|
|
98
|
+
- Promotion succeeded: print `Promoted <id> to the global store.` and show the new global row.
|
|
99
|
+
- Gate not met: the engine reports how far the instinct is from the K=2 / M=2 bar. Print that plainly, for example `<id> needs 2 cycles across 2 projects; seen 1 cycle in 1 project so far. Not promoted.` Do not retry and do not force the write.
|
|
100
|
+
- Unknown id: print `No instinct <id> in the project store.` and suggest `/gdd:instinct list`.
|
|
101
|
+
|
|
102
|
+
If the user answers no at the confirm step, print `Promotion cancelled.` and exit without writing.
|
|
103
|
+
|
|
104
|
+
## Do Not
|
|
105
|
+
|
|
106
|
+
- Do not edit `.design/instincts/instincts.json` or the global store by hand. All writes go through `scripts/lib/instinct-store.cjs`.
|
|
107
|
+
- Do not author new instincts here. The reflector and `/gdd:extract-learnings` emit units; this skill reads and promotes them.
|
|
108
|
+
- Do not bypass the promotion gate. If the K=2 / M=2 bar is not met, report it and stop.
|
|
109
|
+
- Do not modify `reference/instinct-format.md` or the store engine.
|
|
110
|
+
|
|
111
|
+
## INSTINCT COMPLETE
|