From grimoire
Identify gaps between the grimoire specification and the actual plugin implementation. Build or update a prioritized implementation plan.
How this command is triggered — by the user, by Claude, or both
Slash command
/grimoire:gap-analysisThe summary Claude sees in its command listing — used to decide when to auto-load this command
# /gap-analysis Compare the grimoire specification against the current plugin implementation to find gaps, then build or update a prioritized implementation plan. ## Codex Delegation Note Only use Codex workers when the user explicitly asks for delegation or parallel agent work. Otherwise, perform the same steps locally with focused `rg` searches, batched file reads, and item-by-item notes. ## Important Constraints - The specification lives in the `grimoire/grimoire/` directory. These files are written by a human and are the source of truth. - The implementation lives in everything e...
Compare the grimoire specification against the current plugin implementation to find gaps, then build or update a prioritized implementation plan.
Only use Codex workers when the user explicitly asks for delegation or parallel agent work.
Otherwise, perform the same steps locally with focused rg searches, batched file reads, and
item-by-item notes.
grimoire/grimoire/ directory. These files are written by a
human and are the source of truth.skills/, marker-groups/,
.codex-plugin/, README.md, etc.) — everything outside grimoire/grimoire/.When delegation is explicitly authorized, helper passes need the following Codex-native scopes:
rg and inspect implementation files for each item.IMPLEMENTATION_PLAN.md.When working locally, treat this list as the file-read/search scope for each pass.
Anchor all file references to the repo root at grimoire/ (the git repository root, NOT
grimoire/grimoire/).
grimoire/grimoire/ — contains subdirectories skills/, agents/,
concepts/, and files like README.md, notes.mdgrimoire/ — contains skills/, marker-groups/,
.codex-plugin/plugin.json, README.mdgrimoire/skills/*/SKILL.md (each skill has its own directory)These two trees are completely separate. Do not confuse grimoire/grimoire/skills/ (spec)
with grimoire/skills/ (implementation).
Check whether IMPLEMENTATION_PLAN.md exists at the repo root (grimoire/IMPLEMENTATION_PLAN.md).
If it exists, read it to understand:
Use this as a starting point — not a constraint. The plan may be outdated or incorrect; the gap analysis below is the source of truth. But reading it first avoids redundant discovery and helps calibrate expectations.
Always perform a full analysis — do not skip items based on prior runs. The implementation may have changed (features added, removed, or regressed) even when specs haven't, so every item must be re-evaluated.
Before cataloging the spec, study 2-3 of the most mature implemented skills to learn what a
well-built skill looks like in this plugin. Run 2-3 helper passes in parallel when authorized, one per skill
directory (pick skills with the most files in grimoire/skills/). Each helper pass reads the
full skill directory and reports:
Merge these reports into a pattern profile — a short description of what a complete, high-quality skill implementation looks like in this repo. This profile is passed to every Step 2 helper pass so they can assess implementation quality, not just existence.
Use up to 250 parallel helper passes to read ALL files in the grimoire/grimoire/ directory tree.
Assign one helper pass per spec file when authorized; otherwise process files in batches. Each pass reads its assigned file and extracts every
distinct item described in it, returning a structured list.
There are two categories of spec items with fundamentally different roles:
Implementable items (skills, agents, infrastructure) — things that get built as discrete components in the plugin. Each has a corresponding implementation artifact.
Cross-cutting items (concepts, flows) — these do NOT map to discrete implementations. Concepts describe principles and aspects that should be woven into multiple skills/agents (e.g. backpressure isn't a skill to build — it's a principle skills should embody). Flows describe activities showing how agents/skills interact (e.g. autonomous discovery isn't a feature — it's a process description of how sigil, familiar, librarian, etc. collaborate).
Each implementable item in a helper pass's output must have:
skill:cartography, agent:familiar, infra:directory-structure)grimoire/grimoire/ files describe this item (absolute paths)detailed (enough to implement), partial (some detail, some
gaps), sketch (mentioned but too vague to implement directly)Each concept or flow in a helper pass's output must have:
concept:backpressure, flow:autonomous-discovery)grimoire/grimoire/ files describe this item (absolute paths)One helper pass should specifically handle grimoire/grimoire/ideas/ for roadmap items. Items
only mentioned in ideas/ without their own spec file should be marked as sketch detail level.
Important: every skill, agent, concept, flow, and piece of infrastructure described gets its
own entry. If a single file describes multiple items (e.g. scribe.md describes both the
scribe skill and sub-skills like distill, gc, indexing), each gets a separate entry.
After all helper passes complete, merge their results into two deduplicated lists: one for implementable items, one for cross-cutting items. If multiple helper passes report the same item (e.g. referenced across files), merge their spec_files lists and keep the most detailed summary.
Return ONLY the structured lists, not prose.
Launch two groups of helper passes in parallel: one for implementable items, one for cross-cutting items.
For EACH implementable item (skills, agents, infrastructure) returned in step 1, run a separate helper pass. Launch all helper passes in parallel.
Each helper pass receives:
Each helper pass must:
Read the spec — Read the spec_files listed for this item to understand what's specified. This intentional re-read ensures each helper pass has full isolated context.
Search the implementation — Search the plugin codebase OUTSIDE grimoire/grimoire/
for corresponding implementation. Specifically:
grimoire/skills/*/SKILL.md, check for matching references/,
examples/, scripts/ directories within each skillgrimoire/skills/ (agents may be invoked from within skill instructions)grimoire/.codex-plugin/plugin.json, grimoire/marker-groups/, scripts, and the
directory layout of implemented skills.grimoire/README.md for what's described as shipped.Scan for implementation debt — In every implementation file found, grep for TODO,
FIXME, PLACEHOLDER, STUB, HACK, and XXX. Note any hits. Also check whether the
skill has references/, examples/, and scripts/ directories — compare against the
pattern profile from Step 0.5 to flag missing structure that peer skills have.
Classify the gap — Return a structured report with:
implemented — a corresponding feature exists and covers the specpartial — something exists but is missing described behaviorsshallow — implementation exists but lacks supporting structure (references, examples,
scripts) that peer skills have, OR contains significant TODOs/placeholdersstale — implementation exists but doesn't match the current spec (spec has evolved
past what was built)not_implemented — described in spec but nothing corresponding in the pluginpartial/shallow/stale items: specific behaviors/features
described in spec but absent from implementation. For not_implemented: what would
need to be built.implemented —
even a fully implemented skill may have tasks if the spec describes behaviors or
features not yet covered. Each task should be concrete enough to act on (e.g. "add
reference doc for reentrancy patterns" not "improve references"). Items with no
remaining work should have an empty tasks list.Note: spec_detail of sketch does not change the status classification. A sketch-level
item can still be not_implemented. The distinction matters in step 4 where sketch items
are deprioritized for recommendation.
Each helper pass should be thorough but focused only on its single item. It should NOT attempt to analyze other items.
For EACH concept and flow from step 1, run a separate helper pass. Launch in parallel only when authorized.
Concepts and flows do NOT have their own implementation — they describe principles and activities that should be reflected across skills and agents. The goal is to assess adoption, not existence.
Each helper pass receives:
Each helper pass must:
Read the spec — Read the spec_files to understand what the concept prescribes or what the flow describes.
Assess adoption — For each implementable item in the touches list that is actually implemented, check whether the implementation reflects the concept or supports the flow:
Return an adoption report with:
adopted — the principle/activity is well-reflected across relevant implementationspartially_adopted — some implementations reflect it, others don'tnot_adopted — the principle/activity is not reflected in implementationsblocked — the implementations it touches don't exist yet, so adoption can't be
assessedCollect all helper pass reports. Assemble two separate outputs:
Implementable items table with columns:
Cross-cutting adoption table with columns:
Sort all implementable items that have remaining tasks into a prioritized implementation
order. This includes not_implemented, partial, shallow, stale, and implemented
items with non-empty task lists. Items with spec_detail sketch go in a separate
unprioritized bucket — they need spec work before they can be planned.
For the remaining items, apply a two-level sort:
First: sort by item type tier. Skills and agents always come before flows, and flows always come before concepts. This reflects that concrete, buildable components are more actionable than workflow descriptions, which in turn are more actionable than design principles. Infrastructure items are sorted alongside the tier of their closest dependency (e.g. infrastructure supporting a skill sorts with skills).
Second: within each tier, sort by:
Clarity — Is the spec detailed enough to implement without guessing? Prefer items where the grimoire/ spec clearly describes what the skill/agent should do.
Impact — Does this unlock other features or fill a critical gap in the workflow? Consider dependencies: if skill A depends on agent B, implementing B first has higher leverage. Also consider cross-cutting adoption: if implementing agent X would unblock adoption of concept Y across multiple skills, that increases X's impact.
Implementability — Can this be built as a skill/agent within the current plugin architecture? Prefer tasks that fit the existing patterns (SKILL.md + references/ + examples/).
Independence — Can this be implemented without requiring other unimplemented features first?
Cross-cutting items (concepts and flows) that have remaining adoption tasks ARE included in the priority queue, but always after all skills/agents (and after flows, for concepts). Their adoption recommendations should also be folded into the tasks of the implementable items they touch. For example, if concept:backpressure recommends "add backpressure guidance to write-poc phase 3", that becomes BOTH a task on skill:write-poc AND appears as a standalone entry in the concept tier of the priority queue.
Show the user:
sketch or partial, list
specific questions whose answers would make the item implementable. Frame these as
actionable prompts for the spec author (e.g. "cartography: what output format should the
map use? what level of detail per node?"). This is more useful than a generic "Needs Spec
Work" label.Keep the output scannable. Use tables and bullet points, not paragraphs.
Create or update IMPLEMENTATION_PLAN.md at the repo root (grimoire/IMPLEMENTATION_PLAN.md).
The plan has the following sections:
A prioritized bullet point list of implementable items with remaining work, sorted by priority (highest first). Each entry should include:
detailed, partial, or sketch)Items with status implemented that DO have remaining tasks (spec describes features or
behaviors not yet covered by the implementation) should appear here with their tasks clearly
described. An implemented skill can still have work to do.
A summary of concepts and flows with their adoption status. For each:
This section is informational — it tracks whether the plugin's design principles and intended workflows are reflected in the implementation. Recommendations from this section are folded into the tasks of implementable items in the Priority Queue.
Items with status shallow — they work but need structural improvements (missing references,
examples, or contain TODOs).
Items with spec_detail sketch — listed with the specific questions from Step 5's spec gaps
output. Not just "needs spec work" but the actual questions that need answers before
implementation can begin.
Items with status implemented that have NO remaining tasks. Listed so progress is visible.
If an existing IMPLEMENTATION_PLAN.md was read in step 0, preserve any human-added notes or
context that still applies. Do not discard information that isn't contradicted by the fresh
analysis.
The plan should be concise and actionable — someone reading it should immediately understand what to work on next and why.
npx claudepluginhub this-vishalsingh/grimoire/gap-analysisPerforms ISO 27001 gap analysis on current controls document vs requirements, producing gap summary by domain, prioritized remediation roadmap, and resource estimates.
/gap-analysisAnalyzes current security posture against HITRUST CSF requirements, identifies control gaps (missing, partial, documentation), prioritizes risks by category.
/gap-analysisPerforms a structured gap analysis against a compliance framework, producing an assessment summary, detailed findings, and a prioritized remediation roadmap.
/gap-analysisInterprets natural language analysis requests, routes to specialized gap-detection skills (security, compliance, traceability, coverage), and produces consolidated reports with historical trending.
/gap-analysisAnalyzes papers in a folder or Zotero collection for research gaps and generates new research ideas.