@oneie/claude 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.
Files changed (59) hide show
  1. package/.claude-plugin/plugin.json +16 -0
  2. package/.mcp.json +12 -0
  3. package/README.md +204 -0
  4. package/agents/w1-recon.md +102 -0
  5. package/agents/w2-decide.md +164 -0
  6. package/agents/w3-edit.md +91 -0
  7. package/agents/w4-verify.md +416 -0
  8. package/commands/browser.md +55 -0
  9. package/commands/cc-connect.md +67 -0
  10. package/commands/claw.md +135 -0
  11. package/commands/close.md +143 -0
  12. package/commands/create.md +78 -0
  13. package/commands/deploy.md +415 -0
  14. package/commands/do-autonomous.md +80 -0
  15. package/commands/do-improve.md +51 -0
  16. package/commands/do-show.md +89 -0
  17. package/commands/do.md +226 -0
  18. package/commands/improve.md +99 -0
  19. package/commands/kill.md +45 -0
  20. package/commands/release.md +144 -0
  21. package/commands/see.md +161 -0
  22. package/commands/setup.md +75 -0
  23. package/commands/sync.md +185 -0
  24. package/hooks/hooks.json +90 -0
  25. package/hooks/lib/signal.sh +28 -0
  26. package/hooks/scripts/design-check.sh +83 -0
  27. package/hooks/scripts/post-edit-check.sh +32 -0
  28. package/hooks/scripts/session-end-verify.sh +51 -0
  29. package/hooks/scripts/session-start.sh +88 -0
  30. package/hooks/scripts/stop-reflect.sh +95 -0
  31. package/hooks/scripts/sync-todo-docs.sh +46 -0
  32. package/hooks/scripts/task-complete-verify.sh +52 -0
  33. package/hooks/scripts/tool-signal.sh +48 -0
  34. package/package.json +33 -0
  35. package/rules/api.md +50 -0
  36. package/rules/astro.md +206 -0
  37. package/rules/design.md +221 -0
  38. package/rules/documentation.md +218 -0
  39. package/rules/engine.md +297 -0
  40. package/rules/react.md +137 -0
  41. package/rules/ui.md +82 -0
  42. package/scripts/cc-connect.sh +345 -0
  43. package/scripts/do-analyze.sh +42 -0
  44. package/scripts/do-folder.sh +63 -0
  45. package/scripts/do-prove.sh +51 -0
  46. package/scripts/do-reconcile.sh +28 -0
  47. package/scripts/do-smoke.sh +60 -0
  48. package/scripts/do-survey.sh +30 -0
  49. package/scripts/do-tier.sh +43 -0
  50. package/skills/build/SKILL.md +52 -0
  51. package/skills/cloudflare/SKILL.md +503 -0
  52. package/skills/dev/SKILL.md +58 -0
  53. package/skills/do/SKILL.md +24 -0
  54. package/skills/oneie/SKILL.md +51 -0
  55. package/skills/perf/SKILL.md +45 -0
  56. package/skills/signal/SKILL.md +108 -0
  57. package/skills/sui/SKILL.md +441 -0
  58. package/skills/tutorial/SKILL.md +96 -0
  59. package/skills/typecheck/SKILL.md +66 -0
