Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ The repository is designed so a fresh clone is publishable without further redac

All in-repo examples use placeholders only: `<your-org>/<your-repo>`, `<workspace>`, `<project-root>`, `<your-api-key>`, `<contributor>`. Full publication discipline: [`docs/PUBLICATION_CHECKLIST.md`](docs/PUBLICATION_CHECKLIST.md). Defence-in-depth detail: [`docs/SECURITY.md`](docs/SECURITY.md).

## Context budget

The repo is optimized around a compact always-loaded kernel plus lazy-loaded depth:

- [`CLAUDE.md`](CLAUDE.md) is the always-loaded operating kernel.
- [`AGENTS.md`](AGENTS.md) and [`WARP.md`](WARP.md) are public-safe pointer files.
- Commands, skills, agents, domains, recipes, and references are lazy-loaded only after routing.
- Bulky examples, templates, deep workflows, and implementation detail live in local `references/` docs next to each skill or agent.
- Runtime behavior is preserved; what's lazy stays out of context until needed.

Reference extraction is now the standard pattern for large skills and agents: the operating contract (frontmatter, when-to-use, decision logic, safety rules, validation gates, output expectations) stays inline; everything else moves into `references/`. Measure with `bash scripts/context-budget-report.sh`. Policy: [`docs/CONTEXT_BUDGET.md`](docs/CONTEXT_BUDGET.md). Campaign log: [`docs/CONTEXT_BUDGET_PLAN.md`](docs/CONTEXT_BUDGET_PLAN.md).

**Current status: the reference-extraction campaign is practically complete.** Large SKILL.md and high-value agent files were compacted into operating contracts; detailed examples, troubleshooting, and playbooks moved into lazy-loaded references. Remaining large files are mostly routing indexes, command bodies, vendored upstream references, or intentionally lazy material — further work is optional polish.

## Validation

```bash
Expand Down Expand Up @@ -194,6 +208,7 @@ If you fork this repo for personal use, the first commit on your fork should NOT
| Adoption guide | [`docs/ADOPTION_GUIDE.md`](docs/ADOPTION_GUIDE.md) |
| Compatibility matrix | [`docs/COMPATIBILITY.md`](docs/COMPATIBILITY.md) |
| Context budget guidance | [`docs/CONTEXT_BUDGET.md`](docs/CONTEXT_BUDGET.md) |
| Context budget — extraction campaign log | [`docs/CONTEXT_BUDGET_PLAN.md`](docs/CONTEXT_BUDGET_PLAN.md) |
| Common failure modes | [`docs/TROUBLESHOOTING.md`](docs/TROUBLESHOOTING.md) |
| Pre-publication safety checklist | [`docs/PUBLICATION_CHECKLIST.md`](docs/PUBLICATION_CHECKLIST.md) |
| Hooks reference (all 16) | [`docs/HOOKS.md`](docs/HOOKS.md) |
Expand Down
6 changes: 3 additions & 3 deletions decisions/2026-05-05-history-rewrite-2-pii-and-cross-repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Operator invoked `/ultraplan` security audit ("ensure no leak whatsoever") on 20

1. **Operator OS username** (`<scrubbed>`) embedded in 16 tracked files: 2 audit-doc absolute paths + 14 yaml `author:` fields.
2. **Second-private-project file paths** (`~/<private-project>/...`) leaked across 25 lines in `docs/SECURITY_PLAYBOOK.md` — same exposure class as the 2026-05-03 incident.
3. **Operator's real email** (`<scrubbed>@​gmail.​com`) embedded in the **author metadata of every commit** (32+ commits) — discovered during the all-history grep. NOT visible to forward-state file scans.
3. **Operator's real email** (`<redacted-email>`) embedded in the **author metadata of every commit** (32+ commits) — discovered during the all-history grep. NOT visible to forward-state file scans.
4. **Operator's full name** (`the operator`) still present in older commits' diffs as deletion lines from prior PII sweeps (29 blobs + 2 commit messages).

Forward-state fix landed in `944f9fe` (now orphaned). This decision covers the destructive history rewrite that scrubs all four classes from every commit.
Expand All @@ -25,7 +25,7 @@ Single-pass `git filter-repo` rewrite with:
- operator full name → `Repository owner`
- operator OS username → `redacted-username`
- operator email-prefix → `redacted-email`
- any `@​gmail.​com` → `@example.invalid` (catch-all)
- any personal email address → `@example.invalid` (catch-all)
- `~/<private-project>` → `~/your-project`
3. **`--replace-message`** with the same pattern set so commit-message bodies are scrubbed.
4. **Force-push** to `origin/main`.
Expand All @@ -40,7 +40,7 @@ Fresh `git clone` verification (post-push, run on 2026-05-05 22:03):
| Full name | 0 | 0 | 0 |
| OS username | 0 | 0 | 0 |
| Email-prefix | 0 | 0 | 0 |
| `@​gmail.​com` | 0 | 0 | 0 |
| Personal email pattern | 0 | 0 | 0 |
| `~/<private-project>` | 0 | 0 | 0 |
| Public handle (allowed) | 68 | (LICENSE / README / ELITE-OPS docs / decisions logs) |

Expand Down
35 changes: 35 additions & 0 deletions docs/CONTEXT_BUDGET_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,41 @@ inflection point when no SKILL.md was the top context risk.
inventory script counts any `.md` under `agents/` as an agent definition.
- Preserve upstream vendored content (e.g., `skills/n8n/czlonkowski/*`).

## Final campaign status

Status: **practically complete (~95% by impact).**

The campaign achieved its primary goal: high-frequency operating files
were compacted, bulky examples and implementation detail were moved into
lazy-loaded references, and runtime behavior was preserved across every
extraction.

End-state evidence:

- No SKILL.md exceeds ~2,800 estimated tokens (top remaining: `react-bits` at ~2,765).
- `pm-agent.md` dropped from ~3,459 → ~2,302 tokens (no longer in P1–P3 risk list).
- `CLAUDE.md` compacted from ~2,285 → ~2,103 tokens; still within the 5,000-token budget threshold.
- Top context risks are now `ALWAYS_LOAD_RISK` (the kernel, by design),
`ROUTING_INDEX_RISK` (lazy on dispatch), and `LAZY_REFERENCE_HEAVY`
(lazy on invocation).
- All validation gates pass: `validate.sh`, `check-public-safety.sh`,
`audit-public-readiness.sh --quick`, gitleaks, trivy.

Remaining large files are acceptable because they are primarily:

- **Routing indexes** (`agents/REGISTRY.md`, domain `DOMAIN.md` files) — loaded only when routing fires.
- **Lazy command bodies** (`commands/sc/*`, `commands/bmad/*`) — loaded only on command invocation.
- **Lazy reference files** (per-skill `references/`, large `*.md` resources) — loaded only when the skill is selected.
- **Vendored upstream material** (`skills/n8n/czlonkowski/*`) — intentionally left untouched to preserve upstream sync.

Future work is optional polish unless a file becomes always-loaded,
exceeds budget, or starts appearing repeatedly in high-priority
context-risk reports. Re-open the campaign only if:

1. A new SKILL.md exceeds 2,800 tokens.
2. `CLAUDE.md` exceeds 4,000 tokens.
3. A validation gate starts failing on count-drift or public-safety.

## Validator constraints that shape CLAUDE.md

`scripts/validate.sh` requires the following strings to exist verbatim in
Expand Down
Loading