Use the using-coding-standards skill when a project already has a Coding Standards library and your agent needs to write code that matches an existing pattern. See Coding Standards for the loop and Extract Coding Standards for how the library gets filled. This is the write time half of the loop: your agent checks the library before it writes, and Gloria lets you inspect the canonical example in the Snippets table or on a snippet detail page when you want to review it.
You: “Add a new DAO that follows this project’s standards.” Gloria: “I checked the standards library first, matched the closest canonical shape, and left a provenance marker in the diff.”
Coding Standards turns expected coding shapes into checkable rules and reusable snippets. As your agent writes, the library keeps new work aligned with the patterns the project already chose. When you want to confirm the match in Gloria, the Snippets view gives you a sortable table of canonical examples and a detail page for each snippet.
How it works
- Ask your agent to write the feature or fix.
- If you want a quick refresher on the canonical shape first, open Gloria’s Snippets view for the project. Sort the table or filter it by language to narrow the list, then open the snippet that matches the shape you want.
- On the snippet detail page, review the highlighted code, copy the snippet if you want to compare it side by side, and open the linked rules for the standard behind it. Gloria shows language and placeholder tags in the same colored tag style it uses across the app. When Gloria recognizes the language, it highlights the snippet to match the active light or dark theme. When the language name is unsupported or malformed, Gloria shows safely escaped plain text instead.
- Your agent searches the standards library first for the project, the language, and the shape it is about to write.
- Your agent then picks the best match.
| Match | What appears in the code or diff |
|---|---|
| Strong match | The diff shows the canonical shape with placeholders filled, plus a gloria:snippet marker marked verbatim. |
| Partial match | The diff keeps the same structure, adapts what must change, and marks the reused unit as adapted. |
| No match | The agent writes the code normally. If the shape looks reusable, stop here and extract it into the standards library. |
- The diff shows a
gloria:snippetprovenance marker wherever the agent reuses a snippet.
gloria:snippet <project>/<snippet-id> (verbatim|adapted)verbatim means the structure stayed the same and only the placeholders changed. adapted means the structure changed beyond the placeholders.
- If the best snippet is close but the project intentionally needs a different shape, the agent keeps the marker and adds a short note that explains why. The checker reads that note as intent, not drift, for
observedrules and snippet patterns.enforcedrules do not allow that exception.
Verify
Ask your agent: “Write a small pattern-shaped change in this project and show the diff.”
A good result shows the search first step, a matching snippet choice, and a gloria:snippet marker in the diff. In Gloria, sort or filter the Snippets table until you find the same canonical snippet, then open its detail page to confirm the matched pattern, linked rules, copy action, and colored tags for the language and placeholders. If the shape needs a deliberate divergence, the diff also includes a short note that explains it.