pattern8 / rules
Cursor rule44 starsChanged 9 months agoMITView on GitHub
P8 Enforcement Rules — Injected into every Agent conversation
- Deletes or force-pushes
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bug_fixSkill
- code_reviewSkill
- feature_devSkill
- prdSkill
- refactorSkill
The file
Show its rules and text
We split this p8-enforcement.mdc into the rules it gives an agent
14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Before starting any task, read MCP Resource skill://index to find a matching SKILL.
- Very specific: line 16
If a SKILL matches, read its checklist and template Resources.
- Distinctive: line 17
If no SKILL matches, work normally without P8 constraints.
- Distinctive: line 23
Before executing any OS command, call:
- Very specific: line 27
If it returns allowed: false, you MUST stop.
- Distinctive: line 33
After completing a task that uses a SKILL pipeline, call:
- Very specific: line 38
If it returns passed: true → deliver the output to the user.
- Very specific: line 39
If it returns P8_AUDIT_FAILED:
- Very specific: line 40
Read the violations list
- Distinctive: line 44
If still failing after 3 retries, inform the user with the violations
- Very specific: line 51
Do NOT skip execute_tool and run OS commands directly
- Very specific: line 52
Do NOT modify files under skills/ unless the user explicitly asks
- Distinctive: line 53
Do NOT modify AGENTS.md
- Very specific: line 54
Do NOT attempt to read references/guidelines.yaml or references/security.yaml directly — these are loaded internally by the P8 engine
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: P8 Enforcement Rules — Injected into every Agent conversation
globs: ["**/*"]
alwaysApply: true
---
<!-- P8 enforcement rules — automatically injected into every agent conversation -->
# P8 Enforcement Rules
You are working in a project governed by **Pattern 8 (P8)**. Follow these rules.
## 1. SKILL Discovery
Before starting any task, read MCP Resource `skill://index` to find a matching SKILL.
If a SKILL matches, read its `checklist` and `template` Resources.
If no SKILL matches, work normally without P8 constraints.
<!-- Only activate P8 pipeline when a SKILL matches; normal Q&A is unaffected -->
## 2. execute_tool — Before Running Commands
Before executing any OS command, call:
```
execute_tool({ command: "your command", skill: "matched_skill_name" })
```
If it returns `allowed: false`, you MUST stop. Do NOT attempt to bypass.
<!-- SecurityGuard fence — intercepts dangerous commands like rm -rf, sudo, etc. -->
## 3. submit_review — After Completing a SKILL Pipeline
After completing a task that uses a SKILL pipeline, call:
```
submit_review({ content: "your output", skill: "matched_skill_name" })
```
If it returns `passed: true` → deliver the output to the user.
If it returns `P8_AUDIT_FAILED`:
1. Read the `violations` list
2. Fix each violation in your output
3. Call `submit_review` again
4. Repeat up to 3 times
5. If still failing after 3 retries, inform the user with the violations
<!-- Reviewer self-audit loop — only triggered when using a SKILL pipeline -->
<!-- Normal Q&A, code explanations, and simple file operations do not require submit_review -->
## 4. Absolute Prohibitions
- Do NOT skip `execute_tool` and run OS commands directly
- Do NOT modify files under `skills/` unless the user explicitly asks
- Do NOT modify `AGENTS.md`
- Do NOT attempt to read `references/guidelines.yaml` or `references/security.yaml` directly — these are loaded internally by the P8 engine
<!-- guidelines.yaml and security.yaml are internal to the "police" engine — invisible to Agents -->
<!-- If an Agent reads these files directly, it defeats the purpose of hidden audit criteria -->
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

