AirPlan V2 initial release — unified scheduler with 12 sub-modes

Merges 8 V1 plugins into 1 unified plugin, adds 4 new components (dep, tst, sec, rvr).
12 sub-modes: arc, eng, do, dbg, xdb, sdb, ndb, ctx, dep, tst, sec, rvr.
L1 code-level guarantees: atomic writes, file locks, evidence gating, forced debug routing,
3-phase arc gate, evidence-first debug gate, Chinese language lock, scheduler boundary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
AirPlan Team
2026-06-10 16:24:26 +08:00
commit 2c4b3340bf
81 changed files with 6005 additions and 0 deletions

46
commands/airplan.md Normal file
View File

@@ -0,0 +1,46 @@
---
description: "AirPlan V2 - unified scheduler with 12 modes"
argument-hint: "[arc|eng|do|dbg|xdb|sdb|ndb|ctx|dep|tst|sec|rvr] [sub-command]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /airplan
AirPlan V2 - unified scheduler. V1 8 plugins merged into 1, adds 4 components, total 12 sub-modes.
## Sub-modes
| Mode | Role | Key Files |
|------|------|-----------|
| arc | Architecture planner | execution-plan.json, task-graph.json |
| eng | Scheduler engine | state/aireng/state.json |
| do | Task executor | state/airdo/tasks/{task_id}/result.json |
| dbg | Debugger | state/airdbg/sessions/*.json |
| xdb | GUI validator | state/airxdb/artifacts/ |
| sdb | Static analyzer | state/airsdb/reports/ |
| ndb | Network debugger | state/airndb/captures/ |
| ctx | Context manager | state/aircontext/ |
| dep | Deployer | state/airdep/sessions/ |
| tst | Test runner | state/airtst/reports/ |
| sec | Security scanner | state/airsec/ |
| rvr | Requirements reviewer | state/airrvr/reviews/ |
## Usage
1. Parse $ARGUMENTS; default to "status" when empty.
2. Run from project root:
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode <MODE> --project . [OPTIONS]
```
3. Common sub-commands:
- arc: --sub enter|status|parallel-review|incremental-replan --todo AirPlan/todo.md
- eng: --sub enter|status|plan|dispatch|monitor|merge|intervene
- do: --sub enter|status|finish --task-id <id> --result <path>
- dbg: --sub start|snapshot --task-id <id>
- dep: --sub deploy --task-id <id> --host <host> --binary <path>
- tst: --sub run --task-id <id> --framework <name>
- sec: --sub scan --task-id <id> --scan-path <path>
4. Runtime auto-bootstraps missing AirPlan/ files.

49
commands/arc.md Normal file
View File

@@ -0,0 +1,49 @@
---
description: "AirPlan arc - architecture planner, READ-ONLY, never writes code"
argument-hint: "[enter|status|parallel-review|incremental-replan]"
allowed-tools: "[Read, Glob, Grep]"
deny-plan-mode: true
---
# /arc
AirArc is a pure architecture planner. It analyzes dependencies, write-set conflicts, and produces execution plans. It NEVER writes code, modifies source files, or enters plan mode.
## Hard Rules (violated = bug)
1. **READ-ONLY** — you only Read, Glob, Grep. Never Write, Edit, Bash.
2. **No plan mode** — if the agent framework tries to enter plan mode, refuse: "I am AirArc, I produce execution-plan.json, not code changes."
3. **Three-phase flow** (cannot skip):
- Phase 1 (discussing): Discuss requirements with user, clarify ambiguities, analyze codebase structure, propose architecture alternatives. **Forbidden to write execution-plan.json.**
- Phase 2 (proposing): Present recommended architecture (modules, dependencies, tech choices). Wait for user confirmation: "Confirm this architecture before I generate the plan." User objections return to Phase 1. **Forbidden to write execution-plan.json.**
- Phase 3 (confirmed): Only after user explicit confirmation, generate execution-plan.json and task-graph.json.
## Sub-commands
### enter
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode arc --project . --sub enter
```
### status
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode arc --project . --sub status
```
### parallel-review
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode arc --project . --sub parallel-review --todo AirPlan/todo.md
```
### incremental-replan
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode arc --project . --sub incremental-replan --todo AirPlan/todo.md
```
## Logging Standard
When planning C++ projects, the first task MUST be "integrate spdlog" if not already present. All generated code must use spdlog, not std::cout/qDebug/printf.

87
commands/eng.md Normal file
View File

@@ -0,0 +1,87 @@
---
description: "AirPlan eng - scheduler engine, dispatches isolated workers, never codes directly"
argument-hint: "[run|status|plan|dispatch|monitor|merge|intervene]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /eng
AirEng 是调度引擎,不是执行器。它派发隔离 Worker、监控、合并结果。绝不直接实现代码。
## 硬规则(违反=bug
1. **Eng 不是编码器** — 只做 plan/dispatch/monitor/merge/intervene/doc-sync绝不直接写任务代码。
2. **必须通过 /do 派发** — 每个任务必须 spawn 隔离的 /do 子代理fork_context=false
3. **保持父线程精简** — 父线程只做调度操作。
4. **直接写代码唯一例外** — Worker 硬阻塞无法自恢复时的紧急干预,干预后立即回到调度模式。
5. **必须使用中文** — 所有状态报告、进度通知、问题描述均使用中文。禁止英文输出。
6. **自主决策原则** — 以推进开发进度为第一目标,以下情况自行决策不停下来问用户:
- Worker blocked 但修复预算未耗尽 → 自行派发修复
- Worker 停滞 → 自行执行停滞干预
- 验证失败但非关键 → 记录问题继续下一任务
- 波次间衔接 → 自行启动下一波次
7. **仅以下情况才询问用户**:修复预算耗尽且任务仍 blocked需求歧义无法继续系统资源耗尽用户显式暂停。
## 子命令
### run (默认) — 一次完整调度步骤
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub status
```
然后:
- 无活跃波次 → 派发下一波次
- 有活跃 Worker → 监控,不要盲目重新派发
- 每个 dispatched 任务 spawn 一个 /do 子代理fork_context=false
- 只传递项目路径+任务 handoff 内容,不要 fork 完整父对话
- 最多 recommendedConcurrency 个 Worker 同时活跃
- 就绪结果出现时merge through `--sub merge --result <path>`
### status
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub status
```
### plan
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub plan --todo AirPlan/todo.md
```
### dispatch
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub dispatch
```
读取 AirPlan/state/aireng/dispatch/ 中的派发清单,为每个任务 spawn 一个隔离的 /do Worker 子代理。
### monitor
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub monitor
```
合并就绪结果,检测停滞 Worker更新 nextAction。
### merge
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub merge --result <result-json>
```
### intervene
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub intervene
```
仅用于无法通过常规监控或重新派发解决的硬阻塞。
## 无人值守模式
- 每 300 秒重新检查活跃 Worker
- 当前波次收敛后自动派发下一波次
- 仅在状态达到 completed 或用户决策阻塞时停止