-
Notifications
You must be signed in to change notification settings - Fork 1
feat(article): ai meets terraform prompt strategies for test generation post #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(article): ai meets terraform prompt strategies for test generation post #73
Conversation
✅ Deploy Preview for masterpoint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Warning Rate limit exceeded@westonplatter has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 38 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughUpdates Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Server
participant Template
participant Browser
User->>Server: Request blog/news page
Server->>Template: Load template and post data (includes .Description)
Template->>Template: Apply safeHTML to .Description
Template->>Server: Return rendered HTML
Server->>Browser: Serve page
Browser->>User: Display HTML-formatted description
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
…for-Test-Generation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
🧹 Nitpick comments (3)
.gitignore (1)
6-8
: LGTM; optional: ignore directories with trailing slashesCurrent patterns work. For clarity and to ignore the directories themselves (not just contents), consider:
-CLAUDE.md -.claude/* -.cursor/* +CLAUDE.md +.claude/ +.cursor/content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (2)
54-54
: Correct tool name“Airder” -> “Aider”.
-*Similar alternatives: [Airder](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode)*, (this list changes almost weekly) +*Similar alternatives: [Aider](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode)* (this list changes almost weekly) ```<!-- review_comment_end --> --- `113-127`: **Align v2 section heading with ToC text** Make the v2 heading match the updated ToC to avoid fragment mismatches. ```diff -### v2 – Cursor Sonnet-4 Refined Prompt +### v2 – Cursor Sonnet-4 Refined PromptNote: If you prefer the “Cursor + Sonnet-4 + Refined Prompt” phrasing, use it both in the heading and ToC and adjust the fragment accordingly.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v0-prompt-cursor.png
is excluded by!**/*.png
static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v4-prompt.png
is excluded by!**/*.png
static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/yang-weston-woodworking-robotic-arm.png
is excluded by!**/*.png
📒 Files selected for processing (3)
.gitignore
(1 hunks)content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
(1 hunks)layouts/partials/news-entry.html
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
content/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
content/**/*.md
: All content is in Markdown files under /content/
Front matter in Markdown files controls metadata and page behavior
Use absolute paths in content (e.g., /blog/ not blog/)
Reference images from /img/ (maps to /static/img/)
Set draft: true in front matter to hide from production
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
content/blog/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
Blog post Markdown files should be created under content/blog/ and follow the pattern hugo new blog/my-post-title.md
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🪛 GitHub Check: Trunk Check
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[notice] 12-12: markdownlint(MD042)
[new] No empty links
[notice] 12-12: markdownlint(MD059)
[new] Link text should be descriptive
[notice] 23-23: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 26-26: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 48-48: markdownlint(MD036)
[new] Emphasis used instead of a heading
[failure] 1-1: prettier
Incorrect formatting, autoformat by running 'trunk fmt'
🪛 LanguageTool
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[style] ~12-~12: Consider using an alternative to strengthen your wording.
Context: ...ys-for-durable-prompts) section. If you want to learn how we got there, read on. ##...
(WANT_KEEN)
[grammar] ~36-~36: Ensure spelling is correct
Context: ...re engineering principles and curiously stepp into the "Ironman suits" that generativ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~109-~109: Ensure spelling is correct
Context: ... use, Yang applied a common vibe coding stratey. He asked Claude to reflect on his feedb...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~116-~116: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...the refined prompt from the last step. We jumped back into Cursor and gave it the...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~159-~159: Consider using a more concise synonym.
Context: ...durable prompt” that can be used across a variety of Terraform codebases. We’re hoping you c...
(A_VARIETY_OF)
[grammar] ~188-~188: Ensure spelling is correct
Context: ...) - wait for Veronika's feedback on the promp {{ I reviewed the prompt and rewrote a g...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.17.2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
12-12: No empty links
(MD042, no-empty-links)
23-23: Link fragments should be valid
(MD051, link-fragments)
26-26: Link fragments should be valid
(MD051, link-fragments)
48-48: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🔇 Additional comments (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (1)
1-200
: Formatting & Linting – Manual Verification Needed
- The
trunk
command isn’t available in this environment, so formatting and linting couldn’t run automatically.- Please install and run your formatter and markdown linter (e.g.
trunk fmt && trunk check --fix
, orprettier --write .
andmarkdownlint --fix
) locally to address any issues.- Spot-check for style improvements:
- Line 116: vary sentence openings to avoid repetition.
- Line 159: tighten “a variety of” to something like “across many Terraform codebases.”
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
Outdated
Show resolved
Hide resolved
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
Outdated
Show resolved
Hide resolved
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
Outdated
Show resolved
Hide resolved
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
Outdated
Show resolved
Hide resolved
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
Outdated
Show resolved
Hide resolved
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (7)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (7)
2-3
: Draft should be true until ready to publish.Per repo guidelines for content/**/*.md, keep posts hidden with draft: true unless publishing now.
If you’re not publishing immediately, apply:
visible: true -draft: false +draft: true
23-23
: Fix ToC anchors to match headings (MD051).Ensure ToC text and fragments match the exact headings.
- - [v2 – Cursor + Sonnet-4 + Refined Prompt](#v2--cursor--sonnet-4--refined-prompt) + - [v2 – Cursor Sonnet-4 Refined Prompt](#v2--cursor-sonnet-4-refined-prompt) ... -- [Prompt for Generating Terraform Tests in Child-Modules](#prompt-for-generating-terraform-tests-for-child-modules) +- [Prompt for Generating Terraform Tests in Child-Modules](#prompt-for-generating-terraform-tests-in-child-modules)Also applies to: 26-26
36-36
: Typo: “Karthpathy” → “Karpathy”.-As a team, we’ve embraced a paradoxical approach: stay grounded in solid software engineering principles and curiously step into the "Ironman suits" that generative LLMs have to offer (Karthpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC). As a result, we've developed new best practices and refined LLM prompts or Cursor Rules that help us as a team complete chunks of work more efficiently. +As a team, we’ve embraced a paradoxical approach: stay grounded in solid software engineering principles and curiously step into the "Ironman suits" that generative LLMs have to offer (Karpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC). As a result, we've developed new best practices and refined LLM prompts or Cursor Rules that help us as a team complete chunks of work more efficiently.
109-109
: Typo: “stratey” → “strategy”.-To capture this feedback for future use, Yang applied a common vibe-coding stratey. He asked Claude to reflect on his feedback and create an improved prompt to generate Terraform tests. We wanted to operate from a more developed structural base as we iterated on a reproducible AI-driven workflow. +To capture this feedback for future use, Yang applied a common vibe-coding strategy. He asked Claude to reflect on his feedback and create an improved prompt to generate Terraform tests. We wanted to operate from a more developed structural base as we iterated on a reproducible AI-driven workflow.
157-158
: Remove placeholder content before publishing.“{{ create repo and add link to prompt here }}” will render on the page.
-{{ create repo and add link to prompt here }}
I can replace this with a direct link to the specific prompt file path in shared-prompts once finalized.
187-191
: Remove internal editorial notes/TODOs from published content.These should not ship.
-TODO(westonplatter) - wait for Veronika's feedback on the prompt - -{{ I reviewed the prompt and rewrote a good chunk of it }} -[https://github.com/masterpointio/internal-prompts/pull/13](https://github.com/masterpointio/internal-prompts/pull/13) +<!-- (Removed internal editorial notes before publishing) -->If needed, I can move these to an issue and add the appropriate links in the post after feedback.
12-12
: Replace placeholder link “here” (MD042/MD059).Point to the actual prompt file in shared-prompts or remove the placeholder.
Apply one of:
-> TLDR: We crafted an LLM prompt to generate Terraform tests. It's [here](#) in our [shared-prompts](https://github.com/masterpointio/shared-prompts) Github repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on. +> TLDR: We crafted an LLM prompt to generate Terraform tests. It’s available in our [shared-prompts](https://github.com/masterpointio/shared-prompts) GitHub repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on.When you have the final prompt path, I can update this to link directly to the file.
🧹 Nitpick comments (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (1)
48-48
: Markdownlint MD036: Avoid emphasis as a heading.Make the “Similar alternatives” lines regular text or a proper sub-heading.
Option A (plain sentence):
-*Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf* +Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf.-*Similar alternatives: [Airder](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode)*, (this list changes almost weekly) +Similar alternatives: [Aider](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode). (This list changes almost weekly.)Also applies to: 54-54
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
(1 hunks)layouts/_default/single.html
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
content/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
content/**/*.md
: All content is in Markdown files under /content/
Front matter in Markdown files controls metadata and page behavior
Use absolute paths in content (e.g., /blog/ not blog/)
Reference images from /img/ (maps to /static/img/)
Set draft: true in front matter to hide from production
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
content/blog/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
Blog post Markdown files should be created under content/blog/ and follow the pattern hugo new blog/my-post-title.md
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🧠 Learnings (2)
📚 Learning: 2025-07-31T21:30:32.227Z
Learnt from: CR
PR: masterpointio/masterpoint.io#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-31T21:30:32.227Z
Learning: Applies to content/**/*.md : Set draft: true in front matter to hide from production
Applied to files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
📚 Learning: 2025-07-31T21:30:32.227Z
Learnt from: CR
PR: masterpointio/masterpoint.io#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-31T21:30:32.227Z
Learning: Applies to content/**/*.md : Use absolute paths in content (e.g., /blog/ not blog/)
Applied to files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🪛 LanguageTool
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[style] ~12-~12: Consider using an alternative to strengthen your wording.
Context: ...ys-for-durable-prompts) section. If you want to learn how we got there, read on. ##...
(WANT_KEEN)
[grammar] ~109-~109: Ensure spelling is correct
Context: ... use, Yang applied a common vibe-coding stratey. He asked Claude to reflect on his feedb...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~116-~116: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...the refined prompt from the last step. We jumped back into Cursor and gave it the...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~159-~159: Consider using a more concise synonym.
Context: ... durable prompt that can be used across a variety of Terraform codebases. We’re hoping you c...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.17.2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
12-12: No empty links
(MD042, no-empty-links)
23-23: Link fragments should be valid
(MD051, link-fragments)
26-26: Link fragments should be valid
(MD051, link-fragments)
48-48: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🪛 GitHub Check: Trunk Check
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[notice] 12-12: markdownlint(MD042)
[new] No empty links
[notice] 12-12: markdownlint(MD059)
[new] Link text should be descriptive
[notice] 23-23: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 26-26: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 48-48: markdownlint(MD036)
[new] Emphasis used instead of a heading
[failure] 1-1: prettier
Incorrect formatting, autoformat by running 'trunk fmt'
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - masterpoint
- GitHub Check: Header rules - masterpoint
- GitHub Check: Pages changed - masterpoint
🔇 Additional comments (5)
layouts/_default/single.html (1)
22-22
: safeHTML usage is safe here
.Description
in Hugo is populated from front matter (edited by your trusted content authors), so rendering it withsafeHTML
poses no XSS risk in this setup. No changes required.content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (4)
7-7
: Confirm publish date aligns with intended go-live.Current date is set to 2025-08-13. If you plan to publish later or await feedback, adjust or keep draft: true until then.
134-135
: Grammar/clarity fix.[ suggest_nitpick ]
-Our next step was to test out the refined prompt on other child modules. I continuing using Cursor (and Sonnet-4) in Agent Mode to generate tests for in two other modules, [`terraform-datadog-users`](https://github.com/masterpointio/terraform-datadog-users) and [`terraform-secrets-helper`](https://github.com/masterpointio/terraform-secrets-helper/), +Our next step was to test the refined prompt on other child modules. I continued using Cursor (and Sonnet-4) in Agent Mode to generate tests for two other modules: [`terraform-datadog-users`](https://github.com/masterpointio/terraform-datadog-users) and [`terraform-secrets-helper`](https://github.com/masterpointio/terraform-secrets-helper/),
142-142
: Brand casing: “Datadog”[ suggest_nitpick ]
-* Terraform DataDog Users – [PR #12](https://github.com/masterpointio/terraform-datadog-users/pull/12) +* Terraform Datadog Users – [PR #12](https://github.com/masterpointio/terraform-datadog-users/pull/12)
1-1
: Prettier formatting couldn’t be verified – install Trunk CLI and rerun checksCI reported a formatting issue, but the
trunk
command wasn’t found locally. Please ensure you have the Trunk CLI installed (for example vianpm install -g trunk-cli
orcargo install trunk-cli
), then run:trunk fmt trunk check
against content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md and confirm there are no remaining formatting errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (1)
1-199
: Remove all placeholder tokens and TODOs from the blog post
Please clean up the following in content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md:
- Line 12: replace the TLDR link
[here](#)
with the actual prompt URL in shared-prompts.- Line 157: delete the literal
{{ create repo and add link to prompt here }}
and insert the final link.- Line 187: remove the
TODO(westonplatter) – wait for Veronika’s feedback on the prompt
comment.- Line 189: remove the editor’s note
{{ I reviewed the prompt and rewrote a good chunk of it }}
.After making these edits, re-run:
rg -n '\{\{.*\}\}|\[here\]\(#\)|TODO\(|FIXME|TBD'
to confirm no placeholders or TODOs remain.
♻️ Duplicate comments (7)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (7)
36-36
: Correct name: Karpathy (not Karthpathy).-... (Karthpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC) ... +... (Karpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC) ...
109-109
: Typo: “stratey” -> “strategy”.-... applied a common vibe-coding stratey. He asked ... +... applied a common vibe-coding strategy. He asked ...
2-3
: Set draft: true until ready to publish (per repo guideline).Keep posts hidden until the publish date is confirmed.
visible: true -draft: false +draft: true
12-12
: Replace empty placeholder link “here” (MD042, MD059) and improve wording.-> TLDR: We crafted an LLM prompt to generate Terraform tests. It's [here](#) in our [shared-prompts](https://github.com/masterpointio/shared-prompts) Github repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on. +> TLDR: We crafted an LLM prompt to generate Terraform tests. It’s available in our [shared-prompts](https://github.com/masterpointio/shared-prompts) GitHub repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on.
23-23
: Fix broken ToC anchors to match headings (MD051).- - [v2 – Cursor + Sonnet-4 + Refined Prompt](#v2--cursor--sonnet-4--refined-prompt) + - [v2 – Cursor Sonnet-4 Refined Prompt](#v2--cursor-sonnet-4-refined-prompt) ... -- [Prompt for Generating Terraform Tests in Child-Modules](#prompt-for-generating-terraform-tests-for-child-modules) +- [Prompt for Generating Terraform Tests in Child-Modules](#prompt-for-generating-terraform-tests-in-child-modules)Also applies to: 26-26
156-158
: Remove placeholder line before publishing.-The final version of the prompt (cursor rule) is up on GitHub in our open-source LLM prompts repo. Please try it out and share feedback from your experience\! -{{ create repo and add link to prompt here }} +The final version of the prompt (cursor rule) is up on GitHub in our open-source LLM prompts repo. Please try it out and share feedback from your experience\!
187-191
: Remove internal editorial TODOs before publishing.-TODO(westonplatter) - wait for Veronika's feedback on the prompt - -{{ I reviewed the prompt and rewrote a good chunk of it }} -[https://github.com/masterpointio/internal-prompts/pull/13](https://github.com/masterpointio/internal-prompts/pull/13) +<!-- Internal editorial notes removed prior to publishing -->
🧹 Nitpick comments (7)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (7)
8-8
: Capitalize GitHub in front matter description.-... Masterpoint's <a href="https://github.com/masterpointio/shared-prompts">shared-prompts</a> Github repo. +... Masterpoint's <a href="https://github.com/masterpointio/shared-prompts">shared-prompts</a> GitHub repo.
48-49
: Avoid using emphasis as a pseudo-heading (MD036) and keep to plain text.-*Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf* +Note: Similar alternatives include GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf.
54-55
: Fix product name and avoid italics as heading (MD036).-*Similar alternatives: [Airder](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode)*, (this list changes almost weekly) +Note: Similar alternatives include [Aider](https://github.com/Aider-AI/aider) and [OpenCode](https://github.com/opencode-ai/opencode) (this list changes almost weekly).
142-143
: Normalize brand casing: Datadog (not DataDog).-* Terraform DataDog Users – [PR #12](https://github.com/masterpointio/terraform-datadog-users/pull/12) +* Terraform Datadog Users – [PR #12](https://github.com/masterpointio/terraform-datadog-users/pull/12)
159-159
: Remove double space.-... leverage these strategies within your own prompts. +... leverage these strategies within your own prompts.
171-171
: Possessive form: tests’ (plural).-... matching the tests’s focus, like `main.tf.hcl`, ... +... matching the tests’ focus, like `main.tf.hcl`, ...
176-177
: Grammar: remove “to” after “Have the LLM”.-LLMs tend to produce verbose boilerplate code. Have the LLM to refactor tests to reduce duplication while keeping the same test coverage. +LLMs tend to produce verbose boilerplate code. Have the LLM refactor tests to reduce duplication while keeping the same test coverage.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
content/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
content/**/*.md
: All content is in Markdown files under /content/
Front matter in Markdown files controls metadata and page behavior
Use absolute paths in content (e.g., /blog/ not blog/)
Reference images from /img/ (maps to /static/img/)
Set draft: true in front matter to hide from production
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
content/blog/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
Blog post Markdown files should be created under content/blog/ and follow the pattern hugo new blog/my-post-title.md
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🧠 Learnings (1)
📚 Learning: 2025-07-31T21:30:32.227Z
Learnt from: CR
PR: masterpointio/masterpoint.io#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-31T21:30:32.227Z
Learning: Applies to content/**/*.md : Set draft: true in front matter to hide from production
Applied to files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🪛 LanguageTool
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[style] ~12-~12: Consider using an alternative to strengthen your wording.
Context: ...ys-for-durable-prompts) section. If you want to learn how we got there, read on. ##...
(WANT_KEEN)
[grammar] ~109-~109: Ensure spelling is correct
Context: ... use, Yang applied a common vibe-coding stratey. He asked Claude to reflect on his feedb...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~116-~116: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...the refined prompt from the last step. We jumped back into Cursor and gave it the...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~159-~159: Consider using a more concise synonym.
Context: ... durable prompt that can be used across a variety of Terraform codebases. We’re hoping you c...
(A_VARIETY_OF)
🪛 GitHub Check: Trunk Check
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[notice] 12-12: markdownlint(MD042)
[new] No empty links
[notice] 12-12: markdownlint(MD059)
[new] Link text should be descriptive
[notice] 23-23: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 26-26: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 48-48: markdownlint(MD036)
[new] Emphasis used instead of a heading
[failure] 1-1: prettier
Incorrect formatting, autoformat by running 'trunk fmt'
🪛 markdownlint-cli2 (0.17.2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
12-12: No empty links
(MD042, no-empty-links)
23-23: Link fragments should be valid
(MD051, link-fragments)
26-26: Link fragments should be valid
(MD051, link-fragments)
48-48: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - masterpoint
- GitHub Check: Header rules - masterpoint
- GitHub Check: Pages changed - masterpoint
🔇 Additional comments (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (1)
1-199
: Ensure Code Is Formatted Before Merging
CI has flagged a Prettier formatting failure, buttrunk fmt
isn’t available in this environment. Please install or make thetrunk
CLI available (see https://trunk.io), then run:trunk fmt—or— if you prefer your local setup:
npx prettier --write .
Commit the resulting changes so CI passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (5)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (5)
21-26
: Fix ToC anchor fragments to match headings (MD051)Align with actual headings.
- - [v2 – Cursor + Sonnet-4 + Refined Prompt](#v2--cursor--sonnet-4--refined-prompt) + - [v2 – Cursor Sonnet-4 Refined Prompt](#v2--cursor-sonnet-4-refined-prompt) ... -- [Prompt for Generating Terraform Tests in Child-Modules](#prompt-for-generating-terraform-tests-for-child-modules) +- [Prompt for Generating Terraform Tests in Child-Modules](#prompt-for-generating-terraform-tests-in-child-modules)
36-36
: Typo: Karpathy’s nameCorrect spelling.
-... (Karthpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC) ... +... (Karpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC) ...
12-12
: Fix empty placeholder link and improve wording (MD042/MD059)Replace “here” with a direct, helpful reference.
Apply:
-> TLDR: We crafted an LLM prompt to generate Terraform tests. It's [here](#) in our [shared-prompts](https://github.com/masterpointio/shared-prompts) Github repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on. +> TLDR: We crafted an LLM prompt to generate Terraform tests. It’s available in our [shared-prompts](https://github.com/masterpointio/shared-prompts) GitHub repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on.Once the exact prompt file is added, update this to point to that file path.
156-158
: Remove placeholder before publishingThis placeholder will render.
The final version of the prompt (cursor rule) is up on GitHub in our open-source LLM prompts repo. Please try it out and share feedback from your experience! -{{ create repo and add link to prompt here }}
187-191
: Remove internal TODOs/notes from public postDon’t ship editorial notes.
-TODO(westonplatter) - wait for Veronika's feedback on the prompt - -{{ I reviewed the prompt and rewrote a good chunk of it }} -[https://github.com/masterpointio/internal-prompts/pull/13](https://github.com/masterpointio/internal-prompts/pull/13) +<!-- Internal TODOs removed before publishing -->If you need to track these pre-merge tasks, keep them in the PR description or an issue.
🧹 Nitpick comments (11)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (11)
8-8
: Capitalize GitHub correctly in descriptionMinor correctness.
-... Masterpoint's <a href="https://github.com/masterpointio/shared-prompts">shared-prompts</a> Github repo. +... Masterpoint's <a href="https://github.com/masterpointio/shared-prompts">shared-prompts</a> GitHub repo.
48-48
: Avoid emphasis-as-heading; also fix “Aider” spelling (MD036)Render as plain text and correct tool name.
-*Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf* +Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf.-*Similar alternatives: [Airder](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode)*, (this list changes almost weekly) +Similar alternatives: [Aider](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode) (this list changes almost weekly)Also applies to: 54-54
111-111
: Grammar: remove extra “and”Streamline sentence.
-... the code layout and basic tests and aligned with our goals. +... the code layout and basic tests aligned with our goals.
115-115
: Article usageAdd missing “the”.
-We also carried forward LLM prompt that Claude Code generated for us in the last step. +We also carried forward the LLM prompt that Claude Code generated for us in the last step.
132-132
: Capitalize Terraform and remove double spaceMinor cleanup.
-... into terraform tests. We can fine-tune the prompts we pass into LLMs to yield ... +... into Terraform tests. We can fine-tune the prompts we pass into LLMs to yield ...
134-134
: Grammar: tense and phrasingFix tense and redundant “for”.
-Our next step was to test out the refined prompt on other child modules. I continuing using Cursor (and Sonnet-4) in Agent Mode to generate tests for in two other modules, ... +Our next step was to test out the refined prompt on other child modules. I continued using Cursor (and Sonnet-4) in Agent Mode to generate tests in two other modules, ...
160-160
: Remove extra space-... leverage these strategies within your own prompts. +... leverage these strategies within your own prompts.
171-171
: Possessive formUse tests’ (plural possessive).
-... matching the tests’s focus, ... +... matching the tests’ focus, ...
178-178
: Grammar: remove “to”-Have the LLM to refactor tests to reduce duplication ... +Have the LLM refactor tests to reduce duplication ...
181-181
: Remove extra space-... and will often select the best ideas ... +... and will often select the best ideas ...
184-186
: Avoid duplicate link; point to the specific prompt file when readyCollapse to a single sentence and remove redundant line; later, update to the exact prompt file path in shared-prompts.
-The full and final version of the prompt is located in Masterpoint's [shared-prompts](https://github.com/masterpointio/shared-prompts) repo, -[https://github.com/masterpointio/shared-prompts](https://github.com/masterpointio/shared-prompts). +The full and final version of the prompt is located in Masterpoint's [shared-prompts](https://github.com/masterpointio/shared-prompts) repo.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
content/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
content/**/*.md
: All content is in Markdown files under /content/
Front matter in Markdown files controls metadata and page behavior
Use absolute paths in content (e.g., /blog/ not blog/)
Reference images from /img/ (maps to /static/img/)
Set draft: true in front matter to hide from production
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
content/blog/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
Blog post Markdown files should be created under content/blog/ and follow the pattern hugo new blog/my-post-title.md
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🧠 Learnings (1)
📚 Learning: 2025-08-11T18:01:10.301Z
Learnt from: westonplatter
PR: masterpointio/masterpoint.io#73
File: content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md:2-3
Timestamp: 2025-08-11T18:01:10.301Z
Learning: For the masterpointio/masterpoint.io repository, blog post visibility is controlled by the publish date rather than the draft flag in the front matter. The draft flag can be set to false even for unpublished posts, as the publish date determines when content becomes visible.
Applied to files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🪛 LanguageTool
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[style] ~12-~12: Consider using an alternative to strengthen your wording.
Context: ...ys-for-durable-prompts) section. If you want to learn how we got there, read on. ##...
(WANT_KEEN)
[style] ~116-~116: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...the refined prompt from the last step. We jumped back into Cursor and gave it the...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~159-~159: Consider using a more concise synonym.
Context: ... durable prompt that can be used across a variety of Terraform codebases. We’re hoping you c...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.17.2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
12-12: No empty links
(MD042, no-empty-links)
23-23: Link fragments should be valid
(MD051, link-fragments)
26-26: Link fragments should be valid
(MD051, link-fragments)
48-48: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🪛 GitHub Check: Trunk Check
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[notice] 12-12: markdownlint(MD042)
[new] No empty links
[notice] 12-12: markdownlint(MD059)
[new] Link text should be descriptive
[notice] 23-23: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 26-26: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 48-48: markdownlint(MD036)
[new] Emphasis used instead of a heading
[failure] 1-1: prettier
Incorrect formatting, autoformat by running 'trunk fmt'
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - masterpoint
- GitHub Check: Header rules - masterpoint
- GitHub Check: Pages changed - masterpoint
🔇 Additional comments (2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (2)
2-8
: Confirm publish timing (repo uses publish date for visibility)Per repo learning, visibility is governed by publish date. With draft: false and date: 2025-08-14T00:00:00Z, this will publish on that date. Confirm this is intended.
1-10
: Ensure Prettier formatting passes
Please runnpx trunk fmt
(or install the Trunk CLI and runtrunk fmt
) in your local environment to apply the repo’s Prettier rules before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (1)
1-200
: Formatting Fix Required: Run Prettier or Install trunk to AutoformatIt looks like
trunk fmt
isn’t available in CI (command not found), so the Markdown wasn’t auto-formatted. Please install trunk (or ensure it’s in your PATH) and re-run:trunk fmtIf you prefer using your local Prettier setup instead, you can run:
npx prettier --write content/blog/ai-meets-tf-prompt-strategies-for-test-generation.mdThen commit the resulting formatting changes.
♻️ Duplicate comments (2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (2)
188-191
: Remove editorial TODOs before publishingThese internal notes will render; remove them.
-TODO(westonplatter) - wait for Veronika's feedback on the prompt - -{{ I reviewed the prompt and rewrote a good chunk of it }} -[https://github.com/masterpointio/internal-prompts/pull/13](https://github.com/masterpointio/internal-prompts/pull/13) +<!-- Internal editorial notes removed before publishing -->If you need to keep this context, track it in the PR description instead.
12-12
: Fix empty placeholder link and wording (MD042/MD059)Replace here with the actual URL (or remove it) and use “GitHub”.
-> TLDR: We crafted an LLM prompt to generate Terraform tests. It's [here](#) in our [shared-prompts](https://github.com/masterpointio/shared-prompts) Github repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on. +> TLDR: We crafted an LLM prompt to generate Terraform tests. It’s available in our [shared-prompts](https://github.com/masterpointio/shared-prompts) GitHub repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on.If you have the exact file path in shared-prompts, link to that directly.
🧹 Nitpick comments (9)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (9)
8-8
: Minor: GitHub capitalization“Github” -> “GitHub”.
-description: We share our experience developing an LLM prompt for Cursor and Claude Code to write meaningful Terraform tests. We describe various experiments, highlight strategies for crafting "durable prompts", and share the prompt’s final version in Masterpoint's <a href="https://github.com/masterpointio/shared-prompts">shared-prompts</a> Github repo. +description: We share our experience developing an LLM prompt for Cursor and Claude Code to write meaningful Terraform tests. We describe various experiments, highlight strategies for crafting "durable prompts", and share the prompt’s final version in Masterpoint's <a href="https://github.com/masterpointio/shared-prompts">shared-prompts</a> GitHub repo.
49-49
: Avoid using emphasis as a heading (MD036)Use plain text or a small subheading instead of italics.
-*Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf* +Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf-*Similar alternatives: [Airder](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode)*, (this list changes almost weekly) +Similar alternatives: [Airder](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode) (this list changes almost weekly)Also applies to: 55-55
37-37
: Spelling: KarpathyFix the name.
-As a team, we’ve embraced a paradoxical approach: stay grounded in solid software engineering principles and curiously step into the "Ironman suits" that generative LLMs have to offer (Karthpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC). As a result, we've developed new best practices and refined LLM prompts or Cursor Rules that help us as a team complete chunks of work more efficiently. +As a team, we’ve embraced a paradoxical approach: stay grounded in solid software engineering principles and curiously step into the "Ironman suits" that generative LLMs have to offer (Karpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC). As a result, we've developed new best practices and refined LLM prompts or Cursor Rules that help us as a team complete chunks of work more efficiently.
112-113
: Grammar cleanupRemove the duplicated “and”.
-**Takeaway:** Model quality matters. Claude’s Sonnet-4 significantly outperformed the model Cursor selected using “Auto Model” for structured code generation. While it still needed human review, the code layout and basic tests and aligned with our goals. +**Takeaway:** Model quality matters. Claude’s Sonnet-4 significantly outperformed the model Cursor selected using “Auto Model” for structured code generation. While it still needed human review, the code layout and basic tests aligned with our goals.
116-119
: Tighten wording and reduce repetition (“We … We … We …”)Minor wording improvements.
-At this point, we had learned that the underlying AI model matters, and using a descriptive prompt really helped. We also carried forward LLM prompt that Claude Code generated for us in the last step. We now wanted to see if Cursor could get to the same spot as Claude Code if we passed in the refined prompt from the last step. +At this point, we’d learned that the underlying AI model matters, and that a descriptive prompt really helps. We also carried forward the LLM prompt Claude Code generated in the prior step. Next, we wanted to see if Cursor could reach the same quality by using that refined prompt.
133-133
: Consistency: capitalize Terraform and remove double space-Zooming out for a second … LLMs are random functions that transform input into output. In this case, we’re transforming a prompt and the code into terraform tests. We can fine-tune the prompts we pass into LLMs to yield higher quality outputs, but using an LLM means using a semi-random process (how random also depends on the LLM’s temperature parameter). Given this non-deterministic behavior, you have the opportunity to re-run operations multiple times and get different results. We see this as a huge value-add if you want to ask an LLM to write 3 terraform tests 3 different times, compare the 9 different tests, and then select the top 2 or 3 for your use case. +Zooming out for a second … LLMs are random functions that transform input into output. In this case, we’re transforming a prompt and the code into Terraform tests. We can fine-tune the prompts we pass into LLMs to yield higher-quality outputs, but using an LLM means using a semi-random process (how random also depends on the LLM’s temperature parameter). Given this non-deterministic behavior, you have the opportunity to re-run operations multiple times and get different results. We see this as a huge value-add if you want to ask an LLM to write 3 Terraform tests 3 different times, compare the 9 different tests, and then select the top 2 or 3 for your use case.
135-136
: Grammar: tense and phrasing-Our next step was to test out the refined prompt on other child modules. I continuing using Cursor (and Sonnet-4) in Agent Mode to generate tests for in two other modules, [`terraform-datadog-users`](https://github.com/masterpointio/terraform-datadog-users) and [`terraform-secrets-helper`](https://github.com/masterpointio/terraform-secrets-helper/), +Our next step was to test the refined prompt on other child modules. I continued using Cursor (and Sonnet-4) in Agent Mode to generate tests for two other modules, [`terraform-datadog-users`](https://github.com/masterpointio/terraform-datadog-users) and [`terraform-secrets-helper`](https://github.com/masterpointio/terraform-secrets-helper/),
171-173
: Grammar and filename consistency
- tests’s -> tests’
- Use tftest.hcl to match earlier examples.
-For us, we prompted the LLM to divide test coverage into (happy path, edge case, and complex) categories. We additionally split up happy path tests into specific files matching the tests’s focus, like `main.tf.hcl`, `locals.tf.hcl`, `variables.tf.hcl`, etc. Your team or org might have different preferences, which is great. Find out what works for your needs. +For us, we prompted the LLM to divide test coverage into (happy path, edge case, and complex) categories. We additionally split up happy path tests into specific files matching the tests’ focus, like `main.tftest.hcl`, `locals.tftest.hcl`, `variables.tftest.hcl`, etc. Your team or org might have different preferences, which is great. Find out what works for your needs.
181-181
: List formatting: indent continuation lineIndent for proper list rendering.
- We got different outputs when we re-ran the same operation – same LLM with the same prompt and working from the same codebase. LLMs are non-deterministic functions. We see this as a feature 🙃 (not a bug), and will often select the best ideas generated from re-running operations multiple times. + We got different outputs when we re-ran the same operation – same LLM with the same prompt and working from the same codebase. LLMs are non-deterministic functions. We see this as a feature 🙃 (not a bug), and will often select the best ideas generated from re-running operations multiple times.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
content/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
content/**/*.md
: All content is in Markdown files under /content/
Front matter in Markdown files controls metadata and page behavior
Use absolute paths in content (e.g., /blog/ not blog/)
Reference images from /img/ (maps to /static/img/)
Set draft: true in front matter to hide from production
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
content/blog/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
Blog post Markdown files should be created under content/blog/ and follow the pattern hugo new blog/my-post-title.md
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🧠 Learnings (1)
📚 Learning: 2025-08-11T18:01:10.301Z
Learnt from: westonplatter
PR: masterpointio/masterpoint.io#73
File: content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md:2-3
Timestamp: 2025-08-11T18:01:10.301Z
Learning: For the masterpointio/masterpoint.io repository, blog post visibility is controlled by the publish date rather than the draft flag in the front matter. The draft flag can be set to false even for unpublished posts, as the publish date determines when content becomes visible.
Applied to files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🪛 LanguageTool
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[style] ~12-~12: Consider using an alternative to strengthen your wording.
Context: ...ys-for-durable-prompts) section. If you want to learn how we got there, read on. ##...
(WANT_KEEN)
[style] ~117-~117: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...the refined prompt from the last step. We jumped back into Cursor and gave it the...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~160-~160: Consider using a more concise synonym.
Context: ... durable prompt that can be used across a variety of Terraform codebases. We’re hoping you c...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.17.2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
12-12: No empty links
(MD042, no-empty-links)
21-21: Link fragments should be valid
(MD051, link-fragments)
22-22: Link fragments should be valid
(MD051, link-fragments)
23-23: Link fragments should be valid
(MD051, link-fragments)
24-24: Link fragments should be valid
(MD051, link-fragments)
49-49: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🪛 GitHub Check: Trunk Check
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[notice] 12-12: markdownlint(MD042)
[new] No empty links
[notice] 12-12: markdownlint(MD059)
[new] Link text should be descriptive
[notice] 21-21: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 22-22: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 23-23: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 24-24: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 49-49: markdownlint(MD036)
[new] Emphasis used instead of a heading
[failure] 1-1: prettier
Incorrect formatting, autoformat by running 'trunk fmt'
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - masterpoint
- GitHub Check: Header rules - masterpoint
- GitHub Check: Pages changed - masterpoint
🔇 Additional comments (4)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (4)
2-3
: Front matter visibility approach acknowledgedKeeping draft: false is fine here since publish scheduling is controlled by the date (per your repo convention). No change needed.
137-137
: Image caption consistency (v3 section shows “v4”)The caption says “v4 – Cursor Auto Model prompt” while the section is v3. Align the caption.
-{{< lightboximg "/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v4-prompt.png" "v4 – Cursor Auto Model prompt" >}} +{{< lightboximg "/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v4-prompt.png" "v3 – Cursor Auto Model prompt" >}}If you intend to introduce a v4 section, add it and update the ToC accordingly.
9-9
: All referenced images verifiedThe featured image and screenshots exist at:
- static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/yang-weston-woodworking-robotic-arm.png
- static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v0-prompt-cursor.png
- static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v4-prompt.png
No broken image links detected.
1-10
: Scheduled Publishing ConfirmedI scanned
config.yaml
andstatic/admin/config.yml
forbuildFuture
,future
,publishDate
,unpublishDate
, andbuildDrafts
—no matches were found. Hugo’s default behavior (without--buildFuture
) will skip future-dated content, so this post will remain hidden until 2025-08-14 as intended.No changes required.
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
Outdated
Show resolved
Hide resolved
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (6)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (6)
2-7
: Visibility via publish date looks correctUsing a future date to govern visibility (and keeping draft: false) matches the repo’s practice. No change needed.
38-38
: Typo: “Karthpathy” → “Karpathy”-As a team, we’ve embraced a paradoxical approach: stay grounded in solid software engineering principles and curiously step into the "Ironman suits" that generative LLMs have to offer (Karthpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC). As a result, we've developed new best practices and refined LLM prompts or Cursor Rules that help us as a team complete chunks of work more efficiently. +As a team, we’ve embraced a paradoxical approach: stay grounded in solid software engineering principles and curiously step into the "Ironman suits" that generative LLMs have to offer (Karpathy’s [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC). As a result, we've developed new best practices and refined LLM prompts or Cursor Rules that help us as a team complete chunks of work more efficiently.
188-191
: Remove internal TODOs and editorial notes before publishingThese will render publicly; drop them or move to a tracking issue.
-TODO(westonplatter) - wait for Veronika's feedback on the prompt - -{{ I reviewed the prompt and rewrote a good chunk of it }} -[https://github.com/masterpointio/internal-prompts/pull/13](https://github.com/masterpointio/internal-prompts/pull/13) +<!-- Internal editorial notes removed before publishing -->
22-25
: Fix broken TOC anchors for en dash headings (MD051)Generated IDs typically use double hyphens for en dashes. Update fragments to match.
- - [v0 – Cursor Auto Model](#v0-cursor-auto-model) - - [v1 – Claude Code using Sonnet-4](#v1-claude-code-using-sonnet-4) - - [v2 – Cursor Sonnet-4 Refined Prompt](#v2-cursor-sonnet-4-refined-prompt) - - [v3 – Applying the Refined Prompt to Other Codebases](#v3-applying-the-refined-prompt-to-other-codebases) + - [v0 – Cursor Auto Model](#v0--cursor-auto-model) + - [v1 – Claude Code using Sonnet-4](#v1--claude-code-using-sonnet-4) + - [v2 – Cursor Sonnet-4 Refined Prompt](#v2--cursor-sonnet-4-refined-prompt) + - [v3 – Applying the Refined Prompt to Other Codebases](#v3--applying-the-refined-prompt-to-other-codebases)
157-159
: Remove placeholder and consolidate prompt linkLine 158 is a placeholder; also inline the repo link and unescape “!”.
-The final version of the prompt (cursor rule) is up on GitHub in our open-source LLM prompts repo. Please try it out and share feedback from your experience\! -{{ create repo and add link to prompt here }} +The final version of the prompt (Cursor Rule) is available in our open-source LLM prompts repo: https://github.com/masterpointio/shared-prompts. Please try it out and share feedback from your experience!
12-12
: Fix empty placeholder link and improve wording (MD042/MD059)Replace the “here” placeholder with the actual repo link and capitalize GitHub.
-> TLDR: We crafted an LLM prompt to generate Terraform tests. It's [here](#) in our [shared-prompts](https://github.com/masterpointio/shared-prompts) Github repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on. +> TL;DR: We crafted an LLM prompt to generate Terraform tests. It’s available in our [shared-prompts repository](https://github.com/masterpointio/shared-prompts). If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on.
🧹 Nitpick comments (8)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (8)
36-36
: Capitalize GitHub consistentlyMinor nit: brand capitalization.
-Threads across [Github](https://github.com/dotnet/runtime/pull/115762) and [Reddit](https://www.reddit.com/r/Terraform/comments/1l7my1x/where_is_ai_still_completely_useless_for/) have shown how AI-generated code can be subpar 😂. +Threads across [GitHub](https://github.com/dotnet/runtime/pull/115762) and [Reddit](https://www.reddit.com/r/Terraform/comments/1l7my1x/where_is_ai_still_completely_useless_for/) have shown how AI-generated code can be subpar 😂.
50-50
: Avoid emphasis-as-heading pattern (MD036); prefer a plain “Note:”Switch the italic line to a simple note.
-_Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf_ +Note: Similar alternatives include GitHub Copilot in VS Code, JetBrains AI Assistant, or Windsurf.
56-56
: Fix brand spelling and clean up styling“Aider” is misspelled; also simplify formatting.
-_Similar alternatives: [Airder](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode)_, (this list changes almost weekly) +Note: Similar alternatives include [Aider](https://github.com/Aider-AI/aider) and [OpenCode](https://github.com/opencode-ai/opencode). This list changes almost weekly.
113-113
: Grammar: remove extra “and”Tighten the sentence.
-**Takeaway:** Model quality matters. Claude’s Sonnet-4 significantly outperformed the model Cursor selected using “Auto Model” for structured code generation. While it still needed human review, the code layout and basic tests and aligned with our goals. +**Takeaway:** Model quality matters. Claude’s Sonnet-4 significantly outperformed the model Cursor selected using “Auto Model” for structured code generation. While it still needed human review, the code layout and basic tests aligned with our goals.
136-136
: Grammar fixes: verb tense and extra preposition-Our next step was to test out the refined prompt on other child modules. I continuing using Cursor (and Sonnet-4) in Agent Mode to generate tests for in two other modules, [`terraform-datadog-users`](https://github.com/masterpointio/terraform-datadog-users) and [`terraform-secrets-helper`](https://github.com/masterpointio/terraform-secrets-helper/), +Our next step was to test the refined prompt on other child modules. I continued using Cursor (and Sonnet-4) in Agent Mode to generate tests for two other modules: [`terraform-datadog-users`](https://github.com/masterpointio/terraform-datadog-users) and [`terraform-secrets-helper`](https://github.com/masterpointio/terraform-secrets-helper/).
171-173
: Possessive and file name consistencyUse “tests’” and align examples with tftest.hcl naming.
-4. **Be explicit about what to test and how to test**. - For us, we prompted the LLM to divide test coverage into (happy path, edge case, and complex) categories. We additionally split up happy path tests into specific files matching the tests’s focus, like `main.tf.hcl`, `locals.tf.hcl`, `variables.tf.hcl`, etc. Your team or org might have different preferences, which is great. Find out what works for your needs. +4. **Be explicit about what to test and how to test**. + For us, we prompted the LLM to divide test coverage into (happy path, edge case, and complex) categories. We additionally split up happy path tests into specific files matching the tests’ focus, like `main.tftest.hcl`, `locals.tftest.hcl`, `variables.tftest.hcl`, etc. Your team or org might have different preferences, which is great. Find out what works for your needs.
178-178
: Grammar: remove “to”-LLMs tend to produce verbose boilerplate code. Have the LLM to refactor tests to reduce duplication while keeping the same test coverage. In our experiments, this forced the model to condense test logic into more concise and maintainable tests. +LLMs tend to produce verbose boilerplate code. Have the LLM refactor tests to reduce duplication while keeping the same test coverage. In our experiments, this forced the model to condense test logic into more concise and maintainable tests.
185-186
: Minor: remove trailing comma / duplicate linkOptional cleanup: fold into one sentence without a dangling comma or duplicate URL.
-The full and final version of the prompt is located in Masterpoint's [shared-prompts](https://github.com/masterpointio/shared-prompts) repo, -[https://github.com/masterpointio/shared-prompts](https://github.com/masterpointio/shared-prompts). +The full and final version of the prompt is in Masterpoint’s shared-prompts repo: https://github.com/masterpointio/shared-prompts.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v0-prompt-cursor.png
is excluded by!**/*.png
static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v4-prompt.png
is excluded by!**/*.png
static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/yang-weston-woodworking-robotic-arm.png
is excluded by!**/*.png
📒 Files selected for processing (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
content/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
content/**/*.md
: All content is in Markdown files under /content/
Front matter in Markdown files controls metadata and page behavior
Use absolute paths in content (e.g., /blog/ not blog/)
Reference images from /img/ (maps to /static/img/)
Set draft: true in front matter to hide from production
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
content/blog/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
Blog post Markdown files should be created under content/blog/ and follow the pattern hugo new blog/my-post-title.md
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🧠 Learnings (1)
📚 Learning: 2025-08-11T18:01:10.301Z
Learnt from: westonplatter
PR: masterpointio/masterpoint.io#73
File: content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md:2-3
Timestamp: 2025-08-11T18:01:10.301Z
Learning: For the masterpointio/masterpoint.io repository, blog post visibility is controlled by the publish date rather than the draft flag in the front matter. The draft flag can be set to false even for unpublished posts, as the publish date determines when content becomes visible.
Applied to files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🪛 LanguageTool
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[style] ~12-~12: Consider using an alternative to strengthen your wording.
Context: ...ys-for-durable-prompts) section. If you want to learn how we got there, read on. ##...
(WANT_KEEN)
[style] ~118-~118: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...the refined prompt from the last step. We jumped back into Cursor and gave it the...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~160-~160: Consider using a more concise synonym.
Context: ... durable prompt that can be used across a variety of Terraform codebases. We’re hoping you c...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.17.2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
12-12: No empty links
(MD042, no-empty-links)
22-22: Link fragments should be valid
(MD051, link-fragments)
23-23: Link fragments should be valid
(MD051, link-fragments)
24-24: Link fragments should be valid
(MD051, link-fragments)
25-25: Link fragments should be valid
(MD051, link-fragments)
50-50: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🪛 GitHub Check: Trunk Check
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[notice] 12-12: markdownlint(MD042)
[new] No empty links
[notice] 12-12: markdownlint(MD059)
[new] Link text should be descriptive
[notice] 22-22: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 23-23: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 24-24: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 25-25: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 50-50: markdownlint(MD036)
[new] Emphasis used instead of a heading
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - masterpoint
- GitHub Check: Header rules - masterpoint
- GitHub Check: Pages changed - masterpoint
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (2)
36-38
: Typos and naming consistency: “GitHub” and “Karpathy”.Correct brand/name spellings for professionalism.
-Threads across [Github](https://github.com/dotnet/runtime/pull/115762) and [Reddit](https://www.reddit.com/r/Terraform/comments/1l7my1x/where_is_ai_still_completely_useless_for/) have shown how AI-generated code can be subpar 😂. +Threads across [GitHub](https://github.com/dotnet/runtime/pull/115762) and [Reddit](https://www.reddit.com/r/Terraform/comments/1l7my1x/where_is_ai_still_completely_useless_for/) have shown how AI-generated code can be subpar 😂. -As a team, we’ve embraced a paradoxical approach: stay grounded in solid software engineering principles and curiously step into the "Ironman suits" that generative LLMs have to offer (Karthpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC). As a result, we've developed new best practices and refined LLM prompts or Cursor Rules that help us as a team complete chunks of work more efficiently. +As a team, we’ve embraced a paradoxical approach: stay grounded in solid software engineering principles and curiously step into the "Ironman suits" that generative LLMs have to offer (Karpathy's [Software 3.0 talk](https://youtu.be/LCEmiRjPEtQ?si=gSQ-viGAArtHt8G-&t=1642) at YC). As a result, we've developed new best practices and refined LLM prompts or Cursor Rules that help us as a team complete chunks of work more efficiently.
157-160
: Remove leftover placeholder and consolidate link reference.Placeholder line will render; you already provide the canonical link in the “Prompt …” section below.
-The final version of the prompt (cursor rule) is up on GitHub in our open-source LLM prompts repo. Please try it out and share feedback from your experience\! -{{ create repo and add link to prompt here }} +The final version of the prompt (Cursor rule) is up on GitHub in our open-source LLM prompts repo. Please try it out and share feedback from your experience!Optionally, inline the link here to avoid duplication:
- Masterpoint’s shared-prompts: https://github.com/masterpointio/shared-prompts
🧹 Nitpick comments (9)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (9)
12-12
: Use descriptive link text and fix GitHub capitalization.“here” isn’t descriptive (MD059) and “Github” -> “GitHub”.
-> TLDR: We crafted an LLM prompt to generate Terraform tests. It's [here](https://github.com/masterpointio/shared-prompts/blob/main/rules/tf-testing-child-module.mdc) in our [shared-prompts](https://github.com/masterpointio/shared-prompts) Github repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on. +> TLDR: We crafted an LLM prompt to generate Terraform tests. See the Cursor rule: [Terraform child‑module testing prompt](https://github.com/masterpointio/shared-prompts/blob/main/rules/tf-testing-child-module.mdc) in our [shared-prompts](https://github.com/masterpointio/shared-prompts) GitHub repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on.
22-25
: Fix ToC anchor fragments for headings with en dashes (MD051).Hugo/markdown slugification turns “–” into “--”.
- - [v0 – Cursor Auto Model](#v0-cursor-auto-model) - - [v1 – Claude Code using Sonnet-4](#v1-claude-code-using-sonnet-4) - - [v2 – Cursor Sonnet-4 Refined Prompt](#v2-cursor-sonnet-4-refined-prompt) - - [v3 – Applying the Refined Prompt to Other Codebases](#v3-applying-the-refined-prompt-to-other-codebases) + - [v0 – Cursor Auto Model](#v0--cursor-auto-model) + - [v1 – Claude Code using Sonnet-4](#v1--claude-code-using-sonnet-4) + - [v2 – Cursor Sonnet-4 Refined Prompt](#v2--cursor-sonnet-4-refined-prompt) + - [v3 – Applying the Refined Prompt to Other Codebases](#v3--applying-the-refined-prompt-to-other-codebases)
50-51
: Avoid using emphasis in place of headings (MD036).Render this as plain text or a blockquote note instead of italicizing the whole line.
-_Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf_ +Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or Windsurf
56-57
: Fix product/name typos and formatting.“Aider” spelling, “Windsurf” capitalization, and avoid full-line italics.
-_Similar alternatives: [Airder](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode)_, (this list changes almost weekly) +Similar alternatives: [Aider](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode) — this list changes almost weekly
113-114
: Grammar: remove stray conjunction.Minor readability tweak.
-**Takeaway:** Model quality matters. Claude’s Sonnet-4 significantly outperformed the model Cursor selected using “Auto Model” for structured code generation. While it still needed human review, the code layout and basic tests and aligned with our goals. +**Takeaway:** Model quality matters. Claude’s Sonnet-4 significantly outperformed the model Cursor selected using “Auto Model” for structured code generation. While it still needed human review, the code layout and basic tests aligned with our goals.
117-119
: Grammar: add missing article and tighten phrasing.Improves clarity and removes repetitive “We”.
-At this point, we had learned that the underlying AI model matters, and using a descriptive prompt really helped. We also carried forward LLM prompt that Claude Code generated for us in the last step. We now wanted to see if Cursor could get to the same spot as Claude Code if we passed in the refined prompt from the last step. +At this point, we had learned that the underlying AI model matters, and using a descriptive prompt really helped. We also carried forward the LLM prompt that Claude Code generated in the last step. Next, we wanted to see if Cursor could reach the same quality if we passed in the refined prompt.
136-137
: Grammar: fix tense and extra preposition.-Our next step was to test out the refined prompt on other child modules. I continuing using Cursor (and Sonnet-4) in Agent Mode to generate tests for in two other modules, [`terraform-datadog-users`](https://github.com/masterpointio/terraform-datadog-users) and [`terraform-secrets-helper`](https://github.com/masterpointio/terraform-secrets-helper/), +Our next step was to test the refined prompt on other child modules. I continued using Cursor (and Sonnet-4) in Agent Mode to generate tests in two other modules, [`terraform-datadog-users`](https://github.com/masterpointio/terraform-datadog-users) and [`terraform-secrets-helper`](https://github.com/masterpointio/terraform-secrets-helper/),
134-135
: Consistency: capitalize “Terraform”.Aligns with earlier capitalization of the product name.
-… into terraform tests. We can fine-tune … +… into Terraform tests. We can fine-tune …
171-179
: Grammar fixes: possessive and infinitive.
- “tests’s” -> “tests’” (or “test’s” if singular)
- “Have the LLM to refactor” -> “Have the LLM refactor”
-… matching the tests’s focus, like `main.tf.hcl`, `locals.tf.hcl`, `variables.tf.hcl`, etc. … +… matching the tests’ focus, like `main.tf.hcl`, `locals.tf.hcl`, `variables.tf.hcl`, etc. … -LLMs tend to produce verbose boilerplate code. Have the LLM to refactor tests to reduce duplication while keeping the same test coverage. +LLMs tend to produce verbose boilerplate code. Have the LLM refactor tests to reduce duplication while keeping the same test coverage.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these settings in your CodeRabbit configuration.
📒 Files selected for processing (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
content/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
content/**/*.md
: All content is in Markdown files under /content/
Front matter in Markdown files controls metadata and page behavior
Use absolute paths in content (e.g., /blog/ not blog/)
Reference images from /img/ (maps to /static/img/)
Set draft: true in front matter to hide from production
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
content/blog/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
Blog post Markdown files should be created under content/blog/ and follow the pattern hugo new blog/my-post-title.md
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🧠 Learnings (1)
📚 Learning: 2025-08-11T18:01:10.378Z
Learnt from: westonplatter
PR: masterpointio/masterpoint.io#73
File: content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md:2-3
Timestamp: 2025-08-11T18:01:10.378Z
Learning: For the masterpointio/masterpoint.io repository, blog post visibility is controlled by the publish date rather than the draft flag in the front matter. The draft flag can be set to false even for unpublished posts, as the publish date determines when content becomes visible.
Applied to files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🪛 LanguageTool
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[style] ~12-~12: Consider using an alternative to strengthen your wording.
Context: ...ys-for-durable-prompts) section. If you want to learn how we got there, read on. ##...
(WANT_KEEN)
[grammar] ~17-~17: There might be a mistake here.
Context: ...hy-ai-for-iac) - Our AI Toolkit for IaC - AI-Enhanced IDE - [...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...ai-toolkit-for-iac) - AI-Enhanced IDE - [Terminal-Based AI Coding](#terminal-base...
(QB_NEW_EN)
[grammar] ~19-~19: There might be a mistake here.
Context: ...anced-ide) - Terminal-Based AI Coding - [We’re still experimenting with MCPs for ...
(QB_NEW_EN)
[grammar] ~20-~20: There might be a mistake here.
Context: ...ill experimenting with MCPs for Code Gen](#were-still-experimenting-with-mcps-for-code-gen) - [Our exploration in Writing Terraform Tes...
(QB_NEW_EN)
[grammar] ~21-~21: There might be a mistake here.
Context: ...ation in Writing Terraform Tests with AI](#our-exploration-in-writing-terraform-tests-with-ai) - [v0 – Cursor Auto Model](#v0-cursor-auto-...
(QB_NEW_EN)
[grammar] ~22-~22: There might be a mistake here.
Context: ...sts-with-ai) - v0 – Cursor Auto Model - [v1 – Claude Code using Sonnet-4](#v1-cla...
(QB_NEW_EN)
[grammar] ~23-~23: There might be a mistake here.
Context: ...el) - v1 – Claude Code using Sonnet-4 - [v2 – Cursor Sonnet-4 Refined Prompt](#v2...
(QB_NEW_EN)
[grammar] ~24-~24: There might be a mistake here.
Context: ... - v2 – Cursor Sonnet-4 Refined Prompt - [v3 – Applying the Refined Prompt to Othe...
(QB_NEW_EN)
[grammar] ~25-~25: There might be a mistake here.
Context: ...ng the Refined Prompt to Other Codebases](#v3-applying-the-refined-prompt-to-other-codebases) - [Takeaways for Durable Prompts](#takeaway...
(QB_NEW_EN)
[grammar] ~26-~26: There might be a mistake here.
Context: ...ebases) - Takeaways for Durable Prompts - [Prompt for Generating Terraform Tests in...
(QB_NEW_EN)
[grammar] ~27-~27: There might be a mistake here.
Context: ...erating Terraform Tests in Child-Modules](#prompt-for-generating-terraform-tests-in-child-modules) - Credits
## Why AI for ...
(QB_NEW_EN)
[grammar] ~36-~36: There might be a mistake here.
Context: ... how AI-generated code can be subpar 😂. As a team, we’ve embraced a paradoxical a...
(QB_NEW_EN)
[grammar] ~70-~70: There might be a mistake here.
Context: ... validated before going into production. - Test variable inputs – confirm require...
(QB_NEW_EN)
[grammar] ~71-~71: There might be a mistake here.
Context: ...ced and invalid values are caught early. - Add basic happy paths – cover the expe...
(QB_NEW_EN)
[grammar] ~72-~72: There might be a mistake here.
Context: ...ed usage scenarios defined in main.tf
. - Probe edge cases – write tests that in...
(QB_NEW_EN)
[grammar] ~117-~117: There might be a mistake here.
Context: ...e prompt really helped. We also carried forward LLM prompt that Claude Code generated f...
(QB_NEW_EN)
[style] ~118-~118: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...the refined prompt from the last step. We jumped back into Cursor and gave it the...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[grammar] ~121-~121: There might be a mistake here.
Context: ...figure out”: - Where to place the tests - How to mock Terraform providers - How to...
(QB_NEW_EN)
[grammar] ~122-~122: There might be a mistake here.
Context: ... tests - How to mock Terraform providers - How to structure test inputs and share d...
(QB_NEW_EN)
[grammar] ~123-~123: There might be a mistake here.
Context: ... test inputs and share data across files - How to test locals
without exposing th...
(QB_NEW_EN)
[style] ~160-~160: Consider using a more concise synonym.
Context: ... durable prompt that can be used across a variety of Terraform codebases. We’re hoping you c...
(A_VARIETY_OF)
[grammar] ~162-~162: There might be a mistake here.
Context: ...Describe the codebase layout upfront*. Describe how the Terraform child module ...
(QB_NEW_EN)
[grammar] ~165-~165: There might be a mistake here.
Context: ...LLM to make small incremental changes**. We found it valuable to have the LLM mak...
(QB_NEW_EN)
[grammar] ~168-~168: There might be a mistake here.
Context: ...w. 3. Ask for clarifying questions. We found it helpful to direct the LLM to...
(QB_NEW_EN)
[grammar] ~171-~171: There might be a mistake here.
Context: ...it about what to test and how to test**. For us, we prompted the LLM to divide te...
(QB_NEW_EN)
[grammar] ~174-~174: There might be a mistake here.
Context: ... your needs. 5. Mock ALL providers. In this specific prompt, we directed the...
(QB_NEW_EN)
[grammar] ~177-~177: There might be a mistake here.
Context: ... Prompt for refactoring and brevity. LLMs tend to produce verbose boilerplate...
(QB_NEW_EN)
[grammar] ~181-~181: There might be a mistake here.
Context: ...om re-running operations multiple times. ## Prompt for Generating Terraform Tests in ...
(QB_NEW_EN)
[grammar] ~185-~185: There might be a mistake here.
Context: ....com/masterpointio/shared-prompts) repo, [https://github.com/masterpointio/shared...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.17.2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
22-22: Link fragments should be valid
(MD051, link-fragments)
23-23: Link fragments should be valid
(MD051, link-fragments)
24-24: Link fragments should be valid
(MD051, link-fragments)
25-25: Link fragments should be valid
(MD051, link-fragments)
50-50: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🪛 GitHub Check: Trunk Check
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[notice] 12-12: markdownlint(MD059)
[new] Link text should be descriptive
[notice] 22-22: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 23-23: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 24-24: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 25-25: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 50-50: markdownlint(MD036)
[new] Emphasis used instead of a heading
[failure] 1-1: prettier
Incorrect formatting, autoformat by running 'trunk fmt'
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - masterpoint
- GitHub Check: Header rules - masterpoint
- GitHub Check: Pages changed - masterpoint
🔇 Additional comments (2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (2)
2-9
: Front matter looks consistent with repo practices (publish date governs visibility).Publish date is set; HTML in description is fine now that templates render safeHTML.
1-195
: Run formatter to satisfy Prettier check.CI flagged a Prettier formatting failure. Please run trunk fmt (or your formatter) to normalize Markdown spacing and line wrapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (1)
22-25
: Fix ToC fragments for headings with en dashes (MD051)Goldmark/Hugo typically slugifies “–” to “--”. Update ToC anchors to use a double hyphen after the “vX”.
- - [v0 – Cursor Auto Model](#v0-cursor-auto-model) - - [v1 – Claude Code using Sonnet-4](#v1-claude-code-using-sonnet-4) - - [v2 – Cursor Sonnet-4 Refined Prompt](#v2-cursor-sonnet-4-refined-prompt) - - [v3 – Applying the Refined Prompt to Other Codebases](#v3-applying-the-refined-prompt-to-other-codebases) + - [v0 – Cursor Auto Model](#v0--cursor-auto-model) + - [v1 – Claude Code using Sonnet-4](#v1--claude-code-using-sonnet-4) + - [v2 – Cursor Sonnet-4 Refined Prompt](#v2--cursor-sonnet-4-refined-prompt) + - [v3 – Applying the Refined Prompt to Other Codebases](#v3--applying-the-refined-prompt-to-other-codebases)
🧹 Nitpick comments (5)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (5)
12-12
: Replace “here” link text with something descriptive (MD059)“here” is non-descriptive and flagged by markdownlint. Suggest inlining the file name or a descriptive phrase.
-> TLDR: We crafted an LLM prompt to generate Terraform tests. It's [here](https://github.com/masterpointio/shared-prompts/blob/main/rules/tf-testing-child-module.mdc) in our [shared-prompts](https://github.com/masterpointio/shared-prompts) GitHub repo. If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on. +> TLDR: We crafted an LLM prompt to generate Terraform tests. The final prompt file is available in our [shared-prompts](https://github.com/masterpointio/shared-prompts) GitHub repo: [tf-testing-child-module.mdc](https://github.com/masterpointio/shared-prompts/blob/main/rules/tf-testing-child-module.mdc). If you’re looking for the list of things that worked for us, jump to the [Takeaways for Durable Prompts](#takeaways-for-durable-prompts) section. If you want to learn how we got there, read on.
50-51
: Avoid using emphasis as a pseudo-heading (MD036)Use plain text or a subheading instead of italicized “Similar alternatives”.
-_Similar alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf_ +Alternatives: GitHub Copilot in VS Code, JetBrains AI Assistant, or WindSurf
56-57
: Mirror the formatting change for consistency (MD036)Same style tweak for the Terminal section.
-_Similar alternatives: [Aider](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode), (this list changes almost weekly)_ +Alternatives: [Aider](https://github.com/Aider-AI/aider), [OpenCode](https://github.com/opencode-ai/opencode), (this list changes almost weekly)
138-139
: “v4” label appears without a corresponding section or ToC entryThe image caption reads “v4 – Cursor Auto Model prompt,” but there is no v4 section/ToC item. This may confuse readers.
Options:
- If intentional to keep only up to v3, rename the caption:
-{{< lightboximg "/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v4-prompt.png" "v4 – Cursor Auto Model prompt" >}} +{{< lightboximg "/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v4-prompt.png" "Cursor Auto Model prompt" >}}
- If you intend to add a v4 section, please add a “### v4 – …” heading and a matching ToC entry.
172-172
: Grammar: fix possessive “tests’s” → “tests’”Minor polish.
- For us, we prompted the LLM to divide test coverage into (happy path, edge case, and complex) categories. We additionally split up happy path tests into specific files matching the tests’s focus, like `main.tf.hcl`, `locals.tf.hcl`, `variables.tf.hcl`, etc. Your team or org might have different preferences, which is great. Find out what works for your needs. + For us, we prompted the LLM to divide test coverage into (happy path, edge case, and complex) categories. We additionally split up happy path tests into specific files matching the tests’ focus, like `main.tf.hcl`, `locals.tf.hcl`, `variables.tf.hcl`, etc. Your team or org might have different preferences, which is great. Find out what works for your needs.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these settings in your CodeRabbit configuration.
📒 Files selected for processing (1)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
content/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
content/**/*.md
: All content is in Markdown files under /content/
Front matter in Markdown files controls metadata and page behavior
Use absolute paths in content (e.g., /blog/ not blog/)
Reference images from /img/ (maps to /static/img/)
Set draft: true in front matter to hide from production
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
content/blog/**/*.md
📄 CodeRabbit Inference Engine (CLAUDE.md)
Blog post Markdown files should be created under content/blog/ and follow the pattern hugo new blog/my-post-title.md
Files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🧠 Learnings (1)
📚 Learning: 2025-08-11T18:01:10.378Z
Learnt from: westonplatter
PR: masterpointio/masterpoint.io#73
File: content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md:2-3
Timestamp: 2025-08-11T18:01:10.378Z
Learning: For the masterpointio/masterpoint.io repository, blog post visibility is controlled by the publish date rather than the draft flag in the front matter. The draft flag can be set to false even for unpublished posts, as the publish date determines when content becomes visible.
Applied to files:
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
🪛 markdownlint-cli2 (0.17.2)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
22-22: Link fragments should be valid
(MD051, link-fragments)
23-23: Link fragments should be valid
(MD051, link-fragments)
24-24: Link fragments should be valid
(MD051, link-fragments)
25-25: Link fragments should be valid
(MD051, link-fragments)
50-50: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🪛 GitHub Check: Trunk Check
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md
[notice] 12-12: markdownlint(MD059)
[new] Link text should be descriptive
[notice] 22-22: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 23-23: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 24-24: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 25-25: markdownlint(MD051)
[new] Link fragments should be valid
[notice] 50-50: markdownlint(MD036)
[new] Emphasis used instead of a heading
[failure] 1-1: prettier
Incorrect formatting, autoformat by running 'trunk fmt'
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - masterpoint
- GitHub Check: Header rules - masterpoint
- GitHub Check: Pages changed - masterpoint
🔇 Additional comments (3)
content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (3)
1-10
: Front matter looks good; publish date governs visibility in this repoAcknowledging prior clarification: publish date controls visibility here, so
draft: false
with the set date is fine. The image path uses /img/, as expected.
1-1
: Prettier/trunk format is failingRun trunk fmt to satisfy the formatter check.
9-9
: Images present — no action requiredAll three referenced images exist under static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/, so no broken images expected on publish.
- Referenced from: content/blog/ai-meets-tf-prompt-strategies-for-test-generation.md (lines 9, 81, 138)
- static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/yang-weston-woodworking-robotic-arm.png
- static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v0-prompt-cursor.png
- static/img/updates/ai-meets-tf-prompt-strategies-for-test-generation/v4-prompt.png
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what
Pre-Merge Todos
shared-prompts
repoSummary by CodeRabbit