ramstack 0.1.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 (215) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/agents/comment-sicko.md +32 -0
  4. package/agents/poteto-agent.md +9 -0
  5. package/cli/rstack.mjs +539 -0
  6. package/package.json +29 -0
  7. package/skills/architect/README.md +25 -0
  8. package/skills/architect/SKILL.md +83 -0
  9. package/skills/architect/agents/openai.yaml +5 -0
  10. package/skills/architect/references/design-red-flags.md +33 -0
  11. package/skills/architect/references/rationale-template.md +35 -0
  12. package/skills/architect/references/runner-prompt.md +20 -0
  13. package/skills/arena/README.md +21 -0
  14. package/skills/arena/SKILL.md +71 -0
  15. package/skills/arena/agents/openai.yaml +5 -0
  16. package/skills/automate-me/README.md +21 -0
  17. package/skills/automate-me/SKILL.md +109 -0
  18. package/skills/automate-me/agents/openai.yaml +5 -0
  19. package/skills/blast-radius/README.md +21 -0
  20. package/skills/blast-radius/SKILL.md +50 -0
  21. package/skills/blast-radius/agents/openai.yaml +5 -0
  22. package/skills/bro/README.md +16 -0
  23. package/skills/bro/SKILL.md +7 -0
  24. package/skills/bro/agents/openai.yaml +5 -0
  25. package/skills/create-verification-skill/README.md +22 -0
  26. package/skills/create-verification-skill/SKILL.md +44 -0
  27. package/skills/create-verification-skill/agents/openai.yaml +5 -0
  28. package/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
  29. package/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
  30. package/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
  31. package/skills/figure-it-out/README.md +22 -0
  32. package/skills/figure-it-out/SKILL.md +55 -0
  33. package/skills/figure-it-out/agents/openai.yaml +5 -0
  34. package/skills/how/README.md +25 -0
  35. package/skills/how/SKILL.md +134 -0
  36. package/skills/how/agents/openai.yaml +3 -0
  37. package/skills/how/references/critic-prompt.md +59 -0
  38. package/skills/how/references/critique-rubric.md +58 -0
  39. package/skills/how/references/explainer-prompt.md +55 -0
  40. package/skills/how/references/explorer-prompt.md +52 -0
  41. package/skills/interrogate/README.md +21 -0
  42. package/skills/interrogate/SKILL.md +112 -0
  43. package/skills/interrogate/agents/openai.yaml +5 -0
  44. package/skills/interrogate/references/code-quality-review.md +47 -0
  45. package/skills/interrogate/references/lead-judgment.md +58 -0
  46. package/skills/interrogate/references/reviewer-prompt.md +72 -0
  47. package/skills/interrogate/references/rubric.md +77 -0
  48. package/skills/maintain-verification-skill/README.md +21 -0
  49. package/skills/maintain-verification-skill/SKILL.md +39 -0
  50. package/skills/maintain-verification-skill/agents/openai.yaml +5 -0
  51. package/skills/no-comments/README.md +22 -0
  52. package/skills/no-comments/SKILL.md +24 -0
  53. package/skills/no-comments/agents/openai.yaml +5 -0
  54. package/skills/poteto-mode/README.md +26 -0
  55. package/skills/poteto-mode/SKILL.md +140 -0
  56. package/skills/poteto-mode/agents/openai.yaml +5 -0
  57. package/skills/poteto-mode/playbooks/authoring-a-skill.md +13 -0
  58. package/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
  59. package/skills/poteto-mode/playbooks/autopilot-full.md +13 -0
  60. package/skills/poteto-mode/playbooks/autopilot-stack.md +16 -0
  61. package/skills/poteto-mode/playbooks/babysit.md +27 -0
  62. package/skills/poteto-mode/playbooks/bug-fix.md +17 -0
  63. package/skills/poteto-mode/playbooks/eval.md +27 -0
  64. package/skills/poteto-mode/playbooks/feature.md +21 -0
  65. package/skills/poteto-mode/playbooks/hillclimb.md +21 -0
  66. package/skills/poteto-mode/playbooks/investigation.md +14 -0
  67. package/skills/poteto-mode/playbooks/multi-phase-plan.md +3 -0
  68. package/skills/poteto-mode/playbooks/opening-a-pr.md +11 -0
  69. package/skills/poteto-mode/playbooks/orchestrate.md +113 -0
  70. package/skills/poteto-mode/playbooks/pause-safely.md +10 -0
  71. package/skills/poteto-mode/playbooks/perf-issue.md +24 -0
  72. package/skills/poteto-mode/playbooks/prototype.md +14 -0
  73. package/skills/poteto-mode/playbooks/refactoring.md +16 -0
  74. package/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
  75. package/skills/poteto-mode/playbooks/session-pickup.md +13 -0
  76. package/skills/poteto-mode/playbooks/shipping.md +20 -0
  77. package/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
  78. package/skills/poteto-mode/playbooks/visual-parity.md +11 -0
  79. package/skills/poteto-mode/playbooks/worktree-cleanup.md +14 -0
  80. package/skills/poteto-mode/references/bugbot-triage.md +142 -0
  81. package/skills/poteto-mode/references/plan.md +105 -0
  82. package/skills/poteto-mode/scripts/bootstrap.ts +62 -0
  83. package/skills/poteto-mode/scripts/bun.lock +67 -0
  84. package/skills/poteto-mode/scripts/orch/orch.test.ts +634 -0
  85. package/skills/poteto-mode/scripts/orch/orch.ts +578 -0
  86. package/skills/poteto-mode/scripts/orch/store.ts +1607 -0
  87. package/skills/poteto-mode/scripts/package.json +16 -0
  88. package/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
  89. package/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
  90. package/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +118 -0
  91. package/skills/poteto-mode/scripts/watch-pr/github.test.ts +306 -0
  92. package/skills/poteto-mode/scripts/watch-pr/github.ts +699 -0
  93. package/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
  94. package/skills/poteto-mode/scripts/watch-pr/policy.ts +832 -0
  95. package/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
  96. package/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
  97. package/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
  98. package/skills/poteto-mode/scripts/watch-pr/types.ts +401 -0
  99. package/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
  100. package/skills/poteto-mode/scripts/worktree-audit.sh +86 -0
  101. package/skills/principle-boundary-discipline/README.md +17 -0
  102. package/skills/principle-boundary-discipline/SKILL.md +34 -0
  103. package/skills/principle-boundary-discipline/agents/openai.yaml +5 -0
  104. package/skills/principle-build-the-lever/README.md +17 -0
  105. package/skills/principle-build-the-lever/SKILL.md +23 -0
  106. package/skills/principle-build-the-lever/agents/openai.yaml +5 -0
  107. package/skills/principle-encode-lessons-in-structure/README.md +17 -0
  108. package/skills/principle-encode-lessons-in-structure/SKILL.md +31 -0
  109. package/skills/principle-encode-lessons-in-structure/agents/openai.yaml +5 -0
  110. package/skills/principle-exhaust-the-design-space/README.md +17 -0
  111. package/skills/principle-exhaust-the-design-space/SKILL.md +21 -0
  112. package/skills/principle-exhaust-the-design-space/agents/openai.yaml +5 -0
  113. package/skills/principle-experience-first/README.md +17 -0
  114. package/skills/principle-experience-first/SKILL.md +19 -0
  115. package/skills/principle-experience-first/agents/openai.yaml +5 -0
  116. package/skills/principle-fix-root-causes/README.md +17 -0
  117. package/skills/principle-fix-root-causes/SKILL.md +23 -0
  118. package/skills/principle-fix-root-causes/agents/openai.yaml +5 -0
  119. package/skills/principle-foundational-thinking/README.md +17 -0
  120. package/skills/principle-foundational-thinking/SKILL.md +21 -0
  121. package/skills/principle-foundational-thinking/agents/openai.yaml +5 -0
  122. package/skills/principle-guard-the-context-window/README.md +17 -0
  123. package/skills/principle-guard-the-context-window/SKILL.md +17 -0
  124. package/skills/principle-guard-the-context-window/agents/openai.yaml +5 -0
  125. package/skills/principle-laziness-protocol/README.md +17 -0
  126. package/skills/principle-laziness-protocol/SKILL.md +18 -0
  127. package/skills/principle-laziness-protocol/agents/openai.yaml +5 -0
  128. package/skills/principle-make-operations-idempotent/README.md +17 -0
  129. package/skills/principle-make-operations-idempotent/SKILL.md +24 -0
  130. package/skills/principle-make-operations-idempotent/agents/openai.yaml +5 -0
  131. package/skills/principle-migrate-callers-then-delete-legacy-apis/README.md +17 -0
  132. package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +22 -0
  133. package/skills/principle-migrate-callers-then-delete-legacy-apis/agents/openai.yaml +5 -0
  134. package/skills/principle-minimize-reader-load/README.md +17 -0
  135. package/skills/principle-minimize-reader-load/SKILL.md +23 -0
  136. package/skills/principle-minimize-reader-load/agents/openai.yaml +5 -0
  137. package/skills/principle-model-the-domain/README.md +17 -0
  138. package/skills/principle-model-the-domain/SKILL.md +26 -0
  139. package/skills/principle-model-the-domain/agents/openai.yaml +5 -0
  140. package/skills/principle-never-block-on-the-human/README.md +16 -0
  141. package/skills/principle-never-block-on-the-human/SKILL.md +23 -0
  142. package/skills/principle-never-block-on-the-human/agents/openai.yaml +5 -0
  143. package/skills/principle-outcome-oriented-execution/README.md +16 -0
  144. package/skills/principle-outcome-oriented-execution/SKILL.md +22 -0
  145. package/skills/principle-outcome-oriented-execution/agents/openai.yaml +5 -0
  146. package/skills/principle-prove-it-works/README.md +18 -0
  147. package/skills/principle-prove-it-works/SKILL.md +33 -0
  148. package/skills/principle-prove-it-works/agents/openai.yaml +5 -0
  149. package/skills/principle-redesign-from-first-principles/README.md +16 -0
  150. package/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
  151. package/skills/principle-redesign-from-first-principles/agents/openai.yaml +5 -0
  152. package/skills/principle-separate-before-serializing-shared-state/README.md +16 -0
  153. package/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
  154. package/skills/principle-separate-before-serializing-shared-state/agents/openai.yaml +5 -0
  155. package/skills/principle-sequence-verifiable-units/README.md +18 -0
  156. package/skills/principle-sequence-verifiable-units/SKILL.md +22 -0
  157. package/skills/principle-sequence-verifiable-units/agents/openai.yaml +5 -0
  158. package/skills/principle-subtract-before-you-add/README.md +17 -0
  159. package/skills/principle-subtract-before-you-add/SKILL.md +22 -0
  160. package/skills/principle-subtract-before-you-add/agents/openai.yaml +5 -0
  161. package/skills/principle-type-system-discipline/README.md +19 -0
  162. package/skills/principle-type-system-discipline/SKILL.md +31 -0
  163. package/skills/principle-type-system-discipline/agents/openai.yaml +5 -0
  164. package/skills/recall/README.md +23 -0
  165. package/skills/recall/SKILL.md +35 -0
  166. package/skills/recall/agents/openai.yaml +5 -0
  167. package/skills/reflect/README.md +24 -0
  168. package/skills/reflect/SKILL.md +77 -0
  169. package/skills/reflect/agents/openai.yaml +5 -0
  170. package/skills/reflect/references/divergent-reviewer.md +43 -0
  171. package/skills/reflect/references/judgment-reviewer.md +42 -0
  172. package/skills/reflect/references/synthesizer.md +56 -0
  173. package/skills/reflect/references/tooling-reviewer.md +57 -0
  174. package/skills/setup-rstack/README.md +25 -0
  175. package/skills/setup-rstack/SKILL.md +81 -0
  176. package/skills/setup-rstack/agents/openai.yaml +3 -0
  177. package/skills/show-me-your-work/README.md +23 -0
  178. package/skills/show-me-your-work/SKILL.md +82 -0
  179. package/skills/show-me-your-work/agents/openai.yaml +5 -0
  180. package/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
  181. package/skills/show-me-your-work/scripts/log.sh +40 -0
  182. package/skills/swarm/README.md +21 -0
  183. package/skills/swarm/SKILL.md +46 -0
  184. package/skills/swarm/agents/openai.yaml +5 -0
  185. package/skills/tdd/README.md +21 -0
  186. package/skills/tdd/SKILL.md +44 -0
  187. package/skills/tdd/agents/openai.yaml +5 -0
  188. package/skills/teach/README.md +22 -0
  189. package/skills/teach/SKILL.md +21 -0
  190. package/skills/teach/agents/openai.yaml +5 -0
  191. package/skills/technical-writing/README.md +23 -0
  192. package/skills/technical-writing/SKILL.md +130 -0
  193. package/skills/technical-writing/agents/openai.yaml +5 -0
  194. package/skills/typescript-best-practices/README.md +22 -0
  195. package/skills/typescript-best-practices/SKILL.md +28 -0
  196. package/skills/typescript-best-practices/agents/openai.yaml +3 -0
  197. package/skills/typescript-best-practices/references/patterns.md +292 -0
  198. package/skills/unslop/README.md +21 -0
  199. package/skills/unslop/SKILL.md +80 -0
  200. package/skills/unslop/agents/openai.yaml +3 -0
  201. package/skills/why/README.md +26 -0
  202. package/skills/why/SKILL.md +229 -0
  203. package/skills/why/agents/openai.yaml +3 -0
  204. package/skills/why/references/epistemics.md +144 -0
  205. package/skills/why/references/investigator-prompt.md +103 -0
  206. package/skills/why/references/source-playbook.md +17 -0
  207. package/skills/why/references/sources/code-archaeology.md +88 -0
  208. package/skills/why/references/sources/databricks.md +70 -0
  209. package/skills/why/references/sources/datadog.md +99 -0
  210. package/skills/why/references/sources/incident-postmortem.md +15 -0
  211. package/skills/why/references/sources/linear.md +48 -0
  212. package/skills/why/references/sources/notion.md +55 -0
  213. package/skills/why/references/sources/sentry.md +100 -0
  214. package/skills/why/references/sources/slack.md +54 -0
  215. package/skills/why/references/synthesizer-prompt.md +135 -0
