pgserve 0.1.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.
Files changed (158) hide show
  1. package/.genie/AGENTS.md +13 -0
  2. package/.genie/agents/README.md +110 -0
  3. package/.genie/agents/analyze.md +176 -0
  4. package/.genie/agents/forge.md +290 -0
  5. package/.genie/agents/garbage-cleaner.md +324 -0
  6. package/.genie/agents/garbage-collector.md +596 -0
  7. package/.genie/agents/github-issue-gc.md +618 -0
  8. package/.genie/agents/review.md +380 -0
  9. package/.genie/agents/semantic-analyzer/find-duplicates.md +90 -0
  10. package/.genie/agents/semantic-analyzer/find-orphans.md +99 -0
  11. package/.genie/agents/semantic-analyzer.md +101 -0
  12. package/.genie/agents/update.md +182 -0
  13. package/.genie/agents/wish.md +357 -0
  14. package/.genie/code/AGENTS.md +692 -0
  15. package/.genie/code/agents/audit/risk.md +173 -0
  16. package/.genie/code/agents/audit/security.md +189 -0
  17. package/.genie/code/agents/audit.md +145 -0
  18. package/.genie/code/agents/challenge.md +230 -0
  19. package/.genie/code/agents/change-reviewer.md +295 -0
  20. package/.genie/code/agents/code-garbage-collector.md +425 -0
  21. package/.genie/code/agents/code-quality.md +410 -0
  22. package/.genie/code/agents/commit-suggester.md +255 -0
  23. package/.genie/code/agents/commit.md +124 -0
  24. package/.genie/code/agents/consensus.md +204 -0
  25. package/.genie/code/agents/daily-standup.md +722 -0
  26. package/.genie/code/agents/docgen.md +48 -0
  27. package/.genie/code/agents/explore.md +79 -0
  28. package/.genie/code/agents/fix.md +100 -0
  29. package/.genie/code/agents/git/commit-advisory.md +219 -0
  30. package/.genie/code/agents/git/workflows/issue.md +244 -0
  31. package/.genie/code/agents/git/workflows/pr.md +179 -0
  32. package/.genie/code/agents/git/workflows/release.md +460 -0
  33. package/.genie/code/agents/git/workflows/report.md +342 -0
  34. package/.genie/code/agents/git.md +432 -0
  35. package/.genie/code/agents/implementor.md +161 -0
  36. package/.genie/code/agents/install.md +515 -0
  37. package/.genie/code/agents/issue-creator.md +344 -0
  38. package/.genie/code/agents/polish.md +116 -0
  39. package/.genie/code/agents/qa.md +653 -0
  40. package/.genie/code/agents/refactor.md +294 -0
  41. package/.genie/code/agents/release.md +1129 -0
  42. package/.genie/code/agents/roadmap.md +885 -0
  43. package/.genie/code/agents/tests.md +557 -0
  44. package/.genie/code/agents/tracer.md +50 -0
  45. package/.genie/code/agents/update/upstream-update.md +85 -0
  46. package/.genie/code/agents/update/versions/generic-update.md +305 -0
  47. package/.genie/code/agents/vibe.md +1317 -0
  48. package/.genie/code/spells/agent-configuration.md +58 -0
  49. package/.genie/code/spells/automated-rc-publishing.md +106 -0
  50. package/.genie/code/spells/branch-tracker-guidance.md +28 -0
  51. package/.genie/code/spells/debug.md +320 -0
  52. package/.genie/code/spells/emoji-naming-convention.md +303 -0
  53. package/.genie/code/spells/evidence-storage.md +26 -0
  54. package/.genie/code/spells/file-naming-rules.md +35 -0
  55. package/.genie/code/spells/forge-code-blueprints.md +195 -0
  56. package/.genie/code/spells/genie-integration.md +153 -0
  57. package/.genie/code/spells/publishing-protocol.md +61 -0
  58. package/.genie/code/spells/team-consultation-protocol.md +284 -0
  59. package/.genie/code/spells/tool-requirements.md +20 -0
  60. package/.genie/code/spells/triad-maintenance-protocol.md +154 -0
  61. package/.genie/code/teams/tech-council/council.md +328 -0
  62. package/.genie/code/teams/tech-council/jt.md +352 -0
  63. package/.genie/code/teams/tech-council/nayr.md +305 -0
  64. package/.genie/code/teams/tech-council/oettam.md +375 -0
  65. package/.genie/neurons/README.md +193 -0
  66. package/.genie/neurons/forge.md +106 -0
  67. package/.genie/neurons/genie.md +63 -0
  68. package/.genie/neurons/review.md +106 -0
  69. package/.genie/neurons/wish.md +104 -0
  70. package/.genie/product/README.md +20 -0
  71. package/.genie/product/cli-automation.md +359 -0
  72. package/.genie/product/environment.md +60 -0
  73. package/.genie/product/mission.md +60 -0
  74. package/.genie/product/roadmap.md +44 -0
  75. package/.genie/product/tech-stack.md +34 -0
  76. package/.genie/product/templates/context-template.md +218 -0
  77. package/.genie/product/templates/qa-done-report-template.md +68 -0
  78. package/.genie/product/templates/review-report-template.md +89 -0
  79. package/.genie/product/templates/wish-template.md +120 -0
  80. package/.genie/scripts/helpers/analyze-commit.js +195 -0
  81. package/.genie/scripts/helpers/bullet-counter.js +194 -0
  82. package/.genie/scripts/helpers/bullet-find.js +289 -0
  83. package/.genie/scripts/helpers/bullet-id.js +244 -0
  84. package/.genie/scripts/helpers/check-secrets.js +237 -0
  85. package/.genie/scripts/helpers/count-tokens.js +200 -0
  86. package/.genie/scripts/helpers/create-frontmatter.js +456 -0
  87. package/.genie/scripts/helpers/detect-markers.js +293 -0
  88. package/.genie/scripts/helpers/detect-todos.js +267 -0
  89. package/.genie/scripts/helpers/detect-unlabeled-blocks.js +135 -0
  90. package/.genie/scripts/helpers/embeddings.js +344 -0
  91. package/.genie/scripts/helpers/find-empty-sections.js +158 -0
  92. package/.genie/scripts/helpers/index.js +319 -0
  93. package/.genie/scripts/helpers/validate-frontmatter.js +578 -0
  94. package/.genie/scripts/helpers/validate-links.js +207 -0
  95. package/.genie/scripts/helpers/validate-paths.js +373 -0
  96. package/.genie/spells/README.md +9 -0
  97. package/.genie/spells/ace-protocol.md +118 -0
  98. package/.genie/spells/ask-one-at-a-time.md +175 -0
  99. package/.genie/spells/backup-analyzer.md +542 -0
  100. package/.genie/spells/blocker.md +12 -0
  101. package/.genie/spells/break-things-move-fast.md +56 -0
  102. package/.genie/spells/context-candidates.md +72 -0
  103. package/.genie/spells/context-critic.md +51 -0
  104. package/.genie/spells/defer-to-expertise.md +278 -0
  105. package/.genie/spells/delegate-dont-do.md +292 -0
  106. package/.genie/spells/error-investigation-protocol.md +328 -0
  107. package/.genie/spells/evidence-based-completion.md +273 -0
  108. package/.genie/spells/experiment.md +65 -0
  109. package/.genie/spells/file-creation-protocol.md +229 -0
  110. package/.genie/spells/forge-integration.md +281 -0
  111. package/.genie/spells/forge-orchestration.md +514 -0
  112. package/.genie/spells/gather-context.md +18 -0
  113. package/.genie/spells/global-health-check.md +34 -0
  114. package/.genie/spells/global-noop-roundtrip.md +25 -0
  115. package/.genie/spells/install-genie.md +1232 -0
  116. package/.genie/spells/install.md +82 -0
  117. package/.genie/spells/investigate-before-commit.md +112 -0
  118. package/.genie/spells/know-yourself.md +288 -0
  119. package/.genie/spells/learn.md +828 -0
  120. package/.genie/spells/mcp-diagnostic-protocol.md +246 -0
  121. package/.genie/spells/mcp-first.md +124 -0
  122. package/.genie/spells/multi-step-execution.md +67 -0
  123. package/.genie/spells/orchestration-boundary-protocol.md +256 -0
  124. package/.genie/spells/orchestrator-not-implementor.md +189 -0
  125. package/.genie/spells/prompt.md +746 -0
  126. package/.genie/spells/reflect.md +404 -0
  127. package/.genie/spells/routing-decision-matrix.md +368 -0
  128. package/.genie/spells/run-in-parallel.md +12 -0
  129. package/.genie/spells/session-state-updater-example.md +196 -0
  130. package/.genie/spells/session-state-updater.md +220 -0
  131. package/.genie/spells/track-long-running-tasks.md +133 -0
  132. package/.genie/spells/troubleshoot-infrastructure.md +176 -0
  133. package/.genie/spells/upgrade-genie.md +415 -0
  134. package/.genie/spells/url-presentation-protocol.md +301 -0
  135. package/.genie/spells/wish-initiation.md +158 -0
  136. package/.genie/spells/wish-issue-linkage.md +410 -0
  137. package/.genie/spells/wish-lifecycle.md +100 -0
  138. package/.genie/state/provider-status.json +3 -0
  139. package/.genie/state/version.json +16 -0
  140. package/AGENTS.md +422 -0
  141. package/CLAUDE.md +1 -0
  142. package/LICENSE +21 -0
  143. package/Makefile +235 -0
  144. package/README.md +323 -0
  145. package/bin/pglite-server.js +457 -0
  146. package/ecosystem.config.cjs +23 -0
  147. package/examples/multi-tenant-demo.js +104 -0
  148. package/package.json +47 -0
  149. package/src/detector.js +105 -0
  150. package/src/index.js +177 -0
  151. package/src/pool.js +320 -0
  152. package/src/ports.js +114 -0
  153. package/src/protocol.js +216 -0
  154. package/src/registry.js +134 -0
  155. package/src/router.js +289 -0
  156. package/src/server.js +265 -0
  157. package/tests/benchmarks/runner.js +489 -0
  158. package/tests/multi-tenant.test.js +201 -0
