afsim-auto

afsim-auto is a command for Cursor from qingzhoupro/afsim-skill. It costs 0 tokens per session (1,327 once invoked), scanned A, original, MIT.

A command that generates AFSIM scenario code from a written request, using templates and built-in checks. AFSIM is a simulation tool for modelling platforms such as aircraft, ships, vehicles, and missiles.

In plain words
What is it for?
Creating aircraft, ship, ground, or missile scenarios with sensors, weapons, processors, routes, radar, or behaviour logic, then saving the result for later verification in Warlock.
Why use it?
It turns a scenario description into structured code while checking block endings, types, parameters, units, and comments.

Command for Cursor

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/qingzhoupro/afsim-skill/afsim-auto
Clone the repo
git clone --depth 1 https://github.com/qingzhoupro/afsim-skill

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for afsim-auto

README.md
[![agentmods](https://agentmods.dev/badge/commands/qingzhoupro/afsim-skill/afsim-auto.svg)](https://agentmods.dev/commands/qingzhoupro/afsim-skill/afsim-auto)
Your own site
<a href="https://agentmods.dev/commands/qingzhoupro/afsim-skill/afsim-auto"><img src="https://agentmods.dev/badge/commands/qingzhoupro/afsim-skill/afsim-auto.svg" alt="Measured on agentmods" height="20"></a>
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 1,327 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.01327
Opus 5 $0.00000 $0.00664
Sonnet 5 $0.00000 $0.00265
Haiku 4.5 $0.00000 $0.00133

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

Security

Grade A, and why

afsim-auto 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 3d 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.

.cursor/commands/afsim-auto.md · 160 lines

How it starts

The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/afsim-auto — AFSIM 代码自动生成

两种模式

全自动(/afsim-auto <需求>

接收需求 → 自动解析 → 找模板 → 生成 → 自检 → 输出。全流程无需确认。

半自动(/afsim-auto step <需求>

每次只生成一个模块,每步等待确认后再继续。适合新手学习或复杂场景。


全自动模式流程

Step 0: 需求理解

解析用户描述,提取关键要素:

  • 平台类型(飞机/舰船/地面/导弹)
  • 阵营(红方/蓝方/绿方)
  • 是否带传感器、武器、处理器
  • 仿真时长
  • 特殊功能(行为树、路由、雷达等)

需求模糊时,全自动模式会尝试推断并补充默认值,必要时在输出后提示用户确认。

Step 1: 加载模板

按需求类型加载对应模板:

需求类型 模板来源
飞机平台 refs/quick-ref.md 最小原型 + templates/
舰船/地面 refs/demos-index.md 找 launcher/ship demo
带传感器 refs/demos-index.md 找 sensor demo
带武器 refs/demos-index.md 找 weapon/engage demo
复杂逻辑 refs/demos-index.md 找 processor/script demo

Step 2: 代码生成

基于模板修正输出,遵循:

  • 不凭空自造语法
  • 块结构完整(所有 end_* 存在)
  • 基类型正确(WSF_PLATFORMWSF_AIR_MOVER 等)
  • 参数格式正确(坐标 d:m:s、时间单位、速度单位)

Step 3: 自检

生成后自动检查:

  • 所有 end_* 闭合完整
  • 基类型拼写正确
  • 参数格式正确
  • 单位正确(ft、kts、m 等)
  • 无行尾注释

Step 4: 输出到 staging

将生成的代码写入文件output/staging/不直接输出代码块

文件路径:output/staging/<场景名称>.txt
文件内容:[生成的 AFSIM 代码]

同时告知用户:

  • 输出路径
  • 内容摘要(包含哪些 platform_type、sensor、weapon 等)
  • 下一步操作(用 Warlock 打开验证)

Step 5: 归档闭环

用户认可后(或 Warlock 验证通过),将文件移动到 output/verified/ 对应子目录:

mv output/staging/<name>.txt output/verified/scenario/
mv output/staging/<name>.txt output/verified/component/
mv output/staging/<name>.txt output/verified/template/

在目标目录的 README 中追加元信息(来源、日期、功能描述)。


半自动模式流程(step)

逐模块构建清单

Task Progress:
- [ ] Step 1: 需求确认
- [ ] Step 2: 基础平台定义(platform_type + platform)
- [ ] Step 3: 传感器(如有)
- [ ] Step 4: 武器(如有)
- [ ] Step 5: 处理器/脚本逻辑(如有)
- [ ] Step 6: 路路由与阵位
- [ ] Step 7: 全局配置(random_seed, end_time, log_file)
- [ ] Step 8: 自检确认

Step 1: 需求确认

解析用户需求,输出需求摘要,等待确认:

我将为你构建以下 AFSIM 场景:
- 红方 SAM 系统 vs 蓝方战机
- 包含:LAUNCHER_TYPE(platform_type)、FINDER_SENSOR、TIR_SENSOR、LRSAM_WEAPON、TRACK_PROCESSOR
- 仿真时长:50 min

确认请回复 "是" 或补充信息。

Step 2-7: 逐模块生成

每个模块生成后等待确认:

【Step 2/8】基础平台定义

platform_type LAUNCHER_TYPE WSF_PLATFORM
   side red
   icon SA-10_Launcher
   weapon lrsam LRSAM
     quantity 1
   end_weapon
end_platform_type

platform launcher1 LAUNCHER_TYPE
   side red
   position 40:00:00n 116:00:00e altitude 0 ft msl
end_platform

确认以上平台定义?[是/修改/跳过]

Read the full file on GitHub · 160 lines

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. 3d ago First seen · 160 lines · 0 tokens per session scan A 65e92a29e2e7

Subscribe to this mod's changes

afsim-auto is a command published in the GitHub repository qingzhoupro/afsim-skill (51 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,327 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-30.