From formae-mcp
Use when the user wants to check for infrastructure drift, see what changed out-of-band, or absorb/overwrite out-of-band changes into their IaC codebase
How this skill is triggered — by the user, by Claude, or both
Slash command
/formae-mcp:formae-fix-code-driftThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When absorbing drift, you MUST run a reconcile simulation immediately after editing the PKL file — in the same turn, without asking, without pausing, without reporting success. An absorption is only complete when the simulation confirms no changes required. Telling the user "done" after an edit without simulating is WRONG.
When absorbing drift, you MUST run a reconcile simulation immediately after editing the PKL file — in the same turn, without asking, without pausing, without reporting success. An absorption is only complete when the simulation confirms no changes required. Telling the user "done" after an edit without simulating is WRONG.
Ask the user whether they want to check a specific stack or all stacks. Then call list_changes_since_last_reconcile with the appropriate stack parameter (or omit it for all stacks).
The drift endpoint reports modifications since the last reconcile. However, drift may have already been absorbed into the IaC code without a reconcile having been run since. To distinguish true drift from already-absorbed drift:
list_changes_since_last_reconcile returns modifications, ask the user for the path to their main forma fileapply_forma with mode: reconcile, simulate: true, force: true on that fileOnly present true drift to the user. For already-absorbed drift, mention that those resources were previously absorbed and will clear on the next reconcile.
If no true drift: Report that all stacks are clean — any reported drift has already been absorbed and will clear on the next reconcile.
If true drift is detected: Present the modifications grouped by stack, showing:
AWS::S3::Bucket)update = properties changed, delete = resource was removed outside formae)For each drifted resource (or group of resources), ask the user what action to take:
When the user chooses absorb, you MUST execute all of (a) through (e) in a single uninterrupted sequence:
(a) Call extract_resources with a query matching the drifted resource
(b) Read the existing IaC codebase to understand how the resource is currently defined
(c) Edit the PKL source to match the extracted (actual) state — only change what drifted
(d) In the SAME turn, without pausing: call apply_forma with mode: reconcile, simulate: true, force: true on the main forma file. Then call get_command_status to check the result.
(e) Evaluate the simulation:
For resources the user wants to overwrite:
apply_forma with mode: reconcile, simulate: true, force: true on the main forma fileapply_forma with mode: reconcile, simulate: false, force: trueget_command_status to monitor progress:
sleep 5). Do NOT poll in a tight loop.After handling all drifted resources, re-run the verification from step 2 to confirm all remaining drift has been absorbed. Note that list_changes_since_last_reconcile alone may still report drift for absorbed resources — this is expected and will clear on the next reconcile.
pkl eval to evaluate forma files — ALWAYS use formae eval --output-consumer machine. Forma files use formae-specific extensions that only the formae CLI can resolve, and --output-consumer machine ensures parseable output instead of human-formatted text.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub platform-engineering-labs/formae-marketplace --plugin formae-mcp