add-fields-workflow
Workflow for adding new fields to existing MMv1 or handwritten resources.
来源信息
- 仓库
- GoogleCloudPlatform/magic-modules
- 最近来源活动
- 2026年9月14日 17:35
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 975
- Forks
- 2,573
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- add-fields-workflow
- description
- Workflow for adding new fields to existing MMv1 or handwritten resources.
# `add-fields-workflow`
> **Note to AI Agents:** You MUST read the YAML frontmatter above first. Only read the rest of this file if the `description` matches your required task.
## Prerequisites
- You must be operating in the `magic-modules` root directory.
- You must know the target resource (e.g., `google_compute_instance`) and the API field(s) to add.
---
## Execution Steps
### 1. Context & Schema Investigation
Before you begin implementation, read the following documents:
- `docs/content/develop/add-fields.md` — Complete procedural guide for adding fields to MMv1 and handwritten resources.
- `docs/content/reference/field.md` — Comprehensive MMv1 field configuration reference.
- `docs/content/test/test.md` - Complete procedural guide for adding tests.
- `docs/content/reference/sample.md` - Comprehensive MMv1 sample configuration reference.
- `.agents/knowledge/index.md` for general information.
**Resource Definition Locations**:
- MMv1 generated resources: `mmv1/products/<product>/<resource>.yaml`
- Handwritten resources: `mmv1/third_party/terraform/services/<product>/resource_<product>_<resource>.go`
Implement logic according to the API behavior and terraform best practices. Your code should match the style of the resource and product.
### 2. Add fields
Add the requested field(s) to the requested resource(s).
### 3. Add tests for the fields
Field tests should exist according to the following rules:
- Every field must be present in at least one test step.
- Every mutable field must have its value altered in an update step.
- It's preferable for optional fields to be missing in at least one step to ensure that they're truly optional.
Because you're adding fields to an existing resource, try to modify existing tests if possible rather than adding new tests.
**Test Locations**:
- Generated : `mmv1/templates/terraform/samples/services/<PRODUCT>/`
- Handwritten resources: `mmv1/third_party/terraform/services/<PRODUCT>/resource_<product>_<resource>_test.go`
### 4. Run Pre-Gen Checks
- Use [run-pre-gen-checks](.agents/skills/utils/run-pre-gen-checks/SKILL.md). If issues are found, analyze and fix them.
### 5. Generate Provider
- Use [generate-provider](.agents/skills/operations/generate-provider/SKILL.md).
- Confirm that the provider was generated successfully.
### 6. Test and Debug
- Use [`repo-sync`](.agents/skills/operations/repo-sync/SKILL.md) to ensure the downstream repositories are in sync with magic-modules.
- Use [`generate-provider`](.agents/skills/operations/generate-provider/SKILL.md) to generate the provider code into the downstream repositories.
- Invoke [`qa-test-runner`](.agents/skills/operations/qa-test-runner/SKILL.md) (or delegate to the `qa-test-runner` subagent) to run all acceptance tests for the modified resource.
- Invoke [`test-fixer`](.agents/skills/workflows/test_fix/SKILL.md) (or delegate to the `test-fixer` subagent) to fix any issues found by the `qa-test-runner` skill. Return to step 4 after any changes.
---
## The Loop
Repeat steps 4-6 as needed until the primary task is complete.
在 GitHub 查看