Skip to content

Commit 62a16de

Browse files
authored
chore: update CLAUDE.md hierarchy with current org strategy context (#14)
- Update root CLAUDE.md with Organizational Context section, architecture details, external-contribution-safety coverage, and Development Standards - Update claude-code/CLAUDE.md: add Usage section, External Contribution Safety section, rename title for clarity - Add CLAUDE.md to 6 tool directories missing them: cursor, augment-code, cline, github-copilot, windsurf, kilo-code, roo-code - All new subdirectory CLAUDE.md files list every non-config file with descriptions and cross-references Generated by /generate-context skill from open-paws-strategy
1 parent 7625035 commit 62a16de

File tree

9 files changed

+451
-17
lines changed

9 files changed

+451
-17
lines changed

CLAUDE.md

Lines changed: 104 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
Ready-to-use AI coding instruction files for 12 tools, tailored for animal advocacy software. Copy a tool directory into any project root and the AI assistant immediately understands advocacy-domain constraints, security threat models, testing standards, and process workflows. Part of the Open Paws developer pipeline.
44

5+
## Organizational Context
6+
7+
**Role in flywheel:** This repo is the canonical source for AI coding methodology across all Open Paws projects. It feeds two downstream consumers: `graze-cli` bundles selected guides into its binary, and `desloppify` generates agent skill files from the same content. It is also curriculum content for the bootcamp — developers learn these 7 concerns and 6 process skills through the training pipeline.
8+
9+
**Layer:** 1 — Strengthen. Lever: Strengthen.
10+
11+
**External contribution safety (2026-04-01):** All 12 tool directories now include `external-contribution-safety.md` (or equivalent for the tool's format). This file teaches the two-state identity model: advocacy mode for Open Paws repos, neutral mode (org identity suppressed, commit hygiene enforced) for external repos. The `agents-md/AGENTS.md` is the vendor-neutral version of the same. This was implemented in PR #13.
12+
13+
**Unicode integrity (CI):** A CI action checks all instruction files for hidden Unicode characters (Rules File Backdoor attack). The `scripts/check-unicode-integrity.py` script is the underlying tool.
14+
15+
**Strategy references:**
16+
- `open-paws-strategy/ecosystem/repos.md` — structured-coding-with-ai entry with full breakdown
17+
- `open-paws-strategy/closed-decisions.md` — 2026-04-01 external contribution safety decision
18+
- `open-paws-strategy/programs/developer-training-pipeline/guild/operations.md` — bootcamp curriculum context
19+
520
## Quick Start
621

722
No build step. Pick a tool directory, copy its files into your project:
@@ -18,18 +33,19 @@ See README.md for copy commands for all 12 tools.
1833
## Architecture
1934

2035
```
21-
claude-code/ 15 files — CLAUDE.md + scoped rules + skills + hooks template
22-
cursor/ 14 files — .cursorrules + .mdc files (4 activation modes)
23-
github-copilot/ 22 files — copilot-instructions + prompts + chat modes + skills
24-
windsurf/ 14 files — .windsurf/rules/ (4 trigger types, 6K/12K char limits)
25-
kilo-code/ 21 files — mode files + Memory Bank + concerns + skills
26-
cline/ 14 files — .clinerules/ (Plan/Act paradigm)
27-
roo-code/ 19 files — .roomodes JSON + mode rules + concerns + skills
28-
augment-code/ 14 files — .augment/rules/
29-
aider/ 1 file — CONVENTIONS.md (all-in-one)
30-
gemini-cli/ 1 file — GEMINI.md (all-in-one)
31-
jetbrains-junie/ 1 file — .junie/guidelines.md (all-in-one)
32-
agents-md/ 1 file — AGENTS.md (vendor-neutral, 20+ tools)
36+
claude-code/ CLAUDE.md + hooks-template.md + .claude/ (rules/ + skills/)
37+
cursor/ .cursorrules + .cursor/rules/ (.mdc files)
38+
github-copilot/ .github/ (copilot-instructions.md + instructions/ + prompts/ + skills/ + chat-modes/)
39+
windsurf/ .windsurf/rules/ (trigger-type rules, 6K/12K char limits)
40+
kilo-code/ .kilocode/ (rules/ mode files + Memory Bank + skills/)
41+
cline/ .clinerules/ (Plan/Act paradigm — all rules as flat files)
42+
roo-code/ .roomodes + .roo/rules/ (JSON modes + mode rules)
43+
augment-code/ .augment/rules/ (concern rules + process skills)
44+
aider/ CONVENTIONS.md (all-in-one)
45+
gemini-cli/ GEMINI.md (all-in-one)
46+
jetbrains-junie/ README.md (references .junie/guidelines.md pattern)
47+
agents-md/ AGENTS.md (vendor-neutral, 20+ tools)
48+
scripts/ check-unicode-integrity.py (instruction file integrity checker)
3349
```
3450

3551
137 files total across 12 tool directories.
@@ -41,7 +57,9 @@ agents-md/ 1 file — AGENTS.md (vendor-neutral, 20+ tools)
4157
| `README.md` | Full tool comparison, copy commands, content coverage |
4258
| `claude-code/CLAUDE.md` | Claude Code root instruction file |
4359
| `claude-code/hooks-template.md` | Pre-commit/post-edit/pre-push hook setup guide |
44-
| `agents-md/AGENTS.md` | Universal fallback for any unsupported tool |
60+
| `claude-code/.claude/rules/external-contribution-safety.md` | Two-state identity model for external repos |
61+
| `agents-md/AGENTS.md` | Universal vendor-neutral fallback for any unsupported tool |
62+
| `scripts/check-unicode-integrity.py` | Detects hidden Unicode in instruction files (Rules File Backdoor defense) |
4563

4664
## Content Coverage
4765

@@ -51,8 +69,78 @@ All 12 tools cover the same 7 concerns and 6 process skills:
5169

5270
**Skills:** git-workflow, testing-strategy, requirements-interview, plan-first-development, code-review, security-audit
5371

72+
Each tool also includes: external-contribution-safety (two-state identity model for external repos).
73+
5474
## Development
5575

56-
- **No dependencies** -- pure markdown/JSON instruction files
57-
- **Adding a new tool:** Create `tool-name/` directory, implement the 7 concerns + 6 skills in the tool's native format
58-
- **Editing content:** Each tool was independently authored for its format -- changes to one do not auto-propagate to others
76+
- **No dependencies** — pure markdown/JSON instruction files
77+
- **Adding a new tool:** Create `tool-name/` directory, implement the 7 concerns + 6 skills in the tool's native format, add external-contribution-safety content
78+
- **Editing content:** Each tool was independently authored for its format — changes to one do not auto-propagate to others
79+
- **Integrity check:** Run `python scripts/check-unicode-integrity.py` before committing any instruction file edits
80+
- **CI:** Unicode integrity check runs on all PRs via GitHub Action
81+
82+
## Development Standards
83+
84+
### 10-Point Review Checklist (ranked by AI violation frequency)
85+
86+
Apply to every PR:
87+
88+
1. **DRY** — AI clones code at 4x the human rate. Search before writing anything new
89+
2. **Deep modules** — Reject shallow wrappers and pass-through methods. Interface must be simpler than implementation (Ousterhout)
90+
3. **Single responsibility** — Each function does one thing at one level of abstraction
91+
4. **Error handling** — Never catch-all. AI suppresses errors and removes safety checks. Every catch block must handle specifically
92+
5. **Information hiding** — Don't expose internal state. Mask API keys (last 4 chars only)
93+
6. **Ubiquitous language** — Use movement terminology consistently. Never let AI invent synonyms for domain terms
94+
7. **Design for change** — Abstraction layers and loose coupling. Tools must outlast individual campaigns
95+
8. **Legacy velocity** — AI code churns 2x faster. Use characterization tests before modifying existing code
96+
9. **Over-patterning** — Simplest structure that works. Three similar lines of code is better than a premature abstraction
97+
10. **Test quality** — Every test must fail when the covered behavior breaks. Mutation score over coverage percentage
98+
99+
### Quality Gates
100+
101+
**Desloppify** — Target score: ≥ 85 (all other repos).
102+
103+
```bash
104+
pip install "git+https://github.com/Open-Paws/desloppify.git#egg=desloppify[full]"
105+
desloppify scan --path .
106+
desloppify next
107+
```
108+
109+
**Speciesist language** — Run `semgrep --config semgrep-no-animal-violence.yaml` on all `.md` edits.
110+
111+
**Instruction file integrity** — Run `python scripts/check-unicode-integrity.py` before pushing. CI also runs this automatically.
112+
113+
**Two-failure rule** — After two failed fixes on the same problem, stop and restart with a better approach.
114+
115+
### Plan-First Development
116+
117+
Read existing files → identify what changes → write specification → break into subtasks → implement and verify each → commit per subtask
118+
119+
### Structured Coding Reference
120+
121+
For tool-specific AI coding instructions, copy the corresponding directory from this repo into your project root. This repo IS the reference.
122+
123+
### Seven Concerns — repo-specific implications
124+
125+
All 7 always apply. Critical for this repo:
126+
127+
1. **Testing** — Content changes must not break the downstream consumers (graze-cli bundling, desloppify skill generation). Verify content renders correctly in the target tool's format
128+
2. **Security** — Instruction file integrity is a first-class concern. Hidden Unicode in instruction files is the Rules File Backdoor attack. Every PR runs the Unicode check
129+
3. **Privacy** — No activist data or operational details in example code or sample prompts
130+
4. **Cost** — Instruction files are loaded into every AI session that uses them. Keep them lean — every token counts at scale across the bootcamp
131+
5. **Advocacy domain** — This repo IS the canonical source for advocacy domain language. Never introduce synonyms for established terms
132+
6. **Accessibility** — Instruction files must work in editors with no syntax highlighting, screen readers, and plain-text terminals
133+
7. **Emotional safety** — Sample prompts and example scenarios must not include graphic investigation content
134+
135+
### Advocacy Domain Language
136+
137+
Use these terms consistently. Never introduce synonyms:
138+
- **Campaign** — organized advocacy effort (not "project" or "initiative")
139+
- **Investigation** — covert documentation (not "research" or "audit")
140+
- **Coalition** — multi-org alliance
141+
- **Sanctuary** — permanent animal care facility (not "shelter" or "foster")
142+
- **Farmed animal** — not "livestock"
143+
- **Factory farm** — not "farm" or "facility"
144+
- **Ag-gag** — laws criminalizing undercover agricultural investigation
145+
- **Companion animal** — not "pet"
146+
- **Direct action** — physical intervention with specific legal status

augment-code/CLAUDE.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Augment Code — Animal Advocacy Instructions
2+
3+
Augment Code instruction files for animal advocacy development. Copy this directory into any Open Paws project root.
4+
5+
## Usage
6+
7+
```bash
8+
cp -r .augment your-project/
9+
```
10+
11+
The `.augment/rules/` files are loaded by Augment Code based on filename context.
12+
13+
## .augment/rules/ Contents
14+
15+
| File | What it covers | When to read |
16+
|------|---------------|--------------|
17+
| `main.md` | Always-active baseline: advocacy domain, security constraints, 10-point checklist | Augment loads this automatically |
18+
| `accessibility.md` | Internationalization, low-bandwidth, offline-first, low-literacy design | Accessibility work |
19+
| `advocacy-domain.md` | Ubiquitous language dictionary, bounded contexts, anti-corruption layers | Any advocacy feature work |
20+
| `code-review.md` | Five-layer review pipeline (automated → AI → Ousterhout → AI failures → advocacy) | PR review |
21+
| `cost-optimization.md` | Model routing, token budget discipline, vendor lock-in as movement risk | LLM integration work |
22+
| `emotional-safety.md` | Progressive disclosure, content warnings, burnout prevention | Content-displaying features |
23+
| `external-contribution-safety.md` | Two-state identity: advocacy mode vs neutral mode for external repos | Any external repo work |
24+
| `geo-seo.md` | SEO and GEO optimization rules | Public-facing pages |
25+
| `git-workflow.md` | Atomic commits, ephemeral branches, PR curation | Git operations |
26+
| `plan-first.md` | Read → plan → code → verify workflow | Before any implementation |
27+
| `privacy.md` | Activist identity protection, real deletion, zero-knowledge architecture | Any data handling |
28+
| `requirements-interview.md` | Six-phase stakeholder interview | Requirements gathering |
29+
| `security-audit.md` | 10-step advocacy security audit | Security reviews |
30+
| `security.md` | Three-adversary threat model, zero-retention APIs, device seizure preparation | Any security-sensitive work |
31+
| `testing-strategy.md` | Spec-first, mutation testing, five anti-patterns | Test writing |
32+
| `testing.md` | Testing concerns and quality gates | Test setup |
33+
34+
## Cross-References
35+
36+
- For Claude Code format, see `../claude-code/`
37+
- For Cursor MDC format, see `../cursor/`
38+
- For universal vendor-neutral instructions, see `../agents-md/AGENTS.md`

claude-code/CLAUDE.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
# Animal Advocacy Platform
1+
# Claude Code — Animal Advocacy Instructions
22

33
Software for animal liberation and advocacy. This is a high-risk domain: investigation data is subpoena-target evidence, activists face legal prosecution, and system compromise endangers lives. See `.claude/rules/advocacy-domain.md` for ubiquitous language — NEVER introduce synonyms for established domain terms.
44

5+
## Usage
6+
7+
Copy this directory into any Open Paws project root:
8+
9+
```bash
10+
cp CLAUDE.md your-project/
11+
cp hooks-template.md your-project/
12+
cp -r .claude your-project/
13+
```
14+
15+
The `.claude/rules/` files are scoped by filename and activate contextually. The `.claude/skills/` files are invoked by slash commands or agent prompts. See `hooks-template.md` for pre-commit/post-edit/pre-push hook setup.
16+
517
## Workflow
618

719
Read existing code before writing anything. Plan before code: read, plan, code, verify. Never create files or functions that duplicate existing ones — search first. Write a specification before implementation. Write a failing test before writing code. After two failed fix attempts, stop and re-approach with a better prompt rather than compounding errors.
@@ -45,6 +57,18 @@ See `hooks-template.md`. Hooks execute shell commands before/after agent actions
4557

4658
See `.claude/rules/desloppify.md` for desloppify setup and usage.
4759

60+
## External Contribution Safety
61+
62+
When working in a repository that is NOT part of the Open Paws organization, switch to neutral mode:
63+
- Match the target repo's commit style — read the last 5 commits first
64+
- Do not mention Open Paws, advocacy context, or movement terminology in commits, PRs, or comments
65+
- Do not include Co-Authored-By trailers or "Generated with" attribution
66+
- Write PR descriptions proportional to diff size, human-style
67+
68+
Repo classification: `git remote get-url origin` — if the owner is `Open-Paws`, use advocacy mode. Otherwise, neutral mode. Absent positive confirmation, default to neutral (safe).
69+
70+
See `.claude/rules/external-contribution-safety.md` for the full two-state identity model.
71+
4872
## MCP Servers
4973

5074
Any MCP server handling sensitive advocacy data MUST be self-hosted. MCP extends agent capabilities but also extends the attack surface — audit each server's data access, network calls, and retention policy before enabling.

cline/CLAUDE.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Cline — Animal Advocacy Instructions
2+
3+
Cline instruction files for animal advocacy development using the Plan/Act paradigm. Copy this directory into any Open Paws project root.
4+
5+
## Usage
6+
7+
```bash
8+
cp -r .clinerules your-project/
9+
```
10+
11+
The `.clinerules/` directory contains flat files. Cline loads all of them and applies them contextually.
12+
13+
## .clinerules/ Contents
14+
15+
| File | What it covers | When to read |
16+
|------|---------------|--------------|
17+
| `main.md` | Always-active baseline: advocacy domain, security constraints, 10-point checklist | Cline loads this automatically |
18+
| `accessibility.md` | Internationalization, low-bandwidth, offline-first, low-literacy design | Accessibility work |
19+
| `advocacy-domain.md` | Ubiquitous language dictionary, bounded contexts, anti-corruption layers | Any advocacy feature work |
20+
| `code-review.md` | Five-layer review pipeline (automated → AI → Ousterhout → AI failures → advocacy) | PR review |
21+
| `cost-optimization.md` | Model routing, token budget discipline, vendor lock-in as movement risk | LLM integration work |
22+
| `emotional-safety.md` | Progressive disclosure, content warnings, burnout prevention | Content-displaying features |
23+
| `external-contribution-safety.md` | Two-state identity: advocacy mode vs neutral mode for external repos | Any external repo work |
24+
| `geo-seo.md` | SEO and GEO optimization rules | Public-facing pages |
25+
| `git-workflow.md` | Atomic commits, ephemeral branches, PR curation | Git operations |
26+
| `plan-first.md` | Read → plan → code → verify workflow | Before any implementation |
27+
| `privacy.md` | Activist identity protection, real deletion, zero-knowledge architecture | Any data handling |
28+
| `requirements-interview.md` | Six-phase stakeholder interview | Requirements gathering |
29+
| `security-audit.md` | 10-step advocacy security audit | Security reviews |
30+
| `security.md` | Three-adversary threat model, zero-retention APIs, device seizure preparation | Any security-sensitive work |
31+
| `testing-strategy.md` | Spec-first, mutation testing, five anti-patterns | Test writing |
32+
| `testing.md` | Testing concerns and quality gates | Test setup |
33+
34+
## Cross-References
35+
36+
- For Claude Code format, see `../claude-code/`
37+
- For Cursor MDC format, see `../cursor/`
38+
- For universal vendor-neutral instructions, see `../agents-md/AGENTS.md`

cursor/CLAUDE.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Cursor — Animal Advocacy Instructions
2+
3+
Cursor MDC instruction files for animal advocacy development. Copy this directory into any Open Paws project root.
4+
5+
## Usage
6+
7+
```bash
8+
cp .cursorrules your-project/
9+
cp -r .cursor your-project/
10+
```
11+
12+
The `.cursorrules` file is the always-active baseline. `.cursor/rules/` files use MDC frontmatter activation modes (always, auto, agent-requested, manual).
13+
14+
## Files
15+
16+
| File | What it covers | When to read |
17+
|------|---------------|--------------|
18+
| `.cursorrules` | Always-active baseline rules: advocacy domain, security, 10-point checklist | Cursor loads this automatically |
19+
| `.cursor/rules/README.md` | MDC activation mode guide | When adding new rules |
20+
21+
## .cursor/rules/ Contents
22+
23+
| File | What it covers | When to read |
24+
|------|---------------|--------------|
25+
| `accessibility.mdc` | Internationalization, low-bandwidth, offline-first, low-literacy design | Accessibility work |
26+
| `advocacy-domain.mdc` | Ubiquitous language dictionary, bounded contexts, anti-corruption layers | Any advocacy feature work |
27+
| `code-review.mdc` | Five-layer review pipeline (automated → AI → Ousterhout → AI failures → advocacy) | PR review |
28+
| `cost-optimization.mdc` | Model routing, token budget discipline, vendor lock-in as movement risk | LLM integration work |
29+
| `emotional-safety.mdc` | Progressive disclosure, content warnings, burnout prevention | Content-displaying features |
30+
| `external-contribution-safety.mdc` | Two-state identity: advocacy mode vs neutral mode for external repos | Any external repo work |
31+
| `geo-seo.mdc` | SEO and GEO optimization rules | Public-facing pages |
32+
| `git-workflow.mdc` | Atomic commits, ephemeral branches, PR curation | Git operations |
33+
| `plan-first.mdc` | Read → plan → code → verify workflow | Before any implementation |
34+
| `privacy.mdc` | Activist identity protection, real deletion, zero-knowledge architecture | Any data handling |
35+
| `requirements-interview.mdc` | Six-phase stakeholder interview | Requirements gathering |
36+
| `security-audit.mdc` | 10-step advocacy security audit | Security reviews |
37+
| `security.mdc` | Three-adversary threat model, zero-retention APIs, device seizure preparation | Any security-sensitive work |
38+
| `testing-strategy.mdc` | Spec-first, mutation testing, five anti-patterns | Test writing |
39+
| `testing.mdc` | Testing concerns and quality gates | Test setup |
40+
41+
## Cross-References
42+
43+
- For Claude Code format, see `../claude-code/`
44+
- For the canonical advocacy rules source, see `../claude-code/.claude/rules/`
45+
- For universal vendor-neutral instructions, see `../agents-md/AGENTS.md`

0 commit comments

Comments
 (0)