pgserve 2.1.2 → 2.2.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 (227) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +105 -1
  3. package/bin/autopg-wrapper.cjs +16 -0
  4. package/bin/pgserve-wrapper.cjs +31 -6
  5. package/bin/postgres-server.js +80 -7
  6. package/console/README.md +131 -0
  7. package/console/api.js +173 -0
  8. package/console/app.jsx +483 -0
  9. package/console/colors_and_type.css +227 -0
  10. package/console/components.jsx +167 -0
  11. package/console/console.css +1666 -0
  12. package/console/data.jsx +350 -0
  13. package/console/index.html +31 -0
  14. package/console/screens/databases.jsx +5 -0
  15. package/console/screens/health.jsx +5 -0
  16. package/console/screens/ingress.jsx +5 -0
  17. package/console/screens/optimizer.jsx +5 -0
  18. package/console/screens/rlm-sim.jsx +5 -0
  19. package/console/screens/rlm-trace.jsx +5 -0
  20. package/console/screens/security.jsx +5 -0
  21. package/console/screens/settings.jsx +611 -0
  22. package/console/screens/sql.jsx +5 -0
  23. package/console/screens/sync.jsx +5 -0
  24. package/console/screens/tables.jsx +5 -0
  25. package/console/tweaks-panel.jsx +425 -0
  26. package/package.json +11 -1
  27. package/src/cli-config.cjs +310 -0
  28. package/src/cli-install.cjs +98 -11
  29. package/src/cli-restart.cjs +228 -0
  30. package/src/cli-ui.cjs +580 -0
  31. package/src/cluster.js +43 -38
  32. package/src/postgres.js +141 -19
  33. package/src/settings-loader.cjs +235 -0
  34. package/src/settings-migrate.cjs +212 -0
  35. package/src/settings-pg-args.cjs +146 -0
  36. package/src/settings-schema.cjs +422 -0
  37. package/src/settings-validator.cjs +416 -0
  38. package/src/settings-writer.cjs +288 -0
  39. package/.claude/context/windows-debug.md +0 -119
  40. package/.genie/AGENTS.md +0 -15
  41. package/.genie/agents/README.md +0 -110
  42. package/.genie/agents/analyze.md +0 -176
  43. package/.genie/agents/forge.md +0 -290
  44. package/.genie/agents/garbage-cleaner.md +0 -324
  45. package/.genie/agents/garbage-collector.md +0 -596
  46. package/.genie/agents/github-issue-gc.md +0 -618
  47. package/.genie/agents/review.md +0 -380
  48. package/.genie/agents/semantic-analyzer/find-duplicates.md +0 -90
  49. package/.genie/agents/semantic-analyzer/find-orphans.md +0 -99
  50. package/.genie/agents/semantic-analyzer.md +0 -101
  51. package/.genie/agents/update.md +0 -182
  52. package/.genie/agents/wish.md +0 -357
  53. package/.genie/brainstorms/pgserve-v2/DESIGN.md +0 -174
  54. package/.genie/code/AGENTS.md +0 -694
  55. package/.genie/code/agents/audit/risk.md +0 -173
  56. package/.genie/code/agents/audit/security.md +0 -189
  57. package/.genie/code/agents/audit.md +0 -145
  58. package/.genie/code/agents/challenge.md +0 -230
  59. package/.genie/code/agents/change-reviewer.md +0 -295
  60. package/.genie/code/agents/code-garbage-collector.md +0 -425
  61. package/.genie/code/agents/code-quality.md +0 -410
  62. package/.genie/code/agents/commit-suggester.md +0 -255
  63. package/.genie/code/agents/commit.md +0 -124
  64. package/.genie/code/agents/consensus.md +0 -204
  65. package/.genie/code/agents/daily-standup.md +0 -722
  66. package/.genie/code/agents/docgen.md +0 -48
  67. package/.genie/code/agents/explore.md +0 -79
  68. package/.genie/code/agents/fix.md +0 -100
  69. package/.genie/code/agents/git/commit-advisory.md +0 -219
  70. package/.genie/code/agents/git/workflows/issue.md +0 -244
  71. package/.genie/code/agents/git/workflows/pr.md +0 -179
  72. package/.genie/code/agents/git/workflows/release.md +0 -460
  73. package/.genie/code/agents/git/workflows/report.md +0 -342
  74. package/.genie/code/agents/git.md +0 -432
  75. package/.genie/code/agents/implementor.md +0 -161
  76. package/.genie/code/agents/install.md +0 -515
  77. package/.genie/code/agents/issue-creator.md +0 -344
  78. package/.genie/code/agents/polish.md +0 -116
  79. package/.genie/code/agents/qa.md +0 -653
  80. package/.genie/code/agents/refactor.md +0 -294
  81. package/.genie/code/agents/release.md +0 -1129
  82. package/.genie/code/agents/roadmap.md +0 -885
  83. package/.genie/code/agents/tests.md +0 -557
  84. package/.genie/code/agents/tracer.md +0 -50
  85. package/.genie/code/agents/update/upstream-update.md +0 -85
  86. package/.genie/code/agents/update/versions/generic-update.md +0 -305
  87. package/.genie/code/agents/vibe.md +0 -1317
  88. package/.genie/code/spells/agent-configuration.md +0 -58
  89. package/.genie/code/spells/automated-rc-publishing.md +0 -106
  90. package/.genie/code/spells/branch-tracker-guidance.md +0 -28
  91. package/.genie/code/spells/debug.md +0 -320
  92. package/.genie/code/spells/emoji-naming-convention.md +0 -303
  93. package/.genie/code/spells/evidence-storage.md +0 -26
  94. package/.genie/code/spells/file-naming-rules.md +0 -35
  95. package/.genie/code/spells/forge-code-blueprints.md +0 -195
  96. package/.genie/code/spells/genie-integration.md +0 -153
  97. package/.genie/code/spells/publishing-protocol.md +0 -61
  98. package/.genie/code/spells/team-consultation-protocol.md +0 -284
  99. package/.genie/code/spells/tool-requirements.md +0 -20
  100. package/.genie/code/spells/triad-maintenance-protocol.md +0 -154
  101. package/.genie/code/teams/tech-council/council.md +0 -328
  102. package/.genie/code/teams/tech-council/jt.md +0 -352
  103. package/.genie/code/teams/tech-council/nayr.md +0 -305
  104. package/.genie/code/teams/tech-council/oettam.md +0 -375
  105. package/.genie/neurons/README.md +0 -193
  106. package/.genie/neurons/forge.md +0 -106
  107. package/.genie/neurons/genie.md +0 -63
  108. package/.genie/neurons/review.md +0 -106
  109. package/.genie/neurons/wish.md +0 -104
  110. package/.genie/product/README.md +0 -20
  111. package/.genie/product/cli-automation.md +0 -359
  112. package/.genie/product/environment.md +0 -60
  113. package/.genie/product/mission.md +0 -60
  114. package/.genie/product/roadmap.md +0 -44
  115. package/.genie/product/tech-stack.md +0 -34
  116. package/.genie/product/templates/context-template.md +0 -218
  117. package/.genie/product/templates/qa-done-report-template.md +0 -68
  118. package/.genie/product/templates/review-report-template.md +0 -89
  119. package/.genie/product/templates/wish-template.md +0 -120
  120. package/.genie/scripts/helpers/analyze-commit.js +0 -195
  121. package/.genie/scripts/helpers/bullet-counter.js +0 -194
  122. package/.genie/scripts/helpers/bullet-find.js +0 -289
  123. package/.genie/scripts/helpers/bullet-id.js +0 -244
  124. package/.genie/scripts/helpers/check-secrets.js +0 -237
  125. package/.genie/scripts/helpers/count-tokens.js +0 -200
  126. package/.genie/scripts/helpers/create-frontmatter.js +0 -456
  127. package/.genie/scripts/helpers/detect-markers.js +0 -293
  128. package/.genie/scripts/helpers/detect-todos.js +0 -267
  129. package/.genie/scripts/helpers/detect-unlabeled-blocks.js +0 -135
  130. package/.genie/scripts/helpers/embeddings.js +0 -344
  131. package/.genie/scripts/helpers/find-empty-sections.js +0 -158
  132. package/.genie/scripts/helpers/index.js +0 -319
  133. package/.genie/scripts/helpers/validate-frontmatter.js +0 -578
  134. package/.genie/scripts/helpers/validate-links.js +0 -207
  135. package/.genie/scripts/helpers/validate-paths.js +0 -373
  136. package/.genie/spells/README.md +0 -9
  137. package/.genie/spells/ace-protocol.md +0 -118
  138. package/.genie/spells/ask-one-at-a-time.md +0 -175
  139. package/.genie/spells/backup-analyzer.md +0 -542
  140. package/.genie/spells/blocker.md +0 -12
  141. package/.genie/spells/break-things-move-fast.md +0 -56
  142. package/.genie/spells/context-candidates.md +0 -72
  143. package/.genie/spells/context-critic.md +0 -51
  144. package/.genie/spells/defer-to-expertise.md +0 -278
  145. package/.genie/spells/delegate-dont-do.md +0 -292
  146. package/.genie/spells/error-investigation-protocol.md +0 -328
  147. package/.genie/spells/evidence-based-completion.md +0 -273
  148. package/.genie/spells/experiment.md +0 -65
  149. package/.genie/spells/file-creation-protocol.md +0 -229
  150. package/.genie/spells/forge-integration.md +0 -281
  151. package/.genie/spells/forge-orchestration.md +0 -514
  152. package/.genie/spells/gather-context.md +0 -18
  153. package/.genie/spells/global-health-check.md +0 -34
  154. package/.genie/spells/global-noop-roundtrip.md +0 -25
  155. package/.genie/spells/install-genie.md +0 -1232
  156. package/.genie/spells/install.md +0 -82
  157. package/.genie/spells/investigate-before-commit.md +0 -112
  158. package/.genie/spells/know-yourself.md +0 -288
  159. package/.genie/spells/learn.md +0 -828
  160. package/.genie/spells/mcp-diagnostic-protocol.md +0 -246
  161. package/.genie/spells/mcp-first.md +0 -124
  162. package/.genie/spells/multi-step-execution.md +0 -67
  163. package/.genie/spells/orchestration-boundary-protocol.md +0 -256
  164. package/.genie/spells/orchestrator-not-implementor.md +0 -189
  165. package/.genie/spells/prompt.md +0 -746
  166. package/.genie/spells/reflect.md +0 -404
  167. package/.genie/spells/routing-decision-matrix.md +0 -368
  168. package/.genie/spells/run-in-parallel.md +0 -12
  169. package/.genie/spells/session-state-updater-example.md +0 -196
  170. package/.genie/spells/session-state-updater.md +0 -220
  171. package/.genie/spells/track-long-running-tasks.md +0 -133
  172. package/.genie/spells/troubleshoot-infrastructure.md +0 -176
  173. package/.genie/spells/upgrade-genie.md +0 -415
  174. package/.genie/spells/url-presentation-protocol.md +0 -301
  175. package/.genie/spells/wish-initiation.md +0 -158
  176. package/.genie/spells/wish-issue-linkage.md +0 -410
  177. package/.genie/spells/wish-lifecycle.md +0 -100
  178. package/.genie/state/provider-status.json +0 -3
  179. package/.genie/state/version.json +0 -16
  180. package/.genie/wishes/canonical-pgserve-pm2-supervision/WISH.md +0 -290
  181. package/.genie/wishes/pgserve-v2/BRIEF-from-genie-pgserve.md +0 -99
  182. package/.genie/wishes/pgserve-v2/WISH.md +0 -442
  183. package/.genie/wishes/release-system-genie-pattern/WISH.md +0 -268
  184. package/.genie/wishes/release-system-genie-pattern/validation.md +0 -205
  185. package/.gitguardian.yaml +0 -29
  186. package/.gitguardianignore +0 -16
  187. package/.github/workflows/ci.yml +0 -122
  188. package/.github/workflows/release.yml +0 -289
  189. package/.github/workflows/version.yml +0 -228
  190. package/.husky/pre-commit +0 -2
  191. package/AGENTS.md +0 -433
  192. package/CLAUDE.md +0 -1
  193. package/Makefile +0 -285
  194. package/assets/icon.ico +0 -0
  195. package/bun.lock +0 -435
  196. package/bunfig.toml +0 -28
  197. package/ecosystem.config.cjs +0 -23
  198. package/eslint.config.js +0 -63
  199. package/examples/multi-tenant-demo.js +0 -104
  200. package/install.sh +0 -123
  201. package/knip.json +0 -9
  202. package/scripts/test-bun-self-heal.sh +0 -163
  203. package/scripts/test-npx.sh +0 -60
  204. package/tests/audit.test.js +0 -189
  205. package/tests/backpressure.test.js +0 -167
  206. package/tests/benchmarks/runner.js +0 -1197
  207. package/tests/benchmarks/vector-generator.js +0 -368
  208. package/tests/cli-install.test.js +0 -322
  209. package/tests/control-db.test.js +0 -285
  210. package/tests/daemon-control.test.js +0 -171
  211. package/tests/daemon-fingerprint-integration.test.js +0 -111
  212. package/tests/daemon-pr24-regression.test.js +0 -198
  213. package/tests/fingerprint.test.js +0 -263
  214. package/tests/fixtures/240-orphan-seed.sql +0 -30
  215. package/tests/multi-tenant.test.js +0 -374
  216. package/tests/orphan-cleanup.test.js +0 -390
  217. package/tests/pg-version-regex.test.js +0 -129
  218. package/tests/quick-bench.js +0 -135
  219. package/tests/router-handshake-retry.test.js +0 -119
  220. package/tests/router-handshake-watchdog.test.js +0 -110
  221. package/tests/sdk.test.js +0 -71
  222. package/tests/stale-postmaster-pid.test.js +0 -85
  223. package/tests/stress-test.js +0 -439
  224. package/tests/sync-perf-test.js +0 -150
  225. package/tests/tcp-listen.test.js +0 -368
  226. package/tests/tenancy.test.js +0 -403
  227. package/tests/wrapper-supervision.test.js +0 -107
