Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Strategy & Tactics Method (S&T)

A zero-dependency AI coding workflow template. Prevents LLM context collapse, token bloat, and architectural drift by strictly separating long-term design from ephemeral execution.

AI coding assistants (Claude Code, Roo Code, Cursor) are incredible for prototyping, but they break down on "Day 2" of complex projects. As the codebase grows, LLMs suffer from context exhaustion, hallucinate incorrect APIs, and break the core architecture.

The Strategy & Tactics (S&T) Method solves this without requiring heavy CLIs or proprietary Python orchestration frameworks. It relies entirely on native Markdown files, your filesystem, and strict prompt architecture.

🚀 See It In Action (Proof of Concept)

This isn't a theoretical framework. S&T was battle-tested to build a highly complex C++/GPU engineering course. 👉 View the Applied OpenCL Lab to see the raw, unfiltered workflow/ execution history of an AI successfully building heterogenous GPU systems using this exact workflow.

Prerequisites: Claude Code CLI installed and authenticated.


🧠 The Core Philosophy: Dual-Layer Context

To prevent the LLM from getting confused by its own past outputs, we separate the workflow into two distinct layers:

  1. The Strategy Layer (workflow/design/): The immutable Source of Truth. These long-lived documents contain the architecture, vision, and high-level milestones. The AI is never allowed to change architecture implicitly during coding.
  2. The Tactics Layer (workflow/tasks/): Disposable, highly specific execution tickets. These contain strict Definitions of Done (DoD).
  3. The Token Saver (workflow/tasks/archive/): Once a task is completed, the markdown file is aggressively moved to the archive. This physically removes it from the LLM's active workspace, keeping the context window pristine and token costs low.

📁 Repository Structure

Click "Use this template" to instantly scaffold this structure into your new project:

├── workflow/
│   ├── design/             # Long-lived strategy docs (The Source of Truth)
│   ├── tasks/              # Active, ephemeral execution tickets
│   │   └── archive/        # Completed tasks (archived to save tokens)
│   └── templates/          # Design doc and task doc templates
├── .claude/
│   ├── agents/             # Specialist agent personas (architect, coder, reviewer…)
│   ├── commands/           # Slash commands (/implement, /review, /sync, /validate…)
│   ├── rules/              # Persistent AI rules — 00-master-specs, 01-protocol, 02-communication, 03-safety, 04-skills-reference, MEMORY
│   └── skills/             # Reusable skill definitions
└── CLAUDE.md               # Project-level AI instructions

🔄 The Operating Loop

When building a feature, you (or your orchestrator agent) follow a strict loop:

  1. Analyze (Strategy): Read workflow/design/D[ID]_feature.md. Identify the next milestone.
  2. Plan (Tactics): Create workflow/tasks/T[ID]_task.md with minimal context and a strict Definition of Done (e.g., "Build passes, tests pass").
  3. Execute (Coder): Implement code strictly based on the task file. Do not modify design files.
  4. Sync & Clean: Mark status complete in the design doc. Move the task file to workflow/tasks/archive/.

🛠️ Handling the "20% Friction" (Spec Drift)

Top-down design is rarely 100% accurate. S&T includes pragmatic escape hatches for the messy reality of software development:

  • The "Design Wins" Rule: If code contradicts the design, the code is wrong. Create a task to fix the code.
  • The "Fast Lane": For minor bug fixes (under 15 mins) that don't touch public APIs, skip the task file. Edit code directly to prevent process fatigue.
  • Automated Reverse Engineering: When you discover a better implementation path and the code deviates from the plan, don't manually rewrite the design. Use this prompt:

    "Read the git diff for the recent changes. Update workflow/design/D[ID]_feature.md to reflect the reality of the working code. Do not change the code."

⚙️ Usage & Integration

Because S&T is just Markdown files and .claude/ conventions, it works natively with Claude Code:

  • Claude Code CLI/IDE: Loads agent personas from .claude/agents/, slash commands from .claude/commands/, and persistent rules from .claude/rules/ automatically.
  • CLAUDE.md: Project-level instructions loaded into every session — override defaults here.
  • Skills & Agents: Full index of slash commands, agent roles, and pipelines — see .claude/rules/04-skills-reference.md.
  • Roo Code / Cursor: The rule files in .claude/rules/ are plain Markdown and may be adapted to other tools (e.g. .clinerules, .cursor/rules/). Agents, commands, and skills in .claude/agents/, .claude/commands/, and .claude/skills/ are Claude Code-specific and will require additional effort to port.

More Information

  • License: LICENSE (MIT)
  • Author: ED / Claude Code

⚡ Quick Start

Requires: Claude Code with sub-agent support (.claude/agents/ directory). Update to the latest version if slash commands or agents aren't recognized.

One-time setup — fill in the template before your first session:

File What to fill in
.claude/rules/00-master-specs.md Language, framework, build system, naming conventions, platform
workflow/design/00-executive-summary.md Project name, vision, architecture pattern, key decisions, module list — fill this before running /create-design
CLAUDE.md Project philosophy principle(s)
.claude/rules/MEMORY.md Leave Discipline rules intact; clear Session Notes when starting a real project

Then delete workflow/design/D00_dummy.md and workflow/tasks/archive/T000_dummy.md (placeholder files that exist only to keep the directory structure in git).

Per-feature loop:

Type these slash commands inside a Claude Code chat session (not the terminal).

/create-design  →  /plan-task  →  /run_workflow $TASK_ID
  • /create-design <module-name>: reads your exec summary and intent → writes workflow/design/D[ID]_<module-name>.md
  • /plan-task <D[ID]_feature>.md: reads approved design doc → writes next atomic task to workflow/tasks/T[ID]_task.md
  • /run_workflow <T[ID]_task>: orchestrates implement → review/fix loop → validate → sync (see full spec)

🔧 Adapting to Your Stack

The agents and skills in .claude/agents/ and .claude/skills/ are plain Markdown — built for a generic project. Review them before your first session and specialize to your stack.

Start with (mandatory): 00-master-specs.md (stack + conventions), coder.md (language idioms), development skill (engineering guidelines).

Optional: auditor.md, tester.md, evaluator.md — remove any roles your workflow doesn't use.

Examples of specialization:

  • Rename development skill → python-development and fill in Python-specific guidelines
  • Narrow coder.md to your language's idioms and forbidden patterns
  • Remove agents your workflow doesn't use (e.g., auditor.md if no doc-auditing step)

This is a one-time calibration that pays off across every task.

🗺️ Future Development

Parallel Workflow Execution

Running multiple task pipelines concurrently.

Draft plan:

  • Agent claiming a task updates its Status field (e.g., PENDINGIN PROGRESS) so concurrent agents don't double-pick the same work.
  • /sync (design doc update + archive) requires explicit user approval before writing — prevents silent architectural drift when multiple pipelines land changes close together.

About

A zero-dependency AI coding workflow template. Prevents LLM context collapse and architectural drift by separating long-term design from ephemeral tasks.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors