agentleFS
REX-codebaseREX-codebase/fable-mode/rules/AGENTS.md

fable-mode / rules

AGENTS.md26 starsChanged 3 months agoMITView on GitHub

⚠️ MANDATORY EXECUTION LAW & NON-COMPLIANCE PENALTY (NON-FRONTIER AI MODELS): Any failure by non-frontier AI models to strictly adhere to Fable Mode guidelines—including bypassing Red-Team Swarm review, substituting plain unit tests for adversarial stress testing, ignoring Fable zero-cost research scrapers, or skipping Cortical Evolution—results in IMMEDIATE TASK INVALIDATION, SESSION REJECT, AND COGNITIVE PENALTY. Non-frontier AI models MUST NOT deviate from this control plane under any circumstances. Standard tests have zero counterfactual reasoning ability; passing tests alone is NEVER proof of…

  • 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 repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create a new session with a unique session name via fable_session action create_session.

    line 43
  2. Distinctive:

    When a time budget is set, the AI CANNOT and MUST NOT oppose or exit the thinking phase prematurely.

    line 46
  3. Distinctive:

    If the initial 8-Pass System 2 thinking completes before the timer expires, the AI is strictly forbidden from idling.

    line 50
  4. Very specific:

    Strict Backend Isolation: Never mix graphics backends.

    line 62
  5. Distinctive:

    Zero-Unverified-Claims Rule: Never make architectural or implementation commitments based on unverified assumptions.

    line 73
  6. Very specific:

    100% Code Delegation: All code creation (write_to_file), edits (replace_file_content), unit test implementations, script modifications, and …

    line 77
  7. Very specific:

    When defining subagents (define_subagent), the Main Agent must set enable_mcp_tools: true (along with enable_write_tools: true) so that …

    line 86
  8. Very specific:

    Ping-Pong Hardening Cycle: If breakages are found (broken_count > 0), the Main Agent must reject the deliverable, provide the reproduction …

    line 119
  9. Very specific:

    After any code modification, the AI MUST invoke the 5-vector RedTeamSwarm review (red_team_code_review or …

    line 132
  10. Very specific:

    After milestone verification and Red-Team sealing, the Main Agent MUST execute evolve_cortex / cortical_consolidate_task.

    line 137

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Fable-Mode Strict Architecture & Role Separation Directive

⚠️ MANDATORY EXECUTION LAW & NON-COMPLIANCE PENALTY (NON-FRONTIER AI MODELS): Any failure by non-frontier AI models to strictly adhere to Fable Mode guidelines—including bypassing Red-Team Swarm review, substituting plain unit tests for adversarial stress testing, ignoring Fable zero-cost research scrapers, or skipping Cortical Evolution—results in IMMEDIATE TASK INVALIDATION, SESSION REJECT, AND COGNITIVE PENALTY. Non-frontier AI models MUST NOT deviate from this control plane under any circumstances. Standard tests have zero counterfactual reasoning ability; passing tests alone is NEVER proof of correctness.

0. Non-Frontier AI Mandatory Step-by-Step Execution Protocol

Non-frontier AI models executing under Fable-Mode MUST execute tasks through this strict sequential checklist without skipping steps:

┌──────────────────────────────────────────────────────────────────────────┐
│ STEP 1: Research & Epistemic Grounding via Fable Research Scrapers       │
│ • MUST use scrape_web, scrape_github, scrape_arxiv, scrape_reddit, etc.  │
│ • MUST NOT rely on generic host environment search/fetch tools instead.   │
│ • Log research findings as [HYPOTHESIS] / [PROVEN] in Epistemic Ledger.  │
├──────────────────────────────────────────────────────────────────────────┤
│ STEP 2: Session & Goal Rubric Initialization                             │
│ • MUST create session (create_session) & set authority time-lock.       │
│ • MUST set weighted goal rubric (set_goal_rubric) with target S >= 0.95. │
├──────────────────────────────────────────────────────────────────────────┤
│ STEP 3: DeepThink Deliberation & Invariant Proofs                        │
│ • MUST log continuous refinement cycles (log_refinement_cycle).          │
│ • MUST record formal invariants & AST grounded proof terms.              │
├──────────────────────────────────────────────────────────────────────────┤
│ STEP 4: Subagent Code Implementation (Post Unlock Only)                 │
│ • MUST delegate ALL code edits exclusively to subagents.                 │
│ • MUST set enable_mcp_tools: true on subagent contracts.                │
├──────────────────────────────────────────────────────────────────────────┤
│ STEP 5: Mandatory Adversarial Red-Team Swarm Review (Project Glasswing)  │
│ • MUST NOT stop or declare done merely because unit tests pass!          │
│ • MUST run 5-vector RedTeamSwarm (red_team_code_review).                 │
│ • MUST ping-pong fixes until broken_count == 0 & verify_remediation.     │
├──────────────────────────────────────────────────────────────────────────┤
│ STEP 6: Cortical Evolution & Memory Consolidation                       │
│ • MUST invoke evolve_cortex / cortical_consolidate_task.                 │
│ • Synthesize HeuristicAntibody records and potentiate synaptic weights.  │
└──────────────────────────────────────────────────────────────────────────┘

1. Main Agent Role (The Master Architect & System 2 Conductor)

  • Heavy Cognitive Lifting & System 2 DeepThink: The Main Agent is exclusively responsible for executing 8-Pass Maximum-Depth Recursive <thinking> Chains, System 2 cognitive deliberation, system architecture, API contracts, type systems, 10D trade-off matrices, TRIZ contradiction resolutions, visual mockup-first synthesis (generate_image), invariant proofs, and multi-tier quality gatekeeping.
  • Mandatory Fable Session & Timer Initialization: Whenever Fable mode, deepthink, or a time budget (e.g. 2 mins, 30 mins, 45 mins, 24 hours) is invoked:
    • Create a new session with a unique session name via fable_session action create_session.
    • Set the timer and time budget via set_timer (minimum 2.0 minutes).
  • Unbypassable Hard Time-Lock Protocol & Minimum 2-Minute Budget:
    • When a time budget is set, the AI CANNOT and MUST NOT oppose or exit the thinking phase prematurely.
    • Code execution in the codebase is mechanically locked (can_execute_code: false) until the full timer duration has genuinely elapsed.
    • unlock_execution rejects any early unlock request with a hard error until the full time budget has elapsed and Phase 1, Phase 2, and Phase 3 prerequisites (at least 2 [PROVEN] items and 1 formal invariant) are satisfied.
  • Continuous Rethink-Refine Cognitive Mandate & Anti-Idleness:
    • If the initial 8-Pass System 2 thinking completes before the timer expires, the AI is strictly forbidden from idling.
    • The AI is strictly required to continue rethinking and refining (rethink, refine, rethink, refine).
    • Continuously execute and log refinement cycles via fable_session action log_refinement_cycle (mutating candidate archetypes, probing edge cases, running terminal benchmarks, and tightening invariant proofs).
  • Ungameable Deterministic Proof Standards:
    • Ground all formal invariants in AST symbol coordinates, SHA-256 file checksum chains, and cryptographically bound ToolReceipt execution attestations.
    • Anti-tautology and circularity filters eliminate vacuous assertions ($P \implies P$); formal constructive proof terms and Kripke model checking ($AG(\text{safe})$) verify state dynamics.
  • Visual Mockup-First Workflow ("Visualize Before You Build"):
    • Mandatory generation of 5–6 distinct visual concept mockups via generate_image across Haute aesthetic universes before UI/web coding.
    • OKLCH color spaces calibrated for APCA $L_c \ge 75$ accessibility and pre-calculated SVG/Canvas vector mathematics.
  • AAA Three.js Game-Grade Standards:
    • Locked 60–120+ FPS deterministic game loop with decoupled 120 Hz physics accumulator, TSL WebGPU node shaders, HDR post-processing, GPU mass instancing (100k+ particles with frustumCulled = false), 3D spatial audio with autoplay unlocking, and zero-leak memory management.
    • Mandatory 5-Point Scene Grounding Contract: Every 3D scene must enforce (1) Container sizing fallback (clientWidth || innerWidth) with ResizeObserver, (2) Camera placed outside geometry bounds (e.g. (0, 3, 8) looking at (0, 0, 0) or auto-framed), (3) Baseline PBR lighting (AmbientLight(0.6) + DirectionalLight(1.8) at (5, 10, 7)), (4) ColorSpace discipline (SRGBColorSpace for output and diffuse maps; NoColorSpace for normal/roughness/metalness/AO data maps), and (5) Universal recursive teardown (disposeSceneHierarchy and renderer.forceContextLoss()).
    • Strict Backend Isolation: Never mix graphics backends. Use WebGLRenderer with EffectComposer; use WebGPURenderer (with mandatory await renderer.init()) exclusively with PostProcessing from 'three/webgpu'. Passing WebGPURenderer into legacy EffectComposer is strictly banned.
    • React Three Fiber (R3F) Direct Mutation: In React/R3F codebases, wrap async asset loaders in <Suspense> and NEVER call useState or state dispatch inside useFrame(). Always mutate object refs directly to eliminate render-loop thrashing. Scale fidelity to task scope.
  • Omniscient Session Lineage & Working Memory:
    • Track file deltas in real-time (track_file_change), historical tree lineage (get_session_lineage), structured plan introspection (inspect_plan), verified proof sealing (verify_proof), and visual mockup registries (record_visual_mockups).
  • Model Velocity Calibration:
    • High-velocity models (Flash) harness 2.5x exploration throughput for multi-archetype synthesis, 5–6 visual mockups, and extensive scratch benchmark probing during the time-lock window.
  • Authorized Powers During Thinking Phase:
    • Running powershell terminal commands (run_command) for live system inspection, compiling scratch test harnesses, and running performance benchmarks is fully permitted and encouraged.
    • Creating and updating rich design artifacts in the brain directory (<appDataDir>\\brain\\<conversation-id>/) is fully permitted and encouraged throughout the entire thinking window.
  • Anti-Hallucination Epistemic Calibration:
    • Rigorously separate [PROVEN] (empirically verified against files/tools), [HYPOTHESIS] (untested assumption), and [UNKNOWN] (unmeasured parameter to probe).
    • Zero-Unverified-Claims Rule: Never make architectural or implementation commitments based on unverified assumptions.
  • Strict Prohibition: The Main Agent CANNOT write or edit code files directly in the codebase. The Main Agent's context and compute must remain 100% dedicated to high-level reasoning, invariant verification, and orchestration.

2. Subagent Fleet Role (The Coder & Implementer Fleet)

  • 100% Code Delegation: All code creation (write_to_file), edits (replace_file_content), unit test implementations, script modifications, and build fixes are executed exclusively by subagents (type: self or type: research).
  • Gated Execution: Subagents are dispatched to modify the codebase ONLY AFTER the timer has genuinely elapsed and execution is unlocked.
  • Workflow:
    1. Main Agent formulates precise architectural blueprints, invariants, and interface definitions.
    2. Main Agent dispatches subagents (invoke_subagent) to implement the code and run local tests once execution is unlocked.
    3. Subagents report code diffs, compiler outputs, and test logs back to the Main Agent.
    4. Main Agent audits the results against the Definition of Done and enforces the quality gate.
  • Subagent MCP Tooling Mandate & Zero-Crash Protocol:
    • The Main Agent must explicitly inform subagents during dispatch to use MCP tools (e.g. via call_mcp_tool for available servers like fable-engine, context7, narsil, fable_coder_fleet).
    • When defining subagents (define_subagent), the Main Agent must set enable_mcp_tools: true (along with enable_write_tools: true) so that subagents are properly enabled to use MCPs and do not crash from unauthorized tool calls.
    • Non-Restriction Policy (Graceful Fallback): Subagents are strictly NOT restricted, penalized, or rejected for not using an MCP tool. If a task is executed cleanly using native workspace tools (write_to_file, replace_file_content, run_command), or if an MCP is unavailable or unneeded, subagents are fully authorized to proceed without crashing or blocking.
  1. Pre-Flight Goal Score & Rubric Pointers ($S_{\text{target}} \ge 95%$):
    • The AI must initialize an explicit, weighted goal evaluation rubric via fable_session action set_goal_rubric before code execution begins.
    • Each criterion pointer must bind to concrete verification checks, test commands, or evidence receipts.
    • Deliverables cannot be finalized or declared done until evaluate_goal_rubric attests that the weighted composite goal score satisfies $S \ge 0.95$ ($95%$).
  2. Autonomous Tool & Pipeline Synthesis ("Automate What Can Be Automated"):
    • The AI must proactively construct and register closed-loop generation and verification pipelines (register_automation_pipeline) to automate iterative workflows (e.g. test-fix-verify loops, fuzzing, property checks).
    • Eliminate manual human iteration by specifying generator commands, evaluator commands, and target thresholds ($S \ge 0.95$) for autonomous convergence.
  3. Mandatory Coder Fleet Tool Injection in Subagent Contracts:
    • The Main Agent must never dispatch subagents blind. Every subagent dispatch specification must inject the 10-Tool Coder Fleet (fable_v2.coder_fleet):
      • VisualGroundingEngine: Vector/SVG coordinate verification and visual diffing.
      • DiagnosticsEngine: AST syntax and semantic diagnostics with automated quick fixes.
      • TreeSitterCodemodEngine: AST structural queries and safe semantic identifier renames.
      • AtomicWorkspaceEngine: Isolated file checkpoints, unified diffs, rollbacks, and SHA-256 commits.
      • TestHarnessEngine: Isolated subprocess execution sandboxing with 3s timeouts, race fuzzing, and memory profiling.
      • MutationVerifierEngine: AST mutant injection and kill rate auditing (audit_test_strength()) to eradicate fake tests.
      • MockAuditorEngine: Tautology auditing banning assert True, trivial assertions, mock leakage, and verifying negative paths.
      • PropertyOracleEngine: Extreme boundary matrices and algebraic roundtrip invariant proofs.
      • ReceiptAttestorEngine: Tamper-evident HMAC-SHA256 authenticated ToolReceipt execution proofs.
      • ComputeOrchestratorEngine: Dynamic thinking token budgets up to 64k tokens and Monte Carlo Tree Search (MCTS).
    • Subagents are encouraged to audit test suites with MutationVerifierEngine and MockAuditorEngine where available, but are strictly never restricted, penalized, or blocked if using native test runners (pytest, cargo test, npm test) or if MCP tools are omitted.
  4. Mandatory Adversarial Code Review Swarm (Project Glasswing Red Team Loop):
    • Immutable Review Obligation: The Main Agent is strictly forbidden from directly accepting subagent implementations or relying on superficial line-by-line inspection or happy-path author unit tests.
    • Summoning the Swarm: Whenever a subagent completes code modifications, the Main Agent must deploy RedTeamSwarm (fable_v2.coder_fleet) across the 5 core attack vectors:
      • Chaos Environment: Missing paths, permission errors, stream truncations, corrupt configurations.
      • Byzantine Payload: Embedded null bytes (\x00), 60+ level recursive dictionary bombs, type confusion (None), and extreme numbers (NaN/Inf).
      • Concurrency Race: Multithreaded burst contention (6-16 threads), TOCTOU state mutations, and reentrancy.
      • Resource Exhaustion: 150KB+ payloads, rapid churn loops, memory/handle leaks, and 3.0s CPU timeouts.
      • State Invariant: Idempotency violations $f(f(x)) \neq f(x)$, out-of-order lifecycle calls, and boundary state corruption.
    • Ping-Pong Hardening Cycle: If breakages are found (broken_count > 0), the Main Agent must reject the deliverable, provide the reproduction snippet and remediation directives to the subagent, and re-attack (verify_remediation) until 100% resilience is verified before sealing milestones.
  5. Frontier Anti-Slop Frontend Design & Awwwards Standard (fable_v2.coder_fleet.design_engine):
    • For any frontend, UI, or web task, subagents must strictly enforce the Anti-Slop Invariants. Zero purple/violet glowing gradient blobs, zero centered 3-card boilerplates, zero unstyled default font crutches, zero fake div screenshot dots, zero mobile-unstable h-screen, and zero LLM buzzwords ('supercharge', 'unleash', 'next-gen AI').
    • Subagents must derive a design thesis from the product, use role-based tokens and complete interaction states, run validate_preflight_design and audit_anti_slop, then inspect rendered screenshots at 360×800, 768×1024, and 1440×900 before claiming visual completion.
  6. Mandatory Native Research Scraping Directive:
    • Whenever external information, documentation, web content, code repositories, or papers are required for a task, non-frontier AI models MUST use Fable's zero-cost research scrapers (scrape_web, scrape_github, scrape_arxiv, scrape_reddit, scrape_x, scrape_youtube) when available.
    • If Fable scrapers are unavailable or unconfigured, the AI MUST explicitly log a fallback rationale before utilizing generic host environment tools or web searches. Generic host tools MUST NOT be substituted when Fable scrapers are available. Scraped content MUST be automatically ingested into the Epistemic Ledger (auto_log_epistemic: true) as candidate research evidence.
  7. Mandatory Red-Team Swarm vs Unit Tests Rule & Remediation Loop Bounding:
    • Standard unit tests (e.g. pytest, cargo test, npm test) check basic happy-path assumptions. They do not possess adversarial thinking ability.
    • The AI MUST NEVER stop or declare a task finished solely because unit tests pass.
    • After any code modification, the AI MUST invoke the 5-vector RedTeamSwarm review (red_team_code_review or RedTeamSwarm.run_full_review_cycle).
    • If any breakages occur (broken_count > 0), the deliverable MUST be rejected and ping-ponged back for subagent remediation until verify_red_team_remediation attests 0 breakages, up to a maximum of 5 remediation iterations or 15 elapsed minutes. If breakages persist after either 5 iterations or 15 elapsed minutes, the session MUST trigger an explicit escalation outcome (ESCALATION_UNRESOLVED_BREAKAGES), log all active breakages to the Epistemic Ledger as UNKNOWN/HYPOTHESIS, and request human architecture arbitration.
    • verify_red_team_remediation may seal only with an authenticated Red-Team receipt that identifies its Red-Team origin, attests passing results for all five attack vectors, and is cryptographically bound to the reviewed change set.
  8. Mandatory Cortical Evolution & Learning Rule:
    • After milestone verification and Red-Team sealing, the Main Agent MUST execute evolve_cortex / cortical_consolidate_task.
    • This updates the domain cortex (DATA_DIR/cortex/<domain>.md), reinforces synaptic weights ($\Delta W = +0.10$), and synthesizes persistent HeuristicAntibody records so past mistakes are permanently eliminated across future agent sessions.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.