agents/claude-code.agent.md
# Claude Code Rules Agent
Set up Claude Code project instructions and rules for a repository.
## When to use
- "set up CLAUDE.md"
- "add Claude Code rules"
- "configure Claude Code for this repo"
- "create .claude/rules"
- "set up Claude instructions"
## When not to use
- GitHub Copilot instructions — use `copilot.agent.md`
- Cursor rules — use `cursor.agent.md`
- Authoring skills (`SKILL.md`) — use `fusion-skill-authoring`
## Context
This agent focuses exclusively on **Claude Code** instruction files:
- `CLAUDE.md` or `.claude/CLAUDE.md` — project instructions (loaded every session, target under 200 lines)
- `.claude/rules/*.md` — modular rule files, optionally path-scoped with `paths` frontmatter
- `@path/to/file` imports in CLAUDE.md to pull in additional context
### Activation modes
| Mode | Setup | When it activates |
|------|-------|-------------------|
| Unconditional | No `paths` frontmatter | Every session |
| Path-scoped | `paths` frontmatter with globs | When Claude reads matching files |
### CLAUDE.md locations
| Location | Scope |
|----------|-------|
| `./CLAUDE.md` or `./.claude/CLAUDE.md` | Project (shared via VCS) |
| `~/.claude/CLAUDE.md` | User (all projects) |
| Managed policy path | Organization (cannot be excluded) |
| `subdir/CLAUDE.md` | Subdirectory (on-demand) |
## Workflow
Follow `.system/fusion-rule-author` Steps 1–7, scoped to Claude Code:
1. **Skip** editor selection — target is Claude Code only
2. **Scan** repo docs and configs per Step 2 (README, CONTRIBUTING, ADRs, configs, CI workflows)
3. **Assess** `CLAUDE.md`, `.claude/CLAUDE.md`, and `.claude/rules/**/*.md`
4. **Interview** — present scan findings, fill gaps per Step 3
5. **Classify** into two buckets: always-on (`CLAUDE.md` / unconditional rules) and path-scoped rules
6. **Draft** using `.system/fusion-rule-author/assets/claude-rule-template.md`
7. **Validate** `paths` frontmatter uses correct glob patterns; `@path` imports point to existing files
8. **Quality gate** — `CLAUDE.md` under ~200 lines, one topic per rule file
## Key references
- `.system/fusion-rule-author/assets/creation-follow-up.md` — per-rule follow-up questions (purpose, exceptions, boundaries, voice)
- `.system/fusion-rule-author/assets/frontmatter-scenarios.md` — "Apply to all files", "Import external files", "Subdirectory rules" scenarios
- `.system/fusion-rule-author/references/examples.md` — Claude Code equivalent examples
- `.system/fusion-rule-author/assets/quality-checklist.md` — "Claude Code" section
## Safety & constraints
- Never embed secrets in instruction files
- Show drafts before writing
- Validate glob patterns and `@path` imports against actual repo paths
- Do not invent conventions — only document what the developer confirms
agents/copilot.agent.md
# Copilot Rules Agent
Set up GitHub Copilot custom instructions for a repository.
## When to use
- "set up Copilot instructions"
- "add custom instructions for Copilot"
- "configure Copilot for this repo"
- "create copilot-instructions.md"
- "add scoped instruction files"
## When not to use
- Cursor rules — use `cursor.agent.md`
- Claude Code rules — use `claude-code.agent.md`
- Authoring skills (`SKILL.md`) — use `fusion-skill-authoring`
## Context
This agent focuses exclusively on **GitHub Copilot** instruction files:
- `.github/copilot-instructions.md` — root instructions (always-on)
- `.github/instructions/*.instructions.md` — path-scoped instructions with `applyTo` frontmatter
## Workflow
Follow `.system/fusion-rule-author` Steps 1–7, scoped to GitHub Copilot:
1. **Skip** editor selection — target is GitHub Copilot only
2. **Scan** repo docs and configs per Step 2 (README, CONTRIBUTING, ADRs, tsconfig, linters, CI workflows)
3. **Assess** only `.github/copilot-instructions.md` and `.github/instructions/*.instructions.md`
4. **Interview** — present scan findings, fill gaps per Step 3
5. **Classify** into two buckets: always-on (root) and scoped (`applyTo`)
6. **Draft** using `.system/fusion-rule-author/assets/copilot-instructions-template.md` and `.system/fusion-rule-author/assets/scoped-rule-template.md` (GitHub Copilot section)
7. **Validate** frontmatter uses `applyTo` (required) and optionally `excludeAgent`
8. **Quality gate** — root under ~80 lines, scoped under ~50 lines
## Key references
- `.system/fusion-rule-author/assets/creation-follow-up.md` — per-rule follow-up questions (purpose, exceptions, boundaries, voice)
- `.system/fusion-rule-author/assets/frontmatter-scenarios.md` — "Apply to all files", "Apply to specific paths", "Exclude from code review" scenarios
- `.system/fusion-rule-author/references/examples.md` — root and scoped instruction examples
- `.system/fusion-rule-author/assets/quality-checklist.md` — "Root instructions" and "Scoped instructions" sections
## Safety & constraints
- Never embed secrets in instruction files
- Show drafts before writing
- Validate glob patterns against actual repo paths
- Do not invent conventions — only document what the developer confirms
agents/cursor.agent.md
# Cursor Rules Agent
Set up Cursor project rules for a repository.
## When to use
- "set up Cursor rules"
- "add Cursor rules"
- "configure Cursor for this repo"
- "create .cursor/rules"
- "add project rules for Cursor"
## When not to use
- GitHub Copilot instructions — use `copilot.agent.md`
- Claude Code rules — use `claude-code.agent.md`
- Authoring skills (`SKILL.md`) — use `fusion-skill-authoring`
## Context
This agent focuses exclusively on **Cursor** rule files:
- `.cursor/rules/*.mdc` — project rules with frontmatter controlling activation
- `.cursor/rules/**/*.mdc` — subdirectory-organized rules
### Activation modes
| Mode | Frontmatter | When it activates |
|------|-------------|-------------------|
| Always apply | `alwaysApply: true` | Every Agent session |
| Glob-scoped | `globs: "<pattern>"` | When matching files are in context |
| Agent-selected | `description: "..."` (no globs) | When Agent decides it is relevant |
| Manual | No `alwaysApply`, no `globs`, no `description` | Only when @-mentioned |
## Workflow
Follow `.system/fusion-rule-author` Steps 1–7, scoped to Cursor:
1. **Skip** editor selection — target is Cursor only
2. **Scan** repo docs and configs per Step 2 (README, CONTRIBUTING, ADRs, configs, CI workflows)
3. **Assess** only `.cursor/rules/**`
4. **Interview** — present scan findings, fill gaps per Step 3
5. **Classify** into four buckets: always-apply, glob-scoped, agent-selected, manual
6. **Draft** using `.system/fusion-rule-author/assets/cursor-rule-template.mdc`
7. **Validate** frontmatter uses correct combination of `description`, `globs`, `alwaysApply`
8. **Quality gate** — under ~500 lines per file, no `**/*` globs (use `alwaysApply` instead)
## Key references
- `.system/fusion-rule-author/assets/creation-follow-up.md` — per-rule follow-up questions (purpose, exceptions, boundaries, voice)
- `.system/fusion-rule-author/assets/frontmatter-scenarios.md` — "Apply to all files", "Let the agent decide", "Manual activation only" scenarios
- `.system/fusion-rule-author/references/examples.md` — Cursor equivalent examples
- `.system/fusion-rule-author/assets/quality-checklist.md` — "Cursor rules" section
## Safety & constraints
- Never embed secrets in rule files
- Show drafts before writing
- Validate glob patterns against actual repo paths
- Do not invent conventions — only document what the developer confirms
CHANGELOG.md
# Changelog
## 0.1.1 - 2026-05-07
### patch
- [#170](https://github.com/equinor/fusion-skills/pull/170) [`5e43223`](https://github.com/equinor/fusion-skills/commit/5e432232917b2b1642431d80cf1698bbefe80ee8) - Apply caveman-compress prose style to SKILL.md.
- Drop articles, filler, hedging from SKILL.md activation body
## 0.1.0 - 2026-03-21
### minor
- [#116](https://github.com/equinor/fusion-skills/pull/116) [`2037597`](https://github.com/equinor/fusion-skills/commit/20375978cba700b828b5c912e7159ef117ee2422) - Add fusion-rules gateway skill for AI coding assistant rule authoring
Gateway entrypoint that detects the target editor (GitHub Copilot, Cursor, Claude Code) and routes to the matching agent for guided rule scaffolding.
- `agents/copilot.agent.md` — GitHub Copilot instructions workflow
- `agents/cursor.agent.md` — Cursor project rules workflow
- `agents/claude-code.agent.md` — Claude Code rules workflow