Skip to content
Back to skills

Convention Setup

ASecurity

Installs project conventions and reversible loading guidance; extracts representative implementations, patterns, architecture, and accepted rules. Triggers: convention setup, extract conventions, etalon classes.

  • 32 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 1, 2026
ai-agentstestingdocumentation

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned October 6, 2026

npx -y skills add kochetkov-ma/claude-brewcode --skill convention-setup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Convention Setup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Convention Setup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kochetkov-ma-convention-setup/badge)](https://www.skillsdirectory.com/skills/kochetkov-ma-convention-setup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: convention-setup
description: "Installs project conventions and reversible loading guidance; extracts representative implementations, patterns, architecture, and accepted rules. Triggers: convention setup, extract conventions, etalon classes."
---

# Convention setup

<!-- brewcode-meta: version=6.4.0 content_version=6.3.0 generated_by=brewcode:convention-setup -->

Inspect representative production code and tests, identify repeated architectural and implementation patterns, and write concise convention documents to the user-selected Codex-owned path. Cite concrete repository files, distinguish enforced rules from observations, and avoid changing application code unless the user explicitly asks.

## Modes and lifecycle

Resolve one mode from `status`, `install` (default, the original full extraction), `upgrade`, `enable`, `disable`, `uninstall`, `purge`; extras: `full`, `conventions`, `rules`, `paths <p1,p2>`. Explicit tokens win; otherwise resolve RU/EN intent, choose install on empty/no-match input, and ask at most one outcome-changing question. Read-only status asks nothing.
Before the first action print `PLAN — brewcode:convention-setup` with literal `INPUT:`, `MODE:`, `SCOPE:`, `DO:`, `RESULT:`. Run `sh <skill-directory>/scripts/convention.sh status` first; stop on ownership/collision errors.

| Mode | Behavior |
|------|----------|
| `status` | Read-only document/loading inventory; parked guidance is disabled, never missing. |
| `install` / `full` | Run the extraction workflow below; validate docs, then run the script's install command. |
| `upgrade` | Refresh evidence and metadata using the workflow; run the script's upgrade command, preserving parked state and local guidance wording. |
| `enable` / `disable` | Run that script command to restore/park `.codex/rules/convention.md` as `.md.disabled`, byte-identically. |
| `uninstall` | Remove only owned loading guidance and its generated AGENTS index row; preserve docs and accepted rules. |
| `purge` | Confirm the three owned document paths unless deletion is already explicit; remove them and loading guidance, preserve accepted rules and unrelated files. |
| `conventions` | Extract only documents, validate and install loading guidance; leave other rules untouched. |
| `rules` | Extract accepted rules from existing stamped evidence without regenerating documents. |
| `paths` | Refresh named source layers, preserving other evidence. |

For generation, obtain `version`, `content_version`, `generated_by`, `last_updated` from the script's `setup` JSON; stamp each of `.codex/convention/{reference-patterns,testing-conventions,project-architecture}.md` with those exact values and `doc_type: llm`. Validate before installing loading guidance. Never ship unresolved placeholders.
Codex does not auto-load `.codex/rules/`. After install/upgrade/enable, add or update exactly one root `AGENTS.md` rule-index row with columns `Rule`, `Load when`, `Purpose`: require reading the live convention rule before implementation/review. For a disabled install, index the parked path with `disabled; do not load`; disable updates that row likewise. Uninstall/purge remove only this generated index row. Preserve accepted coding rules and manual convention references; they remain active. Report this boundary after disable/removal. Validate the complete rule index after every mutation, then run script status as evidence.

## Workflow

1. Read the applicable `AGENTS.md` files and repository architecture documentation before analysis.
2. Resolve the requested scope: full repository, convention documents only, rule extraction from existing convention documents, or explicit paths.
3. Inventory languages, frameworks, module boundaries, build files, tests, migrations, and existing convention material with focused `rg` searches.
4. Select representative production and test files for each relevant layer. Prefer repeated current patterns over isolated legacy examples.
5. Record evidence for architecture boundaries, dependency direction, naming, data models, error handling, persistence, external integrations, testing, and deployment constraints.
6. For each candidate convention, cite concrete paths, state whether it is enforced or observed, identify exceptions, and name the preferred reference implementation.
7. Write compact English convention documents under `.codex/convention/`. Preserve unrelated content and do not duplicate full rule bodies in `AGENTS.md`.
8. If the user requests durable rules, extract accepted candidates, deduplicate them against all `.codex/rules/*.md` files and applicable `AGENTS.md` instructions, and apply them directly without a dedicated organizer agent.
9. Update the root `AGENTS.md` rule-index table so every project rule appears exactly once with columns `Rule`, `Load when`, and `Purpose`.
10. Invoke `$brewtools:text-optimize -l` for every changed convention, rule, and index file. Compare semantics before accepting optimized text.
11. Re-run the file inventory, validate every cited path, and report documents changed, rules added or merged, duplicates skipped, and unresolved conflicts.

Use Codex collaboration only when the user or active repository instructions explicitly require delegation. When delegation is allowed, prefer project-specific agents and keep one bounded evidence-gathering surface per agent.

## Native user gates

Required approval: main presents a concrete, reviewable proposal in chat and waits for an actual user reply before dependent action. Existing authorization for the same scope remains valid; do not ask again. Optional clarification: use `request_user_input_async` only if exposed, or `request_user_input` only if available in the current runtime/mode, for optional choices and never approval. Otherwise ask in main chat. Delegated agents return unresolved questions to main. Silence, elapsed time and tool errors are not approval.

Files in this skill

  • LICENSE1.1 KB
  • README.md468 B
  • SKILL.md5.8 KB
  • agents/openai.yaml243 B
  • references/analysis-layers.md11.2 KB
  • references/conventions-guide.md6.3 KB
  • references/rules-guide.md618 B
  • references/text-optimize-fallback.md5.8 KB
  • scripts/convention.sh14 KB
  • tests/lifecycle.mjs6.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.