Code Conventions
When to use
Use when code needs review, writing, or explanation against project conventions. Applies at two layers:
- Language conventions — naming, file naming, type system, TSDoc/XML doc standards, code structure, error handling, async patterns, dead code policy. Each language has a dedicated agent and authoritative reference doc.
- Cross-cutting conventions — applied on every review: intent capture (every non-obvious decision must be documented well enough that code could be regenerated from comments alone) and constitution enforcement (ADRs and contributor docs are law; deviations require a new decision record; stale decisions flagged).
Typical triggers:
- "what are the naming conventions for this project?"
- "how should I write TSDoc for this function?"
- "does this file follow our code style?"
- "review this for convention violations"
- "what comment style should I use here?"
- "is this idiomatic TypeScript / React / C# / Markdown?"
- "apply code conventions to this file"
- "are these inline comments good enough?"
- "does this violate any ADR?"
- "is this ADR still current?"
- "we have a CONTRIBUTING.md — check if this change follows it"
When not to use
- Security vulnerability scanning (use a dedicated security review skill)
- Performance profiling or benchmarking
- High-level architecture or system design decisions
- Generating net-new code without a review target
- Mutating files without explicit user confirmation
Precedence and applicability
This skill provides org-wide baseline conventions. When installed in a repository with its own conventions, precedence (highest wins):
- Repository-level policy —
CONTRIBUTING.md, contributor guides (contribute/), ADRs, .github/copilot-instructions.md, AGENTS.md, or equivalent
- Tooling configuration —
biome.json, tsconfig.json, .editorconfig, linter configs
- This skill — all rules in
references/*.conventions.md and agent modes
When a repository explicitly narrows, relaxes, or contradicts a rule from this skill, the repository policy wins. Don't flag code that conforms to repo's documented conventions, even if it deviates from the skill baseline.
If conflict is undocumented (no ADR, no contributor note, no config), treat the skill rule as default and recommend the team record their intent.
For maintainers: record convention overrides in CONTRIBUTING.md, a contributor guide, or an ADR so both humans and agents discover them consistently.
Agent modes
| Agent |
Activated for |
agents/typescript.agent.md |
TypeScript naming, TSDoc, type system, code style, error handling |
agents/react.agent.md |
React component structure, hooks rules, accessibility, keys |
agents/csharp.agent.md |
C# naming, CQRS patterns, async/await, null safety, testing |
agents/markdown.agent.md |
Markdown structure, frontmatter, links, callouts, GitHub-specific syntax |
agents/intent.agent.md |
Intent capture — applied in parallel on every code review |
agents/constitution.agent.md |
ADR and contributor doc enforcement — applied in parallel when project has decision records |
Convention references (authoritative rules per language):
references/typescript.conventions.md
references/react.conventions.md
references/csharp.conventions.md
references/markdown.conventions.md
Required inputs
If required inputs are missing or ambiguous, ask before proceeding.
- Target code (inline snippet or file path) or a specific convention question
- Language or file type (inferred from content if not provided)
- For constitution checks: path to ADR directory and/or contributor docs (inferred from common locations —
docs/adr/, CONTRIBUTING.md, contribute/ — if not provided)
When the developer's context or persona is known, consult the matching follow-up file in assets/ for targeted clarifying questions. Ask only unanswered questions.
assets/framework-core-developer.follow-up.md — Fusion Framework internals, shared libraries, framework APIs
assets/react-app.follow-up.md — Fusion React app development
assets/core-service.follow-up.md — Fusion Core backend services (C# / .NET)
Instructions
Step 1 — Classify and route
Detect the primary language, then activate the matching language agent:
- TypeScript (
.ts, non-component .tsx) → agents/typescript.agent.md
- React (
.tsx with JSX or hooks, component files) → agents/react.agent.md
- Mixed
.tsx (TypeScript type concerns + React component concerns) → both agents in parallel
- C# (
.cs, .csproj) → agents/csharp.agent.md
- Markdown (
.md, .mdx) → agents/markdown.agent.md
Always activate in parallel on any code review:
agents/intent.agent.md — every review, regardless of language
agents/constitution.agent.md — when project has ADRs (docs/adr/, adr/) or contributor docs (CONTRIBUTING.md, contribute/, .github/copilot-instructions.md)
If language cannot be determined, ask before proceeding.
Step 2 — Apply or explain conventions
Each language agent reads its authoritative reference file first, then:
- For convention questions: answers with rule explanation and corrected code example
- For code review: identifies deviations, states the rule, shows corrected version
- Does not flag patterns the project has explicitly configured in
biome.json or .editorconfig
The intent and constitution agents run in parallel and contribute findings to the combined report.
Step 3 — Present findings
Organise all findings from all agents into a unified report:
- Required — must fix: naming violations, missing TSDoc on exports,
any types, constitutional violations
- Recommended — should fix: weak intent comments, undocumented magic values, unjustified suppressions
- Advisory — consider: missing decision records, stale ADRs, implicit exceptions to formalise
For each finding: state the rule, affected code, and corrected version or recommended action.
Step 4 — Apply corrections
Apply only corrections the user explicitly approves. Edit files using workspace tools. Don't rewrite entire files unless under 50 lines.
Expected output
- For convention questions: a rule explanation with a corrected code or markup example
- For code review: a unified findings report (Required / Recommended / Advisory) covering language conventions, intent quality, and constitutional compliance
- Offered corrections with the user's explicit approval before any file is mutated
Safety & constraints
- Never mutate files without explicit user confirmation.
- Don't flag style choices the project has opted into via
biome.json or .editorconfig.
- Don't invent ADR content — only enforce and challenge what is actually documented.
1---2name: fusion-code-conventions3description: Applies and explains code conventions across TypeScript, React, C#, and Markdown. Enforces naming rules, file naming patterns, TSDoc and XML doc standards, inline comment intent (the *why*, not the *what*), code structure, error handling, async patterns, and dead code policy. Also enforces ADR and contributor doc decisions, and flags decisions that appear stale or misaligned with current tooling. USE FOR: convention questions, code review against project standards, applying naming rules, auditing intent comments, checking TSDoc completeness, enforcing recorded ADR decisions, and flagging stale architectural decisions. DO NOT USE FOR: security vulnerability scanning, performance profiling, runtime debugging, or generating net-new code without a review target.4license: MIT5---67# Code Conventions89## When to use1011Use when code needs review, writing, or explanation against project conventions. Applies at two layers:1213- **Language conventions** — naming, file naming, type system, TSDoc/XML doc standards, code structure, error handling, async patterns, dead code policy. Each language has a dedicated agent and authoritative reference doc.14- **Cross-cutting conventions** — applied on every review: intent capture (every non-obvious decision must be documented well enough that code could be regenerated from comments alone) and constitution enforcement (ADRs and contributor docs are law; deviations require a new decision record; stale decisions flagged).1516Typical triggers:17- "what are the naming conventions for this project?"18- "how should I write TSDoc for this function?"19- "does this file follow our code style?"20- "review this for convention violations"21- "what comment style should I use here?"22- "is this idiomatic TypeScript / React / C# / Markdown?"23- "apply code conventions to this file"24- "are these inline comments good enough?"25- "does this violate any ADR?"26- "is this ADR still current?"27- "we have a CONTRIBUTING.md — check if this change follows it"2829## When not to use3031- Security vulnerability scanning (use a dedicated security review skill)32- Performance profiling or benchmarking33- High-level architecture or system design decisions34- Generating net-new code without a review target35- Mutating files without explicit user confirmation3637## Precedence and applicability3839This skill provides **org-wide baseline conventions**. When installed in a repository with its own conventions, precedence (highest wins):40411. **Repository-level policy** — `CONTRIBUTING.md`, contributor guides (`contribute/`), ADRs, `.github/copilot-instructions.md`, `AGENTS.md`, or equivalent422. **Tooling configuration** — `biome.json`, `tsconfig.json`, `.editorconfig`, linter configs433. **This skill** — all rules in `references/*.conventions.md` and agent modes4445When a repository explicitly narrows, relaxes, or contradicts a rule from this skill, the repository policy wins. Don't flag code that conforms to repo's documented conventions, even if it deviates from the skill baseline.4647If conflict is undocumented (no ADR, no contributor note, no config), treat the skill rule as default and recommend the team record their intent.4849> **For maintainers:** record convention overrides in `CONTRIBUTING.md`, a contributor guide, or an ADR so both humans and agents discover them consistently.5051## Agent modes5253| Agent | Activated for |54|---|---|55| `agents/typescript.agent.md` | TypeScript naming, TSDoc, type system, code style, error handling |56| `agents/react.agent.md` | React component structure, hooks rules, accessibility, keys |57| `agents/csharp.agent.md` | C# naming, CQRS patterns, async/await, null safety, testing |58| `agents/markdown.agent.md` | Markdown structure, frontmatter, links, callouts, GitHub-specific syntax |59| `agents/intent.agent.md` | Intent capture — applied in parallel on every code review |60| `agents/constitution.agent.md` | ADR and contributor doc enforcement — applied in parallel when project has decision records |6162Convention references (authoritative rules per language):63- `references/typescript.conventions.md`64- `references/react.conventions.md`65- `references/csharp.conventions.md`66- `references/markdown.conventions.md`6768## Required inputs6970If required inputs are missing or ambiguous, ask before proceeding.7172- Target code (inline snippet or file path) or a specific convention question73- Language or file type (inferred from content if not provided)74- For constitution checks: path to ADR directory and/or contributor docs (inferred from common locations — `docs/adr/`, `CONTRIBUTING.md`, `contribute/` — if not provided)7576When the developer's context or persona is known, consult the matching follow-up file in `assets/` for targeted clarifying questions. Ask only unanswered questions.7778- `assets/framework-core-developer.follow-up.md` — Fusion Framework internals, shared libraries, framework APIs79- `assets/react-app.follow-up.md` — Fusion React app development80- `assets/core-service.follow-up.md` — Fusion Core backend services (C# / .NET)8182## Instructions8384### Step 1 — Classify and route8586Detect the primary language, then activate the matching language agent:87- TypeScript (`.ts`, non-component `.tsx`) → `agents/typescript.agent.md`88- React (`.tsx` with JSX or hooks, component files) → `agents/react.agent.md`89- Mixed `.tsx` (TypeScript type concerns + React component concerns) → both agents in parallel90- C# (`.cs`, `.csproj`) → `agents/csharp.agent.md`91- Markdown (`.md`, `.mdx`) → `agents/markdown.agent.md`9293Always activate in parallel on any code review:94- `agents/intent.agent.md` — every review, regardless of language95- `agents/constitution.agent.md` — when project has ADRs (`docs/adr/`, `adr/`) or contributor docs (`CONTRIBUTING.md`, `contribute/`, `.github/copilot-instructions.md`)9697If language cannot be determined, ask before proceeding.9899### Step 2 — Apply or explain conventions100101Each language agent reads its authoritative reference file first, then:102- For convention questions: answers with rule explanation and corrected code example103- For code review: identifies deviations, states the rule, shows corrected version104- Does not flag patterns the project has explicitly configured in `biome.json` or `.editorconfig`105106The intent and constitution agents run in parallel and contribute findings to the combined report.107108### Step 3 — Present findings109110Organise all findings from all agents into a unified report:111- **Required** — must fix: naming violations, missing TSDoc on exports, `any` types, constitutional violations112- **Recommended** — should fix: weak intent comments, undocumented magic values, unjustified suppressions113- **Advisory** — consider: missing decision records, stale ADRs, implicit exceptions to formalise114115For each finding: state the rule, affected code, and corrected version or recommended action.116117### Step 4 — Apply corrections118119Apply only corrections the user explicitly approves. Edit files using workspace tools. Don't rewrite entire files unless under 50 lines.120121## Expected output122123- For convention questions: a rule explanation with a corrected code or markup example124- For code review: a unified findings report (Required / Recommended / Advisory) covering language conventions, intent quality, and constitutional compliance125- Offered corrections with the user's explicit approval before any file is mutated126127## Safety & constraints128129- Never mutate files without explicit user confirmation.130- Don't flag style choices the project has opted into via `biome.json` or `.editorconfig`.131- Don't invent ADR content — only enforce and challenge what is actually documented.132133