Prompts & Rules
How to shape AI behavior without writing code
The Prompt Stack
AI doesn't just see your question -- it sees layers of context that shape its behavior.
Five Layers of Context
Each layer adds more specificity. The AI sees all of them combined:
- System prompt — built into the AI tool (Claude Code / Copilot CLI)
- CLAUDE.md — project instructions at the repo root
- .claude/rules/ — path-scoped conventions (auto-loaded per file type)
- Skill instructions — the SKILL.md being executed
- Your message — what you typed
CLAUDE.md
The project's main instructions file -- like a README for the AI.
What Goes in CLAUDE.md
- Build and deploy commands
- Project structure overview
- Key conventions and patterns
- Branch strategy and CI info
- Links to setup guides
Both Tools Read It
Claude Code reads CLAUDE.md at the repo root. Copilot CLI also reads it
(since v1.0.4). One file, universal context for both tools.
/repo-root/CLAUDE.md
Rules (.claude/rules/)
Path-scoped convention files that auto-load when you edit matching files.
--- paths: ["**/*.js"] applyTo: "**/*.js" --- # JavaScript Conventions - Use CustomComponent custom elements (extends HTMLElement) - Lifecycle: options() -> beforeLoad() -> afterLoad() - No ES modules -- use Gulp concat pipeline - Externalize selectors to component config
Dual Frontmatter
Rules need both paths: (Claude Code) and applyTo: (Copilot CLI)
to work in both tools. Single file, dual format.
Shared Rules (.ai/rules/)
Cross-tool rules read by both local skills and CI/CD automation agents.
pr-review.md
PR review standards — 80%+ confidence threshold, severity levels, constructive tone.
pr-answer.md
How to reply to PR comments — cite code, be concise, acknowledge valid points.
pragmatism.md
Filter for practical questions — skip theoretical debates, focus on actionable feedback.
Edit Once, Changes Everywhere
Shared rules in .ai/rules/ are read by local interactive sessions AND autonomous
CI/CD agents. Update the rule once and every agent picks up the change.
AGENTS.md
Agent inventory at repo root -- Copilot CLI reads it for context about available agents.
Agent Registry
AGENTS.md at the repo root lists all available agents with their names,
descriptions, and capabilities. Copilot CLI uses this to understand which agents are
available for @AgentName invocation. Claude Code agents are defined in
plugin agents/ directories instead.