context-discipline
Skill4 starsChanged 6 days agoMITView on GitHub
Enforce large-project context discipline with no-raw-read thresholds, phase-boundary compaction, and tiered AGENTS.md guidance.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- ios3kov/codex-skillstheir own version, first seen Nov 29, 2026
- justinwilliames/skillstheir own version, first seen Nov 29, 2026
- PedroMosquera/squadaitheir own version, first seen Oct 13, 2026
- Resgrid/Coretheir own version, first seen Oct 8, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- Resgrid/Core★ 240same name
- PedroMosquera/squadai★ 10same name
- justinwilliames/skills★ 1same name
- ios3kov/codex-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accounting-bookkeepingSkill
- agent-context-persistenceSkill
- asoSkill
- brainstorm-argumentationSkill
- brainstorm-debateSkill
- brainstorm-lensesSkill
- causal-inferenceSkill
- creative-briefSkill
- customer-support-opsSkill
- data-quality-checksSkill
- design-fundamentalsSkill
- ecommerce-operationsSkill
- event-taxonomySkill
- exec-coding-standardsSkill
- exec-cppSkill
- exec-csharpSkill
- exec-deliverableSkill
- exec-github-actionsSkill
- exec-goSkill
- exec-jvmSkill
- exec-phpSkill
- exec-pythonSkill
- exec-rubySkill
- exec-rustSkill
- exec-self-testingSkill
- exec-swiftSkill
- exec-typescriptSkill
- executor-fallbackSkill
- exec-visualizationSkill
- fast-pathSkill
- final-reviewSkill
- financial-auditSkill
- hr-recruitingSkill
- influencer-strategySkill
- interview-ask-backSkill
- interview-elicitationSkill
- jev-assistSkill
- json-data-wranglingSkill
- legal-contract-basicsSkill
- localization-copySkill
- manufacturing-ops-planningSkill
- marketing-attributionSkill
- media-planningSkill
- okr-planningSkill
- pack-game-analyticsSkill
- parallel-executionSkill
- performance-marketingSkill
- personal-financeSkill
- plan-architectureSkill
- plan-backlogSkill
- plan-research-firstSkill
- preflightSkill
- profile-contentSkill
- profile-designSkill
- profile-pilotSkill
- profile-planSkill
- real-estate-analysisSkill
- review-conformanceSkill
- review-dualSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Keep bulk evidence outside the orchestrator and bring back only anchored conclusions.
- Distinctive: line 13
Write durable state to disk so a fresh session can resume without hidden context.
- Very specific: line 35
Keep full .codex-flow/PLAN.md as the durable source of truth on disk.
- Distinctive: line 38
Treat derived slice files as generated views.
- Very specific: line 39
Check the generation anchor recorded in each slice header.
- Very specific: line 68
Keep the root AGENTS.md to about 50 lines or fewer.
- Distinctive: line 70
Create a per-package AGENTS.md only when the approved PLAN.md Component → files map touches that package and its conventions differ from …
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context Discipline
Why
Protect the orchestrator's working context across long backlogs. Repeated exploration, large diffs, and verbose logs crowd out current-task evidence. Keep bulk evidence outside the orchestrator and bring back only anchored conclusions. Write durable state to disk so a fresh session can resume without hidden context.
Recitation
At every phase boundary and immediately before each codex_execute, re-state all three in one
concise line: the current phase, the current task ID + title, and the next pending gate. Recite the
run position from current durable state; do not re-read control files solely for this recitation.
No-raw-read rules (orchestrator)
- For a diff over 400 lines, delegate a conformance summary to a subagent, then directly read only targeted critical hunks.
- For test or build logs, run them via a script and inspect only tail output or grep matches. Delegate full-log analysis to a subagent.
- During Phase 2 exploration, use Explore subagents. Require conclusions with paths and line anchors; never bulk-dump files into the orchestrator.
Tiered read-back
- Have the orchestrator and Codex read budgeted derived slices instead of whole control files:
.codex-flow/CONTEXT-T<n>.md(≤ 4000 estimated tokens using the chars/4 heuristic) for each task and.codex-flow/RESUME.md(≤ 8000 estimated tokens using the chars/4 heuristic) on resume. - Keep full
.codex-flow/PLAN.mdas the durable source of truth on disk. Read it in full only to resolve a disputed finding or to follow a slice's omitted-pointer line to a needed section — the generated slice is never optional. If the helper is not found, STOP and tell the user to reinstall the codex-flow plugin (its scripts/ directory is required); if it is present but exits non-zero, surface the error to the user and STOP. Never edit control files by hand. - Treat derived slice files as generated views. Regenerate them; never hand-edit them.
- Check the generation anchor recorded in each slice header. Re-check every
[verify]-stamped block against the current code before relying on it.
Safe compaction points
- Phase 2 boundary: wait until the plan is approved, PLAN.md and planning.md are written, and the AGENTS.md guidance commit is complete. TASKS.md does not exist yet and is not required.
- Sequential task boundary: wait until the task passes review and its Decision log schema block is on disk. If checkpoint commits are enabled, wait for that commit too.
- Parallel wave boundary: wait until every task commit is merged, the integration review passes, and the coordinator appends the per-task Decision log schema blocks.
- At an allowed boundary, verify the required durable state is on disk. Tell the user this is a
safe compaction point and suggest running
/compact; the orchestrator cannot run that client command. With state on disk, an auto-compaction landing at or after the boundary is lossless. - NEVER compact mid-task.
- Phase 5 step 0 re-reads the task's generated context slice and TASKS.md entry from disk after compaction; read full PLAN.md only under the Tiered read-back rules.
| Boundary | Safe compaction point? |
| Phase 2 plan approval | Yes — after PLAN.md, the AGENTS.md commit, and planning.md are complete |
| Sequential task completion | Yes — after review and the Decision log block; also the checkpoint commit when enabled |
| Parallel wave completion | Yes — after merge, integration review, and per-task Decision log blocks |
| Mid-implementation | No |
| After a failed approach | Record the dead end on disk, then wait for an allowed boundary; never mid-attempt |
Tiered AGENTS.md
- Generate AGENTS.md files in Phase 2 after plan approval and before Phase 3.
- Keep the root AGENTS.md to about 50 lines or fewer. Include the project one-liner, exact build/test/lint commands, and repo-wide conventions Codex cannot infer.
- Create a per-package AGENTS.md only when the approved PLAN.md Component → files map touches that package and its conventions differ from the root. Apply nearest-wins semantics.
- Make additive-only changes: create AGENTS.md if missing; if present, append or propose missing facts. Never delete or rewrite user lines.
- Replace every angle-bracket field in this template with repository facts:
# AGENTS.md
<Project purpose in one line.>
## Commands
- Build: `<exact build command>`
- Test: `<exact test command>`
- Lint: `<exact lint command>`
## Conventions
- <Repo-wide or package-specific fact Codex cannot infer.>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.

