Standards from config

From event4u-app/agent-config · View interactive version

Standards from config is an AI agent skill from the GitHub repository event4u-app/agent-config. Use when you need this project's coding standards (line length, quotes, import order, naming, commit format) — derive them from the REAL tooling config as a pointer + digest, never a guessed claim.

How to use this skill

Skill file

standards-from-config

Evidence v2 Class A — configured convention. The safe, on-thesis half of

self-building project context: coding standards are not guessed and not

observed, they are derived from the real tooling config. The config is

the standard; this skill produces a pointer + digest, never a flattened

claim. High-trust, auto-refreshable, drift-proof — because the truth lives in

the config file, and the card only points at it plus distils the 3–5 points an

agent needs most while writing.

Definitions (Class A/B/C, trust tiers, the v1↔v2 isolation contract) live in

CODE0;

the parent context mechanism is CODE0.

When to use

enforced style (indent, line length, quote style, import order, naming).

commit convention.

next agent from re-deriving the same config.

Do NOT use for: a standard that has no config backing (that is a guessed

or observed convention — Class B, not A; never invent a Class-A claim); the

concrete shape of code (that is v1 source-discovery, read fresh); a project

with no tooling config at all (record a negative fact: "no enforced standard

found", do not fabricate one).

Procedure

  1. Detect the real config sources (read fresh, never from memory). Common

sources, by ecosystem — inspect what actually exists:

.gitmessage, the lint/format steps in the CI workflow.

tsconfig.json (strictness).

setup.cfg.

  1. Follow the chain before you digest, and pick the config NEAREST the edit.

Read literally — one file, one parse — this procedure returns a null on a

repository whose root config is a single extends. A fourteen-line linter

config whose only load-bearing line points into a package in the same

workspace is not a project without standards; it is a project whose standards

are one hop away, and "no enforced standard found" there is a false negative

that reads exactly like a true one. extends is specified in TypeScript,

ESLint, Biome and Stylelint; includes plays the same role in PHPStan and

Rector; workspace: is documented in npm, yarn, pnpm and bun.

the edited path's own directory governs, then its parent, up to the

repository root. A per-package tsconfig.json, .eslintrc, .env or

deployment manifest is the one that package's build reads; a root file it

does not extend has no effect on it. Reading the root config for an edit

inside a package that carries its own is a wrong answer, not a coarse

one. Report the outranked root candidate too, so the precedence is visible.

absence.** Say which hop failed and why. A partial digest naming its gap is

usable; a null that reads as "no standards" is a lie.

the digest.** Presenting a third-party preset as the project's own standard

is worse than reporting nothing — the reader cannot tell which rules the

project chose. Report it with its path; do not merge it.

  1. Derive as pointer + digest, never a flattened claim. Each standard is one

line: the value, the config file it came from, and the scope it

applies to. Write ruff.toml → line-length = 88 (scope: src/**/*.py), NOT

"the project uses line length 88". The pointer makes the claim re-checkable

and the next agent can open the config to confirm.

  1. Preserve scope; surface conflicts, never flatten them. If two configs (or

an inline / per-directory override) give two values, emit **two pointers with

two values + their scopes** — never one ambiguous merged claim. A visible

conflict is correct; a hidden flattened guess is the failure mode.

Instruction files (AGENTS.md, CLAUDE.md, .cursorrules) are a conflict

source too: prose that contradicts a config is a second pointer, not a

correction of the first. A user correction repeated against the config

("tabs, for the third time") is asked about — which one should change? —

never silently adopted over the config.

  1. Stamp staleness. Record each source's config_mtime (or content hash).

The digest is stale when the config file's mtime/hash changes → re-derive. No

human gate is needed (Class A is deterministic) — the digest is **regenerated

from the config, never hand-edited**.

  1. Persist as a Class-A context card under agents/settings/contexts/ (see

Output format). Class A is high-trust because config-derived — it is read

for heuristics only and never bypasses a fresh structural read (the v1↔v2

isolation contract in evidence-discipline).

Output format

A Class-A standards card MUST contain, in order:

  1. Frontmatter class: A, trust: high (config-derived), and a

sources: list of {path, config_mtime} for every config the digest reads.

  1. A pointer+digest table — one row per standard: `standard | value | source

(file:key) | scope. No standard appears without a source` cell pointing at

a real config file.

  1. A conflicts block (may be empty) listing any standard where ≥2 sources /

scopes disagree, as two-or-more rows, never one merged value.

  1. A refresh line stating the card is regenerated when any listed

config_mtime changes, and is read for heuristics only (never a structural

bypass).

Gotcha

it is a guessed/observed convention (Class B) or nothing. Class A never

fabricates.

signal; surface both pointers.

value by hand instead of the config defeats the drift-proofing.

whether a given file complies is a fresh read, not this card's claim.

Do NOT

pointer to the config that declares it.

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.