/gloria:using-coding-standardsfrom gloria
Use while writing code in a project with a registered gloria Coding Standards library — before implementing anything pattern-shaped (a DAO, an API route, a migration, a test harness, a channel adapter), and whenever CLAUDE.md carries a "## Coding Standards" section with a gloria:standards stamp. Also fires for "follow/use our standards while writing this", "write this the way we do", and "register/contribute this back as a snippet". Drives the write-time discipline: find_snippets before writing, adopt or adapt the canonical exemplar, leave a gloria:snippet provenance marker, contribute reusable shapes back via put_snippet, and justify deliberate divergence.
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.
Consulting the library is a gloria MCP call, not memory: find_snippets
before writing pattern-shaped code. And when the user says "register",
"contribute", or "add" this back as a snippet — or you produce a reusable
shape worth sharing — that means calling the gloria MCP tool put_snippet
(with the user's approval), not just leaving the code in place. The write-time
loop is: find_snippets → adopt/adapt → leave the gloria:snippet marker →
put_snippet for genuinely reusable new shapes.
A project with a gloria standards library has already decided what its patterns look like. This skill is the write-time half of the loop: consult the library before writing pattern-shaped code, copy the canonical exemplar instead of improvising, and leave a marker so reuse is verifiable.
Core principle: the snippet is the decision, the marker is the receipt. Adopting the canonical snippet keeps the codebase converged; the provenance marker makes that reuse greppable, so the checker verifies claimed reuse deterministically instead of guessing.
CLAUDE.md/AGENTS.md has a ## Coding Standards section (the
<!-- gloria:standards vN --> stamp is the tell)Don't use for: genuinely one-off logic with no repeating shape; repos with no registered standards (nothing to consult); extracting or checking standards (their own skills).
Before writing the first line of a pattern-shaped change:
find_snippets { projectSlug, language, query }
Query with the pattern's name as the repo speaks it ("D1 DAO", "api route zod", "d1 migration"). The search ladders exact → contains → fuzzy, so a short natural phrase works.
| Match | Action |
|---|---|
| Strong match — the snippet is the shape you need | Adopt it. Fill every TODO: placeholder. Marker: (verbatim) |
| Partial match — right pattern, needs structural adaptation | Adapt it. Keep the structural skeleton, change what must change, fill every placeholder. Marker: (adapted) |
| No match, but the shape will recur | Write it well, then contribute it back: put_snippet with placeholders and linked ruleIds (ask the user before publishing) |
| No match, genuinely one-off | Write normally. No marker, no contribution |
Never leave a TODO: placeholder unfilled in committed code — placeholders are the snippet's
customization points, and an unfilled one means the adaptation is incomplete.
On the adopted/adapted unit (top of the function, class, or file section it produced), in the language's comment syntax:
// gloria:snippet <project>/<snippet-id> (verbatim|adapted)
Exact grammar: the literal gloria:snippet, one space, the project slug, /, the snippet id,
one space, then (verbatim) or (adapted). Examples:
// gloria:snippet gloria-dev/d1-dao (adapted)
-- gloria:snippet gloria-dev/d1-migration (verbatim)
verbatim means structure copied with only placeholders filled; adapted means you changed
structure beyond the placeholders. When in doubt, adapted.
If a strong match exists but you deliberately deviate from it, say why in an adjacent comment:
// gloria:snippet gloria-dev/d1-dao (adapted) — diverges: streaming read, so no
// row-array mapping; see #412
Documented divergence is legitimate for observed-authority rules and snippet patterns; the
checker treats it as intent, not drift. enforced rules have no such escape hatch — never
"diverge" from a rule a tool blocks.
| Mistake | Fix |
|---|---|
| Writing the pattern from memory, then checking | find_snippets first — the snippet may encode decisions you'd re-litigate |
| Adopting without filling placeholders | Every TODO: filled before the code is done |
| Marker on the wrong granularity | Mark the unit the snippet produced, not the whole file it lives in |
Claiming (verbatim) after structural edits | Structural change = (adapted); the checker compares faithfulness |
| Silent divergence from a strong match | One comment line saying why; silence reads as unattributed duplication |
| Contributing one-off code as a snippet | Contribute only shapes that will recur; ask the user before put_snippet |
find_snippets called before writing anything pattern-shapedgloria:snippet markerTODO: placeholder filledput_snippet (with user approval)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub sandgardenhq/plugins --plugin gloria12 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./deriving-agent-code-styleUse 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./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.