AGENT SKILL

实施方案交叉核验

plan-crosscheck

在编写任何代码之前,以对抗方式对照真实代码交叉核验实施计划。为计划的每个部分派出一个验证器读取代码,用 file:line 确认或反驳每条论断,给出具体修改并搜寻缺口——另有一个怀疑者找出计划遗漏的内容。在起草任何非平凡计划之后(多文件、认证/RBAC/数据范围、数据迁移、多处调用点、契约/模式变更)、实施之前使用。

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
plan-crosscheck
description
Adversarially cross-check an implementation plan against the REAL code before writing any of it. Fans out one verifier per plan-part that reads the code, confirms or refutes each claim with file:line, gives the concrete edit, and hunts for gaps — plus one skeptic that finds what the plan forgot. Use after drafting any non-trivial plan (multi-file, auth/RBAC/data-scope, migrations, many call-sites, contract/schema changes), BEFORE implementing.

03 SKILL.md 正文

Plan Cross-Check

A plan is a hypothesis, not a fact. Line numbers drift, call-sites get missed, ativo-style filters are applied inconsistently, edge cases hide behind reverse relations. Before spending effort implementing, prove the plan against the real code — and let the human approve the revised plan, not the guess.

This skill sits between create-plan and implement-plan: create-plan → plan-crosscheck → implement-plan. It complements verification-gate (which verifies finished work); this verifies the plan.

When to use

Run it once a plan exists and before the first edit, when the plan is non-trivial in any of these ways:

  • touches many files / call-sites (e.g. "update all N places that read X");
  • changes authorization, RBAC, or data-scope (a missed site is an access leak);
  • adds a migration / schema / DB constraint (ordering, backfill, deploy risk);
  • changes a shared contract (serializer, importer, API) with downstream readers;
  • crosses subsystems where you can't hold every detail in one head.

Skip it for trivial one-file changes with no auth/migration/contract surface — there a single inline re-read of the file is enough. Don't fan out to prove a typo.

The method

  1. Split the plan into PARTS that can each be verified independently — usually one per subsystem or file-group (model+migration, the auth core, the view layer, the writer, tests/fixtures). Aim for 3–6 parts.

  2. One verifier per part (Workflow fan-out, or parallel Agent calls if Workflow isn't opted-in). Give each verifier the full plan plus its assigned part, and require it to read the actual code and return the structured verdict below. Verifiers are read-only — they check, they don't edit.

  3. Always add one ADVERSARIAL / completeness verifier whose only job is to break the plan: "what did this forget, where does it break?" It must grep for every usage — including reverse relations / related_name (obj.related_set, field__lookup), admin, serializers, signals, management commands, and the frontend/API — to catch call-sites the plan never listed. It also probes migration/deploy risk and tests that depend on the current (possibly buggy) behavior and will flip red.

  4. Synthesize the verifier results into a revised plan: fold in the corrections, add the missed sites, resolve or escalate each risk. Surface the furos (gaps) and material changes to the human, and get approval on the revised plan. Do not start implementing while any part is plano-tem-furo.

Verifier output schema (reuse verbatim)

{
  part:          string,                                  // which plan part
  verdict:       "plano-ok" | "plano-ok-com-ajustes" | "plano-tem-furo",
  verified:      string[],   // plan claims CONFIRMED in code, each with file:line
  corrections:   string[],   // where the plan is wrong/incomplete + the concrete fix
  exact_changes: string[],   // the real edit per file:line (what to change to what)
  risks:         string[],   // edge-cases / gotchas the plan doesn't cover
}

Verifier prompt shape (per part)

Here is the PLAN: <full plan>. VERIFY PART N against <the exact files/lines it touches>. Confirm each claim with file:line, or refute it. For every change the plan proposes, read the current code and give the exact edit (current line → new line). Flag any place the change doesn't compose (e.g. .exists() vs .values_list() vs a reverse-relation join). List risks the plan misses. Read-only — don't edit.

Discipline (what makes it worth the tokens)

  • Evidence, not memory — every "verified" item carries file:line. A claim without a line reference isn't verified.
  • The helper must compose — when the plan says "reuse one predicate across N sites", have a verifier confirm the sites are shape-compatible (a reusable Q composes into .filter/.exists/reverse joins; a ready-made queryset often doesn't). Getting this wrong is the classic authz-drift bug.
  • get_queryset must match object-permission — for data-scope, the list filter and the object-level check must use the same definition, or "list shows it but the object 404s".
  • Behavior changes are decisions, not side effects — if the cross-check reveals the plan fixes a latent bug (e.g. an inactive/expired row that currently still grants access), name it explicitly and get the human to accept the access change.
  • Reverse relations are where sites hide — grep related_name and __ lookups, not just the model class name.
  • Cross the result back before coding — the plan may change materially; the human approves the revised plan.

Relation to other skills

  • create-plan produces the plan; plan-crosscheck stress-tests it; implement-plan executes the approved, revised plan (with test-driven-development).
  • verification-gate verifies finished work; this verifies the plan.
  • Pair with software-engineering / ponytail (don't cross-check speculative over-engineering into existence — cut it first, then verify what remains).

04 同仓库更多 Skills

matheusnorjosa
matheusnorjosa/aprender_sistema

技术文档写作规范

writing-standards

遵循 AS v2 技术写作规范(清晰、简洁、主动语态、Python/Django 惯例)。适用于撰写 README、文档字符串(PEP 257)、提交信息、PR 描述、错误信息或任何技术文档。

技术文档工程师技术文档编写
★ 0
matheusnorjosa
matheusnorjosa/aprender_sistema

成果验证关卡

verification-gate

在宣称成功之前先进行验证。适用于准备表示某功能可用/已完成、实现功能后、修复缺陷后,或推送代码前——先运行验证命令并确认输出。

测试工程师成果验证与价值评估
★ 0
matheusnorjosa
matheusnorjosa/aprender_sistema

测试驱动开发

test-driven-development

在 AS v2(pytest + Django/DRF)中先编写失败的测试,再进行实现。适用于实现功能或修复缺陷时,在编写任何生产代码之前使用。

测试工程师测试与质量保障
★ 0
matheusnorjosa
matheusnorjosa/aprender_sistema

子智能体编排开发

subagent-development

在 AS v2 中编排子智能体——将任务拆解为相互独立的领域,并行处理并进行两阶段审查。适用于委派探索、实现或跨文件验证,以加快工作进度并节省主上下文。

AI 工程师编码任务委派
★ 0
matheusnorjosa
matheusnorjosa/aprender_sistema

自动化安全扫描

security-scan

为 AS v2 提供自动化安全扫描。在提交前或审查变更中的漏洞时使用。执行依赖审计(pip-audit、npm audit)、密钥检测(grep 模式)和代码模式扫描(SQL 注入、XSS、eval、pickle、硬编码密钥)。与项目 hooks 系统集成。

安全工程师安全检测工程
★ 0
matheusnorjosa
matheusnorjosa/aprender_sistema

交接文档恢复工作

resume-handoff

从保存的交接文档恢复工作,在继续之前先根据当前代码库验证其状态。适用于上下文清空后或在新会话中(通过路径、会话名称或 GitHub issue)从保存的交接文档恢复工作。

软件开发工程师会话上下文交接
★ 0