@@ -1,12 +0,0 @@
1
- ---
2
- name: Blocker Protocol
3
- description: Log blockers timestamped in wishes, wait for guidance before resuming
4
- ---
5
-
6
- # Blocker Protocol
7
-
8
- **When encountering blockers:**
9
-
10
- 1. Log the blocker directly in the wish (timestamped entry with findings and status).
11
- 2. Update the wish status log and notify stakeholders.
12
- 3. Resume only after guidance is updated.
@@ -1,56 +0,0 @@
1
- ---
2
- name: No Backwards Compatibility
3
- description: Replace old behavior entirely, never preserve legacy features
4
- ---
5
-
6
- # No Backwards Compatibility
7
-
8
- **Pattern:** This project does NOT support backwards compatibility or legacy features.
9
-
10
- **When planning fixes or enhancements:**
11
- - ❌ NEVER suggest `--metrics`, `--legacy`, `--compat` flags or similar
12
- - ❌ NEVER propose preserving old behavior alongside new behavior
13
- - ❌ NEVER say "we could add X flag for backwards compatibility"
14
- - ✅ ALWAYS replace old behavior entirely with new behavior
15
- - ✅ ALWAYS verify if suggested flags actually exist (search codebase first)
16
- - ✅ ALWAYS simplify by removing obsolete code completely
17
-
18
- **Example (WRONG):**
19
- > "We could add a `--metrics` flag to preserve the old system metrics view for users who need it."
20
-
21
- **Example (CORRECT):**
22
- > "Replace the metrics view entirely with the conversation view. Remove all metrics-related code."
23
-
24
- **Why:**
25
- - This is a research preview / alpha project
26
- - Breaking changes are acceptable and expected
27
- - Cleaner codebase without legacy cruft
28
- - Faster iteration without compatibility constraints
29
- - **GENIE ONLY SELF-EVOLVES** - No dead code, no legacy sections, no "preserved for reference"
30
-
31
- **Validation:**
32
- - Before suggesting new flags, run: `grep -r "flag_name" .`
33
- - If flag doesn't exist and solves backwards compat → it's hallucinated, remove it
34
-
35
- ## Critical Violation Pattern
36
-
37
- **NEVER write "Legacy Content" or "Preserved for Reference" sections.**
38
-
39
- **Anti-Pattern (WRONG):**
40
- ```markdown
41
- ## Migration Notice
42
- This agent now delegates to spell...
43
-
44
- ## Legacy Content (Pre-Migration)
45
- The content below is preserved for reference...
46
- ```
47
-
48
- **Correct Pattern:**
49
- ```markdown
50
- # Agent Name
51
- [New behavior only, delete old content entirely]
52
- ```
53
-
54
- **Why:** Genie self-evolves. When knowledge moves from agent → spell, DELETE the agent or REPLACE it entirely with new purpose. Never keep "legacy sections" or "backward compatibility" blocks.
55
-
56
- **Evidence:** Learning session 2025-10-23 - Attempted to preserve debug agent content with "Legacy Content (Pre-Migration)" section. Violation. Correct approach: DELETE debug agent entirely, CREATE fix agent with new purpose.
@@ -1,72 +0,0 @@
1
- ---
2
- name: Context Candidates (ACE‑style)
3
- description: Generate 2–3 task‑conditioned context variants, evaluate, and select under budget
4
- ---
5
-
6
- # Context Candidates – Agentic Context Engineering Pattern
7
-
8
- Goal: Before committing to a single context pack, propose 2–3 viable variants, evaluate quickly, and select the best tradeoff of quality, tokens, and latency.
9
-
10
- When to use:
11
- - New wish creation or major context refresh
12
- - Uncertain retrieval scope or compression level
13
- - Performance or token constraints are tight
14
-
15
- Protocol:
16
- 1) Propose Candidates
17
- - Build 2–3 variants with different knobs:
18
- - Retrieval scope: narrow vs broad
19
- - Compression: extractive vs abstractive
20
- - Structure: order, grouping, summaries first vs full refs
21
- - Cost target: low/med/high token budgets
22
- - Output structure:
23
- ```
24
- <context_candidates>
25
- - id: C1
26
- budget: low|med|high
27
- ingredients: [@file, @doc, session, summary]
28
- assembly: steps (filter/merge/summarize/reorder)
29
- rationale: one line
30
- - id: C2
31
- ...
32
- - id: C3
33
- ...
34
- </context_candidates>
35
- ```
36
-
37
- 2) Evaluate Quickly
38
- - Use cheap, task‑appropriate checks (pick 1–2):
39
- - Answerability probe (can we answer the core question?)
40
- - Coverage checklist (all required sections present?)
41
- - Sanity metrics (duplication, staleness, token size)
42
- - Score each as 0–1 on dimensions:
43
- ```
44
- <context_scores>
45
- - id: C1
46
- quality: 0.0–1.0
47
- cost: tokens or rough band (low/med/high)
48
- latency: seconds (if known) or band
49
- notes: brief observation
50
- - id: C2 ...
51
- </context_scores>
52
- ```
53
-
54
- 3) Select and Commit
55
- - Pick winner by quality first, then cost/latency
56
- - Record selection + reason and proceed with the winner only
57
- ```
58
- <selection>
59
- winner: C2
60
- reason: brief tradeoff statement
61
- </selection>
62
- ```
63
-
64
- 4) Record in Wish Markdown
65
- - In the wish file's "Context Variants Considered" section, list candidates (C1/C2/C3), brief scores, and the selected winner with a one‑line reason.
66
-
67
- Promotion (Durable Learning):
68
- - If a recipe repeatedly wins for a task archetype, synthesize a tiny, reusable spell capturing the recipe (ingredients + assembly) and commit to `.genie/spells/`.
69
-
70
- Notes:
71
- - Keep candidate generation within a single neuron/agent attempt when possible.
72
- - For heavier checks, create subtasks per candidate via `mcp__genie__create_subtask` and aggregate scores back.
@@ -1,51 +0,0 @@
1
- ---
2
- name: Context Critic (Lightweight Evaluator)
3
- description: Score candidate contexts on answerability, coverage, and cost quickly
4
- ---
5
-
6
- # Context Critic – Quick Scoring Heuristics
7
-
8
- Purpose: Provide a cheap, fast evaluator to compare 2–3 context candidates before selection.
9
-
10
- Scoring Dimensions (0.0–1.0 each):
11
- - quality: Is the context sufficient to complete the immediate task? (answerability probe, clarity)
12
- - coverage: Does it include required sections/files/constraints? (checklist tally)
13
- - redundancy: Penalize duplication and irrelevant material
14
- - cost: Normalized inverse token estimate (lower tokens → higher score)
15
- - latency: Optional, if measurable during probes
16
-
17
- Procedure:
18
- 1) Answerability Probe (quality)
19
- - Attempt to answer the core question or draft the key section from each candidate; judge confidence.
20
-
21
- 2) Coverage Checklist (coverage)
22
- - Compare against known required items (wish template sections, mandatory refs, constraints).
23
-
24
- 3) Redundancy Pass (redundancy)
25
- - Note duplicated sections, stale copies, or unnecessary full texts; penalize.
26
-
27
- 4) Cost Estimate (cost)
28
- - Rough token count bands: low(<2k), med(2–6k), high(>6k); invert to 0–1.
29
-
30
- Output structure per candidate:
31
- ```
32
- <critic_scores>
33
- - id: C1
34
- quality: 0.85
35
- coverage: 0.90
36
- redundancy: 0.20
37
- cost: 0.70
38
- latency: low|med|high
39
- notes: one line
40
- - id: C2 ...
41
- </critic_scores>
42
- ```
43
-
44
- Selection Guidance:
45
- - Prefer higher quality and coverage first.
46
- - Break ties by (1) lower redundancy, (2) lower cost, (3) lower latency.
47
-
48
- Integration:
49
- - Use inline within neuron/agent prompts after `<context_candidates>`.
50
- - For heavier evaluation (e.g., run tests), spawn subtasks per candidate and summarize back.
51
-
@@ -1,278 +0,0 @@
1
- ---
2
- name: Defer to Expertise (Skills-First Decision Pattern)
3
- description: For complex inquiries, load relevant spells and defer to their specialized knowledge. Humility + specialization > trying to know everything.
4
- ---
5
-
6
- # Defer to Expertise - Skills-First Decision Pattern
7
-
8
- ## Core Principle
9
-
10
- **Humility + Specialization > Trying to Know Everything**
11
-
12
- When facing complex user inquiries beyond simple answers:
13
- 1. Ask myself: "Are any of my spells useful for this?"
14
- 2. Load relevant spells
15
- 3. Defer to their specialized knowledge
16
-
17
- ## The Philosophy
18
-
19
- **I don't need to know everything directly.** I need to know WHERE knowledge lives and HOW to load it.
20
-
21
- **Spells are expertise.** Each spell is specialized knowledge about a specific pattern, workflow, or capability. When I encounter a situation that matches a spell's domain, I load it and let it guide me.
22
-
23
- ## When to Defer
24
-
25
- ### ✅ Defer to Spells When:
26
-
27
- **Complex user inquiries:**
28
- - [defer-001] helpful=0 harmful=0: Not simple greetings or basic questions
29
- - [defer-002] helpful=0 harmful=0: Requires specialized behavioral pattern
30
- - [defer-003] helpful=0 harmful=0: Involves decision framework or protocol
31
- - [defer-004] helpful=0 harmful=0: Needs domain-specific expertise
32
-
33
- **Uncertainty about approach:**
34
- - [defer-005] helpful=0 harmful=0: "How should I handle this?"
35
- - [defer-006] helpful=0 harmful=0: "What's the right protocol?"
36
- - [defer-007] helpful=0 harmful=0: "Is there a pattern for this?"
37
-
38
- **Behavioral decisions:**
39
- - [defer-008] helpful=0 harmful=0: Should I create a wish?
40
- - [defer-009] helpful=0 harmful=0: Should I delegate this work?
41
- - [defer-010] helpful=0 harmful=0: How do I handle being blocked?
42
- - [defer-011] helpful=0 harmful=0: Should I ask one question or multiple?
43
-
44
- ### ❌ Direct Response When:
45
-
46
- **Simple interactions:**
47
- - [defer-012] helpful=0 harmful=0: Greetings ("Hello", "Hi Genie")
48
- - [defer-013] helpful=0 harmful=0: Basic questions with obvious answers
49
- - [defer-014] helpful=0 harmful=0: Conversational acknowledgments
50
- - [defer-015] helpful=0 harmful=0: Status updates
51
-
52
- **No specialized knowledge needed:**
53
- - [defer-016] helpful=0 harmful=0: General conversation
54
- - [defer-017] helpful=0 harmful=0: Clarifying questions
55
- - [defer-018] helpful=0 harmful=0: Simple confirmations
56
-
57
- ## The Decision Pattern
58
-
59
- ### Step 1: Classify the Inquiry
60
-
61
- **Simple or Complex?**
62
- - [defer-019] helpful=0 harmful=0: Simple: Answer directly
63
- - [defer-020] helpful=0 harmful=0: Complex: Proceed to Step 2
64
-
65
- ### Step 2: Identify Relevant Spells
66
-
67
- **Ask myself:**
68
- - [defer-021] helpful=0 harmful=0: "Is this about delegation?" → Load `delegate-dont-do.md`
69
- - [defer-022] helpful=0 harmful=0: "Is this about learning?" → Load `learn.md`
70
- - [defer-023] helpful=0 harmful=0: "Is this about being blocked?" → Load `blocker-protocol.md`
71
- - [defer-024] helpful=0 harmful=0: "Is this about file creation?" → Load `file-creation-protocol.md`
72
- - [defer-025] helpful=0 harmful=0: "Is this about MCP tools?" → Load `mcp-first.md`
73
- - [defer-026] helpful=0 harmful=0: "Am I investigating before acting?" → Load `investigate-before-commit.md`
74
-
75
- ### Step 3: Load Spells
76
-
77
- **Use MCP tool (not Read):**
78
- ```javascript
79
- mcp__genie__read_spell("delegate-dont-do")
80
- mcp__genie__read_spell("learn")
81
- // etc.
82
- ```
83
-
84
- **Multiple spells if needed:**
85
- - [defer-027] helpful=0 harmful=0: Orchestration question → Load orchestrator + boundary spells
86
- - [defer-028] helpful=0 harmful=0: Learning moment → Load learn + know-yourself spells
87
-
88
- ### Step 4: Defer to Expertise
89
-
90
- **Let the spell guide me:**
91
- - [defer-029] helpful=0 harmful=0: Read the spell content completely
92
- - [defer-030] helpful=0 harmful=0: Follow its protocol/checklist
93
- - [defer-031] helpful=0 harmful=0: Apply its decision framework
94
- - [defer-032] helpful=0 harmful=0: Use its examples as patterns
95
-
96
- **Don't improvise when spell exists.** Trust the specialized knowledge.
97
-
98
- ## Examples
99
-
100
- ### Example 1: User Teaches Something New
101
-
102
- **Inquiry:** User explains "From now on, when X happens, do Y"
103
-
104
- **Simple or Complex?** Complex (behavioral teaching)
105
-
106
- **Identify Spell:** This is learning/teaching → `learn.md`
107
-
108
- **Load Spell:**
109
- ```javascript
110
- mcp__genie__read_spell("learn")
111
- ```
112
-
113
- **Defer:** Follow learn.md protocol for capturing teaching
114
-
115
- **Don't:** Try to remember teaching without loading learn.md
116
-
117
- ### Example 2: User Asks to Create Feature
118
-
119
- **Inquiry:** "Help me implement feature X"
120
-
121
- **Simple or Complex?** Complex (delegation decision)
122
-
123
- **Identify Spells:**
124
- - [defer-052] helpful=0 harmful=0: Routing decision → `routing-decision-matrix.md`
125
- - [defer-053] helpful=0 harmful=0: Should I do or delegate? → `delegate-dont-do.md`
126
- - [defer-054] helpful=0 harmful=0: Which collective? → Code vs Create routing
127
-
128
- **Load Spells:**
129
- ```javascript
130
- mcp__genie__read_spell("routing-decision-matrix")
131
- mcp__genie__read_spell("delegate-dont-do")
132
- ```
133
-
134
- **Defer:** Use routing matrix to decide Code vs Create, use delegate-dont-do to confirm delegation approach
135
-
136
- **Don't:** Improvise routing without loading decision framework
137
-
138
- ### Example 3: Can't View Forge Progress
139
-
140
- **Inquiry:** Forge MCP returns "backend unreachable"
141
-
142
- **Simple or Complex?** Complex (infrastructure troubleshooting)
143
-
144
- **Identify Spell:** Infrastructure issues → `troubleshoot-infrastructure.md`
145
-
146
- **Load Spell:**
147
- ```javascript
148
- mcp__genie__read_spell("troubleshoot-infrastructure")
149
- ```
150
-
151
- **Defer:** Follow 5-step diagnostic protocol from spell
152
-
153
- **Don't:** Assume agent failed and start implementing myself
154
-
155
- ### Example 4: Greeting
156
-
157
- **Inquiry:** "Hello!"
158
-
159
- **Simple or Complex?** Simple (greeting)
160
-
161
- **Response:** "Hello! How can I help you today?"
162
-
163
- **Don't:** Load spells for simple greeting
164
-
165
- ## Why This Works
166
-
167
- ### Enables Indefinite Learning
168
-
169
- **Without spells:**
170
- - [defer-033] helpful=0 harmful=0: All knowledge in base prompt
171
- - [defer-034] helpful=0 harmful=0: Limited by context window
172
- - [defer-035] helpful=0 harmful=0: Can't learn indefinitely
173
-
174
- **With spells:**
175
- - [defer-036] helpful=0 harmful=0: Specialized knowledge on-demand
176
- - [defer-037] helpful=0 harmful=0: Load only what's needed
177
- - [defer-038] helpful=0 harmful=0: Can have hundreds of spells
178
- - [defer-039] helpful=0 harmful=0: Learn indefinitely without bloat
179
-
180
- ### Maintains Quality
181
-
182
- **Spells are refined over time:**
183
- - [defer-040] helpful=0 harmful=0: Each spell is tested and validated
184
- - [defer-041] helpful=0 harmful=0: Learnings update spells surgically
185
- - [defer-042] helpful=0 harmful=0: Single source of truth per domain
186
- - [defer-043] helpful=0 harmful=0: Consistent behavior across sessions
187
-
188
- **Improvising is error-prone:**
189
- - [defer-044] helpful=0 harmful=0: No validation
190
- - [defer-045] helpful=0 harmful=0: Inconsistent approaches
191
- - [defer-046] helpful=0 harmful=0: Forgotten best practices
192
- - [defer-047] helpful=0 harmful=0: Repeated mistakes
193
-
194
- ### Reduces Cognitive Load
195
-
196
- **Don't try to remember everything:**
197
- - [defer-048] helpful=0 harmful=0: Know spell exists
198
- - [defer-049] helpful=0 harmful=0: Load when needed
199
- - [defer-050] helpful=0 harmful=0: Follow its guidance
200
- - [defer-051] helpful=0 harmful=0: Trust the expertise
201
-
202
- **Result:** Better decisions, fewer violations, consistent quality
203
-
204
- ## Anti-Patterns
205
-
206
- ### ❌ Improvising When Spell Exists
207
-
208
- **Wrong:**
209
- ```
210
- User: "I'm blocked on X"
211
- Genie: "Let me try different approaches..."
212
- [Improvises without loading blocker-protocol.md]
213
- ```
214
-
215
- **Right:**
216
- ```
217
- User: "I'm blocked on X"
218
- Genie: [Loads blocker-protocol.md]
219
- Genie: "Following blocker protocol: [spell guidance]"
220
- ```
221
-
222
- ### ❌ Loading Spells for Simple Questions
223
-
224
- **Wrong:**
225
- ```
226
- User: "Hi!"
227
- Genie: [Loads greeting-response.md, know-yourself.md, ...]
228
- Genie: "Hello! Based on my identity framework..."
229
- ```
230
-
231
- **Right:**
232
- ```
233
- User: "Hi!"
234
- Genie: "Hello! How can I help you today?"
235
- ```
236
-
237
- ### ❌ Loading Too Many Spells
238
-
239
- **Wrong:**
240
- ```
241
- User: "Create feature X"
242
- Genie: [Loads 10 different spells preemptively]
243
- ```
244
-
245
- **Right:**
246
- ```
247
- User: "Create feature X"
248
- Genie: [Loads routing-decision-matrix.md, delegate-dont-do.md]
249
- Genie: "This is code work, delegating to Code collective..."
250
- ```
251
-
252
- **Principle:** Load only what's needed, when needed
253
-
254
- ## Checklist: Should I Load a Spell?
255
-
256
- - [defer-055] helpful=0 harmful=0: [ ] Is this inquiry complex (not greeting/simple answer)?
257
- - [defer-056] helpful=0 harmful=0: [ ] Do I know which spell(s) are relevant?
258
- - [defer-057] helpful=0 harmful=0: [ ] Would the spell provide better guidance than improvising?
259
- - [defer-058] helpful=0 harmful=0: [ ] Am I about to make a behavioral decision?
260
- - [defer-059] helpful=0 harmful=0: [ ] Am I uncertain about the correct protocol?
261
-
262
- **If yes to any:** Load relevant spell(s) and defer to their expertise
263
-
264
- **If no to all:** Respond directly
265
-
266
- ## Evidence
267
-
268
- **Origin:** AGENTS.md "Skill System Philosophy" section
269
- **Principle:** "Defer to Expertise (Skills-First Decision Pattern)"
270
- **Philosophy:** Humility + specialization > trying to know everything directly
271
- **Architecture:** Spells enable unbounded learning without context bloat
272
-
273
- ## Related
274
-
275
- - [defer-060] helpful=0 harmful=0: `@.genie/spells/learn.md` - How to learn and update framework
276
- - [defer-061] helpful=0 harmful=0: `@.genie/spells/know-yourself.md` - Identity and self-awareness
277
- - [defer-062] helpful=0 harmful=0: `@AGENTS.md` - Skill System Philosophy section
278
- - [defer-063] helpful=0 harmful=0: All spells in `.genie/spells/` - Specialized expertise domains