agentleFS
Aquifer-seaAquifer-sea/pattern8/.cursor/rules/p8-enforcement.mdc

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.

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
  1. Very specific:

    Before starting any task, read MCP Resource skill://index to find a matching SKILL.

    line 15
  2. Very specific:

    If a SKILL matches, read its checklist and template Resources.

    line 16
  3. Distinctive:

    If no SKILL matches, work normally without P8 constraints.

    line 17
  4. Distinctive:

    Before executing any OS command, call:

    line 23
  5. Very specific:

    If it returns allowed: false, you MUST stop.

    line 27
  6. Distinctive:

    After completing a task that uses a SKILL pipeline, call:

    line 33
  7. Very specific:

    If it returns passed: true → deliver the output to the user.

    line 38
  8. Very specific:

    If it returns P8_AUDIT_FAILED:

    line 39
  9. Very specific:

    Read the violations list

    line 40
  10. Distinctive:

    If still failing after 3 retries, inform the user with the violations

    line 44
  11. Very specific:

    Do NOT skip execute_tool and run OS commands directly

    line 51
  12. Very specific:

    Do NOT modify files under skills/ unless the user explicitly asks

    line 52
  13. Distinctive:

    Do NOT modify AGENTS.md

    line 53
  14. Very specific:

    Do NOT attempt to read references/guidelines.yaml or references/security.yaml directly — these are loaded internally by the P8 engine

    line 54

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
p8-enforcement.mdc
---
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 -->

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.