@jiroamato/pstack 0.0.0-stage → 0.16.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.
- package/LICENSE +21 -0
- package/README.md +79 -2
- package/bin/pstack.js +95 -0
- package/lib/install.js +121 -0
- package/lib/prompt.js +77 -0
- package/lib/targets.js +43 -0
- package/package.json +38 -5
- package/pstack/.claude-plugin/plugin.json +26 -0
- package/pstack/.codex-plugin/plugin.json +36 -0
- package/pstack/LICENSE +21 -0
- package/pstack/LICENSE-cursor-team-kit +21 -0
- package/pstack/NOTICE +8 -0
- package/pstack/README.md +307 -0
- package/pstack/agents/comment-sicko.md +34 -0
- package/pstack/agents/poteto-agent.md +10 -0
- package/pstack/automations/benny/FOR_AGENTS.md +92 -0
- package/pstack/automations/benny/README.md +28 -0
- package/pstack/automations/benny/skills/reproduce-and-fix-issues/SKILL.md +313 -0
- package/pstack/automations/benny/skills/reproduce-and-fix-issues/references/control-adapter.md +169 -0
- package/pstack/automations/benny/skills/reproduce-and-fix-issues/references/feature-map.example.md +205 -0
- package/pstack/automations/benny/skills/reproduce-and-fix-issues/references/verify-existing-fix.md +93 -0
- package/pstack/automations/benny/skills/setup-benny/SKILL.md +271 -0
- package/pstack/automations/benny/skills/triage-issue-reports/SKILL.md +240 -0
- package/pstack/automations/benny/skills/triage-issue-reports/references/routing.example.md +61 -0
- package/pstack/automations/benny/templates/configuration.example.yaml +84 -0
- package/pstack/automations/benny/templates/reproduce-automation-prompt.md +33 -0
- package/pstack/automations/benny/templates/triage-automation-prompt.md +39 -0
- package/pstack/codex/agents/comment-sicko.toml +36 -0
- package/pstack/codex/agents/poteto-agent.toml +11 -0
- package/pstack/docs/guide/01-setup.md +80 -0
- package/pstack/docs/guide/02-poteto-mode.md +131 -0
- package/pstack/docs/guide/03-understand.md +79 -0
- package/pstack/docs/guide/04-design.md +133 -0
- package/pstack/docs/guide/05-build-and-clean.md +83 -0
- package/pstack/docs/guide/06-verify-and-ship.md +130 -0
- package/pstack/docs/guide/07-overnight.md +120 -0
- package/pstack/docs/guide/08-principles.md +72 -0
- package/pstack/docs/guide/09-make-it-yours.md +100 -0
- package/pstack/docs/guide/10-recipes-and-pitfalls.md +156 -0
- package/pstack/docs/guide/README.md +38 -0
- package/pstack/skills/architect/SKILL.md +85 -0
- package/pstack/skills/architect/agents/openai.yaml +2 -0
- package/pstack/skills/architect/references/design-red-flags.md +57 -0
- package/pstack/skills/architect/references/rationale-template.md +35 -0
- package/pstack/skills/architect/references/runner-prompt.md +20 -0
- package/pstack/skills/arena/SKILL.md +75 -0
- package/pstack/skills/arena/agents/openai.yaml +2 -0
- package/pstack/skills/automate-me/SKILL.md +104 -0
- package/pstack/skills/automate-me/agents/openai.yaml +2 -0
- package/pstack/skills/benchmark-checklist/SKILL.md +39 -0
- package/pstack/skills/benchmark-checklist/agents/openai.yaml +2 -0
- package/pstack/skills/blast-radius/SKILL.md +52 -0
- package/pstack/skills/blast-radius/agents/openai.yaml +2 -0
- package/pstack/skills/bro/SKILL.md +7 -0
- package/pstack/skills/bro/agents/openai.yaml +2 -0
- package/pstack/skills/control-cli/SKILL.md +55 -0
- package/pstack/skills/control-cli/agents/openai.yaml +2 -0
- package/pstack/skills/control-ui/SKILL.md +72 -0
- package/pstack/skills/control-ui/agents/openai.yaml +2 -0
- package/pstack/skills/correct/SKILL.md +34 -0
- package/pstack/skills/correct/agents/openai.yaml +2 -0
- package/pstack/skills/create-verification-skill/SKILL.md +47 -0
- package/pstack/skills/create-verification-skill/agents/openai.yaml +2 -0
- package/pstack/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/pstack/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/pstack/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/pstack/skills/deslop/SKILL.md +30 -0
- package/pstack/skills/deslop/agents/openai.yaml +2 -0
- package/pstack/skills/figure-it-out/SKILL.md +55 -0
- package/pstack/skills/figure-it-out/agents/openai.yaml +2 -0
- package/pstack/skills/how/SKILL.md +58 -0
- package/pstack/skills/how/agents/openai.yaml +2 -0
- package/pstack/skills/how/references/explainer-prompt.md +55 -0
- package/pstack/skills/how/references/explorer-prompt.md +52 -0
- package/pstack/skills/interrogate/SKILL.md +111 -0
- package/pstack/skills/interrogate/agents/openai.yaml +2 -0
- package/pstack/skills/interrogate/references/code-quality-review.md +47 -0
- package/pstack/skills/interrogate/references/lead-judgment.md +58 -0
- package/pstack/skills/interrogate/references/reviewer-prompt.md +70 -0
- package/pstack/skills/interrogate/references/rubric.md +77 -0
- package/pstack/skills/kiss/SKILL.md +90 -0
- package/pstack/skills/kiss/agents/openai.yaml +2 -0
- package/pstack/skills/kiss/references/assess.md +110 -0
- package/pstack/skills/kiss/references/principles.md +138 -0
- package/pstack/skills/maintain-verification-skill/SKILL.md +41 -0
- package/pstack/skills/maintain-verification-skill/agents/openai.yaml +2 -0
- package/pstack/skills/make-bot-ui/SKILL.md +289 -0
- package/pstack/skills/make-bot-ui/agents/openai.yaml +2 -0
- package/pstack/skills/no-comments/SKILL.md +24 -0
- package/pstack/skills/no-comments/agents/openai.yaml +2 -0
- package/pstack/skills/poteto-help/SKILL.md +156 -0
- package/pstack/skills/poteto-help/agents/openai.yaml +2 -0
- package/pstack/skills/poteto-help/references/prompting.md +51 -0
- package/pstack/skills/poteto-help/references/recipes.md +47 -0
- package/pstack/skills/poteto-mode/SKILL.md +143 -0
- package/pstack/skills/poteto-mode/agents/openai.yaml +2 -0
- package/pstack/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/pstack/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/pstack/skills/poteto-mode/playbooks/autopilot-full.md +13 -0
- package/pstack/skills/poteto-mode/playbooks/autopilot-stack.md +16 -0
- package/pstack/skills/poteto-mode/playbooks/babysit.md +29 -0
- package/pstack/skills/poteto-mode/playbooks/bug-fix.md +15 -0
- package/pstack/skills/poteto-mode/playbooks/eval.md +25 -0
- package/pstack/skills/poteto-mode/playbooks/feature.md +21 -0
- package/pstack/skills/poteto-mode/playbooks/hillclimb.md +21 -0
- package/pstack/skills/poteto-mode/playbooks/investigation.md +14 -0
- package/pstack/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
- package/pstack/skills/poteto-mode/playbooks/opening-a-pr.md +38 -0
- package/pstack/skills/poteto-mode/playbooks/orchestrate.md +114 -0
- package/pstack/skills/poteto-mode/playbooks/pause-safely.md +10 -0
- package/pstack/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/pstack/skills/poteto-mode/playbooks/prototype.md +14 -0
- package/pstack/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/pstack/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/pstack/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/pstack/skills/poteto-mode/playbooks/shipping.md +17 -0
- package/pstack/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
- package/pstack/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/pstack/skills/poteto-mode/playbooks/worktree-cleanup.md +14 -0
- package/pstack/skills/poteto-mode/references/bugbot-triage.md +142 -0
- package/pstack/skills/poteto-mode/scripts/bootstrap.ts +62 -0
- package/pstack/skills/poteto-mode/scripts/bun.lock +67 -0
- package/pstack/skills/poteto-mode/scripts/check-plan.mjs +185 -0
- package/pstack/skills/poteto-mode/scripts/orch/orch.test.ts +634 -0
- package/pstack/skills/poteto-mode/scripts/orch/orch.ts +578 -0
- package/pstack/skills/poteto-mode/scripts/orch/store.ts +1607 -0
- package/pstack/skills/poteto-mode/scripts/package.json +16 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +118 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/github.test.ts +306 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/github.ts +699 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/policy.ts +832 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/types.ts +401 -0
- package/pstack/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
- package/pstack/skills/poteto-mode/scripts/worktree-audit.sh +92 -0
- package/pstack/skills/principle-attack-the-premise/SKILL.md +23 -0
- package/pstack/skills/principle-attack-the-premise/agents/openai.yaml +2 -0
- package/pstack/skills/principle-boundary-discipline/SKILL.md +34 -0
- package/pstack/skills/principle-boundary-discipline/agents/openai.yaml +2 -0
- package/pstack/skills/principle-build-the-lever/SKILL.md +23 -0
- package/pstack/skills/principle-build-the-lever/agents/openai.yaml +2 -0
- package/pstack/skills/principle-encode-lessons-in-structure/SKILL.md +31 -0
- package/pstack/skills/principle-encode-lessons-in-structure/agents/openai.yaml +2 -0
- package/pstack/skills/principle-exhaust-the-design-space/SKILL.md +21 -0
- package/pstack/skills/principle-exhaust-the-design-space/agents/openai.yaml +2 -0
- package/pstack/skills/principle-experience-first/SKILL.md +19 -0
- package/pstack/skills/principle-experience-first/agents/openai.yaml +2 -0
- package/pstack/skills/principle-explain-the-number/SKILL.md +23 -0
- package/pstack/skills/principle-explain-the-number/agents/openai.yaml +2 -0
- package/pstack/skills/principle-fix-root-causes/SKILL.md +23 -0
- package/pstack/skills/principle-fix-root-causes/agents/openai.yaml +2 -0
- package/pstack/skills/principle-foundational-thinking/SKILL.md +21 -0
- package/pstack/skills/principle-foundational-thinking/agents/openai.yaml +2 -0
- package/pstack/skills/principle-guard-the-context-window/SKILL.md +16 -0
- package/pstack/skills/principle-guard-the-context-window/agents/openai.yaml +2 -0
- package/pstack/skills/principle-laziness-protocol/SKILL.md +18 -0
- package/pstack/skills/principle-laziness-protocol/agents/openai.yaml +2 -0
- package/pstack/skills/principle-make-operations-idempotent/SKILL.md +24 -0
- package/pstack/skills/principle-make-operations-idempotent/agents/openai.yaml +2 -0
- package/pstack/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +22 -0
- package/pstack/skills/principle-migrate-callers-then-delete-legacy-apis/agents/openai.yaml +2 -0
- package/pstack/skills/principle-minimize-reader-load/SKILL.md +23 -0
- package/pstack/skills/principle-minimize-reader-load/agents/openai.yaml +2 -0
- package/pstack/skills/principle-model-the-domain/SKILL.md +26 -0
- package/pstack/skills/principle-model-the-domain/agents/openai.yaml +2 -0
- package/pstack/skills/principle-never-block-on-the-human/SKILL.md +20 -0
- package/pstack/skills/principle-never-block-on-the-human/agents/openai.yaml +2 -0
- package/pstack/skills/principle-outcome-oriented-execution/SKILL.md +21 -0
- package/pstack/skills/principle-outcome-oriented-execution/agents/openai.yaml +2 -0
- package/pstack/skills/principle-prove-it-works/SKILL.md +22 -0
- package/pstack/skills/principle-prove-it-works/agents/openai.yaml +2 -0
- package/pstack/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
- package/pstack/skills/principle-redesign-from-first-principles/agents/openai.yaml +2 -0
- package/pstack/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
- package/pstack/skills/principle-separate-before-serializing-shared-state/agents/openai.yaml +2 -0
- package/pstack/skills/principle-sequence-verifiable-units/SKILL.md +17 -0
- package/pstack/skills/principle-sequence-verifiable-units/agents/openai.yaml +2 -0
- package/pstack/skills/principle-subtract-before-you-add/SKILL.md +21 -0
- package/pstack/skills/principle-subtract-before-you-add/agents/openai.yaml +2 -0
- package/pstack/skills/principle-test-behavior-not-implementation/SKILL.md +25 -0
- package/pstack/skills/principle-test-behavior-not-implementation/agents/openai.yaml +2 -0
- package/pstack/skills/principle-type-system-discipline/SKILL.md +31 -0
- package/pstack/skills/principle-type-system-discipline/agents/openai.yaml +2 -0
- package/pstack/skills/pstack-harness/SKILL.md +67 -0
- package/pstack/skills/recall/SKILL.md +35 -0
- package/pstack/skills/recall/agents/openai.yaml +2 -0
- package/pstack/skills/reflect/SKILL.md +76 -0
- package/pstack/skills/reflect/agents/openai.yaml +2 -0
- package/pstack/skills/reflect/references/divergent-reviewer.md +43 -0
- package/pstack/skills/reflect/references/judgment-reviewer.md +42 -0
- package/pstack/skills/reflect/references/synthesizer.md +56 -0
- package/pstack/skills/reflect/references/tooling-reviewer.md +55 -0
- package/pstack/skills/setup-pstack/SKILL.md +110 -0
- package/pstack/skills/show-me-your-work/SKILL.md +82 -0
- package/pstack/skills/show-me-your-work/agents/openai.yaml +2 -0
- package/pstack/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/pstack/skills/show-me-your-work/scripts/log.sh +42 -0
- package/pstack/skills/swarm/SKILL.md +48 -0
- package/pstack/skills/swarm/agents/openai.yaml +2 -0
- package/pstack/skills/tdd/SKILL.md +44 -0
- package/pstack/skills/tdd/agents/openai.yaml +2 -0
- package/pstack/skills/teach/SKILL.md +21 -0
- package/pstack/skills/teach/agents/openai.yaml +2 -0
- package/pstack/skills/technical-writing/SKILL.md +106 -0
- package/pstack/skills/technical-writing/agents/openai.yaml +2 -0
- package/pstack/skills/typescript-best-practices/SKILL.md +31 -0
- package/pstack/skills/typescript-best-practices/agents/openai.yaml +2 -0
- package/pstack/skills/typescript-best-practices/references/patterns.md +324 -0
- package/pstack/skills/unslop/SKILL.md +67 -0
- package/pstack/skills/unslop/agents/openai.yaml +2 -0
- package/pstack/skills/why/SKILL.md +158 -0
- package/pstack/skills/why/agents/openai.yaml +2 -0
- package/pstack/skills/why/references/epistemics.md +144 -0
- package/pstack/skills/why/references/investigator-prompt.md +103 -0
- package/pstack/skills/why/references/source-playbook.md +17 -0
- package/pstack/skills/why/references/sources/code-archaeology.md +88 -0
- package/pstack/skills/why/references/sources/databricks.md +70 -0
- package/pstack/skills/why/references/sources/datadog.md +99 -0
- package/pstack/skills/why/references/sources/incident-postmortem.md +15 -0
- package/pstack/skills/why/references/sources/linear.md +48 -0
- package/pstack/skills/why/references/sources/notion.md +55 -0
- package/pstack/skills/why/references/sources/sentry.md +100 -0
- package/pstack/skills/why/references/sources/slack.md +54 -0
- package/pstack/skills/why/references/synthesizer-prompt.md +135 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Sentry Error History
|
|
2
|
+
|
|
3
|
+
## What this source contains
|
|
4
|
+
|
|
5
|
+
Sentry is the archive of things that went wrong. For defensive, corrective, or error-handling code, it often holds the direct motivation: the specific exceptions, stack traces, and frequencies that pushed someone to add a check, catch, retry, or fallback.
|
|
6
|
+
|
|
7
|
+
- **Issues.** Grouped errors with counts, first/last seen timestamps, affected releases, and comments
|
|
8
|
+
- **Events.** Individual error instances within an issue (stack traces, tags, user context)
|
|
9
|
+
- **Releases.** Deployment records with associated issues (useful for "which version fixed this?")
|
|
10
|
+
- **Replays.** Session recordings of user-facing errors (if enabled)
|
|
11
|
+
- **Profiles.** Performance profiling data (less useful for "why", more for "how slow")
|
|
12
|
+
- **Issue comments & assignments.** Sometimes contain engineer notes on root cause
|
|
13
|
+
|
|
14
|
+
The most valuable thing Sentry provides is **temporal correlation**: "issue X was created 2024-01-02, peaked at 500 events/day, stopped appearing after release v2.14.0 on 2024-01-15, the release that shipped the defensive check."
|
|
15
|
+
|
|
16
|
+
## How to search it
|
|
17
|
+
|
|
18
|
+
Use the Sentry MCP.
|
|
19
|
+
|
|
20
|
+
1. **Orient.** If you don't know the project slug and organization:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
find_organizations
|
|
24
|
+
find_projects
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
2. **Search for issues related to the target.**
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
search_issues (natural language, e.g., "errors in PaymentService timeout", "unhandled exceptions in uploadFile")
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Good query components: exception class names the target handles, the function or class name of the target, error message strings the target checks for, the file path of the target.
|
|
34
|
+
|
|
35
|
+
3. **Narrow by release and time window.**
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
search_issue_events (filter by release, time, environment, trace ID, tags)
|
|
39
|
+
get_issue_tag_values (for an issue, see distribution across versions, users, environments)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
For a suspected issue, check:
|
|
43
|
+
- **First seen.** When did the error start appearing?
|
|
44
|
+
- **Last seen.** When did it stop? Does it line up with the target's ship date?
|
|
45
|
+
- **Affected releases.** Which versions saw it? Which was the fix?
|
|
46
|
+
- **Frequency trajectory.** Did it spike, then get resolved?
|
|
47
|
+
|
|
48
|
+
4. **Pull the full event for context.**
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
get_sentry_resource (pass a Sentry URL or type+ID)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Does the stack trace pass through the target code? Do the tags and breadcrumbs match the conditions the target defends against?
|
|
55
|
+
|
|
56
|
+
5. **Check releases that landed near the target.**
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
find_releases (around the commit date of the target)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Cross-reference release version with the PR's merge date.
|
|
63
|
+
|
|
64
|
+
6. **Use Seer sparingly.**
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
analyze_issue_with_seer
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Seer produces AI root-cause analyses. Useful as a hypothesis generator, but treat them as inference, not authoritative. The actual events and stack traces are the primary evidence. Seer's narrative is secondary.
|
|
71
|
+
|
|
72
|
+
## What good evidence looks like here
|
|
73
|
+
|
|
74
|
+
- An issue whose **first seen** is shortly before the target's PR and **last seen** shortly after, suggesting the target addressed this error
|
|
75
|
+
- Stack traces that pass through or land on the target function, showing the exact failure mode being defended against
|
|
76
|
+
- A comment on the issue from the PR author describing the fix
|
|
77
|
+
- The target's PR description or commit message referencing a Sentry issue URL or ID
|
|
78
|
+
- An issue with high event counts that stops after the release containing the target
|
|
79
|
+
|
|
80
|
+
## Common pitfalls
|
|
81
|
+
|
|
82
|
+
- **Grouping drift.** Sentry groups errors by fingerprint. Refactors or renames can track the "same" error under a new issue ID. If an issue ends abruptly, the error may have just been regrouped. Check for new issues immediately after.
|
|
83
|
+
- **Release correlation is noisy.** A release contains many commits. An issue stopping at v2.14.0 doesn't prove the target fixed it. Another change in the same release might have. Cross-reference with the target's exact commit.
|
|
84
|
+
- **Silent fixes.** Sometimes the error stops because upstream changed, not because of the defensive code. The correlation suggests the fix. It doesn't prove authorship.
|
|
85
|
+
- **Resolved != fixed.** Issues can be marked "resolved" manually without any code change. Treat `resolved` as a human marker, not evidence that code fixed it.
|
|
86
|
+
- **Seer hallucinations.** Seer can generate confident-sounding explanations that aren't right. Fall back to the actual events, stack traces, and timestamps when making claims.
|
|
87
|
+
- **Sampling.** Some projects sample events aggressively. A low event count may just mean high sampling, not a rare error. If in doubt, note the gap.
|
|
88
|
+
|
|
89
|
+
## What to return
|
|
90
|
+
|
|
91
|
+
For each relevant issue:
|
|
92
|
+
- Issue ID and title
|
|
93
|
+
- Project and organization
|
|
94
|
+
- First seen / last seen timestamps
|
|
95
|
+
- Event count (and sampling rate if known)
|
|
96
|
+
- Affected releases
|
|
97
|
+
- A representative stack trace snippet showing relevance to the target (verbatim excerpt, not summary)
|
|
98
|
+
- First/last-seen correlation with the target's ship date
|
|
99
|
+
- Link to the issue
|
|
100
|
+
- Any author comments or resolution notes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Slack Conversations
|
|
2
|
+
|
|
3
|
+
## What this source contains
|
|
4
|
+
|
|
5
|
+
- Real-time discussions of problems and decisions
|
|
6
|
+
- Incident channels where fire-drill decisions were made
|
|
7
|
+
- Design discussion threads where tradeoffs were debated
|
|
8
|
+
- Questions answered by senior engineers that didn't make it into docs
|
|
9
|
+
- Post-merge discussions that explain why something was revisited
|
|
10
|
+
- DMs (usually not searchable, scope accordingly)
|
|
11
|
+
|
|
12
|
+
Slack is frequently where the *real* decisions got made, especially for smaller changes that didn't warrant a doc. It's also the most ephemeral source. Threads get deleted, channels get archived, and search quality degrades over time.
|
|
13
|
+
|
|
14
|
+
## How to search it
|
|
15
|
+
|
|
16
|
+
Slack MCP tools vary. Check which Slack MCP is available and inspect its tool schema first. It may require `mcp_auth`. If authentication fails, stop and report the gap.
|
|
17
|
+
|
|
18
|
+
1. **Author-bounded search.** Messages from the PR author around the PR merge date. Limits scope dramatically and often hits gold.
|
|
19
|
+
2. **Keyword search for the feature name and key symbols.** Include misspellings and casual phrasings.
|
|
20
|
+
3. **PR URL search.** Slack often links PRs when they're reviewed or discussed. Search for the PR URL (or just `/pull/<number>`).
|
|
21
|
+
4. **Error string search.** If the code handles a specific error, search for the error string. Incident threads often surface.
|
|
22
|
+
5. **Channel-scoped search.** Narrow to likely channels:
|
|
23
|
+
- `#eng-*`. Engineering discussions
|
|
24
|
+
- `#proj-*`. Project channels
|
|
25
|
+
- `#incident-*` / `#sev-*`. Incident channels
|
|
26
|
+
- Team-specific channels for the owning team
|
|
27
|
+
- Design review channels
|
|
28
|
+
6. **Thread traversal.** When you find a relevant message, fetch the whole thread. The decision often lives in the replies.
|
|
29
|
+
|
|
30
|
+
## What good evidence looks like here
|
|
31
|
+
|
|
32
|
+
- A thread where tradeoffs were explicitly debated ("I was going to use A but B is better because...")
|
|
33
|
+
- An incident channel message describing the bug the code prevents
|
|
34
|
+
- A question from a reviewer and an authoritative answer from the author or lead
|
|
35
|
+
- A reference to a meeting where a decision was made
|
|
36
|
+
- A message from a product manager or customer-facing engineer explaining a customer ask
|
|
37
|
+
|
|
38
|
+
## Common pitfalls
|
|
39
|
+
|
|
40
|
+
- **Channel archaeology limits.** Very old messages may be gone due to retention policies. If you can't find anything before a certain date, note the retention cliff.
|
|
41
|
+
- **Unsearched DMs.** Many decisions happen in DMs that aren't searchable. You'll miss them. That's a known limitation.
|
|
42
|
+
- **Speculative jokes as "decisions."** Slack is casual. "Lol just do the thing" isn't a decision, even if it preceded the commit. Look for considered discussion.
|
|
43
|
+
- **Context collapse in single messages.** Without the thread, a single message often reads differently than in context. Always fetch threads.
|
|
44
|
+
- **Auth failures.** If the MCP isn't authenticated, stop. Don't make up findings. Report that Slack wasn't searchable.
|
|
45
|
+
|
|
46
|
+
## What to return
|
|
47
|
+
|
|
48
|
+
For each relevant thread:
|
|
49
|
+
- Channel name
|
|
50
|
+
- Permalink or thread ID
|
|
51
|
+
- Participants
|
|
52
|
+
- Date range of the discussion
|
|
53
|
+
- The key quotes (verbatim) with attribution
|
|
54
|
+
- Context: what thread/incident/discussion this was part of
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Synthesizer Prompt Template
|
|
2
|
+
|
|
3
|
+
Build the synthesizer's prompt from this template. Fill in the placeholders.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are answering a "why" question about a piece of code by synthesizing findings from multiple investigators who searched different historical sources (source control, issue / ticket tracker, long-form documents, real-time team chat, infrastructure observability, error / exception tracking, product analytics warehouse, and code comments). Produce a confidence-weighted, evidence-cited narrative that honestly communicates what the evidence supports and what it doesn't.
|
|
8
|
+
|
|
9
|
+
## The Question
|
|
10
|
+
|
|
11
|
+
> {QUESTION}
|
|
12
|
+
|
|
13
|
+
## The Code Anchor
|
|
14
|
+
|
|
15
|
+
**Target files:** {FILES_WITH_LINE_RANGES}
|
|
16
|
+
|
|
17
|
+
**Key symbols:** {SYMBOLS}
|
|
18
|
+
|
|
19
|
+
## Investigator Findings
|
|
20
|
+
|
|
21
|
+
{ALL_INVESTIGATOR_FINDINGS}
|
|
22
|
+
|
|
23
|
+
## Sources That Weren't Searched
|
|
24
|
+
|
|
25
|
+
{SKIPPED_SOURCES_WITH_REASONS}
|
|
26
|
+
|
|
27
|
+
## Epistemics Framework
|
|
28
|
+
|
|
29
|
+
You MUST follow the framework in `references/epistemics.md`. Read it in full before writing the output. The key rules:
|
|
30
|
+
|
|
31
|
+
1. Every claim sits in one of these tiers: **Direct**, **Supported**, **Inferred**, **Speculative**, **Unknown**. The tier determines what section the claim goes in and how it's phrased.
|
|
32
|
+
2. Every Direct/Supported claim must have a citation (PR #, ticket ID, doc URL, chat permalink, commit hash, or file:line).
|
|
33
|
+
3. Inferred and Speculative claims must use hedged language ("appears to", "likely", "suggests", "one possibility is").
|
|
34
|
+
4. Never cite code as evidence for its own intent.
|
|
35
|
+
5. Gaps in the evidence must be documented. Don't fill them with plausible-sounding guesses.
|
|
36
|
+
6. If the user's question embedded a hypothesis, treat it as a candidate, not a conclusion. Check the evidence independently.
|
|
37
|
+
|
|
38
|
+
## Instructions
|
|
39
|
+
|
|
40
|
+
1. **Read all investigator findings.** They gathered raw evidence, not conclusions. You weigh it.
|
|
41
|
+
2. **Reconcile overlapping findings.** Multiple investigators may have cited the same PR, ticket, or doc. Merge into a single, authoritative reference.
|
|
42
|
+
3. **Identify contradictions.** If two items of evidence disagree, don't pick one. Surface both.
|
|
43
|
+
4. **Calibrate confidence.** For each claim, identify the evidence and the tier. State Direct claims plainly with a citation. Hedge Inferred claims and explain the inference. Mark Speculative claims explicitly. Put claims with no evidence in the gaps section.
|
|
44
|
+
5. **Verify citations by spot-checking.** You can read the codebase and call MCP tools to verify citations. Do not write files, commit, or modify external state. If you're uncertain a cited item exists or says what's claimed, check it. Don't propagate errors.
|
|
45
|
+
6. **Don't overreach.** The user will act on your output. Better to leave an open question open than to fill it with a confident-sounding guess.
|
|
46
|
+
|
|
47
|
+
## Output Format
|
|
48
|
+
|
|
49
|
+
Write the output for the user. Use this exact structure:
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### The Question
|
|
54
|
+
|
|
55
|
+
Restate the user's question in one or two sentences so the answer is anchored.
|
|
56
|
+
|
|
57
|
+
### The Code in Question
|
|
58
|
+
|
|
59
|
+
File paths, line ranges, key symbols. Two or three lines to orient a reader who lands here cold.
|
|
60
|
+
|
|
61
|
+
### What We Found
|
|
62
|
+
|
|
63
|
+
**Claims with direct evidence**, one per bullet. Quote or paraphrase the source and cite precisely. Format each finding like:
|
|
64
|
+
|
|
65
|
+
- **[Direct]** {Claim}. Source: [PR #123](url) / ticket ID / file:line. {Brief quote or paraphrase.}
|
|
66
|
+
- **[Supported]** {Claim}. Evidence: {list of items and what each contributes}.
|
|
67
|
+
|
|
68
|
+
Use `[Direct]` for single-source, explicit evidence. Use `[Supported]` when multiple indirect items converge on a conclusion.
|
|
69
|
+
|
|
70
|
+
### What We Can Reasonably Infer
|
|
71
|
+
|
|
72
|
+
**Claims that aren't explicitly stated anywhere but are well-supported by indirect evidence.** Make the inference chain visible: "Given A and B, it's likely that C." Use hedged language ("appears to", "likely", "suggests", "is consistent with"). Format:
|
|
73
|
+
|
|
74
|
+
- **[Inferred]** {Hedged claim}. Reasoning: {the specific evidence and the inference step}.
|
|
75
|
+
|
|
76
|
+
If there's nothing to infer, skip this section.
|
|
77
|
+
|
|
78
|
+
### Competing Hypotheses
|
|
79
|
+
|
|
80
|
+
**If the evidence fits multiple stories, present them.** Don't force a winner when the record doesn't support one. For each hypothesis:
|
|
81
|
+
|
|
82
|
+
- **Hypothesis:** {one-sentence statement}
|
|
83
|
+
- **Evidence for:** {specific items}
|
|
84
|
+
- **Evidence against or missing:** {what would need to be true but isn't, or what counter-signals exist}
|
|
85
|
+
|
|
86
|
+
Skip this section if there's a single clear answer.
|
|
87
|
+
|
|
88
|
+
### What We Don't Know
|
|
89
|
+
|
|
90
|
+
**Explicit gaps.** Things the user asked that the evidence didn't answer. Sources searched that came up empty. Sources that weren't searchable at all, such as a missing real-time team chat MCP.
|
|
91
|
+
|
|
92
|
+
Be specific. "We searched the issue tracker for [query1], [query2], [query3] and found no issue discussing the rate-limit threshold" is useful. "We don't know why" is not. Include:
|
|
93
|
+
|
|
94
|
+
- Specific questions that went unanswered
|
|
95
|
+
- Searches that returned nothing
|
|
96
|
+
- Sources that were unavailable (and why)
|
|
97
|
+
- People who would likely know but who you can't ask
|
|
98
|
+
|
|
99
|
+
### Sources Consulted
|
|
100
|
+
|
|
101
|
+
Bulleted list of what was actually searched, so the user can judge coverage and redirect. Format:
|
|
102
|
+
|
|
103
|
+
- **Source control history**: {file paths}, {number of commits reviewed}, PRs #{numbers}, and code comments searched. Or "Not searched. This should not happen because git and `gh` are always expected."
|
|
104
|
+
- **Issue / ticket tracker**: {ticket IDs and keyword searches}. Or "Not searched. No matching MCP available in this environment."
|
|
105
|
+
- **Long-form documents**: {page titles and search queries}. Or "Not searched. No matching MCP available in this environment."
|
|
106
|
+
- **Real-time team chat**: {channels searched, date ranges, queries}. Or "Not searched. No matching MCP available in this environment."
|
|
107
|
+
- **Infrastructure observability**: {dashboards, monitors, metrics, logs, traces, or incidents searched}. Or "Not searched. No matching MCP available in this environment."
|
|
108
|
+
- **Error / exception tracking**: {issues, events, or releases searched}. Or "Not searched. No matching MCP available in this environment."
|
|
109
|
+
- **Product analytics warehouse**: {fully-qualified tables queried, the time windows, and the numeric summaries (counts, percentiles, first/last-seen timestamps) that bore on the question}. Or "Not searched. No matching MCP available in this environment."
|
|
110
|
+
|
|
111
|
+
### Confidence Summary
|
|
112
|
+
|
|
113
|
+
One or two sentences summarizing your overall confidence. E.g.:
|
|
114
|
+
|
|
115
|
+
> "The core rationale (A) is well-supported by direct PR and ticket evidence. The specific threshold value (100) is inferred from the surrounding context but not explicitly documented. The question of whether this was driven by a customer request could not be answered. No relevant issue tracker or long-form doc content surfaced, and real-time team chat search was unavailable."
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Quality Check Before Returning
|
|
120
|
+
|
|
121
|
+
Before finalizing, review your output against this checklist:
|
|
122
|
+
|
|
123
|
+
1. Does every claim in "What We Found" have a citation? If not, add one or move the claim to "Inferred" or "Hypotheses."
|
|
124
|
+
2. Is the phrasing tier-appropriate? (Direct claims can use "because". Inferred claims cannot.)
|
|
125
|
+
3. Did you surface any contradictions you noticed, or did you quietly pick one?
|
|
126
|
+
4. Does the "What We Don't Know" section exist and name specific gaps? If it's empty or missing, be suspicious. Historical investigations almost always have gaps.
|
|
127
|
+
5. If the user embedded a hypothesis in their question, did you check it against the evidence rather than rubber-stamping it?
|
|
128
|
+
6. Did you cite any code as evidence for its own intent? Remove those. Code is mechanics, not motivation.
|
|
129
|
+
7. Is the overall tone calibrated? A confident-sounding answer with weak evidence is the exact failure mode this skill exists to prevent.
|
|
130
|
+
|
|
131
|
+
If any item fails, revise before returning.
|
|
132
|
+
|
|
133
|
+
## A Final Note
|
|
134
|
+
|
|
135
|
+
The value of this output comes from its honesty, not its authority. A reader who takes your answer to the original author, an engineering lead, or a product manager should be well-positioned to ask the right follow-up questions. Be clear about what's known, what's inferred, and what's missing. Don't optimize for looking decisive. Optimize for being useful.
|