@gobing-ai/spur 0.3.41 → 0.3.43
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/.claude-plugin/marketplace.json +15 -0
- package/README.md +15 -1
- package/config/templates/AGENTS.md +5 -3
- package/config/workflows/task-pipeline.yaml +113 -12
- package/package.json +15 -12
- package/plugins/README.md +655 -0
- package/plugins/sp/README.md +621 -0
- package/plugins/sp/agents/expert-spur.md +109 -0
- package/plugins/sp/agents/super-coder.md +126 -0
- package/plugins/sp/agents/super-planner.md +283 -0
- package/plugins/sp/agents/super-reviewer.md +154 -0
- package/plugins/sp/commands/dev-arch.md +30 -0
- package/plugins/sp/commands/dev-brainstorm.md +40 -0
- package/plugins/sp/commands/dev-changelog.md +28 -0
- package/plugins/sp/commands/dev-daily.md +29 -0
- package/plugins/sp/commands/dev-debug.md +29 -0
- package/plugins/sp/commands/dev-dogfood.md +33 -0
- package/plugins/sp/commands/dev-featurechange.md +130 -0
- package/plugins/sp/commands/dev-find-conflict.md +51 -0
- package/plugins/sp/commands/dev-find-issue.md +76 -0
- package/plugins/sp/commands/dev-find-next.md +60 -0
- package/plugins/sp/commands/dev-fixall.md +33 -0
- package/plugins/sp/commands/dev-gitmsg.md +28 -0
- package/plugins/sp/commands/dev-gtd.md +97 -0
- package/plugins/sp/commands/dev-handover.md +26 -0
- package/plugins/sp/commands/dev-idea.md +50 -0
- package/plugins/sp/commands/dev-next.md +31 -0
- package/plugins/sp/commands/dev-parallel.md +30 -0
- package/plugins/sp/commands/dev-plan.md +46 -0
- package/plugins/sp/commands/dev-refine.md +48 -0
- package/plugins/sp/commands/dev-refineall.md +65 -0
- package/plugins/sp/commands/dev-refresh.md +32 -0
- package/plugins/sp/commands/dev-reverse.md +32 -0
- package/plugins/sp/commands/dev-review.md +31 -0
- package/plugins/sp/commands/dev-run.md +63 -0
- package/plugins/sp/commands/dev-runall.md +83 -0
- package/plugins/sp/commands/dev-simplify.md +39 -0
- package/plugins/sp/commands/dev-unit.md +29 -0
- package/plugins/sp/commands/dev-verify.md +48 -0
- package/plugins/sp/commands/dev-verifyall.md +72 -0
- package/plugins/sp/commands/dev-wrap.md +48 -0
- package/plugins/sp/commands/dev-wrapall.md +51 -0
- package/plugins/sp/commands/rule-add.md +18 -0
- package/plugins/sp/commands/rule-refine.md +18 -0
- package/plugins/sp/commands/rule-scan.md +18 -0
- package/plugins/sp/commands/spur-init.md +22 -0
- package/plugins/sp/commands/workflow-add.md +18 -0
- package/plugins/sp/commands/workflow-refine.md +18 -0
- package/plugins/sp/hooks/agent-hint.ts +60 -0
- package/plugins/sp/hooks/careful-guard.ts +147 -0
- package/plugins/sp/hooks/context-post-tool.ts +325 -0
- package/plugins/sp/hooks/context-session-start.ts +182 -0
- package/plugins/sp/hooks/context-session-stop.ts +95 -0
- package/plugins/sp/hooks/hooks.json +51 -0
- package/plugins/sp/hooks/pi/guard-extension.ts +341 -0
- package/plugins/sp/hooks/task-write-guard.ts +84 -0
- package/plugins/sp/plugin.json +8 -0
- package/plugins/sp/scripts/batch-preflight.ts +204 -0
- package/plugins/sp/scripts/daily-summary/daily-summary.ts +606 -0
- package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +363 -0
- package/plugins/sp/scripts/dogfood-testing/validate-report.ts +168 -0
- package/plugins/sp/scripts/feature-sync-bounded.ts +451 -0
- package/plugins/sp/scripts/stage-registry-adapter.ts +1341 -0
- package/plugins/sp/scripts/task-size-precheck.ts +202 -0
- package/plugins/sp/scripts/validate-commands.ts +651 -0
- package/plugins/sp/scripts/validate-flag-contracts.ts +875 -0
- package/plugins/sp/skills/brainstorm/SKILL.md +361 -0
- package/plugins/sp/skills/brainstorm/agents/openai.yaml +14 -0
- package/plugins/sp/skills/brainstorm/examples/ideation-example.md +209 -0
- package/plugins/sp/skills/brainstorm/metadata.openclaw +7 -0
- package/plugins/sp/skills/brainstorm/references/grilling-interview.md +68 -0
- package/plugins/sp/skills/brainstorm/references/workflows.md +255 -0
- package/plugins/sp/skills/branch-workflow/SKILL.md +109 -0
- package/plugins/sp/skills/branch-workflow/references/branch-lifecycle.md +69 -0
- package/plugins/sp/skills/branch-workflow/references/worktree-patterns.md +100 -0
- package/plugins/sp/skills/code-implementation/SKILL.md +203 -0
- package/plugins/sp/skills/code-implementation/references/debugging.md +64 -0
- package/plugins/sp/skills/code-implementation/references/implementation-patterns.md +113 -0
- package/plugins/sp/skills/code-improvement/SKILL.md +231 -0
- package/plugins/sp/skills/code-improvement/references/deepening-signals.md +205 -0
- package/plugins/sp/skills/code-review/SKILL.md +112 -0
- package/plugins/sp/skills/code-review/references/receiving-code-review.md +70 -0
- package/plugins/sp/skills/code-review/references/review-lenses.md +117 -0
- package/plugins/sp/skills/code-review/references/self-review-checklist.md +53 -0
- package/plugins/sp/skills/code-review/references/verification-before-completion.md +68 -0
- package/plugins/sp/skills/code-simplification/SKILL.md +225 -0
- package/plugins/sp/skills/code-testing/SKILL.md +108 -0
- package/plugins/sp/skills/code-testing/references/stacks/bun-ts.md +165 -0
- package/plugins/sp/skills/code-testing/references/stacks/go.md +88 -0
- package/plugins/sp/skills/code-testing/references/stacks/python.md +117 -0
- package/plugins/sp/skills/code-testing/references/test-loop-breaker.md +37 -0
- package/plugins/sp/skills/code-testing/references/test-output-discipline.md +52 -0
- package/plugins/sp/skills/code-testing/references/unit-testing.md +212 -0
- package/plugins/sp/skills/code-verification/SKILL.md +535 -0
- package/plugins/sp/skills/code-verification/references/code-improvement.md +39 -0
- package/plugins/sp/skills/code-verification/references/secu-review.md +94 -0
- package/plugins/sp/skills/code-verification/references/verdict-schema.md +141 -0
- package/plugins/sp/skills/conflict-finding/SKILL.md +254 -0
- package/plugins/sp/skills/conflict-finding/references/authority-resolution.md +258 -0
- package/plugins/sp/skills/conflict-finding/references/comparison-protocol.md +277 -0
- package/plugins/sp/skills/conflict-finding/references/finding-contract.md +346 -0
- package/plugins/sp/skills/conflict-finding/references/remediation-routing.md +276 -0
- package/plugins/sp/skills/daily-summary/SKILL.md +171 -0
- package/plugins/sp/skills/daily-summary/agents/openai.yaml +13 -0
- package/plugins/sp/skills/doc-evolve/SKILL.md +175 -0
- package/plugins/sp/skills/doc-evolve/references/operations.md +93 -0
- package/plugins/sp/skills/dogfood-testing/SKILL.md +608 -0
- package/plugins/sp/skills/dogfood-testing/references/monitor-ledger.md +211 -0
- package/plugins/sp/skills/dogfood-testing/references/report-template.md +351 -0
- package/plugins/sp/skills/doubt-driven-development/SKILL.md +136 -0
- package/plugins/sp/skills/functional-review/SKILL.md +364 -0
- package/plugins/sp/skills/functional-review/references/verdict-schema.md +133 -0
- package/plugins/sp/skills/indexed-context/SKILL.md +164 -0
- package/plugins/sp/skills/issue-finding/SKILL.md +442 -0
- package/plugins/sp/skills/issue-finding/agents/openai.yaml +15 -0
- package/plugins/sp/skills/issue-finding/examples/expected-findings.json +27 -0
- package/plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl +23 -0
- package/plugins/sp/skills/issue-finding/references/session-formats.md +151 -0
- package/plugins/sp/skills/next-feature/SKILL.md +125 -0
- package/plugins/sp/skills/next-feature/references/handoff-routing.md +92 -0
- package/plugins/sp/skills/next-feature/references/proposal-contract.md +49 -0
- package/plugins/sp/skills/next-feature/references/ranking-rubric.md +52 -0
- package/plugins/sp/skills/next-feature/references/signal-derivation.md +67 -0
- package/plugins/sp/skills/next-router/SKILL.md +181 -0
- package/plugins/sp/skills/next-router/references/messages.md +90 -0
- package/plugins/sp/skills/next-router/references/routing-table.md +216 -0
- package/plugins/sp/skills/parallel-execution/SKILL.md +148 -0
- package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +109 -0
- package/plugins/sp/skills/parallel-execution/references/fan-out-patterns.md +101 -0
- package/plugins/sp/skills/parallel-execution/references/result-synthesis.md +94 -0
- package/plugins/sp/skills/reverse-engineering/SKILL.md +375 -0
- package/plugins/sp/skills/reverse-engineering/agents/openai.yaml +18 -0
- package/plugins/sp/skills/source-driven-development/SKILL.md +124 -0
- package/plugins/sp/skills/spec-decomposition/SKILL.md +117 -0
- package/plugins/sp/skills/spec-decomposition/references/decomposition.md +539 -0
- package/plugins/sp/skills/spur-cli/SKILL.md +133 -0
- package/plugins/sp/skills/spur-cli/references/agent.md +179 -0
- package/plugins/sp/skills/spur-cli/references/features/acceptance-criteria.md +82 -0
- package/plugins/sp/skills/spur-cli/references/features/hierarchy-mece.md +177 -0
- package/plugins/sp/skills/spur-cli/references/features/roadmap-priority.md +84 -0
- package/plugins/sp/skills/spur-cli/references/features/verbs.md +122 -0
- package/plugins/sp/skills/spur-cli/references/features.md +234 -0
- package/plugins/sp/skills/spur-cli/references/init.md +119 -0
- package/plugins/sp/skills/spur-cli/references/message.md +98 -0
- package/plugins/sp/skills/spur-cli/references/rules/authoring-rules.md +212 -0
- package/plugins/sp/skills/spur-cli/references/rules/fine-tuning.md +148 -0
- package/plugins/sp/skills/spur-cli/references/rules/operations.md +228 -0
- package/plugins/sp/skills/spur-cli/references/rules/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/rules.md +209 -0
- package/plugins/sp/skills/spur-cli/references/serve.md +58 -0
- package/plugins/sp/skills/spur-cli/references/tasks/l3-guard-cheatsheet.md +98 -0
- package/plugins/sp/skills/spur-cli/references/tasks/section-editing.md +95 -0
- package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +361 -0
- package/plugins/sp/skills/spur-cli/references/tasks.md +280 -0
- package/plugins/sp/skills/spur-cli/references/team.md +133 -0
- package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +226 -0
- package/plugins/sp/skills/spur-cli/references/workflows/operations.md +211 -0
- package/plugins/sp/skills/spur-cli/references/workflows/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/workflows.md +355 -0
- package/plugins/sp/skills/spur-dev/SKILL.md +224 -0
- package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +196 -0
- package/plugins/sp/skills/spur-dev/references/cross-cutting.md +680 -0
- package/plugins/sp/skills/spur-dev/references/decision-brief.md +80 -0
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +546 -0
- package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +164 -0
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +790 -0
- package/plugins/sp/skills/spur-dev/references/execution-workflow.md +352 -0
- package/plugins/sp/skills/spur-dev/references/feature-link-helper.md +191 -0
- package/plugins/sp/skills/spur-dev/references/flag-glossary.md +417 -0
- package/plugins/sp/skills/spur-dev/references/gate-checklists.md +171 -0
- package/plugins/sp/skills/spur-dev/references/glossary.md +95 -0
- package/plugins/sp/skills/spur-dev/references/idea-evaluation.md +80 -0
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +120 -0
- package/plugins/sp/skills/spur-dev/references/planning-workflow.md +302 -0
- package/plugins/sp/skills/spur-dev/references/product-planning.md +206 -0
- package/plugins/sp/skills/spur-dev/references/section-batching.md +24 -0
- package/plugins/sp/skills/sys-architecture/SKILL.md +155 -0
- package/plugins/sp/skills/sys-architecture/references/decision-method.md +137 -0
- package/plugins/sp/skills/sys-architecture/references/upkeep-survey.md +75 -0
- package/plugins/sp/skills/sys-debugging/SKILL.md +228 -0
- package/plugins/sp/skills/sys-debugging/references/debugging-protocol.md +62 -0
- package/plugins/sp/skills/test-driven-development/SKILL.md +248 -0
- package/plugins/sp/skills/wayfinder/SKILL.md +292 -0
- package/spur.js +6035 -4963
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: indexed-context
|
|
3
|
+
description: "Cross-agent project intelligence: file index (anatomy), learnings, pitfalls, bug log, token ledger, and session memory under .spur/context/. Triggers: \"load project context\", \"new session\", \"unfamiliar codebase\", \"index this codebase\", \"codebase memory\", \"indexed context\", \"project intelligence\"."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
metadata:
|
|
6
|
+
author: spur
|
|
7
|
+
version: "1.0"
|
|
8
|
+
platforms: "claude-code,codex,openclaw,opencode,antigravity"
|
|
9
|
+
interactions:
|
|
10
|
+
- context-provider
|
|
11
|
+
- inversion
|
|
12
|
+
operations:
|
|
13
|
+
- load-context
|
|
14
|
+
- update-anatomy
|
|
15
|
+
- append-learning
|
|
16
|
+
- append-pitfall
|
|
17
|
+
- log-bug
|
|
18
|
+
- record-memory
|
|
19
|
+
openclaw:
|
|
20
|
+
emoji: "🧠"
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Indexed Context
|
|
24
|
+
|
|
25
|
+
`sp:indexed-context` provides **cross-session, cross-agent codebase intelligence** through six
|
|
26
|
+
data files under `.spur/context/`. It replaces OpenWolf's Claude Code-only protocol with a
|
|
27
|
+
portable, markdown-first approach that works on every target agent.
|
|
28
|
+
|
|
29
|
+
**One principle:** the agent accumulates knowledge in `.spur/context/` as it works, and checks
|
|
30
|
+
that knowledge before redundant work. The token ledger is the only file written automatically
|
|
31
|
+
(by hooks); the other five are skill-guided — the agent appends when it recognizes value.
|
|
32
|
+
|
|
33
|
+
## Data layer — `.spur/context/`
|
|
34
|
+
|
|
35
|
+
| File | Purpose | Who writes |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `anatomy.md` | File index — 2-3 line description + token estimate per file | Agent (skill-guided) |
|
|
38
|
+
| `learnings.md` | Project conventions, API quirks, decision rationale | Agent (skill-guided) |
|
|
39
|
+
| `pitfalls.md` | Do-Not-Repeat entries, dated | Agent (skill-guided) |
|
|
40
|
+
| `buglog.md` | Structured bug patterns (error, root cause, fix, tags) | Agent (skill-guided) |
|
|
41
|
+
| `memory.md` | Session log — milestones, decisions, outcomes | Agent (skill-guided) |
|
|
42
|
+
| `token-ledger.jsonl` | Per-event token tracking — append-only event stream | **Hooks (automatic)** |
|
|
43
|
+
|
|
44
|
+
All files are gitignored — they hold machine-generated state specific to your local working copy.
|
|
45
|
+
|
|
46
|
+
## When this skill activates
|
|
47
|
+
|
|
48
|
+
Activate `sp:indexed-context` when you need the **full protocol** — onboarding to a codebase,
|
|
49
|
+
starting a significant session, or wanting to understand what prior sessions learned. The
|
|
50
|
+
individual habits below also apply implicitly via `AGENTS.md`'s inline rules.
|
|
51
|
+
|
|
52
|
+
## Protocol — the 6 habits
|
|
53
|
+
|
|
54
|
+
### 1. Check anatomy before reading files
|
|
55
|
+
|
|
56
|
+
Before reading a file, check `.spur/context/anatomy.md`. If it has a sufficient description for
|
|
57
|
+
your task, **skip the full read** — save the tokens. Only read the full file if the description
|
|
58
|
+
is missing, stale, or insufficient for your current task.
|
|
59
|
+
|
|
60
|
+
**Anatomy entry format:**
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
### `path/to/file.ts`
|
|
64
|
+
Brief description (1-3 lines). Token estimate: NNN.
|
|
65
|
+
|
|
66
|
+
Key exports / responsibilities:
|
|
67
|
+
- exportName — what it does
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2. Check pitfalls before generating code
|
|
71
|
+
|
|
72
|
+
Before writing code, scan `.spur/context/pitfalls.md` for dated Do-Not-Repeat entries relevant to
|
|
73
|
+
the area you're touching. Avoid repeating known mistakes.
|
|
74
|
+
|
|
75
|
+
**Pitfall entry format:**
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
## Do-Not-Repeat: <short title>
|
|
79
|
+
|
|
80
|
+
- **Date:** YYYY-MM-DD
|
|
81
|
+
- **Mistake:** what went wrong
|
|
82
|
+
- **Fix:** what to do instead
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 3. Update anatomy on file changes
|
|
86
|
+
|
|
87
|
+
After **creating, deleting, or renaming** a file, update the `anatomy.md` entry:
|
|
88
|
+
|
|
89
|
+
- **Created:** add a new `### \`path\`` section with description + token estimate.
|
|
90
|
+
- **Deleted:** remove the entry.
|
|
91
|
+
- **Renamed:** move the entry to the new path.
|
|
92
|
+
|
|
93
|
+
### 4. Append learnings when you discover value
|
|
94
|
+
|
|
95
|
+
When you learn a **non-obvious** project convention, API quirk, or user correction, append to
|
|
96
|
+
`.spur/context/learnings.md`. Skip obvious things — the value is in the non-obvious.
|
|
97
|
+
|
|
98
|
+
**Learning entry format:**
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
## Learning: <short title>
|
|
102
|
+
|
|
103
|
+
- **Convention/quirk:** description
|
|
104
|
+
- **Why it matters:** rationale
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 5. Log bugs when you fix them
|
|
108
|
+
|
|
109
|
+
After encountering and fixing a bug, test failure, or error, append to both:
|
|
110
|
+
|
|
111
|
+
- `.spur/context/buglog.md` — structured entry for pattern matching.
|
|
112
|
+
- `.spur/context/pitfalls.md` — if it's a do-not-repeat lesson.
|
|
113
|
+
|
|
114
|
+
**Bug entry format:**
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
## bug-NNN: <error message>
|
|
118
|
+
|
|
119
|
+
- **Date:** YYYY-MM-DD
|
|
120
|
+
- **File:** `path/to/file`
|
|
121
|
+
- **Root cause:** why it broke
|
|
122
|
+
- **Fix:** what you changed
|
|
123
|
+
- **Tags:** relevant, keywords
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 6. Record memory at milestones
|
|
127
|
+
|
|
128
|
+
At the **end of significant work** (milestone, PR, session wrap-up), append to
|
|
129
|
+
`.spur/context/memory.md`:
|
|
130
|
+
|
|
131
|
+
```markdown
|
|
132
|
+
| HH:MM | description | file(s) | outcome | ~tokens |
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Token ledger — automatic via hooks
|
|
136
|
+
|
|
137
|
+
`token-ledger.jsonl` is written by hooks, not by the agent. One event per line.
|
|
138
|
+
|
|
139
|
+
**PostToolUse matcher:** `Bash|Grep|Glob|Read|Write|Edit` (plugin `hooks.json` +
|
|
140
|
+
`context-post-tool` allowlist). Unknown tools fail open (exit 0, no write). No `*` / MCP without
|
|
141
|
+
an explicit allowlist entry.
|
|
142
|
+
|
|
143
|
+
**Privacy:** store a short **summary** (truncated command / pattern / glob) — never full stdout or
|
|
144
|
+
env dumps. Token estimates for Bash/Grep/Glob use response size **after a 4 KiB cap** and secret
|
|
145
|
+
scrub; omit `tokens` when unknown (never `0`).
|
|
146
|
+
|
|
147
|
+
```jsonl
|
|
148
|
+
{"ts":"2026-07-09T14:23:01Z","session":"session-2026-07-09-1423","type":"session_start"}
|
|
149
|
+
{"ts":"2026-07-09T14:23:15Z","session":"session-2026-07-09-1423","type":"read","file":"src/dao.ts","tokens":648}
|
|
150
|
+
{"ts":"2026-07-09T14:24:00Z","session":"session-2026-07-09-1423","type":"write","file":"src/dao.ts","tokens":222,"action":"edit"}
|
|
151
|
+
{"ts":"2026-07-12T15:00:00Z","session":"session-2026-07-12-1500","type":"bash","summary":"ls -la","tokens":12}
|
|
152
|
+
{"ts":"2026-07-12T15:00:01Z","session":"session-2026-07-12-1500","type":"grep","summary":"/TODO/ src"}
|
|
153
|
+
{"ts":"2026-07-12T15:00:02Z","session":"session-2026-07-12-1500","type":"glob","summary":"**/*.test.ts"}
|
|
154
|
+
{"ts":"2026-07-09T14:30:00Z","session":"session-2026-07-09-1423","type":"session_end","totals":{"reads":5,"writes":19,"tokens":2783}}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Never edit `token-ledger.jsonl` by hand.** It feeds the Board **Observability → Tool Using** tab.
|
|
158
|
+
On agents without hook support, the ledger simply doesn't accumulate — graceful degradation.
|
|
159
|
+
|
|
160
|
+
## Graceful degradation
|
|
161
|
+
|
|
162
|
+
On an agent supporting hooks, the token ledger runs silently. On an agent that does NOT support
|
|
163
|
+
hooks, the agent can still read/write the other 5 files by skill guidance — it loses only the
|
|
164
|
+
automatic ledger. The intelligence layer is fully portable; the counting layer is best-effort.
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: issue-finding
|
|
3
|
+
description: "Analyze agent session logs, find performance bottlenecks, propose fixes, and generate a structured task file. Triggers: find issues, post-mortem, session review, topic focus."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
version: 1.1.0
|
|
6
|
+
metadata:
|
|
7
|
+
author: spur
|
|
8
|
+
platforms: "claude-code,codex,openclaw,opencode,antigravity,pi"
|
|
9
|
+
category: analysis-core
|
|
10
|
+
interactions:
|
|
11
|
+
- pipeline
|
|
12
|
+
- inversion
|
|
13
|
+
pipeline_steps:
|
|
14
|
+
- discover
|
|
15
|
+
- analyze
|
|
16
|
+
- identify
|
|
17
|
+
- propose
|
|
18
|
+
- generate
|
|
19
|
+
openclaw:
|
|
20
|
+
emoji: "🛡"
|
|
21
|
+
see_also:
|
|
22
|
+
- sp:dogfood-testing
|
|
23
|
+
- sp:spur-cli
|
|
24
|
+
- sp:code-testing
|
|
25
|
+
- sp:sys-debugging
|
|
26
|
+
- sp:spur-dev
|
|
27
|
+
- sp:daily-summary
|
|
28
|
+
- sp:reverse-engineering
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# sp:issue-finding — Session Log Issue Finder
|
|
32
|
+
|
|
33
|
+
Review agent session logs, identify performance bottlenecks and behavioral anti-patterns, propose
|
|
34
|
+
fixes, and generate a structured task file capturing findings for future execution.
|
|
35
|
+
|
|
36
|
+
This skill codifies the forensic session-log analysis performed after the J4 batch execution
|
|
37
|
+
(task 0379), making the process reusable for any set of agent sessions.
|
|
38
|
+
|
|
39
|
+
**Honesty contract:** install-time skill packaging works on all declared platforms. **Native
|
|
40
|
+
session forensics depth varies by agent** — OMP is the deepest documented adapter; other sources
|
|
41
|
+
are best-effort path discovery + format notes. Prefer `--sessions` when the default root is wrong.
|
|
42
|
+
See [references/session-formats.md](references/session-formats.md).
|
|
43
|
+
|
|
44
|
+
## When to Use
|
|
45
|
+
|
|
46
|
+
**Trigger phrases:** "find issues", "performance analysis", "session log review", "identify
|
|
47
|
+
bottlenecks", "post-mortem", "what went wrong", "why was this slow"
|
|
48
|
+
|
|
49
|
+
**Use PROACTIVELY after:**
|
|
50
|
+
|
|
51
|
+
- A batch task execution (`/sp:dev-runall`) that took longer than expected
|
|
52
|
+
- A pipeline run with excessive compactions, test runs, or guard failures
|
|
53
|
+
- Any agent session where the operator suspects inefficiency or waste
|
|
54
|
+
|
|
55
|
+
**Do NOT use for:**
|
|
56
|
+
|
|
57
|
+
- Debugging a specific runtime failure — use `sp:sys-debugging`
|
|
58
|
+
- Code review — use `sp:code-review` or `sp:code-verification`
|
|
59
|
+
- Daily activity reporting — use `sp:daily-summary`
|
|
60
|
+
- Implementing the fixes found — this skill only creates the task; use `/sp:dev-run` to execute it
|
|
61
|
+
|
|
62
|
+
## Arguments
|
|
63
|
+
|
|
64
|
+
| Argument | Description | Default |
|
|
65
|
+
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
|
|
66
|
+
| `[topic]` | Optional free-text focus or smart positional input (see below). Narrows IDENTIFY/PROPOSE/GENERATE; DISCOVER still inventories selected sessions. | (full taxonomy) |
|
|
67
|
+
| `--sessions <glob>` | Session JSONL file(s) or directory to analyze. When omitted, uses the most recent sessions for the resolved source + current project. | (most recent) |
|
|
68
|
+
| `--source <name>` | Session log source: `auto`, `omp`, `claude`, `codex`, `gemini`, `opencode`, `antigravity`, `openclaw`, `pi`. `auto` = cwd agent when known, else `omp` if present, else first existing default root. | `auto` |
|
|
69
|
+
| `--feature <id>` | Feature ID to link the generated task to (e.g., `H51`). | (none) |
|
|
70
|
+
| `--template <name>` | Task template: `meta` (multi-fix umbrella), `issue` (single finding), or `standard`. | `meta` |
|
|
71
|
+
| `--priority <P0\|P1\|P2\|P3>` | **Task** priority frontmatter (`spur task update --priority`). Not bottleneck severity. | `P2` |
|
|
72
|
+
| `--severity <S0\|S1\|S2>` | Minimum **bottleneck** severity to keep after ranking (S0 most severe). | (all) |
|
|
73
|
+
| `--category <list>` | Comma-separated bottleneck categories to keep (see IDENTIFY table ids). | `all` |
|
|
74
|
+
| `--since <iso>` / `--until <iso>` | Optional wall-clock bounds on session start times (when timestamps are available). | (none) |
|
|
75
|
+
| `--top <n>` | Cap the number of requirements / fixes written into the task. | (no cap) |
|
|
76
|
+
| `--min-cost <duration>` | Drop bottlenecks whose estimated waste is below this floor (e.g. `30m`, `2h`). Applied after severity ranking. | (none) |
|
|
77
|
+
| `--strict-topic` | When `[topic]` is set, drop off-topic bottlenecks even if they dominate wall time. | off |
|
|
78
|
+
| `--use-history` | Optionally import/analyze via `spur history` for token/cost aggregates; raw JSONL remains authoritative for tool-loop forensics. | off |
|
|
79
|
+
| `--no-task` | Markdown report to stdout only; do not create a task. | off |
|
|
80
|
+
| `--json` | JSON findings to stdout only; do not create a task. Mutually exclusive with default task creation. | off |
|
|
81
|
+
|
|
82
|
+
### Smart positional `[topic]`
|
|
83
|
+
|
|
84
|
+
| Input pattern | Detection | Behavior |
|
|
85
|
+
| ------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------ |
|
|
86
|
+
| Ends with `.jsonl`, or looks like a session path/glob (`~/.`, `sessions/`, `*`) | Session selector | Treat as `--sessions` (do not also require free-text topic) |
|
|
87
|
+
| Matches a known category id or phrase (`test-loop`, `guard`, `compaction`, …) | Category hint | Apply as `--category` filter (merge with explicit flag if both set) |
|
|
88
|
+
| Mentions a feature id pattern (`J4`, `H51`, …) or task WBS digits | Work-unit hint | Prefer sessions/subagents whose titles/paths correlate; still allow full inventory |
|
|
89
|
+
| Other plain text | Focus criteria | Filter/re-rank IDENTIFY + PROPOSE to issues matching the text (e.g. `"test-loop spinning on Run0376"`) |
|
|
90
|
+
| Empty | Full scan | Current default: all categories, all severities |
|
|
91
|
+
|
|
92
|
+
### Severity vs priority (do not conflate)
|
|
93
|
+
|
|
94
|
+
| Scale | Values | Meaning | Where it appears |
|
|
95
|
+
| ----------------------- | ---------- | -------------------------------------------- | ------------------------------------------- |
|
|
96
|
+
| **Bottleneck severity** | S0, S1, S2 | Estimated waste of the _finding_ | IDENTIFY ranking, JSON `severity`, Notes |
|
|
97
|
+
| **Task priority** | P0–P3 | Frontmatter priority of the _generated task_ | `--priority`, `spur task update --priority` |
|
|
98
|
+
|
|
99
|
+
Severity thresholds:
|
|
100
|
+
|
|
101
|
+
- **S0**: > 2h waste — must fix before next batch run
|
|
102
|
+
- **S1**: 30min–2h waste — should fix soon
|
|
103
|
+
- **S2**: < 30min waste — nice to fix
|
|
104
|
+
|
|
105
|
+
### Output mode matrix
|
|
106
|
+
|
|
107
|
+
| Flags | Create task | Stdout |
|
|
108
|
+
| ---------------------- | ----------- | --------------------- |
|
|
109
|
+
| (default) | yes | short summary + WBS |
|
|
110
|
+
| `--no-task` | no | markdown report |
|
|
111
|
+
| `--json` | no | JSON only |
|
|
112
|
+
| `--no-task` + `--json` | no | JSON only (json wins) |
|
|
113
|
+
|
|
114
|
+
Never invent a dual-write mode: either create a task **or** emit a report/JSON, not both.
|
|
115
|
+
|
|
116
|
+
## The 5-Phase Protocol
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
sessions (JSONL — source-dependent roots; see session-formats.md)
|
|
120
|
+
→ DISCOVER locate session logs; build session inventory with timestamps
|
|
121
|
+
→ ANALYZE extract metrics: tool calls, compactions, test runs, guard failures
|
|
122
|
+
→ IDENTIFY rank bottlenecks by time cost; filter by topic/category/severity
|
|
123
|
+
→ PROPOSE design fixes for in-scope root causes; estimate time savings
|
|
124
|
+
→ GENERATE create a structured task via `spur task create` (unless --no-task/--json)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Phase 1: DISCOVER — Session Inventory
|
|
128
|
+
|
|
129
|
+
**Goal:** Locate and catalog the session logs to analyze.
|
|
130
|
+
|
|
131
|
+
**Steps:**
|
|
132
|
+
|
|
133
|
+
1. Resolve `--source` (or `auto`) and default roots from
|
|
134
|
+
[references/session-formats.md](references/session-formats.md).
|
|
135
|
+
2. If `[topic]` or `--sessions` already selects paths, use those files.
|
|
136
|
+
3. Otherwise list the source root for the current project slug and take the most recent
|
|
137
|
+
timestamped session set (include subagent session files when the layout has them).
|
|
138
|
+
4. Apply `--since` / `--until` when session start timestamps are available.
|
|
139
|
+
5. Build a session inventory table:
|
|
140
|
+
|
|
141
|
+
| Session | File | Start Time | End Time | Duration |
|
|
142
|
+
| ------- | --------------------------- | ---------- | -------- | -------- |
|
|
143
|
+
| Main | `…/*.jsonl` | … | … | … |
|
|
144
|
+
| Run0376 | subdirectory / subagent log | … | … | … |
|
|
145
|
+
|
|
146
|
+
6. Compute total wall time across all sessions. State the resolved source and confidence
|
|
147
|
+
(High = known adapter + readable tool events; Medium = path found, format partial;
|
|
148
|
+
Low = operator-supplied paths only).
|
|
149
|
+
|
|
150
|
+
### Phase 2: ANALYZE — Metric Extraction
|
|
151
|
+
|
|
152
|
+
**Goal:** Extract quantitative metrics from each session's JSONL log.
|
|
153
|
+
|
|
154
|
+
**Portable signals to count** (map field names per source — see session-formats.md):
|
|
155
|
+
|
|
156
|
+
| Signal | Metric |
|
|
157
|
+
| --------------------------------------------------------------------- | -------------------------------- |
|
|
158
|
+
| Tool/function calls | Tool call count per tool name |
|
|
159
|
+
| Context compaction / summarize events | Compaction count |
|
|
160
|
+
| Bash/shell runs matching `bun test` / `vitest` / `pytest` / `go test` | Test run count |
|
|
161
|
+
| Bash/shell runs containing `spur` | Spur call count |
|
|
162
|
+
| Tool results mentioning `GuardDeniedError` | Guard failure count + transition |
|
|
163
|
+
| Tool results with `error` / `Error` | Error count |
|
|
164
|
+
| Identical command string repeated 3+ times | Loop candidate |
|
|
165
|
+
|
|
166
|
+
**Extraction approach:** read each JSONL file line-by-line; parse tool name + command inputs;
|
|
167
|
+
count identical commands for loop detection.
|
|
168
|
+
|
|
169
|
+
Produce per-session metrics (duration, tools, compactions, test runs, spur calls, guard failures,
|
|
170
|
+
key finding). Aggregate totals across sessions.
|
|
171
|
+
|
|
172
|
+
When `--use-history` is set, the **selected-file history bridge** supplies ETL aggregates for the
|
|
173
|
+
frozen session set (task 0507 R3):
|
|
174
|
+
|
|
175
|
+
1. **Freeze Phase 1's selected OMP JSONL files once** — the same inventory the raw analysis reads.
|
|
176
|
+
Discovery roots: the normal OMP session root (`~/.omp/agent/sessions/`) **and**
|
|
177
|
+
`.spur/run/<run-id>/agent-sessions/<omp-executor>/*.jsonl` for workflow subprocess sessions.
|
|
178
|
+
Never import a broad `.spur/run` scan and never run a full/source-root reconciliation here.
|
|
179
|
+
2. **Import each frozen file once, through the source-local CLI**, with single-file `force-file`
|
|
180
|
+
mode:
|
|
181
|
+
`bun run apps/cli/src/index.ts history import --source omp --file <absolute-file> --mode force-file --json`.
|
|
182
|
+
The importer derives the session key from the filename; use the same stem for analysis.
|
|
183
|
+
3. **Analyze scoped to that key**: `history analyze --session <filename-stem> --json`.
|
|
184
|
+
4. Use the artifact for the aggregates ETL can represent — tokens, cost, messages, tool calls,
|
|
185
|
+
loops, and assistant response duration. **Continue parsing the same raw files** for command text,
|
|
186
|
+
compactions, test/guard retries, tool execution duration/status/errors, and every other signal
|
|
187
|
+
the ETL does not carry.
|
|
188
|
+
|
|
189
|
+
ETL supplies normalized aggregates; it is **not** a substitute for raw tool-loop evidence. If an
|
|
190
|
+
import fails or the DB is empty, continue with raw logs and note that cost data is unavailable.
|
|
191
|
+
Before any ad-hoc verification SQL against `history_*` tables, follow the schema-first rule in
|
|
192
|
+
[references/session-formats.md](references/session-formats.md) — inspect the live schema once.
|
|
193
|
+
|
|
194
|
+
### Phase 3: IDENTIFY — Root Cause Ranking
|
|
195
|
+
|
|
196
|
+
**Goal:** Rank bottlenecks by estimated time cost; apply topic / category / severity filters.
|
|
197
|
+
|
|
198
|
+
**Bottleneck categories** (`--category` ids in parentheses):
|
|
199
|
+
|
|
200
|
+
| Category id | Detection signal | Time cost estimate |
|
|
201
|
+
| ----------------- | ------------------------------------------------------------------------- | ----------------------------- |
|
|
202
|
+
| `test-loop` | Same test command run 3+ times with no source edit between runs | (identical runs − 1) × ~2 min |
|
|
203
|
+
| `guard` | 3+ `spur task check` calls for the same task before pass | (extra checks) × ~3 min |
|
|
204
|
+
| `compaction` | Compactions > 5 per session | count × ~2.5 min |
|
|
205
|
+
| `section-write` | `spur task update --section` calls > 2× task count | (extra writes) × ~2 min |
|
|
206
|
+
| `git-red-herring` | `git stash` / `git branch` / `git diff` between test failures | ~5–20 min per incident |
|
|
207
|
+
| `verbose-output` | Unfiltered test output flooding (e.g. bare `tail` without failure filter) | per-run × ~1500 tokens |
|
|
208
|
+
|
|
209
|
+
**For each bottleneck found, record:**
|
|
210
|
+
|
|
211
|
+
1. **What happened** — counts and timestamps from the log
|
|
212
|
+
2. **Root cause** — missing guidance, missing protocol, etc.
|
|
213
|
+
3. **Evidence** — tool call counts, timestamps, error messages
|
|
214
|
+
4. **Time cost** — estimated wall-time waste
|
|
215
|
+
5. **Severity** — S0 / S1 / S2 from thresholds above
|
|
216
|
+
|
|
217
|
+
**Topic filtering:**
|
|
218
|
+
|
|
219
|
+
- With `[topic]` and without `--strict-topic`: keep matching bottlenecks; also keep non-matching
|
|
220
|
+
S0 findings (dominant wall-time waste) and annotate them as out-of-topic but severe.
|
|
221
|
+
- With `--strict-topic`: keep only topic-matching findings (after category/severity filters).
|
|
222
|
+
- Apply `--category`, `--severity`, `--min-cost`, and `--top` after ranking (in that order).
|
|
223
|
+
|
|
224
|
+
Also note **what worked well** so efficient patterns are preserved.
|
|
225
|
+
|
|
226
|
+
### Phase 4: PROPOSE — Fix Design
|
|
227
|
+
|
|
228
|
+
**Goal:** Design a concrete fix for each **in-scope** root cause.
|
|
229
|
+
|
|
230
|
+
**For each bottleneck, propose:**
|
|
231
|
+
|
|
232
|
+
1. **Fix description** — documentation, skill reference, pipeline comment, hook, etc.
|
|
233
|
+
2. **Target location** — exact file path
|
|
234
|
+
- Skill guidance: `skills/<skill-name>/SKILL.md` or `references/<name>.md`
|
|
235
|
+
- Pipeline comments: runtime workflow under `.spur/workflows/` (e.g. `task-pipeline.yaml`)
|
|
236
|
+
- CLI reference: `skills/spur-cli/references/tasks/…`
|
|
237
|
+
3. **Proposed content** — text or code block to add
|
|
238
|
+
4. **Expected impact** — estimated time saved per future run
|
|
239
|
+
5. **Acceptance criteria** — Gherkin scenario with measurable targets
|
|
240
|
+
|
|
241
|
+
Prefer **documentation/guidance** fixes unless the root cause is a code bug. Harness guards are
|
|
242
|
+
often correct — agents lack discoverable constraints until they hit them.
|
|
243
|
+
|
|
244
|
+
When the same anti-pattern appears across **≥2 independent sessions** (or the operator asks to
|
|
245
|
+
codify it), offer a handoff to **`/sp:rule-scan`** / rule authoring after GENERATE — do not invent
|
|
246
|
+
rules inside this skill.
|
|
247
|
+
|
|
248
|
+
### Phase 5: GENERATE — Task File Creation
|
|
249
|
+
|
|
250
|
+
**Goal:** Create a structured task via CLI-gated corpus writes (unless `--no-task` / `--json`).
|
|
251
|
+
|
|
252
|
+
**Task creation (correct CLI — do not invent flags):**
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
spur task create "Fix <context> performance bottlenecks: <top issues>" \
|
|
256
|
+
--template meta \
|
|
257
|
+
--feature <feature-id> \
|
|
258
|
+
--json
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Notes:
|
|
262
|
+
|
|
263
|
+
- Title is the **positional** argument (there is no `--name`).
|
|
264
|
+
- Template is space form `--template meta` (or `issue` / `standard`); never the dotted form.
|
|
265
|
+
- Priority is **not** available on create. After create:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
spur task update <wbs> --priority P2 --json
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
- If `--feature` was omitted at create time and the operator later supplies one:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
spur task update <wbs> --feature <feature-id> --json
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
- Single-finding tasks: prefer `--template issue` (aligned with `sp:sys-debugging`).
|
|
278
|
+
- Multi-requirement umbrella: keep `--template meta` (default).
|
|
279
|
+
|
|
280
|
+
**Section population** — write each section body to a temp file, then:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
# Body only — no same-level heading (section name is already the heading)
|
|
284
|
+
cat > /tmp/issue-bg.md << 'EOF'
|
|
285
|
+
The <context> completed with PASS verdicts, but took <X> hours — approximately Nx slower than
|
|
286
|
+
expected. Forensic analysis of <N> session logs identified <M> root causes...
|
|
287
|
+
EOF
|
|
288
|
+
spur task update <wbs> --section Background --from-file /tmp/issue-bg.md --json
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Required sections for a meta issue-finding task:**
|
|
292
|
+
|
|
293
|
+
| Section | Content |
|
|
294
|
+
| ------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
295
|
+
| Background | 2–3 paragraphs: what ran, duration, why slow, root-cause count, topic filter if any |
|
|
296
|
+
| Requirements | One `[ ] R<n>.` bullet per fix: trigger, fix, target file, measurable target |
|
|
297
|
+
| Acceptance Criteria | One Gherkin `Scenario:` per requirement with measurable thresholds |
|
|
298
|
+
| Q&A | 4–6 Q&A pairs: rationale, approach, hook vs guidance, savings, decomposition |
|
|
299
|
+
| Design | Per-fix evidence (counts, timestamps), fix content, target location |
|
|
300
|
+
| Plan | Ordered checkboxes referencing requirements |
|
|
301
|
+
| Notes | Root-cause analyses (RC1–RC*n*) with forensic evidence (meta template: **not** a Root Cause section) |
|
|
302
|
+
| References | Session JSONL paths, source/agent, guard `file:line`, pipeline YAML, commits |
|
|
303
|
+
|
|
304
|
+
**Section format rules** (from task 0379):
|
|
305
|
+
|
|
306
|
+
1. **Solution `file:line` citations**: repo-relative `file:line` (e.g. `apps/web/src/components/SupervisorTab.tsx:17-20`), never bare `:line` or bare filename without path.
|
|
307
|
+
2. **Review P1–P4 table**: if a Review section exists, include a markdown table with a cell matching
|
|
308
|
+
`/^\s*P[1-4]\s*$/` and a non-placeholder content cell.
|
|
309
|
+
3. **Meta template**: no `Root Cause` section — put analyses in `Notes`.
|
|
310
|
+
4. **Canonical sections only**: `Background`, `Requirements`, `Acceptance Criteria`, `Q&A`,
|
|
311
|
+
`Design`, `Plan`, `Solution`, `Root Cause`, `Testing`, `Review`, `References`, `History`, `Notes`.
|
|
312
|
+
5. **Section body**: body-only for `--section` (no duplicate heading).
|
|
313
|
+
6. **Batch writes**: write all section temps → apply all `spur task update --section` calls →
|
|
314
|
+
**one** `spur task check`. Never write-check-rewrite-check per section.
|
|
315
|
+
|
|
316
|
+
**Verification:**
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
spur task check <wbs> --json
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Must return `pass: true` with 0 errors. Warnings may be acceptable on meta tasks
|
|
323
|
+
(e.g. `prose-prerequisite-unlisted`, `uncovered-task-scenario`).
|
|
324
|
+
|
|
325
|
+
## Output
|
|
326
|
+
|
|
327
|
+
**Default:** A task file under the configured tasks folder (`docs/tasks/`, `docs/tasks3/`, …) with
|
|
328
|
+
WBS, optional feature link, and structured sections.
|
|
329
|
+
|
|
330
|
+
**With `--no-task`:** Markdown findings report on stdout.
|
|
331
|
+
|
|
332
|
+
**With `--json`:**
|
|
333
|
+
|
|
334
|
+
```json
|
|
335
|
+
{
|
|
336
|
+
"source": "omp",
|
|
337
|
+
"topic": "test-loop spinning",
|
|
338
|
+
"sessions": [{ "name": "...", "duration": 5.45, "tools": 307 }],
|
|
339
|
+
"bottlenecks": [
|
|
340
|
+
{ "id": "B1", "category": "test-loop", "severity": "S0", "timeCost": "4h" }
|
|
341
|
+
],
|
|
342
|
+
"fixes": [
|
|
343
|
+
{
|
|
344
|
+
"id": "R1",
|
|
345
|
+
"target": "sp:code-testing",
|
|
346
|
+
"content": "...",
|
|
347
|
+
"expectedSavings": "4h"
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
"task": null
|
|
351
|
+
}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
When a task was created (default mode), include `"task": { "wbs": "…", "file": "…", "status": "…" }`
|
|
355
|
+
in the short summary; JSON-only mode leaves `task` null.
|
|
356
|
+
|
|
357
|
+
## Integration
|
|
358
|
+
|
|
359
|
+
- **Session log parsing** — manual JSONL analysis (no required external analyzer script)
|
|
360
|
+
- **Multi-source roots / field maps** — [references/session-formats.md](references/session-formats.md)
|
|
361
|
+
- **Optional** `spur history import` / `analyze` when `--use-history`
|
|
362
|
+
- **`spur task create` / `update` / `check`** — CLI-gated corpus only (never direct-write task files)
|
|
363
|
+
|
|
364
|
+
## Required Permissions
|
|
365
|
+
|
|
366
|
+
| Capability | Purpose |
|
|
367
|
+
| --------------- | ------------------------------------- |
|
|
368
|
+
| `Read` | Session JSONL, skill/source files |
|
|
369
|
+
| `Grep` / `Glob` | Pattern search and session discovery |
|
|
370
|
+
| `Bash` | `spur task` / optional `spur history` |
|
|
371
|
+
| `Write` | Temp files for section bodies |
|
|
372
|
+
|
|
373
|
+
## Platform Notes
|
|
374
|
+
|
|
375
|
+
### Claude Code
|
|
376
|
+
|
|
377
|
+
- Invoke via `/sp:dev-find-issue …` or `Skill(skill="sp:issue-finding", args="…")`.
|
|
378
|
+
- Prefer structured tools for file discovery; parse JSONL with Read/Grep.
|
|
379
|
+
|
|
380
|
+
### Codex / OpenClaw / OpenCode / Antigravity / Pi
|
|
381
|
+
|
|
382
|
+
- Read this skill and follow the 5-phase protocol (slash commands may be adapted at install time).
|
|
383
|
+
- Prefer `rg` for scanning large JSONL; expand globs carefully.
|
|
384
|
+
- If the agent’s session root differs from the table in session-formats.md, require `--sessions`.
|
|
385
|
+
|
|
386
|
+
### Multi-agent reality
|
|
387
|
+
|
|
388
|
+
- Packaging is portable; **forensic fidelity is source-dependent**.
|
|
389
|
+
- When unsure of layout, ask once for a session path or use `--sessions` rather than guessing.
|
|
390
|
+
|
|
391
|
+
## Shipped command
|
|
392
|
+
|
|
393
|
+
### `/sp:dev-find-issue`
|
|
394
|
+
|
|
395
|
+
Thin wrapper: `Skill(skill="sp:issue-finding", args="$ARGUMENTS")`.
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
/sp:dev-find-issue
|
|
399
|
+
/sp:dev-find-issue "test-loop spinning"
|
|
400
|
+
/sp:dev-find-issue --sessions "~/.omp/agent/sessions/-xprojects-spur-new/2026-07-29T*" --feature H51
|
|
401
|
+
/sp:dev-find-issue "L3 guard format discovery" --source omp --severity S1 --priority P1
|
|
402
|
+
/sp:dev-find-issue --category test-loop,guard --no-task
|
|
403
|
+
/sp:dev-find-issue --json --source claude --since 2026-07-28
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
## Common rationalizations
|
|
407
|
+
|
|
408
|
+
| Rationalization | Reality |
|
|
409
|
+
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
410
|
+
| "Sessions are huge — I'll sample randomly." | Prefer signal Grep first, then deep-read hot regions. Random samples invent severity. |
|
|
411
|
+
| "I'll just write the task file with Write." | Corpus writes are CLI-gated (`spur task create` / `update`). Direct Write fails the harness contract. |
|
|
412
|
+
| "OMP format everywhere." | Only OMP is High-fidelity documented. Other sources need portable field maps + `--sessions` when roots differ. |
|
|
413
|
+
| "P0 severity means task priority P0." | Severity (S0–S2) ranks waste; `--priority` is separate task frontmatter (P0–P3). |
|
|
414
|
+
| "History import replaces JSONL forensics." | History gives token/cost aggregates; tool-loop loops still need raw session lines. |
|
|
415
|
+
|
|
416
|
+
## Red flags
|
|
417
|
+
|
|
418
|
+
- GENERATE recipes inventing a title flag, dotted template forms, or quoted dotted section flags.
|
|
419
|
+
- Claiming multi-agent forensics without stating source confidence (High/Medium/Low).
|
|
420
|
+
- Creating a task when `--no-task` or `--json` was requested.
|
|
421
|
+
- Skipping batch section writes + single `spur task check`.
|
|
422
|
+
- Emitting empty findings without inventorying sessions first.
|
|
423
|
+
|
|
424
|
+
## Dogfood / self-check fixture
|
|
425
|
+
|
|
426
|
+
A tiny synthetic OMP session lives under
|
|
427
|
+
[examples/session-test-loop.jsonl](examples/session-test-loop.jsonl) with expected categories in
|
|
428
|
+
[examples/expected-findings.json](examples/expected-findings.json). Use it to smoke-check IDENTIFY
|
|
429
|
+
without real operator logs:
|
|
430
|
+
|
|
431
|
+
```
|
|
432
|
+
/sp:dev-find-issue --sessions plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl --no-task
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
Expect at least the `test-loop` category (and whatever else the expected-findings file lists).
|
|
436
|
+
|
|
437
|
+
## Reference files
|
|
438
|
+
|
|
439
|
+
- **[references/session-formats.md](references/session-formats.md)** — multi-source roots, tool-call
|
|
440
|
+
field maps, OMP deep dive, history bridge
|
|
441
|
+
- **[examples/session-test-loop.jsonl](examples/session-test-loop.jsonl)** — synthetic OMP fixture
|
|
442
|
+
- **[examples/expected-findings.json](examples/expected-findings.json)** — fixture expectations
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: issue-finding
|
|
2
|
+
description: "Forensic analysis of coding-agent session logs — discover performance
|
|
3
|
+
bottlenecks and behavioral anti-patterns, rank root causes by time cost, propose
|
|
4
|
+
targeted fixes, and optionally create a structured spur task via CLI-gated writes.
|
|
5
|
+
Supports optional topic focus, multi-source session roots, and --no-task/--json report modes."
|
|
6
|
+
version: 1.1.0
|
|
7
|
+
icon: 🛡
|
|
8
|
+
category: debugging
|
|
9
|
+
tags:
|
|
10
|
+
- analysis-core
|
|
11
|
+
- issue-finding
|
|
12
|
+
- session-logs
|
|
13
|
+
- performance
|
|
14
|
+
- post-mortem
|
|
15
|
+
- bottlenecks
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fixture": "session-test-loop.jsonl",
|
|
3
|
+
"source": "omp",
|
|
4
|
+
"description": "Synthetic OMP session for dogfood/self-check of sp:issue-finding IDENTIFY signals.",
|
|
5
|
+
"expectedCategories": [
|
|
6
|
+
{
|
|
7
|
+
"id": "test-loop",
|
|
8
|
+
"minIdenticalCommandRuns": 3,
|
|
9
|
+
"commandContains": "bun test packages/app/tests/services/feature-check.test.ts",
|
|
10
|
+
"minSeverity": "S1"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "guard",
|
|
14
|
+
"minSpurTaskCheckRuns": 3,
|
|
15
|
+
"commandContains": "spur task check 0376"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "git-red-herring",
|
|
19
|
+
"commands": ["git stash", "git status && git diff"]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "compaction",
|
|
23
|
+
"minCompactions": 6
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"smokeCommand": "/sp:dev-find-issue --sessions plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl --no-task"
|
|
27
|
+
}
|