file-placement-policy
Skill1 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 skill 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 12
Load this skill at session start: if the project has .agentharness-guarded-paths.json.
- Distinctive: line 19
Before creating any new file or directory, check whether the target location is guarded:
- Distinctive: line 31
If the path is guarded: stop and ask the user for permission.
- Very specific: line 48
Wait for an explicit yes/ok/go ahead response.
- Very specific: line 54
Add the approved path to .agentharness-allowed-additions.txt:
- Very specific: line 66
If .agentharness-guarded-paths.json doesn't exist:
- Very specific: line 70
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 308,232 skill 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
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:
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.mdto document X. This is in the guardeddocs/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:
echo "docs/architecture/NEW_SECTION.md" >> .agentharness-allowed-additions.txtThe 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:
- Run:
python3 tools/analyze_structure.py . --recommend - Present the recommendations to the user.
- 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
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/file-placement-policy.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
- 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.

