A token-optimized, multi-model template repository for AI-assisted software development.
Stop burning API credits, losing track of codebases mid-session, or spending hours writing manual test data.
- π§ Dual-Memory Architecture (Minified JSON Caching):
- Short-Term Session Cache (
memory-shortterm.md): Tracks immediate tasks and uncommitted changes during the workday. Flushed daily to prevent input token bloat. - Long-Term Epoch Cache (
memory-longterm.md): Immutable, compressed history of macro-architecture and completed milestones.
- Short-Term Session Cache (
- β±οΈ Dynamic Autonomy Throttling:
- Toggle seamlessly between Pair-Programming Mode (strict pauses after 50 lines / major components) and Overnight Autonomous Mode (uninterrupted multi-file execution).
- π Multi-Model Identity & Red-Team Auditing:
- Track which specific LLM model executed which session in the memory logs.
- Optional Red-Team Audit workflow using a secondary model (e.g., OpenAI o1 reviewing Claude 3.5 Sonnet) before commits.
- π§ͺ Mandatory "Triad" Verification:
- Forces the AI to generate automated unit/integration tests with Happy Path, Edge Case, and Failure Path dummy data alongside source code. Banning raw
console.log()verification.
- Forces the AI to generate automated unit/integration tests with Happy Path, Edge Case, and Failure Path dummy data alongside source code. Banning raw
- π Living ReadTheDocs Sync (
/docs):- Keeps human-readable documentation (
/docs/architecture.md,/docs/api.md,/docs/setup.md) continuously updated without cluttering the AI's core operating context.
- Keeps human-readable documentation (
- π Native IDE Bindings:
- Native configuration support for Cursor (
.cursor/rules/), GitHub Copilot (.github/copilot-instructions.md), and VSCode (.vscode/tasks.json).
- Native configuration support for Cursor (
my-ai-project/
βββ .agent/
β βββ templates/ # Raw, unpopulated templates (Immutable)
β β βββ agent.template.md # Master operating system & execution rules
β β βββ tech-stack.template.md # Technical constraints & banned patterns
β β βββ testing-protocol.template.md# Framework rules & Triad dummy data policy
β β βββ reviewer.template.md # Red-Team security & quality audit checklist
β β βββ docs-protocol.template.md # ReadTheDocs living documentation rules
β β βββ memory-longterm.template.md # Global Epoch Cache (Minified JSON history)
β β βββ memory-shortterm.template.md# Ephemeral Session Cache (Minified JSON state)
β β
β βββ active/ # Active runtime context files (Populated via setup.md)
β β βββ agent.md # Active master prompt read at session start
β β βββ tech-stack.md # Active project stack directives
β β βββ testing-protocol.md # Active testing rules & framework choice
β β βββ reviewer.md # Active audit template
β β βββ docs-protocol.md # Active living docs configuration
β β βββ memory-longterm.md # Permanent project milestones
β β βββ memory-shortterm.md # Ephemeral workday working memory
β β
β βββ setup.md # The 9-question interactive interview script
β
βββ .github/ # (Optional) Copilot instructions
β βββ copilot-instructions.md
βββ .vscode/ # (Optional) VSCode / Cursor settings & tasks
β βββ settings.json
β βββ tasks.json
βββ docs/ # Living human-readable documentation
β βββ architecture.md
β βββ api.md
β βββ setup.md
βββ init.sh # Non-destructive initial bootstrapper
βββ README.md # Project documentation (You are here)
Clone or use this repository as a GitHub Template. Run the initialization script in your terminal to safely prepare the .agent/active/ directory:
chmod +x init.sh
./init.shOpen your AI coding assistant (Cursor, Claude Dev, ChatGPT, Aider, GitHub Copilot, etc.) and paste the following prompt:
"Please read
.agent/setup.mdand conduct the 9-question setup interview with me."
Answer the questions regarding:
- Project Vision & Scope
- Tech Stack & Framework choices
- Banned Patterns (Anti-patterns to avoid)
- Testing Framework & placement
- Directory Boundaries
- Model Toolchain & Red-Team Audit preferences
- Autonomy Throttle (50-line pairing vs. Overnight mode)
- IDE Integrations (Cursor / Copilot / VSCode)
- Living Documentation (ReadTheDocs in
/docs)
The AI will automatically generate your customized context files inside .agent/active/.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. SESSION START β
β AI reads memory-longterm.md + memory-shortterm.md + β
β agent.md β Confirms current objective with human. β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 2. EXECUTION PHASE β
β AI generates code complying with tech-stack.md. β
β Simultaneously generates tests (Triad Dummy Data). β
β Respects autonomy throttle (Pairing vs Overnight). β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3. AUDIT PHASE (OPTIONAL) β
β Secondary model loads reviewer.md β Audits logic & β
β security vulnerabilities β Outputs <AUDIT_REPORT>. β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 4. SESSION SHUTDOWN β
β AI flushes short-term state to memory-shortterm.md. β
β Compresses milestones into memory-longterm.md. β
β Updates human-readable docs in /docs/ (if enabled). β
ββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββ
Large language models suffer from context loss and rising credit costs as conversations grow.
- To solve this, every new coding session starts fresh with the Amnesia Rule.
- The AI reloads its context strictly from
.agent/active/memory-longterm.md(high-level JSON architecture state) and.agent/active/memory-shortterm.md(active JSON task state). - No long conversational histories are re-read, reducing input token overhead by up to 80%.
Manual line-by-line debugging and terminal console.log() statements waste time. The AI is required to prove its code works by outputting tests containing three distinct dummy data profiles:
- Happy Path: Expected input formats.
- Edge Cases: Empty sets, nulls, boundaries, extremely long strings.
- Failure Path: Invalid types and unauthorized access designed to hit error handlers.
When switching between models mid-project (e.g., using Claude 3.5 Sonnet for architecture, Llama-3 locally via Ollama to save credits, or GPT-4o for code review), the AI logs its exact model version in .agent/active/memory-shortterm.md. If bugs or structural drifts occur, you can audit which model introduced them.
This framework template is open-source under the MIT License. Feel free to adapt and customize the directives in .agent/templates/ for your specific team workflow.