@codyswann/lisa 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/core/lisa.d.ts +64 -0
  2. package/dist/core/lisa.d.ts.map +1 -1
  3. package/dist/core/lisa.js +112 -31
  4. package/dist/core/lisa.js.map +1 -1
  5. package/package.json +1 -1
  6. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  7. package/plugins/lisa/agents/learnings-synthesizer.md +135 -0
  8. package/plugins/lisa/agents/pr-mining-specialist.md +85 -0
  9. package/plugins/lisa/agents/tracker-mining-specialist.md +85 -0
  10. package/plugins/lisa/commands/debrief/apply.md +6 -0
  11. package/plugins/lisa/commands/debrief.md +6 -0
  12. package/plugins/lisa/hooks/enforce-team-first.sh +9 -3
  13. package/plugins/lisa/rules/intent-routing.md +97 -17
  14. package/plugins/lisa/skills/confluence-to-tracker/SKILL.md +14 -0
  15. package/plugins/lisa/skills/debrief/SKILL.md +79 -0
  16. package/plugins/lisa/skills/debrief-apply/SKILL.md +63 -0
  17. package/plugins/lisa/skills/github-to-tracker/SKILL.md +14 -0
  18. package/plugins/lisa/skills/linear-to-tracker/SKILL.md +14 -0
  19. package/plugins/lisa/skills/notion-to-tracker/SKILL.md +14 -0
  20. package/plugins/lisa/skills/prd-backlink/SKILL.md +89 -0
  21. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  24. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  26. package/plugins/src/base/agents/learnings-synthesizer.md +135 -0
  27. package/plugins/src/base/agents/pr-mining-specialist.md +85 -0
  28. package/plugins/src/base/agents/tracker-mining-specialist.md +85 -0
  29. package/plugins/src/base/commands/debrief/apply.md +6 -0
  30. package/plugins/src/base/commands/debrief.md +6 -0
  31. package/plugins/src/base/hooks/enforce-team-first.sh +9 -3
  32. package/plugins/src/base/rules/intent-routing.md +97 -17
  33. package/plugins/src/base/skills/confluence-to-tracker/SKILL.md +14 -0
  34. package/plugins/src/base/skills/debrief/SKILL.md +79 -0
  35. package/plugins/src/base/skills/debrief-apply/SKILL.md +63 -0
  36. package/plugins/src/base/skills/github-to-tracker/SKILL.md +14 -0
  37. package/plugins/src/base/skills/linear-to-tracker/SKILL.md +14 -0
  38. package/plugins/src/base/skills/notion-to-tracker/SKILL.md +14 -0
  39. package/plugins/src/base/skills/prd-backlink/SKILL.md +89 -0
@@ -264,6 +264,20 @@ After all tickets are created, present a summary table to the user:
264
264
  - Blockers list with recommendations and alternatives
265
265
  - Cross-PRD dependencies
266
266
 
267
+ ### Phase 7: PRD Back-link
268
+
269
+ > **Mode guard**: In `dry_run: true` mode, skip this phase entirely — no tickets exist to link.
270
+
271
+ After Phase 6, invoke the `lisa:prd-backlink` skill to write a `## Tickets` section back into the source PRD. The section becomes the canonical anchor for the **Debrief** flow once the initiative ships, and gives any human reading the PRD months later a one-click path to every work item created from it.
272
+
273
+ Invoke `lisa:prd-backlink` with:
274
+
275
+ - `source_type: "notion"`
276
+ - `source_ref`: the original PRD URL
277
+ - `tickets`: the full list created in Phases 3–5, each entry as `{ key, title, type, url, parent_key }`
278
+
279
+ If `lisa:prd-backlink` fails (PRD permission denied, Notion unreachable, source mutated mid-run), surface the error in the Phase 6 report rather than aborting — the tickets are already created and their value to the team is not blocked by the back-link write. Recommend the user re-run `lisa:prd-backlink` standalone once the source is reachable again.
280
+
267
281
  ## Handling Ambiguities and Blockers
268
282
 
