ai-sdlc-approvals-sandbox
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseai-sdlc-approvals-sandbox: Approvals And Sandbox
ai-sdlc-approvals-sandbox:审批与沙箱
Internal AI SDLC skill, not client-facing by default. Every rule below is important to follow. None of it can be skipped. Before producing the final artifact, confirm required inputs, target audience, missing facts, output format, and constraints when they are unclear. Do not invent missing information. Ask concise clarification questions when required inputs are absent.
内部AI SDLC技能,默认不面向客户。 以下每条规则都必须遵守,不可跳过任何一条。 在生成最终产物前,若输入信息、目标受众、缺失事实、输出格式及约束条件不明确,需先进行确认。 不得编造缺失信息。当必要输入缺失时,需提出简洁的澄清问题。
0. Skill Card
0. 技能卡片
- Skill name:
ai-sdlc-approvals-sandbox - Primary audience: Dev
- Supporting audience: QA
- Audience tags: Dev, QA
- SDLC stage: Sandbox escalation decision
- Purpose: Decide, request, and report sandbox escalation for AI SDLC commands only when the sandbox blocks a required action or the task explicitly requires approved external access.
- Output: Sandbox escalation decision record with prefix_rule guidance and residual risk
- 技能名称:
ai-sdlc-approvals-sandbox - 主要受众:开发人员(Dev)
- 支持受众:测试人员(QA)
- 受众标签:Dev、QA
- SDLC阶段:沙箱升级决策
- 用途:仅当沙箱阻止必要操作或任务明确要求已获批的外部访问时,针对AI SDLC命令决定、请求并报告沙箱权限升级。
- 输出:包含prefix_rule指导和剩余风险的沙箱升级决策记录
0.1 Required Inputs
0.1 必要输入
- Exact command that failed or requires external access.
- Task reason for the command.
- Sandbox error, expected restriction, and risk profile.
- 执行失败或需要外部访问的具体命令。
- 执行该命令的任务原因。
- 沙箱错误信息、预期限制及风险概况。
0.2 Clarification Rules
0.2 澄清规则
- Ask concise questions before finalizing when role, artifact, requirements, scope, audience, or constraints are unclear.
- If optional information is missing, mark it as ,
TBD, orNot providedinstead of inventing it.Assumption - Separate confirmed facts from assumptions and open questions.
- Do not proceed to downstream synthesis when a required upstream artifact or decision is missing.
- 当角色、产物、需求、范围、受众或约束条件不明确时,需先提出简洁问题再最终确定。
- 若可选信息缺失,标记为、
TBD或Not provided,不得编造。Assumption - 将已确认事实与假设、待澄清问题分开。
- 当必要的上游产物或决策缺失时,不得进行下游合成工作。
0.2.1 Flow Mode Flags
0.2.1 流程模式标志
- Support two explicit execution flags: and
--quick-flow.--full-flow - If both flags are supplied, takes precedence because it is the stricter mode.
--full-flow - : move fast, make high-quality progress with available context, avoid clarification questions unless continuing would create material product, security, compliance, data-loss, or irreversible implementation risk.
--quick-flow - In , use documented assumptions, recommended defaults, existing repository patterns, and the nearest available artifact evidence; record important assumptions and decisions in
--quick-flow.decision-log.md - In , run only focused checks that are directly relevant, cheap, and likely to catch regressions for the requested work; report any skipped broader checks as residual risk.
--quick-flow - : ask concise clarification questions when inputs, scope, ownership, acceptance criteria, or decisions are unclear; do not silently assume material requirements.
--full-flow - In , verify upstream and downstream artifacts, decision-log entries, traceability links, acceptance criteria, and validation evidence before finalizing.
--full-flow - In , run or recommend the skill-appropriate gates, reviews, scripts, and validation commands needed for end-to-end confidence; document any blocked verification explicitly.
--full-flow - When neither flag is supplied, follow the skill default rules and choose the least risky behavior for the request size and domain.
- 支持两种明确的执行标志:和
--quick-flow。--full-flow - 若同时提供两个标志,优先,因为它是更严格的模式。
--full-flow - :快速推进,利用现有上下文高效开展工作;除非继续执行会造成产品、安全、合规、数据丢失或不可逆的实施风险,否则避免提出澄清问题。
--quick-flow - 在模式下,使用已记录的假设、推荐默认值、现有仓库模式及最近可用的产物证据;将重要假设和决策记录在
--quick-flow中。decision-log.md - 在模式下,仅运行与请求工作直接相关、成本低且可能发现回归问题的针对性检查;将所有跳过的全面检查作为剩余风险进行报告。
--quick-flow - :当输入、范围、所有权、验收标准或决策不明确时,提出简洁的澄清问题;不得默认重要需求。
--full-flow - 在模式下,最终确定前需验证上下游产物、决策日志条目、可追溯链接、验收标准及验证证据。
--full-flow - 在模式下,运行或推荐技能对应的必要关卡、评审、脚本及验证命令,以确保端到端可信度;明确记录任何受阻的验证工作。
--full-flow - 若未提供任何标志,遵循技能默认规则,根据请求规模和领域选择风险最低的行为。
0.3 Output Rules
0.3 输出规则
- Keep output structured with headings and bullets.
- Make findings, gaps, risks, and blockers explicit.
- Tie recommendations to evidence from the provided artifact, repository, workspace, or user context.
specs-refiniment/<feature-name>/<file.md> - Include role ownership when the output creates follow-up work for BA, QA, Dev, PM, or Delivery.
- Return progress, completion, validation, and handoff summaries directly in the Codex response.
- Before the final response, emit the contract with
ai-sdlc-handoff/v1,result,blockers, andnext_required; every action includesnext_optional,reason, andcommand.expected_artifact - Do not create ,
summary.txt, or another standalone summary file unless the user explicitly requests one.*-summary.txt - Keep durable writes limited to the canonical lifecycle artifacts, decision log, human-readable index, and machine files.
_ai_sdlc - Let shared helpers migrate legacy paths on the next write; never overwrite or manually merge divergent legacy and canonical files.
- 输出需使用标题和项目符号保持结构化。
- 明确指出发现结果、缺口、风险及阻塞点。
- 建议需与提供的产物、仓库、工作区或用户上下文的证据相关联。
specs-refiniment/<feature-name>/<file.md> - 若输出为BA、QA、Dev、PM或交付团队产生后续工作,需明确角色归属。
- 直接在Codex响应中返回进度、完成情况、验证及交接摘要。
- 在最终响应前,输出包含、
result、blockers和next_required的next_optional契约;每个操作需包含ai-sdlc-handoff/v1、reason和command。expected_artifact - 除非用户明确要求,否则不得创建、
summary.txt或其他独立摘要文件。*-summary.txt - 持久化写入仅限制在标准生命周期产物、决策日志、人类可读索引及机器文件中。
_ai_sdlc - 让共享助手在下次写入时迁移旧路径;不得覆盖或手动合并不一致的旧文件与标准文件。
0.4 Artifact Routing
0.4 产物路由
-
Maintain a feature decision log whenever this skill records, resolves, changes, or depends on a product, delivery, QA, security, validation, branching, implementation, or rollout decision.
-
For PM, BA, QA, Delivery, discovery, planning, refinement, and readiness work, write decisions to.
specs-refiniment/<feature-name>/decision-log.md -
For developer implementation SDD work, write decisions to.
specs/<feature-name>/decision-log.md -
Each decision-log entry must include date, decision, context or evidence, options considered when relevant, owner, status, and links to affected artifacts, tasks, tests, or validation evidence.
-
Use this exact decision-log structure:markdown
# Decision Log | ID | Date | Status | Owner | Decision | Context/Evidence | Options Considered | Affected Artifacts | Validation/Trace Links | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | DEC-001 | YYYY-MM-DD | proposed / accepted / superseded / rejected | role or name | concise decision | source facts, artifact links, or evidence | option A; option B; recommended default | affected docs, tasks, code, tests, or rollout notes | requirement IDs, test IDs, validation commands, PRs, commits, or tickets | -
Useonly for developer implementation SDD packages and repo-governance artifacts.
specs/ -
Do not place PM, BA, QA, Delivery, discovery, planning, refinement, or readiness outputs in; those belong at
specs/.specs-refiniment/<feature-name>/<file.md> -
When consuming, treat it as upstream refinement context and create or update
specs-refiniment/<feature-name>/<file.md>only when implementation work is explicitly in scope.specs/
-
每当该技能记录、解决、变更或依赖于产品、交付、QA、安全、验证、分支、实施或发布决策时,需维护功能决策日志。
-
针对PM、BA、QA、交付、探索、规划、细化及准备工作,将决策写入。
specs-refiniment/<feature-name>/decision-log.md -
针对开发人员实施SDD工作,将决策写入。
specs/<feature-name>/decision-log.md -
每个决策日志条目必须包含日期、决策内容、上下文或证据、相关备选方案(如有)、负责人、状态及关联产物、任务、测试或验证证据的链接。
-
使用以下精确的决策日志结构:markdown
# Decision Log | ID | Date | Status | Owner | Decision | Context/Evidence | Options Considered | Affected Artifacts | Validation/Trace Links | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | DEC-001 | YYYY-MM-DD | proposed / accepted / superseded / rejected | role or name | concise decision | source facts, artifact links, or evidence | option A; option B; recommended default | affected docs, tasks, code, tests, or rollout notes | requirement IDs, test IDs, validation commands, PRs, commits, or tickets | -
仅用于开发人员实施SDD包及仓库治理产物。
specs/ -
不得将PM、BA、QA、交付、探索、规划、细化或准备工作的输出放入;这些内容应放在
specs/。specs-refiniment/<feature-name>/<file.md> -
当使用时,将其视为上游细化上下文;仅当实施工作明确在范围内时,才创建或更新
specs-refiniment/<feature-name>/<file.md>中的内容。specs/
0.5 Feature State Machine
0.5 功能状态机
- Maintain feature lifecycle state in TOON at for refinement work and
specs-refiniment/<feature-name>/_ai_sdlc/state.toonfor implementation work.specs/<feature-name>/_ai_sdlc/state.toon - Before executing this skill for a feature, check the state machine with .
python3 skills/_shared/state_machine.py check --feature <feature-name> --skill <this-skill-name> --workspace <refinement|implementation> --quick-flow|--full-flow - When this skill starts durable work, mark it in progress with ; when the skill's required artifact or review is complete, mark it done with
beginand includecompleteplus--artifacts <path>when a decision was involved.--decision-ref DEC-### - In , do not proceed when predecessor stages are incomplete, another lifecycle skill is active, or the state file reports a blocker.
--full-flow - In , a predecessor skip is allowed only when continuing is low risk and the command includes
--quick-flowor--assumption "..."; record the same assumption or decision in--decision-ref DEC-###.decision-log.md - Use to emit compact LLM-readable state before choosing the next skill.
python3 skills/_shared/state_machine.py status --feature <feature-name> --workspace <refinement|implementation> --format toon - The state machine is feature-scoped: do not reuse a across unrelated feature folders.
state.toon
- 在TOON中维护功能生命周期状态:细化工作对应,实施工作对应
specs-refiniment/<feature-name>/_ai_sdlc/state.toon。specs/<feature-name>/_ai_sdlc/state.toon - 针对某功能执行该技能前,使用检查状态机。
python3 skills/_shared/state_machine.py check --feature <feature-name> --skill <this-skill-name> --workspace <refinement|implementation> --quick-flow|--full-flow - 当该技能开始持久化工作时,用标记为进行中;当技能的必要产物或评审完成时,用
begin标记为已完成,若涉及决策需添加complete和--artifacts <path>。--decision-ref DEC-### - 在模式下,当前置阶段未完成、另一个生命周期技能处于激活状态或状态文件报告阻塞时,不得继续执行。
--full-flow - 在模式下,仅当继续执行风险低且命令包含
--quick-flow或--assumption "..."时,才允许跳过前置阶段;需在--decision-ref DEC-###中记录相同的假设或决策。decision-log.md - 使用输出紧凑的LLM可读状态,再选择下一个技能。
python3 skills/_shared/state_machine.py status --feature <feature-name> --workspace <refinement|implementation> --format toon - 状态机以功能为范围:不得在无关功能文件夹间复用。
state.toon
0.6 Artifact Metadata And Metatags
0.6 产物元数据与元标签
- Every Markdown artifact generated or updated by this skill must start with an YAML frontmatter block before the first visible heading.
artifact_metadata - Use schema and keep these fields current:
ai-sdlc-artifact-metadata/v1,feature,artifact,path,workspace,skill,flow_mode,state_file,decision_log,status,owner,created_at,updated_at,trace_ids,related_artifacts, andvalidation.metatags - must include at minimum
metatags, the workspace (ai-sdlcorrefinement), this skill name, the artifact type or filename stem, and a lifecycle/status tag such asimplementation,draft,review, orapproved.validated - When is active, set
--quick-flow, keep assumptions visible in the body, and add tags for major defaults or unresolved risk only when they help retrieval.flow_mode: quick - When is active, set
--full-flow, keep blockers and validation evidence reflected inflow_mode: full,status,validation, andtrace_ids.related_artifacts - Update metadata whenever the artifact path, status, owner, trace links, validation evidence, related artifacts, or decision references change.
- Metadata is an index for routing, retrieval, and traceability; it does not replace the artifact body, , or
decision-log.md.state.toon
- 该技能生成或更新的每个Markdown产物,必须在第一个可见标题前包含YAML前置块。
artifact_metadata - 使用schema,并保持以下字段最新:
ai-sdlc-artifact-metadata/v1、feature、artifact、path、workspace、skill、flow_mode、state_file、decision_log、status、owner、created_at、updated_at、trace_ids、related_artifacts和validation。metatags - 至少需包含
metatags、工作区(ai-sdlc或refinement)、该技能名称、产物类型或文件名主干,以及生命周期/状态标签(如implementation、draft、review或approved)。validated - 当激活时,设置
--quick-flow,在正文中显示假设,仅当有助于检索时才添加主要默认值或未解决风险的标签。flow_mode: quick - 当激活时,设置
--full-flow,在flow_mode: full、status、validation和trace_ids中反映阻塞点和验证证据。related_artifacts - 当产物路径、状态、负责人、追溯链接、验证证据、关联产物或决策引用变更时,需更新元数据。
- 元数据用于路由、检索和可追溯性;不能替代产物正文、或
decision-log.md。state.toon
0.7 Specs Index
0.7 规范索引
- Before searching across feature folders, inspect the compact LLM index first: for refinement work or
specs-refiniment/_ai_sdlc/specs-index.toonfor implementation work.specs/_ai_sdlc/specs-index.toon - Use the human-readable index at or
specs-refiniment/specs-index.mdwhen reporting feature coverage, artifact inventory, or handoff status to people.specs/specs-index.md - After this skill creates or materially updates an artifact, refresh the matching workspace index with .
python3 skills/_shared/ai_sdlc_specs_index.py --workspace <refinement|implementation> --quick-flow|--full-flow - In , rely on
--quick-flowto choose the smallest relevant artifact set before opening files.specs-index.toon - In , verify the updated artifact appears in both
--full-flowandspecs-index.toonbefore final handoff.specs-index.md - The specs index summarizes artifact metadata and state; it does not replace reading the selected source artifacts when details, approvals, or validation evidence matter.
- 在跨功能文件夹搜索前,先查看紧凑的LLM索引:细化工作对应,实施工作对应
specs-refiniment/_ai_sdlc/specs-index.toon。specs/_ai_sdlc/specs-index.toon - 向人员报告功能覆盖范围、产物清单或交接状态时,使用或
specs-refiniment/specs-index.md的人类可读索引。specs/specs-index.md - 该技能创建或大幅更新产物后,使用刷新对应工作区的索引。
python3 skills/_shared/ai_sdlc_specs_index.py --workspace <refinement|implementation> --quick-flow|--full-flow - 在模式下,依赖
--quick-flow选择最小的相关产物集,再打开文件。specs-index.toon - 在模式下,最终交接前需验证更新后的产物是否同时出现在
--full-flow和specs-index.toon中。specs-index.md - 规范索引汇总产物元数据和状态;当细节、审批或验证证据重要时,不能替代读取选定的源产物。
References
参考资料
- Use when deterministic validation, planning, or formatting is required by the workflow; pass the same
scripts/approval_plan.pyor--quick-flowflag that was supplied to the skill when supported.--full-flow
- 当工作流需要确定性验证、规划或格式化时,使用;若支持,需传入与技能相同的
scripts/approval_plan.py或--quick-flow标志。--full-flow
Script Usage
脚本用法
- Validate approval requests before asking for escalation or recording an approval decision.
- Quick flow:
python3 skills/ai-sdlc-approvals-sandbox/scripts/approval_plan.py --quick-flow --command "<command>" --justification "<user-facing question?>" - Full flow:
python3 skills/ai-sdlc-approvals-sandbox/scripts/approval_plan.py --full-flow --command "<command>" --justification "<user-facing question?>" --prefix-rule "<safe reusable prefix>" - Use only when proposing a reusable non-destructive approval prefix; omit it for destructive or one-off commands.
--prefix-rule
- 在请求升级或记录审批决策前,先验证审批请求。
- 快速流程:
python3 skills/ai-sdlc-approvals-sandbox/scripts/approval_plan.py --quick-flow --command "<command>" --justification "<user-facing question?>" - 完整流程:
python3 skills/ai-sdlc-approvals-sandbox/scripts/approval_plan.py --full-flow --command "<command>" --justification "<user-facing question?>" --prefix-rule "<safe reusable prefix>" - 仅当提议可复用的非破坏性审批前缀时,使用;破坏性或一次性命令需省略该参数。
--prefix-rule
Purpose
用途
Decide, request, and report sandbox escalation for AI SDLC commands only when the sandbox blocks a required action or the task explicitly requires approved external access.
仅当沙箱阻止必要操作或任务明确要求已获批的外部访问时,针对AI SDLC命令决定、请求并报告沙箱权限升级。
Inputs
输入
- Collect the exact command that failed or must run outside the sandbox.
- Collect the task reason that makes the command necessary.
- Collect the sandbox error or expected restriction: filesystem, network, listener, GUI, external service, or destructive action.
- Collect whether the command is destructive, secret-bearing, shell-heavy, or reusable.
- Collect an intended narrow only when repeated approval is safe.
prefix_rule
- 收集执行失败或必须在沙箱外运行的具体命令。
- 收集使该命令成为必要的任务原因。
- 收集沙箱错误或预期限制:文件系统、网络、监听器、GUI、外部服务或破坏性操作。
- 收集命令是否具有破坏性、包含机密、大量使用shell或可复用。
- 仅当重复审批安全时,收集预期的窄范围。
prefix_rule
Steps
步骤
-
Run normal reads, workspace writes, local tests, and formatting in the default sandbox first.
-
Classify the command into one segment per shell operator when the command contains pipes, separators, logical operators, or subshells.
-
Request escalation only when a required command is blocked by sandbox restrictions or explicitly needs approved external access.
-
Do not request escalation to bypass SDD, skip validation, avoid fixing a local setup issue, or run unrelated broad commands.
-
Validate the approval plan before asking when time permits:bash
python3 skills/ai-sdlc-approvals-sandbox/scripts/approval_plan.py \ --command 'go test ./internal/service/...' \ --justification 'Allow running focused service tests with the required sandbox permissions?' \ --prefix-rule 'go test ./internal/service/...' -
Phraseas a short user-facing question.
justification -
Provideonly for narrow, reusable, non-destructive command classes.
prefix_rule -
Rerun the command only after approval is granted.
-
Report denied or partial approval and continue with the best safe fallback.
-
先在默认沙箱中执行常规读取、工作区写入、本地测试及格式化操作。
-
若命令包含管道、分隔符、逻辑运算符或子shell,按每个shell运算符将命令分类为不同段。
-
仅当必要命令被沙箱限制阻止或明确需要已获批的外部访问时,请求权限升级。
-
不得为绕过SDD、跳过验证、规避本地设置问题或运行无关的宽泛命令而请求权限升级。
-
若时间允许,在请求前验证审批计划:bash
python3 skills/ai-sdlc-approvals-sandbox/scripts/approval_plan.py \ --command 'go test ./internal/service/...' \ --justification 'Allow running focused service tests with the required sandbox permissions?' \ --prefix-rule 'go test ./internal/service/...' -
将表述为简短的面向用户的问题。
justification -
仅为窄范围、可复用、非破坏性命令类提供。
prefix_rule -
仅在获得审批后重新运行命令。
-
报告被拒绝或部分获批的情况,并采用最佳安全备选方案继续执行。
Output Spec
输出规范
Return this decision record when escalation is requested, denied, or skipped:
text
Sandbox decision:
- Command: exact command
- Required for: task-specific reason
- Sandbox issue: filesystem | network | listener | GUI | external service | destructive | none
- Escalation: requested | not requested | denied | granted
- Prefix rule: proposed rule | none and why
- Result: passed | failed | skipped | blocked
- Residual risk: none | concrete limitationQuality gate:
- Pass when escalation is narrow, justified by the task, and avoids broad reusable approval for dangerous commands.
- Fail when the request uses vague justification, proposes broad interpreter or shell prefixes, includes secrets, or escalates unrelated work.
当请求、拒绝或跳过升级时,返回以下决策记录:
text
Sandbox decision:
- Command: exact command
- Required for: task-specific reason
- Sandbox issue: filesystem | network | listener | GUI | external service | destructive | none
- Escalation: requested | not requested | denied | granted
- Prefix rule: proposed rule | none and why
- Result: passed | failed | skipped | blocked
- Residual risk: none | concrete limitation质量关卡:
- 若升级范围窄、有任务依据且避免为危险命令授予宽泛的可复用审批,则通过。
- 若请求理由模糊、提议宽泛的解释器或shell前缀、包含机密或升级无关工作,则不通过。
Examples
示例
Valid request:
json
{
"sandbox_permissions": "require_escalated",
"justification": "Allow running Go tests with a writable external cache for this package?",
"prefix_rule": ["go", "test", "./internal/service/..."]
}Invalid counter-example:
json
{
"sandbox_permissions": "require_escalated",
"justification": "Need permissions.",
"prefix_rule": ["python3"]
}Reject this because the justification is vague and the prefix allows arbitrary scripts.
有效请求:
json
{
"sandbox_permissions": "require_escalated",
"justification": "Allow running Go tests with a writable external cache for this package?",
"prefix_rule": ["go", "test", "./internal/service/..."]
}无效反例:
json
{
"sandbox_permissions": "require_escalated",
"justification": "Need permissions.",
"prefix_rule": ["python3"]
}拒绝该请求,因为理由模糊且前缀允许执行任意脚本。
Edge Cases
边缘情况
- Skip reusable for destructive commands such as
prefix_rule,rm, force push, or data deletion.git reset - Skip reusable for heredocs, redirection, wildcards, command substitution, environment-heavy one-liners, or shell wrappers.
prefix_rule - Warn immediately and avoid reusing commands when a command contains credentials, bearer tokens, private keys, webhook secrets, or production-only values.
- Treat a missing dependency error as a setup issue first, not an escalation reason, unless the dependency download is required and network is blocked.
- Report partial approval when one command segment is approved but another remains blocked.
- 对于、
rm、强制推送或数据删除等破坏性命令,跳过可复用的git reset。prefix_rule - 对于here文档、重定向、通配符、命令替换、依赖环境的单行命令或shell包装器,跳过可复用的。
prefix_rule - 若命令包含凭据、承载令牌、私钥、webhook机密或仅生产环境可用的值,需立即发出警告并避免复用该命令。
- 首先将缺失依赖的错误视为设置问题,而非升级理由,除非依赖下载是必要操作且网络被阻止。
- 当某命令段获批但另一段仍被阻止时,报告部分获批情况。
Scope Boundary
范围边界
- Do not decide which validation commands are required; use .
$ai-sdlc-validation - Do not approve destructive commands on the user's behalf.
- Do not weaken developer SDD, review, or validation requirements because sandbox permissions are inconvenient.
- Do not replace the active runtime’s higher-priority sandbox and approval policies.
- 不得决定需要哪些验证命令;使用。
$ai-sdlc-validation - 不得代表用户批准破坏性命令。
- 不得因沙箱权限不便而降低开发人员SDD、评审或验证要求。
- 不得替代当前运行时优先级更高的沙箱和审批策略。