[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74G7ZR02FX4VXDC14Q367ZZ":3,"skill-same:01M74G7ZR02FX4VXDC14Q367ZZ":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M74G7ZR02FX4VXDC14Q367ZZ","plan-review",null,"Read a terraform plan (binary or JSON) and surface destructive actions, drift, and unsafe diffs before apply.","MohammadBafkar\u002Fpolymath","MohammadBafkar","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F34940462?v=4","01M74G540TQFZWK6KVAPKFVGNR","Mohammad Bafkar","01M74G541HG19QP9V5DQCJVKYE",0,"MIT","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-cloud\u002Fskills\u002Fplan-review\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: plan-review\ndescription: Read a terraform plan (binary or JSON) and surface destructive actions, drift, and unsafe diffs before apply.\n---\n\n# plan-review\n\n> A second pair of eyes on a `terraform plan` output. Output is a categorized review: destructive actions, drift, replacements, additions, and a go\u002Fno-go recommendation.\n\n**Mode:** deterministic — same inputs, same output. Follow the steps and the output shape exactly; compute with the named script or tool, never by estimate; add nothing the shape does not ask for.\n\n## When to use\n\n- A PR includes a generated plan artifact (`tfplan.binary` or `tfplan.json`) and a reviewer wants a fast read.\n- Pre-apply, before promoting a plan to prod.\n- After a long-lived branch rebases, to catch drift that crept in.\n\n## Inputs\n\n- Plan file (required) — either `tfplan.binary` (run `terraform show -json tfplan.binary > tfplan.json` first) or `tfplan.json` directly.\n- Workspace \u002F environment label (required) — review tone is stricter for `prod`.\n- Approved change scope (optional) — what the PR claims to change. Anything outside is flagged.\n\n## Procedure\n\n1. **Convert if needed.** If a binary plan is supplied, run `terraform show -json \u003Cplan>` (or `tofu show -json`, or the binary named in the plugin's `terraformBinary` setting) to produce JSON. Do not parse the binary format directly. **The JSON contains sensitive values in plaintext** (`before_sensitive`\u002F`after_sensitive` only *mark* them): never echo those values in your review, and flag a `tfplan.json` uploaded as a public CI artifact or committed to the repo.\n2. **Run the bundled summary — never classify a plan by reading the JSON by eye.** It applies the rules in steps 3–6 mechanically, never prints a value, and states the minimum gate:\n\n   ```bash\n   python3 \"${POLYMATH_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}\u002Fskills\u002Fplan-review\u002Fscripts\u002Fplan-summary.py\" tfplan.json \\\n     --scope 'module.refunds.*'      # one --scope per address glob the PR is approved to change\n   ```\n\n   Paste its block verbatim, then add only what it cannot know (steps 3–6 explain each section). Exit 2 = not a plan JSON.\n3. **Read each classification** (the script's `change.actions` mapping):\n   - `[\"no-op\"]` — unchanged; ignore. `[\"read\"]` — data source read; note only if it's deferred to apply time.\n   - `[\"forget\"]` — removed from state without destroying (a `removed` block); confirm that's intended.\n   - `[\"create\"]` — new resources; flag if outside approved scope.\n   - `[\"update\"]` — in-place change; show before → after for sensitive fields.\n   - `[\"delete\", \"create\"]` or `[\"create\", \"delete\"]` — replacement; almost always destructive (state loss). Read `action_reason` and `replace_paths` to see *which attribute* forced it — often a one-line config fix avoids the replace.\n   - `[\"delete\"]` — destruction; only safe with explicit approval.\n4. **Destructive patterns** the script calls out by resource type — add the human gate for each:\n   - `aws_db_instance`, `aws_rds_cluster`, `google_sql_database_instance`, `azurerm_mssql_database` — replacement triggers backup-required gate.\n   - `aws_s3_bucket`, `google_storage_bucket`, `azurerm_storage_account` — delete triggers data-loss gate (require `force_destroy = false` audit).\n   - `aws_iam_*`, `google_project_iam_*`, `azurerm_role_assignment` — privilege changes deserve their own reviewer; wildcard actions\u002Fresources (`\"*\"`) and new cross-account trust get a dedicated callout.\n   - `*_security_group`, `*_firewall*` — surface opening (0.0.0.0\u002F0 ingress) gets a dedicated callout.\n5. **Drift.** Read the plan JSON's top-level `resource_drift` array — changes Terraform detected during refresh that happened outside Terraform. Report them separately from intended changes; an update in `resource_changes` that merely reverts drift is not part of the PR's intent either.\n6. **Sensitive-field check** (judgment — the script can't see CI logs). Confirm sensitive attributes are marked (`after_sensitive`) and that the CI log shows `(sensitive value)` rather than the value; flag any secret that appears unmasked in plan *output* or in a non-sensitive attribute (e.g. a password in a tag or user_data).\n7. **Provider version pinning.** The script lists providers without a version constraint — they float and re-plan unpredictably.\n8. **Recommend** one of `apply-ok`, `apply-with-approval`, `needs-rework`, `block`. Start from the script's minimum gate; raise it only for a named reason (an out-of-scope create\u002Fupdate, a replacement a one-line config change avoids, an unmasked secret, a missing backup for a stateful replace). Never lower it.\n\n## Output\n\n```text\nplan-review\n\nWorkspace:   prod\nPlan file:   tfplan.json\n\nPlan summary\n  create 4 · update 2 · replace 1 · delete 1 · forget 0 · deferred read 0\n  (terraform's own line: 5 to add, 2 to change, 2 to destroy)\n\nDestructive actions:\n  - aws_db_instance.refund_primary                   REPLACE  forced by: engine_version (replace_because_cannot_update)\n  - aws_s3_bucket.legacy_uploads                     DELETE\n\nStateful resources at risk:\n  - aws_db_instance.refund_primary (aws_db_instance) REPLACE — data-loss gate: snapshot\u002Fbackup + restore path required\n  - aws_s3_bucket.legacy_uploads (aws_s3_bucket) DELETE — data-loss gate: snapshot\u002Fbackup + restore path required\n\nIAM \u002F privilege changes (own reviewer):\n  none\n\nInternet exposure:\n  none\n\nOutside approved scope:\n  - aws_s3_bucket.legacy_uploads delete\n\nDrift (changed outside Terraform — not this PR's intent):\n  - aws_security_group.web update\n\nProviders without a version constraint: none\n\nMinimum gate: block (destructive change outside the approved scope)\n\nReviewer notes\n  - refund_primary: engine upgrade 14 → 15 forces replacement; use an in-place major-version\n    upgrade (allow_major_version_upgrade) instead, or confirm skip_final_snapshot = false + restore runbook.\n  - Sensitive values: masked in the CI plan output; tfplan.json is not uploaded as an artifact.\n\nRecommendation: block\n  Reason: legacy_uploads delete is outside PR scope — split it into a dedicated migration PR.\n```\n\n## Quality bar\n\n- Every destructive action explicitly named (resource type + address + risk + gate).\n- Drift separated from intentional change.\n- Sensitive field handling verified.\n- A single explicit recommendation, not \"looks fine\".\n\n## Anti-patterns to avoid\n\n- Approving a plan by file size or count (\"only 6 changes, should be fine\"). Volume is not risk.\n- Treating a replacement as an update. Replacement = delete + create, with state loss.\n- Skipping the drift section because it \"doesn't change anything in this PR\". Drift is the leading indicator of out-of-band changes that bypass review.\n- Reviewing a binary plan by reading it directly. Always go through `terraform show -json` first.\n- Quoting a sensitive value from the plan JSON in the review.\n","# plan-review\n\n> A second pair of eyes on a `terraform plan` output. Output is a categorized review: destructive actions, drift, replacements, additions, and a go\u002Fno-go recommendation.\n\n**Mode:** deterministic — same inputs, same output. Follow the steps and the output shape exactly; compute with the named script or tool, never by estimate; add nothing the shape does not ask for.\n\n## When to use\n\n- A PR includes a generated plan artifact (`tfplan.binary` or `tfplan.json`) and a reviewer wants a fast read.\n- Pre-apply, before promoting a plan to prod.\n- After a long-lived branch rebases, to catch drift that crept in.\n\n## Inputs\n\n- Plan file (required) — either `tfplan.binary` (run `terraform show -json tfplan.binary > tfplan.json` first) or `tfplan.json` directly.\n- Workspace \u002F environment label (required) — review tone is stricter for `prod`.\n- Approved change scope (optional) — what the PR claims to change. Anything outside is flagged.\n\n## Procedure\n\n1. **Convert if needed.** If a binary plan is supplied, run `terraform show -json \u003Cplan>` (or `tofu show -json`, or the binary named in the plugin's `terraformBinary` setting) to produce JSON. Do not parse the binary format directly. **The JSON contains sensitive values in plaintext** (`before_sensitive`\u002F`after_sensitive` only *mark* them): never echo those values in your review, and flag a `tfplan.json` uploaded as a public CI artifact or committed to the repo.\n2. **Run the bundled summary — never classify a plan by reading the JSON by eye.** It applies the rules in steps 3–6 mechanically, never prints a value, and states the minimum gate:\n\n   ```bash\n   python3 \"${POLYMATH_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}\u002Fskills\u002Fplan-review\u002Fscripts\u002Fplan-summary.py\" tfplan.json \\\n     --scope 'module.refunds.*'      # one --scope per address glob the PR is approved to change\n   ```\n\n   Paste its block verbatim, then add only what it cannot know (steps 3–6 explain each section). Exit 2 = not a plan JSON.\n3. **Read each classification** (the script's `change.actions` mapping):\n   - `[\"no-op\"]` — unchanged; ignore. `[\"read\"]` — data source read; note only if it's deferred to apply time.\n   - `[\"forget\"]` — removed from state without destroying (a `removed` block); confirm that's intended.\n   - `[\"create\"]` — new resources; flag if outside approved scope.\n   - `[\"update\"]` — in-place change; show before → after for sensitive fields.\n   - `[\"delete\", \"create\"]` or `[\"create\", \"delete\"]` — replacement; almost always destructive (state loss). Read `action_reason` and `replace_paths` to see *which attribute* forced it — often a one-line config fix avoids the replace.\n   - `[\"delete\"]` — destruction; only safe with explicit approval.\n4. **Destructive patterns** the script calls out by resource type — add the human gate for each:\n   - `aws_db_instance`, `aws_rds_cluster`, `google_sql_database_instance`, `azurerm_mssql_database` — replacement triggers backup-required gate.\n   - `aws_s3_bucket`, `google_storage_bucket`, `azurerm_storage_account` — delete triggers data-loss gate (require `force_destroy = false` audit).\n   - `aws_iam_*`, `google_project_iam_*`, `azurerm_role_assignment` — privilege changes deserve their own reviewer; wildcard actions\u002Fresources (`\"*\"`) and new cross-account trust get a dedicated callout.\n   - `*_security_group`, `*_firewall*` — surface opening (0.0.0.0\u002F0 ingress) gets a dedicated callout.\n5. **Drift.** Read the plan JSON's top-level `resource_drift` array — changes Terraform detected during refresh that happened outside Terraform. Report them separately from intended changes; an update in `resource_changes` that merely reverts drift is not part of the PR's intent either.\n6. **Sensitive-field check** (judgment — the script can't see CI logs). Confirm sensitive attributes are marked (`after_sensitive`) and that the CI log shows `(sensitive value)` rather than the value; flag any secret that appears unmasked in plan *output* or in a non-sensitive attribute (e.g. a password in a tag or user_data).\n7. **Provider version pinning.** The script lists providers without a version constraint — they float and re-plan unpredictably.\n8. **Recommend** one of `apply-ok`, `apply-with-approval`, `needs-rework`, `block`. Start from the script's minimum gate; raise it only for a named reason (an out-of-scope create\u002Fupdate, a replacement a one-line config change avoids, an unmasked secret, a missing backup for a stateful replace). Never lower it.\n\n## Output\n\n```text\nplan-review\n\nWorkspace:   prod\nPlan file:   tfplan.json\n\nPlan summary\n  create 4 · update 2 · replace 1 · delete 1 · forget 0 · deferred read 0\n  (terraform's own line: 5 to add, 2 to change, 2 to destroy)\n\nDestructive actions:\n  - aws_db_instance.refund_primary                   REPLACE  forced by: engine_version (replace_because_cannot_update)\n  - aws_s3_bucket.legacy_uploads                     DELETE\n\nStateful resources at risk:\n  - aws_db_instance.refund_primary (aws_db_instance) REPLACE — data-loss gate: snapshot\u002Fbackup + restore path required\n  - aws_s3_bucket.legacy_uploads (aws_s3_bucket) DELETE — data-loss gate: snapshot\u002Fbackup + restore path required\n\nIAM \u002F privilege changes (own reviewer):\n  none\n\nInternet exposure:\n  none\n\nOutside approved scope:\n  - aws_s3_bucket.legacy_uploads delete\n\nDrift (changed outside Terraform — not this PR's intent):\n  - aws_security_group.web update\n\nProviders without a version constraint: none\n\nMinimum gate: block (destructive change outside the approved scope)\n\nReviewer notes\n  - refund_primary: engine upgrade 14 → 15 forces replacement; use an in-place major-version\n    upgrade (allow_major_version_upgrade) instead, or confirm skip_final_snapshot = false + restore runbook.\n  - Sensitive values: masked in the CI plan output; tfplan.json is not uploaded as an artifact.\n\nRecommendation: block\n  Reason: legacy_uploads delete is outside PR scope — split it into a dedicated migration PR.\n```\n\n## Quality bar\n\n- Every destructive action explicitly named (resource type + address + risk + gate).\n- Drift separated from intentional change.\n- Sensitive field handling verified.\n- A single explicit recommendation, not \"looks fine\".\n\n## Anti-patterns to avoid\n\n- Approving a plan by file size or count (\"only 6 changes, should be fine\"). Volume is not risk.\n- Treating a replacement as an update. Replacement = delete + create, with state loss.\n- Skipping the drift section because it \"doesn't change anything in this PR\". Drift is the leading indicator of out-of-band changes that bypass review.\n- Reviewing a binary plan by reading it directly. Always go through `terraform show -json` first.\n- Quoting a sensitive value from the plan JSON in the review.\n",{"name":5,"description":7},"main","23f6e21841a39580c9da2b5ec941f39dda17cd86","plugins\u002Fpolymath-cloud\u002Fskills\u002Fplan-review","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath","https:\u002F\u002Fgithub.com\u002FMohammadBafkar","2026-10-29 18:34:59",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add MohammadBafkar\u002Fpolymath --skill plan-review",{"tool":36,"command":37},"bunx","bunx skills add MohammadBafkar\u002Fpolymath --skill plan-review",{"tool":39,"command":40},"pnpm","pnpm dlx skills add MohammadBafkar\u002Fpolymath --skill plan-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-cloud\u002Fskills\u002Fplan-review\u002FSKILL.md",true,[44,50],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"references\u002Fterraform-tools.md","REFERENCE","参考文档",2188,"https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-cloud\u002Fskills\u002Fplan-review\u002Freferences\u002Fterraform-tools.md",{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"scripts\u002Fplan-summary.py","SCRIPT","脚本",7272,"https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-cloud\u002Fskills\u002Fplan-review\u002Fscripts\u002Fplan-summary.py",[57,64,71,78,85,92],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M74GN87EBRHM9N87M7AP1HDD","runbook","Write or refresh an operational runbook for an alert\u002Fsymptom; structured as TL;DR + Pre-checks + Steps + Verification + Rollback + Escalation.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frunbook\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M74GN5GPKEC1JEKP2DFQNEQJ","rfc","Draft a lightweight design RFC to docs\u002Frfcs\u002F\u003Cslug>.md; Summary, Motivation, Detailed design, Drawbacks, Alternatives, Unresolved questions. A proposal to debate, not a recorded decision (adr).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frfc\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M74GN2F4CWPMV4X09TG4E304","editorial-pass","Review and tighten prose in a Markdown artifact for a target tone (terse, formal, friendly) without dropping information; preserve quotations and load-bearing constraints.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Feditorial-pass\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M74GMZWGYMZ37C4DYGT6P23G","architecture-review-facilitation","Run an architecture review as a process — entry criteria, reviewer checklist, decision log, and follow-up actions — pairing the design artifact with a red-team pass.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-review-facilitation\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M74GMXVX0YX3ETDXS527XDGM","architecture-doc","Write a C4-style architecture document; System Context + Containers (+ Components when interesting) with mermaid diagrams. Describes structure, not a decision (adr) or proposal (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-doc\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M74GMVG1WSMCK066S3KE6V5K","adr","Write an Architecture Decision Record (Michael Nygard format) to docs\u002Fadrs\u002FNNNN-\u003Cslug>.md; frontmatter validated by the ADR artifact schema. Records a made decision, not a proposal to debate (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Fadr\u002FSKILL.md",[],[]]