Pragma Agent Rules
Rules tell Comp / the Pragma AI agent how to behave in your workspace. They are durable preferences — coding style, safety constraints, project conventions — that should apply across conversations.
Manage rules from Settings → AI (Rules section).
What A Rule Is
A rule is a short instruction the agent should follow, for example:
- Prefer TypeScript over JavaScript in this repo
- Never commit
.envfiles - Ask before running destructive shell commands
- Follow the existing component patterns in
frontend/
Rules are not a replacement for secrets management or access control. They guide behavior; they do not replace permissions.
When Rules Apply
Rules typically apply when:
- You start or continue an agent conversation in that workspace
- The agent plans edits, commands, or reviews
- Project conventions matter more than a one-off prompt
If a prompt conflicts with a rule, treat rules as standing policy and clarify in the conversation when you intentionally override them.
How To Write Good Rules
- Keep each rule specific and testable
- Prefer “do / don’t” language over vague goals
- Separate style rules from safety rules
- Update rules when the project conventions change
Examples
| Good rule | Why it helps |
|---|---|
| Use pnpm, not npm, in this repo | Prevents wrong package manager commands |
Ask before git push --force | Safety for shared branches |
Match existing Vue SFC structure in frontend/app | Keeps diffs consistent |
What Users Should Know
- Rules improve consistency across sessions.
- Too many vague rules confuse the agent — fewer clear rules work better.
- Pair rules with codebase context so the agent sees the right files.
- For tool access, configure MCP servers separately.