why
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Searches available evidence sources and returns a cited account of decisions and tradeoffs. Use how for runtime behavior.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- why
- description
- Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Searches available evidence sources and returns a cited account of decisions and tradeoffs. Use how for runtime behavior.
02 资源文件 12
- 参考文档references/epistemics.md6.6 KB
- 参考文档references/investigator-prompt.md5.4 KB
- 参考文档references/source-playbook.md1.4 KB
- 参考文档references/sources/code-archaeology.md1.4 KB
- 参考文档references/sources/databricks.md6.8 KB
- 参考文档references/sources/datadog.md4.9 KB
- 参考文档references/sources/incident-postmortem.md372 B
- 参考文档references/sources/linear.md2.9 KB
- 参考文档references/sources/notion.md2.8 KB
- 参考文档references/sources/sentry.md2.0 KB
- 参考文档references/sources/slack.md1.3 KB
- 参考文档references/synthesizer-prompt.md7.0 KB
03 SKILL.md 正文
Why
Investigate the motivation and intent behind code. The how skill explains what the code does. This skill explains which constraints and decisions gave it that shape.
Operating posture
Act as a careful investigator. Separate direct evidence from inference, surface contradictions, and name missing evidence. Read references/epistemics.md before synthesis.
Step 1. Understand the target
Identify the code, pattern, feature, or decision in question. If the target is vague, state the best interpretation from the conversation and proceed.
Step 2. Establish the code anchor
Before searching other sources, collect:
- the relevant paths, lines, and symbols;
- recent commits that touched them;
- pull request and ticket identifiers from those commits.
Use the repository's own history and forge tools. Typical commands include:
git blame -L <start>,<end> <file>
git log --follow -p -- <file>
git log --oneline -20 -- <file>
git log -1 --format=%B <commit>
Fetch the body and discussion for substantive pull requests. Pass the resulting code anchor to every evidence search.
Step 3. Search the available evidence
Resolve host capabilities and the active profile through HOST-COMPATIBILITY.md. Inspect live tools, MCP servers, connectors, and shared resources.
Map each available source to one category:
- source control history;
- issue or ticket tracking;
- long-form documents;
- real-time team chat;
- infrastructure observability;
- error tracking;
- product analytics.
Source control is always available. Record missing categories instead of pretending they were searched.
Create a semantic unit for every available category. Dispatch the units as why-investigators through the active profile. Its partition rule may assign several units to a worker. Keep the units distinct and instructionally read-only.
Each unit receives:
references/investigator-prompt.md;- the matching playbook under
references/sources/; references/sources/incident-postmortem.mdwhen the target contains defensive runtime behavior;- the code anchor;
- the user's question.
Evidence categories
- Source control. Git history, pull requests, comments, tests, and repository documents. This is the only guaranteed source.
- Issue tracker. Product or business constraints recorded in tickets.
- Long-form documents. Design rationale in specifications, ADRs, and postmortems.
- Team chat. Deliberation that never reached a durable document.
- Infrastructure observability. Runtime conditions that motivated limits, retries, timeouts, or similar defenses.
- Error tracking. Specific failures that motivated corrective code.
- Product analytics. Usage or data distributions that shaped behavior and thresholds.
Skipping a category
Skip a category only when no matching source is available or the source is demonstrably irrelevant. Record the reason in the final coverage map. A null search result is evidence. An unsearched source is a gap.
A single-commit question may stay inline when the pull request already contains the full answer and the other available categories would add no evidence. State that scope choice.
Step 4. Synthesize
Dispatch one shared brief as why-synthesizer. Give it:
- every result and recorded gap;
- the code anchor;
- the user's question;
references/epistemics.md;references/synthesizer-prompt.md.
The active profile decides whether the coordinator or workers perform synthesis. The coordinator checks citations, reconciles returned drafts, and owns the final answer.
Step 5. Present
Preserve the synthesizer's confidence labels. Use the structure 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.
If the user may change the code next, finish with Preserve, Change, Avoid, and Risk constraints.
Failure mode
Do not assume the newest commit explains the current design. Trace the history far enough to identify the decision that introduced the behavior.
References
references/epistemics.mddefines confidence levels.references/investigator-prompt.mddefines the evidence-search brief.references/source-playbook.mdmaps evidence categories to source playbooks.references/sources/*.mdcontains one playbook per source category and the defensive-code supplement.references/synthesizer-prompt.mddefines synthesis and output.
04 同仓库更多 Skills
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
wizard
Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
wayfinder
Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
unslop
Cut AI tells from prose. Use before writing or revising any reply, doc, PR description, commit message, or skill text another reader will see, or for /unslop.
typescript-best-practices
TypeScript best practices. Use when reading or editing any .ts or .tsx file.
triage
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.