feat: P1-19 P1-20 实现 - 边界测试强制 + 高风险审计 + UI Skill 路由

P1-19.1: Arc 边界测试强制
- TaskNode 新增 test_required 字段
- _inject_boundary_tests() 为每个模块注入接口测试和单元测试任务
- Done When 验证必须包含"测试通过"

P1-19.2: AirRvr 高风险审计
- 新增 HighRiskAudit, HighRiskFinding 数据类
- ReviewReport 新增 highRiskAudit 字段,含 lifecycle/nullPointer/danglingPointer/exceptionSafety/concurrency + overallRisk + deliveryVerdict
- 序列化/反序列化支持

P1-19.3: block-release 集成
- dispatch_worker_group() 派发前扫描最新审查报告
- deliveryVerdict=block-release 时阻止所有后续派发
- 记录 eng.blocked 事件

P1-20: frontend-design Skill 集成
- is_ui_task() UI 任务检测
- ensure_frontend_design_skill() 自动安装 Skill
- route_ui_task() UI 任务路由决策
- enter_worker() 集成 UI 检测,skill 不可用时阻止执行
- commands/do.md 更新 UI 处理说明
- SKILL.md 新增 INV-12/INV-13/INV-14

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
AirLongDian
2026-06-10 17:06:48 +08:00
commit e73a4da354
54 changed files with 6054 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 |
|------|------|
| arc | Architecture planner |
| eng | Scheduler engine |
| do | Task executor |
| dbg | Debugger |
| xdb | GUI validator |
| sdb | Static analyzer |
| ndb | Network debugger |
| ctx | Context manager |
| dep | Deployer |
| tst | Test runner |
| sec | Security scanner |
| rvr | Requirements reviewer |
## Usage
1. Parse $ARGUMENTS; default to "status" when empty.
2. Run from project root - replace MODE with first arg:
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode MODE --project . [OPTIONS]
```
Example: /airplan arc -> runs with --mode arc
Example: /airplan eng monitor -> runs with --mode eng --sub monitor
3. Common patterns:
- /airplan arc parallel-review --todo AirPlan/todo.md
- /airplan eng dispatch
- /airplan eng monitor
- /airplan do finish --task-id T-001 --result /path/to/result.json
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.

11
commands/ctx.md Normal file
View File

@@ -0,0 +1,11 @@
---
description: "AirPlan ctx mode"
argument-hint: "[enter|status|...]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /ctx
Run AirPlan ctx mode.
python "$HOME/plugins/airplan/scripts/airplan.py" --mode ctx --project . [OPTIONS]

11
commands/dbg.md Normal file
View File

@@ -0,0 +1,11 @@
---
description: "AirPlan dbg mode"
argument-hint: "[enter|status|...]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /dbg
Run AirPlan dbg mode.
python "$HOME/plugins/airplan/scripts/airplan.py" --mode dbg --project . [OPTIONS]

11
commands/dep.md Normal file
View File

@@ -0,0 +1,11 @@
---
description: "AirPlan dep mode"
argument-hint: "[enter|status|...]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /dep
Run AirPlan dep mode.
python "$HOME/plugins/airplan/scripts/airplan.py" --mode dep --project . [OPTIONS]

54
commands/do.md Normal file
View File

@@ -0,0 +1,54 @@
---
description: "AirPlan do mode - task executor with UI skill routing"
argument-hint: "[enter|status|finish]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /do
AirDo is the task executor. It runs individual tasks, enforces routing rules, and integrates with other AirPlan modes.
## Hard Rules
1. **UI Task Handling (P1-20)** — When task involves UI/frontend/interface design:
- Must detect UI tasks via keyword matching (gui, ui, render, widget, frontend, react, vue, etc.)
- Must ensure frontend-design Skill is available before executing UI code
- If frontend-design Skill is not installed, block the task
- Use `ensure_frontend_design_skill()` and `route_ui_task()` functions
2. **Evidence Gate (INV-4)** — Tasks with GUI/network indicators must have corresponding evidence before finishing:
- GUI tasks require screenshot/validation evidence
- Network tasks require packet capture/connectivity evidence
- Code tasks require static analysis/test results
3. **Force AirDbg Routing (INV-4)** — If task finishes without evidence, force route to AirDbg:
- `done` status + no validations/files_changed → route to airdbg
- `blocked`/`failed` status → always route to airdbg
## Sub-commands
### enter
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode do --project . --sub enter --task-id T-001 --task-text "实现登录界面UI"
```
### status
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode do --project . --sub status
```
### finish
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode do --project . --sub finish --task-id T-001 --result /path/to/result.json
```
## UI Task Detection Keywords
UI task detection uses these keywords (case-insensitive):
- gui, ui, render, layout, dialog, osd, overlay, visual
- widget, pane, toolbar, settings_dialog, canvas, button
- window, popup, menu, drm, kms, opengl, vulkan
- frontend, react, vue, angular, web, css, html

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 或用户决策阻塞时停止

11
commands/ndb.md Normal file
View File

@@ -0,0 +1,11 @@
---
description: "AirPlan ndb mode"
argument-hint: "[enter|status|...]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /ndb
Run AirPlan ndb mode.
python "$HOME/plugins/airplan/scripts/airplan.py" --mode ndb --project . [OPTIONS]

11
commands/rvr.md Normal file
View File

@@ -0,0 +1,11 @@
---
description: "AirPlan rvr mode"
argument-hint: "[enter|status|...]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /rvr
Run AirPlan rvr mode.
python "$HOME/plugins/airplan/scripts/airplan.py" --mode rvr --project . [OPTIONS]

11
commands/sdb.md Normal file
View File

@@ -0,0 +1,11 @@
---
description: "AirPlan sdb mode"
argument-hint: "[enter|status|...]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /sdb
Run AirPlan sdb mode.
python "$HOME/plugins/airplan/scripts/airplan.py" --mode sdb --project . [OPTIONS]

11
commands/sec.md Normal file
View File

@@ -0,0 +1,11 @@
---
description: "AirPlan sec mode"
argument-hint: "[enter|status|...]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /sec
Run AirPlan sec mode.
python "$HOME/plugins/airplan/scripts/airplan.py" --mode sec --project . [OPTIONS]

11
commands/tst.md Normal file
View File

@@ -0,0 +1,11 @@
---
description: "AirPlan tst mode"
argument-hint: "[enter|status|...]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /tst
Run AirPlan tst mode.
python "$HOME/plugins/airplan/scripts/airplan.py" --mode tst --project . [OPTIONS]

11
commands/xdb.md Normal file
View File

@@ -0,0 +1,11 @@
---
description: "AirPlan xdb mode"
argument-hint: "[enter|status|...]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /xdb
Run AirPlan xdb mode.
python "$HOME/plugins/airplan/scripts/airplan.py" --mode xdb --project . [OPTIONS]