agentharness / rules
Cursor rule1 starsChanged 2 months agoMITView on GitHub
Use before creating any new file or directory in an established project — covers guarded root paths, docs/, src/, conf/, the allowed-additions escape hatch, and how to ask for permission. Load this skill at the start of every session in a project that has .agentharness-guarded-paths.json.
We split this file-placement-policy.mdc into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Load this skill at session start: if the project has .agentharness-guarded-paths.json.
- Distinctive: line 12
Before creating any new file or directory, check whether the target location is guarded:
- Distinctive: line 24
If the path is guarded: stop and ask the user for permission.
- Very specific: line 37
Wait for an explicit yes/ok/go ahead response.
- Very specific: line 41
Add the approved path to .agentharness-allowed-additions.txt:
- Very specific: line 51
If .agentharness-guarded-paths.json doesn't exist:
- Very specific: line 55
If accepted, create the structure and generate the config: python3 tools/analyze_structure.py .
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 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: "Use before creating any new file or directory in an established project — covers guarded root paths, docs/, src/, conf/, the allowed-additions escape hatch, and how to ask for permission. Load this skill at the start of every session in a project that has .agentharness-guarded-paths.json."
---
## File Placement Policy
**Load this skill at session start** if the project has
`.agentharness-guarded-paths.json`. Read the file before touching anything.
### Rule: check before creating
Before creating any new file or directory, check whether the target
location is guarded:
```bash
python3 -c "
import json
d = json.load(open('.agentharness-guarded-paths.json'))
print('Root guarded:', d['guard_root_level_new_items'])
print('Guarded dirs:', d['guarded_dirs'])
"
```
If the path is guarded: **stop and ask the user for permission.**
### What counts as guarded
- Any new file at the root level (when `guard_root_level_new_items: true`)
- Any file under `src/`, `docs/`, `tests/`, `conf/`, `logs/`, etc.
- Any root-level config file already listed in `guarded_root_files`
### Asking for permission
> "I need to create `docs/architecture/NEW_SECTION.md` to document X.
> This is in the guarded `docs/` directory. May I proceed?"
Wait for an explicit `yes`/`ok`/`go ahead` response.
### After getting permission: record it
Add the approved path to `.agentharness-allowed-additions.txt`:
```bash
echo "docs/architecture/NEW_SECTION.md" >> .agentharness-allowed-additions.txt
```
The pre-commit hook reads this file to allow the commit.
### No guarded-paths file = early-stage project
If `.agentharness-guarded-paths.json` doesn't exist:
1. Run: `python3 tools/analyze_structure.py . --recommend`
2. Present the recommendations to the user.
3. If accepted, create the structure and generate the config:
`python3 tools/analyze_structure.py . --output .agentharness-guarded-paths.json`
### Pre-commit enforcement
The hook at `tools/check-file-placement.sh` runs automatically before
every commit. If a staged file is in a guarded location and not in
`.agentharness-allowed-additions.txt`, the commit is blocked with a
clear message.
### Reference
Full protocol: `patterns/file-placement-policy/POLICY.md`
Analyzer: `tools/analyze_structure.py`
Hook: `tools/check-file-placement.sh`
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 3,978 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 repository77 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/accessibility.mdcCursor rule
- .cursor/rules/agentharness-router.mdcCursor rule
- .cursor/rules/agentic-loops.mdcCursor rule
- .cursor/rules/api-design.mdcCursor rule
- .cursor/rules/audit-review-followup.mdcCursor rule
- .cursor/rules/big-work-plan-review.mdcCursor rule
- .cursor/rules/branching.mdcCursor rule
- .cursor/rules/clean-architecture.mdcCursor rule
- .cursor/rules/code-review-api.mdcCursor rule
- .cursor/rules/code-review-db.mdcCursor rule
- .cursor/rules/code-review.mdcCursor rule
- .cursor/rules/code-review-ui.mdcCursor rule
- .cursor/rules/committing.mdcCursor rule
- .cursor/rules/database-conventions.mdcCursor rule
- .cursor/rules/dependency-audit.mdcCursor rule
- .cursor/rules/dependency-injection.mdcCursor rule
- .cursor/rules/design-patterns.mdcCursor rule
- .cursor/rules/docker-conventions.mdcCursor rule
- .cursor/rules/error-handling.mdcCursor rule
- .cursor/rules/github-issue-triage.mdcCursor rule
- .cursor/rules/go-conventions.mdcCursor rule
- .cursor/rules/harness-feedback.mdcCursor rule
- .cursor/rules/logging.mdcCursor rule
- .cursor/rules/multi-agent-coordination.mdcCursor rule
- .cursor/rules/mutation-testing.mdcCursor rule
- .cursor/rules/performance-profiling.mdcCursor rule
- .cursor/rules/planning-with-files.mdcCursor rule
- .cursor/rules/port-agent-config.mdcCursor rule
- .cursor/rules/project-bootstrap.mdcCursor rule
- .cursor/rules/python-conventions.mdcCursor rule
- .cursor/rules/react-best-practices.mdcCursor rule
- .cursor/rules/refactoring.mdcCursor rule
- .cursor/rules/requirements-clarification.mdcCursor rule
- .cursor/rules/security-review.mdcCursor rule
- .cursor/rules/solid-principles.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- .cursor/rules/typescript-conventions.mdcCursor rule
- accessibilitySkill
- agentic-loopsSkill
- api-designSkill
- audit-review-followupSkill
- big-work-plan-reviewSkill
- branchingSkill
- clean-architectureSkill
- code-review-apiSkill
- code-review-dbSkill
- code-reviewSkill
- code-review-uiSkill
- committingSkill
- database-conventionsSkill
- dependency-auditSkill
- dependency-injectionSkill
- design-patternsSkill
- docker-conventionsSkill
- error-handlingSkill
- file-placement-policySkill
- github-issue-triageSkill
- The first 60 shown.
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.

