standards-generate

A command that examines a repository and creates its .claude/standards.md file with detected project conventions. It asks before replacing an existing file.

In plain words
What is it for?
Use it to inspect project configuration and generate or refresh a standards document for agents working in the repository.
Why use it?
It avoids manually documenting language, tooling, and repository practices, while protecting an existing standards file from accidental replacement.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/rmolines/fractal-loop/standards-generate
Clone the repo
git clone --depth 1 https://github.com/rmolines/fractal-loop
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,634 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00026 $0.02634
Opus 5 $0.00013 $0.01317
Sonnet 5 $0.00005 $0.00527
Haiku 4.5 $0.00003 $0.00263

Measured 2d ago against content hash c2e8df46d2cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

standards-generate 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 2d 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.

commands/standards-generate.md · 272 lines

How it starts

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

/standards:generate

Inspect the target repo intelligently and generate .claude/standards.md following the schema in references/standards-schema.md.

Input: $ARGUMENTS — optional path to target repo. Defaults to repo root (git rev-parse --show-toplevel).


Step 1: Resolve target path

REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
TARGET="${ARGUMENTS:-$REPO_ROOT}"

Step 2: Guard — check if standards.md already exists

If .claude/standards.md exists in TARGET:

Use AskUserQuestion:

  • Question: ".claude/standards.md já existe. Deseja sobrescrever?"
  • Options: "Sim, sobrescrever" / "Cancelar"

If "Cancelar" → print "Operação cancelada. Arquivo existente mantido." and STOP. If "Sim, sobrescrever" → continue.

Step 3: Inspect the repo

Read the following files if they exist (use Read tool):

Primary config sources (read all that exist):

  • $TARGET/CLAUDE.md
  • $TARGET/.claude/project.md
  • $TARGET/package.json
  • $TARGET/Makefile
  • $TARGET/pyproject.toml
  • $TARGET/tsconfig.json
  • $TARGET/Cargo.toml
  • $TARGET/go.mod

Commit/lint config:

  • Any $TARGET/commitlint.config.* (use Glob: commitlint.config.*)
  • Any $TARGET/.commitlintrc* (use Glob: .commitlintrc*)
  • Any $TARGET/.eslintrc* (use Glob: .eslintrc*)
  • $TARGET/.eslintignore

Hooks:

  • $TARGET/.husky/pre-commit
  • $TARGET/.husky/pre-push

CI:

  • List $TARGET/.github/workflows/ if it exists (use Glob: .github/workflows/*.yml and .github/workflows/*.yaml)

Also run:

git -C "$TARGET" branch -l main master 2>/dev/null | sed 's/^[* ]*//' | grep -v '^$'

to detect protected branches.

Step 4: Synthesize detected values

Using your understanding of the files read, determine values for each field. Apply this detection logic:

Gates section

build (required):

  • package.json has scripts.buildnpm run build (source: package.json#scripts.build)
  • Makefile has build: target → make build (source: Makefile#build)
  • .claude/project.md has build: field → use that value (source: .claude/project.md#build)
  • Cargo.toml exists → cargo build (source: Cargo.toml)
  • go.mod exists → go build ./... (source: go.mod)
  • pyproject.toml exists with [build-system] → detect tool (hatch, poetry, flit) and emit appropriate command (source: pyproject.toml#build-system)
  • Nothing → mark as # not detected — fill manually

Read the full file on GitHub · 272 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. 2d ago First seen · 272 lines · 26 tokens per session scan A c2e8df46d2cc

Subscribe to this mod's changes

standards-generate is a command published in the GitHub repository rmolines/fractal-loop (13 stars, last pushed 5mo ago), licensed MIT. It adds 26 tokens to every session and 2,634 once invoked, about $0.0001 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.