# 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

Emb Workflow

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

npm not published yet license stars open issues open PRs Ask ChatGPT

## 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) | ## FAQ
How is this different from writing a CLAUDE.md / AGENTS.md by hand? Static rule files rely on the model reading and remembering them — they grow monolithic and silently fall out of context. emb-workflow injects *scoped* context through platform hooks (session start / per turn / per sub-agent role), gates progress with *mechanical* checks (scripts with exit codes), and persists task state on disk so sessions are resumable.
Is it only for Claude? No. One `emb-workflow init` delivers the same workflow to Claude Code, Cursor, Codex, OpenCode, GitHub Copilot, Gemini CLI, and Windsurf, each wired with its native config and hook mechanism. Seven more platforms have reserved registry slots.
Will it touch my existing code? No. It only writes `.emb-workflow/` plus each platform's config wiring, tracked in a manifest. `emb-workflow uninstall` strips everything back out (with a backup first).
Does it guarantee the AI won't make mistakes? No — and it doesn't pretend to. It sharply reduces the probability (evidence requirements, frozen hardware tables, mechanical layer checks) and forces a pause at high-risk points instead of letting the AI guess. Hardware design and physical measurement still need you.
What about the old embedded-dev project? This repo is a **rebranded derivative** of upstream [auto-embedded](https://github.com/DunCanYounG-1/auto-embedded) (Gitee `emb-flow/emb-workflow`). Upstream previously absorbed the earlier Claude-only plugin `embedded-dev` (protocol, knowledge base, competition mode). Lineage and attribution: [ATTRIBUTION.md](./ATTRIBUTION.md).
What does it NOT cover? Schematic/PCB design, component selection, soldering, oscilloscope work, and certification. It is an engineering execution framework for the *firmware software* chain — honest scope, see [Core Concepts](./docs/concepts.md#scope--limits).
## CI (Gitee Go) This repo is intended for **Gitee** hosting. CI runs on [Gitee Go](https://gitee.com/features/gitee-go); pipeline YAML lives under [`.workflow/`](./.workflow/): | Pipeline | What it runs | |---|---| | `ci-static.yml` | Claim consistency + index checks (`check:claims` / `check:index`) | | `ci-e2e.yml` | Build + full e2e suite (includes 7-platform parity) | | `ci-link-rot.yml` | Monthly link-rot audit (`check:links`) | **First-time setup:** open **Pipelines / Gitee Go** on the Gitee project so it picks up `.workflow/` and enables the pipelines. Without CI enabled, local commands still work: ```bash npm install npm run check:claims && npm run check:index npm run build && bash tests/test-emb-workflow.sh ``` See [CONTRIBUTING.md](./CONTRIBUTING.md) and [`.gitee/PULL_REQUEST_TEMPLATE.md`](./.gitee/PULL_REQUEST_TEMPLATE.md) for the merge-request checklist. > **Note:** Gitee Go cloud e2e (`ci-e2e`) is **Linux-only** today; run Windows coverage locally with `bash tests/test-emb-workflow.sh`. ## Stars welcome Hosted on [Gitee: emb-flow/emb-workflow](https://gitee.com/emb-flow/emb-workflow). Stars welcome. ## Community & Resources - [Gitee Issues](https://gitee.com/emb-flow/emb-workflow/issues) - npm package name `emb-workflow` (**not published yet**; install from source above) ## Support ## License This project is licensed under the **[PolyForm Noncommercial License 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0)**. - Full terms: [LICENSE](./LICENSE) - Copyright / upstream attribution: [NOTICE](./NOTICE), [ATTRIBUTION.md](./ATTRIBUTION.md) - Noncommercial use allowed under LICENSE; **commercial use requires a separate license** For commercial licensing, contact the derivative maintainer **Crayon** via [Gitee Issues](https://gitee.com/emb-flow/emb-workflow/issues). Full commercial rights covering upstream `auto-embedded` code may also require permission from the upstream copyright holder(s). > Note: Gitee’s license picker does not list PolyForm NC, so the repo page may show “Unknown license”. The `LICENSE` / `NOTICE` files in this repository are authoritative.