/formae:formae-policyfrom formae
Sets, removes, or inspects TTL and auto-reconcile policies on formae stacks via natural language, handling inline vs standalone policy placement.
Ships in formae. 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.
None: SKILL.md is the whole skill.
Use this skill to manage formae stack policies via natural language. Two policy types are supported:
TTLPolicy).AutoReconcilePolicy).For mode none, the user-facing plan contains stack names, policy behavior,
duration, affected resources and outcomes. Treat file paths, snippets, anchors
and edits in the steps below as internal authoring details; ask about policy
choices rather than files. Mode codebase retains selected-source reporting.
Pass the chosen profile on every policy planner and agent call. Call get_codebase_context with the actual harness working directory or reuse the selected context. For none, use prepare_authoring to retrieve the complete affected stacks into a fresh ~/.formae-ai/scratch/<operation-id>/ directory, preserving existing policies, targets, references and generators. A maintained project is optional.
Every planner call carries the selected context plus explicit forma_file inside that project or disposable directory, including delete_standalone_policy. Planners return snippets and anchors; the harness edits those files. Scans stay in that one selected root. Always pass that context on later apply/destroy calls. For shared policies affecting multiple stacks, prepare the complete set and review all affected stacks. Never switch global profiles or search the MCP process directory.
Use formae-apply for soft reconcile, drift decisions and the final combined confirmation. Suggest the optional message in that confirmation, allowing edit or clear. Keep disposable source and dependencies until outcome/retry inspection is complete, then remove the directory. Older agents without the required capabilities need a maintained complete source project.
forma { } and referenced from one or more stacks via PolicyResolvable. Use when the same policy governs multiple stacks (e.g. a shared 1-hour ephemeral TTL applied to lifeline, dev, and staging).When the user mentions attaching the same policy to more than one stack, or explicitly says "reusable" or "shared", default to standalone. Otherwise default to inline.
A stack may hold at most one policy per type. It cannot carry both an inline TTL and a standalone TTL. The tools enforce this and will refuse with an error naming the conflict; relay that error and offer to detach or remove the conflicting policy rather than working around it.
onDependents defaults to "abort". Override with "cascade" if the user says "cascade", "destroy dependents too", or similar.interval defaults to 5 minutes (300 seconds) when the user does not specify one.Always state the chosen defaults to the user before applying.
User says something like "expire lifeline in 20 minutes" or "auto-reconcile production every 10 minutes".
20m → 1200, 4h → 14400, 1d → 86400).list_stacks and find a matching label. If no match, present the available labels and ask the user which one they meant.onDependents = "abort" by default) to the lifeline stack."create_inline_policy with operation: "set", the resolved policy_type, and the relevant duration field (ttl_seconds or interval_seconds). The tool returns:
file_path — the PKL file declaring the stack.operation — "create" or "update".pkl_snippet — the text to insert.insertion_anchor_start / insertion_anchor_end — the line range; for create they are equal (insert before that line); for update they cover the existing block (replace those lines).existing_policy_snippet — only for update; use it for the before/after policy comparison, including the source diff in mode codebase.imports_to_add — add each entry near the top of the file if missing.create insert the snippet before the anchor line; for update replace the lines covered by the anchor range. Add any missing imports near the top of the file. Indent the snippet to match the surrounding context (the snippet is emitted unindented).none, describe the policy's before/after behavior; in mode codebase, show the relevant source diff as well.none, abandon the unsubmitted preview and clean up its disposable workspace; do not promise it will apply later. In mode codebase, explain that the local edit remains unapplied.apply_forma with mode: "reconcile", simulate: true, file_path: <returned file_path>.apply_forma with simulate: false. Then poll get_command_status every 5 seconds (with sleep 5); only report state transitions.User says "don't expire lifeline anymore", "stop auto-reconciling production", etc.
Same shape as set, but call create_inline_policy with operation: "remove". The tool returns:
operation: "remove" — apply the deletion at the anchor lines.operation: "noop" — no policy of that type was attached. Tell the user there's nothing to remove and stop.For remove, delete the lines covered by the anchor range. Use existing_policy_snippet to describe the policy being removed; show the source diff only in mode codebase.
If notes mentions "removed empty policies block", retain that source-cleanup detail internally in mode none; explain only the policy removed. In mode codebase, it can accompany the relevant source diff.
User says "create a 1-hour ephemeral policy and attach it to lifeline and dev".
ephemeral-1h, nightly-drift) and confirm it.create_standalone_policy with label, policy_type and the duration field. It returns file_path, pkl_snippet, insertion_anchor_start/_end (equal — insert BEFORE that line, which is the forma block's closing brace), and imports_to_add.
operation: "noop" means a standalone with that label already exists. Say so and stop; updating in place is not supported (delete and recreate).forma_file for the rest of the session.apply_forma with mode: "reconcile", simulate: true on the file carrying the declaration. If attach targets live in other files, simulate each of those too.get_command_status every 5 seconds and report only state transitions.User says "attach ephemeral-1h to staging".
attach_standalone_policy with stack and policy_label. It returns file_path, pkl_snippet, insertion_anchor_start/_end (equal — insert BEFORE that line), imports_to_add, notes.
operation: "noop" means it is already attached. Say so and stop.codebase.apply_forma reconcile, confirm, apply, poll.User says "detach ephemeral-1h from lifeline".
detach_standalone_policy with stack and policy_label. It returns source_anchor_start/_end — the lines to delete — plus existing_resolvable_snippet for the diff.
operation: "noop" means it was not attached. Say so and stop.notes mentions "removed empty policies block", keep that source-cleanup detail internal in mode none; show it with the relevant source diff in mode codebase.codebase.apply_forma reconcile, confirm, apply, poll.Detaching does not delete the policy. It stays declared and stays attached to any other stacks.
User says "delete the ephemeral-1h policy".
delete_standalone_policy with label.
file_path, source_anchor_start/_end, existing_policy_snippet, and destroy_forma_pkl.notes warns about a local binding, also remove the bare reference inside forma { } and any <binding>.res entries, or the file will not evaluate.destroy_forma_pkl verbatim to a temporary file inside the selected workspace, so the existing PklProject/dependencies and source context remain available.destroy_forma with file_path: <temp>, simulate: true. Show the result, get explicit confirmation, then call it with simulate: false and poll.If the destroy returns a Skip operation with ReferencingStacks, someone attached the policy between the pre-check and the destroy. Say the policy still exists and name the attaching stacks. In mode codebase, also explain that the source has already been edited and needs reconciliation with this outcome. In mode none, keep the disposable edit internal; never report successful deletion.
Version gating. The standalone-policy tools require formae ≥ 0.82.0, and the auto-reconcile policy type requires formae ≥ 0.88.0. On an older local formae the tool refuses with a requires formae >= X.Y.Z message — relay it and suggest upgrading, or fall back to an inline TTL policy where that fits.
User asks "what policies are on lifeline?".
list_stacks, locate the stack, surface its inline Policies.list_policies, filter to entries whose AttachedStacks includes the target stack label.AttachedStacks shows them all). This distinction matters: removing an inline policy affects one stack, while deleting a standalone affects every stack it is attached to. No file edits, no apply.pkl eval — ALWAYS use formae eval --output-consumer machine. Forma files use formae-specific extensions.codebase, ask which candidate file to edit if needed. In mode
none, reprepare the complete requested stack or ask which infrastructure
stack/policy the user means; never make them choose a temporary file.codebase requires a separate schema-upgrade decision. In mode none, verify the prepared source matches the connected agent and use its supported schema; if that agent lacks the capability or its schema is unavailable, explain the policy capability limitation and stop. Never guess a newer schema or imply upgrading a schema upgrades the agent.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
23 skills in this plugin
/formae-applyUse when the user wants to deploy infrastructure, apply a forma file, reconcile a stack, update a stack, or make planned infrastructure changes/formae-authorUse when the user wants to start authoring formae infrastructure or deploy something NEW with formae — e.g. 'I want to deploy X with formae', 'build a k8s app with formae', 'set up infrastructure for Y', 'create a new forma file for my service', 'write formae IaC for Z'. The front door that triages where the work happens, sets up plugin schema deps, and dispatches to focused authoring skills. NOT for applying an existing forma file (use formae-apply) or operating existing infra./formae-configUse when the user wants to switch, list, save, edit, delete, or compare formae configuration profiles in ~/.config/formae//formae-connectUse when the user wants to connect a cloud account to their hosted formae installation, or add another one — e.g. 'connect my AWS account', 'give formae access to account 123456789012', 'add a second AWS account', 'formae can't see my resources yet'./formae-depsUse when the user wants to add or remove a plugin schema dependency in an existing formae project's PklProject — e.g. 'add the grafana plugin', 'I need cloudflare DNS', 'drop the azure dependency'./formae-destroyUse when the user wants to destroy, delete, or tear down infrastructure resources, stacks, or environmentsformae@formae-marketplace is listed by platform-engineering-labs/formae-marketplace — review the source before installing
npx claudepluginhub platform-engineering-labs/formae-marketplace --plugin formae