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.
npx agentmods add commands/qingzhoupro/afsim-skill/afsim-debuggit clone --depth 1 https://github.com/qingzhoupro/afsim-skillWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01216 |
| Opus 5 | $0.00000 | $0.00608 |
| Sonnet 5 | $0.00000 | $0.00243 |
| Haiku 4.5 | $0.00000 | $0.00122 |
Grade A, and why
afsim-debug 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.
How it starts
The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/afsim-debug — 报错处理与教训激活
粘贴 Warlock/Wizard 的报错信息,获取修正方案和相关教训。
使用方式
/afsim-debug
[粘贴报错信息]
核心原则
报错后绝不立即猜测根因。必须用断点(逐段注释/最小测试文件)隔离问题。
处理流程
Step 1: errors-ref 快速匹配
在 refs/errors-ref.md 中搜索报错关键字:
Unknown commandInvalid positionnot foundexpectedundefinedsyntax error- 具体命令名(如
platform_type、radar_signature等)
匹配到 [Exxx] 条目后,记录相关教训 ID。
Step 2: 教训激活(应激触发)
仅在 errors-ref 命中时,加载 memory/cold/lesson-index.md 查找相关教训 ID。
找到教训 ID 后,加载 memory/cold/lesson-root-causes.md 中对应段落。
Step 3: 修正方案输出 + 断点验证
输出格式:
## 报错分析
[描述报错原因]
## 修正方案
```text
[修正后的代码片段]
断点测试计划
修正后,写一个最小化测试文件(只保留报错相关的最小片段), 验证修正是否正确。测试通过后再改主文件。
Demo 参考
详见:refs/demos-index.md → [相关 Demo 名称]
### Step 4: 追加记录(需用户确认)
如果该报错在 errors-ref 中无记录:
1. 将报错模式和修正方案追加到 `refs/errors-ref.md`
2. 如果该错误有深层根因,创建对应教训追加到 `memory/cold/`
> **注意**:追加前必须等用户 Warlock 验证通过后再追加,不可提前追加未经确认的教训。
---
## 断点调试工作流(核心)
> 当报错信息不足以直接定位根因时,必须使用断点调试。
### 何时使用
- 报错关键字模糊(如 `Unknown weapon`、`not found`)
- 修正后错误依然存在
- 无法从报错行号直接推断问题
### 断点调试流程
1. **提取最小片段**:从原文件中提取报错相关的最小代码块
2. **写测试文件**:将最小片段写成独立测试文件(`output/staging/test_xxx.txt`)
3. **Warlock 验证**:用 Warlock 打开测试文件,确认是否仍报错
4. **逐步加回**:测试通过后,逐步加回被注释掉的代码,再次验证
5. **确认根因**:通过断点测试精确定位问题,然后修正原文件
### 断点测试文件命名规范
output/staging/test_<功能><编号>.txt 例如: test_weapon_type_1.txt # 断点1:weapon 类型定义 test_weapon_with_type_1.txt # 断点2:weapon + platform_type test<具体修正点>.txt
### 断点调试示例
场景:报错 "Unknown weapon: my_weapon"
断点1(最小化): weapon MY_WEAPON WSF_EXPLICIT_WEAPON launched_platform_type MY_MISSILE end_weapon random_seed 1 end_time 1 sec → Warlock 测试
断点2(加上 platform_type): weapon MY_WEAPON WSF_EXPLICIT_WEAPON launched_platform_type MY_MISSILE end_weapon platform_type MY_MISSILE WSF_PLATFORM end_platform_type random_seed 1 end_time 1 sec → Warlock 测试
断点3(加上 platform 实例): weapon MY_WEAPON WSF_EXPLICIT_WEAPON launched_platform_type MY_MISSILE end_weapon platform_type MY_MISSILE WSF_PLATFORM end_platform_type platform test WSF_PLATFORM weapon my_weapon MY_WEAPON end_weapon end_platform random_seed 1 end_time 1 sec → Warlock 测试
通过后,再加回其他配置(mover、sensor 等)
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.
- 2d ago First seen · 156 lines · 0 tokens per session scan A 9edfe056d894
afsim-debug 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,216 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.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
constitution
Create or update the project constitution from interactive or provided principle inputs.