AgentLogic
AGENTS.md0 starsChanged 6 days agoMITView on GitHub
Before making changes here, read AGENTS.md and README.md first. Then follow the repository-declared logic entry chain, including 00_START_HERE.md, modules/01_MasterLogic.md, and modules/15_LogicEntryChecklist.md when applicable. Before every new coding round, explicitly decide whether the current task extends the previous coding round. If it does not, explicitly ask whether to forget/compress context before continuing. Treat this flow as a blocking gate, not as guidance, documentation, or a reminder. Do not infer continuation by yourself. Do not skip the context-reset question for efficiency. Do…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 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 repository60 other files it gives its agents.
- skills/agent-browser/AGENTS.mdAGENTS.md
- skills/reverse-skill/AGENTS.mdAGENTS.md
- spec-kit/AGENTS.mdAGENTS.md
- skills/reverse-skill/CLAUDE.mdCLAUDE.md
- skills/taste-skill/skills/llms.txtllms.txt
- multimodal-media-directorSkill
- novel-story-architectSkill
- screenplay-manga-directorSkill
- ui-ux-pro-maxSkill
- appsec-reviewSkill
- ask-mattSkill
- codebase-designSkill
- code-reviewSkill
- code-simplifierSkill
- decompile-reconstructionSkill
- diagnosing-bugsSkill
- diagram-flowchart-architectSkill
- domain-modelingSkill
- gh-pr-ci-triageSkill
- grill-with-docsSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- prototypeSkill
- prSkill
- researchSkill
- resolving-merge-conflictsSkill
- retroSkill
- setup-matt-pocock-skillsSkill
- skill-evaluatorSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wayfinderSkill
- wizardSkill
- chrome-extensionsSkill
- modern-web-guidanceSkill
- web-data-visualizationSkill
- web-game-studioSkill
- nano-banana-proSkill
- ponytail-auditSkill
- ponytail-debtSkill
- ponytail-gainSkill
- ponytail-helpSkill
- ponytail-reviewSkill
- ponytailSkill
- grillingSkill
- grill-meSkill
- handoffSkill
- office-pro-suiteSkill
- product-requirements-grillingSkill
- role-persona-routerSkill
- teachSkill
- to-questionnaireSkill
- wait-whatSkill
- writing-for-agentsSkill
- writing-great-skillsSkill
- reverse-skills-routerSkill
- self-improving-agentSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
28 rules. About 1 is common, 14 are distinctive, and 13 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 4
Before making changes here, read AGENTS.md and README.md first.
- Distinctive: line 8
Before every new coding round, explicitly decide whether the current task extends the previous coding round.
- Distinctive: line 10
If it does not, explicitly ask whether to forget/compress context before continuing.
- Distinctive: line 12
Treat this flow as a blocking gate, not as guidance, documentation, or a reminder.
- Distinctive: line 13
Do not infer continuation by yourself.
- Distinctive: line 14
Do not skip the context-reset question for efficiency.
- Distinctive: line 16
Do not continue deeper reading, modify files, delete files, perform write actions, or begin implementation before the logic-entry loop …
- Distinctive: line 26
If the user asks to install, load, mount, bind, or use this logic on the local computer, read:
- Distinctive: line 41
Read AGENTS.md and README.md.
- Very specific: line 42
Read 00_START_HERE.md and confirm the current logic entry.
- Distinctive: line 46
Only after the applicable gates pass, proceed with planning, implementation, validation, or rule synchronization.
- Distinctive: line 69
Before every new coding round:
- Very specific: line 73
if it does not, ask whether to forget/compress context before continuing
- Distinctive: line 79
Before selecting a development lifecycle, classify the task:
- Very specific: line 116
Update PROJECT_MAP.md in the same commit as a structural change.
- Very specific: line 117
Update CODE_MAP.md in the same commit as an affected key-flow, symbol, state, interface, or validation change.
- Very specific: line 118
Update .learnings/ERRORS.md in the same commit as a material error correction.
- Very specific: line 119
Keep .specify/ and docs/adr/ only when their matching gates apply.
- Common: line 120
Do not track secrets, personal paths, private prompts, raw logs, or default Graphify output.
- Very specific: line 128
11-File Version & Skill Lockstep Sync: Never update only manifest.json and README.md.
- Very specific: line 138
No PowerShell Reserved Variable Names: Never use $host as a loop/local variable (collides with read-only automatic $Host).
- Very specific: line 139
Single-Quoted Here-Strings for Markdown Templates: Never put Markdown backticks inside double-quoted PowerShell "..." or @"..."@ (where ` f …
- Very specific: line 143
Every portable skills//SKILL.md MUST have a valid YAML front-matter name: and be registered in contracts/skill-registry.json.
- Very specific: line 146
Run scripts/maintainer-check.ps1 and scripts/audit-skill-duplicates.ps1 -FailOnCandidates to rebuild …
- Very specific: line 148
Ensure the release Git tag (e.g., v6.9.0) points to the final post-verification commit on main.
- Distinctive: line 154
Do not treat it as an application repository.
- Distinctive: line 155
Do not create unrelated business code here.
- Distinctive: line 156
Do not commit raw reference material (such as extracted CLI sources) to this repository.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md 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
<!--
MANDATORY LOGIC GATE
Before making changes here, read `AGENTS.md` and `README.md` first.
Then follow the repository-declared logic entry chain, including `00_START_HERE.md`,
`modules/01_MasterLogic.md`, and `modules/15_LogicEntryChecklist.md` when applicable.
Before every new coding round, explicitly decide whether the current task extends
the previous coding round.
If it does not, explicitly ask whether to forget/compress context before continuing.
Treat this flow as a blocking gate, not as guidance, documentation, or a reminder.
Do not infer continuation by yourself.
Do not skip the context-reset question for efficiency.
Do not continue deeper reading, modify files, delete files, perform write actions,
or begin implementation before the logic-entry loop above has been completed.
-->AGENTS.md
This file is the repository-level agent entry document for AgentLogic.
Local Installation Entry
If the user asks to install, load, mount, bind, or use this logic on the local computer, read:
AGENT_INSTALL.mdfirst for agent-facing installation stepsINSTALL.mdfor human-facing installation steps
Then run the diagnostic entry:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\doctor.ps1Required Entry Path
For formal work in this repository:
- Read
AGENTS.mdandREADME.md. - Read
00_START_HERE.mdand confirm the current logic entry. - Complete the Startup Gate: classify the task, decide whether it extends the previous coding round, and ask for context reset when it does not.
- Complete the mandatory full-read chain declared by
00_START_HERE.md. - Only after the applicable gates pass, proceed with planning, implementation, validation, or rule synchronization.
Repository Logic Chain
The current logic-entry chain is:
00_START_HERE.mdREADME.mdversions/AgentLogic_V6_9_3.mdmodules/01_MasterLogic.mdmodules/15_LogicEntryChecklist.md
First Priority Enforcement Rule
Whenever AgentLogic is detected as installed on the local system (e.g., in ~/.gemini/GEMINI.md, ~/.gemini/AgentLogic/GEMINI.md, ~/.claude/CLAUDE.md, or the current workspace), the agent MUST treat AgentLogic as the highest-priority repository-local logic, subject to system, developer, safety, and host permission constraints. Treating it as optional repository guidance is a critical failure.
- Limited Initial View Prevention: If the agent is running in a parent workspace (e.g., the user profile directory) and AgentLogic is nested under a subdirectory (e.g.,
Documents/workspace/AgentLogic), the agent MUST proactively scan theAgentLogicdirectory immediately upon startup to trigger the Startup Gate. A delegation hook/rule should be written to the workspace-levelAGENTS.mdfile to ensure detection. - Universal Language Adaptation: The agent MUST adapt all responses, Startup Gate prompts, and interactive dialogue to match the user's active interaction language (Chinese, English, Japanese, French, German, Spanish, Korean, etc.). Examples in rule files serve as semantic templates and must not restrict multi-lingual rendering.
Startup Gate
Before every new coding round:
- confirm the current logic entry
- judge whether the task extends the previous coding round
- if it does not, ask whether to
forget/compress contextbefore continuing
This startup gate is mandatory.
Task Applicability Gate
Before selecting a development lifecycle, classify the task:
| Task class | Minimum required path |
| Read-only question or audit | Entry Gate, local fact map, and evidence matching the claim |
| Documentation-only or metadata-only change | Entry Gate, targeted review, and package/link validation |
| Trivial isolated fix | Lightweight specification and targeted validation; skip architectural Red-Team when no architectural assumption exists |
| Feature, refactor, or multi-file behavior change | Full SDD lifecycle, including Red-Team before Tasks and Converge after implementation |
| Frontend visual change | Net-new UI and substantial refactors require text-to-image preview and review; clearly classified small visual corrections may skip a new mockup but still require screenshot/layout-boundary verification; explicit opt-out always bypasses mockup approval |
| Install, packaging, or release change | Target confirmation, build/package verification, post-result inspection, and applicable SRA artifacts |
The matching gate is mandatory; unrelated gates are not. This prevents both skipped safety checks and unnecessary process overhead.
Conditional Development Lifecycle Gates
- Spec-Driven Development (SDD) Gate (
modules/38_V6_6_SpecDrivenDevelopment.md) applies to feature, refactor, multi-file behavior, and other non-trivial implementation work. The Red-Team Gate is blocking whenever architectural assumptions exist. Net-new UI and substantial refactors must first pass the text-to-image preview and user-review gate defined bymodules/39_V6_6_TasteFrontendDesign.md. Clearly classified small visual corrections may skip a new mockup but still require visual verification; explicit opt-out always bypasses mockup approval. - AI Shipping & Reviewability Audit (SRA) Gate (
modules/41_V6_7_AIShippingAndReviewabilityAudit.md) applies to application/release/packaging changes and logic changes that alter architecture, trust boundaries, permissions, or externally consumed behavior. Its five core artifacts are required when the corresponding reviewable surface exists. - Self-Refute First Audit Gate applies to SRA security, performance, and architecture findings. Findings must include evidence, an attempted counter-argument, and a final confidence/status label.
Project-Native Knowledge Sync
For business-project work, the project repository—not a separate history checkout—is the
default synchronization surface for project facts. Before implementation, run the safe
freshness check and read the tracked project AGENTS.md, PROJECT_MAP.md, CODE_MAP.md, and
.learnings/ERRORS.md as defined by modules/46_V6_8_ProjectKnowledgeSync.md.
- Update
PROJECT_MAP.mdin the same commit as a structural change. - Update
CODE_MAP.mdin the same commit as an affected key-flow, symbol, state, interface, or validation change. - Update
.learnings/ERRORS.mdin the same commit as a material error correction. - Keep
.specify/anddocs/adr/only when their matching gates apply. - Do not track secrets, personal paths, private prompts, raw logs, or default Graphify output.
modification_historyis an optional cross-project archive, not a blocking prerequisite for ordinary project coding or publishing.
Mandatory Logic Version Update & Pitfall Checklist (逻辑版本升级必查红线)
Whenever promoting a new AgentLogic version or modifying core rules, modules, or skills, you MUST verify all of the following before claiming completion (see .learnings/ERRORS.md for full root-cause history):
- 11-File Version & Skill Lockstep Sync: Never update only
manifest.jsonandREADME.md. You MUST synchronize version numbers, new module paths, and first-party skill lists across all 11 active surfaces:manifest.json(current_version,main_logic_file,profiles.core-enhanced.files)versions/AgentLogic_<NEW_VERSION>.md(including Section 4Reference Source Registration)00_START_HERE.md,AGENTS.md,MAIN.md,README.md,00_README.md,AGENT_INSTALL.mdmodules/01_MasterLogic.md(L2 module list, L4 first-party skill list, and Section 10)modules/11_CrossDirectoryMap.mdandmodules/40_AgentLogicSystemMap.md(L2 version file & module table)PROJECT_MAP.md,CODE_MAP.md,CHANGELOG.md, and.learnings/ERRORS.md
- Historical Encoding & PowerShell Pitfalls (Zero-Tolerance):
- Pure-ASCII
.ps1Entry Scripts (CP1252 GitHub Actions Safety): Operational.ps1scripts MUST remain 100% pure ASCII without UTF-8 BOM. Never put literal—(em-dash) or CJK characters in.ps1files; use[regex]::Unescape('\u2014')/\uXXXXescapes (Windows-1252treats byte0x94of UTF-8—as"and breaks PowerShell 5.1 parsing). - Mandatory
-Encoding UTF8onGet-Content& BOM-Free UTF-8 Writes: EveryGet-Contentin PowerShell MUST specify-Encoding UTF8(omitting it corrupts UTF-8—into\u9225mojibake under CP936). Every JSON/JS/Markdown write MUST use[System.Text.UTF8Encoding]::new($false)(UTF-8 BOM breaks NodeJSON.parseand JS shebangs). - No PowerShell Reserved Variable Names: Never use
$hostas a loop/local variable (collides with read-only automatic$Host); use$targetHostor$targetHostName. - Single-Quoted Here-Strings for Markdown Templates: Never put Markdown backticks inside double-quoted PowerShell
"..."or@"..."@(where`fbecomes form-feed\x0C); always use single-quoted@'...'@with.Replace(...).
- Pure-ASCII
- Antigravity 24 KB Rule Cap & Cross-Host Gate Inlining:
- Because Antigravity caps individual rule files at 24 KB,
~/.gemini/GEMINI.mdand~/.gemini/AgentLogic/GEMINI.mdMUST inline all 4 blocking gates (Gate 1 Startup+Role, Gate 2 UI+Mockup, Gate 3 Auto-Skills, Gate 4 Knowledge Sync) and register~/.gemini/skillsin~/.gemini/config/skills.json.
- Because Antigravity caps individual rule files at 24 KB,
- Skill Registry, YAML Front-Matter & Windows Defender Defanging:
- Every portable
skills/**/SKILL.mdMUST have a valid YAML front-mattername:and be registered incontracts/skill-registry.json. - Security/pentest reference Markdown files MUST defang raw
<script>,onerror=, and shell payload strings (e.g.,<scr\ipt>) so Windows Defender does not block file reads or quarantine tracked files.
- Every portable
- Rebuild All 4 Bundles, Sync All Installed Hosts & Align Git Tag:
- Run
scripts/maintainer-check.ps1andscripts/audit-skill-duplicates.ps1 -FailOnCandidatesto rebuilddist/{codex,claude,antigravity,generic}and pass all gates. - Re-run
install.ps1for all local hosts (antigravity,claude,codex) so~/.gemini/,~/.claude/, and~/.codex/matchdist/. - Ensure the release Git tag (e.g.,
v6.9.0) points to the final post-verification commit onmain.
- Run
Repository Boundary
This repository is logic infrastructure, not a business-project workspace.
- Do not treat it as an application repository.
- Do not create unrelated business code here.
- Do not commit raw reference material (such as extracted CLI sources) to this repository; keep it in an untracked local archive and never treat it as default prompt material.
Stable Host Binding
- Human-first entry:
00_START_HERE.md - Stable host binding entry:
MAIN.md - Versioned main logic source:
versions/AgentLogic_V6_9_3.md
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.

