# emb-workflow **Repository Path**: emb-flow/emb-workflow ## Basic Information - **Project Name**: emb-workflow - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-09-21 - **Last Updated**: 2026-09-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
An out-of-the-box engineering framework that makes AI coding agents reliable at embedded firmware.
AI agents guess pins, lose track mid-task, and claim "fixed" without evidence. emb-workflow installs a discipline layer into your firmware project — an enforced 5-phase workflow, frozen hardware resources, on-disk task memory, build/flash/debug toolchain skills, and a 80+ article offline embedded knowledge base — delivered to 7 AI coding platforms at once.
简体中文 • Overview (Chinese only for now) • Quick Start • Core Concepts • Architecture • FAQ
## Why emb-workflow? | Capability | What it changes | | --- | --- | | **Enforced 5-phase workflow** | Every reply declares its phase (`[MODE: RESEARCH]`…). Code is only written after a reviewed plan — no more "shoot first" edits. | | **Hardware resource lock** | Pins / DMA / IRQ priorities are frozen into `hw-lock.yaml` before coding. Conflicts are caught by a script's exit code, not by the AI's goodwill. | | **On-disk task memory** | Progress, edits, and findings persist in `.emb-workflow/`. New sessions auto-inject the scene and resume via a 5-question restart — context loss stops killing tasks. | | **Evidence-gated completion** | "Should work" is blocked. Build output, serial logs, or datasheet page numbers are required before anything is declared done. | | **Self-improving project specs** | Each finished task promotes its learnings (decisions, gotchas, conventions) back into the repo's spec library, auto-injected next time. | | **Toolchain + knowledge built in** | 24 tool skills (build / flash / debug / serial / bus / analysis) and a 80+ article offline knowledge base — installed as a profile-scoped subset (detected by chip / build / OS; inspect with `emb-workflow profile`, extend with `emb-workflow add`) so the project gets only what's relevant — the AI consults them instead of hallucinating registers. | | **7 platforms, one setup** | Write the rules once; `emb-workflow init` wires them into Claude Code, Cursor, Codex, OpenCode, Copilot, Gemini CLI, and Windsurf with each platform's native syntax and hooks. | ## Prerequisites - **Node.js** >= 20 - **Python** >= 3.9 ## Quick Start ```bash # 1. Clone from Gitee and install the CLI globally (npm package not published yet; `npm install -g emb-workflow` is a future option) git clone https://gitee.com/emb-flow/emb-workflow.git cd emb-workflow npm install -g . # 2. Initialize in your firmware project (pick the AI tools you use, or --all) emb-workflow init /path/to/firmware-project -u your-name --platforms claude,cursor # 3. Open a new AI session in that project — the scene is auto-injected. Just describe what you need. ``` See the [Quick Start guide](./docs/quick-start.md) for per-platform command syntax, daily commands, and maintenance (`doctor` / `update` / `uninstall`). ## How to Use Describe your need in natural language — the framework routes it: | You say | What happens | | --- | --- | | *"Port an SSD1306 driver for STM32F103"* | Searches the local knowledge base → evaluates open-source drivers → adapts one (reuse before reinvent) | | *"Check the datasheet for F103 ADC clock limits"* | Datasheet-lookup mode: find PDF → extract parameters → write back as code comments with page numbers | | *"Why doesn't the USART1 interrupt fire?"* | Evidence-first debugging: registers / NVIC / netlist checked before any code is touched | | *"Enable competition mode for a balance car"* | 6 specialist agents in parallel: freeze pins & interface contracts → MATLAB simulation gate → driver + algorithm tracks | ## How It Works emb-workflow runs an enforced loop with platform hooks and role-scoped sub-agents: 1. **RESEARCH** — identify the chip, consult the bundled knowledge base, plan pins into `hw-lock.yaml`. No code allowed. 2. **INNOVATE → PLAN** — compare approaches, produce an itemized plan (paths + signatures + verification criteria). Plans containing code require your approval. 3. **EXECUTE** — a single-writer Builder implements one item per round with evidence; each confirmed step gets a local git snapshot. 4. **REVIEW** — mechanical gates run first (`arch-check` layering + hardware-conflict + spec integrity), then verification with real output; learnings are promoted back into `spec/`. Session start, every turn, and every sub-agent dispatch are wired through **project-level hooks** that inject exactly the relevant context — guaranteed by each platform's hook mechanism, not by the model remembering. Details in [Architecture](./docs/architecture.md). ## Resources | Need | Link | | --- | --- | | One-page project overview (Chinese only for now) | [Overview (CN)](./docs/OVERVIEW_CN.md) | | Install & first task, per-platform syntax | [Quick Start](./docs/quick-start.md) | | RIPER-5, hardware lock, memory, competition mode | [Core Concepts](./docs/concepts.md) | | Injection loop, repo layout, extending platforms | [Architecture](./docs/architecture.md) | | Installation details & troubleshooting | [INSTALL.md](./INSTALL.md) | | The protocol the AI itself follows | [SKILL.md](./SKILL.md) | ## FAQCLAUDE.md / AGENTS.md by hand?embedded-dev project?