English Β· δΈζ
SDD Pinple Workflow β Make AI work like a real senior engineer.
This is more than a workflow β it's a portable, business-agnostic "cognitive operating system" for an AI engineer. Drop it into any repository, feed one prompt to your AI, and it bootstraps a complete collaboration system: an AI that does its homework before acting, stays within guardrails, remembers its lessons, and grows with your project.
The goal isn't "let AI write a few lines of code for you" β it's "give AI the working style, judgment, and growth of a seasoned engineer".
Why Β· Quick Start Β· Highlights Β· Architecture Β· Docs
After cloning this repo on a fresh machine, the workflow's own tooling should ship with it rather than live on one person's laptop. Three additions: ai-tool-migrator (cross-tool migration of Skills/MCP/Agents/Memory between Claude Code / Codex / ZCode / Cursor / OpenCode / WorkBuddy / dsh β the dependency MULTI-TOOL-AUTHORITY.md references now lives in-package), skillhub-ship (zero-trap publishing of local skills to SkillHub), deepseek-harness-installer (one-shot dsh install & verification). 33 β 36 skills.
V3.0 converged the process; V3.1 ships the methodology skills distilled from real usage β and answers "how do I take this whole workflow to another machine?"
- Workflow migrator (workflow-migrator) β: migrate this seed repo to a fresh computer / new tool environment. Read-only inventory first (scan_migration.py conflict matrix: new / identical / differs), then one of two target shapes β plain per-tool copy, or
~/.agentssingle-source-of-truth with junction shells. Append-only, migration report with rollback list. - Method-review trio: grill-method attacks how you're working (is this the optimal route?), doubt-driven-development adversarially reviews non-trivial decisions in fresh context before they harden, idea-vetting vets unproven ideas against prior art before you invest.
- Craft skills: code-simplification (reduce complexity, behavior preserved), memory-find (keyword recall across memory & knowledge assets), glossary-builder (extract enum/synonym maps into
.notes/foundation/glossary.md), context-stacking (three-step deep learning, complements the comprehension ledger). - Field-tested upgrades, sanitized: api-doc-generator's five hard rules (encoding/annotation/gateway-path/dedup β distilled from real YApi incidents) and security conventions (identity-from-context, IDOR checks) now ride along in
shared-references/.
V1/V2 made AI reliable; V3.0 fixes two deeper problems: the workflow itself got too heavy, and humans stopped understanding what AI ships.
- Expert-package workflow: 20+ pipeline skills collapsed into one entry point with S/M/L sizing β small tasks skip the ceremony entirely. See EXPERT-PACKAGE-PATTERN.md.
- Comprehension ledger: boundary Q&A before sign-off, a human-facing handover trio after verify, and Leitner-box spaced review β turning "AI wrote it, I never understood it" into a repayable debt. See skills/comprehension-ledger/.
- Workflow audit & slim (audit-slim): evidence-based Keep/Merge/Delete for resident rules & skills, plus Step 0 post-upgrade consistency inspection (4 layers: links / references / command paths / factual claims) β because "rebuilt the new" never automatically means "cleaned the old".
- Single source of truth across tools:
~/.agents/as the one authority; per-tool dirs become junction shells. See MULTI-TOOL-AUTHORITY.md. - Context budget: rules split core/methodology (-60% resident injection); plans delivered as a one-pager + appendices.
- Field-tested on a real L-level requirement: discovered ~70% was already implemented on a legacy branch before writing a line; sign-off gate held (zero production code without approval). Full story: EVOLUTION-V3.md.
Today's AI coding assistants are powerful, but everyone who's used one has hit the same walls:
| Pain point | You've definitely experienced | What this workflow does about it |
|---|---|---|
| AI forgets | A new conversation = total amnesia; you re-explain the project every time | Memory system + knowledge assets + task persistence β context survives across sessions |
| AI hallucinates | Invents classes and methods that don't exist; acts after reading just one file | Four-questions-before-acting + Spec-first + automated fact-verification |
| AI goes off the rails | Loops endlessly breaking code, or over-engineers far beyond the requirement | Circuit-breaker protocol + reversibility tiers + context-isolated sub-agents |
| AI never grows | Makes the same mistake again; ignores yesterday's correction | Compound Learning loop β every correction becomes a memory/rule; it gets to know your project better over time |
This is not yet another "prompt template". It's a constrained, self-reflective, evolvable cognitive OS β it encodes a senior engineer's working style (research first, respect boundaries, retrospect, accumulate experience) into muscle memory the AI follows at every step.
# 1. Drop this repo into your project as a subdirectory, or just clone it
git clone https://github.com/<your-name>/ai-coding-workflow.git-
Open
BOOTSTRAP.mdand copy the "bootstrap prompt" inside. -
Paste it into your AI IDE (Cursor / Claude Code / any agent that supports custom rules).
That's it. The AI will automatically: analyze your repo β deploy the workflow files β fill in placeholders β generate a first draft of .notes/ knowledge assets β self-verify.
Got a new machine? Clone this repo there, then tell the AI: "use skills/workflow-migrator to install this workflow into my environment on this machine" β it inventories conflicts read-only, then migrates via plain per-tool copy or
~/.agentssingle-source-of-truth, append-only with a rollback-capable report. Seeskills/workflow-migrator.
Want to deploy manually or understand what each file does? See
docs/DEPLOYMENT.md.
This workflow wasn't designed on a whim β it was forged through countless iterations on real enterprise-grade production projects. A few designs that genuinely matter:
Before touching anything, the AI auto-checks four things: recall past lessons β route to the right skill β consult project knowledge β verify the code entity actually exists. This turns "AI guessing" into "AI doing its homework first".
A complete measurement closed loop: Practice β Collection β Consumption β Decision β Practice. Four automated Hooks (SessionStart/Stop/SessionEnd/PreCompact) power a self-healing eval pipeline β L2 Agent-as-Judge gates every session end, SessionEnd auto-collects metadata, PreCompact preserves critical decisions across context compaction.
Hot (~3000 tokens, always-on): CLAUDE.md + alwaysApply rules.
Warm (on-demand): Skills + references, loaded by trigger.
Cold (on-demand retrieval): .notes/ docs + historical logs.
Proactive delegation decision tree saves tokens without losing capability.
Stop Hook prompts a structured L2 Agent-as-Judge ({ok, violations, reason}) to check every code change against 12 iron laws β exceptions, SQL injection, identity forgery, tenant isolation, credential leaks, idempotency, resource leaks, transaction abuse, IDOR, thread context, and scheduled-task safety. ok=false hard-blocks the session from ending.
Complex tasks are not allowed to start with code. First produce a fact-verified technical spec, then run path verification, consistency checks, pre-mortem reasoning, and multi-perspective review. The companion "test-cases-first" philosophy β write stable behavioral contracts at design time, only run regressions while coding, and materialize test classes after the code is finalized β eliminates the chronic pain of "tests churning along with the implementation".
Many AI tools now have memory, but most stop at "remembering your preferences". This workflow's memory goes further β it actively recalls and participates in decisions before every action.
- Categorized accumulation: preference / feedback / insight / reference β four types, each with a clear role
- Active recall (Q0 of the four questions): before acting, scan the memory index; load any relevant lesson and avoid the mistake before it happens, instead of realizing it afterward
- Promotion mechanism: every memory carries a "why" so edge cases can be judged; critical lessons get promoted to enforced rules
- Memory hygiene: auto-detect staleness, merge duplicates, cap capacity β memory never devolves into clutter
In one line: other tools' memory is "the AI remembers what you said"; here, memory is "before doing anything, the AI first recalls where it tripped on this kind of task before".
Every correction triggers a loop of "root-cause analysis β memory-promotion evaluation β distill into a memory or rule". The longer you use it, the better it understands your project; mistakes turn into reusable assets β exactly what separates a senior engineer from a newcomer: experience accumulates.
Three failed attempts in a row force a stop-and-rethink. An explicit progress counter + a five-level action ladder root out both "AI repeatedly breaking code" and "search-bombing" dead loops.
From the "constitution" (AGENTS.md) to routing to skills to the feedback loop β cleanly layered, each with its job. The 36 skills are trimmable on demand, covering the full dev lifecycle from unit testing and code review to architecture guarding, method review, and knowledge distillation.
Designed entirely with neutral conventions and placeholders β runs on Cursor, Claude Code, or any agent. All business coupling has been stripped out, so it adapts to any language and any domain.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 5 Β· EDD & Automation Hooks Β· Cron Β· eval pipeline β β self-healing
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Layer 4 Β· Loop & Persistence task persistence Β· breaker Β· β β gets smarter
β observation Β· memory β over time
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Layer 3 Β· Capabilities 36 Skills Β· sub-agents Β· orch. β β the toolbox
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Layer 2 Β· Routing & Decision skill routing Β· knowledge β β the dispatcher
β routing Β· complexity triage β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Layer 1 Β· Constitution AGENTS.md Β· coding standards Β· β β the constitution
β behavioral boundaries β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Full design philosophy and data flow: ai-coding-workflow-architecture.md.
ai-coding-workflow/
βββ README.md # This file β English landing page
βββ README.zh-CN.md # Chinese landing page
βββ BOOTSTRAP.md # β One-shot bootstrap prompt
βββ ai-coding-workflow-architecture.md # Four-layer architecture guide
βββ AGENTS.md # Agent entry (identity/principles/boundaries/loop)
βββ LICENSE # MIT
βββ docs/
β βββ DEPLOYMENT.md # Manual deploy guide + trimming + checklist
β
βββ rules/ # Constitution layer (20 rules)
β βββ ... # (see full list in architecture doc)
β
βββ skills/ # Capability layer (20+ skills, each with SKILL.md)
β βββ ... # (see full list in architecture doc)
β
βββ templates/ # Scaffolding templates
βββ .notes-scaffold.md # .notes knowledge-asset directory structure
βββ eval-log-template.md # Eval log format template
βββ memory-scaffold.md # Memory index skeleton template
βββ PLATFORM-ADAPTER-template.md # Platform adapter template (Claude Code/Cursor)
| I want to⦠| Go here |
|---|---|
| Start right now | BOOTSTRAP.md β copy the prompt, feed it to your AI |
| Deploy manually / trim on demand | docs/DEPLOYMENT.md |
| Understand the design | ai-coding-workflow-architecture.md |
| Read the AI's "constitution" | AGENTS.md |
The core design philosophy of this workflow is evolvability β fork it, trim it, extend it.
- Add a rule: create
rules/{semantic-name}.md - Add a skill: use
skills/skill-creatorto scaffold a new skill - Add knowledge: distill into
.notes/across the Foundation / Patterns / Analysis layers
Follow the "knowledge-routing decision tree" in AGENTS.md to decide which layer new knowledge belongs to.
MIT Β© crayon
This is a system I forged through countless iterations on real projects, distilling all my thinking on one question: how do we make AI not just "able to write code", but actually work like a senior engineer β researching, judging, respecting boundaries, retrospecting, and growing. Now it's open-source. I hope it helps everyone who wants to take AI Coding seriously. Enjoy. π