@@ -0,0 +1,144 @@
1
+ # /release
2
+
3
+ **Source of truth:** `one/release.md` · **Script:** `scripts/release.ts`
4
+
5
+ Assemble `release/` from the monorepo, publish npm packages, and push to `github.com/one-ie/one`.
6
+
7
+ ## Modes
8
+
9
+ | Invocation | What |
10
+ |-----------|------|
11
+ | `/release` | Stage + publish + push (full pipeline) |
12
+ | `/release --stage` | Assemble `release/` only, no publish, no push |
13
+ | `/release --push` | Stage + push to one-ie/one (skip npm publish) |
14
+ | `/release --dry-run` | Print manifest, no writes |
15
+
16
+ ## The Three Packages
17
+
18
+ | Package | npm name | Publish from | Depends on |
19
+ |---------|----------|-------------|------------|
20
+ | SDK | `@oneie/sdk` | `release/sdk` | — |
21
+ | CLI | `oneie` | `packages/cli` | `@oneie/sdk` |
22
+ | MCP | `@oneie/mcp` | `release/mcp` | `@oneie/sdk` |
23
+
24
+ **Publish order:** SDK first, then CLI + MCP.
25
+
26
+ ---
27
+
28
+ ## Steps
29
+
30
+ ### Step 1 — Stage (`bun run release`)
31
+
32
+ ```bash
33
+ bun run release # assembles release/ from monorepo
34
+ bun run release -- --dry-run # preview only
35
+ ```
36
+
37
+ The script (`scripts/release.ts`) runs six sub-steps:
38
+
39
+ | Sub-step | What |
40
+ |----------|------|
41
+ | `clean` | Wipe `release/` (preserve `.git`) |
42
+ | `copy` | Run manifest: `agents/templates`, `packages/sdk`, `packages/mcp`, `.claude`, `templates/web` |
43
+ | `one` | Copy `one/` docs filtered by public allowlist (strategy + in-flight work withheld) |
44
+ | `overlay` | Apply `scripts/release-templates/` on top (README.md, CLAUDE.md, AGENTS.md overrides) |
45
+ | `license` | Mirror root `LICENSE` into every slot |
46
+ | `verify` | Assert 4-file convention: `README.md`, `CLAUDE.md`, `AGENTS.md`, `LICENSE` in root + each slot |
47
+
48
+ **Slots:** `agents/` · `one/` · `sdk/` · `mcp/` · `.claude/` · `web/`
49
+
50
+ **Key copies:**
51
+ - `templates/web` → `release/web` (Astro + React template)
52
+ - `packages/sdk` → `release/sdk`
53
+ - `packages/mcp` → `release/mcp`
54
+ - `.claude` → `release/.claude` (excl. `settings.local.json`)
55
+ - `agents/templates` → `release/agents/templates` (real pods withheld)
56
+ - `one/` → `release/one` (allowlist filtered)
57
+
58
+ Report: files copied, bytes, ms per sub-step.
59
+
60
+ ### Step 2 — Version Bump
61
+
62
+ Before publishing, sync versions. SDK must be bumped first:
63
+
64
+ 1. Bump `packages/sdk/package.json` version
65
+ 2. Update `packages/cli/package.json` `@oneie/sdk` dep to match
66
+ 3. Update `packages/mcp/package.json` `@oneie/sdk` dep to match
67
+ 4. Bump CLI and MCP versions
68
+
69
+ **CRITICAL:** `cd packages/sdk` before `npm version` — running from monorepo root triggers lockfile relock.
70
+
71
+ ```bash
72
+ cd packages/sdk && npm version patch && cd ../..
73
+ cd packages/cli && npm version patch && cd ../..
74
+ cd packages/mcp && npm version patch && cd ../..
75
+ ```
76
+
77
+ Re-run `bun run release` after bumping so `release/sdk` and `release/mcp` reflect new versions.
78
+
79
+ ### Step 3 — Build + Publish
80
+
81
+ SDK must publish before CLI and MCP resolve it.
82
+
83
+ ```bash
84
+ # SDK
85
+ cd release/sdk && bun run build && npm publish --access public && cd ../..
86
+
87
+ # CLI (publishes from packages/cli, not release/)
88
+ cd packages/cli && npm run build && npm publish --access public && cd ../..
89
+
90
+ # MCP
91
+ cd release/mcp && bun run build && npm publish --access public && cd ../..
92
+ ```
93
+
94
+ ### Step 4 — Push to github.com/one-ie/one
95
+
96
+ ```bash
97
+ bun run release -- --push
98
+ ```
99
+
100
+ The `--push` flag (built into `scripts/release.ts`):
101
+ 1. `git init` inside `release/` if no `.git` (first time)
102
+ 2. `git remote add origin git@github.com:one-ie/one.git`
103
+ 3. `git add .`
104
+ 4. `git commit -m "release: v<version>"`
105
+ 5. `git push -u origin main`
106
+
107
+ ### Step 5 — Report
108
+
109
+ ```
110
+ Stage: clean 12ms copy 340ms one 28ms overlay 5ms license 2ms verify 3ms
111
+ 487 files, 4.2MB total 390ms
112
+ Publish: @oneie/sdk@0.8.0 ✓ oneie@3.8.3 ✓ @oneie/mcp@0.2.0 ✓
113
+ Push: ✓ github.com/one-ie/one commit: release: v0.8.0
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Manifest Reference (`scripts/release.ts`)
119
+
120
+ ```typescript
121
+ const manifest = [
122
+ { from: 'agents/templates', to: 'agents/templates' },
123
+ { from: 'packages/sdk', to: 'sdk', exclude: ['node_modules', 'dist'] },
124
+ { from: 'packages/mcp', to: 'mcp', exclude: ['node_modules', 'dist'] },
125
+ { from: '.claude', to: '.claude', exclude: ['settings.local.json'] },
126
+ { from: 'templates/web', to: 'web', exclude: ['node_modules', 'dist', '.astro'] },
127
+ ]
128
+ // one/ is filtered separately by ONE_PUBLIC_DOCS allowlist
129
+ // README.md + CLAUDE.md come from scripts/release-templates/ overlay (NOT monorepo root)
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Gotchas
135
+
136
+ - **Internal CLAUDE.md never ships** — it's 43KB of private dev context; the overlay provides a clean public version
137
+ - **`one/` is default-deny** — only files in `ONE_PUBLIC_DOCS` allowlist ship; strategy/partnership docs stay private
138
+ - **SDK publishes first** — CLI and MCP declare `@oneie/sdk` as dependency; registry must have it before they resolve
139
+ - **`release/.git` persists** — `clean` step preserves `.git` so `release/` stays a live checkout of `one-ie/one`
140
+ - **CLI publishes from `packages/cli`** — not `release/`; there's no `release/cli` slot
141
+
142
+ ---
143
+
144
+ *Stage. Publish. Push. The release/ directory IS the one-ie/one repo. Three packages, one truth.*
@@ -0,0 +1,161 @@
1
+ # /see
2
+
3
+ **Skills:** `/typedb` (read-only queries across all 6 dimensions)
4
+
5
+ Read the world — query substrate state without emitting signals.
6
+
7
+ ## Nouns
8
+
9
+ | Noun | What | Loop |
10
+ |------|------|------|
11
+ | `tasks [--tag X] [--status Y]` | Open work sorted by effective priority | L1 |
12
+ | `highways [--limit N]` | Proven paths — strength ≥ 50 (default top 20) | L2 |
13
+ | `toxic` | Blocked paths — resistance > strength | L3 |
14
+ | `frontiers` | Unexplored tag clusters (<10% traversed) | L7 |
15
+ | `paths [--from X] [--to Y]` | Any path query by source/target | L2 |
16
+ | `hypotheses` | Permanent knowledge (hardened by L6) | L6 |
17
+ | `evolved` | Agents that rewrote their system prompts | L5 |
18
+ | `revenue` | Per-path earnings from L4 economic loop | L4 |
19
+ | `events [--since T]` | Signal history and Four Outcomes audit | L1 |
20
+ | `memory <uid>` | Full memory card for an actor (reveal) | L6 |
21
+
22
+ ## Routing
23
+
24
+ `/see` maps to `follow()` — deterministic read along strongest paths.
25
+ No mark(), no warn(), no side effects. Every noun is read-only.
26
+
27
+ | Noun | Primitive | Source |
28
+ |------|-----------|--------|
29
+ | tasks | `follow()` queue read | `/api/tasks` or `scanTodos()` |
30
+ | highways | `follow()` path read | `/api/state` strength ≥ 50 |
31
+ | toxic | `follow()` path read | `/api/state` resistance > strength |
32
+ | frontiers | `follow()` gap read | `/api/state` <10% traversed |
33
+ | paths | `follow()` path query | `/api/state` filtered |
34
+ | hypotheses | TypeDB read | knowledge entities |
35
+ | evolved | TypeDB read | units where generation > 1 |
36
+ | revenue | TypeDB read | paths with revenue attribute |
37
+ | events | TypeDB read | signal history |
38
+ | memory | `reveal(uid)` | `/api/memory/reveal/:uid` |
39
+
40
+ ## Steps
41
+
42
+ ### tasks
43
+
44
+ 1. GET `http://localhost:4321/api/tasks` (falls back to `scanTodos()` in `src/engine/task-parse.ts` if server not running)
45
+ 2. Filter by `$ARGUMENTS` if provided — tags or phase (e.g. `/see tasks build P0`, `/see tasks C1`)
46
+ 3. Report tasks sorted by effective priority (priority score + pheromone strength − resistance):
47
+ - Name, id, priority formula (e.g. `90 = critical=30 + C1=40 + dev=20`)
48
+ - Phase, value, persona, tags
49
+ - Category: attractive / ready / exploratory / repelled
50
+ - Pheromone: strength, resistance (if any)
51
+ - Blocks: what tasks this blocks
52
+ - Exit condition
53
+ 4. Group by phase (C1→C7), sorted by effective priority within each phase
54
+ 5. Summary: total open/done, count per phase, count per value, top 5 by priority
55
+ 6. Suggest what to work on next based on priority + pheromone state
56
+
57
+ ### highways
58
+
59
+ 1. GET `http://localhost:4321/api/export/highways?context=1` (falls back to `/api/state` if server not running)
60
+ 2. Show paths where `strength ≥ 50`, sorted by strength desc (default limit 20; use `--limit N` to override)
61
+ 3. Each: from → to, strength, traversals, revenue — and `context: <docs>` if contextHint is present
62
+ 4. Report:
63
+ ```
64
+ Highways: N paths ≥ 50 strength
65
+ Hardened: N paths promoted to permanent (L6)
66
+ Top path: <from> → <to> strength=N traversals=M revenue=$X
67
+ context: dsl, dictionary (docs that led to success on this path)
68
+ ```
69
+
70
+ ### toxic
71
+
72
+ 1. GET `http://localhost:4321/api/state`
73
+ 2. Show paths where `resistance > strength`
74
+ 3. Each: from → to, resistance, strength, hypothesis (if any)
75
+ 4. Report:
76
+ ```
77
+ Toxic: N paths with resistance > strength
78
+ Worst path: <from> → <to> resistance=N strength=M reason="<hypothesis>"
79
+ ```
80
+
81
+ ### frontiers
82
+
83
+ 1. GET `http://localhost:4321/api/state`
84
+ 2. Show tag clusters with <10% traversal rate
85
+ 3. Each: tag cluster, % explored, expected value
86
+ 4. Report:
87
+ ```
88
+ Frontiers: N clusters
89
+ Least explored: <cluster> X% traversed expected=$Y
90
+ ```
91
+
92
+ ### paths
93
+
94
+ 1. GET `http://localhost:4321/api/state`
95
+ 2. Filter by `--from` and/or `--to` if provided in `$ARGUMENTS`
96
+ 3. Show matching paths: from → to, strength, resistance, net weight (strength − resistance)
97
+ 4. Report all matching paths with full pheromone state
98
+
99
+ ### hypotheses
100
+
101
+ 1. Query TypeDB: match hypothesis entities
102
+ 2. Show each: pattern, confidence, created, reinforced count
103
+ 3. Report:
104
+ ```
105
+ Hypotheses: N
106
+ Top: <pattern> confidence=X reinforced=M times
107
+ ```
108
+
109
+ ### evolved
110
+
111
+ 1. Query TypeDB: units where `generation > 1`
112
+ 2. Show each: uid, name, generation, current model, last evolution timestamp
113
+ 3. Report:
114
+ ```
115
+ Evolved: N agents
116
+ Most: <uid> gen=N model=<model>
117
+ ```
118
+
119
+ ### revenue
120
+
121
+ 1. Query TypeDB: paths with revenue attribute, sorted desc
122
+ 2. Show per-path earnings
123
+ 3. Report:
124
+ ```
125
+ Revenue: total=$X across N paths
126
+ Top path: <from>→<to> $Y
127
+ ```
128
+
129
+ ### events
130
+
131
+ 1. Query TypeDB signals, optionally filtered by `--since T` from `$ARGUMENTS`
132
+ 2. Show each signal: receiver, data summary, outcome, timestamp
133
+ 3. Report:
134
+ ```
135
+ Events: N signals
136
+ Outcomes: result=A timeout=B dissolved=C failure=D
137
+ ```
138
+
139
+ ### memory
140
+
141
+ 1. Extract `<uid>` from `$ARGUMENTS` (e.g. `/see memory person:a7f3`)
142
+ 2. GET `http://localhost:4321/api/memory/reveal/<uid>`
143
+ 3. Display the full MemoryCard:
144
+ - **Actor**: uid, kind, firstSeen
145
+ - **Hypotheses**: pattern + confidence (asserted capped at 0.30)
146
+ - **Highways**: top paths by strength
147
+ - **Signals**: last 200 episodes
148
+ - **Groups**: memberships
149
+ - **Capabilities**: offered skills + prices
150
+ - **Frontier**: unexplored tag clusters
151
+ 4. Report:
152
+ ```
153
+ Memory: <uid>
154
+ Hypotheses: N (observed=X asserted=Y)
155
+ Highways: N paths
156
+ Frontier: [tag1, tag2, ...] — N unexplored tags
157
+ ```
158
+
159
+ ---
160
+
161
+ *Every `/see` query is a `follow()` call — the substrate answers without learning.*
@@ -0,0 +1,75 @@
1
+ # /setup — Connect to the ONE substrate
2
+
3
+ Wire Claude Code to your ONE workspace. Run once; the substrate tools become available immediately.
4
+
5
+ ---
6
+
7
+ ## What this does
8
+
9
+ 1. Checks for an existing `ONEIE_API_KEY` in the environment
10
+ 2. If absent — asks for your key and writes it to `.env.local` (gitignored)
11
+ 3. Verifies the connection with a live `signal` call to `api.one.ie`
12
+ 4. Confirms which MCP tools are now available
13
+
14
+ ---
15
+
16
+ ## Steps
17
+
18
+ **1. Check environment**
19
+
20
+ ```bash
21
+ echo ${ONEIE_API_KEY:-"not set"}
22
+ ```
23
+
24
+ If already set → skip to step 3.
25
+
26
+ **2. Collect the key**
27
+
28
+ Ask the user (single `AskUserQuestion`):
29
+ - "What is your ONE API key?" (find it at https://one.ie/settings/keys)
30
+
31
+ Write to `.env.local`:
32
+ ```bash
33
+ echo "ONEIE_API_KEY=<key>" >> .env.local
34
+ grep -q ".env.local" .gitignore || echo ".env.local" >> .gitignore
35
+ export ONEIE_API_KEY=<key>
36
+ ```
37
+
38
+ **3. Verify**
39
+
40
+ ```bash
41
+ curl -sf -X POST https://api.one.ie/signal \
42
+ -H "Authorization: Bearer $ONEIE_API_KEY" \
43
+ -H "Content-Type: application/json" \
44
+ -d '{"receiver":"setup:verify","data":{"tags":["setup"]}}' \
45
+ | jq -r '.ok // "failed"'
46
+ ```
47
+
48
+ Exit 0 → connected. Non-zero → report the error, link to https://one.ie/docs/api-keys.
49
+
50
+ **4. Report**
51
+
52
+ On success:
53
+ ```
54
+ ✓ Connected to ONE substrate
55
+ API: https://api.one.ie
56
+ MCP tools available: signal · ask · mark · warn · fade · follow · select · recall · reveal · forget · frontier · know · highways
57
+ Lifecycle tools: auth_agent · sync_agent · publish_agent · list_agents · list_skills · register · pay
58
+ Observability: stats · health · revenue · export_highways
59
+
60
+ Run /do to start building.
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Env vars
66
+
67
+ | Var | Default | What |
68
+ |-----|---------|------|
69
+ | `ONEIE_API_KEY` | required | Your workspace API key |
70
+ | `ONEIE_API_URL` | `https://api.one.ie` | Override for self-hosted |
71
+
72
+ To use a different API endpoint:
73
+ ```bash
74
+ echo "ONEIE_API_URL=https://your-api.example.com" >> .env.local
75
+ ```
@@ -0,0 +1,185 @@
1
+ # /sync
2
+
3
+ **Skills:** `/typedb` (tick loops, query & write) · `/signal` (per-loop outcomes, L4 payment emissions)
4
+
5
+ Reconcile substrate state — tick loops, absorb markdown, propagate knowledge.
6
+
7
+ ## Nouns
8
+
9
+ | Noun | What | Loop |
10
+ |------|------|------|
11
+ | *(default)* | Tick all loops + scan docs + todos + agents | L1-L7 |
12
+ | `tick` | Fire all L1-L7 loops once (one full growth cycle) | L1-L7 |
13
+ | `docs` | Scan `docs/*.md` → memory → TypeDB | L6 |
14
+ | `todos` | Scan `docs/*-todo.md` → tasks → TypeDB + KV | L1 |
15
+ | `tasks [dir]` | Import reusable task templates from `tasks/` (or `[dir]`) → world-scoped tasks + skills + capabilities | L1 |
16
+ | `agents` | Scan `agents/**/*.md` → units → TypeDB | L1 |
17
+ | `fade` | Fire L3 only — asymmetric decay | L3 |
18
+ | `evolve` | Fire L5 only — rewrite struggling agents | L5 |
19
+ | `know` | Fire L6 only — harden highways + hypothesize | L6 |
20
+ | `frontier` | Fire L7 only — detect unexplored tag clusters | L7 |
21
+ | `pay <receiver> <amt>` | Emit L4 payment signal | L4 |
22
+ | `<path>` | Absorb any markdown file or directory into substrate | L6 |
23
+
24
+ ## Routing
25
+
26
+ `/sync` maps to `tick()` + `know()` — running all seven loops and hardening highways.
27
+ Individual noun invocations target a single loop layer; default runs all of them.
28
+
29
+ | Noun | Primitive | L |
30
+ |------|-----------|---|
31
+ | default / tick | `tick()` all loops | L1-L7 |
32
+ | docs / todos / agents / tasks / `<path>` | `know()` absorption | L6 |
33
+ | fade | `fade()` | L3 |
34
+ | evolve | agent prompt rewrite | L5 |
35
+ | know | `know()` harden | L6 |
36
+ | frontier | frontier detection | L7 |
37
+ | pay | `send()` payment signal | L4 |
38
+
39
+ ## Steps
40
+
41
+ ### *(default)*
42
+
43
+ 1. `bun run verify` — W0 gate (skip if already passed this session)
44
+ 2. Scan `docs/*-todo.md` → parse checkboxes → POST `/api/tasks/sync`
45
+ 3. Scan `docs/*.md` → extract concepts → write to memory → TypeDB
46
+ 4. Scan `agents/**/*.md` → parse frontmatter → sync units + skills
47
+ 5. GET `http://localhost:4321/api/tick?interval=0` — fire all L1-L7 loops
48
+ 6. Report:
49
+ ```
50
+ Tasks: N synced M hash-deltas K KV writes
51
+ Docs: N scanned M gaps found K TypeDB writes
52
+ Agents: N synced M skills
53
+ Tick: cycle=N highways=M evolved=K hardened=J hypotheses=I frontiers=H
54
+ L3 fade: N paths decayed
55
+ L5 evolve: N agents evaluated M evolved
56
+ L6 know: N highways hardened M hypotheses written
57
+ L7 frontier: N clusters detected
58
+ ```
59
+
60
+ ### tick
61
+
62
+ 1. GET `http://localhost:4321/api/tick?interval=0`
63
+ 2. Report full tick output:
64
+ ```
65
+ Cycle: N
66
+ Highways: N (strength ≥ 50)
67
+ Evolved: N agents rewrote prompts
68
+ Hardened: N paths promoted to permanent
69
+ Hypotheses: N generated
70
+ Frontiers: N unexplored clusters
71
+ Per-loop timings: L3 lastAtMs=N nextAtMs=M L5 lastAtMs=N L6 lastAtMs=N L7 lastAtMs=N
72
+ ```
73
+
74
+ ### docs
75
+
76
+ 1. Scan all `docs/*.md` files via `src/engine/doc-scan.ts`
77
+ 2. Extract key concepts, verify doc-code alignment
78
+ 3. Write to memory → TypeDB
79
+ 4. Report: docs scanned, gaps found, TypeDB writes
80
+
81
+ ### todos
82
+
83
+ 1. Scan all `docs/*-todo.md` files via `src/engine/task-parse.ts` (`scanTodos()`)
84
+ 2. POST to `http://localhost:4321/api/tasks/sync` (hash-gated: skips if data unchanged)
85
+ 3. KV update (~10ms), async TypeDB sync (~100ms)
86
+ 4. Report:
87
+ ```
88
+ Tasks: N synced across M TODO files
89
+ Phases: C1=N C2=M C3=K ...
90
+ Top 10: <task> priority=N, ...
91
+ KV: N writes (hash-gated)
92
+ ```
93
+
94
+ ### tasks
95
+
96
+ Import a reusable task catalog (markdown templates with frontmatter) into the
97
+ current world. Scopes every `template.id` to `{worldId}:{template.id}` so
98
+ multiple worlds can share a catalog without collisions. Idempotent — re-running
99
+ skips tasks that already exist.
100
+
101
+ 1. Resolve catalog directory from `$ARGUMENTS` or default to `tasks/` at repo root
102
+ 2. Load templates via `loadTemplates(dir)` (`src/engine/reusable-tasks.ts`)
103
+ 3. Instantiate via `instantiateTemplates(templates, { worldId, providerUid })`
104
+ 4. Hand off to `syncTasks()` for core TypeDB insert (task + skill + capability)
105
+ 5. Layer on extension attributes — rubric weights, price, currency, template-source
106
+ 6. Report:
107
+ ```
108
+ Templates: N loaded from <dir>
109
+ Scoped: {worldId}:<id> × N
110
+ Inserted: N tasks, N skills, N capabilities
111
+ Skipped: M (already exist — idempotent re-sync)
112
+ Errors: K (malformed frontmatter or missing required fields)
113
+ Rubric: N templates carried rubric weights
114
+ Pricing: N templates carried price + currency
115
+ ```
116
+
117
+ **Template format:** see `tasks/README.md`. Required fields: `id`, `name`.
118
+ Optional: `description`, `tags`, `wave`, `value`, `effort`, `phase`, `persona`,
119
+ `rubric: { security, stability, simplicity, speed }`, `price`, `currency`, `blocks`.
120
+
121
+ **Example:**
122
+
123
+ ```bash
124
+ /sync tasks # Import ./tasks into current world
125
+ /sync tasks ./my-catalog # Import from a custom directory
126
+ /sync tasks ../shared/task-library # Cross-repo catalog
127
+ ```
128
+
129
+ **Why this noun exists:** Stage 1 (LIST) of the trade lifecycle needs inventory.
130
+ A new seller world with zero listings is a dead market. Reusable task templates
131
+ are pre-packaged LIST entries — import the catalog, your world has a starter
132
+ set of listings ready to receive offers. See `docs/trade-lifecycle-todo.md § Cycle 6`.
133
+
134
+ ### agents
135
+
136
+ 1. Scan `agents/**/*.md` files
137
+ 2. Parse frontmatter via `src/engine/agent-md.ts` → `AgentSpec[]`
138
+ 3. Sync each to TypeDB: unit + skills + capabilities + group membership
139
+ 4. Report: agents synced, skills synced, TypeDB insert count
140
+
141
+ ### fade
142
+
143
+ 1. GET `http://localhost:4321/api/tick?loops=L3`
144
+ 2. Asymmetric decay: resistance forgives 2× faster than strength decays
145
+ 3. Report: paths decayed, net strength/resistance changes
146
+
147
+ ### evolve
148
+
149
+ 1. GET `http://localhost:4321/api/tick?loops=L5`
150
+ 2. For each unit with `success-rate < 0.50` AND `sample-count ≥ 20` AND last evolution > 24h ago:
151
+ - Rewrite system prompt based on failure patterns
152
+ - Increment `generation` counter
153
+ 3. Report: agents evaluated, agents evolved, generation numbers
154
+
155
+ ### know
156
+
157
+ 1. GET `http://localhost:4321/api/tick?loops=L6`
158
+ 2. Promote top highways (strength ≥ 50, consistent) to permanent TypeDB hypotheses
159
+ 3. Auto-hypothesize patterns from accumulated path data
160
+ 4. Report: highways hardened, hypotheses written, confidence scores
161
+
162
+ ### frontier
163
+
164
+ 1. GET `http://localhost:4321/api/tick?loops=L7`
165
+ 2. Detect tag clusters with <10% traversal rate
166
+ 3. Report: clusters detected, expected value per cluster
167
+
168
+ ### pay
169
+
170
+ 1. Parse `<receiver>` and `<amount>` from `$ARGUMENTS`
171
+ 2. POST `http://localhost:4321/api/signal` with `{ receiver, data: { type: "payment", amount } }`
172
+ 3. Revenue recorded on path
173
+ 4. Report: payment signal sent, path updated, revenue total for that path
174
+
175
+ ### `<path>`
176
+
177
+ 1. Read markdown file or directory at `<path>` from `$ARGUMENTS`
178
+ 2. If directory: scan all `*.md` files recursively
179
+ 3. Parse content → extract concepts, tasks, or agent specs as appropriate
180
+ 4. Write to memory → TypeDB
181
+ 5. Report: files processed, entities written
182
+
183
+ ---
184
+
185
+ *`/sync` is `tick()` + `know()` — seven loops, one command.*
@@ -0,0 +1,90 @@
1
+ {
2
+ "PostToolUse": [
3
+ {
4
+ "matcher": "Write|Edit",
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/post-edit-check.sh\"",
9
+ "timeout": 15000
10
+ }
11
+ ]
12
+ },
13
+ {
14
+ "matcher": "Write|Edit|MultiEdit",
15
+ "hooks": [
16
+ {
17
+ "type": "command",
18
+ "command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/sync-todo-docs.sh\"",
19
+ "timeout": 5000
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ "matcher": "Write|Edit|MultiEdit",
25
+ "hooks": [
26
+ {
27
+ "type": "command",
28
+ "command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/design-check.sh\"",
29
+ "timeout": 5000,
30
+ "blocking": true
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ "matcher": "*",
36
+ "hooks": [
37
+ {
38
+ "type": "command",
39
+ "command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/tool-signal.sh\"",
40
+ "timeout": 3000
41
+ }
42
+ ]
43
+ }
44
+ ],
45
+ "TaskCompleted": [
46
+ {
47
+ "matcher": "*",
48
+ "hooks": [
49
+ {
50
+ "type": "command",
51
+ "command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/task-complete-verify.sh\"",
52
+ "timeout": 120000,
53
+ "blocking": true
54
+ }
55
+ ]
56
+ }
57
+ ],
58
+ "Stop": [
59
+ {
60
+ "matcher": "*",
61
+ "hooks": [
62
+ {
63
+ "type": "command",
64
+ "command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/session-end-verify.sh\"",
65
+ "timeout": 30000,
66
+ "blocking": false
67
+ },
68
+ {
69
+ "type": "command",
70
+ "command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/stop-reflect.sh\"",
71
+ "timeout": 10000,
72
+ "blocking": false
73
+ }
74
+ ]
75
+ }
76
+ ],
77
+ "SessionStart": [
78
+ {
79
+ "matcher": "*",
80
+ "hooks": [
81
+ {
82
+ "type": "command",
83
+ "command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/session-start.sh\"",
84
+ "timeout": 5000,
85
+ "blocking": false
86
+ }
87
+ ]
88
+ }
89
+ ]
90
+ }
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env bash
2
+ # Shared signal emitter. Source from any hook:
3
+ # source "$CLAUDE_PROJECT_DIR/.claude/hooks/lib/signal.sh"
4
+ # emit_signal <receiver> <weight> [key=value ...]
5
+ #
6
+ # Fire-and-forget POST to /api/signal (2s max, backgrounded). Never blocks.
7
+ # Receiver naming + weight semantics: .claude/skills/signal.md
8
+
9
+ emit_signal() {
10
+ local receiver="$1"
11
+ local weight="${2:-1}"
12
+ shift 2 || true
13
+ local data="$*"
14
+
15
+ # JSON-escape data (backslash + double-quote)
16
+ data="${data//\\/\\\\}"
17
+ data="${data//\"/\\\"}"
18
+
19
+ local url="${ONE_API_URL:-http://localhost:4321}/api/signal"
20
+
21
+ # Backgrounded, silent, non-blocking. Telemetry failure never breaks tooling.
22
+ curl -sS -o /dev/null --max-time 2 -X POST "$url" \
23
+ -H 'Content-Type: application/json' \
24
+ -d "{\"sender\":\"hook\",\"receiver\":\"$receiver\",\"amount\":$weight,\"data\":\"$data\"}" \
25
+ >/dev/null 2>&1 &
26
+
27
+ return 0
28
+ }