@@ -0,0 +1,17 @@
1
+ # Source playbooks
2
+
3
+ The why skill spawns one investigator per available evidence category, each reading a single source-specific playbook below. The playbooks are concrete examples for common MCPs; adapt them for a different MCP in the same category.
4
+
5
+ | Category | Playbook | Example MCP it documents |
6
+ |---|---|---|
7
+ | Source control history | [`code-archaeology.md`](./sources/code-archaeology.md) | git, `gh` |
8
+ | Issue / ticket tracker | [`linear.md`](./sources/linear.md) | Linear (adapt for Jira, GitHub Issues, Plane, Shortcut) |
9
+ | Long-form documents | [`notion.md`](./sources/notion.md) | Notion (adapt for Confluence, Google Docs, Coda) |
10
+ | Real-time team chat | [`slack.md`](./sources/slack.md) | Slack (adapt for Discord, Microsoft Teams, Mattermost) |
11
+ | Infrastructure observability | [`datadog.md`](./sources/datadog.md) | Datadog (adapt for New Relic, Honeycomb, Grafana, Splunk) |
12
+ | Error / exception tracking | [`sentry.md`](./sources/sentry.md) | Sentry (adapt for Rollbar, Bugsnag, Airbrake) |
13
+ | Product analytics warehouse | [`databricks.md`](./sources/databricks.md) | Databricks SQL (adapt for Snowflake, BigQuery, ClickHouse, dbt) |
14
+
15
+ Cross-cutting:
16
+
17
+ - [`incident-postmortem.md`](./sources/incident-postmortem.md). Add this if the target code looks defensive (null checks, retry, timeout, rate limit, feature flag, egress guard, OOM handler).
@@ -0,0 +1,88 @@
1
+ # Code Archaeology (git + in-repo)
2
+
3
+ ## What this source contains
4
+
5
+ - Commit history (messages, dates, authors, diffs)
6
+ - PR descriptions, review comments, and discussion threads (via `gh`)
7
+ - Inline code comments, TODOs, FIXMEs, deprecation notes
8
+ - ADRs (architectural decision records) if the repo keeps them
9
+ - Tests. Names and assertions often encode the edge cases that motivated a change
10
+ - Related files modified in the same commits (co-change signal)
11
+ - CHANGELOG entries, release notes in the repo
12
+ - Issue/ticket IDs mentioned in commit messages and PR bodies
13
+
14
+ The most trustworthy source, tied directly to the code, and the most complete. Everything that went through the repo should be here.
15
+
16
+ ## How to search it
17
+
18
+ Expand the seed commit list:
19
+
20
+ ```bash
21
+ # Full history of the file through renames
22
+ git log --follow --oneline -- <file>
23
+
24
+ # Pickaxe: commits that added or removed this exact text
25
+ git log -S '<exact_string_from_code>' -- <file>
26
+
27
+ # Or for patterns:
28
+ git log -G '<regex>' -- <file>
29
+
30
+ # Who wrote each line and when
31
+ git blame -L <start>,<end> <file>
32
+
33
+ # The full diff of a specific commit
34
+ git show <hash>
35
+
36
+ # Commits between two points affecting this file
37
+ git log <old>..<new> -p -- <file>
38
+ ```
39
+
40
+ For each substantive commit, pull the PR context:
41
+
42
+ ```bash
43
+ # Find the PR number from the merge commit or branch
44
+ git log -1 --format=%B <hash>
45
+
46
+ # Full PR context: body, review comments, linked issues
47
+ gh pr view <number> --json title,body,author,createdAt,mergedAt,labels,closingIssuesReferences,comments,reviews,files
48
+
49
+ # The --json reviews and comments fields are where the real signal is
50
+ ```
51
+
52
+ Look for out-of-band docs:
53
+
54
+ ```bash
55
+ # ADRs often live in docs/adr/ or similar
56
+ rg -l -i 'architecture.decision' --glob '*.md'
57
+
58
+ # TODOs and FIXMEs near the target
59
+ rg -n -C2 '(TODO|FIXME|HACK|XXX|NOTE)' <target_file>
60
+
61
+ # Related tests. Names often encode the "why"
62
+ rg -l '<symbol>' --glob '*test*'
63
+ ```
64
+
65
+ ## What good evidence looks like here
66
+
67
+ - A PR description that explains the problem being solved, not just the change ("This fixes the pagination bug that caused X")
68
+ - A long review thread where alternatives were debated
69
+ - An inline comment near the target line that explains a non-obvious constraint
70
+ - A test named `test_handles_edge_case_when_X` that reveals an edge case motivating the code
71
+ - A commit message that references a ticket or incident ID
72
+ - A CHANGELOG entry that summarizes the user-visible rationale
73
+
74
+ ## Common pitfalls
75
+
76
+ - **Squash-merge flatlands.** If the repo squashes PRs, individual commits in the branch history are lost. Fall back to PR body and comments.
77
+ - **Misleading commit messages.** "Small refactor" sometimes hides an intentional behavior change. Look at the diff, not the message.
78
+ - **Cargo-culted patterns.** The author may have copied a pattern without understanding why. Check if the pattern originated earlier in the codebase and investigate *that* commit.
79
+ - **Bot commits and auto-merges.** Dependabot, Renovate, and automated backports usually don't carry motivation. Skip them when trying to find intent.
80
+ - **Treating code as evidence of intent.** The code itself isn't evidence for why it exists. Evidence comes from commit messages, PRs, comments, tests, docs. Don't cite "the function is named X" as evidence of intent.
81
+
82
+ ## What to return
83
+
84
+ Every commit/PR/comment that bears on the question, with:
85
+ - The exact text (quoted)
86
+ - The hash / PR number / file:line
87
+ - Author and date
88
+ - Whether it's direct (explicitly addresses the question) or circumstantial
@@ -0,0 +1,70 @@
1
+ # Databricks Analytics & System Tables
2
+
3
+ ## What this source contains
4
+
5
+ Databricks is the product-analytics, data-pipeline, and warehouse-telemetry layer. It complements Datadog: Datadog is the *infra/runtime* view, Databricks is the *product/data* view (what users did, which experiments ran, how feature usage evolved, where a threshold constant came from).
6
+
7
+ - **Product analytics events.** `your_warehouse.events.analytics_track_event` (raw) and typed, deduplicated per-event dbt models in `<your_analytics_db>.<schema>.<table>`. User behavior: feature invocations, clicks, accepts/rejects, submissions, client-reported errors.
8
+ - **Usage & billing events.** `your_warehouse.events.usage_event` / `<your_analytics_db>.<schema>.stg_usage_events`; `your_warehouse.events.raw_model_event` / `<your_analytics_db>.<schema>.stg_raw_model_events`. For cost- or volume-driven decisions.
9
+ - **Experiment / feature-flag data.** Exposure and outcome tables. **Schema is company-specific.** Probe with `SHOW TABLES` before assuming names.
10
+ - **System tables.** `system.query.history`, `system.compute.warehouses`, `system.billing.*`, `system.access.audit`. Answer "was this query expensive?", "how often did anyone run this?", "when did warehouse load spike?"
11
+ - **dbt lineage.** Models in `<your_analytics_db>.<schema>` reveal what pipelines depend on a table/field; upstream changes frequently motivate consumer-code changes.
12
+ - **Databricks notebooks.** Exploratory analyses engineers wrote before code changes. **Not queryable via the SQL MCP.** If you suspect the rationale lives in a notebook, name it as a gap.
13
+
14
+ ## How to search it
15
+
16
+ Use the Databricks SQL MCP. Primary tool: `execute_sql_read_only`. If it returns a `statement_id`, poll with `poll_sql_result` rather than re-running.
17
+
18
+ **Orient before querying.** Schemas are company-specific; probe before trusting a table name:
19
+
20
+ ```sql
21
+ SHOW TABLES IN <your_analytics_db>.<schema> LIKE '*<keyword>*';
22
+ DESCRIBE TABLE <your_analytics_db>.<schema>.stg_<event>;
23
+ ```
24
+
25
+ **Time-bound every query.** These tables are huge and unconstrained scans time out. Filter on `_timestamp` (events) or `start_time` (`system.query.history`) with a window bracketing the ship date, typically ~30 days before and after, wider only for strong reason.
26
+
27
+ **Prefer typed dbt models over the raw table.** `<your_analytics_db>.<schema>.<table>` is deduplicated, typed, and liquid-clustered; `your_warehouse.events.analytics_track_event` has duplicates and untyped `properties_json`. Model-name pattern: `stg_<source>_<event_name_with_underscores>`, where `<source>` is `app`, `backend`, `website`, or `cli`; confirm the exact model name with `SHOW TABLES` when the pattern alone doesn't resolve it. Drop to the raw table only when there's no dbt model yet, or you need events from inside the dbt refresh lag.
28
+
29
+ **Column conventions on the typed dbt models** (knowing these avoids a `DESCRIBE` round-trip):
30
+
31
+ - `_timestamp`, `_id`, `_auth_id`, `_request_id`, `event_name`. Standard on every model
32
+ - `properties_<name>`. Typed, underscore-cased event properties (`properties_entrypoint`, `properties_size_bytes`, …)
33
+ - `context_team_id`, `context_client_version`, `context_country`, `context_client_os`. Pre-extracted client context
34
+
35
+ ### Investigation patterns that tend to pay off
36
+
37
+ Pick the table + column combination that matches the target:
38
+
39
+ 1. **Event usage trajectory.** Daily counts on the relevant `stg_*` model across a ±30d window around the PR merge. A step function from zero to steady volume within a day or two of the merge is strong circumstantial evidence the PR launched the feature. A decay to zero suggests a deprecation or deletion.
40
+ 2. **Guard-rail / defensive-check origin.** Distribution (median / p99 / max) of the relevant `properties_<name>` column in the 14 days *before* the PR. A p99 that matches the target's threshold constant suggests the number was chosen from data.
41
+ 3. **Experiment / feature-flag lookup.** `SHOW TABLES ... LIKE '*experiment*'` to find the exposure table, then pull exposure counts by variant for the relevant flag key near the PR date.
42
+ 4. **Query-history evidence for migrations, backfills, or perf rewrites.** `system.query.history` filtered by `statement_text ILIKE '%<table_or_symbol>%'` with a tight `start_time` window surfaces the expensive queries that likely motivated the change (sort by `total_duration_ms` or aggregate `SUM(read_bytes)`, `COUNT(*)`).
43
+ 5. **dbt lineage.** If the target reads from or writes into a `<your_analytics_db>.<schema>` model, the model's own git history (in this repo) often carries the rationale. Hand that lead back to the git investigator rather than chasing it yourself.
44
+
45
+ ## What good evidence looks like here
46
+
47
+ Beyond the pattern shapes above:
48
+
49
+ - An error-classifying event's count drops to near zero in the days after a defensive-code PR. Suggests the PR resolved that error class
50
+ - An exposure table row names the target's feature-flag key with a "shipped" / "concluded" decision around the PR ship date
51
+
52
+ ## Common pitfalls
53
+
54
+ - **Instrumented ≠ caused.** An event's existence means someone cared enough to log it, not that the target code exists *because* of it. Pair with a PR/commit citation from the git investigator before claiming causation.
55
+ - **Silent instrumentation changes.** A step function in event volume may mean a new event started being logged, not that user behavior changed. Check for instrumentation PRs in the same window before reading the ramp as a feature-launch signal.
56
+ - **Schema drift.** Event properties evolve; a column on the typed dbt model today may not have existed when the target was written. Older data may carry the property only inside raw `properties_json`.
57
+ - **dbt refresh lag.** `<your_analytics_db>.<schema>.*` is rebuilt on a schedule (often hourly/daily). For events from the last few hours, fall back to `your_warehouse.events.*` and deduplicate by `_id`.
58
+ - **Company-specific tables.** Experiment, feature-flag, billing, and usage tables vary. Reporting a result from a table whose existence you never confirmed is a classic failure mode. Probe with `SHOW TABLES` / `DESCRIBE TABLE` first.
59
+ - **Retention cliff.** If the relevant window predates the table's retention or the dbt model's creation date, that's a *gap*, not a null result. Name it explicitly so the synthesizer doesn't read "no results" as "no activity."
60
+ - **Notebooks aren't queryable.** The SQL MCP can't see Databricks notebooks. If you suspect the rationale lives in one, return a gap.
61
+
62
+ ## What to return
63
+
64
+ For each relevant finding:
65
+ - Type (product event / experiment exposure / usage or billing event / system-table row / dbt model)
66
+ - Fully-qualified table name and the exact query you ran
67
+ - Time window queried
68
+ - Compact numeric summary (counts, percentiles, first/last-seen timestamps). **Don't dump raw rows.**
69
+ - Temporal correlation with the target's ship date (e.g., "first row 2024-08-15; PR #49074 merged 2024-08-14")
70
+ - Relevance + strength: direct / circumstantial / weak
@@ -0,0 +1,99 @@
1
+ # Datadog Telemetry
2
+
3
+ ## What this source contains
4
+
5
+ Datadog holds the runtime record: what actually happened in production, as opposed to what was planned or discussed.
6
+
7
+ - **Metrics.** Counters, gauges, histograms instrumented by the team. A metric's *presence* is itself evidence: someone thought this number worth watching.
8
+ - **Monitors & alerts.** Conditions the team decided warranted waking someone up. A monitor firing on `rate_limit_hit > 10/min` is direct evidence the team worried about that threshold.
9
+ - **Dashboards.** Curated views. The charts tell you what the team considers important for a subsystem.
10
+ - **APM traces & spans.** Request-level runtime data. Useful for "why is this slow" / "why is there a timeout here" questions.
11
+ - **Logs.** High-volume event records. Often contain the error conditions that motivated defensive code.
12
+ - **Incidents.** Formal incident records with timelines and linked postmortems.
13
+ - **Notebooks.** Exploratory investigations; often contain hypotheses and analyses.
14
+
15
+ Datadog answers "what was the production reality around the time this code was written?", which often explains the code's shape.
16
+
17
+ ## How to search it
18
+
19
+ Use the Datadog MCP. Start broad, then narrow.
20
+
21
+ 1. **Identify the owning service(s).**
22
+
23
+ ```
24
+ search_datadog_services (filter by name or team)
25
+ search_datadog_service_dependencies (see upstream/downstream)
26
+ ```
27
+
28
+ 2. **Dashboards and monitors first. They tell you what the team cares about.**
29
+
30
+ ```
31
+ search_datadog_dashboards (query: feature name, service name, symbol)
32
+ search_datadog_monitors (same queries)
33
+ ```
34
+
35
+ When a dashboard or monitor covers the target, note its queries and watched thresholds. The threshold is frequently the answer to "why is this clamped at N?"
36
+
37
+ 3. **Metrics around the target.**
38
+
39
+ ```
40
+ search_datadog_metrics (by name pattern, e.g., the feature or symbol)
41
+ get_datadog_metric_context (metadata: description, units, tags)
42
+ get_datadog_metric (timeseries; "was there a spike around the PR date?")
43
+ ```
44
+
45
+ Correlating a metric's trajectory with the target's add/change date is strong supporting evidence: "the `payment_timeout` metric spiked 2023-11-03, and the retry logic merged 2023-11-06."
46
+
47
+ 4. **Logs. Narrow, don't dump.**
48
+
49
+ ```
50
+ search_datadog_logs (raw log patterns near the target, set use_log_patterns=true)
51
+ analyze_datadog_logs (SQL-style aggregations, only when you need counts)
52
+ ```
53
+
54
+ Search with symbols, error strings, or feature names. **Strongly prefer time-bounded queries** (e.g., 30 days before/after the change). Log volume is huge; unconstrained searches waste time and may time out.
55
+
56
+ 5. **APM spans and traces.**
57
+
58
+ ```
59
+ aggregate_spans (stats: "how often does this endpoint fail?")
60
+ search_datadog_spans (inspect individual spans)
61
+ get_datadog_trace (a specific trace ID)
62
+ ```
63
+
64
+ Useful for timeouts, retries, slow paths, and cross-service behavior.
65
+
66
+ 6. **Incidents.**
67
+
68
+ ```
69
+ search_datadog_incidents (by title, team, date range)
70
+ get_datadog_incident (full detail for a specific incident)
71
+ ```
72
+
73
+ If the target looks defensive, search for incidents around the time it was added. An incident whose timeline includes "added defensive check for X" is near-direct evidence.
74
+
75
+ ## What good evidence looks like here
76
+
77
+ - A monitor whose query and threshold match the constraint the code enforces (code clamps to 100; monitor alerts when requests exceed 100/min)
78
+ - A dashboard created by the target's author, with widgets that correspond to what the code measures or guards against
79
+ - A metric showing a production spike immediately before the code was merged, and stable values after
80
+ - An incident record referencing the target code, the same symbols, or the same error strings
81
+ - Logs showing a specific error pattern the defensive code would prevent, timestamped in the window before the change
82
+
83
+ ## Common pitfalls
84
+
85
+ - **Correlation is not causation.** A spike before a PR and stabilization after is suggestive, not definitive. Other changes may have landed in the same window. Check neighboring PRs.
86
+ - **Overfitting to the chart you found.** Datadog visualizations are *made* by humans and reflect that human's framing. A chart named "retry success rate" is evidence the team cared about retry success, not that it's why a specific line of code exists.
87
+ - **Vanished telemetry.** Metrics can be renamed, deleted, or have short retention. If you can't find data from the relevant window, that's a gap, not a null result.
88
+ - **Noise at scale.** Searching logs for a common string returns thousands of matches. Narrow by service, tag, and time aggressively. Use `analyze_datadog_logs` to aggregate rather than dumping raw logs.
89
+ - **Instrumented != caused.** A metric's existence tells you someone cared enough to measure something, not that the code was added *because* of it. Cross-reference with commit/PR dates.
90
+
91
+ ## What to return
92
+
93
+ For each relevant item:
94
+ - Type (dashboard / monitor / metric / log pattern / trace / incident / notebook)
95
+ - Title or name
96
+ - Link or identifier (dashboard ID, monitor ID, metric name, incident ID)
97
+ - Owner/author and created/modified date
98
+ - The specific condition, query, or quote that bears on the question (verbatim where possible)
99
+ - Relevance: what this suggests about the target code, and how strong the connection is
@@ -0,0 +1,15 @@
1
+ # Incident & Postmortem Context
2
+
3
+ Not a separate source, a **cross-cutting angle**. Incidents often motivate defensive code ("we added this check after the X outage"), so if the target looks defensive (null checks, retry logic, timeout handling, rate limiting, feature flags), specifically hunt for incident history across every available source:
4
+
5
+ - **Notion**: search for postmortems mentioning the target file, feature, or error string
6
+ - **Linear**: look for tickets labeled `incident`, `sev-*`, `postmortem-action-item`, `reliability`
7
+ - **Slack**: search `#sev-*` and `#incident-*` channels around the dates the target code was added
8
+ - **Git**: commits with messages like "fix for incident", "add defensive check", "revert" followed by "re-apply with..." are strong signals
9
+ - **Datadog**: `search_datadog_incidents` for formal incident records with timelines; dashboards and monitors created as postmortem action items
10
+ - **Sentry**: issues whose first-seen/last-seen window aligns with the target's PR ship date; stack traces through the target
11
+ - **Databricks**: product-analytics events that classify an error condition (client-reported failures, user-visible retry events, etc.) often spike during an incident window. A drop in that event count after the target PR ships is circumstantial support that the target code resolved the user-visible symptom, even when Datadog/Sentry signal is noisy.
12
+
13
+ If you find an incident link, fetch the full postmortem. Postmortems typically have an "Action Items" section that ties directly to code changes. When multiple sources corroborate (a Datadog incident ID appears in a Linear ticket, which appears in a Notion postmortem, which appears in a Slack thread that links to the target PR, and the Databricks error-event count drops after the fix), the evidence is especially strong.
14
+
15
+ Worth spending time on when the code's defensive character makes an incident-driven origin plausible. Skip it for code that doesn't look defensive.
@@ -0,0 +1,48 @@
1
+ # Linear Tickets
2
+
3
+ ## What this source contains
4
+
5
+ - Issues describing features, bugs, and their motivation
6
+ - Project docs attached to issues (often PRDs or specs)
7
+ - Parent/sub-issue relationships (broader initiative → specific tickets)
8
+ - Comments on issues (clarifications, scope changes, "why we're doing this" rationale)
9
+ - Labels (e.g., `compliance`, `customer-request`, `perf`) that signal the type of motivation
10
+ - Status updates that explain scope changes
11
+ - Attachments and linked GitHub PRs
12
+
13
+ Linear is where the product/business context often lives: the "we're doing this because customer X asked" or "this is for the Q3 compliance initiative" layer.
14
+
15
+ ## How to search it
16
+
17
+ Use the Linear MCP.
18
+
19
+ 1. **Start with linked tickets.** If the seed commits or PRs reference ticket IDs (e.g., `ENG-1234`, `[BUG-567]`), fetch those first with `get_issue`. Read the full issue including comments.
20
+ 2. **List related issues by keyword.** Use `list_issues` with text search for the feature name, key symbol, or business term. Try multiple phrasings.
21
+ 3. **Walk the issue tree.** If you land on a sub-issue, fetch its parent. Sub-issues are tactical; parents often carry the "why."
22
+ 4. **Read project docs.** If the issue belongs to a project, use `get_project` and check attached docs. Project-level documents are where specs and rationale are most often captured.
23
+ 5. **Check labels and milestones.** Labels hint at the category of motivation (customer-request, incident-followup, compliance). Milestones tie work to deadlines, which often reveal motivation.
24
+
25
+ ## What good evidence looks like here
26
+
27
+ - An issue description stating the business problem: "Customer Acme needs X because of their SOC2 audit"
28
+ - A comment recording a decision: "We decided to go with approach B because approach A would require touching the billing service"
29
+ - A parent issue titled like an initiative: "Q3 Enterprise Readiness" or "Reduce Payment Failures"
30
+ - An attached PRD or spec
31
+ - Labels like `customer:acme`, `incident-followup`, `compliance`, `perf-regression`
32
+
33
+ ## Common pitfalls
34
+
35
+ - **Scope drift.** The ticket the PR references may have been closed and reopened with a different scope. Read the whole history.
36
+ - **Mechanical templates.** Some teams require "Why" sections but fill them with boilerplate. Generic text ("improve user experience") is probably not a real answer.
37
+ - **Stale tickets.** Old tickets often reflect a version of the plan that changed. Check dates and cross-reference with the code's ship date.
38
+ - **Closed-as-duplicate chains.** Follow the duplicate-of relationships back to the canonical ticket.
39
+ - **Private workspace content.** If you can't access an issue, note that as a gap rather than guessing.
40
+
41
+ ## What to return
42
+
43
+ For each relevant ticket:
44
+ - Ticket ID and title
45
+ - The problem/motivation quoted from the description or comments (not paraphrased; the synthesizer needs the exact text to cite)
46
+ - Labels, parent issue, project
47
+ - Author, created date, closed date
48
+ - Link to the ticket if available
@@ -0,0 +1,55 @@
1
+ # Notion Docs
2
+
3
+ ## What this source contains
4
+
5
+ - PRDs (product requirement documents)
6
+ - Technical specs and RFCs
7
+ - Architectural decision records (ADRs)
8
+ - Meeting notes from design reviews
9
+ - Team pages with domain context
10
+ - Postmortems from incidents
11
+ - Runbooks that may explain defensive code
12
+ - Strategy documents that set priorities
13
+
14
+ Notion is where "why" often lives in long-form before it becomes code. A significant feature usually has a doc.
15
+
16
+ ## How to search it
17
+
18
+ Use the Notion MCP.
19
+
20
+ 1. **Keyword searches with `notion-search`.** Try:
21
+ - The feature name
22
+ - Key symbols / class names from the target code
23
+ - Author handles (design docs are often authored before the code lands)
24
+ - Error strings or user-visible terms
25
+ - Time-bounded queries if you know when the code shipped
26
+ 2. **Fetch candidate pages with `notion-fetch`.** Read the full content, not the preview; rationale is often buried mid-document.
27
+ 3. **Follow backlinks and child pages.** Design docs often have sub-pages for alternatives considered, appendices, or implementation notes.
28
+ 4. **Check related databases.** `notion-query-data-sources` and `notion-query-meeting-notes` can surface meeting notes that discussed the decision.
29
+ 5. **Search author-specific spaces.** If the PR author has a personal notebook (common at some companies), it may hold exploratory thinking that preceded the code.
30
+
31
+ ## What good evidence looks like here
32
+
33
+ - A PRD with a "Problem statement" or "Motivation" section that matches the target code's purpose
34
+ - An "Alternatives considered" or "Rejected approaches" section
35
+ - A postmortem that names the target code as the fix for a specific incident
36
+ - Meeting notes that record "we decided X because Y" and tie to the same author/date range as the PR
37
+ - An ADR template filled out non-trivially (status, context, decision, consequences)
38
+
39
+ ## Common pitfalls
40
+
41
+ - **Outdated docs.** Specs are often written before implementation and not updated; the doc may describe a plan that changed. Cross-check against the actual PR.
42
+ - **Doc vs. reality drift.** A spec may say "we'll do X" but the code actually does Y. Flag the divergence; the synthesizer will surface the contradiction.
43
+ - **Boilerplate templates.** Some orgs require a "Why" section that gets filled with fluff. Look for specificity.
44
+ - **Unlinked docs.** The most relevant doc may not be linked from anywhere. Broad keyword searches help.
45
+ - **Multiple drafts.** If a topic has multiple docs, find the one that was finalized or most recently updated. Check dates.
46
+ - **Access-restricted pages.** If you can't access a page, note it as a gap.
47
+
48
+ ## What to return
49
+
50
+ For each relevant doc:
51
+ - Title and URL
52
+ - Authors and last-updated date
53
+ - The motivation text (verbatim quote), with page/section location
54
+ - Relevant linked pages (so the synthesizer can cite them)
55
+ - Whether the doc was finalized or draft
@@ -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