claudecodex

grain

Mine an architecture graph out of a repository that has none: grain propose reads the code and the full git history and writes node types, nodes, relations, cycles and the rules the repository's own code can prove, each one carrying the evidence that produced it and the count of places that already break it, as a tree Yggdrasil loads and accepts with one command. The agent-facing questions it has always answered still work from the same model: where <intent> (where such things live, what is expected there, exemplars to copy), what <term>, how <query>, check <file> (how a change sits against the local norm), review, completeness, status/report/rules, export, decide steer|boundary|waive — plus hooks that speak unbidden and an MCP server exposing every command as a tool to any MCP client. Statistical answers mined from syntax trees and git history; no model calls, no network, never blocks.

0 on GitHubby Krzysztof Dudekv6.1.0MITupdated 9 days agoDeveloper Tools
/

Plugin grain from marketplace grain-marketplace in krzysztofdudek/Grain. Commands read from the repo's manifest — 8 days ago.

This plugin runs code on your machine — its hooks fire automatically on events like tool use and it starts local MCP servers. The exact commands are listed below; read them before installing.

What it installs

Skills (1)

  • grain

    Ask the repository about its own conventions BEFORE writing code, through the grain MCP tools. Use whenever you are about to create a source file, add a class/function/handler/command/component/test, are unsure where something belongs, or want to know how a kind of change has been done here before —

Slash commands (23)

  • /grain:advise

    What this repository's own history and imports say about the architecture graph it ALREADY has — places a finer cut beats, rules the graph could take on, and (as data, not advice) places that change together with nothing connecting them

  • /grain:check

    Ask the repo how a file — or your whole uncommitted change — sits against the local norm (deviations with evidence and exemplars)

  • /grain:cochange

    Which parts of a set of files or graph nodes change together more often than chance, and how well a proposed cut of them into parts follows the seams the history shows

  • /grain:completeness

    Ask the repo which other files historically change together with the given file(s) — co-change, above a confidence floor

  • /grain:decide

    Record a maintainer decision — steer (promote a pattern), boundary (forbid an import direction), or waive (excuse one scope) — or list/withdraw one

  • /grain:explain

    Show the full local-to-global convention lattice around one file (no acceptance cut)

  • /grain:export

    Dump the whole convention model as JSON (every convention with all its sites, anchors, trends, groups, markers, co-change) for pipelines and audits

  • /grain:how

    Ask the repo how a change like <intent> has actually been made here before — real past commits, not a guess

  • /grain:map

    A structural overview of the repo — dependency layers, top concepts, certified change shapes, decisions in force

  • /grain:measure

    What the work between two commits did to a territory — its files, its imports inside and across its edge, the undeclared dependencies between nodes, and how often the range crossed its edge

  • /grain:obligation

    What a NEW file under this path has historically required — obligations mined from git status alone, before the file is written

  • /grain:oracle

    Keep the difference between the graph grain proposed and the graph you accepted, and score the proposal against it — precision and recall on the same measures grain is held to on hand-written graphs

  • /grain:propose

    Mine a PROPOSED Yggdrasil `.yggdrasil/` architecture graph for this repository — nodes, relations and rules with evidence — into a staging directory for a human to accept with `yg adopt`

  • /grain:refresh

    Rebuild the grain index for this repo now (queries auto-refresh; use after a history rewrite)

  • /grain:report

    grain report — the repository's top conventions with evidence and trends

  • /grain:review

    Alias of `check` with no file argument — one aggregated report over your whole uncommitted change

  • /grain:rules

    Generate a standalone Markdown document of this repo's established conventions, for a reader with no terminal and no grain plugin

  • /grain:selftest

    Plant synthetic deviations into conforming exemplars and report how many this repo's own model catches (or evaluate `how`, `where` or extraction itself against a naive baseline/oracle)

  • /grain:spectrum

    Alias of `explain` under its original name — same command, same output

  • /grain:status

    grain index status — freshness, size, health of the convention model for this repo

  • /grain:steer

    Alias of `decide steer` under its original name — record a maintainer decision that promotes a pattern repo-wide

  • /grain:what

    Ask the repo what <words> already IS here — declarations, values, spread, siblings, commit mentions, fan-in

  • /grain:where

    Ask the repo where things like <intent> live, what is expected there, and which exemplar to copy

MCP servers (1)

  • grain

    runs: node -e const f=process.argv[1];if(!require('fs').existsSync(f)){console.error('grain: '+f+' is not reachable from this environment (a host path inside a container?), so grain did not run');process.ex

Hooks (7)

  • SessionStart

    node -e "const f=process.argv[1];if(!require('fs').existsSync(f)){console.error('grain: '+f+' is not reachable from this environment (a host path inside a container?), so grain did not run');process.e

  • PostToolUse

    node -e "const f=process.argv[1];if(!require('fs').existsSync(f)){console.error('grain: '+f+' is not reachable from this environment (a host path inside a container?), so grain did not run');process.e

  • PostToolUse

    node -e "const f=process.argv[1];if(!require('fs').existsSync(f)){console.error('grain: '+f+' is not reachable from this environment (a host path inside a container?), so grain did not run');process.e

  • PreToolUse

    node -e "const f=process.argv[1];if(!require('fs').existsSync(f)){console.error('grain: '+f+' is not reachable from this environment (a host path inside a container?), so grain did not run');process.e

  • PreToolUse

    node -e "const f=process.argv[1];if(!require('fs').existsSync(f)){console.error('grain: '+f+' is not reachable from this environment (a host path inside a container?), so grain did not run');process.e

  • PreToolUse

    node -e "const f=process.argv[1];if(!require('fs').existsSync(f)){console.error('grain: '+f+' is not reachable from this environment (a host path inside a container?), so grain did not run');process.e

  • UserPromptSubmit

    node -e "const f=process.argv[1];if(!require('fs').existsSync(f)){console.error('grain: '+f+' is not reachable from this environment (a host path inside a container?), so grain did not run');process.e

View source on GitHub

Similar plugins

superpowers

claudecodex

Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques

15 skills · hooks

obra/superpowers 316,836

AI-powered codebase understanding — analyze, visualize, and explain any project

9 skills · 10 agents · hooks

Egonex-AI/Understand-Anything 92,410

mem0

claudecodex

Cross-session memory and token savings for coding agents.

6 skills · 1 agent · 1 MCP server · hooks

mem0ai/mem0 68,893

context7

claudecodex

Up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your coding agent's context.

1 MCP server

upstash/context7 64,709

Use Alibaba Open Code Review from local Codex.

2 skills

alibaba/open-code-review 50,068

slidev

claude

Claude Code skill for creating and presenting Slidev slidedecks

1 skill

slidevjs/slidev 49,452

Maintain grain?

This page updates itself from your repo. Add the badge to your README, or get it Featured to pin it above the organic results with a followed link to your site.

claude & codex pluginslisted