一键导入
build-and-test
Use after any code, Kconfig, DTS, or config change — before committing. Runs the mandatory build + test gate for the weather-station project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use after any code, Kconfig, DTS, or config change — before committing. Runs the mandatory build + test gate for the weather-station project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when adding a new library under lib/. Creates the full scaffold with Kconfig, CMakeLists.txt, header, source, and wires it into the build system. Invoke when the user says "add library", "new lib", "create library", or similar.
Use when adding a new fake sensor type to the weather-station project — a new physical quantity with a Q31 encoding. Invoke when the user says "add sensor type", "new sensor", "fake sensor", or mentions a quantity not yet supported.
Use when completing tasks, implementing major features, or before merging. Spawns parallel review agents for architecture, security, C quality, embedded, and test coverage. Invoke when the user says "review code", "code review", "check my work", or before creating a PR.
Use when running the pytest integration test suite against a built gateway. Optionally filter by marker. Invoke when the user says "run tests", "run integration tests", "test gateway", or "twister".
Use after every implementation subtask, build iteration, or when asked to audit changed code. Runs pre-commit gate, then reviews against project-specific constraints from ADRs and CLAUDE.md. Invoke when the user says "check standards", "audit code", "ADR compliance", or "standards check".
Use when the user adds a new feature, makes an architectural decision, chooses a library/pattern/approach, or says "write an ADR", "add ADR", "document this decision", "record this decision", or "architecture decision record". Automatically invoked after implementing significant features or design choices.
| name | build-and-test |
| description | Use after any code, Kconfig, DTS, or config change — before committing. Runs the mandatory build + test gate for the weather-station project. |
| allowed-tools | Bash |
| disable-model-invocation | false |
Run the mandatory build + test gate for the weather-station project.
Instead of running individual commands, use the build gate script:
scripts/build-gate.sh [options]
Options:
--pristine — Force pristine rebuild (default: auto-detects from git diff)--skip-smoke — Skip shell smoke-test step--skip-tests — Skip twister test step--skip-precommit — Skip pre-commit step--quiet — Suppress stderr progress outputOutput: JSON to stdout with per-step results, durations, and overall verdict. Human-readable progress goes to stderr.
Example:
scripts/build-gate.sh
scripts/build-gate.sh --pristine
scripts/build-gate.sh --skip-tests --skip-precommit
JSON output schema:
{
"script": "build-gate",
"timestamp": "2026-05-25T12:00:00Z",
"verdict": "PASS|FAIL",
"steps": [
{"name": "Build gateway", "status": "PASS|FAIL|SKIP", "duration_s": 12.3, "detail": "...", "errors": []},
{"name": "Build sensor-node", "status": "PASS|FAIL|SKIP", "duration_s": 8.1, "detail": "...", "errors": []},
{"name": "Shell smoke-test", "status": "PASS|FAIL|SKIP", "duration_s": 2.0, "detail": "...", "errors": []},
{"name": "Twister tests", "status": "PASS|FAIL|SKIP", "duration_s": 45.0, "detail": "...", "errors": []},
{"name": "Pre-commit", "status": "PASS|FAIL|SKIP", "duration_s": 3.0, "detail": "...", "errors": []}
],
"summary": "All 5 steps passed."
}
Exit codes: 0 = all PASS, 1 = one or more FAIL, 2 = partial (some skipped)
The script runs these 5 steps in order:
west build -b native_sim/native/64 apps/gatewaywest build -b native_sim/native/64 apps/sensor-nodefake_sensors appearswest twister -p native_sim/native/64 -T tests/ --inline-logs -v -Npre-commit run --all-filesUse --pristine (or -p always) after any Kconfig, DTS overlay, or .conf change.
The script auto-detects this from git diff.
ZEPHYR_BASE=/home/zephyr/workspace/zephyr for twister.-p always. The script auto-detects this.mosquitto -p 1883 -d for full coverage.CMakeCache.txt and rebuild.| Feeling | Reality |
|---|---|
| "Should pass" / "probably fine" / "looks correct" | You didn't verify |
| Trusting a build from an earlier session | Not fresh evidence |
| Skipping sensor-node build because "only gateway changed" | Build both |
| Skipping shell smoke-test because "just a small change" | Small changes can break init |
| Proceeding past a test failure saying "will fix later" | Fix now or don't proceed |
| Proceeding past a pre-commit hook failure | Fix now or don't proceed |
| Any wording implying success without having RUN the verification command | No evidence = no claim |
/home/zephyr/workspace/build/native_sim/native/64/gateway/zephyr/zephyr.exe