@krtclcdy/tersio 2.25.5 → 2.25.7
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/README.md +42 -38
- package/dashboard/dist/index.html +15 -15
- package/dist/bench/code-out/pfull-0/debounce.js +13 -0
- package/dist/bench/code-out/pfull-0/deepClone.js +18 -0
- package/dist/bench/code-out/pfull-0/groupBy.js +15 -0
- package/dist/bench/code-out/pfull-1/debounce.js +13 -0
- package/dist/bench/code-out/pfull-1/deepClone.js +17 -0
- package/dist/bench/code-out/pfull-1/groupBy.js +14 -0
- package/dist/bench/code-out/pfull-2/debounce.js +13 -0
- package/dist/bench/code-out/pfull-2/deepClone.js +18 -0
- package/dist/bench/code-out/pfull-2/groupBy.js +15 -0
- package/dist/bench/code-out/pfull-3/debounce.js +12 -0
- package/dist/bench/code-out/pfull-3/deepClone.js +17 -0
- package/dist/bench/code-out/pfull-3/groupBy.js +7 -0
- package/dist/bench/code-out/pfull-4/debounce.js +10 -0
- package/dist/bench/code-out/pfull-4/deepClone.js +17 -0
- package/dist/bench/code-out/pfull-4/groupBy.js +14 -0
- package/dist/bench/code-out/plite-0/debounce.js +13 -0
- package/dist/bench/code-out/plite-0/deepClone.js +18 -0
- package/dist/bench/code-out/plite-0/groupBy.js +15 -0
- package/dist/bench/code-out/plite-1/debounce.js +13 -0
- package/dist/bench/code-out/plite-1/deepClone.js +17 -0
- package/dist/bench/code-out/plite-1/groupBy.js +11 -0
- package/dist/bench/code-out/plite-2/debounce.js +12 -0
- package/dist/bench/code-out/plite-2/deepClone.js +17 -0
- package/dist/bench/code-out/plite-2/groupBy.js +14 -0
- package/dist/bench/code-out/plite-3/debounce.js +12 -0
- package/dist/bench/code-out/plite-3/deepClone.js +17 -0
- package/dist/bench/code-out/plite-3/groupBy.js +14 -0
- package/dist/bench/code-out/plite-4/debounce.js +12 -0
- package/dist/bench/code-out/plite-4/deepClone.js +17 -0
- package/dist/bench/code-out/plite-4/groupBy.js +14 -0
- package/dist/bench/code-out/pultra-0/debounce.js +12 -0
- package/dist/bench/code-out/pultra-0/deepClone.js +20 -0
- package/dist/bench/code-out/pultra-0/groupBy.js +14 -0
- package/dist/bench/code-out/pultra-1/debounce.js +10 -0
- package/dist/bench/code-out/pultra-1/deepClone.js +17 -0
- package/dist/bench/code-out/pultra-1/groupBy.js +7 -0
- package/dist/bench/code-out/pultra-2/debounce.js +13 -0
- package/dist/bench/code-out/pultra-2/deepClone.js +18 -0
- package/dist/bench/code-out/pultra-2/groupBy.js +15 -0
- package/dist/bench/code-out/pultra-3/debounce.js +13 -0
- package/dist/bench/code-out/pultra-3/deepClone.js +18 -0
- package/dist/bench/code-out/pultra-3/groupBy.js +15 -0
- package/dist/bench/code-out/pultra-4/debounce.js +13 -0
- package/dist/bench/code-out/pultra-4/deepClone.js +18 -0
- package/dist/bench/code-out/pultra-4/groupBy.js +15 -0
- package/dist/bench/code-out/run-0/debounce.js +12 -0
- package/dist/bench/code-out/run-0/deepClone.js +17 -0
- package/dist/bench/code-out/run-0/groupBy.js +14 -0
- package/dist/bench/code-out/run-1/debounce.js +13 -0
- package/dist/bench/code-out/run-1/deepClone.js +15 -0
- package/dist/bench/code-out/run-1/groupBy.js +13 -0
- package/dist/bench/code-out/run-2/debounce.js +12 -0
- package/dist/bench/code-out/run-2/deepClone.js +18 -0
- package/dist/bench/code-out/run-2/groupBy.js +13 -0
- package/dist/bench/code-out/run-3/debounce.js +12 -0
- package/dist/bench/code-out/run-3/deepClone.js +18 -0
- package/dist/bench/code-out/run-3/groupBy.js +14 -0
- package/dist/bench/code-out/run-4/debounce.js +12 -0
- package/dist/bench/code-out/run-4/deepClone.js +16 -0
- package/dist/bench/code-out/run-4/groupBy.js +13 -0
- package/dist/cli/backups.js +7 -14
- package/dist/cli/banner.js +3 -3
- package/dist/cli/common.js +29 -13
- package/dist/cli/currency.js +1 -1
- package/dist/cli/dashboard.js +66 -35
- package/dist/cli/doctor-fix.js +204 -19
- package/dist/cli/doctor.js +263 -40
- package/dist/cli/hosts.js +25 -6
- package/dist/cli/install.js +150 -49
- package/dist/cli/interactive.js +3 -3
- package/dist/cli/manifest.js +109 -9
- package/dist/cli/profile.js +13 -8
- package/dist/cli/rtk-wiring.js +1 -1
- package/dist/cli/settings.js +20 -5
- package/dist/cli/uninstall.js +4 -4
- package/dist/cli/update.js +6 -7
- package/dist/cli/usage.js +6 -9
- package/dist/extensions/caveman/index.js +10 -4
- package/dist/extensions/caveman/rule-lite.md +77 -0
- package/dist/extensions/caveman/rule-megacave-lite.md +59 -0
- package/dist/extensions/caveman/rule-megacave-ultra.md +59 -0
- package/dist/extensions/caveman/rule-megacave.md +5 -3
- package/dist/extensions/caveman/rule-ultra.md +4 -4
- package/dist/extensions/caveman/rule.md +55 -45
- package/dist/extensions/combo/index.js +85 -25
- package/dist/extensions/commands/index.js +1 -1
- package/dist/extensions/pstack/index.js +121 -0
- package/dist/extensions/pstack/rule.md +141 -0
- package/dist/extensions/rtk/filter.js +0 -1
- package/dist/extensions/rtk/session.js +20 -12
- package/dist/extensions/server.js +90 -6
- package/dist/extensions/shared/agent-stats.js +214 -278
- package/dist/extensions/shared/brand-marks.js +33 -34
- package/dist/extensions/shared/carbon.js +1 -1
- package/dist/extensions/shared/plugin-settings.js +11 -6
- package/dist/extensions/shared/pricing.js +8 -16
- package/dist/extensions/shared/rtk-eligible.js +84 -0
- package/dist/extensions/shared/rtk-gain.js +5 -10
- package/dist/extensions/shared/session-state.js +15 -10
- package/dist/extensions/shared/sqlite.js +162 -0
- package/dist/extensions/shared/status.js +8 -9
- package/dist/extensions/shared/types.js +1 -1
- package/dist/extensions/shared/usage-ledger.js +155 -61
- package/dist/extensions/shared/usage-store.js +111 -52
- package/dist/extensions/shared/utils.js +5 -5
- package/dist/extensions/timing/index.js +31 -0
- package/dist/extensions/updater/index.js +3 -6
- package/dist/tersio.js +8 -3
- package/extensions/caveman/index.ts +10 -4
- package/extensions/caveman/rule-lite.md +77 -0
- package/extensions/caveman/rule-megacave-lite.md +59 -0
- package/extensions/caveman/rule-megacave-ultra.md +59 -0
- package/extensions/caveman/rule-megacave.md +5 -3
- package/extensions/caveman/rule-ultra.md +4 -4
- package/extensions/caveman/rule.md +55 -45
- package/extensions/combo/index.ts +86 -23
- package/extensions/commands/index.ts +1 -1
- package/extensions/pstack/index.ts +130 -0
- package/extensions/pstack/playbooks/authoring-a-skill.md +12 -0
- package/extensions/pstack/playbooks/autonomous-run.md +13 -0
- package/extensions/pstack/playbooks/autopilot-full.md +13 -0
- package/extensions/pstack/playbooks/autopilot-stack.md +16 -0
- package/extensions/pstack/playbooks/babysit.md +23 -0
- package/extensions/pstack/playbooks/bug-fix.md +15 -0
- package/extensions/pstack/playbooks/eval.md +25 -0
- package/extensions/pstack/playbooks/feature.md +21 -0
- package/extensions/pstack/playbooks/hillclimb.md +21 -0
- package/extensions/pstack/playbooks/investigation.md +14 -0
- package/extensions/pstack/playbooks/multi-phase-plan.md +155 -0
- package/extensions/pstack/playbooks/opening-a-pr.md +34 -0
- package/extensions/pstack/playbooks/orchestrate.md +111 -0
- package/extensions/pstack/playbooks/pause-safely.md +10 -0
- package/extensions/pstack/playbooks/perf-issue.md +25 -0
- package/extensions/pstack/playbooks/prototype.md +14 -0
- package/extensions/pstack/playbooks/refactoring.md +16 -0
- package/extensions/pstack/playbooks/runtime-forensics.md +11 -0
- package/extensions/pstack/playbooks/session-pickup.md +11 -0
- package/extensions/pstack/playbooks/shipping.md +17 -0
- package/extensions/pstack/playbooks/trace-forensics.md +14 -0
- package/extensions/pstack/playbooks/visual-parity.md +11 -0
- package/extensions/pstack/playbooks/worktree-cleanup.md +12 -0
- package/extensions/pstack/principles/attack-the-premise.md +22 -0
- package/extensions/pstack/principles/boundary-discipline.md +33 -0
- package/extensions/pstack/principles/build-the-lever.md +22 -0
- package/extensions/pstack/principles/encode-lessons-in-structure.md +10 -0
- package/extensions/pstack/principles/exhaust-the-design-space.md +8 -0
- package/extensions/pstack/principles/experience-first.md +18 -0
- package/extensions/pstack/principles/explain-the-number.md +16 -0
- package/extensions/pstack/principles/fix-root-causes.md +23 -0
- package/extensions/pstack/principles/foundational-thinking.md +20 -0
- package/extensions/pstack/principles/guard-the-context-window.md +11 -0
- package/extensions/pstack/principles/laziness-protocol.md +9 -0
- package/extensions/pstack/principles/make-operations-idempotent.md +23 -0
- package/extensions/pstack/principles/migrate-callers-then-delete-legacy-apis.md +21 -0
- package/extensions/pstack/principles/minimize-reader-load.md +17 -0
- package/extensions/pstack/principles/model-the-domain.md +23 -0
- package/extensions/pstack/principles/never-block-on-the-human.md +14 -0
- package/extensions/pstack/principles/outcome-oriented-execution.md +20 -0
- package/extensions/pstack/principles/prove-it-works.md +21 -0
- package/extensions/pstack/principles/redesign-from-first-principles.md +15 -0
- package/extensions/pstack/principles/separate-before-serializing-shared-state.md +15 -0
- package/extensions/pstack/principles/sequence-verifiable-units.md +16 -0
- package/extensions/pstack/principles/subtract-before-you-add.md +17 -0
- package/extensions/pstack/principles/test-behavior-not-implementation.md +20 -0
- package/extensions/pstack/principles/type-system-discipline.md +17 -0
- package/extensions/pstack/references/bugbot-triage.md +142 -0
- package/extensions/pstack/rule.md +141 -0
- package/extensions/pstack/skills/architect/SKILL.md +78 -0
- package/extensions/pstack/skills/architect/references/design-red-flags.md +57 -0
- package/extensions/pstack/skills/architect/references/rationale-template.md +35 -0
- package/extensions/pstack/skills/architect/references/runner-prompt.md +20 -0
- package/extensions/pstack/skills/arena/SKILL.md +47 -0
- package/extensions/pstack/skills/benchmark-checklist/SKILL.md +38 -0
- package/extensions/pstack/skills/blast-radius/SKILL.md +49 -0
- package/extensions/pstack/skills/bro/SKILL.md +6 -0
- package/extensions/pstack/skills/correct/SKILL.md +31 -0
- package/extensions/pstack/skills/figure-it-out/SKILL.md +51 -0
- package/extensions/pstack/skills/how/SKILL.md +35 -0
- package/extensions/pstack/skills/how/references/explainer-prompt.md +55 -0
- package/extensions/pstack/skills/how/references/explorer-prompt.md +35 -0
- package/extensions/pstack/skills/interrogate/SKILL.md +73 -0
- package/extensions/pstack/skills/interrogate/references/code-quality-review.md +47 -0
- package/extensions/pstack/skills/interrogate/references/lead-judgment.md +58 -0
- package/extensions/pstack/skills/interrogate/references/reviewer-prompt.md +62 -0
- package/extensions/pstack/skills/interrogate/references/rubric.md +77 -0
- package/extensions/pstack/skills/no-comments/SKILL.md +23 -0
- package/extensions/pstack/skills/reflect/SKILL.md +66 -0
- package/extensions/pstack/skills/reflect/references/divergent-reviewer.md +38 -0
- package/extensions/pstack/skills/reflect/references/judgment-reviewer.md +37 -0
- package/extensions/pstack/skills/reflect/references/synthesizer.md +56 -0
- package/extensions/pstack/skills/reflect/references/tooling-reviewer.md +48 -0
- package/extensions/pstack/skills/show-me-your-work/SKILL.md +81 -0
- package/extensions/pstack/skills/swarm/SKILL.md +45 -0
- package/extensions/pstack/skills/tdd/SKILL.md +41 -0
- package/extensions/pstack/skills/technical-writing/SKILL.md +105 -0
- package/extensions/pstack/skills/unslop/SKILL.md +61 -0
- package/extensions/pstack/skills/why/SKILL.md +97 -0
- package/extensions/pstack/skills/why/references/epistemics.md +71 -0
- package/extensions/pstack/skills/why/references/investigator-prompt.md +84 -0
- package/extensions/pstack/skills/why/references/source-playbook.md +17 -0
- package/extensions/pstack/skills/why/references/sources/code-archaeology.md +51 -0
- package/extensions/pstack/skills/why/references/sources/databricks.md +70 -0
- package/extensions/pstack/skills/why/references/sources/datadog.md +97 -0
- package/extensions/pstack/skills/why/references/sources/incident-postmortem.md +5 -0
- package/extensions/pstack/skills/why/references/sources/linear.md +48 -0
- package/extensions/pstack/skills/why/references/sources/notion.md +55 -0
- package/extensions/pstack/skills/why/references/sources/sentry.md +66 -0
- package/extensions/pstack/skills/why/references/sources/slack.md +17 -0
- package/extensions/pstack/skills/why/references/synthesizer-prompt.md +129 -0
- package/extensions/rtk/filter.ts +0 -1
- package/extensions/rtk/session.ts +19 -11
- package/extensions/server.ts +72 -7
- package/extensions/shared/agent-stats.ts +226 -278
- package/extensions/shared/brand-marks.ts +34 -34
- package/extensions/shared/carbon.ts +1 -1
- package/extensions/shared/plugin-settings.ts +12 -6
- package/extensions/shared/pricing.ts +10 -26
- package/extensions/shared/rtk-eligible.ts +83 -0
- package/extensions/shared/rtk-gain.ts +5 -10
- package/extensions/shared/session-state.ts +18 -13
- package/extensions/shared/sqlite.ts +162 -0
- package/extensions/shared/status.ts +9 -9
- package/extensions/shared/types.ts +2 -1
- package/extensions/shared/usage-ledger.ts +157 -66
- package/extensions/shared/usage-store.ts +120 -52
- package/extensions/shared/utils.ts +5 -5
- package/extensions/timing/index.ts +44 -0
- package/extensions/updater/index.ts +3 -8
- package/package.json +21 -9
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-writing
|
|
3
|
+
description: "Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use for the technical-writing skill or when writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Technical writing
|
|
7
|
+
|
|
8
|
+
Write so a tired engineer understands on the first read. Apply all four layers.
|
|
9
|
+
|
|
10
|
+
Three rules sit above the layers:
|
|
11
|
+
|
|
12
|
+
- **Cut every word that does no work.** If the sentence survives without a word, the word goes. "In order to" is "to". "It is important to note that" is nothing.
|
|
13
|
+
- **Use the short, everyday word.** "Use", not "utilize". "Help", not "facilitate". "Do", not "perform". A long word has to buy its length with precision.
|
|
14
|
+
- **When a rule makes a sentence worse, fix the sentence another way or leave it alone.** A sentence that follows every rule and sounds like a machine wrote it has failed.
|
|
15
|
+
|
|
16
|
+
The codebase is the word list. Write the real symbol, file, flag, or command name, not a synonym or a description of it.
|
|
17
|
+
|
|
18
|
+
Don't invent jargon. Use the words a developer would say out loud: "move", "delete", "a budget that only decreases", not "evacuate", "ratchet", or "endgame". A named pattern is fine when the doc says what it means the first time. Propose a new offender and its replacement as an addition to `unslop`'s abstract-metaphor rule in your reply, with the diff. Don't edit that skill.
|
|
19
|
+
|
|
20
|
+
## Vary the rhythm
|
|
21
|
+
|
|
22
|
+
A doc can obey every layer and still read machine-written: every sentence clipped short, no view anywhere, nothing specific.
|
|
23
|
+
|
|
24
|
+
- Mix sentence lengths on purpose. Short sentences land a point. Longer ones carry a fact with its condition or consequence.
|
|
25
|
+
- One thought per sentence does not mean one length per sentence. Split the sentence that carries two thoughts. Keep the long sentence that carries one.
|
|
26
|
+
- Have a view where the mode allows it. Explanation weighs trade-offs, so say what you make of them instead of listing pros and cons. Reference stays dry.
|
|
27
|
+
- Be specific over sterile. Not "schema changes can cause issues" but "a column rename fails the build".
|
|
28
|
+
|
|
29
|
+
## Pick the mode first (Diátaxis)
|
|
30
|
+
|
|
31
|
+
One document, one mode. Two questions pick it: does the content inform action (doing) or understanding (thinking), and does it serve learning or work?
|
|
32
|
+
|
|
33
|
+
- Action + learning: **tutorial**.
|
|
34
|
+
- Action + work: **how-to**.
|
|
35
|
+
- Understanding + work: **reference**.
|
|
36
|
+
- Understanding + learning: **explanation**.
|
|
37
|
+
|
|
38
|
+
Use the compass on a whole document or on one sentence.
|
|
39
|
+
|
|
40
|
+
**Tutorial: learning by doing.** The learner's success is your job, not theirs. Open by saying what the learner will build, not what they will "learn". Every step produces a visible result, early and often. Tell them what they should see: the expected output, the prompt change, the log line. Cut explanation to one clause and a link. Stay concrete. Write as "we", in commands: "First, do x. Now, do y."
|
|
41
|
+
|
|
42
|
+
**How-to: steps to a goal.** Solve a problem a person has, not an operation the machine can perform. Assume competence and skip teaching. Action only: no digressions, no background, no completeness for its own sake. Link those instead. Allow forks and judgment: "If you want x, do y." Name the guide by the task: "How to calibrate the radar array", not "Radar array calibration".
|
|
43
|
+
|
|
44
|
+
**Reference: facts for lookup.** Only describe. No instruction, no persuasion, no opinion. Be dry, complete, and sure. State facts, options, limits, and errors with no hedging. Mirror the structure of the thing described, so code and docs can be navigated together. Put material where readers expect it. Generate from code where possible.
|
|
45
|
+
|
|
46
|
+
**Explanation: understanding and why.** One bounded topic, readable away from the product. Each title should tolerate an implicit "About..." in front. Anchor on a real why question. Give context: design decisions, history, constraints, alternatives. Opinion is allowed here and nowhere else.
|
|
47
|
+
|
|
48
|
+
Don't mix modes: no reference tables inside a tutorial, no tutorial hand-holding inside reference, no arguing inside a how-to. Split and link instead.
|
|
49
|
+
|
|
50
|
+
## Write sentences to the reader (Google developer style)
|
|
51
|
+
|
|
52
|
+
- Talk to the reader as "you", in the present tense. "Will" only for things that genuinely happen later.
|
|
53
|
+
- Say who does what: "the compiler checks", not "is checked". Passive is fine only when the actor is unknown or beside the point.
|
|
54
|
+
- Write instructions as commands: "Click Submit." State facts plainly. Never "should be done".
|
|
55
|
+
- Put the condition before the instruction: "To delete the document, click Delete."
|
|
56
|
+
- Put the common case first. Exceptions after.
|
|
57
|
+
- Sound like a knowledgeable friend. No buzzwords, no figurative language, no "please" in instructions, and never "simply", "easy", or "quickly" in a procedure. If it were simple, the reader would not be here.
|
|
58
|
+
- Don't pre-announce ("we will soon support...") and don't start consecutive sentences with the same phrase.
|
|
59
|
+
- Link with words that say where the link goes: the page title or a short description. Never "click here". Prefer a sentence of context on the page over a link off it.
|
|
60
|
+
- Headings carry the point, not just the topic ("Pick the mode first", not "Modes"). Sentence case. A task heading is a bare verb phrase ("Create an instance"). A concept heading is a noun phrase. One h1 per page, no skipped levels.
|
|
61
|
+
- Numbered lists for sequences, bullets for everything else. Introduce a list with a complete sentence. Keep items parallel.
|
|
62
|
+
- Code goes in code font. UI elements go in bold. Use serial commas. Drop "etc." and say up front that a list is partial.
|
|
63
|
+
|
|
64
|
+
## Make statements load one at a time (STE rules)
|
|
65
|
+
|
|
66
|
+
- One instruction per sentence. One thought per sentence everywhere else.
|
|
67
|
+
- Split instructions longer than about 20 words and other sentences longer than about 25.
|
|
68
|
+
- Put the warning or condition before the step it guards: "If hot oil touches your skin, injuries can occur."
|
|
69
|
+
- Keep "the" and "a": "Remove backup file" reads two ways. "Remove the backup file" reads one.
|
|
70
|
+
- Give each word one meaning and one job, then keep it. If "check" means inspect, don't also use it for restrain.
|
|
71
|
+
- Pick one word per action and stick to it: "start", not "start" here and "initiate" there.
|
|
72
|
+
- Write procedures as direct commands, never as narration and never in the passive: "Install the component", not "the component must be installed".
|
|
73
|
+
- Avoid "-ing" words where you can.
|
|
74
|
+
|
|
75
|
+
## Leave no sentence open to two readings (Global English)
|
|
76
|
+
|
|
77
|
+
- Keep words like "only" and "not" next to the word they change: "only fails on growth" and "fails only on growth" say different things.
|
|
78
|
+
- Break up long noun strings: "the proto import budget check script" becomes "the script that checks the proto-import budget".
|
|
79
|
+
- Make every "it", "they", and "this" point at one obvious thing. Repeat the noun when in doubt. Never use "this" or "which" to point at a whole clause.
|
|
80
|
+
- Don't drop verbs: "Phase 1 moves the converters and Phase 2 the runtime" leaves Phase 2 without one. Give it one.
|
|
81
|
+
- Keep the small words that show structure, such as "that" in "Ensure that the switch is off". Never trade clarity for word count.
|
|
82
|
+
- Repeat the article in a series when it prevents a misread: "the client and the host", not "the client and host", when they are two things.
|
|
83
|
+
- Say which parts "and" or "or" joins when a sentence can group two ways. "Both...and", "either...or", and "if...then" are free disambiguators.
|
|
84
|
+
- Use periods, not semicolons. Replace an em dash with a new sentence.
|
|
85
|
+
- Make text in parentheses a full grammatical unit or its own sentence. Never form plurals with "(s)".
|
|
86
|
+
- No slashes: write "a, b, or both" instead of "a/b" or "and/or".
|
|
87
|
+
- Call each thing by one name, everywhere. A doc that says "the gate", "the ratchet", and "the budget check" for one thing teaches three things. Don't churn what didn't change.
|
|
88
|
+
- Skip idioms, colloquialisms, Latin abbreviations, and metaphors.
|
|
89
|
+
|
|
90
|
+
## Voice and repo specifics
|
|
91
|
+
|
|
92
|
+
- Apply the **unslop** skill to every doc this skill touches. That skill owns the slop-pattern catalog: AI vocabulary, filler, hedging, formatting tells.
|
|
93
|
+
- PR descriptions and commit messages are writing too. Every layer except Diátaxis applies to them. A PR body is a briefing that a reviewer can read in under a minute. Do not paste swarm logs, SHA lists, or metric tables. Link them.
|
|
94
|
+
- Product UI strings are not documentation. Use your product's copy guidelines for those.
|
|
95
|
+
- Indent code snippets with tabs. Write real paths. Make every count or tree claim true at the commit that lands it, and include the command that regenerates it.
|
|
96
|
+
|
|
97
|
+
## Worked example
|
|
98
|
+
|
|
99
|
+
Before:
|
|
100
|
+
|
|
101
|
+
> Configuration of the proto import ratchet budget script parameters is performed via budget.json. Note that it's important to remember that running with --write, which updates the committed budget to reflect the current count, should only be done when lowering it. If exceeded, CI fails.
|
|
102
|
+
|
|
103
|
+
After:
|
|
104
|
+
|
|
105
|
+
> `budget.mjs` reads the committed budget from `budget.json` and counts the files that import protos. If the count exceeds the budget, CI fails. Run `budget.mjs --write` only to lower the budget.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unslop
|
|
3
|
+
description: Cut AI tells from any writing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Unslop
|
|
7
|
+
|
|
8
|
+
Edit text to remove AI patterns. Scan for the patterns below, then rewrite. Preserve meaning and match the intended tone.
|
|
9
|
+
|
|
10
|
+
## Patterns to detect and fix
|
|
11
|
+
|
|
12
|
+
Rule numbers are stable ids that other skills cite. A removed rule leaves a gap.
|
|
13
|
+
|
|
14
|
+
### Content
|
|
15
|
+
|
|
16
|
+
3. **Superficial -ing phrases.** "highlighting...", "ensuring...", "reflecting...", "showcasing...", "fostering...". Delete or expand with real sources.
|
|
17
|
+
5. **Vague attributions.** "Experts believe", "Industry reports suggest", "Some critics argue". Name the source or delete.
|
|
18
|
+
|
|
19
|
+
### Language
|
|
20
|
+
|
|
21
|
+
7. **AI vocabulary.** Additionally, crucial, delve, enduring, enhance, fostering, garner, interplay, intricate, landscape (abstract), pivotal, showcase, tapestry (abstract), testament, underscore, vibrant. Replace with plain words.
|
|
22
|
+
8. **Fancy ways to say "is".** "serves as", "stands as", "boasts", "features". Say "is" or "has".
|
|
23
|
+
9. **"Not just X, but Y."** State the point directly instead.
|
|
24
|
+
10. **Rule of three.** Don't force ideas into groups of three. Use the natural number.
|
|
25
|
+
11. **Synonym cycling.** Protagonist, main character, central figure, hero all in one paragraph. Pick one, repeat it.
|
|
26
|
+
12. **False ranges.** "from X to Y" where X and Y aren't on a meaningful scale. List topics directly.
|
|
27
|
+
|
|
28
|
+
### Style
|
|
29
|
+
|
|
30
|
+
13. **Em dash overuse.** Avoid em dashes entirely. Use periods or commas only (no parentheses, no en dashes, no hyphen-as-dash substitutes). If a thought needs separation, end the sentence or use a comma.
|
|
31
|
+
14. **Colon overuse.** Colons are fine before a list or example, not as mid-sentence connectors. "If you're coming from traditional automation: instead of registering event handlers, you describe conditions" adds nothing with the colon. Rewrite to let the point stand on its own without comparison framing. "Describing when the scheduler should fire works best as plain English." Same meaning, no crutch punctuation.
|
|
32
|
+
15. **Boldface overuse.** Don't bold every proper noun or acronym.
|
|
33
|
+
16. **Inline-header lists.** The tell is a bold label and colon that restates the line: "**Performance:** Performance improved...". Convert those to prose. A bold lead-in that ends in a period, names the item, and is followed by genuinely new detail ("**Schema in TypeScript.** Tables live in one file.") is fine, not a tell.
|
|
34
|
+
17. **Title case headings.** Use sentence case.
|
|
35
|
+
18. **Decorative emojis.** Remove from headings and bullets.
|
|
36
|
+
19. **Curly quotes.** Use straight quotes.
|
|
37
|
+
|
|
38
|
+
### Communication artifacts
|
|
39
|
+
|
|
40
|
+
20. **Chatbot phrases.** "I hope this helps!", "Let me know if...", "Of course!", "Certainly!", "Found the smoking gun!" Remove.
|
|
41
|
+
22. **Sycophantic tone.** "Great question! You're absolutely right!" Respond directly.
|
|
42
|
+
|
|
43
|
+
### Filler
|
|
44
|
+
|
|
45
|
+
23. **Filler phrases.** "In order to" becomes "To". "Due to the fact that" becomes "Because". Delete "It is important to note that".
|
|
46
|
+
24. **Excessive hedging.** "could potentially possibly be argued that it might" becomes "may".
|
|
47
|
+
25. **Generic conclusions.** "The future looks bright." State specific plans or facts.
|
|
48
|
+
|
|
49
|
+
### Jargon
|
|
50
|
+
|
|
51
|
+
26. **Abstract metaphor nouns.** Substrate (base), wedge, wedge in (add), vector (way, method), locus, vantage, nexus, primitive as a noun, harness as a metaphor, surface as in "API surface", bedrock, scaffolding as a metaphor, modality, paradigm, gold-plating (more than the job needs), ratchet as a metaphor (the mechanism's real name, or a limit that only tightens), evacuate for moving code (move out), endgame (the last phase), north star, flywheel. These read as technical but usually have a plainer concrete word. Pick the concrete word.
|
|
52
|
+
|
|
53
|
+
### Plain speech
|
|
54
|
+
|
|
55
|
+
27. **Say what it does, not how it feels.** "the database stays close at hand", "SQL you can read", "types that follow your schema" name a feeling. The fix names the mechanism or a number: "`.toSQL()` returns the exact string sent to the database", "a column rename fails the build". Ask what the sentence tells the reader to do or know, then write that. If you can't restate it as a concrete instruction, fact, or number, cut it. One more check: if the sentence could appear unchanged in another project's docs, it says nothing about this one. Cut it.
|
|
56
|
+
28. **Shorten or split dense sentences.** If the reader has to backtrack to parse a sentence, break it in two or drop clauses. One idea per sentence.
|
|
57
|
+
29. **Active voice.** Prefer it. Catch "is/are/was/were + past participle" and name the actor: "queries are validated" becomes "the compiler validates queries", "the file is parsed by the loader" becomes "the loader parses the file". Passive is fine only when the actor is unknown or genuinely doesn't matter.
|
|
58
|
+
30. **Cut adverbs, or use a stronger verb.** "runs quickly" becomes "is fast" or the number, and "significantly improves" becomes the measured delta. An adverb propping up a weak verb means the verb is wrong.
|
|
59
|
+
31. **Prefer the plain word.** "utilize" and "leverage" become "use", "facilitate" becomes "help", "numerous" becomes "many", "in the event that" becomes "if". The fancier synonym is rarely clearer.
|
|
60
|
+
32. **Mannered prose.** Metaphor or flourish where a literal phrase exists: aphorisms ("wire it or delete it"), rhetorical fragments for effect, personified code ("the plan holds it"), figurative verbs ("rides along", "stands on"), stock framing phrases. "A dial worth turning" becomes "a parameter worth varying". Say what you mean. Rule 26 covers the metaphor nouns.
|
|
61
|
+
33. **Over-compression.** Dropped articles, verbless fragments, symbol-speak, and abbreviations that make the reader decode instead of read. "Parser rejects bad date → exit 2, no write" becomes "The parser rejects a bad date, exits with code 2, and writes nothing." Write whole sentences with their articles and verbs, and spell out arrows and abbreviations.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: why
|
|
3
|
+
description: "Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Why
|
|
7
|
+
|
|
8
|
+
Investigate the motivation and intent behind code. The companion `how` skill answers what the code does and how it works. `why` answers what forces led to its shape.
|
|
9
|
+
|
|
10
|
+
Each spawn below names a role line in your configuration and a default. Set `model` to that line's value, or to the default if the line is missing. Leave `model` unset when the value is `auto` or `inherit-parent`. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message.
|
|
11
|
+
|
|
12
|
+
Every spawn is an agent-mode subagent (`readonly: false`). **Do not use a read-only or ask mode.** It strips MCP access, which disables the MCP-backed investigators and the synthesizer's citation spot-checks. Investigators still shouldn't write anything.
|
|
13
|
+
|
|
14
|
+
## Operating Posture
|
|
15
|
+
|
|
16
|
+
Operate as a **careful, cautious, and precise investigator**. Be honest about what you know vs what you're inferring. Read `references/epistemics.md` for the full confidence framework and phrasing guide. The synthesizer must follow it.
|
|
17
|
+
|
|
18
|
+
## Step 1. Understand the Target and the Question
|
|
19
|
+
|
|
20
|
+
The **target** is usually a chunk of code, a pattern, a feature, or a named design decision. The **question** is usually a design rationale, a tradeoff, a motivating edge case, an external constraint, dead code, or a broad history sweep.
|
|
21
|
+
|
|
22
|
+
If the target is vague ("why do we do it this way?" with no clear referent), make your best guess from conversation context (open files, recent edits, cursor location, what was just discussed). State your interpretation briefly so the user can redirect if you're off, then proceed.
|
|
23
|
+
|
|
24
|
+
## Step 2. Establish the Code Anchor
|
|
25
|
+
|
|
26
|
+
Before spawning investigators, build the seed context inline: file paths and line ranges, key symbols (functions, classes, constants), the last few commits touching the target, PR numbers from merge commits (pattern `(#1234)` in the subject line), and any linked ticket IDs. Run `git blame -L <start>,<end> <file>` for last-touch commits, `git log --follow -p -- <file>` for full history with patches through renames, `git log --oneline -20 -- <file>` for recent commits with PR numbers visible, and `git log -1 --format=%B <commit>` to extract PR numbers. Then pull the PR bodies and discussion for any substantive commit: `gh pr view <number> --json title,body,author,createdAt,mergedAt,labels,closingIssuesReferences,comments,reviews`. This anchor goes to every investigator and to the synthesizer.
|
|
27
|
+
|
|
28
|
+
## Step 3. Spawn Parallel Investigators
|
|
29
|
+
|
|
30
|
+
**Default to the full parallel investigation.** The goal is a complete coverage map, not a minimal one. Document the null, don't skip the search.
|
|
31
|
+
|
|
32
|
+
### Discovery
|
|
33
|
+
|
|
34
|
+
Before spawning investigators, list the available MCPs from the host environment. Use the available-tools map when present.
|
|
35
|
+
|
|
36
|
+
Map each available MCP to one evidence category:
|
|
37
|
+
|
|
38
|
+
1. Source control history
|
|
39
|
+
2. Issue / ticket tracker
|
|
40
|
+
3. Long-form documents
|
|
41
|
+
4. Real-time team chat
|
|
42
|
+
5. Infrastructure observability
|
|
43
|
+
6. Error / exception tracking
|
|
44
|
+
7. Product analytics warehouse
|
|
45
|
+
|
|
46
|
+
Source control is always available through git and `gh`. For the other six, classify using the MCP name, server instructions, tool names, and resource descriptors. If an MCP could fit more than one category, choose the one matching its primary evidence. Record ambiguous cases in the coverage map.
|
|
47
|
+
|
|
48
|
+
Spawn one investigator per category that has a matching MCP, all in a single message so they run concurrently, each owning exactly one tool or MCP. Don't ask one agent to cover multiple MCPs. `model`: the `why investigators` line, default a fast model.
|
|
49
|
+
|
|
50
|
+
Each investigator's prompt is `references/investigator-prompt.md` filled in, plus:
|
|
51
|
+
- the category playbook `references/sources/<source>.md` for the selected MCP, adapted from the examples in `references/source-playbook.md`
|
|
52
|
+
- `references/sources/incident-postmortem.md` **if the target code looks defensive** (null checks, retry logic, timeout handling, rate limiting, feature flags, egress guards, OOM handlers)
|
|
53
|
+
- the code anchor and the user's original question
|
|
54
|
+
|
|
55
|
+
### Investigator roster, one per available evidence category
|
|
56
|
+
|
|
57
|
+
Each category below is uniquely positioned to surface one shape of "why", shown after "Best at". Use it to know what to expect back, to name a gap when a category returns empty, and, only in the rare provably-irrelevant case, to justify a skip.
|
|
58
|
+
|
|
59
|
+
1. **Source control** (git history, `gh` for PRs, code comments, tests). Always spawn, the only guaranteed source. Best at *implementation-time rationale captured during review*.
|
|
60
|
+
2. **Issue / ticket tracker** (e.g. Linear, Jira, GitHub Issues, Plane, Shortcut MCP). Best at *the product or business forcing function*. Strongest when the why is external to engineering.
|
|
61
|
+
3. **Long-form documents** (e.g. Notion, Confluence, Google Docs, Coda MCP). Best at *long-form design rationale*, written out before it becomes code.
|
|
62
|
+
4. **Real-time team chat** (e.g. Slack, Discord, Microsoft Teams, Mattermost MCP). Best at *real-time deliberation that never reached a doc*. Especially important when the source control, ticket, and doc paper trail is thin.
|
|
63
|
+
5. **Infrastructure observability** (e.g. Datadog, New Relic, Honeycomb, Grafana, Splunk MCP). Best at *infrastructure and runtime reality that motivated the code*. Strongest when the target reacts to an infra signal (timeouts, retries, rate limits, circuit breakers).
|
|
64
|
+
6. **Error / exception tracking** (e.g. Sentry, Rollbar, Bugsnag, Airbrake MCP). Best at *the specific exceptions and error trajectories that motivated defensive or corrective code*. Strongest for catch blocks, null guards, type checks, retries, and other defenses.
|
|
65
|
+
7. **Product analytics warehouse** (e.g. Databricks, Snowflake, BigQuery, ClickHouse, dbt, Redshift MCP). Best at *product and data reality that shaped the code*. Strongest for flag-gated code, experiment-driven ships, data migrations, and "where did this number come from" questions.
|
|
66
|
+
|
|
67
|
+
### When to skip an investigator
|
|
68
|
+
|
|
69
|
+
Only with an **explicit, written justification** that goes in the final Sources Consulted. Two valid reasons:
|
|
70
|
+
|
|
71
|
+
- **No MCP is available for that category** in this environment. Flag it as a gap, not a choice: "Real-time team chat skipped. No matching MCP available, so the conversational record was not searchable."
|
|
72
|
+
- **The source is provably irrelevant**, not just "probably irrelevant." A high bar: "Error / exception tracking skipped. Target is a build-time script with no runtime code path."
|
|
73
|
+
|
|
74
|
+
If your scope assessment suggests a single-commit trivial target where the PR description already contains the complete answer, you may answer inline **only after** confirming all seven available category searches would be redundant. Say so explicitly. This should be rare.
|
|
75
|
+
|
|
76
|
+
## Step 4. Synthesize
|
|
77
|
+
|
|
78
|
+
Spawn one synthesizer. `model`: the `why synthesizer` line, default the strongest model. It gets:
|
|
79
|
+
1. The investigator findings, including any null results and any categories skipped with justification
|
|
80
|
+
2. The code anchor
|
|
81
|
+
3. The user's original question
|
|
82
|
+
4. The epistemics framework from `references/epistemics.md`
|
|
83
|
+
5. The synthesizer prompt template from `references/synthesizer-prompt.md`
|
|
84
|
+
|
|
85
|
+
## Step 5. Present
|
|
86
|
+
|
|
87
|
+
Present the synthesizer's output to the user. You may lightly edit for clarity or add context from the conversation, but **do not rewrite the confidence language**.
|
|
88
|
+
|
|
89
|
+
## Output Format
|
|
90
|
+
|
|
91
|
+
The structure is the one in `references/synthesizer-prompt.md`: The Question, The Code in Question, What We Found, What We Can Reasonably Infer, Competing Hypotheses, What We Don't Know, Sources Consulted, Confidence Summary. Adapt as needed, but keep the confidence separation intact, and keep Sources Consulted as one line per investigator, including the ones that returned nothing or were skipped, with the reason.
|
|
92
|
+
|
|
93
|
+
After Sources Consulted, if the user's `why` question is a precursor to changing this code, convert the lineage findings into a Preserve / Change / Avoid / Risk constraint set for planning the change.
|
|
94
|
+
|
|
95
|
+
## Common Failure Modes to Avoid
|
|
96
|
+
|
|
97
|
+
- **Recency bias**. Assuming the most recent commit is authoritative. The current shape is often the accretion of many earlier decisions. Trace back.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Epistemics
|
|
2
|
+
|
|
3
|
+
How to reason about confidence when evidence is historical, fragmentary, and sometimes contradictory, and how to tell the user without flattening it into false certainty. Code shows what it does, not *why it exists*. The why lives in commits, PRs, tickets, docs, and conversations, all incomplete, biased, and sometimes missing. Pretending otherwise produces confident-sounding guesses that mislead the user.
|
|
4
|
+
|
|
5
|
+
## Confidence Tiers
|
|
6
|
+
|
|
7
|
+
Every claim in the output must sit in one tier. The tier sets its section and its phrasing.
|
|
8
|
+
|
|
9
|
+
### 1. Direct
|
|
10
|
+
|
|
11
|
+
An explicit, textual citation answers the question: something an author actually *wrote* that says why, not "the code does X so the author must have wanted X." For example, a PR description "this fixes the bug where users with >1000 items couldn't paginate", a ticket "we're adding this because customer Acme requested it in their security review", a code comment "// clamp to 100 because the upstream API rejects larger values", a design doc "we chose option A over option B because we need persistence across restarts", or a chat message from the author "switching to this approach since the old one was flaky in tests".
|
|
12
|
+
|
|
13
|
+
Phrasing: confident, present tense, cited. "This exists because X."
|
|
14
|
+
|
|
15
|
+
### 2. Supported
|
|
16
|
+
|
|
17
|
+
Multiple pieces of indirect evidence converge on one conclusion. No single source states it explicitly, but the pattern across sources makes it likely. For example, the PR title says "improve performance", the ticket is labeled "perf", and the surrounding commits all touch the same hot path. Or several tests added with the change all exercise very large inputs. Or the author's other PRs from the same week all name the same incident.
|
|
18
|
+
|
|
19
|
+
Phrasing: confident but clearly derived, citing each item. "The evidence points strongly to X: [the specific pieces]."
|
|
20
|
+
|
|
21
|
+
### 3. Inferred
|
|
22
|
+
|
|
23
|
+
A reasonable reading of the context that nothing explicitly supports. It is *your interpretation*, not a fact from the record. For example, the PR doesn't say why, but the error was happening in production (per the incident channel timing) and the fix was rushed (merged the same day), so it was likely a hotfix. Or the function name suggests retry logic, and its retry count of 3 matches the team's 3-retry convention elsewhere in the codebase.
|
|
24
|
+
|
|
25
|
+
Phrasing: hedged, with the chain explicit. "Given A and B, C seems likely because D."
|
|
26
|
+
|
|
27
|
+
### 4. Speculative
|
|
28
|
+
|
|
29
|
+
A plausible hypothesis on thin evidence, where other explanations fit equally well. Worth presenting, since the user may know which is right, but mark it as a guess. For example, "This might be a workaround for a browser bug that's since been fixed, but we found no contemporary evidence of that", or "It's possible this threshold was chosen to match an SLA commitment, but no SLA doc references it."
|
|
30
|
+
|
|
31
|
+
Phrasing: "One possibility is X, but we have no direct evidence." Usually lives in Competing Hypotheses, alongside other possibilities.
|
|
32
|
+
|
|
33
|
+
### 5. Unknown
|
|
34
|
+
|
|
35
|
+
You looked and couldn't find out. A valid, important outcome. Document it.
|
|
36
|
+
|
|
37
|
+
Phrasing: "We searched X, Y, and Z and found no evidence of why." Be specific about *what* you searched. "We couldn't find out" is less useful than "We searched the ticket tracker with keywords A and B, scanned the 6 PRs that touched this file since 2023, and grep'd the repo for string literals matching the threshold. None surfaced a rationale."
|
|
38
|
+
|
|
39
|
+
## Phrasing Guide
|
|
40
|
+
|
|
41
|
+
**Confidence words** imply Direct or Supported evidence and need a citation immediately adjacent. Never use them for inferences: "because", "the reason is", "was designed to" (claims author intent), "fixes" / "addresses" / "solves" (claims the change achieved its goal), "the team decided" (claims a group decision happened).
|
|
42
|
+
|
|
43
|
+
**Hedges** signal interpretation, not report. Use them liberally in What We Can Reasonably Infer: "appears to", "seems to", "likely", "suggests", "is consistent with", "one reading is", "plausibly", "may have been", "the evidence points toward".
|
|
44
|
+
|
|
45
|
+
**Words to avoid:**
|
|
46
|
+
|
|
47
|
+
- "obviously". If it were obvious, the user wouldn't be asking
|
|
48
|
+
- "clearly". Almost always precedes a claim that isn't clear
|
|
49
|
+
- "of course". Same
|
|
50
|
+
- "just" (as in "it's just X for performance"). Dismissive and usually hides uncertainty
|
|
51
|
+
- "I think" / "I believe". You're synthesizing evidence, not giving a personal opinion. Use "the evidence suggests" instead.
|
|
52
|
+
|
|
53
|
+
## Avoid Rationalization
|
|
54
|
+
|
|
55
|
+
Code that "makes sense" today may have been written for reasons that no longer apply, or that were wrong at the time. Don't retrofit a clean rationale onto messy history. Don't assume the author did the "right" thing and work backward to justify it. Don't assume a consistent pattern was intentional when it might be copy-paste. Don't turn an absence of evidence into evidence of absence ("no one mentioned security concerns, so it must not have been a concern").
|
|
56
|
+
|
|
57
|
+
## The Sycophancy Trap
|
|
58
|
+
|
|
59
|
+
Users often embed a hypothesis: "Why do we do it this way, I assume it's for performance?" Don't simply confirm it. The guess is a prompt for investigation, not a conclusion to validate. Treat it as one candidate among others and check the evidence independently. If the evidence supports it, say so with citations. If not, say so, and present what the evidence *does* support.
|
|
60
|
+
|
|
61
|
+
## When Evidence Contradicts
|
|
62
|
+
|
|
63
|
+
Surface both sources in the output, with citations. Don't pick the one that fits a tidier narrative. For example, the ticket says "we need this for customer X's compliance requirement" and the PR says "cleaning up tech debt in this area". Both may be true (the ticket motivated the work, the PR gave the author's framing), or one may be wrong. Let the user make the call.
|
|
64
|
+
|
|
65
|
+
## When Evidence Is Missing
|
|
66
|
+
|
|
67
|
+
An honest "we don't know" is one of the most valuable outputs. The user learns the answer isn't in the obvious places, that they'll need to ask a human (the original author, the product owner, the team lead), or that they can decide the question isn't worth pursuing further. Failing to mark a gap, and instead filling it with a confident guess, actively harms the user, because they'll act on the guess. Name each gap concretely: the question, the sources searched, what you searched for in each, and what you found (nothing, or only tangential material).
|
|
68
|
+
|
|
69
|
+
## Before Finalizing
|
|
70
|
+
|
|
71
|
+
Before the synthesizer delivers the output, it checks every claim in "What We Found" and "What We Can Reasonably Infer". Each claim has a citation or moves to Inferred or Hypotheses. Its phrasing matches its tier. It doesn't treat code as evidence for its own intent (if it does, remove or reclassify it). The output has a "What We Don't Know" section. If no gaps are mentioned, that's suspicious. Either the evidence was unusually complete or something is being swept under the rug.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Investigator Prompt Template
|
|
2
|
+
|
|
3
|
+
Fill in the placeholders. Append the one category playbook `sources/<source>.md` for this investigator's evidence category (index: `source-playbook.md`). If the target code looks defensive (null checks, retry logic, timeout handling, rate limiting, feature flags, egress guards, OOM handlers), also append `sources/incident-postmortem.md` so the investigator runs incident-flavored queries inside its own source.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are investigating the historical context and motivation behind a piece of code. Other investigators search other sources in parallel, and a separate synthesizer combines all findings into the final answer. Go deep on your assigned source only. Gather evidence accurately rather than writing prose.
|
|
8
|
+
|
|
9
|
+
Work like a **careful, cautious, and precise investigator**. Surface evidence and describe it accurately, including the parts that don't fit a tidy story. Boring and exact beats plausible. One verbatim quote with a precise citation is worth more than a paragraph of summary.
|
|
10
|
+
|
|
11
|
+
## The Question
|
|
12
|
+
|
|
13
|
+
> {QUESTION}
|
|
14
|
+
|
|
15
|
+
## The Code Anchor
|
|
16
|
+
|
|
17
|
+
**Target files:** {FILES_WITH_LINE_RANGES}
|
|
18
|
+
|
|
19
|
+
**Key symbols:** {SYMBOLS}
|
|
20
|
+
|
|
21
|
+
**Initial commits touching this code (most recent first):**
|
|
22
|
+
{COMMIT_LIST}
|
|
23
|
+
|
|
24
|
+
**PR numbers extracted from commit messages:** {PR_NUMBERS}
|
|
25
|
+
|
|
26
|
+
**Ticket IDs mentioned in commits or PR bodies (if any):** {TICKET_IDS}
|
|
27
|
+
|
|
28
|
+
## Your Assigned Source
|
|
29
|
+
|
|
30
|
+
{SOURCE_NAME}
|
|
31
|
+
|
|
32
|
+
{SOURCE_PLAYBOOK_SECTION}
|
|
33
|
+
|
|
34
|
+
## Investigation Loop
|
|
35
|
+
|
|
36
|
+
1. **Cast a wide net first** so you don't miss related context. Only then narrow in on specific items.
|
|
37
|
+
2. **Read the whole thing.** Read each PR, ticket, doc, or thread fully, not just the title or summary. The key evidence is often in a comment, a subtask, or a follow-up.
|
|
38
|
+
3. **Follow links within your source only.** Pull the PR or commit a PR references, the parent or sibling of a ticket, the doc a doc links. Do NOT chase a cross-source reference. Record it under Additional Leads for that source's investigator. The one-investigator-per-category design depends on this. Chasing it duplicates work and confuses scope.
|
|
39
|
+
4. **Quote verbatim**, with the exact location (PR number, ticket ID, URL, commit hash, file:line), so the reader can confirm the claim in seconds.
|
|
40
|
+
5. **Record what you searched, not just what you found.** Write queries verbatim. An empty search is a finding.
|
|
41
|
+
6. **Resist the story.** If two items in your source disagree, record both. Don't suppress the inconvenient one. If three items line up and a fourth contradicts them, the contradiction is the most interesting finding.
|
|
42
|
+
|
|
43
|
+
Before reporting a finding as strong, ask whether you would expect to find it if your current reading were wrong, and how the evidence would differ. **Never invent.** If you're tempted to round a partial finding up into a confident statement, stop and label it partial. The synthesizer counts on your output being accurate.
|
|
44
|
+
|
|
45
|
+
## Epistemic Discipline
|
|
46
|
+
|
|
47
|
+
- **Mechanics are not motivation.** A commit changing `limit = 50` to `limit = 100` shows the change, not necessarily why. Look for the reason in the commit message, PR description, linked ticket, or review comments.
|
|
48
|
+
- **No intent from code behavior or style.** You may read code to learn what the target *is*. "The author chose a functional approach" is an observation about code, not evidence of intent. Claim intent only where the author stated it.
|
|
49
|
+
- **Preserve uncertainty.** Say when evidence is ambiguous, or when one reading is more plausible but not certain. Don't collapse ambiguity to look decisive.
|
|
50
|
+
- **No silent substitutions.** If the question is about feature X and you only find evidence about feature Y, don't present Y's evidence as if it answers X.
|
|
51
|
+
- **Gather, don't conclude.** Collect the raw material honestly and completely. Don't answer the question, form a final opinion on "the why", or pick sides in contradictions. Don't speculate beyond what the evidence supports. A hunch with no evidence isn't evidence. The synthesizer does the reasoning.
|
|
52
|
+
|
|
53
|
+
## Output Format
|
|
54
|
+
|
|
55
|
+
Return your findings in this structure. The synthesizer reads it directly.
|
|
56
|
+
|
|
57
|
+
### Source
|
|
58
|
+
Which source you investigated (source control, issue / ticket tracker, long-form documents, real-time team chat, infrastructure observability, error / exception tracking, product analytics warehouse, code comments, etc.).
|
|
59
|
+
|
|
60
|
+
### What I Searched
|
|
61
|
+
The queries you ran, items you opened, and places you looked. Be specific. This shows how thorough the search was and what is still unsearched.
|
|
62
|
+
|
|
63
|
+
### Direct Evidence Found
|
|
64
|
+
For each item that explicitly addresses the question:
|
|
65
|
+
- **What it says**: verbatim quote or accurate paraphrase
|
|
66
|
+
- **Where it's from**: PR #123, ticket ID, doc URL, chat permalink, commit hash, or file:line
|
|
67
|
+
- **Author and date** (if available)
|
|
68
|
+
- **Relevance**: one sentence on how it bears on the question
|
|
69
|
+
|
|
70
|
+
### Indirect / Circumstantial Evidence
|
|
71
|
+
For each item that bears on the question without answering it:
|
|
72
|
+
- **What it is**: brief description
|
|
73
|
+
- **Where it's from**: location
|
|
74
|
+
- **What it suggests**: what a careful reader might infer, and the inference chain
|
|
75
|
+
- **Alternative readings**: if the same evidence could support a different interpretation, note it
|
|
76
|
+
|
|
77
|
+
### Contradictions
|
|
78
|
+
Items that disagree with each other, with both citations.
|
|
79
|
+
|
|
80
|
+
### Gaps
|
|
81
|
+
What you searched for and didn't find, specifically: "Searched the issue tracker for [query] across [time range]. No matching issues."
|
|
82
|
+
|
|
83
|
+
### Additional Leads
|
|
84
|
+
Anything that suggests further investigation in a different source, for its investigator or a follow-up pass. For example, a chat thread that a PR mentions.
|
|
@@ -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,51 @@
|
|
|
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, whose 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 and release notes in the repo
|
|
12
|
+
- Issue/ticket IDs 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
|
+
# History 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
|
+
# One commit's full diff
|
|
34
|
+
git show <hash>
|
|
35
|
+
|
|
36
|
+
# Commits between two points affecting this file
|
|
37
|
+
git log <old>..<new> -p -- <file>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Look for out-of-band docs:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# ADRs often live in docs/adr/ or similar
|
|
44
|
+
rg -l -i 'architecture.decision' --glob '*.md'
|
|
45
|
+
|
|
46
|
+
# TODOs and FIXMEs near the target
|
|
47
|
+
rg -n -C2 '(TODO|FIXME|HACK|XXX|NOTE)' <target_file>
|
|
48
|
+
|
|
49
|
+
# Related tests
|
|
50
|
+
rg -l '<symbol>' --glob '*test*'
|
|
51
|
+
```
|
|
@@ -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
|