@@ -0,0 +1,218 @@
1
+ # 🧞 Genie Context: {{USER_NAME}}
2
+
3
+ **Current Repo:** !`basename $(pwd)`
4
+ **Active Since:** !`date -u +"%Y-%m-%d"`
5
+
6
+ ---
7
+
8
+ ## 📊 Runtime Context (Auto-Updated)
9
+
10
+ **Branch:** !`git branch --show-current`
11
+
12
+ **Status:**
13
+ !`git status --short | head -10`
14
+
15
+ **Staged Changes:**
16
+ !`git diff --cached --stat | head -5`
17
+
18
+ **Unstaged Changes:**
19
+ !`git diff --stat | head -5`
20
+
21
+ **Recent Commits:**
22
+ !`git log --oneline -5`
23
+
24
+ ---
25
+
26
+ ## 🎯 Current Focus
27
+
28
+ **Task:** [What you're working on]
29
+ **Status:** [ACTIVE | PAUSED | PLANNING]
30
+ **Started:** [YYYY-MM-DD HH:MM UTC]
31
+
32
+ **Context:**
33
+ - [Key context points]
34
+ - [What's been completed]
35
+ - [What's in progress]
36
+
37
+ **Next Action:**
38
+ [What to do next]
39
+
40
+ ---
41
+
42
+ ## 🔄 Active Parallel Work
43
+
44
+ ### Background Orchestrators
45
+ *Track MCP agent sessions here*
46
+
47
+ ### Delegated Work
48
+ *Track task delegations here*
49
+
50
+ **Note:** When spawning parallel work, add entries here with session IDs and status checks.
51
+
52
+ ---
53
+
54
+ ## ⏳ Decision Queue (One at a Time)
55
+
56
+ ### Decision 1: [Topic] [ACTIVE NOW]
57
+
58
+ **Question:** [The decision you need to make]
59
+
60
+ **Context:**
61
+ - [Background information]
62
+ - [What it affects]
63
+ - [What it blocks]
64
+
65
+ **Question presented:** [YYYY-MM-DD ~HH:MM UTC]
66
+
67
+ ---
68
+
69
+ ## 👤 User Profile: {{USER_NAME}}
70
+
71
+ ### Communication Preferences
72
+
73
+ **Decision Presentation:**
74
+ - ✅ ONE decision per message (never ABCD parallel options)
75
+ - ✅ Full context: question, background, what it blocks
76
+ - ✅ Present options AFTER question, not bundled
77
+ - ✅ Wait for response before next decision
78
+ - ✅ Use decision queue (this file) for sequential presentation
79
+
80
+ **Working Style:**
81
+ - [Your preferences]
82
+ - [How you like to work]
83
+ - [Communication style]
84
+
85
+ **Session Interaction:**
86
+ - ✅ Greet with current context (reference this file)
87
+ - ✅ Build on previous learnings
88
+ - ✅ Sequential focus (one thing deeply, not many shallowly)
89
+ - ✅ Use this file to track parallel work and decisions
90
+
91
+ **Feedback Style:**
92
+ - [How you prefer feedback]
93
+ - [What works well]
94
+ - [What to avoid]
95
+
96
+ ---
97
+
98
+ ## 📚 Relationship History
99
+
100
+ **First session:** [YYYY-MM-DD]
101
+ **Total sessions:** [Count]
102
+ **Collaboration style:** [Description]
103
+
104
+ **Key moments:**
105
+ - [Date]: [Important milestone or learning]
106
+ - [Date]: [Another key moment]
107
+
108
+ **Current projects:**
109
+ 1. [Project name] ([status/phase])
110
+ 2. [Another project]
111
+
112
+ **Working relationship:**
113
+ - [How you work with Claude Code]
114
+ - [Patterns that work well]
115
+ - [Things to remember]
116
+
117
+ ---
118
+
119
+ ## 📋 Recent Completions (Current Session)
120
+
121
+ **Major accomplishments:**
122
+ - ✅ [Completed item]
123
+ - ✅ [Another completion]
124
+
125
+ **Learnings captured:**
126
+ - [New pattern learned]
127
+ - [Technique discovered]
128
+
129
+ ---
130
+
131
+ ## 🗂️ Open Issues Registry ({{PROJECT_NAME}})
132
+
133
+ | # | Title | Status | % | Action |
134
+ |---|-------|--------|---|--------|
135
+ | X | [Issue title] | [PASS/FAIL/PARTIAL] | X% | [Next step] |
136
+
137
+ **Summary:** [Compliance stats or overview]
138
+
139
+ ---
140
+
141
+ ## 💡 Patterns Learned (Cross-Repo)
142
+
143
+ ### [Pattern Name] ([YYYY-MM-DD])
144
+ - **Pattern:** [Description]
145
+ - **Why:** [Reasoning]
146
+ - **Examples:** [Usage examples]
147
+ - **Use cases:** [When to apply]
148
+ - **Report:** [Link to learning report if exists]
149
+
150
+ ---
151
+
152
+ ## 🛠️ How to Use This File
153
+
154
+ **Session Start (Auto):**
155
+ 1. Claude Code loads CLAUDE.md
156
+ 2. Finds `@~/.genie/context.md` reference
157
+ 3. Executes all `!command` statements
158
+ 4. Greets you with:
159
+ - Current focus
160
+ - Where you left off
161
+ - Fresh git context
162
+ - Next queued decision
163
+
164
+ **During Session:**
165
+ - Check "Current Focus" to know what you're working on
166
+ - Update "Recent Completions" as you finish tasks
167
+ - Add decisions to queue (don't present all at once!)
168
+ - Track parallel work in "Active Parallel Work" section
169
+
170
+ **Session End:**
171
+ - Update "Current Focus" with progress
172
+ - Add completions to "Recent Completions"
173
+ - Queue any pending decisions
174
+ - Learnings auto-captured via /learn command
175
+
176
+ **Decision Management:**
177
+ - Add decisions to queue as they arise
178
+ - Present ONE at a time from queue
179
+ - Remove from queue when resolved
180
+ - Never present multiple decisions in parallel (ABCD format)
181
+
182
+ ---
183
+
184
+ ## 🎯 Session Greeting Template
185
+
186
+ When you start a new session, Claude Code greets like this:
187
+
188
+ > "Hey {{USER_NAME}}! 👋
189
+ >
190
+ > **Current focus:** [from Current Focus section]
191
+ > **Where we left off:** [last item from Recent Completions]
192
+ > **Branch:** [from !git branch]
193
+ > **Status:** [summary from !git status]
194
+ >
195
+ > [If decision queued]: **Next up:** Decision 1 about [topic]. Ready to discuss?
196
+ > [If no decision]: Ready to continue or switch focus?"
197
+
198
+ This ensures:
199
+ - ✅ Immediate context restoration
200
+ - ✅ Fresh runtime state
201
+ - ✅ Clear continuation point
202
+ - ✅ No replanning needed
203
+ - ✅ Relationship continuity
204
+
205
+ ---
206
+
207
+ **System Status:** ✅ ACTIVE
208
+
209
+ **This file location:** `~/.genie/context.md` (user-local, cross-repo)
210
+
211
+ **Loaded via:** `@~/.genie/context.md` in CLAUDE.md (line 3)
212
+
213
+ **Next evolution:** [Your ideas for improving this system]
214
+
215
+ ---
216
+
217
+ 🧞 **Session continuity system active!** No more amnesia. Let's build. ✨
218
+
@@ -0,0 +1,68 @@
1
+ # Done Report: qa-<slug>-<YYYYMMDDHHmm>
2
+ ## Executive Summary
3
+ - **Checklist items tested:** X/Y
4
+ - **New scenarios discovered:** A
5
+ - **Bugs found:** B (C critical, D high, E medium)
6
+ - **Checklist items added:** F
7
+
8
+ ## Test Matrix
9
+
10
+ ### Checklist Items (from @.genie/qa/checklist.md)
11
+ | Item | Category | Status | Evidence |
12
+ |------|----------|--------|----------|
13
+ | <name> | <cat> | ✅ Pass | cmd-<name>-<ts>.txt |
14
+ | <name> | <cat> | ❌ Fail | error-<name>-<ts>.txt |
15
+
16
+ ### New Scenarios (discovered during this run)
17
+ | Scenario | Category | Status | Added to Checklist |
18
+ |----------|----------|--------|-------------------|
19
+ | <name> | <cat> | ✅ Pass | ✅ Yes (via learn) |
20
+
21
+ ## Bugs Found
22
+
23
+ ### 🔴 CRITICAL (X)
24
+ **[BUG] <Description>**
25
+ - **Reproduction:** <steps>
26
+ - **Expected:** <behavior>
27
+ - **Actual:** <behavior>
28
+ - **Evidence:** .genie/qa/evidence/ (created during test execution)<file>
29
+ - **Filed:** Issue #XX
30
+ - **Owner:** <agent/person>
31
+
32
+ ### 🟠 HIGH (X)
33
+ (same format)
34
+
35
+ ### 🟡 MEDIUM (X)
36
+ (same format)
37
+
38
+ ## Learning Summary
39
+
40
+ **Items added to checklist:**
41
+ 1. <Item name> (<category>)
42
+ 2. <Item name> (<category>)
43
+
44
+ **Learn agent sessions:**
45
+ - Session <id>: Added <item>
46
+ - Session <id>: Added <item>
47
+
48
+ ## Evidence Archive
49
+ Location: .genie/qa/evidence/ (created during test execution)
50
+
51
+ **Terminal outputs:** X files
52
+ **Screenshots:** Y files
53
+ **Logs:** Z files
54
+
55
+ ## Coverage Analysis
56
+ - **<Category 1>:** X/Y tested (Z%)
57
+ - **<Category 2>:** X/Y tested (Z%)
58
+ - **Overall:** X/Y scenarios validated (Z%)
59
+
60
+ ## Follow-Ups
61
+ 1. <Action> - <Priority>
62
+ 2. <Action> - <Priority>
63
+
64
+ ## Verdict
65
+ **Status:** <APPROVED | BLOCKED>
66
+ **Confidence:** <LOW | MEDIUM | HIGH>
67
+ **Recommendation:** <action items>
68
+
@@ -0,0 +1,89 @@
1
+ # Wish Review – {Wish Slug}
2
+ **Date:** 2024-..Z | **Status in wish:** {status}
3
+ **Completion Score:** XX/100 (XX%)
4
+
5
+ ## Matrix Scoring Breakdown
6
+
7
+ ### Discovery Phase (XX/30 pts)
8
+ - **Context Completeness (X/10 pts)**
9
+ - [x] All files/docs referenced with @ notation (4/4 pts) – Evidence: context ledger complete
10
+ - [x] Background persona outputs captured (3/3 pts) – Evidence: @.genie/wishes/<slug>/reports/done-*
11
+ - [ ] Assumptions/decisions/risks documented (1/3 pts) – Gap: Missing risk analysis
12
+ - **Scope Clarity (X/10 pts)**
13
+ - [x] Current/target state defined (3/3 pts)
14
+ - [x] Spec contract with success metrics (4/4 pts)
15
+ - [x] Out-of-scope stated (3/3 pts)
16
+ - **Evidence Planning (X/10 pts)**
17
+ - [x] Validation commands specified (4/4 pts)
18
+ - [x] Artifact paths defined (3/3 pts)
19
+ - [ ] Approval checkpoints documented (0/3 pts) – Gap: No checkpoints defined
20
+
21
+ ### Implementation Phase (XX/40 pts)
22
+ - **Code Quality (X/15 pts)**
23
+ - [x] Follows standards (5/5 pts) – Evidence: passes lint checks
24
+ - [x] Minimal surface area (4/5 pts) – Note: Some extra files modified
25
+ - [x] Clean abstractions (5/5 pts)
26
+ - **Test Coverage (X/10 pts)**
27
+ - [x] Unit tests (4/4 pts) – Evidence: `@tests/unit/`*
28
+ - [x] Integration tests (4/4 pts) – Evidence: `@tests/integration/`*
29
+ - [x] Test execution evidence (2/2 pts) – Evidence: test-results.log
30
+ - **Documentation (X/5 pts)**
31
+ - [x] Inline comments (2/2 pts)
32
+ - [ ] Updated external docs (0/2 pts) – Gap: README not updated
33
+ - [x] Maintainer context (1/1 pt)
34
+ - **Execution Alignment (X/10 pts)**
35
+ - [x] Stayed in scope (4/4 pts)
36
+ - [x] No scope creep (3/3 pts)
37
+ - [x] Dependencies honored (3/3 pts)
38
+
39
+ ### Verification Phase (XX/30 pts)
40
+ - **Validation Completeness (X/15 pts)**
41
+ - [x] All validation commands passed (6/6 pts)
42
+ - [x] Artifacts at specified paths (5/5 pts)
43
+ - [x] Edge cases tested (4/4 pts)
44
+ - **Evidence Quality (X/10 pts)**
45
+ - [x] Command outputs logged (4/4 pts)
46
+ - [x] Screenshots/metrics captured (3/3 pts)
47
+ - [x] Before/after comparisons (3/3 pts)
48
+ - **Review Thoroughness (X/5 pts)**
49
+ - [x] Human approval obtained (2/2 pts)
50
+ - [x] Blockers resolved (2/2 pts)
51
+ - [x] Status log updated (1/1 pt)
52
+
53
+ ## Evidence Summary
54
+ | Artefact | Location | Result | Notes |
55
+ | --- | --- | --- | --- |
56
+ | Test results | `@wishes/`<slug>/qa/tests.log | ✅ | All 47 tests passing |
57
+ | Metrics | `@wishes/`<slug>/qa/metrics.json | ✅ | TTFB avg 410ms (target <500ms) |
58
+ | Screenshots | `@wishes/`<slug>/qa/screenshots/ | ✅ | 8 workflow screenshots captured |
59
+
60
+ ## Deductions & Gaps
61
+ 1. **-2 pts (Discovery):** Risk analysis incomplete in discovery summary
62
+ 2. **-3 pts (Discovery):** Approval checkpoints not documented before implementation
63
+ 3. **-1 pt (Implementation):** Extra files modified outside core scope
64
+ 4. **-2 pts (Implementation):** README not updated with new feature
65
+
66
+ ## Recommendations
67
+ 1. Add risk analysis to discovery summary section
68
+ 2. Document approval checkpoints for future wishes
69
+ 3. Update README with feature documentation
70
+ 4. Consider splitting peripheral file changes into separate PR
71
+
72
+ ## Verification Commands
73
+ Summarize the validation commands executed (per wish instructions and project defaults in `@.genie/code/agents/tests.md` / `@.genie/code/agents/commit.md`) and record pass/fail status for each.
74
+
75
+ ## Verdict
76
+ **Score: XX/100 (XX%)**
77
+ - ✅ **90-100:** EXCELLENT – Ready for merge
78
+ - ✅ **80-89:** GOOD – Minor gaps, approved with follow-ups
79
+ - ⚠️ **70-79:** ACCEPTABLE – Needs improvements before merge
80
+ - ❌ **<70:** NEEDS WORK – Significant gaps, blocked
81
+
82
+ **Status:** {APPROVED | APPROVED_WITH_FOLLOWUPS | BLOCKED}
83
+
84
+ ## Next Steps
85
+ 1. Address gaps 1-4 above (optional for approval, required for excellence)
86
+ 2. Update wish status to COMPLETED
87
+ 3. Update wish completion score to XX/100
88
+ 4. Create follow-up tasks for deferred documentation
89
+
@@ -0,0 +1,120 @@
1
+ # 🧞 {FEATURE NAME} WISH
2
+ **Status:** DRAFT
3
+ **Roadmap Item:** {ROADMAP-ID} – @.genie/product/roadmap.md §{section}
4
+ **Mission Link:** @.genie/product/mission.md §Pitch
5
+ **Completion Score:** 0/100 (updated by `/review`)
6
+
7
+ ## Evaluation Matrix (100 Points Total)
8
+
9
+ ### Discovery Phase (30 pts)
10
+ - **Context Completeness (10 pts)**
11
+ - [ ] All relevant files/docs referenced with @ notation (4 pts)
12
+ - [ ] Background persona outputs captured in context ledger (3 pts)
13
+ - [ ] Assumptions (ASM-#), decisions (DEC-#), risks documented (3 pts)
14
+ - **Scope Clarity (10 pts)**
15
+ - [ ] Clear current state and target state defined (3 pts)
16
+ - [ ] Spec contract complete with success metrics (4 pts)
17
+ - [ ] Out-of-scope explicitly stated (3 pts)
18
+ - **Evidence Planning (10 pts)**
19
+ - [ ] Validation commands specified with exact syntax (4 pts)
20
+ - [ ] Artifact storage paths defined (3 pts)
21
+ - [ ] Approval checkpoints documented (3 pts)
22
+
23
+ ### Implementation Phase (40 pts)
24
+ - **Code Quality (15 pts)**
25
+ - [ ] Follows project standards (@.genie/standards/*) (5 pts)
26
+ - [ ] Minimal surface area changes, focused scope (5 pts)
27
+ - [ ] Clean abstractions and patterns (5 pts)
28
+ - **Test Coverage (10 pts)**
29
+ - [ ] Unit tests for new behavior (4 pts)
30
+ - [ ] Integration tests for workflows (4 pts)
31
+ - [ ] Evidence of test execution captured (2 pts)
32
+ - **Documentation (5 pts)**
33
+ - [ ] Inline comments where complexity exists (2 pts)
34
+ - [ ] Updated relevant external docs (2 pts)
35
+ - [ ] Context preserved for maintainers (1 pt)
36
+ - **Execution Alignment (10 pts)**
37
+ - [ ] Stayed within spec contract scope (4 pts)
38
+ - [ ] No unapproved scope creep (3 pts)
39
+ - [ ] Dependencies and sequencing honored (3 pts)
40
+
41
+ ### Verification Phase (30 pts)
42
+ - **Validation Completeness (15 pts)**
43
+ - [ ] All validation commands executed successfully (6 pts)
44
+ - [ ] Artifacts captured at specified paths (5 pts)
45
+ - [ ] Edge cases and error paths tested (4 pts)
46
+ - **Evidence Quality (10 pts)**
47
+ - [ ] Command outputs (failures → fixes) logged (4 pts)
48
+ - [ ] Screenshots/metrics captured where applicable (3 pts)
49
+ - [ ] Before/after comparisons provided (3 pts)
50
+ - **Review Thoroughness (5 pts)**
51
+ - [ ] Human approval obtained at checkpoints (2 pts)
52
+ - [ ] All blockers resolved or documented (2 pts)
53
+ - [ ] Status log updated with completion timestamp (1 pt)
54
+
55
+ ## Context Ledger
56
+ | Source | Type | Summary | Routed To |
57
+ | --- | --- | --- | --- |
58
+ | Planning brief | doc | Key findings | entire wish |
59
+ | `@path/to/file` | repo | Insight | wish, docs |
60
+ | mcp__genie__run agent="..." | background | Output summary | wish, roadmap |
61
+
62
+ ### Context Variants Considered
63
+ - Candidates: C1, C2, C3
64
+ - Winner: {C?} — reason: one‑line tradeoff statement
65
+
66
+ ## Discovery Summary
67
+ - **Primary analyst:** {Human/Agent}
68
+ - **Key observations:** …
69
+ - **Assumptions (ASM-#):** …
70
+ - **Open questions (Q-#):** …
71
+ - **Risks:** …
72
+
73
+ ## Executive Summary
74
+ Concise outcome tied to user/system impact.
75
+
76
+ ## Current State
77
+ - **What exists today:** `@file` references with short notes
78
+ - **Gaps/Pain points:** …
79
+
80
+ ## Target State & Guardrails
81
+ - **Desired behaviour:** …
82
+ - **Non-negotiables:** latency, safety, human-likeness, compliance, etc.
83
+
84
+ ## Execution Groups
85
+ ### Group A – {slug}
86
+ - **Goal:** …
87
+ - **Surfaces:** `@file`, `@docs`
88
+ - **Deliverables:** …
89
+ - **Evidence:** Store in wish `qa/group-a/`, add notes in `reports/` if needed
90
+ - **Suggested personas:** `forge-coder`, `forge-quality`
91
+ - **External tracker:** {placeholder ID or JIRA-XXX}
92
+
93
+ (Repeat for Group B/C as needed.)
94
+
95
+ ## Verification Plan
96
+ - Validation steps or scripts to run (tests, metrics, evaluation)
97
+ - Evidence storage: reference wish `qa/` + `reports/` subfolders
98
+ - Branch strategy note (dedicated branch vs existing vs micro-task)
99
+
100
+ ### Evidence Checklist
101
+ - **Validation commands (exact):** …
102
+ - **Artefact paths (where evidence lives):** use wish `qa/` + `reports/`
103
+ - **Approval checkpoints (human sign-off required before work starts):** …
104
+
105
+ ## <spec_contract>
106
+ - **Scope:** …
107
+ - **Out of scope:** …
108
+ - **Success metrics:** …
109
+ - **External tasks:** Tracker IDs (if any)
110
+ - **Dependencies:** …
111
+ </spec_contract>
112
+
113
+ ## Blocker Protocol
114
+ 1. Pause work and create `reports/blocker-<slug>-<timestamp>.md` inside the wish folder describing findings.
115
+ 2. Notify owner and wait for updated instructions.
116
+ 3. Resume only after the wish status/log is updated.
117
+
118
+ ## Status Log
119
+ - [YYYY-MM-DD HH:MMZ] Wish created
120
+ - …
@@ -0,0 +1,195 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Analyze Commit Helper
5
+ *
6
+ * Parse commit metadata using deterministic rules (no LLM).
7
+ * Extracts: type, scope, breaking, issue refs, wish refs.
8
+ *
9
+ * Usage:
10
+ * genie helper analyze-commit [commit-hash]
11
+ * genie helper analyze-commit --staged (analyze staged diff)
12
+ *
13
+ * Output: JSON
14
+ */
15
+
16
+ const { execSync } = require('child_process');
17
+
18
+ // Conventional commit type patterns
19
+ const COMMIT_TYPES = {
20
+ feat: { name: 'Feature', requiresIssue: true, category: 'feature' },
21
+ fix: { name: 'Bug Fix', requiresIssue: true, category: 'feature' },
22
+ docs: { name: 'Documentation', requiresIssue: false, category: 'maintenance' },
23
+ style: { name: 'Style', requiresIssue: false, category: 'maintenance' },
24
+ refactor: { name: 'Refactor', requiresIssue: false, category: 'maintenance' },
25
+ perf: { name: 'Performance', requiresIssue: false, category: 'maintenance' },
26
+ test: { name: 'Test', requiresIssue: false, category: 'maintenance' },
27
+ build: { name: 'Build', requiresIssue: false, category: 'maintenance' },
28
+ ci: { name: 'CI/CD', requiresIssue: false, category: 'maintenance' },
29
+ chore: { name: 'Chore', requiresIssue: false, category: 'maintenance' },
30
+ revert: { name: 'Revert', requiresIssue: false, category: 'special' },
31
+ };
32
+
33
+ function parseConventionalCommit(message) {
34
+ // Format: type(scope)!: subject
35
+ const pattern = /^(\w+)(?:\(([^)]+)\))?(!)?\s*:\s*(.+)$/;
36
+ const match = message.match(pattern);
37
+
38
+ if (!match) {
39
+ return {
40
+ type: null,
41
+ scope: null,
42
+ breaking: false,
43
+ subject: message,
44
+ conventional: false,
45
+ };
46
+ }
47
+
48
+ const [, type, scope, breaking, subject] = match;
49
+
50
+ return {
51
+ type: type.toLowerCase(),
52
+ scope: scope || null,
53
+ breaking: !!breaking,
54
+ subject: subject.trim(),
55
+ conventional: true,
56
+ typeInfo: COMMIT_TYPES[type.toLowerCase()] || null,
57
+ };
58
+ }
59
+
60
+ function extractReferences(message) {
61
+ const refs = {
62
+ issues: [],
63
+ wishes: [],
64
+ closes: [],
65
+ fixes: [],
66
+ related: [],
67
+ };
68
+
69
+ // GitHub issues: fixes #123, closes #456
70
+ const closePattern = /(fixes|closes)\s+#(\d+)/gi;
71
+ let match;
72
+ while ((match = closePattern.exec(message)) !== null) {
73
+ const num = match[2];
74
+ refs.issues.push(num);
75
+ refs.closes.push(num);
76
+ }
77
+
78
+ // Related issues: related: #789, see #999
79
+ const relatedPattern = /(related|see):\s+#(\d+)/gi;
80
+ while ((match = relatedPattern.exec(message)) !== null) {
81
+ const num = match[2];
82
+ if (!refs.issues.includes(num)) {
83
+ refs.issues.push(num);
84
+ refs.related.push(num);
85
+ }
86
+ }
87
+
88
+ // Wish references: wish: slug, .genie/wishes/slug
89
+ const wishPattern = /\bwish:\s*([\w-]+)|\.genie\/wishes\/([\w-]+)/gi;
90
+ while ((match = wishPattern.exec(message)) !== null) {
91
+ const slug = match[1] || match[2];
92
+ if (slug && !refs.wishes.includes(slug)) {
93
+ refs.wishes.push(slug);
94
+ }
95
+ }
96
+
97
+ return refs;
98
+ }
99
+
100
+ function getCommitMessage(commitHash) {
101
+ try {
102
+ const format = commitHash ? '%s%n%b' : '%s%n%b';
103
+ const cmd = commitHash
104
+ ? `git log -1 --format="${format}" ${commitHash}`
105
+ : `git log -1 --format="${format}" HEAD`;
106
+
107
+ return execSync(cmd, {
108
+ encoding: 'utf8',
109
+ stdio: ['pipe', 'pipe', 'pipe']
110
+ }).trim();
111
+ } catch (e) {
112
+ return null;
113
+ }
114
+ }
115
+
116
+ function getStagedMessage() {
117
+ // Read COMMIT_EDITMSG if available, or use git status
118
+ try {
119
+ const fs = require('fs');
120
+ const path = require('path');
121
+ const gitDir = execSync('git rev-parse --git-dir', {
122
+ encoding: 'utf8',
123
+ stdio: ['pipe', 'pipe', 'pipe']
124
+ }).trim();
125
+
126
+ const commitMsgPath = path.join(gitDir, 'COMMIT_EDITMSG');
127
+ if (fs.existsSync(commitMsgPath)) {
128
+ return fs.readFileSync(commitMsgPath, 'utf8').trim();
129
+ }
130
+ } catch (e) {
131
+ // Fallback to empty
132
+ }
133
+
134
+ return '';
135
+ }
136
+
137
+ function analyzeCommit(message) {
138
+ const lines = message.split('\n');
139
+ const subject = lines[0];
140
+ const body = lines.slice(1).join('\n').trim();
141
+
142
+ const parsed = parseConventionalCommit(subject);
143
+ const refs = extractReferences(message);
144
+
145
+ const requiresIssue = parsed.typeInfo?.requiresIssue ?? true; // Default: require issue
146
+ const hasIssue = refs.issues.length > 0;
147
+ const hasWish = refs.wishes.length > 0;
148
+ const hasTraceability = hasIssue || hasWish;
149
+
150
+ return {
151
+ subject,
152
+ body,
153
+ ...parsed,
154
+ references: refs,
155
+ traceability: {
156
+ required: requiresIssue,
157
+ hasIssue,
158
+ hasWish,
159
+ satisfied: !requiresIssue || hasTraceability,
160
+ },
161
+ metadata: {
162
+ category: parsed.typeInfo?.category || 'untyped',
163
+ requiresIssue,
164
+ },
165
+ };
166
+ }
167
+
168
+ function main() {
169
+ const args = process.argv.slice(2);
170
+
171
+ let message;
172
+
173
+ if (args.includes('--staged')) {
174
+ message = getStagedMessage();
175
+ } else if (args.length > 0) {
176
+ message = getCommitMessage(args[0]);
177
+ } else {
178
+ message = getCommitMessage('HEAD');
179
+ }
180
+
181
+ if (!message) {
182
+ console.error('Error: No commit message found');
183
+ process.exit(1);
184
+ }
185
+
186
+ const analysis = analyzeCommit(message);
187
+ console.log(JSON.stringify(analysis, null, 2));
188
+ process.exit(0);
189
+ }
190
+
191
+ if (require.main === module) {
192
+ main();
193
+ }
194
+
195
+ module.exports = { analyzeCommit, parseConventionalCommit, extractReferences };