agentleFS
Alexander-TyagunovAlexander-Tyagunov/magician/skills/divine/SKILL.md

divine

Skill14 starsChanged 49 days agoMITView on GitHub

Research-grounded multi-lens code review of a change, PR or MR, severity-ranked. Use to review or audit a changeset; not for remediation (/scrutinize).

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Remove the scan marker (rm -f .workspace/local/security-scan.active), then close with the quoted signal:

    line 17
  2. Very specific:

    If REVIEW.md exists at the repository root, Read it first.

    line 31
  3. Very specific:

    Monitor mode: when $ARGUMENTS starts with monitor (/loop 1h /divine monitor <repo>: unattended, no fixes), skip the interactive phases and …

    line 35
  4. Very specific:

    Ask how deep the review goes with AskUserQuestion, never in prose.

    line 42
  5. Very specific:

    Larger: write the diff once to .workspace/shared/diffs/<ref>.patch, then dispatch the lenses in parallel, in one message.

    line 57
  6. Very specific:

    Every finding line starts with its tag ([Important], [Nit], [Pre-existing]) and cites file:line, never a bare file, with impact and fix.

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/divine — Deep Code Review

Bundled command: if kg is not found, run it as ${CLAUDE_PLUGIN_ROOT}/tools/kg and give subagents that full path. If that is missing too (Claude chat ships no plugin tools), skip the kg steps and search the code directly.

Review a change for correctness, security, simplification and test quality, grounded in its intent and in external truth. Rank by severity, tag each finding, give a fix. This is the on-demand, PR/MR-aware reviewer. /scrutinize reviews the branch diff mid-flow and remediates. /divine reports, and fixes only on request.

Completion Signal

Remove the scan marker (rm -f .workspace/local/security-scan.active), then close with the quoted signal:

"Divine complete. <N Important, N Nit, N Pre-existing; N fixed, N closed with reason>. Fix in-repo with /scrutinize or /ward task <N>; verify with /certify, then /seal."

When to use

Trigger phrases: "do a code review", "review this PR/MR", "review my changes/diff/branch", "audit this MR". Not for the review that remediates (/scrutinize) or a security-only scan (/sentinel). /transmute invokes /divine as its G7 gateway, checked against .workspace/shared/research/<feature>-parity.md.

On review intent, announce:

"Auto-activating /divine for a structured code review. I will establish the change context, then confirm how deep to go."

Dialect

The review speaks the dialect in lore/review.md. Nits are capped. Remediation runs at most three rounds, diff-only after the first, with a round ledger. The report contract is in Phase 4.

If REVIEW.md exists at the repository root, Read it first. Its values override the defaults, and its text goes into every lens prompt. Platform alternatives (/code-review, claude ultrareview --trust-workspace, the @claude review GitHub flow) are in lore/deep/review.md#platform-surfaces. Recommend one when it fits better.

Phase 0 — Change context

Monitor mode: when $ARGUMENTS starts with monitor (/loop 1h /divine monitor <repo>: unattended, no fixes), skip the interactive phases and follow references/monitor-mode.md.

Read references/change-context.md. Resolve the target from $ARGUMENTS (a PR/MR URL, a branch, or "working tree"). Gather the diff and changed files, the base ref, the PR/MR description and tickets, CI status, and in-repo grounding. Drop the REVIEW.md skip paths. Summarize the change and its scale in two sentences, silently.

Phase 1 — Depth gate

<HARD-GATE> Ask how deep the review goes with `AskUserQuestion`, never in prose. Skip the gate only when the user named a depth ("quick review", "deep review of …"). </HARD-GATE>

Four depths: Quick, Standard (default), Deep, Exhaustive. The matrix is in references/depth-and-research.md. A High-tier change per REVIEW.md gets Deep at least. At Deep or Exhaustive, or on unfamiliar ground, invoke /magic first for external truth. Prefer the latest coding model; suggest it, never switch silently (lore/models.md).

Autonomy

After the depth gate, run to completion without more questions: context reads, kg blast radius, lens dispatch, verification, the report. Re-gate only on side effects: a post to the PR/MR (Phase 5) and, on request, edits, commits and pushes (Phase 6). Web fetches show Claude Code's normal prompt. Doctrine: lore/autonomy.md.

Phase 2 — Multi-lens review

First run mkdir -p .workspace/local && touch .workspace/local/security-scan.active. While the marker exists, the PreModelSwitch hook holds a model switch for confirmation. Remove it in the Completion Signal and on any early exit.

Lenses: magician:reviewer (correctness), magician:sentinel (security, supply chain), magician:simplifier (over-engineering), magician:verifier (tests, Deep and Exhaustive, always fresh). Pick the path by the measured diff size (lore/fold-first.md):

  • Small (3 files or fewer, 300 changed lines or fewer): run each lens but the verifier in the main loop, with agents/<lens>.md as its checklist. Quick depth here makes no Agent call. A High-tier change dispatches its lenses fresh at any size.
  • Larger: write the diff once to .workspace/shared/diffs/<ref>.patch, then dispatch the lenses in parallel, in one message. Fork or fresh follows lore/deep/review.md#fork-or-fresh.

Each spawn prompt is self-contained (goal, patch path, intent, grounding, REVIEW.md text, ledger path, return format). Templates in references/dispatch.md, contract in lore/subagent-context.md. On NEEDS_CONTEXT, add the input and re-dispatch.

Finders optimize for recall. Never tell a lens to be conservative or to skip nits. Phase 3 removes the noise, and it can only remove what the finders surfaced.

Phase 3 — Adversarial verification

Try to refute every Critical and High finding against the code and the intent, in a fresh context, never in a fork. At Exhaustive, use independent votes. At Quick on a small diff, run this check in the main loop and state Verification: in-loop in the report. Keep the survivors, list the rest as dropped. Details in references/depth-and-research.md.

Phase 4 — Report

Deduplicate and rank, then read references/report-format.md and follow its template. The contract:

  • The first line under the heading is the count line, plain, in this order: N Important, N Nit, N Pre-existing; N fixed, N closed with reason. Count it from the list you write.
  • Every finding line starts with its tag (**[Important]**, **[Nit]**, **[Pre-existing]**) and cites file:line, never a bare file, with impact and fix.
  • A refuted candidate goes only under Dropped. The closing signal repeats the count line; it never replaces it.

Phase 5 — Deliver and post

Present the report in chat. For a real PR/MR, offer to post:

<HARD-GATE> A post publishes on the user's behalf. Confirm through `AskUserQuestion`, show the exact text, and check the GitHub/GitLab account before any `gh` or `glab` write. Never post without a clear yes. </HARD-GATE>

Commands and inline-comment format: references/report-format.md.

Phase 6 — Fixes on request

Offer fixes through AskUserQuestion. The default is "just report". The round flow, the ledger, and the commit and push gate are in references/remediation.md.

Obstacles

As a consumer, roll the lenses' Obstacles blocks into one report, separate from the findings. Memorize a confirmed pattern with ctx learn --add "<signature -> workaround>" in your own words, never secrets or PII. As a producer, on a non-clean run return the Obstacles block from lore/obstacles.md (fields: STATUS, OBSTACLE, BLOCKER, SEVERITY, WORKAROUND, RECURRENCE, SCOPE, NEXT) with what you completed.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.