init

A command for starting a new embedded-device project from an empty directory. It creates project state files, a context document, a work-step outline, and a baseline snapshot, then records the selected chip and development tools.

In plain words
What is it for?
Use it to initialize a project, choose or specify its microcontroller, confirm the compiler, programmer, and debugger, and prepare the next feature-development step.
Why use it?
It gives a new project a consistent starting structure and records the hardware and toolchain choices. The baseline helps track later changes to protected and source files.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jzl-maker/ea-skill/init
Clone the repo
git clone --depth 1 https://github.com/jzl-maker/EA-SKILL
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 825 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00825
Opus 5 $0.00000 $0.00413
Sonnet 5 $0.00000 $0.00165
Haiku 4.5 $0.00000 $0.00082

Measured 2d ago against content hash bcfd03474ed5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

init scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/init.md · 68 lines

What it actually says

命令: /ea init (新项目初始化)

功能

从零开始新嵌入式项目,生成 <STATE_DIR>/ 标准结构 + context.md 骨架 + 基线快照。

触发

/ea init <项目名称>
/ea init <项目名称> --chip GD32F407VET6   # 直接指定芯片(跳过选择)

执行流程

  1. 【目录检测】 当前目录已有 .ea/.em/ → 提示「项目已初始化」+ 建议 /ea rec
  2. 【状态目录】 新建 .ea/(纯嵌入式,无需类型判定)
    .ea/
    ├── state.md          # 最小状态(当前步骤 S0)
    ├── project.json      # { type:"embedded", name, created, chip, toolchain, interface }
    ├── context.md        # 工程上下文骨架
    ├── project-spec.md   # 步骤表(空骨架)
    ├── decisions.md  problem-log.md  approvals.md
    ├── sessions/  discussion/  checkpoints/  history/  logs/
    └── records/  tests/
    
  3. 【芯片选择】workflows/chip-learning.md
    • ~/.claude/chips.json(最近使用 + 内置列表)
    • 用户选择或自定义输入
    • 外设列表(GPIO/UART/I2C/SPI/CAN/Timer/ADC...)写入 context
  4. 【工具链确认】 确认编译/烧录/调试工具链(Keil target / OpenOCD interface / J-Link 设备名),写入 project.json
  5. 【基线快照】 python ~/.claude/skills/ea-skill/tools/shared/project_guard.py --snapshot
    • 对保护区文件 + 当前源文件做 SHA-256 → 写入 context.md 基线区
    • 新项目此时无源文件,基线为空表,si 接入老工程时才真正生效
  6. 【写 state.md】 当前步骤 S0,下一步动作:/ea new <功能描述>
  7. 【输出初始化报告】

输出格式

✅ 嵌入式项目初始化完成

项目: <名称>
芯片: GD32F407VET6 (GigaDevice)  外设: GPIO/UART/I2C/SPI/CAN/Timer/ADC
工具链: Keil UV4 + OpenOCD(stlink) + J-Link
状态目录: .ea/

📁 已创建: state.md project.json context.md project-spec.md decisions.md
          problem-log.md approvals.md + sessions/discussion/checkpoints/history/logs/records/tests

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
下一步:
  /ea new <功能描述>    # 进入新功能开发
  /ea setup            # 若工具路径未配置
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

设计原则

  • ✅ 纯嵌入式:无 general/embedded 类型判定
  • ✅ context 先行:新项目即建上下文骨架,后续命令按需补充
  • ✅ 基线快照:从第一天起保护区可审计

相关文件

  • commands/setup.md — 工具环境初始化
  • workflows/chip-learning.md — 芯片选择/学习
  • workflows/context-build.md — 上下文构建流程
  • tools/shared/project_guard.py — 基线快照/审计
  • templates/project.json — 项目元数据模板
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 68 lines · 0 tokens per session scan A bcfd03474ed5

Subscribe to this mod's changes

init is a command published in the GitHub repository jzl-maker/EA-SKILL (4 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 825 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.