/alibabacloud-spec-ops:alibabacloud-validatefrom alibabacloud-spec-ops
Validates generated Terraform code against design requirements and quality standards by dispatching parallel subagent reviews for spec compliance and code quality.
Ships in alibabacloud-spec-ops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
AUTHORITATIVE GUIDANCE — MANDATORY COMPLIANCE
This skill performs dual review: requirement compliance AND code quality. Both reviews MUST be dispatched as independent subagents running in parallel.
Remote Terraform syntax validation (
aliyun iacservice validate-module) is owned byalibabacloud-terraform-codegenStep 6 — by the time control reaches this skill, syntax has already passed remotely. Do NOT re-invokeiacservice validate-modulehere.
PREREQUISITE CHECK (internal — do not expose these checks to user)
Before proceeding, verify:
tasks/status.jsonexists withstatus: "plans-written"designs/terraform/contains generated .tf filesIf missing, STOP and inform the user that code generation needs to complete first.
Activate when:
tasks/status.json for "mode" field to determine validation depthAgent tool in parallelRead tasks/status.json and check the "mode" field:
| Mode | Validation Depth | Stages |
|---|---|---|
"fast-track" | None — trust codegen | Skip both reviews; transition straight to validated |
"full" or absent | Spec compliance + code quality | Stage 1 + Stage 2 (parallel subagents) |
If mode is "fast-track", skip both Stage 1 and Stage 2. Syntax has
already been validated remotely by terraform-codegen Step 6, and the
simplified design opts out of deeper review. The action sequence is:
tasks/status.json to status: "validated"No iacservice call is required here — the validation contract was satisfied in code generation.
CRITICAL: You MUST dispatch BOTH reviewers as independent subagents using the Agent tool in a SINGLE message (parallel execution). Do NOT perform the reviews yourself — delegate to specialized agents.
Use the Agent tool with subagent_type to dispatch both reviews simultaneously:
# In a SINGLE message, make TWO Agent tool calls:
Agent call 1 - Spec Compliance Review:
subagent_type: "alibabacloud-spec-ops:spec-reviewer"
description: "Spec compliance review"
prompt: |
Review the following Terraform code against the design specification.
## Design Document (design.md):
{paste full content of .aliyun-ai-ops-spec/{name}/designs/design.md}
## Terraform Files:
{paste full content of each .tf file}
Follow your review checklist and produce the structured output format.
Return PASS or FAIL with the coverage matrix and issues list.
Agent call 2 - Code Quality Review:
subagent_type: "alibabacloud-spec-ops:code-quality-reviewer"
description: "Code quality review"
prompt: |
Review the following Terraform code for quality, security, and best practices.
## Terraform Files:
{paste full content of each .tf file}
Follow your review checklist and produce the structured output format.
Return PASS or FAIL with categorized issues list.
Key points:
After both subagents complete:
Do NOT call
aliyun iacservice validate-modulehere. Remote syntax was validated byalibabacloud-terraform-codegenStep 6 before this skill ran. Re-running it would be duplicate work and waste an IaC Service quota slot.
Write to .aliyun-ai-ops-spec/{name}/tasks/validation-report.md:
# Validation Report - {Requirement Name}
## Timestamp
{ISO timestamp}
## Stage 1: Spec Compliance (Subagent: spec-reviewer)
- Status: PASS/FAIL
- Issues found: {count}
- Details: {full output from spec-reviewer subagent}
## Stage 2: Code Quality (Subagent: code-quality-reviewer)
- Status: PASS/FAIL
- Issues found: {count}
- Details: {full output from code-quality-reviewer subagent}
## Remote Syntax (handled upstream)
- Validated by: alibabacloud-terraform-codegen Step 6 (iacservice validate-module)
- Status at codegen: PASS (precondition — code generation does not hand
off to this skill unless validate-module succeeded)
## Final Result
- Overall: PASS/FAIL
- Both review stages must PASS to proceed to execution
tasks/status.json to status: "validated" — do NOT mention this to the userTodoWrite: mark "双轨评审:spec compliance + code quality" → completed. (Leave "部署执行" as pending — only the user can promote it to in_progress by confirming.)"Validation complete — all checks passed.
- Spec compliance: ✅
- Code quality: ✅
- Remote syntax: ✅ (validated upstream by terraform-codegen)
下一步:要现在进入部署吗?
部署会通过 IaC Service 远程自动执行
terraform plan与apply——回复一次 "部署" 即授权整条链路完成,真正在云上创建资源并产生费用。我会把 plan 结果展示给你,但不会再停下来二次确认;如果 plan 出现非预期的破坏性变更(例如 Day-2 中要 destroy 资源),我会主动停下来询问。回复 "部署" / "yes" → 进入
alibabacloud-spec-ops:alibabacloud-executing-plans,自动完成 plan + apply。 想再调整代码或暂停?直接告诉我,或随时打断我(Esc / 中止当前消息)。"
TodoWrite: mark "部署执行:terraform plan/apply via IaC Service" → in_progressalibabacloud-spec-ops:alibabacloud-executing-plansIMPORTANT: Do NOT automatically invoke executing-plans without explicit user confirmation. The previous step in the workflow (writing-plans → validate) is read-only and auto-chains; this step is where the workflow stops to ask, by design.
Using independent subagents for review provides:
terraform-codegen Step 6 result; do NOT re-call iacservice validate-moduleWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aliyun/alibabacloud-agent-toolkit --plugin alibabacloud-spec-ops6 skills in this plugin
/alibabacloud-executing-plansExecute validated Terraform plans via Alibaba Cloud IaC Service. Requires explicit user confirmation before any apply operation. WHEN: execute terraform, apply infrastructure, run terraform apply, deploy infrastructure, create cloud resources, execute plan./alibabacloud-planningAct as an Alibaba Cloud expert to help users clarify requirements, design architecture, and plan infrastructure operations. Supports both Day-1 creation and Day-2 modification (scale, expand, adjust). WHEN: user mentions ECS, RDS, VPC, OSS, SLB, ACK, cloud resources, infrastructure needs, deploy on Alibaba Cloud, create server, setup database, cloud architecture, security group, scaling, load balancer, modify resources, upgrade instance, expand capacity, or any Alibaba Cloud service requirement./alibabacloud-ram-permission-diagnoseAlibaba Cloud RAM permission diagnosis and repair assistant. When an agent encounters any permission-related error while operating Alibaba Cloud resources (403, NoPermission, Forbidden, AccessDenied, InvalidSecurityToken, etc.), or when the user describes an Alibaba Cloud RAM permission issue, use this skill immediately. Do not wait for the user to explicitly request it — proactively start the diagnostic process whenever a permission error appears. Also applies when: a developer encounters permission issues while writing Alibaba Cloud SDK code, the user asks how to configure minimum permissions for an operation, or the user wants to know which permissions the current identity is missing.
/alibabacloud-terraform-codegenUse when the user wants Terraform HCL for Alibaba Cloud (Alicloud) infrastructure —
new project or extending an existing one. Covers VPC, ECS, ApsaraDB RDS, OSS,
SLB / ALB, Function Compute v3, ACK, and any other `alicloud_*` resource via the
provider's own documentation fetched at generation time. For AWS → Alicloud
migration or importing existing resources into state, use a different skill.
Triggers: "write terraform for alicloud", "generate alibaba cloud terraform",
"alicloud HCL", "create alibaba cloud vpc/ecs/rds", "生成阿里云 Terraform",
"阿里云 HCL", "用 Terraform 部署阿里云", "alicloud provider", "aliyun/alicloud",
"terraform-provider-alicloud".
/alibabacloud-writing-plansConvert approved infrastructure designs into Terraform HCL code and CLI scripts. Requires alibabacloud:planning to be completed first. WHEN: generate terraform, write HCL, create infrastructure code, convert design to code, write IaC, generate alicloud terraform.Other plugins' skills for the same job