agentleFS
pablonificationpablonification/grok-build-consult-claude/skills/consult-claude/SKILL.md

consult-claude

Skill0 starsChanged 5 months agoMITView on GitHub

Read-only second opinion from Claude Code (claude -p). Use when the user explicitly asks ("ask Claude", "second opinion", "/consult-claude") OR when a HARD GATE passes: high-stakes architecture/security decisions, 2+ credible approaches with real trade-offs, or blocked after 2+ distinct attempts. Modes: plan, review, advice. Do NOT use for routine coding, debugging, file edits, or "just to be thorough". Grok implements any follow-up changes.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. epicenter-md/epicenter★ 4.8ksame name
    2. EpicenterHQ/epicenter★ 4.8ksame name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do NOT consult unless one of these is true:

    line 19
  2. Distinctive:

    Not answerable from repo/docs alone without gambling.

    line 25
  3. Distinctive:

    If the gate fails, continue as Grok.

    line 27
  4. Very specific:

    If implicit: read ${RUBRIC}, confirm the gate passes, write a one-sentence consult reason.

    line 74
  5. Distinctive:

    If explicit: skip gate but still use read-only wrapper.

    line 75
  6. Very specific:

    Write the assembled prompt to a temp file, e.g.

    line 98
  7. Distinctive:

    Do not background this unless the user asked to wait asynchronously.

    line 114
  8. Very specific:

    Read response.txt and files-changed.txt.

    line 129
  9. Distinctive:

    Do not dump Claude's reply verbatim.

    line 133

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Consult Claude (read-only)

Grok Build stays primary. Claude Code is an expensive advisor only — never an implementer.

<HARD-GATE> Do NOT consult unless **one** of these is true:
  1. Explicit — user asked for Claude's opinion, second opinion, or ran /consult-claude.
  2. Implicit — ALL of:
    • Stakes are high (wrong choice wastes significant time, or touches security/auth/data/migrations/concurrency), AND
    • Genuinely uncertain (2+ credible approaches, or stuck after 2+ distinct attempts on the same blocker), AND
    • Not answerable from repo/docs alone without gambling.

If the gate fails, continue as Grok. Do not consult "to be safe." </HARD-GATE>

Limits

  • Read-only — Claude must not edit files. Grok applies changes if needed.
  • Max 1 implicit consult per user task unless the user asks again.
  • No consult loops — do not ping-pong Grok ↔ Claude repeatedly.
  • Log the reason — always tell the user why Claude was consulted.

Model selection (always latest family alias)

Pass --model <alias> to the wrapper. Aliases resolve to the latest model in each family (e.g. opus → current Opus, sonnet → current Sonnet, fable → current Fable). Never hardcode dated model IDs.

AliasUse when
opusArchitecture with hard trade-offs, security/auth threat modeling, concurrency/distributed design, ambiguous high-stakes decisions, deep review of a large risky change
sonnetPlan critique, code/design review, implementation approach comparison, "is this plan sound?", medium-scope advice where speed/cost matter
fableGreenfield product shape, UX/flow exploration, creative alternatives, early brainstorming before commitment — exploratory, not final security sign-off

Default if unsure: sonnet for review/plan modes; opus for advice when security or irreversible architecture is involved; fable only when exploring options, then re-consult with opus or sonnet before committing.

Override with --model when the user requests a specific family.

Invocation

/consult-claude plan [question]
/consult-claude review [question]
/consult-claude advice [question]
/consult-claude review --model opus
/consult-claude                    # infer mode from context; ask if unclear

Orchestration steps

Resolve paths once at start:

SKILL_DIR   = <dirname of this SKILL.md>
CONSULT_SH  = ${SKILL_DIR}/scripts/consult.sh
RUBRIC      = ${SKILL_DIR}/references/gating-rubric.md
PROMPTS_DIR = ${SKILL_DIR}/references/prompts

1. Gate

  • If implicit: read ${RUBRIC}, confirm the gate passes, write a one-sentence consult reason.
  • If explicit: skip gate but still use read-only wrapper.

2. Choose mode and model

ModePurposePrompt template
planCritique or compare approaches before implementation${PROMPTS_DIR}/plan.md
reviewReview diff, design, or current code state${PROMPTS_DIR}/review.md
adviceUnblock a specific decision or failure${PROMPTS_DIR}/advice.md

Pick model per table above. State mode, model alias, and reason in your reply preamble.

3. Assemble context bundle

Build a focused prompt (not the whole repo):

  • Goal — one sentence
  • Open question — what Claude must answer
  • Grok's current position — draft plan, hypothesis, or summary (ask Claude to critique, not restart)
  • Relevant files — paths and contents (only what matters; cap ~30k chars unless user asked for more)
  • Constraints — stack, non-goals, deadlines
  • Attempt history (advice mode) — what was tried and what failed

Write the assembled prompt to a temp file, e.g. /tmp/consult-claude-prompt-$$.md.

4. Run consult (blocking)

From the workspace root of the project under discussion:

"${CONSULT_SH}" \
  --mode <plan|review|advice> \
  --model <opus|sonnet|fable> \
  --workspace "<absolute-workspace-path>" \
  --prompt-file "/tmp/consult-claude-prompt-$$.md" \
  --reason "<consult reason>"
  • Set block_until_ms ≥ 120000 (Claude can take 30–90s).
  • Do not background this unless the user asked to wait asynchronously.
  • On non-zero exit: report stderr; do not pretend the consult succeeded.

5. Read output

The script prints JSON to stdout and writes artifacts under /tmp/consult-claude-<run_id>/:

FileContents
result.jsonFull Claude --output-format json payload
response.txtHuman-readable reply text
pre-workspace.snapshotgit diff HEAD + staged diff + untracked list before consult
post-workspace.snapshotSame snapshot after consult
files-changed.txtPaths that changed (should be empty)

Read response.txt and files-changed.txt. If summary JSON has "is_error": true, treat as failure — do not use the response as advice. If files-changed.txt is non-empty, warn the user — Claude was supposed to be read-only.

6. Synthesize (Grok owns the decision)

Do not dump Claude's reply verbatim. Provide:

  1. Consult meta — mode, model alias, reason, cost if present in JSON
  2. Claude's assessment — concise summary
  3. Agreement — what Grok accepts
  4. Disagreement — what Grok rejects and why (repo context Grok has that Claude may not)
  5. Recommended next step — Grok executes changes, not Claude

What NOT to pass to Claude

  • Entire monorepos or node_modules
  • Secrets, API keys, tokens (redact first)
  • Vague "what do you think?" without Grok's draft position
  • Tasks Grok can resolve with one file read or a test run

Error handling

SituationAction
claude not foundTell user to install Claude Code; stop
Auth failureTell user to run claude interactively to refresh login
TimeoutRetry once with sonnet; if still failing, report and continue as Grok
Unexpected file changesShow diff summary; do not auto-apply; ask user

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.