9527CODE 技术博客
← 返回博客列表

Analyze Confirm Develop-先分析、再确认、后开发

在修改代码前分析当前仓库、逐项确认需求,获得明确授权后再开发,并遵循现有代码风格完成验证。


name: analyze-confirm-develop description: Analyze an existing codebase and align requirements with the user before implementing any code change. Use this skill automatically for requests that involve understanding a software requirement and then developing, modifying, fixing, refactoring, or extending code. Do not use this skill when the user clearly expresses an intention to skip this workflow, such as asking to make the change directly, avoid analysis or questions, skip confirmation, or start implementation immediately. When active, inspect the user-specified code scope precisely; when no scope is given, search the repository broadly but investigate only relevant code paths. Do not edit code until analysis is complete, questions have been asked one at a time, and the user explicitly authorizes development after alignment.


功能简介

在修改代码前分析当前仓库、逐项确认需求,获得明确授权后再开发,并遵循现有代码风格完成验证。

以上为根据 GitHub 原文整理的中文简介。该 Skill 适用于已有项目的功能开发、修改、修复、重构和扩展;用户明确要求跳过分析、提问或确认时,可以退出这套流程。

快速安装

以下命令来自仓库 README。

通用安装:

npx skills add https://github.com/zxyyang/analyze-confirm-develop --skill analyze-confirm-develop

为 Codex 全局安装:

npx skills add https://github.com/zxyyang/analyze-confirm-develop --skill analyze-confirm-develop --agent codex --global

选择适合的安装方式即可,无需重复执行。这里仅展示原仓库命令,本次生成文件没有执行安装。

工作方式与适用环境

根据仓库 README 整理:

  • 先阅读仓库约定并分析当前分支,优先核对用户指定的代码范围。
  • 没有明确范围时,先搜索相关入口,再深入检查与需求有关的代码。
  • 说明现状、需求理解、拟改方案、影响与风险,再逐个提出待确认问题。
  • 每次只问一个问题,并显示提问进度;需求对齐后,等待明确的开发指令。
  • 开发与验证遵循当前仓库的架构、命名、错误处理和测试习惯。
  • 使用开放的 Agent Skills 格式,可通过 skills CLI 安装到 Codex、Claude Code、Cursor 等受支持的工具。

以下保留完整 Skill 指令正文。

Analyze, Confirm, Develop

Use a gated workflow for code changes so implementation is based on the current repository rather than assumptions. Treat analysis and development as separate phases.

Core rules

  • Apply this workflow by default to requests that combine a software requirement with code development, modification, bug fixing, refactoring, or extension.
  • Respect an explicit opt-out. If the user clearly intends to skip this workflow, do not activate or continue it; handle the request through the normal direct-development process.
  • Analyze the current branch before proposing an implementation. Repository evidence takes precedence over generic assumptions.
  • Keep the analysis phase read-only. Do not edit files, generate code into the repository, run formatters that rewrite files, install dependencies, create commits, or perform other mutations.
  • Ask exactly one question per user-facing response. Never combine multiple questions into one message or hide extra questions in bullets.
  • Do not begin development until the user explicitly authorizes it after analysis and requirement alignment.
  • Match the conventions, architecture, naming, error handling, testing patterns, and dependency choices already used by the current branch.

Phase 1: Establish scope

  1. Detect whether the user has opted out before applying the gate. Treat phrases such as 直接做, 不要分析,直接改, 无需提问, 跳过确认, or 马上开始开发 as examples of intent, not as an exhaustive keyword list. Consider the whole request and require the opt-out to be clear; ordinary requests such as 帮我实现 or 修一下 do not opt out by themselves.
  2. If the user opts out, stop following this skill and proceed directly under the normal coding instructions. Do not display this skill's analysis report, question progress heading, or post-alignment authorization prompt.
  3. Otherwise, read repository instructions such as AGENTS.md and inspect the current branch and worktree state.
  4. Extract the requested behavior, constraints, acceptance signals, and any code scope named by the user.
  5. If the user specifies files, directories, modules, services, commits, or another code boundary, inspect that boundary precisely. Follow dependencies outside it only when required to understand behavior, and explain why they matter.
  6. If no code scope is specified, search across the repository for relevant symbols, routes, tests, configuration, and call sites. Deeply inspect only the files and execution paths directly related to the request.
  7. Preserve unrelated user changes. Do not assume a dirty worktree belongs to this task.

