skills/formae-import/SKILL.md
Use when the user wants to bring unmanaged/discovered resources under formae management, import resources into their IaC codebase, or absorb cloud resources into existing forma files
npx skillsauth add platform-engineering-labs/formae-mcp formae-importInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Bring discovered (unmanaged) resources under formae management by incorporating them into an existing IaC codebase.
The target codebase is typically the current working directory (the git repo Claude was started from). Confirm with the user:
First call get_agent_stats to get an overview of unmanaged resource counts by provider. Then use targeted list_resources queries with specific type filters (e.g., managed:false type:AWS::S3::Bucket) to drill down. Never call list_resources with just managed:false — on real accounts this returns too much data.
Present a summary of what's available by type and count.
Ask the user which resource(s) they want to import. They may select one, several, or all of a given type.
Call extract_resources with a query that matches the selected resources. This returns the PKL representation of those resources as they exist in the cloud right now.
Read the user's existing forma files to understand:
amends "@formae/forma.pkl" and has the forma {} block), and how helper modules are imported and spread into itvars.pkl), parametrized modules@formae/, @aws/, local importsBefore writing any code, confirm with the user which stack the imported resources should belong to. Suggest the most appropriate stack based on:
CHECKPOINT: Do not proceed until the user confirms the stack.
Use the target from the extracted resource. It's already known from discovery since the agent discovers per-target.
Merge the extracted PKL into the existing codebase following its conventions:
Critical: Resource labels must match exactly. Formae identifies resources by the triplet (stack, type, label). When importing, you MUST use the exact same label as the unmanaged resource has in the agent. If you change the label, formae will see it as a brand new resource to create instead of an existing one to bring under management. Copy the label from the extracted PKL verbatim — do not rename, shorten, or prettify it.
Critical: PKL module composition. New resources must be part of the module tree rooted at the main forma file. There are two approaches:
imported by the main forma file and its resources spread into the forma {} block (e.g., ...importedModule.resources)A standalone PKL file that defines its own stack and target will not work with reconcile mode — it would be treated as a separate stack declaration and cause existing resources to be destroyed.
Additional guidelines:
vars.pkl with shared config, reference it)Run apply_forma with mode: reconcile, simulate: true on the main forma file (not the helper module).
Tell the user you're checking that the import won't cause any unintended changes — only the expected "bring under management" operations for the newly added resources.
Check the simulation result via get_command_status. The stopping criteria are strict:
Loop until the simulation shows only "bring under management" for the imported resources and nothing else, or ask the user for help if stuck.
Once the simulation looks correct:
apply_forma with mode: reconcile, simulate: falseget_command_status and report the resultpkl 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.development
Use when the user wants to set, remove, or inspect a TTL or auto-reconcile policy on a stack — e.g. 'expire X in 20 minutes', 'reject out-of-band changes on Y', 'auto-reconcile production every 5 minutes', 'remove the TTL on dev', 'what policies are on lifeline?'
devops
Use when the user asks about their cloud targets, configured regions, provider accounts, or which cloud accounts are set up
devops
Use when the user asks about running commands, deployment progress, recent operations, command history, or what failed
devops
Use when the user asks about their infrastructure stacks, how infrastructure is organized, or needs a stack overview with resource counts