preflight

A pre-submission checklist for a documentation project. It checks document metadata, Markdown formatting, bold-text rendering, internal links, indexes, and whether code examples need compilation checks.

In plain words
What is it for?
Use it to inspect selected files or folders, or staged files by default, and produce a pass-or-fail report with items that need attention.
Why use it?
It catches common problems before a change is submitted, such as invalid metadata, broken links, missing index entries, or formatting that displays incorrectly.

Command for Claude Code

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/awesome-embedded-learning-studio/tutorial_awesomemoderncpp/preflight
Clone the repo
git clone --depth 1 https://github.com/Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP

Made for: Claude Code.

Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 557 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.00026 $0.00557
Opus 5 $0.00013 $0.00279
Sonnet 5 $0.00005 $0.00111
Haiku 4.5 $0.00003 $0.00056

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

Security

Grade A, and why

preflight 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.

.claude/commands/preflight.md · 40 lines

What it actually says

/preflight — 提交前自检

跑一遍 PR 前该过的检查,汇总通过项和待修项。

输入

$ARGUMENTS —— 目标文件 / 目录(可选)。留空则用 git diff --cached --name-only 取已暂存文件。

流程

  1. frontmatter 校验:.venv/bin/python scripts/validate_frontmatter.py(必须用 venv,系统 python 缺 PyYAML 会全量误报)。
  2. markdownlint:markdownlint <目标 .md 文件>
  3. 粗体渲染:tsx scripts/check_bold_rendering.ts(扫 documents/ 检测 ** 因标点边界未渲染成 <strong> 而字面残留的行;典型是 **术语(英文)** 这类。发现即修:让 ** 边界落在文字上,标点移到 ** 外)。
  4. 内部链接:运行项目的 link check(若有,如 CI 用的脚本),或人工抽检新增 / 改动链接是否可达、ChapterLinkhref 不以 .md 结尾等。
  5. 索引检查:若新增或移动了文章,对应卷 index.md 是否已更新链接。
  6. 代码示例(若涉及 code/):提醒确认可独立编译(无根 CMakeLists,逐目录构建)。

输出

## Preflight 报告
- [ ] frontmatter: pass / fail(细节)
- [ ] markdownlint: pass / fail
- [ ] 粗体渲染: pass / fail(N 行 ** 残留)
- [ ] 内部链接: pass / 待检
- [ ] 索引更新: 已更新 / 待补
- [ ] 代码示例: 不涉及 / 待编译确认
待修清单:...

硬约束

  • Python 一律 .venv/bin/python(有 PreToolUse hook 强制)。
  • 只读检查,不改文件(发现问题列出来,让用户决定怎么改)。
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 · 40 lines · 26 tokens per session scan A c2a3dc2cfa07

Subscribe to this mod's changes

preflight is a command published in the GitHub repository Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP (250 stars, last pushed 2d ago), licensed MIT. It adds 26 tokens to every session and 557 once invoked, about $0.0001 per session on Opus 5. 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-30.