Phase 2: Analyze the current code

Build an evidence-based understanding of:

  • the current behavior and execution path;
  • the relevant entry points, data flow, interfaces, and dependencies;
  • existing patterns that the implementation should follow;
  • tests and validation mechanisms already present;
  • likely change points, affected consumers, compatibility concerns, and material risks;
  • gaps between the current behavior and the requested behavior.

Do not invent missing facts. Convert uncertainties that affect behavior or implementation into user questions. Avoid asking about facts that can be discovered safely from the repository.

Phase 3: Report before questioning

After the initial code analysis, give a concise report before the first question. Include only sections supported by evidence:

## 分析结果

- 现状:...
- 需求理解:...
- 拟改方案:...
- 影响范围:...
- 风险与注意事项:...

Reference relevant files and symbols when useful. Clearly distinguish confirmed facts from a proposed interpretation.

Phase 4: Ask one question at a time

Determine the number of unresolved questions after analysis. Include the final development-authorization question in the total. If there are no substantive uncertainties, the total is 1, consisting only of the authorization question.

Use this exact heading for every question:

[问题简述] 提问进度:1/总数

问题正文

For example:

[失败处理] 提问进度:2/5

第三方接口超时后,应直接返回失败,还是沿用当前模块的三次重试策略?

Questioning rules:

  • Ask the highest-impact unresolved question first.
  • Keep the question focused and answerable. Offer options only when they help clarify a real tradeoff.
  • Incorporate each answer into the working understanding and ask the next question in the following response.
  • Do not repeat questions already answered by the user or the code.
  • If an answer creates additional unresolved questions, update the displayed total directly. Do not explain why the total changed.
  • Keep the numerator tied to the current sequence and display the current total on every question.
  • When useful, briefly state the newly confirmed understanding before the next single question, without adding another question.

Phase 5: Obtain explicit development authorization

After all substantive questions are resolved:

  1. Restate the confirmed requirement, implementation approach, affected scope, and planned verification concisely.
  2. Ask the final, single authorization question using the same progress heading:
[开始开发] 提问进度:总数/总数

需求和方案已对齐。请明确回复“开发”或“开始开发”,我再开始修改代码。是否开始开发?

Only a clear post-alignment instruction such as 开发, 开始开发, 按方案开发, or another unambiguous command to implement grants authorization.

Responses such as 可以, 好的, 没问题, 确认, 同意, or 继续 do not grant authorization. If the reply is not explicit, remain read-only and repeat the authorization question. A normal implementation request in the user's original message does not bypass this post-alignment gate; a clear opt-out detected before activation does, because this skill should not be used for that request.

If the user clearly opts out while the workflow is already active, stop using the workflow and proceed directly with development. The opt-out is itself explicit permission to skip the remaining analysis and confirmation gate.

If the user asks for more analysis or changes the requirement instead of authorizing development, return to the appropriate analysis or questioning step.

Phase 6: Develop

After explicit authorization:

  1. Recheck the relevant worktree state before editing.
  2. Implement only the confirmed scope.
  3. Follow the current branch's established code style and architectural patterns.
  4. Add or update focused tests when the repository supports them.
  5. Run proportionate validation: targeted tests first, then broader checks when justified.
  6. Report the implemented behavior, key files changed, and verification results. State any validation that could not be run.

Do not ask routine implementation questions that the repository already answers. Make small, reversible decisions consistent with existing code when they do not change the confirmed behavior.

Material discoveries during development

Pause development when a newly discovered fact would materially change the confirmed behavior, public contract, data model, architecture, security posture, migration strategy, or affected scope.

When pausing:

  1. Stop further edits and preserve unrelated work.
  2. Explain the discovery and its impact with repository evidence.
  3. Recalculate the remaining question total directly and resume the one-question-at-a-time format.
  4. After realignment, require explicit development authorization again before continuing.

Ordinary implementation details that remain inside the confirmed plan do not require another approval cycle.

Completion standard

The task is complete only when the confirmed behavior is implemented, relevant validation has run successfully or limitations are disclosed, and the final report accurately reflects the files and behavior changed.

许可与来源

作者:zxyyang。原仓库采用 MIT License,保留版权与许可声明如下。

MIT License

Copyright (c) 2026 zxyyang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

在 GitHub 查看原文

查看更多详情

原文作者:zxyyang

来源网站:GitHub