| name | formae-plugin-add-resource |
| description | Use when the user wants to add support for a new resource type to an existing formae plugin |
Add a Resource Type to an Existing Plugin
Add support for a new resource type to an existing formae resource plugin, following the plugin SDK tutorial and using TDD.
MANDATORY RULE: Install Before Testing
After ANY code changes to the plugin, you MUST run make install before running tests. Integration tests and conformance tests run against the INSTALLED plugin binary, not the source code. Skipping this step means you're testing stale code.
Workflow
1. Locate the plugin
Ask the user where their plugin lives. Check that the directory exists and contains a valid plugin project (look for formae-plugin.pkl, Makefile, and the plugin Go source). Run /init so you have full context on the codebase.
2. Choose the resource type
Ask the user which resource type they want to add. Then research the provider's API for that resource thoroughly:
- Resource model: required vs optional fields, immutable fields (createOnly), read-only fields
- CRUD operations: endpoints, request/response shapes, error codes
- Async operations: does the API return immediately or require polling?
- Value normalization: does the API normalize values? (e.g., case changes, default values injected server-side)
- Relationships: does this resource reference or depend on other resources?
Look at how Terraform or Pulumi model the equivalent resource for schema design reference.
Present your research findings and a proposed resource schema to the user for approval before proceeding.
3. Follow the tutorial (steps 2–10)
Fetch the plugin SDK tutorial from https://docs.formae.io/en/latest/plugin-sdk/tutorial/ and follow steps 2–10, adapting each lesson to the new resource type. Study the existing resource implementations in the plugin for patterns and conventions to follow.