azure-app-onboard-prereq
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAzure App Onboard Prereq — Repository Evaluation
Azure App Onboard 前置检查 — 代码库评估
Evaluate a user's repository for build health, app completeness, and Azure deployment feasibility — before infrastructure planning. Produces per-component verdicts (PASS/WARN/FAIL) consumed by downstream phases.
Orchestrator relationship: Called byat Step 3, or standalone for code readiness checks. When called by orchestrator, return control toazure-app-onboardafter writing artifacts — do NOT invoke downstream phases directly.azure-app-onboard
Phase 1 of 4 in AppOnboard pipeline. Session: . Reads . Writes , , . Produces . Schema: — , . Direct entry supported.
.copilot-azure/sessions/{session-id}/context.jsoncomponents[]repo{}detectedInfra[]prereq-output.jsonprereq-schemas.tsPrereqOutputBuildRequirements评估用户代码库的构建健康度、应用完整性以及Azure部署可行性——此环节需在基础设施规划前完成。会生成各组件的判定结果(PASS/WARN/FAIL),供下游阶段使用。
编排器关联: 由在步骤3调用,也可独立用于代码就绪性检查。当由编排器调用时,生成工件后需将控制权交还给azure-app-onboard——请勿直接调用下游阶段。azure-app-onboard
这是AppOnboard流水线的第1阶段(共4阶段)。会话目录:。读取,写入、、,生成。Schema参考: ——对应、。支持直接启动。
.copilot-azure/sessions/{session-id}/context.jsoncomponents[]repo{}detectedInfra[]prereq-output.jsonprereq-schemas.tsPrereqOutputBuildRequirementsWhen NOT to Use
不适用于以下场景
| Signal | Redirect |
|---|---|
| Validate infrastructure (Bicep/TF/azure.yaml) | azure-validate |
| Generate IaC | azure-prepare |
| End-to-end idea-to-production | azure-app-onboard |
Run | azure-deploy |
| 信号 | 重定向目标 |
|---|---|
| 验证基础设施(Bicep/TF/azure.yaml) | azure-validate |
| 生成基础设施即代码(IaC) | azure-prepare |
| 从想法到生产的端到端流程 | azure-app-onboard |
运行 | azure-deploy |
Rules
规则
⛔ ABSOLUTE PROHIBITION —,npm install,npm test,npx jest, and ALL install/build/test commands are NEVER allowed. Under NO circumstances may you runpytest,npm install,npm test,npx jest,pip install,pytest,dotnet build,dotnet restore,dotnet test,go mod download, or ANY package-manager install, build, or test command during the prereq phase. Do NOT run test suites to verify code — check for test config files statically instead. The prereq phase is read-only evaluation + static-only verification. ONLY exception — two sanctioned contexts, both consent-gated: (a) code the agent modified during migration/remediation (see remediation-protocol.md step 6), or (b) code the agent wrote from scratch on the zero-code path (see zero-code-path.md). In either case, install/build/test runs ONLY via the user-confirmed build-validation gate (build-check.md Step 3), after the user answers that specific per-command consent prompt. General prior consent never counts.cargo build
- ⛔ Full pipeline (Steps 1–8), no exceptions. All prompts → Step 1 directly. Answer specific questions AS PART OF findings (Step 5), not before.
- ⛔ No sub-agents for evaluation. 3-axis evaluation is inline. Exception: zero-code-path scaffolding (Step 2).
- Code/destructive modifications require . Max 3 questions before results. Direct entry: don't repeat orchestrator's intent questions.
ask_user
⛔ 绝对禁止——绝不允许执行、npm install、npm test、npx jest以及所有安装/构建/测试命令。 在任何情况下,前置检查阶段都不得运行pytest、npm install、npm test、npx jest、pip install、pytest、dotnet build、dotnet restore、dotnet test、go mod download或任何包管理器的安装、构建、测试命令。请勿运行测试套件来验证代码——而是静态检查测试配置文件。前置检查阶段仅支持只读评估+纯静态验证。 唯一例外——两种需用户授权的场景: (a) 代理在迁移/修复过程中修改的代码(参考remediation-protocol.md步骤6),或(b) 代理在零代码路径中从头编写的代码(参考zero-code-path.md)。无论哪种情况,仅能在用户确认的构建验证关卡(build-check.md步骤3)后运行安装/构建/测试,且需用户针对特定命令确认授权。通用的预先授权无效。cargo build
- ⛔ 完整流水线(步骤1–8),无例外。 所有提示直接进入步骤1。特定问题需作为检查结果的一部分(步骤5)回答,而非提前回答。
- ⛔ 评估环节不得使用子代理。 三维评估需内联执行。例外情况:零代码路径的脚手架搭建(步骤2)。
- 代码修改或破坏性操作需调用。返回结果前最多可提问3次。直接启动场景:请勿重复编排器已问过的意图问题。
ask_user
MCP Tools
MCP工具
| Tool | Purpose |
|---|---|
| Validate detected stack patterns against Azure best practices |
| Check/install required CLI tools (az, azd, func) |
| 工具 | 用途 |
|---|---|
| 验证检测到的技术栈模式是否符合Azure最佳实践 |
| 检查/安装所需的CLI工具(az、azd、func) |
Workflow
工作流程
Step 1: Session Check
步骤1:会话检查
Orchestrator entry: Session exists — read , proceed to Step 2.
context.jsonDirect entry: Check :
.copilot-azure/sessions/active-session.json- Exists → ⛔ read session-protocol.md for resume/fresh gate. Do NOT proceed until user answers.
- Missing → create session: generate UUID, , write
New-Item -ItemType Directory -Path ".copilot-azure/sessions/{uuid}" -Force+context.jsonviaactive-session.jsontool.create
Then: → merge into . ⛔ Session MUST exist on disk before any scanning.
az account show{id, name, tenantId}context.json.azure编排器启动: 会话已存在——读取,进入步骤2。
context.json直接启动: 检查:
.copilot-azure/sessions/active-session.json- 存在 → ⛔ 阅读session-protocol.md了解恢复/重新开始的规则。获得用户答复前请勿继续。
- 不存在 → 创建会话:生成UUID,执行,通过
New-Item -ItemType Directory -Path ".copilot-azure/sessions/{uuid}" -Force工具写入create和context.json。active-session.json
随后执行 → 将合并到中。 ⛔ 开始扫描前,磁盘上必须存在会话。
az account show{id, name, tenantId}context.json.azureStep 2: Scan Workspace
步骤2:扫描工作区
Scan for project files. Detect components, , , . Classify Terraform providers. Check CLI availability. Stack detection conflicts: user explicit statement wins (write to , mark scan as override); scan-only → confirm with user; multiple stacks → show all and ask (see component-mapping.md); no code → zero-code-path.md.
repo{}detectedInfra[]detectedServices[]context.jsonIf no project files, no Dockerfile, AND no index.html → ⛔ read zero-code-path.md.
⛔ Cloud SDK early gate. Grep for. If functional deps found → read cloud-sdk-migration.md, thenaws-sdk|@aws-sdk|boto3|google-cloud|@google-cloud|firebase: "Redirect to Azure Cloud Migrate" (setask_user) · "Continue evaluation anyway" (finish readiness eval + SDK→Azure mapping, then STOP at Step 8 — no plan until the deps are swapped) · "Cancel".routeToSkill: "azure-cloud-migrate"
扫描项目文件,检测组件、、、。对Terraform提供商进行分类。检查CLI工具是否可用。技术栈检测冲突处理:用户明确说明优先(写入,标记扫描为覆盖);仅扫描结果→需与用户确认;多个技术栈→全部展示并询问(参考component-mapping.md);无代码→参考zero-code-path.md。
repo{}detectedInfra[]detectedServices[]context.json如果无项目文件、无Dockerfile且无index.html → ⛔ 阅读zero-code-path.md。
⛔ 云SDK早期检查关卡。 搜索。如果检测到功能性依赖→阅读cloud-sdk-migration.md,然后调用aws-sdk|@aws-sdk|boto3|google-cloud|@google-cloud|firebase:"重定向至Azure Cloud Migrate"(设置ask_user)· "继续评估"(完成就绪性评估+SDK到Azure的映射,然后在步骤8停止——依赖替换前不生成部署计划)· "取消"。routeToSkill: "azure-cloud-migrate"
Step 3: Per-Component Evaluation
步骤3:组件级评估
| Sub-step | Action | Reference |
|---|---|---|
| 3.1 | Build check | ⛔ You MUST read build-check.md |
| 3.2 | Completeness check | ⛔ You MUST read completeness-check.md |
| 3.3 | Deployability check | ⛔ You MUST read deployability-check.md |
| 3.3a | Component mapping (conditional) | Read component-mapping.md ONLY IF >1 project manifest found (monorepo) |
Populate per component after evaluation. Verdict propagation, tier rules, and f1Viable aggregation are in readiness-gate.md and the individual check references.
buildRequirements| 子步骤 | 操作 | 参考文档 |
|---|---|---|
| 3.1 | 构建检查 | ⛔ 必须阅读build-check.md |
| 3.2 | 完整性检查 | ⛔ 必须阅读completeness-check.md |
| 3.3 | 部署可行性检查 | ⛔ 必须阅读deployability-check.md |
| 3.3a | 组件映射(条件触发) | 仅当检测到多个项目清单(单体仓库)时,阅读component-mapping.md |
评估完成后为每个组件填充。判定结果传播、层级规则以及f1Viable聚合逻辑在readiness-gate.md和各检查环节的参考文档中定义。
buildRequirementsStep 4: Write Artifacts + Readiness Gate
步骤4:写入工件 + 就绪性关卡
⛔ Verify exists on disk. Read readiness-gate.md (verdicts, tiers, batch-then-approve, fast-track) then prereq-artifacts.md (write procedures, schemas).
context.json⛔ 验证磁盘上存在。阅读readiness-gate.md(判定结果、层级、批量审批、快速通道),然后阅读prereq-artifacts.md(写入流程、Schema)。
context.jsonStep 5: Present Findings
步骤5:展示检查结果
Per readiness-gate.md § Present Findings — show verdicts grouped by severity before proceeding.
按照readiness-gate.md § Present Findings的要求——先按严重程度分组展示判定结果,再继续后续操作。
Step 6: Remediation (conditional)
步骤6:修复(条件触发)
⛔ You MUST read remediation-protocol.md IF any ❌ FAIL verdict, 🔧 Recommended Fix, or ⚠️ WARN with exists. Contains remediation loop, static verification, re-eval mandate, post-remediation artifact updates, and the build-validation consent gate. If all verdicts are ✅ PASS or ⚠️ WARN without , skip to Step 7.
fixPhase: "prereq"fixPhase: "prereq"⛔ 如果存在任何❌ FAIL判定、🔧 推荐修复或⚠️ WARN且,必须阅读remediation-protocol.md。文档包含修复循环、静态验证、重新评估要求、修复后工件更新以及构建验证授权关卡。如果所有判定结果均为✅ PASS或⚠️ WARN且无,则跳过此步骤进入步骤7。
fixPhase: "prereq"fixPhase: "prereq"Step 7: Write Final State
步骤7:写入最终状态
completedPhases"prereq"currentPhase: null⛔ Write. RunlastScanCommitand store the full 40-character SHA asgit rev-parse HEAD. Required — staleness guard in Step 1 compares to HEAD on resume to detect changes.context.json.repo.lastScanCommit
completedPhases"prereq"currentPhase: null⛔ 写入。 执行lastScanCommit,将完整的40位SHA值存储为git rev-parse HEAD。此为必填项——步骤1恢复会话时会将其与HEAD对比,以检测代码是否变更。context.json.repo.lastScanCommit
Step 8: Route
步骤8:路由
⛔ Mandatory — do NOT skip this step.
Routing fields: All routing writesandrouteToSkilltorouteReason.context.json
Post-remediation context: If Step 6 ran, lead the routing prompt with: "Remediation complete — {N} issues fixed, your app is now {overallHealth}."
⛔ Evaluate rows top to bottom — first match wins.
| # | Condition | Action |
|---|---|---|
| 1 | | |
| 2 | | Present the cloud-SDK → Azure swap mapping as 🔶 blockers, then |
| 3 | Orchestrator + no | Tell the user: "✅ Your app has been evaluated and is ready — let's plan your Azure deployment." Then invoke |
| 4 | Direct + ready/readyWithCaveats + no Azure infra | |
| 5 | Direct + ready/readyWithCaveats + existing Azure infra | |
| 6 | Direct + blocked | Report blocker summary + "Fix and re-run." |
Severity tiers (🛑🔶❌🔧⚠️✅) are defined in readiness-gate.md.
⛔ 此步骤为必填项——请勿跳过。
路由字段: 所有路由操作需将和routeToSkill写入routeReason。context.json
修复后上下文: 如果执行了步骤6,路由提示需以以下内容开头:"修复完成——已修复{N}个问题,您的应用当前状态为{overallHealth}。"
⛔ 从上到下评估条件——首个匹配项生效。
| # | 条件 | 操作 |
|---|---|---|
| 1 | 已设置 | 调用 |
| 2 | | 将云SDK到Azure的替换映射作为🔶障碍展示,然后调用 |
| 3 | 编排器启动 + 未设置 | 告知用户:"✅ 您的应用已完成评估,准备就绪——接下来我们规划Azure部署方案。" 然后调用 |
| 4 | 直接启动 + 就绪/附带条件就绪 + 无Azure基础设施 | 调用 |
| 5 | 直接启动 + 就绪/附带条件就绪 + 已有Azure基础设施 | 调用 |
| 6 | 直接启动 + 部署受阻 | 报告障碍摘要 + "修复后重新运行。" |
严重程度层级(🛑🔶❌🔧⚠️✅)在readiness-gate.md中定义。
Outputs
输出产物
| Artifact | Location | Consumer |
|---|---|---|
| Session context | | All downstream phases |
| Prereq output | | prepare phase (via |
| Readiness report | | User (offline reference) |
| 工件 | 位置 | 使用者 |
|---|---|---|
| 会话上下文 | | 所有下游阶段 |
| 前置检查输出 | | 准备阶段(通过 |
| 就绪性报告 | | 用户(离线参考) |