@alecsibilia/luca 13.0.0-alpha.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 (128) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +47 -0
  3. package/bin/luca.js +3 -0
  4. package/dist/chunks/branch.mjs +47 -0
  5. package/dist/chunks/bun-runtime.mjs +46 -0
  6. package/dist/chunks/checks.mjs +53 -0
  7. package/dist/chunks/claim-verify.mjs +465 -0
  8. package/dist/chunks/classify.mjs +105 -0
  9. package/dist/chunks/confidence.mjs +199 -0
  10. package/dist/chunks/doctor.mjs +158 -0
  11. package/dist/chunks/hook.mjs +696 -0
  12. package/dist/chunks/init.mjs +715 -0
  13. package/dist/chunks/muninndb-health.mjs +66 -0
  14. package/dist/chunks/phase.mjs +38 -0
  15. package/dist/chunks/pr-review.mjs +122 -0
  16. package/dist/chunks/preferences.mjs +61 -0
  17. package/dist/chunks/repair.mjs +111 -0
  18. package/dist/chunks/repo.mjs +58 -0
  19. package/dist/chunks/retro.mjs +86 -0
  20. package/dist/chunks/roadmap.mjs +58 -0
  21. package/dist/chunks/rules.mjs +527 -0
  22. package/dist/chunks/stale-mcp-server.mjs +90 -0
  23. package/dist/chunks/state.mjs +57 -0
  24. package/dist/chunks/stray-local-install.mjs +200 -0
  25. package/dist/chunks/telemetry.mjs +165 -0
  26. package/dist/chunks/todo.mjs +151 -0
  27. package/dist/chunks/vault-init.mjs +300 -0
  28. package/dist/chunks/verification.mjs +95 -0
  29. package/dist/chunks/version.mjs +70 -0
  30. package/dist/chunks/workflow.mjs +47 -0
  31. package/dist/claude/.claude/agents/architect.md +410 -0
  32. package/dist/claude/.claude/agents/build.md +111 -0
  33. package/dist/claude/.claude/agents/discuss.md +93 -0
  34. package/dist/claude/.claude/agents/discussion.md +149 -0
  35. package/dist/claude/.claude/agents/execute.md +416 -0
  36. package/dist/claude/.claude/agents/executor.md +161 -0
  37. package/dist/claude/.claude/agents/fast.md +84 -0
  38. package/dist/claude/.claude/agents/finalize.md +484 -0
  39. package/dist/claude/.claude/agents/learner.md +160 -0
  40. package/dist/claude/.claude/agents/plan-reviewer.md +129 -0
  41. package/dist/claude/.claude/agents/plan.md +96 -0
  42. package/dist/claude/.claude/agents/research.md +327 -0
  43. package/dist/claude/.claude/agents/researcher.md +78 -0
  44. package/dist/claude/.claude/agents/review.md +283 -0
  45. package/dist/claude/.claude/agents/reviewer.md +163 -0
  46. package/dist/claude/.claude/agents/shadow-scanner.md +257 -0
  47. package/dist/claude/.claude/agents/triage.md +230 -0
  48. package/dist/claude/.claude/agents/verifier.md +131 -0
  49. package/dist/claude/.claude/commands/bug-diagnose.md +12 -0
  50. package/dist/claude/.claude/commands/gh-issue-triage.md +14 -0
  51. package/dist/claude/.claude/commands/gh-pr-address.md +235 -0
  52. package/dist/claude/.claude/commands/gh-prepare.md +12 -0
  53. package/dist/claude/.claude/commands/grill-me.md +12 -0
  54. package/dist/claude/.claude/commands/lu-review.md +51 -0
  55. package/dist/claude/.claude/commands/lu.md +75 -0
  56. package/dist/claude/.claude/commands/luca-init.md +14 -0
  57. package/dist/claude/.claude/commands/luca-telemetry-report.md +12 -0
  58. package/dist/claude/.claude/commands/memory-audit.md +12 -0
  59. package/dist/claude/.claude/commands/milestone-new.md +122 -0
  60. package/dist/claude/.claude/commands/phase-discuss.md +45 -0
  61. package/dist/claude/.claude/commands/phase-execute.md +39 -0
  62. package/dist/claude/.claude/commands/phase-plan.md +53 -0
  63. package/dist/claude/.claude/commands/repo-cleanup.md +80 -0
  64. package/dist/claude/.claude/commands/todo-add.md +28 -0
  65. package/dist/claude/.claude/commands/todo-check.md +36 -0
  66. package/dist/claude/.claude/hooks/context-refresher.ts +285 -0
  67. package/dist/claude/.claude/hooks/continuation-messages.ts +215 -0
  68. package/dist/claude/.claude/hooks/pipeline-guard.ts +182 -0
  69. package/dist/claude/.claude/settings.json +41 -0
  70. package/dist/claude/skills/arch-audit/SKILL.md +161 -0
  71. package/dist/claude/skills/autopilot/SKILL.md +1299 -0
  72. package/dist/claude/skills/bug-diagnose/SKILL.md +102 -0
  73. package/dist/claude/skills/choose/SKILL.md +124 -0
  74. package/dist/claude/skills/gh-issue-triage/SKILL.md +97 -0
  75. package/dist/claude/skills/gh-pr-address/SKILL.md +235 -0
  76. package/dist/claude/skills/gh-prepare/SKILL.md +209 -0
  77. package/dist/claude/skills/grill-me/SKILL.md +46 -0
  78. package/dist/claude/skills/lu/SKILL.md +112 -0
  79. package/dist/claude/skills/lu-review/SKILL.md +51 -0
  80. package/dist/claude/skills/luca-init/SKILL.md +91 -0
  81. package/dist/claude/skills/luca-telemetry-report/SKILL.md +145 -0
  82. package/dist/claude/skills/luca-write-surface/SKILL.md +213 -0
  83. package/dist/claude/skills/memory-audit/SKILL.md +217 -0
  84. package/dist/claude/skills/milestone-audit/SKILL.md +545 -0
  85. package/dist/claude/skills/milestone-complete/SKILL.md +168 -0
  86. package/dist/claude/skills/milestone-gaps/SKILL.md +60 -0
  87. package/dist/claude/skills/milestone-new/SKILL.md +125 -0
  88. package/dist/claude/skills/note/SKILL.md +162 -0
  89. package/dist/claude/skills/phase-add/SKILL.md +91 -0
  90. package/dist/claude/skills/phase-assumptions/SKILL.md +92 -0
  91. package/dist/claude/skills/phase-discuss/SKILL.md +165 -0
  92. package/dist/claude/skills/phase-execute/SKILL.md +1786 -0
  93. package/dist/claude/skills/phase-insert/SKILL.md +100 -0
  94. package/dist/claude/skills/phase-plan/SKILL.md +461 -0
  95. package/dist/claude/skills/phase-remove/SKILL.md +113 -0
  96. package/dist/claude/skills/phase-research/SKILL.md +80 -0
  97. package/dist/claude/skills/post-init-tour/SKILL.md +58 -0
  98. package/dist/claude/skills/progress/SKILL.md +271 -0
  99. package/dist/claude/skills/project-new/SKILL.md +609 -0
  100. package/dist/claude/skills/quick/SKILL.md +256 -0
  101. package/dist/claude/skills/rename-audit/SKILL.md +52 -0
  102. package/dist/claude/skills/repo-audit/SKILL.md +88 -0
  103. package/dist/claude/skills/repo-cleanup/SKILL.md +80 -0
  104. package/dist/claude/skills/seed-memory/SKILL.md +235 -0
  105. package/dist/claude/skills/session-pause/SKILL.md +126 -0
  106. package/dist/claude/skills/session-plan/SKILL.md +112 -0
  107. package/dist/claude/skills/session-resume/SKILL.md +75 -0
  108. package/dist/claude/skills/todo-add/SKILL.md +85 -0
  109. package/dist/claude/skills/todo-check/SKILL.md +77 -0
  110. package/dist/claude/skills/workflow-save/SKILL.md +277 -0
  111. package/dist/index.d.mts +33 -0
  112. package/dist/index.d.ts +33 -0
  113. package/dist/index.mjs +69 -0
  114. package/dist/shared/luca.B3Mimc0P.mjs +52 -0
  115. package/dist/shared/luca.B3saVjJm.mjs +163 -0
  116. package/dist/shared/luca.BYdjkfnz.mjs +217 -0
  117. package/dist/shared/luca.BmhNkYe2.mjs +56 -0
  118. package/dist/shared/luca.C4gMUoBd.mjs +358 -0
  119. package/dist/shared/luca.CQ3g1xrD.mjs +19 -0
  120. package/dist/shared/luca.CRmaAfXR.mjs +713 -0
  121. package/dist/shared/luca.CrXzXueR.mjs +57 -0
  122. package/dist/shared/luca.DTomPq7I.mjs +91 -0
  123. package/dist/shared/luca.DjDTeDCi.mjs +1904 -0
  124. package/dist/shared/luca.HZxBTBgD.mjs +201 -0
  125. package/dist/shared/luca.TSMg1t7I.mjs +10 -0
  126. package/dist/shared/luca.dM-MKlNE.mjs +25 -0
  127. package/dist/shared/luca.naWEcQ4B.mjs +7 -0
  128. package/package.json +76 -0
