A lightweight, cross-platform engineering operating system for AI coding assistants (Claude Code, Codex, Qoder). Enforces progressive disclosure, decision-routing, and quality gates to transform AI coding from chat-based assistance to engineering-grade delivery.
Most AI coding assistants suffer from sycophancy bias (60-80% agreement rate even on flawed proposals) and context bloat (16KB+ always-on instructions). This system solves both:
- Progressive Disclosure: Core stays under 3.5KB; load detailed strategies only when relevant
- Decision Routing: 10 specialized routes with evidence gates, not one-size-fits-all prompts
- Constructive Dissent: Independently evaluate proposals before alignment, reducingιε by 40-55%
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AGENTS.md (~3.5KB) β
β Always-on Core Principles & Routing β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β Route Task
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β workflow-index.yaml (Route Engine) β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββ β
β β tiny_taskβ βdesign_ β βcomplex_ β βimplementa- β β
β β β βconfig β βfeature β βtion β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββ β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββ β
β β bugfix β β review β β security β β multi_ β β
β β β β β β β β agent β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββ β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β Load on Demand
βΌ
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β 10 Layer Files β 9 Adapter Skills β
β (methodology, β (decision-alignment, β
β decision_alignment, β codebase-impact, β
β coding_quality, β implementation-quality, β
β context_intake...) β critical-thinking...) β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ
| Layer | What | When | Token Cost |
|---|---|---|---|
| Core (AGENTS.md) | Principles, routing, verification | Always | ~3.5KB |
| Route Engine (workflow-index.yaml) | 10 routes with decision trees | On route match | +4KB |
| Layers & Skills | Detailed strategies, adapters | On demand | 1-2KB each |
Result: 80% less context than monolithic AGENTS.md configurations.
| Route | When | Mode | Gate |
|---|---|---|---|
tiny_task |
Simple answer, one-step read | shortest_safe_path | verify_if_changed |
design_or_config |
Architecture, dependency, policy | decision_first | user_confirmation_with_dissent |
complex_feature |
New feature, cross-module, public API | spec_then_target_state | focused_tests_plus_review |
implementation |
Plan confirmed, code must change | target_state_build | relevant_tests_lint_type_build |
bugfix |
Bug, regression, flaky test | diagnose_then_fix | regression_test_plus_verify |
review |
Audit, PR review, risk check | independent_review | findings_first |
security |
Auth, secrets, input, trust boundary | security_review | security_findings_and_risk |
pr_or_ci |
Branch, PR, CI, release loop | pr_ci_loop | ci_or_local_equivalent |
multi_agent |
Parallel exploration, slow verify | bounded_parallelism | integrate_outputs |
continuity |
Long-running, multi-session | lightweight_state | concise_artifact_only |
Built-in critical thinking that:
- Independently evaluates proposals against problem constraints, not user preferences
- Surfaces risks, hidden costs, and alternatives even when not asked
- Prioritizes being correct over being agreeable, while remaining constructive
Based on research from Anthropic (2023), Sharma et al. (2024), and community best practices.
# Detects your platform and installs to the correct path
curl -fsSL https://raw.githubusercontent.com/cnw-L/target-state-engineering-os/main/scripts/install.sh | bash| Platform | Install Path | Command |
|---|---|---|
| Claude Code | ~/.claude/ |
cp -r config/* ~/.claude/ |
| Codex | ~/.codex/ |
cp -r config/* ~/.codex/ |
| Qoder | ~/.qoder/ |
cp -r config/* ~/.qoder/ |
# Should show AGENTS.md, workflow-index.yaml, layers/, skills-source/
ls ~/.claude/ # or ~/.codex/ or ~/.qoder/Just ask: "What does this function do?" β Shortest safe path, no overhead.
Ask: "How should I implement caching?" β Decision-first mode with critical thinking.
Ask: "Add user authentication" β Spec β Target-state with review gates.
After plan confirmed β Direct target-state build with quality constraints.
| Approach | Context Size | Decision Quality | Critical Thinking |
|---|---|---|---|
| Monolithic AGENTS.md | 16KB+ always-on | One-size-fits-all | AI agrees with user |
| Skills Collection | 0KB core, skills on-demand | Skill-specific | Optional |
| This System | 3.5KB core, routes+layers on-demand | 10 specialized routes | Built-in dissent |
| Feature | Claude Code | Codex | Qoder |
|---|---|---|---|
| AGENTS.md | β | β | β |
| workflow-index.yaml | β | β | β |
| Layers system | β | β | β |
| Skills adapters | β | β | β |
| Route rules | β (manual) | β (manual) | β (auto) |
The system references Superpowers skills in several routes:
| Route | Superpowers Skills Used |
|---|---|
complex_feature |
brainstorming, writing-plans, test-driven-development |
bugfix |
systematic-debugging |
multi_agent |
subagent-driven-development, using-git-worktrees |
Installation:
# Clone superpowers to your Codex config
git clone https://github.com/github-copilot/superpowers ~/.codex/superpowers
# Create symlink for Qoder
mkdir -p ~/.qoder/skills
ln -s ~/.codex/superpowers/skills ~/.qoder/skills/superpowers
# Create symlink for Claude Code
mkdir -p ~/.claude/skills
ln -s ~/.codex/superpowers/skills ~/.claude/skills/superpowersWithout Superpowers: Routes will still function but may use alternative skills or simpler approaches.
Context7 provides up-to-date documentation and code examples for libraries, SDKs, APIs, and frameworks. Used when work depends on specific versions or external APIs.
| Route | Context7 Usage |
|---|---|
implementation |
API or version-sensitive work |
design_or_config |
Dependency/framework research |
Installation:
Add to your MCP configuration (e.g., ~/.qoder/SharedClientCache/mcp.json):
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"],
"env": {
"CONTEXT7_API_KEY": "your-api-key-here"
}
}
}
}Get API Key: Sign up at Upstash Context7 to get your API key.
Without Context7: Routes will use WebFetch/WebSearch for documentation lookup, which may be slower and less accurate for version-specific information.
config/
βββ AGENTS.md # Core principles (~3.5KB)
βββ workflow-index.yaml # Route engine (10 routes)
βββ layers/ # 10 strategy layers
β βββ methodology.yaml
β βββ decision-alignment.yaml
β βββ research-policy.yaml
β βββ context-intake.yaml
β βββ context-graph.yaml
β βββ project-rules.yaml
β βββ coding-quality.yaml
β βββ collaboration.yaml
β βββ runtime-continuity.yaml
β βββ prompting.yaml
βββ skills-source/adapters/ # 9 adapter skills
β βββ best-practice-research/
β βββ code-review/
β βββ codebase-impact/
β βββ coding-workflow/
β βββ critical-thinking/
β βββ decision-alignment/
β βββ implementation-quality/
β βββ pr-workflow/
β βββ security-review/
βββ evals/ # Evaluation configs
βββ templates/ # 20 delivery templates
βββ rules/ # Route rules (Qoder-only)
This system synthesizes best practices from:
- Anthropic (2023-2024): Sycophancy research, tool-use patterns, context engineering
- Sharma et al. (2024): Reducing sycophancy via preference optimization
- Claude Code Community: Devil's advocate skills, critical thinking patterns
- BMAD-METHOD: Adversarial review, multi-agent patterns
- Industry Consensus: Progressive disclosure, decision-routing, quality gates
| Metric | Before | After | Source |
|---|---|---|---|
| Always-on context | 16KB+ | ~3.5KB | Token analysis |
| Sycophancy rate | 60-80% | 20-35% | Community experiments |
| Decision quality | Subjective | Structured tradeoffs | User feedback |
| Route accuracy | N/A | 85%+ correct | Eval suite |
Contributions welcome! Please read the architecture principles in workflow-index.yaml before proposing changes.
MIT License. See LICENSE for details.