@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.
- package/LICENSE +201 -0
- package/README.md +47 -0
- package/bin/luca.js +3 -0
- package/dist/chunks/branch.mjs +47 -0
- package/dist/chunks/bun-runtime.mjs +46 -0
- package/dist/chunks/checks.mjs +53 -0
- package/dist/chunks/claim-verify.mjs +465 -0
- package/dist/chunks/classify.mjs +105 -0
- package/dist/chunks/confidence.mjs +199 -0
- package/dist/chunks/doctor.mjs +158 -0
- package/dist/chunks/hook.mjs +696 -0
- package/dist/chunks/init.mjs +715 -0
- package/dist/chunks/muninndb-health.mjs +66 -0
- package/dist/chunks/phase.mjs +38 -0
- package/dist/chunks/pr-review.mjs +122 -0
- package/dist/chunks/preferences.mjs +61 -0
- package/dist/chunks/repair.mjs +111 -0
- package/dist/chunks/repo.mjs +58 -0
- package/dist/chunks/retro.mjs +86 -0
- package/dist/chunks/roadmap.mjs +58 -0
- package/dist/chunks/rules.mjs +527 -0
- package/dist/chunks/stale-mcp-server.mjs +90 -0
- package/dist/chunks/state.mjs +57 -0
- package/dist/chunks/stray-local-install.mjs +200 -0
- package/dist/chunks/telemetry.mjs +165 -0
- package/dist/chunks/todo.mjs +151 -0
- package/dist/chunks/vault-init.mjs +300 -0
- package/dist/chunks/verification.mjs +95 -0
- package/dist/chunks/version.mjs +70 -0
- package/dist/chunks/workflow.mjs +47 -0
- package/dist/claude/.claude/agents/architect.md +410 -0
- package/dist/claude/.claude/agents/build.md +111 -0
- package/dist/claude/.claude/agents/discuss.md +93 -0
- package/dist/claude/.claude/agents/discussion.md +149 -0
- package/dist/claude/.claude/agents/execute.md +416 -0
- package/dist/claude/.claude/agents/executor.md +161 -0
- package/dist/claude/.claude/agents/fast.md +84 -0
- package/dist/claude/.claude/agents/finalize.md +484 -0
- package/dist/claude/.claude/agents/learner.md +160 -0
- package/dist/claude/.claude/agents/plan-reviewer.md +129 -0
- package/dist/claude/.claude/agents/plan.md +96 -0
- package/dist/claude/.claude/agents/research.md +327 -0
- package/dist/claude/.claude/agents/researcher.md +78 -0
- package/dist/claude/.claude/agents/review.md +283 -0
- package/dist/claude/.claude/agents/reviewer.md +163 -0
- package/dist/claude/.claude/agents/shadow-scanner.md +257 -0
- package/dist/claude/.claude/agents/triage.md +230 -0
- package/dist/claude/.claude/agents/verifier.md +131 -0
- package/dist/claude/.claude/commands/bug-diagnose.md +12 -0
- package/dist/claude/.claude/commands/gh-issue-triage.md +14 -0
- package/dist/claude/.claude/commands/gh-pr-address.md +235 -0
- package/dist/claude/.claude/commands/gh-prepare.md +12 -0
- package/dist/claude/.claude/commands/grill-me.md +12 -0
- package/dist/claude/.claude/commands/lu-review.md +51 -0
- package/dist/claude/.claude/commands/lu.md +75 -0
- package/dist/claude/.claude/commands/luca-init.md +14 -0
- package/dist/claude/.claude/commands/luca-telemetry-report.md +12 -0
- package/dist/claude/.claude/commands/memory-audit.md +12 -0
- package/dist/claude/.claude/commands/milestone-new.md +122 -0
- package/dist/claude/.claude/commands/phase-discuss.md +45 -0
- package/dist/claude/.claude/commands/phase-execute.md +39 -0
- package/dist/claude/.claude/commands/phase-plan.md +53 -0
- package/dist/claude/.claude/commands/repo-cleanup.md +80 -0
- package/dist/claude/.claude/commands/todo-add.md +28 -0
- package/dist/claude/.claude/commands/todo-check.md +36 -0
- package/dist/claude/.claude/hooks/context-refresher.ts +285 -0
- package/dist/claude/.claude/hooks/continuation-messages.ts +215 -0
- package/dist/claude/.claude/hooks/pipeline-guard.ts +182 -0
- package/dist/claude/.claude/settings.json +41 -0
- package/dist/claude/skills/arch-audit/SKILL.md +161 -0
- package/dist/claude/skills/autopilot/SKILL.md +1299 -0
- package/dist/claude/skills/bug-diagnose/SKILL.md +102 -0
- package/dist/claude/skills/choose/SKILL.md +124 -0
- package/dist/claude/skills/gh-issue-triage/SKILL.md +97 -0
- package/dist/claude/skills/gh-pr-address/SKILL.md +235 -0
- package/dist/claude/skills/gh-prepare/SKILL.md +209 -0
- package/dist/claude/skills/grill-me/SKILL.md +46 -0
- package/dist/claude/skills/lu/SKILL.md +112 -0
- package/dist/claude/skills/lu-review/SKILL.md +51 -0
- package/dist/claude/skills/luca-init/SKILL.md +91 -0
- package/dist/claude/skills/luca-telemetry-report/SKILL.md +145 -0
- package/dist/claude/skills/luca-write-surface/SKILL.md +213 -0
- package/dist/claude/skills/memory-audit/SKILL.md +217 -0
- package/dist/claude/skills/milestone-audit/SKILL.md +545 -0
- package/dist/claude/skills/milestone-complete/SKILL.md +168 -0
- package/dist/claude/skills/milestone-gaps/SKILL.md +60 -0
- package/dist/claude/skills/milestone-new/SKILL.md +125 -0
- package/dist/claude/skills/note/SKILL.md +162 -0
- package/dist/claude/skills/phase-add/SKILL.md +91 -0
- package/dist/claude/skills/phase-assumptions/SKILL.md +92 -0
- package/dist/claude/skills/phase-discuss/SKILL.md +165 -0
- package/dist/claude/skills/phase-execute/SKILL.md +1786 -0
- package/dist/claude/skills/phase-insert/SKILL.md +100 -0
- package/dist/claude/skills/phase-plan/SKILL.md +461 -0
- package/dist/claude/skills/phase-remove/SKILL.md +113 -0
- package/dist/claude/skills/phase-research/SKILL.md +80 -0
- package/dist/claude/skills/post-init-tour/SKILL.md +58 -0
- package/dist/claude/skills/progress/SKILL.md +271 -0
- package/dist/claude/skills/project-new/SKILL.md +609 -0
- package/dist/claude/skills/quick/SKILL.md +256 -0
- package/dist/claude/skills/rename-audit/SKILL.md +52 -0
- package/dist/claude/skills/repo-audit/SKILL.md +88 -0
- package/dist/claude/skills/repo-cleanup/SKILL.md +80 -0
- package/dist/claude/skills/seed-memory/SKILL.md +235 -0
- package/dist/claude/skills/session-pause/SKILL.md +126 -0
- package/dist/claude/skills/session-plan/SKILL.md +112 -0
- package/dist/claude/skills/session-resume/SKILL.md +75 -0
- package/dist/claude/skills/todo-add/SKILL.md +85 -0
- package/dist/claude/skills/todo-check/SKILL.md +77 -0
- package/dist/claude/skills/workflow-save/SKILL.md +277 -0
- package/dist/index.d.mts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.mjs +69 -0
- package/dist/shared/luca.B3Mimc0P.mjs +52 -0
- package/dist/shared/luca.B3saVjJm.mjs +163 -0
- package/dist/shared/luca.BYdjkfnz.mjs +217 -0
- package/dist/shared/luca.BmhNkYe2.mjs +56 -0
- package/dist/shared/luca.C4gMUoBd.mjs +358 -0
- package/dist/shared/luca.CQ3g1xrD.mjs +19 -0
- package/dist/shared/luca.CRmaAfXR.mjs +713 -0
- package/dist/shared/luca.CrXzXueR.mjs +57 -0
- package/dist/shared/luca.DTomPq7I.mjs +91 -0
- package/dist/shared/luca.DjDTeDCi.mjs +1904 -0
- package/dist/shared/luca.HZxBTBgD.mjs +201 -0
- package/dist/shared/luca.TSMg1t7I.mjs +10 -0
- package/dist/shared/luca.dM-MKlNE.mjs +25 -0
- package/dist/shared/luca.naWEcQ4B.mjs +7 -0
- package/package.json +76 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quick
|
|
3
|
+
description: Execute a quick ad-hoc task with Luca quality guarantees but minimal ceremony.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<main>
|
|
7
|
+
# Luca Quick
|
|
8
|
+
|
|
9
|
+
Execute small, ad-hoc tasks with Luca guarantees (atomic commits, workflow-state tracking) while skipping optional agents (research, plan-reviewer, verifier).
|
|
10
|
+
|
|
11
|
+
Quick mode is the same system with a shorter path:
|
|
12
|
+
|
|
13
|
+
- Invokes the architect mode-agent (planning) + the `executor` subagent
|
|
14
|
+
- Skips researcher, plan-reviewer, verifier
|
|
15
|
+
- Quick tasks live in a phase directory like any other phase (per LUCA_DIR_CONTRACT)
|
|
16
|
+
- Tracked via the canonical workflow state machine
|
|
17
|
+
|
|
18
|
+
**Use when:** You know exactly what to do and the task is small enough to not need research or verification.
|
|
19
|
+
|
|
20
|
+
## Sub-agent Delegation Requirements
|
|
21
|
+
|
|
22
|
+
This skill is an **orchestrator**. YOU MUST delegate work to subagents using the Task tool.
|
|
23
|
+
|
|
24
|
+
**Required subagents for this skill:**
|
|
25
|
+
|
|
26
|
+
- The `architect` mode-agent performs the planning work in v13 (the v12-era `lu-planner` subagent was dropped per plan §5.6)
|
|
27
|
+
- `executor` - Executes the plan
|
|
28
|
+
|
|
29
|
+
**DO NOT** attempt to plan or execute yourself. Spawn the appropriate subagents via the `Task` tool, or invoke the architect mode-agent.
|
|
30
|
+
|
|
31
|
+
## Process
|
|
32
|
+
|
|
33
|
+
### Step 0: Resolve Model Profile
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
MODEL_PROFILE=$(cat .luca/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Models are resolved at runtime via `resolveModelForAgent(agentName, complexity)` from the centralized routing table — the orchestrator does not pick model strings.
|
|
40
|
+
|
|
41
|
+
### Step 1: Pre-flight Validation
|
|
42
|
+
|
|
43
|
+
Check that an active Luca project exists:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Auto-initialize the canonical .luca/ skeleton if missing (quick mode works without a full roadmap)
|
|
47
|
+
if [ ! -d .luca ]; then
|
|
48
|
+
luca init 2>/dev/null || true
|
|
49
|
+
fi
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Quick tasks work independently — no `roadmap.md` required. The `luca init` command writes the canonical `.luca/` skeleton per LUCA_DIR_CONTRACT.
|
|
53
|
+
|
|
54
|
+
### Step 2: Get Task Description
|
|
55
|
+
|
|
56
|
+
Use AskQuestion tool:
|
|
57
|
+
|
|
58
|
+
- header: "Quick Task"
|
|
59
|
+
- question: "What do you want to do?"
|
|
60
|
+
|
|
61
|
+
Store response as `$DESCRIPTION`.
|
|
62
|
+
|
|
63
|
+
Generate slug from description:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
slug=$(echo "$DESCRIPTION" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//' | cut -c1-40)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Step 3: Calculate Next Quick Task Number
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
mkdir -p .luca/quick
|
|
73
|
+
last=$(ls -1d .luca/quick/[0-9][0-9][0-9]-* 2>/dev/null | sort -r | head -1 | xargs -I{} basename {} | grep -oE '^[0-9]+')
|
|
74
|
+
|
|
75
|
+
if [ -z "$last" ]; then
|
|
76
|
+
next_num="001"
|
|
77
|
+
else
|
|
78
|
+
next_num=$(printf "%03d" $((10#$last + 1)))
|
|
79
|
+
fi
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Step 4: Create Quick Task Directory
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
QUICK_DIR=".luca/quick/${next_num}-${slug}"
|
|
86
|
+
mkdir -p "$QUICK_DIR"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Step 5: Spawn Planner (Quick Mode)
|
|
90
|
+
|
|
91
|
+
**MANDATORY**: Invoke the architect mode-agent (which performs planning in v13 — the v12-era `lu-planner` subagent was dropped per plan §5.6). Do NOT attempt to plan yourself.
|
|
92
|
+
|
|
93
|
+
First, read context:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Read workflow state from .luca/state.json via the luca CLI
|
|
97
|
+
STATE_JSON=$(luca state read 2>/dev/null || echo '{"initialized":false}')
|
|
98
|
+
# Recall session context from MuninnDB:
|
|
99
|
+
# mcp__muninn__muninn_recall(vault: "default", context: "current session context for quick task")
|
|
100
|
+
WORKING_CONTENT="[recalled from MuninnDB session context]"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Then spawn the architect mode-agent:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
Task(
|
|
107
|
+
prompt="""
|
|
108
|
+
<planning_context>
|
|
109
|
+
|
|
110
|
+
**Mode:** quick
|
|
111
|
+
**Task:** {description}
|
|
112
|
+
**Quick Task Number:** {next_num}
|
|
113
|
+
**Quick Task Directory:** {quick_dir}
|
|
114
|
+
|
|
115
|
+
**Project State:**
|
|
116
|
+
{state_content}
|
|
117
|
+
|
|
118
|
+
**Working Memory:**
|
|
119
|
+
{working_content}
|
|
120
|
+
|
|
121
|
+
</planning_context>
|
|
122
|
+
|
|
123
|
+
<quick_mode_constraints>
|
|
124
|
+
- Create a SINGLE plan with 1-3 focused tasks
|
|
125
|
+
- Target ~30% context usage (simple, focused)
|
|
126
|
+
- No research or verification needed
|
|
127
|
+
- Tasks should be directly actionable
|
|
128
|
+
</quick_mode_constraints>
|
|
129
|
+
|
|
130
|
+
<output_requirements>
|
|
131
|
+
- Create plan.md in {quick_dir} (canonical filename per LUCA_DIR_CONTRACT)
|
|
132
|
+
- Plan should have clear tasks with verification criteria
|
|
133
|
+
- Return summary of plan created
|
|
134
|
+
</output_requirements>
|
|
135
|
+
|
|
136
|
+
Create a quick plan for this task.
|
|
137
|
+
""",
|
|
138
|
+
subagent_type="architect",
|
|
139
|
+
description="Quick plan: {description}"
|
|
140
|
+
)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Do NOT proceed until the Task returns.**
|
|
144
|
+
|
|
145
|
+
### Step 6: Spawn Executor
|
|
146
|
+
|
|
147
|
+
**MANDATORY**: You MUST spawn a lu-executor sub-agent. Do NOT attempt to execute yourself.
|
|
148
|
+
|
|
149
|
+
First, read the plan:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
PLAN_CONTENT=$(cat "${QUICK_DIR}/plan.md")
|
|
153
|
+
# Read workflow state from .luca/state.json via the luca CLI
|
|
154
|
+
STATE_JSON=$(luca state read 2>/dev/null || echo '{"initialized":false}')
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Then spawn the executor:
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
Task(
|
|
161
|
+
prompt="""
|
|
162
|
+
<execution_context>
|
|
163
|
+
|
|
164
|
+
**Mode:** quick
|
|
165
|
+
**Quick Task Number:** {next_num}
|
|
166
|
+
**Quick Task Directory:** {quick_dir}
|
|
167
|
+
|
|
168
|
+
**Plan:**
|
|
169
|
+
{plan_content}
|
|
170
|
+
|
|
171
|
+
**Project State:**
|
|
172
|
+
{state_content}
|
|
173
|
+
|
|
174
|
+
</execution_context>
|
|
175
|
+
|
|
176
|
+
<execution_rules>
|
|
177
|
+
- Execute all tasks in the plan
|
|
178
|
+
- Commit each task atomically
|
|
179
|
+
- Do NOT update `.luca/roadmap.md` (quick tasks are separate phases per the contract)
|
|
180
|
+
- Write the execution summary to the canonical `execute/summary.md`
|
|
181
|
+
</execution_rules>
|
|
182
|
+
|
|
183
|
+
<output_requirements>
|
|
184
|
+
- Create `execute/summary.md` in `{quick_dir}` (canonical per LUCA_DIR_CONTRACT)
|
|
185
|
+
- Return commit hash and summary of what was done
|
|
186
|
+
</output_requirements>
|
|
187
|
+
|
|
188
|
+
Execute this quick task plan.
|
|
189
|
+
""",
|
|
190
|
+
subagent_type="executor",
|
|
191
|
+
description="Execute quick: {description}"
|
|
192
|
+
)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Do NOT proceed until the Task returns.**
|
|
196
|
+
|
|
197
|
+
### Step 7: Advance Workflow State
|
|
198
|
+
|
|
199
|
+
Advance the pipeline through learn/complete via the standard transitions:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
luca state advance --to-step learn
|
|
203
|
+
luca state advance --to-step complete
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Step 8: Final Commit and Completion
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
git add .
|
|
210
|
+
bun run commit --message="${DESCRIPTION}" --type=docs --scope=quick-${next_num} --no-push --skip-checks
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Display completion:
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
217
|
+
Luca ► QUICK TASK COMPLETE ✓
|
|
218
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
219
|
+
|
|
220
|
+
Quick Task ${next_num}: ${DESCRIPTION}
|
|
221
|
+
|
|
222
|
+
Summary: ${QUICK_DIR}/execute/summary.md
|
|
223
|
+
Commit: ${commit_hash}
|
|
224
|
+
|
|
225
|
+
Ready for next task: /quick
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Success Criteria
|
|
229
|
+
|
|
230
|
+
- [ ] `.luca/` directory exists (auto-created via `luca init` if needed)
|
|
231
|
+
- [ ] `.luca/state.json` exists (auto-created via `luca init` if needed)
|
|
232
|
+
- [ ] User provides task description
|
|
233
|
+
- [ ] Slug generated (lowercase, hyphens, max 40 chars)
|
|
234
|
+
- [ ] Next phase number calculated (zero-padded NN per LUCA_DIR_CONTRACT)
|
|
235
|
+
- [ ] Phase directory created at `.luca/phases/NN-slug/`
|
|
236
|
+
- [ ] `plan.md` written by the architect mode-agent
|
|
237
|
+
- [ ] `execute/summary.md` written by the `executor` subagent
|
|
238
|
+
- [ ] Workflow state advanced through learn/complete steps
|
|
239
|
+
- [ ] Artifacts committed
|
|
240
|
+
|
|
241
|
+
## Next Steps
|
|
242
|
+
|
|
243
|
+
| Condition | Action | Command |
|
|
244
|
+
|-----------|--------|---------|
|
|
245
|
+
| Task complete | Check project status | `/progress` |
|
|
246
|
+
| More quick tasks | Run another | `/quick` |
|
|
247
|
+
| Want to commit | Commit changes | Run `bun run commit` |
|
|
248
|
+
| Want PR | Create pull request | Run `gh pr create` |
|
|
249
|
+
|
|
250
|
+
**Primary:** `/progress` — See project status after quick task
|
|
251
|
+
|
|
252
|
+
**Also available:**
|
|
253
|
+
|
|
254
|
+
- `/quick` — Run another quick task
|
|
255
|
+
- `/help` — See all available commands
|
|
256
|
+
</main>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rename-audit
|
|
3
|
+
description: "Find stale references across the repo after renaming a file, pipeline step, export, symbol, ticket ID, or convention. Searches .md/.ts/.tsx/.mjs/.json/.jsonl, plus .claude/, .luca/, and .changeset/ artifacts. Read-only audit — never edits files. Use when the user says \"rename audit\", \"audit renames\", \"find stale refs\", \"post-rename check\", or invokes /rename-audit."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: rename-audit
|
|
7
|
+
|
|
8
|
+
Read-only audit for stale references after a rename. Surfaces every file that still mentions the old name so the caller can decide whether to edit or leave it (e.g. historical changesets are typically left alone).
|
|
9
|
+
|
|
10
|
+
## Step 1 — Parse arguments
|
|
11
|
+
|
|
12
|
+
Required: `oldName` (the string being phased out), `newName` (its replacement).
|
|
13
|
+
Optional: `scope` (`step` | `file` | `export` | `symbol` | `ticket` | `convention`) to refine the search. Optional: `extraExtensions` (e.g. `['.yaml']`) to widen scope.
|
|
14
|
+
|
|
15
|
+
If args are missing, prompt the user once with `AskUserQuestion`. Reject if `oldName === newName`.
|
|
16
|
+
|
|
17
|
+
## Step 2 — Enumerate source files
|
|
18
|
+
|
|
19
|
+
Use `git ls-files` to enumerate tracked files (honors `.gitignore`).
|
|
20
|
+
Default extensions: `.md`, `.ts`, `.tsx`, `.mjs`, `.json`, `.jsonl`.
|
|
21
|
+
Default include dirs (in addition to tracked source): `.claude/`, `.luca/`, `.changeset/`.
|
|
22
|
+
|
|
23
|
+
## Step 3 — Grep for the old name
|
|
24
|
+
|
|
25
|
+
Run the `Grep` tool (or `rg`) for the `oldName` substring across the enumerated files. Use a case-sensitive match by default; offer case-insensitive on `scope: 'convention'`. Collect every `file:line:snippet` hit.
|
|
26
|
+
|
|
27
|
+
## Step 4 — Classify hits
|
|
28
|
+
|
|
29
|
+
Bucket each hit by file type:
|
|
30
|
+
|
|
31
|
+
- **code** — `*.ts` / `*.tsx` / `*.mjs` in `src/`, `packages/`
|
|
32
|
+
- **test** — `*.test.ts` / `*.spec.ts`
|
|
33
|
+
- **docs** — `*.md` outside `.luca/`
|
|
34
|
+
- **state** — `.luca/`, `.changeset/`
|
|
35
|
+
- **config** — `*.json`, `*.jsonl`, `tsconfig.json`, `package.json`, `bunfig.toml`
|
|
36
|
+
|
|
37
|
+
For each bucket, decide an advisory action:
|
|
38
|
+
|
|
39
|
+
- `code` / `test` → MUST-FIX (compile/test regression risk)
|
|
40
|
+
- `docs` / `config` → SHOULD-FIX (drift over time)
|
|
41
|
+
- `state` → ADVISORY (historical artifacts may legitimately keep the old name)
|
|
42
|
+
|
|
43
|
+
## Step 5 — Report
|
|
44
|
+
|
|
45
|
+
Emit a markdown table grouped by bucket. For each row: `<file>:<line> <snippet (≤80 chars)>`. End with a summary line:
|
|
46
|
+
`Total: N matches across M files; K MUST-FIX, L SHOULD-FIX, P advisory.`
|
|
47
|
+
|
|
48
|
+
If `0 matches`, report `✅ No stale references found.`
|
|
49
|
+
|
|
50
|
+
## Constraints
|
|
51
|
+
|
|
52
|
+
This is a **READ-ONLY audit**. Never call `Write`, `Edit`, `NotebookEdit`, or any other file-mutating tool. Use `Bash` only for read-only discovery (`git ls-files`, `rg`) — never for mutation. Never auto-fix. Surface the findings so the caller can decide; the caller may then invoke `/gh-pr-address` or hand-edit.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: repo-audit
|
|
3
|
+
description: Run repo structure audit to detect naming violations, orphaned files, and convention drift. Supports quick and full audit modes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<main>
|
|
7
|
+
# Repo Audit
|
|
8
|
+
|
|
9
|
+
Run a repo structure health check to detect naming violations, orphaned files, import boundary violations, and convention drift.
|
|
10
|
+
|
|
11
|
+
**Arguments:** `[--quick|--full] [--fix]`
|
|
12
|
+
|
|
13
|
+
## Sub-agent Delegation
|
|
14
|
+
|
|
15
|
+
This skill delegates the analysis to the `lu-repo-architect` agent:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Task(
|
|
19
|
+
agent: "lu-repo-architect",
|
|
20
|
+
prompt: "Run {mode} repo audit on this codebase. Report findings in structured format."
|
|
21
|
+
)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Instructions
|
|
25
|
+
|
|
26
|
+
### 1. Determine Audit Mode
|
|
27
|
+
|
|
28
|
+
- `--quick` or TRIVIAL/SIMPLE complexity: Quick audit (naming, boundaries, drift only)
|
|
29
|
+
- `--full` or COMPLEX/CRITICAL complexity: Full audit (all checks including circular imports, dead exports)
|
|
30
|
+
- Default (MODERATE): Standard audit
|
|
31
|
+
|
|
32
|
+
Read complexity from the canonical workflow state:
|
|
33
|
+
```bash
|
|
34
|
+
COMPLEXITY=$(luca state read 2>/dev/null | jq -r '.complexity // "MODERATE"')
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Run Automated Checks
|
|
38
|
+
|
|
39
|
+
Run existing validation scripts first (these provide baseline data):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Domain boundary check
|
|
43
|
+
bun run scripts/check-domain-boundaries.ts 2>&1
|
|
44
|
+
|
|
45
|
+
# Build drift check
|
|
46
|
+
bun run check:drift 2>&1
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 3. Delegate to lu-repo-architect
|
|
50
|
+
|
|
51
|
+
Spawn the agent for deeper analysis based on the mode:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Task(
|
|
55
|
+
agent: "lu-repo-architect",
|
|
56
|
+
prompt: "Run {AUDIT_MODE} repo audit. The automated checks returned: {SCRIPT_RESULTS}. Now perform the additional checks for this mode and produce a structured health report."
|
|
57
|
+
)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 4. Display Results
|
|
61
|
+
|
|
62
|
+
Present the health report from the agent. Format:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
66
|
+
REPO HEALTH REPORT -- {mode} audit
|
|
67
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
68
|
+
|
|
69
|
+
Overall: {PASS|WARN|FAIL} ({score}/100)
|
|
70
|
+
|
|
71
|
+
{structured findings table}
|
|
72
|
+
|
|
73
|
+
{issues list with severity}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 5. Auto-Fix Mode (--fix)
|
|
77
|
+
|
|
78
|
+
If `--fix` is passed and issues are auto-fixable (naming, empty dirs):
|
|
79
|
+
- Rename files to kebab-case
|
|
80
|
+
- Remove empty directories
|
|
81
|
+
- Report what was fixed
|
|
82
|
+
|
|
83
|
+
## Notes
|
|
84
|
+
|
|
85
|
+
- This skill is invoked as `/repo-audit` or automatically at phase boundaries
|
|
86
|
+
- The lu-repo-architect agent performs the actual analysis
|
|
87
|
+
- Existing scripts (check-domain-boundaries, check-drift) handle the mechanical checks
|
|
88
|
+
</main>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: repo-cleanup
|
|
3
|
+
description: Scan the repository for AI-session debris and optionally clean it up.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /repo-cleanup
|
|
7
|
+
|
|
8
|
+
Scan the repository for AI-session debris — orphaned scripts, misplaced source files, tool artifacts, dead exports, `.luca/` contract violations, repo-root markdown debris — and optionally apply the remediations.
|
|
9
|
+
|
|
10
|
+
The scan is performed by the **`luca-shadow-scanner`** subagent (strictly read-only). This command drives that scan and applies fixes through the **`luca repo cleanup-apply`** CLI (the destructive write half).
|
|
11
|
+
|
|
12
|
+
## Parse arguments
|
|
13
|
+
|
|
14
|
+
Parse `$ARGUMENTS` for flags:
|
|
15
|
+
|
|
16
|
+
- `--quick` — quick scan (categories 1 + 3 only)
|
|
17
|
+
- `--full` — full scan (all 7 categories, including dead exports)
|
|
18
|
+
- `--dry-run` — show findings without applying anything
|
|
19
|
+
- `--fix` — auto-apply every `auto_fixable` finding without prompting
|
|
20
|
+
- `--category=N` — restrict to a single detection category (1–7)
|
|
21
|
+
|
|
22
|
+
If no scan-mode flag is given, default to **`standard`** mode with interactive review.
|
|
23
|
+
|
|
24
|
+
Resolve `<repo_vault>` from `.luca/config.json` → `muninn.vault`, falling back to `"default"`.
|
|
25
|
+
|
|
26
|
+
## Step 1 — Scan
|
|
27
|
+
|
|
28
|
+
Spawn the **`luca-shadow-scanner`** subagent via the `Agent` tool. The task prompt must include:
|
|
29
|
+
|
|
30
|
+
- The scan mode (`quick` | `standard` | `full`) resolved from the flags.
|
|
31
|
+
- Any `--category=N` filter — tell the scanner to report only that category.
|
|
32
|
+
|
|
33
|
+
The subagent ends its response with a single JSON block conforming to `ShadowScanReportSchema` (`scan_mode`, `categories_scanned`, `findings[]`, `summary`, `scanned_at`).
|
|
34
|
+
|
|
35
|
+
## Step 2 — Parse the report
|
|
36
|
+
|
|
37
|
+
Take the **last JSON block** of the subagent's response as the `ShadowScanReport`. Each entry in `findings[]` has: `category`, `severity`, `file_path`, `description`, `recommendation`, `recommended_action` (`delete` | `move` | `gitignore`), `target_path?`, `auto_fixable`.
|
|
38
|
+
|
|
39
|
+
Display the findings banner: total count plus the per-severity breakdown from `summary`.
|
|
40
|
+
|
|
41
|
+
## Step 3 — Handle the findings
|
|
42
|
+
|
|
43
|
+
- **No findings** (`summary.total === 0`) → report a clean scan and stop.
|
|
44
|
+
|
|
45
|
+
- **`--dry-run`** → display all findings grouped by severity (critical first) and stop. Apply nothing.
|
|
46
|
+
|
|
47
|
+
- **`--fix`** → for every finding where `auto_fixable === true`, stage that single finding object in a JSON file and run:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
# /tmp/luca-cleanup-finding.json holds the single finding object
|
|
51
|
+
luca repo cleanup-apply --file /tmp/luca-cleanup-finding.json --confirm
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Findings with `auto_fixable === false` (e.g. repo-root markdown, SUMMARY moves) are listed for the user but not auto-applied.
|
|
55
|
+
|
|
56
|
+
- **Interactive mode** (default) → present each finding sorted by severity (critical first). For each one, offer three choices:
|
|
57
|
+
|
|
58
|
+
- **Fix** → stage the single finding object in a JSON file and run `luca repo cleanup-apply --file <path> --confirm`. For a `move`, the finding must carry `target_path`; if it does not, ask the user where it should go and add `target_path` to the file before running.
|
|
59
|
+
- **Keep** → record the user's decision so the file is not re-flagged next scan:
|
|
60
|
+
|
|
61
|
+
First call `mcp__muninn__muninn_remember` with `vault: "<repo_vault>"`, `concept: "shadow-debt:kept:<file_path>"`, and content noting the user approved keeping `<file_path>` with an ISO timestamp. Then promote it: `mcp__muninn__muninn_trust({ id: <returned id>, trust: "verified", vault: "<repo_vault>" })` — this is a user-confirmed decision. The `luca-shadow-scanner` recalls `shadow-debt:kept` entries and excludes them from future scans.
|
|
62
|
+
- **Skip** → take no action; the file will be flagged again on the next scan.
|
|
63
|
+
|
|
64
|
+
## Step 4 — Store the cleanup metric
|
|
65
|
+
|
|
66
|
+
After processing every finding, record what the cleanup did (`metric:*` routes to the repo vault per the vault-routing rule):
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
mcp__muninn__muninn_remember({
|
|
70
|
+
vault: "<repo_vault>",
|
|
71
|
+
concept: "metric:shadow-debt-cleanup-<ISO timestamp>",
|
|
72
|
+
content: JSON.stringify({
|
|
73
|
+
scan_mode, total, fixed, kept, skipped, cleaned_at
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The `luca-shadow-scanner` already stores the raw scan counts under `metric:shadow-debt-scan-*`; this metric captures the action outcome (`fixed` / `kept` / `skipped`).
|
|
79
|
+
|
|
80
|
+
$ARGUMENTS
|