@@ -0,0 +1,235 @@
1
+ ---
2
+ name: gh-pr-address
3
+ description: Address PR review comments — fetch, filter stale, categorize, fix, respond, regression-check.
4
+ ---
5
+
6
+ # /gh-pr-address
7
+
8
+ Address PR review comments by fetching them, dropping stale ones, categorizing by severity, implementing fixes, posting replies, and verifying the fix iteration introduced no regressions.
9
+
10
+ ## Parse arguments
11
+
12
+ Parse `$ARGUMENTS` for:
13
+
14
+ - A **PR number** (e.g. `42`) or **PR URL** (e.g. `https://github.com/owner/repo/pull/42`)
15
+ - `--dry-run` — show categorized comments and planned fixes without executing
16
+ - `--skip-validation` — skip categorization; treat all comments as actionable
17
+ - `--no-respond` — fix issues but don't post reply comments
18
+
19
+ If no PR number or URL is provided, detect it from the current branch:
20
+
21
+ ```bash
22
+ gh pr view --json number,url
23
+ ```
24
+
25
+ Resolve `<repo_vault>` from `.luca/config.json` → `muninn.vault`, falling back to `"default"`.
26
+
27
+ ## Step 1 — Fetch PR data
28
+
29
+ Fetch all reviews and review comments:
30
+
31
+ ```bash
32
+ gh pr view <number> --json reviews,comments,reviewDecision,title,body,number,url
33
+ gh api repos/{owner}/{repo}/pulls/<number>/comments --paginate
34
+ ```
35
+
36
+ Group the results:
37
+
38
+ - **Review comments** — inline code comments with file/line context (the `gh api pulls/<n>/comments` shape).
39
+ - **General comments** — conversation-level feedback.
40
+ - **Duplicates** — the same concern on different lines; group by content similarity and track every comment id in the group.
41
+
42
+ Build a comment map with fields: `commentId, author, body, file, line, inReplyTo, isDuplicate, duplicateGroupId`.
43
+
44
+ **Snapshot the iteration boundary.** Record the current `git rev-parse HEAD` SHA as `iterationStartSha` and the current time as `iterationStartTime` (ISO 8601). Step 7 uses the SHA to compute which paths the iteration modified and the timestamp to filter newly-created comments.
45
+
46
+ ## Step 1.5 — Filter stale comments
47
+
48
+ Comments filed against an earlier commit may already be addressed by later fix commits on the branch. Acting on them wastes iteration cycles.
49
+
50
+ Run the stale-comment filter on the **review comments** (the raw `gh api pulls/<n>/comments` objects — each carries `id, path, line, original_line, commit_id, original_commit_id, diff_hunk, body, in_reply_to_id?, user?`). Stage the review comments array in a JSON file, then run `luca pr-review filter-stale --file`:
51
+
52
+ ```
53
+ # /tmp/luca-pr-comments.json holds the review comments array from Step 1
54
+ luca pr-review filter-stale --file /tmp/luca-pr-comments.json
55
+ ```
56
+
57
+ The command partitions them into four buckets:
58
+
59
+ - **`actionable`** — cited code still exists at the same location. Continue with categorization for these.
60
+ - **`stale`** — cited code was rewritten, removed, or relocated beyond the drift tolerance. **Skip categorization.** When responding (Step 5), reply that the comment is stale and point at the commit that addressed the underlying code.
61
+ - **`replies`** — comments with `in_reply_to_id` set; pass through, not first-class findings.
62
+ - **`unknown`** — could not be re-anchored; treat conservatively as actionable.
63
+
64
+ Append a note to the Step 2 audit summary: `Stale: <n> comments (skipped from categorization)`.
65
+
66
+ ## Step 2 — Categorize comments
67
+
68
+ Unless `--skip-validation` is set, classify each unique actionable comment (deduplicated):
69
+
70
+ | Category | Action | Examples |
71
+ |----------|--------|---------|
72
+ | **security** | Must fix | Vulnerabilities, injection, credential exposure |
73
+ | **bug** | Must fix | Logic errors, regressions, broken behavior |
74
+ | **requirement** | Must fix | Missing acceptance criteria, spec violations |
75
+ | **style** | Should fix | Naming, formatting, established pattern violations |
76
+ | **improvement** | Should fix | Better approach, DX, readability |
77
+ | **question** | Respond only | Clarification requests, design rationale questions |
78
+ | **nit** | Optional | Trivial preferences, minor suggestions |
79
+ | **praise** | Respond only | Positive feedback |
80
+
81
+ Present a summary:
82
+
83
+ ```
84
+ ## PR #<number> Comment Audit
85
+
86
+ Must Fix: N comments (security: N, bug: N, requirement: N)
87
+ Should Fix: N comments (style: N, improvement: N)
88
+ Respond Only: N comments (question: N, praise: N)
89
+ Nit: N comments
90
+ Stale: N comments (skipped from categorization)
91
+
92
+ Total: N unique comments (N duplicates grouped)
93
+ ```
94
+
95
+ If `--dry-run`, stop here.
96
+
97
+ ## Step 2.5 — Detect cross-perspective convergence
98
+
99
+ When two or more independent reviewer perspectives flag the same location, that location is materially more likely to be a real issue. Auto-promote severity so converged findings are treated as must-fix.
100
+
101
+ Build a `findings` array — one entry per actionable comment, plus any findings from other perspectives this iteration has access to. If a pipeline phase is active, include the `luca-reviewer` MUST-FIX/SHOULD-FIX entries from `.luca/phases/<NN-slug>/audits/*.md`. Map each to:
102
+
103
+ ```
104
+ {
105
+ id: <stable id, e.g. comment id or "luca-reviewer:<n>">,
106
+ perspective: <who produced it, e.g. "Copilot", "luca-reviewer">,
107
+ path: <file path>,
108
+ line: <line number>,
109
+ severity: <"must-fix" | "should-fix" | "nit" | "style" | "improvement" | ...>,
110
+ category: <"security" | "bug" | "style" | ...>,
111
+ summary: <short description>
112
+ }
113
+ ```
114
+
115
+ Run convergence detection. Stage the findings array in a JSON file, then run `luca pr-review detect-convergence --file`:
116
+
117
+ ```
118
+ # /tmp/luca-pr-findings.json holds the findings array
119
+ luca pr-review detect-convergence --file /tmp/luca-pr-findings.json --line-tolerance 2
120
+ ```
121
+
122
+ For each entry in the returned `report.promotions`:
123
+
124
+ - Find the corresponding categorized comment in your audit map.
125
+ - Update its severity to **must-fix** (regardless of its original severity), preserving the original category. Add a note: `Promoted via convergence with <other perspectives>`.
126
+ - Surface it in the audit summary: `Converged: <n> findings promoted to must-fix via 2+ perspectives`.
127
+
128
+ Continue to Step 3 with the promoted findings.
129
+
130
+ ## Step 3 — Plan fixes
131
+
132
+ For comments with severity **must fix** and **should fix**:
133
+
134
+ 1. Group by file for efficient execution.
135
+ 2. Determine the fix approach for each comment.
136
+ 3. Order by severity: security → bug → requirement → style → improvement.
137
+
138
+ ## Step 4 — Execute fixes
139
+
140
+ Spawn **`luca-executor`** subagents (one per file group) via the `Agent` tool. Each subagent receives:
141
+
142
+ - The file path and the relevant comment details (body, line, category).
143
+ - Instructions to fix each issue and commit using the project's commit convention. Read it first by running `luca preferences read` and using the `commits` section (`convention`, `types`, `scopes`, `trailers`, `subjectMaxLength`). Reference the PR number per `commits.trailers.issueRef` when set; the executor adds the `Co-Authored-By` trailer automatically when `commits.trailers.coAuthor === true`.
144
+
145
+ After all executor subagents complete, run a type check:
146
+
147
+ ```bash
148
+ bunx --bun tsc --noEmit
149
+ ```
150
+
151
+ If the type check fails, fix the errors before proceeding.
152
+
153
+ ## Step 5 — Respond to comments
154
+
155
+ Unless `--no-respond` is set, post replies to **every** PR comment thread (including all duplicate ids in each group):
156
+
157
+ - **Fixed comments** → reply with what changed and which commit addresses it.
158
+ - **Stale comments** → reply that the comment is stale and point at the commit that already addressed the code.
159
+ - **Question comments** → reply with an answer based on codebase context.
160
+ - **Nit comments** → acknowledge briefly (applied or noted).
161
+ - **Praise comments** → thank and acknowledge briefly.
162
+
163
+ Post inline review-comment replies:
164
+
165
+ ```bash
166
+ gh api repos/{owner}/{repo}/pulls/<number>/comments/<commentId>/replies -f body="<reply>"
167
+ ```
168
+
169
+ Post top-level (conversation) replies:
170
+
171
+ ```bash
172
+ gh api repos/{owner}/{repo}/issues/<number>/comments -f body="<reply>"
173
+ ```
174
+
175
+ ## Step 6 — Push and verify
176
+
177
+ 1. Push the fixes: `git push`
178
+ 2. Verify zero unreplied threads remain:
179
+
180
+ ```bash
181
+ gh api repos/{owner}/{repo}/pulls/<number>/comments --paginate
182
+ ```
183
+
184
+ Check that every comment thread has a reply. Report any gaps.
185
+
186
+ ## Step 7 — Iteration-N regression check
187
+
188
+ Fix commits sometimes introduce new issues the original review didn't flag. Catch them now instead of paying for another full review pass.
189
+
190
+ 1. **Re-fetch all PR comments:**
191
+
192
+ ```bash
193
+ gh api repos/{owner}/{repo}/pulls/<number>/comments --paginate
194
+ ```
195
+
196
+ If the PR has automated reviewer hooks (Copilot, CodeRabbit, etc.) that re-run on push, allow a brief settle window (~30s) before re-fetching.
197
+
198
+ 2. **Build before/after finding arrays.** The `before` array is the `findings` array from Step 2.5 (pre-iteration state). The `after` array is built the same way from the freshly-fetched comments — include only comments with `created_at >= iterationStartTime` to filter out persistent prior findings.
199
+
200
+ 3. **Run the regression check** (it computes touched paths from the SHA range via `git diff`). Stage the full payload object in a JSON file, then run `luca pr-review regression-check --file`:
201
+
202
+ ```
203
+ # /tmp/luca-pr-regression.json holds:
204
+ # {
205
+ # "before": <pre-iteration findings>,
206
+ # "after": <post-iteration findings>,
207
+ # "from_sha": "<iterationStartSha>",
208
+ # "to_sha": "HEAD"
209
+ # }
210
+ luca pr-review regression-check --file /tmp/luca-pr-regression.json
211
+ ```
212
+
213
+ 4. **Handle the verdict.**
214
+
215
+ - No regressions (exit `0`, `report.regressions` empty) → iteration complete. Report `<n> resolved, <n> unchanged, <n> new on untouched paths` in the final summary.
216
+ - Regressions present (exit `1`, `report.regressions` non-empty) → fix commits introduced new findings. **Do not declare the iteration complete.** Re-enter Step 3 (Plan fixes) with `report.regressions` as the input set. The regression cycle is bounded — if 3 consecutive iterations fail this check, escalate to the user with a summary of what's regressing and pause the loop.
217
+
218
+ ## Step 8 — Store learnings
219
+
220
+ Store **recurring patterns** in MuninnDB (skip one-off fixes). The `pattern:*` prefix routes to the `"default"` vault per the vault-routing rule:
221
+
222
+ ```
223
+ mcp__muninn__muninn_remember_batch({
224
+ vault: "default",
225
+ memories: [
226
+ {
227
+ concept: "pattern:pr-review-<category>",
228
+ content: "<description of the recurring review-feedback pattern>",
229
+ tags: ["pr-review", "<category>"]
230
+ }
231
+ ]
232
+ })
233
+ ```
234
+
235
+ $ARGUMENTS
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: gh-prepare
3
+ description: Ship committed work — ensure a changeset, push the feature branch, open a draft PR.
4
+ ---
5
+
6
+ # /gh-prepare
7
+
8
+ Activate the `gh-prepare` skill to ship committed work: ensure a changeset exists, push the current feature branch to the remote, and open (or update) a draft PR that links its tracking issue with `Closes #<issue>` for auto-linking.
9
+
10
+ Works standalone or inside the pipeline. Run the `gh-prepare` skill now. Optional arguments — free-form hints (issue number, PR title, base branch):
11
+
12
+ $ARGUMENTS
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: grill-me
3
+ description: Stress-test a plan or design by walking each branch of the decision tree.
4
+ ---
5
+
6
+ # /grill-me
7
+
8
+ Activate the `grill-me` skill to interview you relentlessly about a plan or design — walking each branch of the decision tree, surfacing unstated assumptions, and offering an ADR only when a choice is hard to reverse, surprising, and carries a real trade-off.
9
+
10
+ Run the `grill-me` skill now. The plan or design to grill:
11
+
12
+ $ARGUMENTS
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: lu-review
3
+ description: Re-enter the Luca pipeline at the review step to audit completed work.
4
+ ---
5
+
6
+ # /lu-review
7
+
8
+ Run the **review** step against the active phase — a structured multi-perspective audit of executed code. Use this after `/phase-execute` + verification, or to re-audit a phase before closing it.
9
+
10
+ You are orchestration only: read state, run the reviewers, let them persist their audits with the `Write` tool.
11
+
12
+ ## Step 0 — Read state
13
+
14
+ Run `luca state read`. The review step has exactly one legal entry: `verify → review`. There is no bypass — `luca state advance` rejects illegal jumps.
15
+
16
+ - `pipelineStep === "verify"` → run `luca state advance --to-step review`, then proceed.
17
+ - `pipelineStep === "review"` → already there, proceed.
18
+ - anything else → STOP. Tell the user the pipeline must reach `verify` before review can run, and point them at `/lu` to drive it there. Do not attempt to force the transition.
19
+
20
+ Run `luca phase current` to get the active slug. If no phase is active, abort.
21
+
22
+ ## Run the reviewers
23
+
24
+ Spawn the `luca-reviewer` subagent via the `Agent` tool — once per perspective, in parallel:
25
+
26
+ - `architect` — structural correctness, dependency direction, API surface
27
+ - `dx` — readability, error messages, ergonomics
28
+ - `security` — input validation, injection, secret handling
29
+ - `simplification` — unnecessary complexity, dead code
30
+ - `test-quality` — vacuous mocks, presence-only assertions, coverage-by-existence
31
+
32
+ Pass each reviewer its assigned perspective and the active phase slug. Each reviewer persists its own audit by writing `audits/<reviewer>.md` with the `Write` tool to the canonical phase path (the stage-gate hook only permits that write in the `review` step).
33
+
34
+ Scale the perspective set to complexity: TRIVIAL/SIMPLE may run only `architect` + `security`; MODERATE+ runs the full set.
35
+
36
+ ## Aggregate
37
+
38
+ When all reviewers return, summarize for the user:
39
+
40
+ - Total MUST-FIX / SHOULD-FIX / NOTE counts across audits
41
+ - Whether any reviewer returned `REQUEST_CHANGES`
42
+
43
+ If there are MUST-FIX findings, the phase is not ready to advance — direct the user back to `/phase-execute` to address them (the `verify → checks → execute` loop-back path). If all reviewers APPROVE, advance with `luca state advance --to-step learn`.
44
+
45
+ ## What you must NOT do
46
+
47
+ - Do NOT force a transition into `review` from a non-`verify` state. Honor the no-bypass policy.
48
+ - Do NOT write audit files yourself — the reviewers write `audits/<reviewer>.md` with the `Write` tool to the canonical path; the hook blocks any other write.
49
+ - Do NOT fix the findings yourself in this skill. Review reports; execute fixes.
50
+
51
+ $ARGUMENTS
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: lu
3
+ description: Start (or resume) the Luca autonomous development pipeline for a request.
4
+ ---
5
+
6
+ # /lu
7
+
8
+ The unified entry point for the Luca pipeline. `/lu <request>` takes a development request and drives it through the full pipeline: triage → research → discuss → architect → plan → plan-review → execute → checks → verify → review → learn → milestone.
9
+
10
+ You are the **orchestrator**. You do not write code or planning artifacts directly — you read state, run each step (delegating to its skill or subagent), and advance the pipeline.
11
+
12
+ ## Step 0 — Read state
13
+
14
+ Run `luca state read`. Branch on `pipelineStep`:
15
+
16
+ - `idle` or `complete` → fresh start. Go to **Triage**.
17
+ - anything else → the pipeline is mid-flight. Skip triage, go straight to **Pipeline loop** and resume from the current step.
18
+
19
+ If the user passed a request but the pipeline is already mid-flight, surface that to the user and ask whether to resume the current run or finish it first — do NOT silently discard either.
20
+
21
+ ## Triage
22
+
23
+ Triage runs once, at the start of a run. It is inline here — there is no separate triage skill.
24
+
25
+ 1. **Classify complexity.** Read the request. Pick one of `TRIVIAL | SIMPLE | MODERATE | COMPLEX | CRITICAL` based on file count, scope, and risk. There is no CLI command to persist complexity — record it in your reasoning and pass it to every subagent you spawn (the model-routing table keys off it).
26
+ 2. **Build the roadmap.** Decompose the request into ordered phases. Each phase is one deliverable unit. Stage the phases array in a JSON file, then run `luca roadmap create --file`:
27
+ ```
28
+ # /tmp/luca-roadmap.json:
29
+ # [
30
+ # { "name": "<kebab-or-prose name>", "deps": [], "complexity": "<level>" },
31
+ # ...
32
+ # ]
33
+ luca roadmap create --file /tmp/luca-roadmap.json
34
+ ```
35
+ For a single-deliverable request, that is a one-phase roadmap. `luca roadmap create` is only legal in `idle`/`triage` — it resets `currentPhase` to 0.
36
+ 3. **Advance** `idle → triage → research` via two `luca state advance --to-step <step>` calls.
37
+
38
+ ## Pipeline loop
39
+
40
+ Repeat until `pipelineStep` is `complete`:
41
+
42
+ 1. Run `luca state read` to get the current `pipelineStep`.
43
+ 2. Run the step using the table below.
44
+ 3. Advance to the next step with `luca state advance --to-step <step>`. Transitions are validated against the pipeline-transitions table — illegal jumps are rejected.
45
+
46
+ | Step | How to run it |
47
+ |---------------|----------------------------------------------------------------------------|
48
+ | `research` | Spawn `luca-researcher` (Agent tool). Persist its output by writing `research.md` with the `Write` tool to the canonical phase path (get the dir from `luca phase current`). |
49
+ | `discuss` | Invoke the `/phase-discuss` skill. |
50
+ | `architect` | Lightweight synthesis: read research + context, confirm the plan-ready brief. Advance to `plan`. |
51
+ | `plan` | Invoke the `/phase-plan` skill. |
52
+ | `plan-review` | Spawn `luca-plan-reviewer` (Agent tool). On `NEEDS_REVISION`, loop back to `plan`. |
53
+ | `execute` | Invoke the `/phase-execute` skill. |
54
+ | `checks` | Run `luca checks run --file <commands.json>` with the project's typecheck (and tests, if present). On failure, loop back to `execute`. |
55
+ | `verify` | Spawn `luca-verifier` (Agent tool). On `recommendation: fix`, loop back to `checks`; on `escalate`, stop and surface to the user. |
56
+ | `review` | Spawn `luca-reviewer` (Agent tool) — one per perspective, in parallel. |
57
+ | `learn` | Spawn `luca-learner` (Agent tool). Then: more phases remain → advance to `plan` for the next phase; last phase → advance to `milestone`. |
58
+ | `milestone` | Invoke the `/milestone-new` skill to close out, or advance to `complete` if no milestone bookkeeping is needed. |
59
+
60
+ ## Oversight
61
+
62
+ Read `oversight` from `luca state read`:
63
+
64
+ - `full-auto` — run the whole loop without pausing.
65
+ - `checkpoint` — pause after `plan-review`, `verify`, and `learn` for user confirmation.
66
+ - `human-in-loop` — pause after every step.
67
+
68
+ ## What you must NOT do
69
+
70
+ - Do NOT write code directly. Phase artifact files are written with the `Write` tool to their canonical path by a subagent or `/phase-*` skill; structured `.luca/` mutations go through the `luca` CLI. The stage-gate hook blocks any other direct write.
71
+ - Do NOT skip steps. The pipeline-transitions table is the contract; `luca state advance` enforces it. There is no bypass.
72
+ - Do NOT re-triage a mid-flight pipeline. Resume from the current step instead.
73
+ - Do NOT commit. Commits happen only in the finalizing flow, never inside `/lu`.
74
+
75
+ $ARGUMENTS
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: luca-init
3
+ description: Seed project preferences (branching, commits, PR, release, tracker conventions) for this repo.
4
+ ---
5
+
6
+ # /luca-init
7
+
8
+ Activate the `luca-init` skill to probe the repository and seed its project preferences — branch naming, commit conventions, PR templates, release tooling, and issue tracker.
9
+
10
+ This is distinct from the `luca init` CLI command (`npx luca init`), which wires up the per-project `.claude/` hooks. `/luca-init` runs *after* that, to capture the repo's working conventions into `.luca/config.json` (via the `luca preferences write` CLI) so the pipeline emits work that matches the project's existing style.
11
+
12
+ Run the `luca-init` skill now. Optional arguments — `--auto` for non-interactive mode, or free-form hints about repo conventions:
13
+
14
+ $ARGUMENTS
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: luca-telemetry-report
3
+ description: Aggregate .luca/telemetry/*.jsonl across recent runs and emit a markdown report. Read-only — never mutates state.
4
+ ---
5
+
6
+ # /luca-telemetry-report
7
+
8
+ Activate the `luca-telemetry-report` skill to aggregate the per-run event logs under `.luca/telemetry/*.jsonl` across recent runs and emit a markdown report summarising step durations, model usage, and pipeline outcomes. Strictly read-only — it never mutates workflow state or writes into the `.luca/` contract.
9
+
10
+ Run the `luca-telemetry-report` skill now. Optional arguments (`--runs <N>` default 10, `--since <ISO-date>`, `--vault <name>`):
11
+
12
+ $ARGUMENTS
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: memory-audit
3
+ description: Paginated LLM-judged retro-pass over a MuninnDB vault — classify trust tiers, write a resumable cursor, emit a per-run report.
4
+ ---
5
+
6
+ # /memory-audit
7
+
8
+ Activate the `memory-audit` skill to run a paginated, LLM-judged retro-pass over a MuninnDB vault: classify each memory's trust tier (inferred vs. verified), write a resumable cursor so a long audit can be continued across runs, and emit a per-run report.
9
+
10
+ Run the `memory-audit` skill now. Optional arguments (`--dry-run` default, `--apply`, `--vault <name>`, `--resume`, `--limit <n>`, `--auto`):
11
+
12
+ $ARGUMENTS
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: milestone-new
3
+ description: Start a new milestone cycle — gather goals, optionally research, define requirements, build the roadmap.
4
+ ---
5
+
6
+ # /milestone-new
7
+
8
+ Start a new milestone cycle. This is the brownfield equivalent of project initialization — use it when beginning a fresh body of work on an existing project.
9
+
10
+ ## Parse arguments
11
+
12
+ Parse `$ARGUMENTS` for:
13
+ - An optional **milestone name** (e.g. `"v2 API Redesign"`)
14
+ - An optional **version** (e.g. `v2`, `v3`)
15
+ - `--skip-research` — skip the research step
16
+
17
+ ## Step 1 — Load context
18
+
19
+ 1. Recall project identity from MuninnDB: `mcp__muninn__muninn_recall({ vault: "<repo_vault>", context: ["brain:project-identity"], mode: "semantic" })`.
20
+ 2. Recall prior milestones: `mcp__muninn__muninn_recall({ vault: "<repo_vault>", context: ["milestone:"], mode: "recent" })`.
21
+ 3. Run `luca state read` to check the pipeline status.
22
+
23
+ Resolve `<repo_vault>` from `.luca/config.json` → `muninn.vault`, falling back to `"default"`.
24
+
25
+ If the pipeline is mid-flight (`pipelineStep` is not `idle` or `complete`), warn the user that starting a new milestone resets pipeline state, and confirm before proceeding.
26
+
27
+ ## Step 2 — Gather milestone goals
28
+
29
+ Ask the user (use `AskUserQuestion` where there are real choices):
30
+ - What should this milestone accomplish?
31
+ - Key features or changes?
32
+ - Constraints or deadlines?
33
+ - Target scope — a small focused change or a large feature set?
34
+
35
+ Compile the answers into a structured goal list.
36
+
37
+ ## Step 3 — Determine version
38
+
39
+ - If prior milestones exist (from the Step 1 recall), suggest the next sequential version.
40
+ - If a version was passed in arguments, use that.
41
+ - If there are no prior milestones, start at `v1`.
42
+
43
+ Confirm the version with the user.
44
+
45
+ ## Step 4 — Persist the milestone
46
+
47
+ Store the milestone in MuninnDB (the `milestone:*` prefix routes to the **repo** vault per the vault-routing rule):
48
+
49
+ ```
50
+ mcp__muninn__muninn_remember({
51
+ vault: "<repo_vault>",
52
+ concept: "milestone:v<version>-goals",
53
+ content: "<structured goal list + scope + constraints>"
54
+ })
55
+ ```
56
+
57
+ There is no `.luca/PROJECT.md` — project identity lives in the MuninnDB brain tree, and milestone goals live in the `milestone:*` memory above. Do not create root-level planning files; the `.luca/` contract does not allow them.
58
+
59
+ ## Step 5 — Research (optional)
60
+
61
+ Unless `--skip-research` is set, for each major feature area spawn the `luca-researcher` subagent via the `Agent` tool with milestone-aware context (project brief + goal list + the feature to research).
62
+
63
+ Store each research summary in MuninnDB under `research:<feature-slug>` in the repo vault. Per-phase `research.md` files are written later by the pipeline once phases exist — milestone-level research is memory-only.
64
+
65
+ Present a summary of key findings to the user.
66
+
67
+ ## Step 6 — Define requirements
68
+
69
+ Based on the goals (and research, if run), present the feature list with suggested scope:
70
+ - **Must have** — core requirements that define the milestone
71
+ - **Should have** — important, not blocking
72
+ - **Nice to have** — stretch goals
73
+
74
+ Let the user adjust. Fold the agreed requirement list into the milestone memory from Step 4 (re-`remember` with the requirements appended) — there is no separate requirements file.
75
+
76
+ ## Step 7 — Build the roadmap
77
+
78
+ Organize the requirements into ordered phases by dependency and priority. Stage the phases array in a JSON file, then run `luca roadmap create --file`:
79
+
80
+ ```
81
+ # /tmp/luca-roadmap.json:
82
+ # [
83
+ # { "name": "<phase name>", "deps": [...], "complexity": "<TRIVIAL|SIMPLE|MODERATE|COMPLEX|CRITICAL>" },
84
+ # ...
85
+ # ]
86
+ luca roadmap create --file /tmp/luca-roadmap.json
87
+ ```
88
+
89
+ `luca roadmap create` is only legal in `idle`/`triage`; it resets `currentPhase` to 0 and sets `totalPhases`. If the pipeline was mid-flight and the user confirmed the reset in Step 1, run `luca workflow reset --confirm` first to return to a clean idle state.
90
+
91
+ ## Step 8 — GitHub tracking
92
+
93
+ Offer three options:
94
+
95
+ 1. **New issue + branch** — `gh issue create --title "v<version>: <name>" --body "<description>"`, then create and push a feature branch.
96
+ 2. **Continue on existing** — comment on the open issue noting the new milestone, keep the current branch.
97
+ 3. **No tracking** — skip (warn that no PR will be auto-created later).
98
+
99
+ ## Step 9 — Done
100
+
101
+ Report completion:
102
+
103
+ ```
104
+ ## Milestone v<version>: <name> — Initialized
105
+
106
+ Roadmap: <N> phases. Pipeline reset to idle.
107
+ Next: /lu <describe the first phase of work>
108
+ ```
109
+
110
+ Record the initialization in MuninnDB and promote it to the verified tier:
111
+
112
+ ```
113
+ mcp__muninn__muninn_remember({
114
+ vault: "<repo_vault>",
115
+ concept: "milestone:v<version>-initialized",
116
+ content: "Milestone v<version> '<name>' initialized: <N> requirements across <N> phases. Goals: <brief>."
117
+ })
118
+ ```
119
+
120
+ Capture the returned id and call `mcp__muninn__muninn_trust({ id: <id>, trust: "verified", vault: "<repo_vault>" })` — this is a user-confirmed milestone, so it belongs at the verified tier.
121
+
122
+ $ARGUMENTS
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: phase-discuss
3
+ description: "Drive the \"discuss\" pipeline step — gather user decisions for the active phase and persist them as context.md."
4
+ ---
5
+
6
+ # /phase-discuss
7
+
8
+ You are running the **discuss** step of the luca pipeline. The current phase has been triaged and researched; now you need user decisions before planning can begin.
9
+
10
+ ## Preconditions
11
+
12
+ Before doing anything, confirm we're in the right state:
13
+
14
+ 1. Run `luca state read` and verify `pipelineStep` is either `research` (transitioning forward) or `discuss` (already advanced).
15
+ 2. If `pipelineStep` is `research`, run `luca state advance --to-step discuss` to enter this step.
16
+ 3. Run `luca phase current` to get the active phase slug and directory. If `active` is false, abort and ask the user to set the roadmap first.
17
+
18
+ If the state is anything else, surface a clear error to the user instead of guessing.
19
+
20
+ ## Gather decisions
21
+
22
+ Ask the user 1–4 focused questions to resolve open scope/design decisions for the phase. Reference the research findings (read from `.luca/phases/<slug>/research.md` via the `Read` tool) so the questions are grounded.
23
+
24
+ Use the `AskUserQuestion` tool when there are concrete choices with trade-offs. Keep questions focused — no padding.
25
+
26
+ ## Persist context
27
+
28
+ When the user has answered, write the consolidated context with the `Write` tool to the canonical path. Use the `dir` field from `luca phase current`; the context path is `<dir>/context.md`:
29
+
30
+ ```
31
+ Write tool → <dir>/context.md
32
+ content: "<markdown summary of decisions>"
33
+ ```
34
+
35
+ The stage-gate hook only permits this `Write` to `<dir>/context.md` while `pipelineStep === "discuss"` — any other path or step is blocked.
36
+
37
+ ## Advance
38
+
39
+ When context.md is written, run `luca state advance --to-step architect` so the next step can begin.
40
+
41
+ ## What you must NOT do
42
+
43
+ - Do NOT write `context.md` to any path other than `<dir>/context.md`, or via `Edit` — the hook blocks every other `.luca/` write.
44
+ - Do NOT skip the question-asking step just because you have an opinion. The point of `/phase-discuss` is to surface user decisions, not yours.
45
+ - Do NOT write code in this step. Code writes are blocked by the stage-gate in PLANNING phases.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: phase-execute
3
+ description: "Drive the \"execute\" pipeline step — implement the phase plan with per-task commits and verification."
4
+ ---
5
+
6
+ # /phase-execute
7
+
8
+ You are running the **execute** step. The plan exists and has been reviewed. Your job is to implement it.
9
+
10
+ ## Preconditions
11
+
12
+ 1. Run `luca state read`. The `pipelineStep` must be `plan-review` (entering execute) or `execute` (already advanced).
13
+ 2. If currently `plan-review`, run `luca state advance --to-step execute`.
14
+ 3. Run `luca phase current` to get the active slug.
15
+
16
+ ## Read the plan
17
+
18
+ Read `.luca/phases/<slug>/plan.md`. If the plan doesn't exist or appears empty, abort and direct the user back to `/phase-plan`.
19
+
20
+ ## Delegate to the executor subagent
21
+
22
+ Spawn the `luca-executor` subagent via the `Agent` tool with a prompt that includes:
23
+ - The full plan content
24
+ - The phase slug
25
+ - Whatever constraints apply (e.g. test-driven development, no commits without verification)
26
+
27
+ The subagent does the actual code-writing work. **You are orchestration only** — do not start editing files yourself in this skill. Code writes happen inside the subagent's tool calls, which the stage-gate hook allows because we're in `EXECUTING` phase.
28
+
29
+ ## Verification gate
30
+
31
+ When the executor returns, run `luca state advance --to-step checks` to enter the mechanical verification step (typecheck + tests).
32
+
33
+ The checks step is its own skill; `/phase-execute` is done once the executor reports completion.
34
+
35
+ ## What you must NOT do
36
+
37
+ - Do NOT advance to `checks` until the executor reports that the plan is implemented.
38
+ - Do NOT skip writing the execute summary — the executor produces one and writes it with the `Write` tool to `<dir>/execute/summary.md` (the canonical path); the hook blocks any other `.luca/` write.
39
+ - Do NOT commit on behalf of the user during execute. Commits are FINALIZING-only and the hook blocks them here.