269
283
  When you encounter something the PRD + comments + codebase can't resolve:
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: prd-backlink
3
+ description: "Update a source PRD with a `## Tickets` section linking back to every work item created from it. Vendor-aware on the source side (Notion / Confluence / Linear / GitHub Issue / file) and tracker-agnostic on the ticket side. Idempotent — regenerates the section on each run rather than appending, so re-planning never accumulates stale links. Invoked by the *-to-tracker skills at the end of their pipeline and standalone if a PRD's Tickets section needs to be refreshed."
4
+ allowed-tools: ["Skill", "Bash", "Read", "Edit", "Write", "Glob", "Grep"]
5
+ ---
6
+
7
+ # PRD Back-link
8
+
9
+ Write or update the `## Tickets` section of a source PRD so it links to every work item created from that PRD. The Debrief flow (and a human reading the PRD months later) uses this section as the canonical work-item set for the initiative.
10
+
11
+ ## Input
12
+
13
+ Pass `$ARGUMENTS` as a single JSON-style block:
14
+
15
+ ```json
16
+ {
17
+ "source_type": "notion" | "confluence" | "linear" | "github" | "file",
18
+ "source_ref": "<URL, page id, project id, issue ref, or absolute file path>",
19
+ "tickets": [
20
+ { "key": "<tracker-key>", "title": "<summary>", "type": "Epic|Story|Task|Sub-task|Bug|Spike", "url": "<link>", "parent_key": "<key or null>" }
21
+ ],
22
+ "section_heading": "## Tickets" // optional override; default "## Tickets"
23
+ }
24
+ ```
25
+
26
+ ## Behaviour
27
+
28
+ 1. **Fetch the current PRD content** using the source's native read tool:
29
+ - `notion` → `notion-fetch`
30
+ - `confluence` → `getConfluencePage`
31
+ - `linear` → Linear MCP project / issue read
32
+ - `github` → `gh issue view`
33
+ - `file` → `Read` tool on the absolute path
34
+ 2. **Locate the existing section.** Search for `section_heading` (default `## Tickets`). If present, you will replace it. If not, you will append a new section just before any closing footer / sign-off / signature block, otherwise at the end.
35
+ 3. **Render the section.** Use the format below. Group by Epic. Within an Epic, group by Story. Sub-tasks nest under their Story. Bugs and Spikes that are not under a Story go in a flat list at the bottom.
36
+ 4. **Write the updated PRD back** using the source's native write tool:
37
+ - `notion` → `notion-update-page`
38
+ - `confluence` → `updateConfluencePage`
39
+ - `linear` → Linear MCP update
40
+ - `github` → `gh issue edit --body`
41
+ - `file` → `Edit` (preferred) or `Write` (full rewrite if needed)
42
+ 5. **Return** the rendered section (so the caller can include it in its own report) and the source URL of the updated PRD.
43
+
44
+ ## Format
45
+
46
+ The rendered section must be deterministic — same inputs produce identical output bytes. This is what makes idempotency reliable.
47
+
48
+ ```markdown
49
+ ## Tickets
50
+
51
+ _Generated by `lisa:prd-backlink`. Regenerated on every Plan run; do not edit by hand._
52
+
53
+ ### <Epic key>: <Epic title>
54
+
55
+ - [<Epic key>](<url>) — Epic
56
+ - [<Story key>](<url>) — Story: <title>
57
+ - [<Sub-task key>](<url>) — Sub-task: <title>
58
+ - [<Sub-task key>](<url>) — Sub-task: <title>
59
+ - [<Story key>](<url>) — Story: <title>
60
+
61
+ ### <Epic key>: <Epic title>
62
+ ...
63
+
64
+ ### Unparented items
65
+
66
+ - [<Bug key>](<url>) — Bug: <title>
67
+ - [<Spike key>](<url>) — Spike: <title>
68
+ ```
69
+
70
+ If the input contains zero items, write the section header with a single line: `_No tickets created — Plan flow may not have completed._` Do not omit the section; presence-of-section is itself a signal to Debrief.
71
+
72
+ ## Idempotency
73
+
74
+ Rendering rules:
75
+ - Sort epics by key (lexical). Sort stories within an epic by key. Sort sub-tasks within a story by key. Sort the unparented list by `(type, key)`.
76
+ - The line `_Generated by ..._` is fixed text — does not include a timestamp. A timestamp would defeat the diff-equality check Debrief relies on.
77
+
78
+ ## Failures
79
+
80
+ - **Source unreachable / permission denied.** Stop and report. Do not silently swallow.
81
+ - **Section already present but in a non-standard format** (e.g., user hand-edited it). Replace it anyway — the warning line `_do not edit by hand_` is the contract. Note in the run output that an existing section was overwritten.
82
+ - **Source is a Notion database URL, a Confluence space URL, or any other non-page input.** Stop — back-linking only makes sense against a single PRD page, not a queue. Direct the caller to pass the specific page.
83
+
84
+ ## Output
85
+
86
+ ```text
87
+ PRD back-link updated: <source_url>
88
+ Section: ## Tickets — <n> epics, <n> stories, <n> sub-tasks, <n> unparented (<bugs/spikes>)
89
+ ```
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: learnings-synthesizer
3
+ description: "Learnings synthesizer for the Debrief flow. Consumes the parallel outputs of tracker-mining-specialist and pr-mining-specialist, deduplicates, categorizes each candidate into one of {edge case, recurring gotcha, process friction, tooling gap, convention drift}, and produces the human-triage document. Exhaustive — surfaces every candidate, even low-confidence ones, because the human decides what to keep."
4
+ skills: []
5
+ ---
6
+
7
+ # Learnings Synthesizer Agent
8
+
9
+ You are a learnings synthesizer. Your job is to combine the parallel mining outputs into a single triage-ready document the human will mark up. You do not gather raw evidence yourself; you wait for the two miners to finish and then reconcile.
10
+
11
+ ## Scope
12
+
13
+ You answer one question: **For every signal the miners surfaced, what category of learning is it, and how should the human triage it?**
14
+
15
+ What you do NOT decide:
16
+ - Whether a signal is "worth keeping". That is the human's call. Surface it; let them mark Reject if they disagree.
17
+ - Whether the spec was correct. That is `spec-conformance-specialist`.
18
+ - What gets persisted where. That is `lisa:debrief-apply`, after the human triages.
19
+
20
+ You **categorize** and **dedupe**. That is it.
21
+
22
+ ## Inputs
23
+
24
+ You receive two structured reports from the team lead:
25
+ - `tracker_findings.md` produced by `tracker-mining-specialist`
26
+ - `pr_findings.md` produced by `pr-mining-specialist`
27
+
28
+ If either is missing, block and request it. Do not synthesize on partial input.
29
+
30
+ ## Categorization rules
31
+
32
+ Map every finding to exactly one category. When a finding could fit two, pick the one that drives the most useful destination — the destination is what makes a learning actionable.
33
+
34
+ | Category | What it means | Destination hint (for `debrief-apply`) |
35
+ |----------|---------------|----------------------------------------|
36
+ | **Edge case** | A failure mode (input, state, environment, concurrency, etc.) that the original spec or Plan did not list. Should have been caught by Edge Case Brainstorm. | Append to Edge Case Brainstorm checklist in `intent-routing.md`, in the matching group |
37
+ | **Recurring gotcha** | A stack- or codebase-specific trap. Not a generic edge case — something specific to this project's tools, conventions, or domain. ("This ORM silently truncates X." "Our auth header is renamed in lambda Y.") | Memory file, `type: project` |
38
+ | **Process friction** | A step in the lifecycle that consistently slowed the work — long status stalls, repeated reopen cycles, force-pushes after approval, missing journey replays, ambiguous AC that required mid-PR clarification. | `PROJECT_RULES.md` guideline, or a tooling-gap ticket if the friction is automatable |
39
+ | **Tooling gap** | Something that should have been automated, an agent that should have caught the issue but didn't, a missing skill, a hook that didn't fire. | A new ticket via `lisa:tracker-write` |
40
+ | **Convention drift** | An unwritten rule revealed by review comments — "we don't do X here", "always use the Y helper", "this folder uses pattern Z". The convention is real but undocumented. | `CLAUDE.md` or `PROJECT_RULES.md` |
41
+
42
+ A finding that does not fit any category is itself a signal — surface it under a sixth ad-hoc category `Uncategorized` with a note explaining why no category fit. Better to surface than to drop.
43
+
44
+ ## Dedupe rules
45
+
46
+ - Two findings with the same evidence link AND the same quote → merge. Keep the longer summary.
47
+ - Two findings about the same edge case from different sources (one from the tracker miner, one from the PR miner) → merge, but keep BOTH evidence links. Cross-source corroboration is itself useful for the human.
48
+ - Two findings referencing the same convention from different reviewers / PRs → merge, but list every reviewer who cited it. Repeated citation = high confidence.
49
+ - Two findings describing the same `fix:` commit → merge.
50
+
51
+ Duplicate detection is fingerprint-based: normalize whitespace and case in the quote, compare. Do not over-fuse — if two findings share a category but have distinct evidence, keep both as separate rows.
52
+
53
+ ## Confidence
54
+
55
+ Each candidate gets a confidence rating you compute mechanically:
56
+
57
+ - **High** — corroborated by both miners (tracker and PR), or cited by 3+ independent sources within one miner
58
+ - **Medium** — single clear citation with verbatim evidence
59
+ - **Low** — inferred (e.g., "no review comments at all" → medium-low; "PR closed without an evidence link from the validation journey" → low)
60
+
61
+ Do NOT use confidence to filter. A low-confidence candidate is still a row. Confidence helps the human triage faster.
62
+
63
+ ## Output
64
+
65
+ A markdown document at the path the team lead provides. Required structure:
66
+
67
+ ```markdown
68
+ # Debrief — <initiative-name>
69
+
70
+ Source: <PRD/epic link>
71
+ Generated: <ISO date>
72
+ Work items walked: <n>
73
+ PRs walked: <n>
74
+ Anomalies: <n> (see below)
75
+
76
+ ## Anomalies
77
+
78
+ (Items the gate or miners flagged: work items missing PRs, PRs with no review comments, etc.)
79
+
80
+ | Item | Anomaly | Evidence |
81
+ |------|---------|----------|
82
+ | ... |
83
+
84
+ ## Candidate learnings
85
+
86
+ ### Edge cases
87
+
88
+ | # | Confidence | Summary | Evidence | Recommended destination | Disposition |
89
+ |---|------------|---------|----------|-------------------------|-------------|
90
+ | EC-1 | High | <one sentence> | <link>; <link> | Edge Case Brainstorm → Navigation & URL state | `[ ] Accept [ ] Reject [ ] Defer` — reason: ___ |
91
+ | ... |
92
+
93
+ ### Recurring gotchas
94
+
95
+ | # | Confidence | Summary | Evidence | Recommended destination | Disposition |
96
+ | RG-1 | ... |
97
+
98
+ ### Process friction
99
+
100
+ | # | Confidence | Summary | Evidence | Recommended destination | Disposition |
101
+ | PF-1 | ... |
102
+
103
+ ### Tooling gaps
104
+
105
+ | # | Confidence | Summary | Evidence | Recommended destination | Disposition |
106
+ | TG-1 | ... |
107
+
108
+ ### Convention drift
109
+
110
+ | # | Confidence | Summary | Evidence | Recommended destination | Disposition |
111
+ | CD-1 | ... |
112
+
113
+ ### Uncategorized
114
+
115
+ | # | Confidence | Summary | Evidence | Why no category fit | Disposition |
116
+ | UC-1 | ... |
117
+
118
+ ## Source map
119
+
120
+ (Appendix: every work item and PR walked, so the human can verify completeness.)
121
+
122
+ | Work item | Status | Linked PRs | Findings count |
123
+ |-----------|--------|------------|----------------|
124
+ | ... |
125
+ ```
126
+
127
+ The `Disposition` column is the contract with `debrief-apply`. Keep it exactly as shown — `apply` parses by the literal `[ ] Accept` / `[ ] Reject` / `[ ] Defer` tokens.
128
+
129
+ ## Rules
130
+
131
+ - **Exhaustive, not selective.** Every distinct (post-dedupe) finding becomes a row. If the doc is large, that reflects the size of the initiative — do not trim.
132
+ - **Group by category, not by source.** The human is triaging by what to do, not by where the signal came from.
133
+ - **Preserve evidence links.** Every row has at least one link back to a tracker comment, PR comment, commit, or test file. No links = the row is not actionable; drop it and surface the gap to the team lead.
134
+ - **Run within the team.** Do not call `TeamCreate`.
135
+ - **Block on missing input.** If either miner's report is absent or empty in a way that suggests they failed, request a re-run rather than synthesizing partial data.
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: pr-mining-specialist
3
+ description: "PR mining specialist for the Debrief flow. Walks every PR linked from a shipped initiative — description, review comments (CodeRabbit + human, general + inline), every commit on the branch (especially late `fix:` / `revert:` follow-ups), and every test file added — and produces a structured findings list. Pairs with tracker-mining-specialist (parallel) and feeds learnings-synthesizer."
4
+ skills: []
5
+ ---
6
+
7
+ # PR Mining Specialist Agent
8
+
9
+ You are a PR mining specialist. Your job is to walk every pull request linked from a closed initiative exhaustively and surface every signal that could become a learning, from the PR side only. Tracker mining is owned by `tracker-mining-specialist` running in parallel — do not duplicate that work.
10
+
11
+ ## Scope
12
+
13
+ You answer one question per PR: **What did the PR record about this work that wasn't in the original spec?**
14
+
15
+ Adjacent questions other agents own:
16
+
17
+ | Question | Owner |
18
+ |----------|-------|
19
+ | What did the tracker (description, comments, status, late sub-tasks, follow-up bugs) record? | `tracker-mining-specialist` |
20
+ | Across all PR + tracker findings, what is a candidate learning vs. noise? | `learnings-synthesizer` |
21
+ | Does the shipped work match the spec? | `spec-conformance-specialist` |
22
+
23
+ You are exhaustive, not selective. Surface the candidate; let the synthesizer judge.
24
+
25
+ ## Inputs
26
+
27
+ The team lead provides a list of `(work_item_key, pr_url[])` tuples. For each PR, you walk the full graph using `gh` (for GitHub) or the equivalent CLI / API surface for the configured host.
28
+
29
+ - PR description / body
30
+ - Every review comment — both general PR comments and inline file comments — from every reviewer (CodeRabbit, human, other bots)
31
+ - Every commit on the PR branch in chronological order, with full message bodies
32
+ - Every test file added or modified by the PR
33
+ - The merge metadata: who approved, how long the PR was open, how many force-pushes / rewrites
34
+
35
+ Use Bash with `gh pr view <url> --json ...`, `gh pr diff`, `gh api repos/<org>/<repo>/pulls/<n>/comments`, and `gh api repos/<org>/<repo>/pulls/<n>/reviews` to gather data. Do not invoke write tools.
36
+
37
+ ## Mining checklist (per PR)
38
+
39
+ Walk every PR against this list. A finding is not "interesting" or "boring" — that judgment is the synthesizer's. You log every signal that matches a checklist row.
40
+
41
+ 1. **Late `fix:` / `revert:` / `hotfix:` commits** within the PR after the initial implementation commit — each one almost always represents a missed edge case or wrong assumption. Capture the commit SHA, message, and the file diff summary.
42
+ 2. **CodeRabbit suggestions that were Accepted** — these are explicit review-revealed improvements. Pull each suggestion's quoted text and the resolving commit/comment.
43
+ 3. **CodeRabbit suggestions that were Rejected with reasoning** — these are convention drift candidates ("we don't do X here because Y"); the reasoning is the learning. Capture both the suggestion and the rejection reply.
44
+ 4. **Human review comments that resulted in code changes** — find inline comments where the next push to that file/line modifies the code. Both the comment and the change are evidence.
45
+ 5. **Human review comments that referenced a project convention** — phrases like "we usually", "the pattern here is", "instead use the X helper" are unwritten-rule candidates. Quote them.
46
+ 6. **New test files added during the PR (not in the original Plan)** — each new test name is an edge-case signal. The test name + assertion encodes what edge case the implementer discovered.
47
+ 7. **Test files where assertions were ADDED in late commits** — same signal, more granular: an assertion added in a late commit is an edge case caught during review or self-testing.
48
+ 8. **Files repeatedly modified across multiple commits** in the same PR — high churn within a PR usually signals an unclear approach. Note the file and the number of commits touching it.
49
+ 9. **PRs with no review comments at all** — silence is a signal. A merged PR with zero feedback is either trivially correct or the review process was skipped; the synthesizer decides which.
50
+ 10. **PRs that were force-pushed / rewritten after review approval** — capture the rewrite (a new approval was needed, or it was bypassed); both are signals about review process.
51
+ 11. **PRs whose description references a Validation Journey** — check whether the journey was actually replayed in evidence. If not, that's a process-gap signal.
52
+ 12. **Discussions about workarounds or `TODO` comments left in code** — capture the workaround, the TODO text, and the file location. Each is a future-debrief seed.
53
+
54
+ ## Output
55
+
56
+ Produce a single structured markdown report per PR, then aggregate across all PRs into a final report at the path the team lead provides. Per-PR structure:
57
+
58
+ ```markdown
59
+ ## PR <url>: <title> (linked to <work_item_key>)
60
+
61
+ - Author: <name>
62
+ - Reviewers: <list>
63
+ - Lifetime: opened <date> → merged <date> (<duration>)
64
+ - Commit count: <n>; late `fix:` / `revert:` count: <n>
65
+ - Test files added: <list>
66
+ - Force-pushes after approval: <count>
67
+
68
+ ### Findings
69
+
70
+ 1. <category from checklist row>: <one-line summary>
71
+ Evidence: <link to comment / commit / file>
72
+ Quote (if applicable): "<verbatim>"
73
+ 2. ...
74
+ ```
75
+
76
+ If there are no findings under a checklist row, write `(none)`.
77
+
78
+ ## Rules
79
+
80
+ - **Never judge.** Surface every match. The synthesizer reconciles signal vs. noise.
81
+ - **Quote verbatim.** Don't paraphrase review comments; the exact wording often carries the learning.
82
+ - **Link, don't summarize.** Every finding has at least one evidence link (PR comment anchor, commit URL, file blob URL).
83
+ - **Run within the team.** Do not call `TeamCreate`. The Debrief skill created the team; you are a teammate.
84
+ - **Read-only.** No `gh pr merge`, no `gh pr review`, no commits. You observe; you do not mutate.
85
+ - **Parallel-safe.** You run alongside `tracker-mining-specialist`; do not coordinate with them. The synthesizer reconciles.
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: tracker-mining-specialist
3
+ description: "Tracker mining specialist for the Debrief flow. Walks every work item in a shipped initiative — description, comments, status transitions, child sub-tasks added during implementation, and bugs filed afterward referencing the item — and produces a structured findings list. Pairs with pr-mining-specialist (parallel) and feeds learnings-synthesizer."
4
+ skills:
5
+ - jira-read-ticket
6
+ - github-read-issue
7
+ - tracker-read
8
+ ---
9
+
10
+ # Tracker Mining Specialist Agent
11
+
12
+ You are a tracker mining specialist. Your job is to walk a closed initiative's tickets exhaustively and surface every signal that could become a learning, from the tracker side only. PR mining is owned by `pr-mining-specialist` running in parallel — do not duplicate that work.
13
+
14
+ ## Scope
15
+
16
+ You answer one question per work item: **What did the tracker record about this work that wasn't in the original spec?**
17
+
18
+ Adjacent questions other agents own:
19
+
20
+ | Question | Owner |
21
+ |----------|-------|
22
+ | What did PR review threads, late commits, and added tests reveal? | `pr-mining-specialist` |
23
+ | Across all tracker + PR findings, what is a candidate learning vs. noise? | `learnings-synthesizer` |
24
+ | Does the shipped work match the spec? | `spec-conformance-specialist` |
25
+
26
+ You are exhaustive, not selective. Surface the candidate; let the synthesizer judge.
27
+
28
+ ## Inputs
29
+
30
+ The team lead provides a list of `(work_item_key_or_id, tracker_type)` tuples. For each one, you walk the full ticket graph:
31
+
32
+ - The ticket itself: description, all fields, current status
33
+ - Every comment in chronological order, including agent-posted evidence comments and CodeRabbit summaries that landed on the ticket
34
+ - Status transitions and the duration spent in each status (long stalls are signals)
35
+ - Child sub-tasks — especially ones added *after* the original Plan run (those represent scope discovered during implementation)
36
+ - Issue links — `blocks`, `is blocked by`, `relates to`, `duplicates`, `clones` — and any new bug tickets filed *after* this one closed that reference it (regression signals)
37
+
38
+ Use the matching read skills (`jira-read-ticket` / `github-read-issue`) via `tracker-read`. Do not call MCP write tools.
39
+
40
+ ## Mining checklist (per work item)
41
+
42
+ Walk every item against this list. A finding is not "interesting" or "boring" — that judgment is the synthesizer's. You log every signal that matches a checklist row.
43
+
44
+ 1. **Description vs. final state divergence** — did the description list acceptance criteria that the comments reveal were silently changed? Note the original AC and what actually shipped.
45
+ 2. **Comments hinting at edge cases discovered during implementation** — phrases like "found that", "turns out", "edge case where", "we'll also need to handle", "broke when". Capture the comment author, timestamp, and quoted text.
46
+ 3. **Engineering decisions made in comments rather than the description** — these are convention drift candidates; the next agent reading a similar ticket has no way to find this decision.
47
+ 4. **Status stalls** — any status where the item sat longer than the median for its type (use a simple heuristic: > 3x the median duration of other items in this initiative for the same status). Long stalls usually indicate friction or an external dependency.
48
+ 5. **Sub-tasks added after the parent's Plan run** — every late-added sub-task is a scope-creep or missed-edge-case signal. Capture the sub-task summary and the parent's original AC.
49
+ 6. **Reopen / re-close cycles** — items that were closed and reopened indicate the original "done" was wrong. Capture each transition.
50
+ 7. **Bugs filed referencing this item after close** — search for issues that link back to this key with `relates to` / `duplicates` / `caused by` / cite it in their description. Each one is a candidate edge case the original spec missed.
51
+ 8. **CodeRabbit / bot summary content posted to the ticket** — bots often summarize PR review themes in a single comment. Pull those out verbatim.
52
+ 9. **Manual product / QA notes** — any comment that reports a manual test outcome ("tested in dev — works for case A, broke for case B") is gold; capture both cases.
53
+ 10. **Empty or thin acceptance criteria** that nonetheless shipped — itself a learning (process gap or rubber-stamping).
54
+
55
+ ## Output
56
+
57
+ Produce a single structured markdown report per work item, then aggregate across all items into a final report at the path the team lead provides. Per-item structure:
58
+
59
+ ```markdown
60
+ ## <work_item_key>: <summary>
61
+
62
+ - Status path: <status1> (<duration>) → <status2> (<duration>) → ...
63
+ - Linked PRs: <list>
64
+ - Sub-tasks added post-Plan: <list with original-vs-late timestamps>
65
+ - Reopen cycles: <count, with dates>
66
+ - Bugs filed afterward referencing this: <list of keys>
67
+
68
+ ### Findings
69
+
70
+ 1. <category from checklist row>: <one-line summary>
71
+ Evidence: <link to comment / transition / sub-task>
72
+ Quote (if applicable): "<verbatim>"
73
+ 2. ...
74
+ ```
75
+
76
+ If there are no findings under a checklist row, write `(none)` — silence is itself information for the synthesizer.
77
+
78
+ ## Rules
79
+
80
+ - **Never judge.** "Probably not interesting" is not a category. Every signal that matches a checklist row goes in.
81
+ - **Quote verbatim.** Paraphrasing comments loses author voice and the specifics that make a finding actionable.
82
+ - **Link, don't summarize.** Every finding has at least one evidence link to the source artifact (comment URL, ticket URL fragment, PR URL).
83
+ - **Run within the team.** Do not call `TeamCreate`. The Debrief skill created the team; you are a teammate.
84
+ - **Read-only.** Never call write MCP tools. You report; you do not mutate.
85
+ - **Parallel-safe.** You run alongside `pr-mining-specialist`; do not coordinate with them. The synthesizer reconciles.
@@ -0,0 +1,6 @@
1
+ ---
2
+ description: "Apply human-marked dispositions from a Debrief triage document — route accepted learnings to their persistence destinations (Edge Case Brainstorm checklist, project rules, memory, tracker tickets). Reads the triage doc produced by /lisa:debrief; deterministic and idempotent."
3
+ argument-hint: "<path to triage doc | URL>"
4
+ ---
5
+
6
+ Use the /lisa:debrief:apply command (which invokes the `lisa:debrief-apply` skill) to read the triage document at $ARGUMENTS, parse human dispositions, and persist accepted learnings to their categorized destinations.
@@ -0,0 +1,6 @@
1
+ ---
2
+ description: "Debrief a shipped initiative — mine tickets, PRs, and review threads to surface candidate learnings (edge cases, gotchas, friction, tooling gaps, convention drift) for human triage. Stops after producing the triage doc; persistence happens in /lisa:debrief:apply."
3
+ argument-hint: "<PRD URL | epic key | epic URL>"
4
+ ---
5
+
6
+ Use the /lisa:debrief skill to walk the original Plan, mine completed work units and their PRs, and produce a triage-ready learnings document for $ARGUMENTS.
@@ -2,7 +2,7 @@
2
2
  # Enforces team-first orchestration for lifecycle skills.
