You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: enhance code generation guidelines with validation and scope management (#22)
* docs: add rational on readme
* docs: add MCP inspector and remove list of tools from readme
* feat: enhance code generation guidelines with validation and scope management
Copy file name to clipboardExpand all lines: static/instructions.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,6 +198,49 @@ When generating Terraform configurations:
198
198
4.**Ensure proper module versioning to maintain stability**
199
199
5.**Include appropriate comments to explain the purpose and configuration of resources**
200
200
6.**Always validate generated logic** with `terraform init` and `terraform validate`
201
+
7.**Verify generated Terraform when possible** - Use available tools to run `terraform init`, `terraform validate`, and `terraform plan` to ensure configurations are syntactically correct and logically sound
202
+
8.**Stay focused on user requirements** - Avoid adding extra features or configurations not explicitly requested (e.g., don't include user_data blocks when generating VSI code unless specifically asked)
203
+
9.**Ask clarifying questions when ambiguous** - If the user's request lacks specific details or could be interpreted multiple ways, ask targeted questions to ensure accurate implementation
204
+
10.**Leverage IBM Cloud MCP when available** - If you have access to IBM Cloud MCP tools, use them to verify region lists, image IDs (for VSIs based on region), availability zones, and other cloud-specific parameters to ensure accuracy
205
+
11.**Generate vanilla Terraform configurations** - Always generate the most straightforward Terraform files (`.tf` files) and a README. Avoid creating scripts, Makefiles, or automation tools to launch Terraform unless explicitly requested. You may generate a template tfvars file if needed.
206
+
207
+
## Validation and Quality Assurance
208
+
209
+
### Terraform Validation
210
+
-**Always attempt to verify generated Terraform configurations**
211
+
- Run `terraform init` to ensure proper provider and module initialization
212
+
- Execute `terraform validate` to check syntax and configuration validity
213
+
- Use `terraform plan` when possible to verify logical correctness. Ignore authentication errors as you may not have valid credentials
214
+
- Provide corrected configurations
215
+
216
+
### Scope Management
217
+
-**Focus strictly on user requirements** - Don't add unrequested features
218
+
-**Common examples of scope creep to avoid:**
219
+
- Do not add user_data blocks to VSI configurations unless explicitly requested
220
+
- Do not add monitoring or logging configurations unless asked
221
+
- Do not add security groups beyond basic requirements
222
+
- Do not implement backup strategies unless specified
223
+
-**When in doubt, ask** - It's better to clarify requirements than assume additional needs
224
+
225
+
### Clarification Best Practices
226
+
-**Ask targeted questions** when user requests are ambiguous
227
+
-**Common clarification areas:**
228
+
- Specific region requirements for resource placement
0 commit comments