Nuxt + Terraform Scaffold Skill
Generate files for Nuxt + AWS infrastructure projects. This skill replaces the CLI — generate all files directly.
Pre-Requisites
Read
terraform-scaffold.config.ts
for
(PascalCase),
, and custom paths. If no config exists, ask the user for these values.
Naming Conventions
| Concept | Convention | Example |
|---|
| Function prefix | PascalCase | |
| Full Lambda name | | |
| Resolver name | camelCase | |
| GraphQL constant | SCREAMING_SNAKE_CASE | |
| TF module name | appsync_function_<camelName>
| appsync_function_productById
|
| TF lambda module | lambda_function_<camelName>
| lambda_function_productById
|
| Composable file | | |
| GraphQL file | (lcfirst) | |
| TF file per model | (lcfirst) | |
| DynamoDB datasource | appsync_datasource_<modelLower>
| appsync_datasource_product
|
| DynamoDB table | | |
| Query index | | |
String conversions:
splits on uppercase, joins with
, uppercases.
capitalizes first letter.
lowercases first letter.
Command 1: Init
Ask user for: project name, function prefix (PascalCase), AWS profile, AWS region (default:
), S3 state bucket, DynamoDB lock table.
AWS Profile Selection: Parse
and
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:
- Model name — type from (PascalCase)
- Resolver type — or
- Resolver name — camelCase (e.g. )
- Runtime — or
- DynamoDB operation (APPSYNC_JS only) — , , , , ,
- Fields — model fields as arguments + optional extras (, , , )
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:
- Name — PascalCase suffix (e.g. )
- Type — or
- Schedule (cron only) — EventBridge expression (e.g. )
Read references/lambda-workflow.md for Lambda source files, TF module block, cron resources, and dependency checks.
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
- Read 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)
Post-generation validation: Run
on modified
files, then
. If providers not initialized, skip and inform user to run
first.