grimoire-spec

grimoire-spec is a skill for Claude Code from ojCezarFerreira/Grimoire. It costs 30 tokens per session (3,144 once invoked), scanned A, original, MIT.

A Grimoire specification workflow turns a request for a page into a written SPEC.md file. It also records the page in HISTORIC.md, a project history log, when applicable.

In plain words
What is it for?
Use it to define a page clearly, gather relevant project context, and register the specification in the Grimoire project history.
Why use it?
It creates a shared description of the requested page before planning or building it. This helps preserve project context and keeps the page lifecycle traceable.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the grimoire plugin — 11 skills shipped together

Good fit Use it to define a page clearly, gather relevant project context, and register the specification in the Grimoire project history.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add ojCezarFerreira/Grimoire
Claude Code
/plugin install grimoire

Made for: Claude Code.

Or install grimoire, the plugin that ships this one along with the rest of its 11 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for grimoire-spec

README.md
[![agentmods](https://agentmods.dev/badge/skills/ojcezarferreira/grimoire/grimoire-spec/github.svg)](https://agentmods.dev/skills/ojcezarferreira/grimoire/grimoire-spec)
Your own site
<a href="https://agentmods.dev/skills/ojcezarferreira/grimoire/grimoire-spec"><img src="https://agentmods.dev/badge/skills/ojcezarferreira/grimoire/grimoire-spec/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for grimoire-spec

Your own site · 80×15
<a href="https://agentmods.dev/skills/ojcezarferreira/grimoire/grimoire-spec"><img src="https://agentmods.dev/badge/skills/ojcezarferreira/grimoire/grimoire-spec.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,144 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.03144
Opus 5 $0.00015 $0.01572
Sonnet 5 $0.00006 $0.00629
Haiku 4.5 $0.00003 $0.00314

Measured 9d ago against content hash bbe41094beaf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

grimoire-spec scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/grimoire-spec/SKILL.md · 136 lines

How it starts

The opening of the file, as written. The whole thing — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.

[Required Reading]

  1. Read ${CLAUDE_PLUGIN_ROOT}/GRIMOIRE-CONVENTIONS.md. Its rules (§ Skill composition, § Commits, § .grimoire/ layout, § Project context, § Historic, § Construct, § IDE-aware review, § User-facing language, § Pause-point pattern) are load-bearing for this skill. Note: this skill is the writer for HISTORIC.md (bootstrap + append + rotate); grimoire-plan and grimoire-execute only update status in place. On construct files this skill makes only the single in-place [pending][specced] reference flip defined in § Construct — it never authors or rewrites construct content. § TDD does not apply here — this skill produces a specification, not code.
  2. If .grimoire/PROJECT.md exists in the project root, read it for project context. If it does not exist, proceed without it and suggest the user run grimoire-init once this task is complete.
  3. If .grimoire/HISTORIC.md exists, read it for recent-page context. If older context seems relevant, browse .grimoire/bag/historic/ (newest suffix first). Missing → proceed without it; this skill will bootstrap it in Phase 6.

[Objective] Turn a request into a clear, agreed-upon SPEC.md for a page, and register that page in HISTORIC.md with status [spec]. This is the first step of the long-form Spec → Plan → Execute pipeline. grimoire-plan will refuse to run on a page that does not have a SPEC.md and a matching [spec] entry, so this skill is the only legitimate way to open a new page.

This skill has two modes, chosen by Phase 0 from the input shape:

  • New-page mode (free-text input) — the long-standing flow: analyze, interview, write SPEC.md, register in HISTORIC.md. It now also carries a size-evaluation pause that can route a too-large request to a construct.
  • Construct-consumption mode (bare-number input) — expand the next [pending] reference of an existing construct into a normal page, then flip that reference to [specced] in CONSTRUCT.md. See § Construct.

User's request:

$ARGUMENTS

[Phase 0: Input-Mode Detection] Inspect the input ($ARGUMENTS / $1) and branch before any analysis:

  • Only digits (one or more digits with optional leading zeros, e.g. 42 or 042 — nothing else, no surrounding words) → Construct-consumption mode. Skip Phases 1–7 and go straight to [Phase C: Construct Consumption] below.
  • Anything else (free text) → New-page mode. Proceed to Phase 1 below.

The two paths are mutually exclusive; pick exactly one. The rest of this section (Phases 1–7) is the new-page path.

[Phase 1: Codebase Analysis]

  • Analyze the relevant slice of the codebase for the user's request. Read only what is needed to form an informed opinion (existing modules, neighboring patterns, schemas, public APIs, tests in the same area).
  • Identify what already exists and could be reused. Surface patterns the new page should follow.
  • Collect candidate facts and constraints. Anything you cannot infer goes into Phase 2 as a question. Do not invent facts.

[Phase 1.5: Size Evaluation] After the codebase/request analysis and before committing to write a page's SPEC.md, judge whether the request fits a single page. Apply the size-evaluation pause per § Pause-point pattern (grimoire-spec: size-evaluation pause):

  • If the request fits one page (the common case), continue to Phase 2 with no pause.
  • If the request is too large for a single page, recommend creating a construct and PAUSE for the user's decision. Reference § Construct (size-evaluation trigger & handoff-brief contract) — do not restate its rules here.
    • On approval: write the handoff brief — the best possible prompt to feed grimoire-construct, capturing the objective, the arc you envision, and the facts/constraints surfaced in Phase 1 — to .grimoire/bag/drafts/construct-brief-<epoch>.md, generating <epoch> as $(date +%s) at write time and creating .grimoire/bag/drafts/ if needed. Then STOP: tell the user to start a fresh, clean-context session and run /grimoire-construct with that brief. Create no page folder, no SPEC.md, no HISTORIC.md entry, and make no page-state commits. The brief persists (it is consumed by a different session); do not delete it.
    • On decline: proceed exactly as today through Phases 2–7 as a normal (possibly large) page — grimoire-plan will split it into step files later.

Read the full file on GitHub · 136 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 136 lines · 30 tokens per session scan A bbe41094beaf

Subscribe to this mod's changes

grimoire-spec is a skill published in the GitHub repository ojCezarFerreira/Grimoire (2 stars, last pushed 2mo ago), licensed MIT. It adds 30 tokens to every session and 3,144 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens