/gloria:deriving-agent-code-stylefrom gloria
Use when asked to turn a codebase's linter, formatter, and compiler configuration into agent-facing code style instructions — "write code style rules for agents", "summarize our lint rules as best practices", "add a Code Style section to CLAUDE.md / AGENTS.md", "what conventions should an agent follow in this repo". Reads every config layer per package, detects where linting silently doesn't run, mines observed conventions from the source, and emits an imperative Code Style section with each rule labeled by what enforces it.
Ships in gloria. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Translate what a repo's toolchain enforces and its source practices into imperative
instructions a coding agent can follow while writing — a "Code Style & Formatting" section for
CLAUDE.md / AGENTS.md.
Core principle: the configs are the spec, and every claim is verified per package. Never write a rule from a remembered default, and never generalize a root config to the whole repo without reading each package's overrides. The most valuable findings are usually the discrepancies — a package whose linter silently skips files, a root flag three packages turn off — because those are exactly where an agent's assumptions will be wrong.
Don't use for: designing or changing lint configs themselves; enforcing style in review (run the linters); documenting architecture (this is style/mechanics only).
Find them all before reading any. Search the whole tree (monorepos hide per-package configs):
| Layer | Files to look for |
|---|---|
| Formatter | .prettierrc*, prettier.config.*, biome.json*, .editorconfig, rustfmt.toml, pyproject.toml [tool.black/ruff], gofmt (implicit) |
| Linter | eslint.config.*, .eslintrc*, .oxlintrc*, biome.json*, ruff.toml, .golangci.yml, clippy.toml, stylelint* |
| Compiler-as-linter | tsconfig*.json, pyproject.toml [tool.mypy], compiler warning flags in build files |
| Orchestration | root package.json/Makefile/turbo.json/CI workflows — how lint/format actually run |
| Stated rules | CLAUDE.md, AGENTS.md, CONTRIBUTING.md — conventions humans already wrote down |
Read every linter config individually, even when they look copy-pasted. In this repo,
three of four packages wire typescript-eslint and one doesn't — a one-line difference that
changes what "lint passes" means.
Strictness flags are writing instructions in disguise. Translate each into what the agent must do at the keyboard, e.g. (TypeScript):
| Flag | Instruction it becomes |
|---|---|
strict | Handle null/undefined explicitly; no implicit any |
noUncheckedIndexedAccess | Treat arr[i] / record[k] as T | undefined; guard, never ! |
noFallthroughCasesInSwitch | Every non-empty case ends in break/return/throw |
verbatimModuleSyntax | Write import type { X } for type-only imports |
module/type: module | ESM only — import/export, never require |
paths | Use the aliases (@scope/pkg/*, @/*), not ../../.. chains |
For each rule, record where it applies. Check every package's config for overrides of the root before writing "always" or "everywhere":
tsconfig flag a package sets to false (e.g. verbatimModuleSyntax off for
bundler compatibility) → the rule is "convention everywhere, hard error in package X".argsIgnorePattern: "^_" in one ESLint config) →
say which package enforces it and whether to follow it repo-wide anyway.types array replaces the root list rather than merging).This is where a naive pass fails. For each package, confirm the linter actually lints the source it appears to cover:
typescript-eslint parser silently skips every
.ts file — eslint . exits clean while linting nothing. Equivalents exist in other
ecosystems (missing plugin, wrong files glob).ignores entry that swallows real source, not just generated output.When unsure, prove it: drop a deliberate violation (an unused variable, an explicit any)
into a covered file and run the package's lint command. Clean output on a dirty file = gap.
Revert the probe. Every gap found goes in the output as a warning ("a clean lint in X proves
nothing — rely on the compiler and tests there"), because an agent will otherwise treat that
green check as evidence.
Configs don't capture everything agents copy. Sample several real source files per package and
extract the conventions in actual use: file naming (kebab vs Pascal, and exceptions by
directory), export naming, test file placement and naming, import style (extensions, barrels,
aliases vs relative), comment register (JSDoc on exports? why-comments in configs?), and
domain idioms (schema/DAO layering, error-handling shape, date representation). Reconcile with
what CLAUDE.md/CONTRIBUTING.md already states — and note where stated rules and observed
code disagree rather than silently picking one.
Rules for the output itself:
any; take unknown and narrow" — not "the
config enables no-explicit-any". The agent needs instructions, not a config tour.Default output location: a standalone doc (e.g. docs/AGENT_CODE_STYLE.md) ready to paste
into CLAUDE.md/AGENTS.md, unless asked to edit those files directly. Note in the doc that
the configs win if the two ever disagree.
| Mistake | Fix |
|---|---|
| Reading root configs and generalizing ("enforced in every package") | Read each package's config; build the Step 3 matrix before writing "always" |
| Describing configs instead of instructing the agent | Every bullet starts with a verb aimed at the writer of the next diff |
| Trusting remembered tool defaults | Quote the actual config value or run the tool to check |
Assuming lint passing means the code was linted | Step 4: verify coverage per package; probe with a deliberate violation if unsure |
| Only reading configs and skipping the source | Configs miss naming, layout, test placement, comment register — sample real files |
| Mixing enforced rules and conventions without labels | Tag each rule: enforced / stated / observed |
| Omitting the verify commands | Close with the exact commands and their caveats |
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
12 skills in this plugin
/checking-coding-standardsUse to check code against a project's registered gloria Coding Standards. Fires for plain requests to compare code with the rules — "check this against our standards", "does this drift from our rules/conventions", "are we following our own standards", "review this for standards compliance", "check this PR against our standards", "run a standards check", "audit the repo for drift", "has our code drifted from the rules" — including before or after implementing a change in a project that has registered standards. Runs diff-scoped checks (the per-PR workhorse), cheap metadata checks (render stamp + rule-evidence staleness), or a full audit (snippet staleness included), and reports findings to the gloria drift ledger via report_check_run. Read-only: findings, never edits./debugging-production-errorsUse to investigate production problems through gloria's log debugging tools. Fires for plain requests about live behavior — "why is X failing in production", "what happened at 2pm", "debug these 500s", "is anything erroring right now", "check the logs", "what broke after the last deploy", "why are checkouts timing out" — for any project with a gloria log connection configured. Queries the org's own log provider live via the gloria MCP tools (get_log_provider_status, get_log_stats, list_error_groups, query_logs): find the spike, group the errors, correlate with the deploy, pull the stack trace, map it to source. Read-only over logs; never asks for credentials in chat./documenting-service-dependenciesUse to map, document, and register a codebase's service dependencies with gloria.dev so they are monitored. Fires for plain requests to sync a dependency or project with gloria — "register this dependency", "register this project", "register/sync our services with gloria", "start monitoring this service", "add this integration to gloria", "sync my project with gloria" — and to inventory them — "document our integrations/dependencies", "what external services does this connect to", "make a health-check doc". Also fires whenever you add, remove, or swap an external service, SaaS API, SDK, API client, database, queue, or internal endpoint. Produces four dependency Markdown docs (external SaaS inventory + health checks, internal systems inventory + health checks) plus, on a first-time pass, a project explainer and (for monorepos) a package/workspace map, and pushes all of it to gloria.dev via its MCP tools (register_project, put_dependency, put_document)./extracting-coding-standardsUse to set up or register gloria Coding Standards for a project. Fires for plain requests to register or sync standards with gloria — "register our coding standards with gloria", "sync our conventions with gloria", "save our rules to gloria", "register our coding conventions" — and to derive them — "extract our coding standards", "derive rules and snippets from this repo", "set up the standards library". Orchestrates deriving-agent-code-style and mapping-packages-for-coding-agents, structures their findings into stable rules (slug ids, authority labels, scope, evidence), mines one canonical placeholder-ized snippet per rule-implied pattern, registers everything via the gloria MCP tools (register_standard, put_rule, put_snippet) with per-item approval, and renders a version-stamped Coding Standards section into CLAUDE.md/AGENTS.md./identifying-skills-for-a-projectUse when asked which agent skills a project already uses and which additional ones would help the people and agents working on it, or to stock your org's gloria.dev skills library from a project's needs. Inventories the skills in play (session list + `.claude/` config + CLAUDE.md), profiles the stack, recommends the gaps, then — only with consent — saves the useful ones to the library by reusing, copying, or authoring a bundle, and offers a local or global install./investigating-production-incidentsUse to turn a production incident into a durable, shareable investigation folder in the repo — not just a chat answer. Fires for "investigate this", "write up this incident", "create an investigation for X", "start an investigation into checkouts failing", or any debugging-production-errors session the user wants preserved for handoff. Wraps the debugging-production-errors query methodology (get_log_provider_status, get_log_stats, list_error_groups, query_logs) with folder lifecycle: opens investigations/<date>-<slug>/, saves the specific evidence (redacted) that supports the diagnosis into evidence/, and writes INVESTIGATION.md with the root cause, deploy correlation, and fix recommendation. Read-only over logs; never asks for credentials in chat.npx claudepluginhub sandgardenhq/plugins --plugin gloria