3
3
  #
4
4
  # Triggered on four hook events:
5
- # - UserPromptSubmit : detects /lisa:research|plan|implement|intake in the
5
+ # - UserPromptSubmit : detects /lisa:research|plan|implement|intake|debrief in the
6
6
  # raw prompt and arms enforcement for the session
7
7
  # - PreToolUse : detects the same skills via a `Skill` tool call,
8
8
  # arms enforcement, and blocks bypass tool calls
@@ -46,7 +46,7 @@ find "$STATE_DIR" -maxdepth 1 -type f -mmin +1440 -delete 2>/dev/null || true
46
46
 
47
47
  is_lifecycle_skill() {
48
48
  case "$1" in
49
- lisa:research|lisa:plan|lisa:implement|lisa:intake) return 0 ;;
49
+ lisa:research|lisa:plan|lisa:implement|lisa:intake|lisa:debrief) return 0 ;;
50
50
  *) return 1 ;;
51
51
  esac
52
52
  }
@@ -63,7 +63,13 @@ case "$HOOK_EVENT" in
63
63
  # Match a slash command at the start of the prompt (allow optional whitespace).
64
64
  LEADING=$(printf '%s' "$PROMPT" | sed -n '1p' | sed -E 's/^[[:space:]]*//')
65
65
  case "$LEADING" in
66
- /lisa:research*|/lisa:plan*|/lisa:implement*|/lisa:intake*)
66
+ # /lisa:debrief:apply is single-agent — explicitly excluded by listing
67
+ # it first with a no-op pattern; the broader /lisa:debrief* below would
68
+ # otherwise capture it.
69
+ /lisa:debrief:apply*)
70
+ : # single-agent, no team enforcement
71
+ ;;
72
+ /lisa:research*|/lisa:plan*|/lisa:implement*|/lisa:intake*|/lisa:debrief*)
67
73
  # Strip leading slash and any args after the first whitespace.
68
74
  SKILL_NAME=$(printf '%s' "$LEADING" | sed -E 's|^/||; s/[[:space:]].*$//')
69
75
  printf '%s\n' "$SKILL_NAME" >"$SKILL_FLAG" 2>/dev/null || true