nuxt-terraform

Scaffold Nuxt + AWS Terraform infrastructure. Use when adding GraphQL resolvers, Lambda functions, initializing a new project with AppSync, DynamoDB, Cognito, writing Terraform tests, or generating/reviewing Terraform code style. Triggers on: add graphql resolver, create lambda, scaffold terraform, init terraform, add appsync resolver, add mutation, add query, add terraform test, write tftest, terraform style.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "nuxt-terraform" with this command: npx skills add ralphcrisostomo/nuxt-development-skills/ralphcrisostomo-nuxt-development-skills-nuxt-terraform

Nuxt + Terraform Scaffold Skill

Generate files for Nuxt + AWS infrastructure projects. This skill replaces the CLI — generate all files directly.

Style Guide

All generated Terraform code follows HashiCorp's official style conventions. Read references/terraform-style-guide.md for formatting rules, naming conventions, file organization, security best practices, and the code review checklist. Apply these conventions to all .tf files produced by any command below.

Pre-Requisites

Read terraform-scaffold.config.ts for functionPrefix (PascalCase), environments, and custom paths. If no config exists, ask the user for these values.

Naming Conventions

ConceptConventionExample
Function prefixPascalCaseMyApp
Full Lambda name<prefix><PascalSuffix>MyAppRedeemNow
Resolver namecamelCaseproductById
GraphQL constantSCREAMING_SNAKE_CASEPRODUCT_BY_ID
TF module nameappsync_function_<camelName>appsync_function_productById
TF lambda modulelambda_function_<camelName>lambda_function_productById
Composable fileuse<Model>.tsuseProduct.ts
GraphQL file<model>.ts (lcfirst)product.ts
TF file per model<model>.tf (lcfirst)product.tf
DynamoDB datasourceappsync_datasource_<modelLower>appsync_datasource_product
DynamoDB tabledynamodb_<modelLower>sdynamodb_products
Query indexby<Field>byUserId

String conversions: toScreamingSnake splits on uppercase, joins with _, uppercases. toPascal capitalizes first letter. lcfirst lowercases first letter.

Command 1: Init

Ask user for: project name, function prefix (PascalCase), AWS profile, AWS region (default: ap-southeast-2), S3 state bucket, DynamoDB lock table.

AWS Profile Selection: Parse ~/.aws/credentials and ~/.aws/config for profile names. Present numbered list. Allow "add new" via aws configure --profile <name>.

Read references/init-workflow.md for directory structure, template placeholders, static files, scripts, and package.json entries. Consult references/terraform-modules.md for all 18 reusable module signatures.

Command 2: GraphQL Resolver

Ask user for:

  1. Model name@model type from schema.graphql (PascalCase)
  2. Resolver typequery or mutation
  3. Resolver name — camelCase (e.g. productById)
  4. RuntimeAPPSYNC_JS or LAMBDA
  5. DynamoDB operation (APPSYNC_JS only) — GetItem, Query, PutItem, UpdateItem, Scan, BatchDeleteItem
  6. Fields — model fields as arguments + optional extras (payload: AWSJSON, filter: AWSJSON, limit: Int, nextToken: String)

For advanced APPSYNC_JS resolver patterns (filters, conditions, batch operations, non-DynamoDB data sources), use the aws-appsync-resolver skill.

Read references/resolver-workflow.md for all generation templates: schema injection, GraphQL constant, Terraform modules (APPSYNC_JS and LAMBDA), dependency modules, AppSync JS functions, Lambda source, and composable generation.

Command 3: Lambda Function

Ask user for:

  1. Name — PascalCase suffix (e.g. RedeemNow)
  2. Typestandard or cron
  3. Schedule (cron only) — EventBridge expression (e.g. rate(5 minutes))

Read references/lambda-workflow.md for Lambda source files, TF module block, cron resources, and dependency checks.

Command 4: Terraform Test

Generate .tftest.hcl test files for Terraform modules. Ask user for:

  1. Module path — which module to test (e.g. ./modules/dynamodb_table)
  2. Test typeunit (plan mode, fast), integration (apply mode, creates resources), or mock (plan mode with mock providers, no credentials needed)
  3. Scenarios — what behaviors to validate (defaults, edge cases, validation rules)

Read references/terraform-test.md for test file structure, run block syntax, assert patterns, mock provider setup, expect_failures, parallel execution, and CI/CD integration examples.

Generated artifacts:

  • Test file in terraform/modules/<module>/tests/<name>_<type>_test.tftest.hcl
  • Mock provider blocks when test type is mock

Naming convention: <description>_unit_test.tftest.hcl, <description>_integration_test.tftest.hcl, <description>_mock_test.tftest.hcl

Rules

Idempotency — never overwrite existing files during init. Skip if TF module, schema field, GraphQL constant, composable function, or Lambda source already exists. When appending, trim trailing whitespace and add newline before new content.

Pre-generation checklist:

  • Read terraform-scaffold.config.ts for functionPrefix
  • Read schema.graphql for existing models and fields
  • Check TF files, graphql/ files, and composables for duplicates
  • Follow exact naming conventions from the table above
  • Verify module dependencies exist; generate if missing (see resolver-workflow.md dependency modules section)

Style compliance: All generated .tf files follow the conventions in references/terraform-style-guide.md — two-space indent, aligned equals signs, meta-arguments first, variables with type+description, descriptive resource names, security hardening defaults.

Post-generation validation: Run terraform fmt on modified .tf files, then terraform validate. If providers not initialized, skip and inform user to run terraform init first. For test files, run terraform test to verify tests pass.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

ralph

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

prd

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

optimise-claude

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

nuxt-init

No summary provided by upstream source.

Repository SourceNeeds Review