/grimoire:divinefrom grimoire
Investigates the motivation and intent behind security-relevant code, producing confidence-calibrated, source-backed rationale with tradeoffs and gaps.
Ships in grimoire. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Investigate the motivation and intent behind security-relevant code or design.
divine is also invocable as /why. It is the Grimoire version of a "why"
archaeology skill. It complements:
cartography, which maps where things are.tome, which preserves durable source-backed conclusions.finding, which reports verified vulnerabilities.Divine answers what forces likely led to the current shape. It does not treat code mechanics as proof of intent.
It can often help to understand why something has the shape it does. Strange code is not automatically vulnerable, but it may reveal a historical incident, customer constraint, protocol invariant, integration boundary, threat model assumption, or forgotten workaround.
Operate as a careful, cautious investigator. Be honest about what is known, what is inferred, what is speculative, and what remains unknown. A boring cited answer is better than a confident story.
Never claim "this exists because..." unless a source says so directly or several independent sources strongly converge. Code shows what happens; commits, PRs, issues, docs, comments, tests, incidents, and prior tomes are where rationale may live.
Every important claim must sit in one tier:
| Tier | Meaning | Phrasing |
|---|---|---|
| Direct | A source explicitly states the rationale | "This exists because..." with citation |
| Supported | Multiple indirect sources converge | "The evidence points to..." with citations |
| Inferred | Reasonable interpretation from context | "It appears", "likely", "suggests" |
| Speculative | Plausible but thin evidence | "One possibility is..." |
| Unknown | Searched but not found | "We searched X and found no rationale" |
Do not upgrade a claim by repeating it. Do not use Direct phrasing for Inferred claims. If the user proposes a hypothesis, treat it as one candidate, not a conclusion to validate.
When this skill is activated, create a todo list from the following steps. Mark each task in_progress before starting it and completed when done.
- [ ] 1. Understand the target and question
- [ ] 2. Establish the code or artifact anchor
- [ ] 3. Build an evidence coverage map
- [ ] 4. Investigate available evidence sources
- [ ] 5. Synthesize rationale and competing hypotheses
- [ ] 6. Translate security implications
- [ ] 7. Record durable conclusions
- [ ] 8. Present confidence-calibrated answer
Parse what the user is asking.
The target is usually:
GRIMOIRE.md, a tome, cartography, or findingThe question is usually:
If the target is vague, make the best interpretation from conversation context and state it briefly before proceeding.
Before investigating intent, anchor the question in concrete material.
Collect:
Useful commands:
git blame -L <start>,<end> <file>
git log --follow -p -- <file>
git log --oneline -20 -- <file>
git log -1 --format=%B <commit>
rg -n "<symbol|constant|error|event|issue-id>" .
If gh is available and the commit history references PRs, inspect substantive PRs:
gh pr view <number> --json title,body,author,createdAt,mergedAt,labels,closingIssuesReferences,comments,reviews
Do not assume the newest commit is authoritative. Current behavior is often the accumulation of several older choices.
Document the evidence categories that are available and unavailable. Search broadly first, then narrow.
Evidence categories:
| Category | Examples | What it reveals |
|---|---|---|
| Grimoire artifacts | GRIMOIRE.md, tomes, cartography, findings, sigil findings | Prior research, local conclusions, known gaps |
| Source control | Git history, PRs, reviews, code comments, tests | Implementation-time rationale |
| Issues and tickets | GitHub Issues, Linear, Jira, Plane, Shortcut | Product, customer, audit, or business pressure |
| Long-form docs | Design docs, specs, ADRs, Notion, Confluence, docs | Planned architecture and rejected alternatives |
| Communication records | Slack, Discord, Teams, email, meeting notes | Decisions that never reached formal docs |
| Runtime evidence | logs, metrics, traces, deployed config, dashboards | Operational pressure behind defensive behavior |
| Error tracking | Sentry, Rollbar, Bugsnag, incident reports | Exceptions or regressions that motivated fixes |
| Product or protocol data | analytics, on-chain events, governance posts | Real-world usage, governance, or economic constraints |
If a category is unavailable, record that as a gap. Do not silently skip it. Only mark a category irrelevant when it is provably unrelated to the target.
For each available source, gather evidence rather than writing a story.
Record:
Read full PRs, issues, docs, or threads when they are relevant. Important rationale is often buried in comments, review discussion, subtasks, or follow-up commits.
For defensive-looking code, search for incidents and regressions:
Do not chase active production systems or externally visible tests without explicit authorization.
Weigh the evidence using the confidence tiers.
Separate:
When evidence contradicts, surface both sides with citations. Do not pick the tidier story unless stronger matching evidence resolves the conflict.
Ask:
After rationale is calibrated, translate it into security research guidance.
Produce a Preserve / Change / Avoid / Risk set when the user may modify or audit the target:
## Constraints For Future Work
- Preserve: [properties or compatibility requirements that evidence supports]
- Change: [parts that appear accidental, stale, or weakly supported]
- Avoid: [edits that would break an invariant, scope assumption, or operational guard]
- Risk: [security questions or attack hypotheses still unresolved]
If the rationale suggests a vulnerability, do not file it as fact. Create a concrete hypothesis:
If [attacker capability or system condition], then [mechanism] may cause
[security impact], unless [mitigating condition].
Route follow-up work:
/finding-draft for a verified vulnerability./tome for durable rationale, negative results, or unresolved questions./scribe-distill if the pattern should become a reusable detection./cartography if the investigation revealed missing navigation.If the investigation changes understanding, write or update a tome.
Record:
For thin or unresolved questions, update grimoire/tomes/notes/hypotheses.md,
grimoire/tomes/notes/unverified-claims.md, or
grimoire/tomes/notes/contradictions.md when those files exist or are useful.
Preserve useful negative results so future agents do not repeat the same search.
Use this structure:
## The Question
[Restate the target and why-question.]
## The Anchor
[Files, line ranges, symbols, commits, PRs, tomes, findings, or other artifacts.]
## What We Found
- [Direct] [Claim with citation.]
- [Supported] [Claim with multiple pieces of evidence.]
## What We Can Reasonably Infer
- [Inferred] [Hedged claim with the inference chain.]
## Competing Hypotheses
- Hypothesis: [One possible explanation.]
Evidence for: [Specific evidence.]
Evidence against or missing: [Specific gap.]
## Security Implications
- Preserve: [What should remain true.]
- Change: [What can likely change.]
- Avoid: [Dangerous edits or assumptions.]
- Risk: [Open security hypothesis.]
## What We Don't Know
- [Specific unanswered question and sources searched.]
## Sources Consulted
- Grimoire artifacts: [paths searched or not available]
- Source control: [commits, PRs, files searched]
- Issues and tickets: [queries or unavailable]
- Long-form docs: [docs or unavailable]
- Communication records: [queries or unavailable]
- Runtime evidence: [logs/metrics/config or unavailable]
- Error tracking: [issues/incidents or unavailable]
- Product/protocol data: [queries or unavailable]
## Confidence Summary
[One or two sentences summarizing the strength and limits of the answer.]
Skip empty sections only when they genuinely do not apply, but keep What We Don't Know, Sources Consulted, and Confidence Summary.
Before finalizing:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
24 skills in this plugin
/annotationThis skill should be used when the user says "find annotations", "list audit tags", "show @audit comments", "compile annotations", "/annotation", "find todos", "find audit comments", "what did I annotate", "annotation summary", "list audit findings", "what's annotated", or wants to discover, list, or filter @audit-* comment annotations scattered throughout a codebase. This skill is for annotation discovery only — how annotations are used downstream (spawning subagents, cross-referencing findings, etc.) is out of scope./cartographyThis skill should be used when the user says "build context on a flow", "trace a flow", "map how X works", "cartography", "/cartography", "document a flow", "create a flow map", "trace how authentication works", "map the data flow", or wants to explore and document how a specific code flow works so that context can be quickly rebuilt on future visits. This is the primary skill for creating cartography files in grimoire/cartography/./checksnpx claudepluginhub joranhonig/grimoire --plugin grimoireOther plugins' skills for the same job