OpenParable
Skip to content
← Back to skills

New Resource Workflow

Development
new-resource-workflow

New Resource Workflow is an Agent Skill for development published in the GoogleCloudPlatform/magic-modules repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Workflow specifically for creating a new resource, supporting both autogen and manual generation.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/GoogleCloudPlatform/magic-modules/blob/HEAD/.agents/skills/workflows/new_resource/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/new-resource-workflow, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

new-resource-workflow

This document guides the agent through the task of creating a new Terraform resource in Magic Modules.

Generation Options

There are two ways to generate the initial YAML definition for the resource:

  1. Autogen Subagent (Default): Use this method if an OpenAPI specification is available for the resource.
  2. Manual Generation: Create the YAML definition directly if no spec is available or if it requires custom crafting.

Execution Steps

1. Prompt for OpenAPI Specification (Default Path)

  • Ask the user to provide the OpenAPI specification file (or its path) for the new resource.
  • Note: If no OpenAPI specification is available, state that you will fall back to the Manual Path (Step 2B) to draft the YAML directly, and ask for the user's confirmation to proceed.
  • If the user provides the spec, proceed to Step 2A (Autogen Path).

2A. Autogen Path

  • Action: Invoke the autogen subagent to handle the generation and initial testing.
  • Prompt: "Use the OpenAPI spec to generate the new resource. Run tests and report back."
  • Wait for the subagent to return its report.
  • Handoff:
    • If the subagent reports that tests passed successfully, present the results to the user.
    • If the subagent reports test failures, enter the Default Workflow (default/SKILL.md) at Step 5 (Fix) to plan remediation.

2B. Manual Path

  • Follow the standard process to draft the YAML definition in mmv1/products/... based on API documentation and repository patterns.
  • Handoff: Once the YAML is drafted, enter the Default Workflow (default/SKILL.md) at Step 3 (Generate) to compile the provider and continue with testing.