Convention Setup

opus 7 lifecycle modes project scope user-invoked

Quick reference

FieldValue
Command/brewcode:convention-setup
Defaultinstall
Lifecyclestatus · install · upgrade · enable · disable · uninstall · purge
Extractionfull · conventions · rules · paths
InputFree-text brief, optional mode, and optional scoped paths
ToolsRead, Write, Edit, Glob, Grep, Bash, Agent, AskUserQuestion, Skill

What it does

Convention setup captures architecture, representative implementations, coding patterns, and testing conventions from your repository. It writes three project documents and installs a loading rule that tells agents which document to read before implementation or review.

Run it after semantic search and before teams-setup. Conventions form the foundation for project agents and review tools; creating a team is not a prerequisite. The read-only setup dashboard includes it in this position.

When to use

  • Establish shared coding and testing patterns before generating project agents.
  • Refresh conventions after a major refactor with upgrade.
  • Analyse selected modules with paths.
  • Extract additional accepted rules from existing documents with rules.
  • Pause convention loading while keeping the documents and accepted rules.

Example

/brewcode:convention-setup install

Expected result: after inspecting status, analysing the code, and reviewing the proposed conventions and rules, the skill produces:

ArtifactPurpose
.claude/convention/reference-patterns.mdRepresentative implementations, coding patterns, and anti-patterns
.claude/convention/testing-conventions.mdTest data, test structure, and assertion patterns
.claude/convention/project-architecture.mdArchitecture, dependencies, and repository layout
.claude/rules/convention.mdLoading guidance for the three documents

The generated documents carry provenance metadata. The loading rule uses the same content-version source and is discoverable by setup-status. Extra project rules depend on which proposals you accept.

Workflow

  1. Resolve intent and report status

    The skill prints its PLAN block, resolves mode and scope from your brief, and probes the installation. Read-only status asks no questions. Outcome-changing ambiguity is clarified before work; ownership or live/disabled path collisions stop the operation.

  2. Analyse active layers in parallel

    Detect the stack and source paths, then analyse the applicable code and test layers with bounded agents. Large repositories can use scoped paths. Candidates include actual file paths and evidence of established patterns.

  3. Select reference implementations

    An architecture-capable agent or Plan agent compares candidates and resolves overlapping suggestions. The chosen references anchor the coding, testing, and architecture documents.

  4. Generate, compact, and review documents

    Three document owners work independently. When available, text optimization compacts their output. Review the proposed conventions and request corrections before proceeding.

  5. Organize accepted rules

    Full extraction proposes avoid and best-practice rules, checks for duplicates, and presents them for acceptance. The conventions-only mode skips this phase. Additional CLAUDE.md references are added only when explicitly requested.

  6. Validate and install loading guidance

    Validate the three documents before installing or refreshing the loading rule. Existing rule wording is preserved while its metadata is refreshed. A disabled loading rule stays disabled during install or upgrade.

Lifecycle modes

ModeBehavior
statusReport state and loading-rule path without writing
install (default)Extract conventions, validate documents, and create or refresh loading guidance
upgradeRepeat extraction against current evidence; preserve local wording and disabled state
enableRestore the parked loading rule without changing its body
disableRename the loading rule to .claude/rules/convention.md.disabled
uninstallRemove the owned loading rule; keep convention documents
purgeRemove the owned loading rule and the three owned convention documents

A bare invocation chooses install, including on an existing project. Use status explicitly for inspection. Lifecycle-only actions do not regenerate documents. Before purge, the skill confirms the exact three document paths unless you have explicitly requested their deletion.

Disabling loading has a narrow scope

Disable parks only the generated loading rule. Accepted coding rules, manual CLAUDE.md references, convention documents, and unrelated files remain. Uninstall and purge also preserve accepted rules and CLAUDE.md. They do not erase project knowledge outside their owned artifacts.

The helper refuses to modify an unowned loading rule or purge unowned documents. If both live and disabled loading rules exist, it reports the collision instead of choosing one.

Additional extraction modes

ModeExampleScope
full/brewcode:convention-setup fullFull extraction, accepted rules, validation, and loading guidance
conventions/brewcode:convention-setup conventionsGenerate the three documents and install or refresh loading guidance while preserving disabled state; skip additional rule extraction
rules/brewcode:convention-setup rulesConsume existing convention documents for rules extraction
paths/brewcode:convention-setup paths src/payments,src/billingRefresh scoped evidence while retaining other layers

The conventions-only mode still installs or refreshes convention.md; other rules stay untouched. Rules-only mode requires existing convention documents. Scoped mode reaches rule organization; it does not discard unrelated document layers.

Technical details

The skill delegates one bounded layer or document per agent. Its brief specifies goal, ownership, paths, existing and parallel work, the next consumer, and acceptance evidence. Analysis activates layers appropriate to the detected stack rather than assuming every repository has the same design.

The bundled scripts/convention.sh handles lifecycle checks, document validation, loader installation, reversible parking, and owned removal. It compares the loading rule and all three documents against the skill’s current content version. A parked loader reports disabled even if documents need refresh; incomplete artifacts report partial.

Generated conventions are project-specific. Upgrade uses current repository evidence and preserves local wording rather than replacing documents with a generic template. It refreshes owned loader metadata without changing the loader’s existing body or enabling a parked installation.

📄

Brewcode overview

Project analysis, conventions, agents, and review tools.
⚙️

Full Setup

The dependency order from search and conventions through documentation sync.
👁

Setup Status

Inspect conventions alongside the other ten setups.
📋

Rules

Generate additional project rules from actual evidence.
🔗

GitHub source

Skill instructions, lifecycle helper, layer definitions, and templates.

Updating plugins

Use /brewtools:plugin-update to check and update the brewcode plugin suite in one command. See the FAQ for details.