AgentSkillsCN

taskfile

执行Summerhouse项目的Taskfile命令。用于terraform操作(init、plan、apply、destroy、output)、后端/前端开发、测试和linting。Terraform在基础设施/环境中使用环境(dev、prod)。

SKILL.md
--- frontmatter
name: taskfile
description: Execute Taskfile commands for the Summerhouse project. Use for terraform operations (init, plan, apply, destroy, output), backend/frontend development, testing, and linting. Terraform uses environments (dev, prod) in infrastructure/environments/.

Taskfile Commands

This skill helps execute Taskfile.yaml commands for the Summerhouse booking platform.

CRITICAL RULE

NEVER run terraform or terragrunt commands directly. ALL infrastructure commands MUST use the Taskfile.

Terraform Commands

Command Pattern

code
task tf:<action>:<env>

Where:

  • <action> is: init, plan, apply, destroy, output
  • <env> is a directory name in infrastructure/environments/ (e.g., dev, prod)

Available Terraform Commands

CommandDescription
tf:init:<env>Initialize Terraform with backend config
tf:plan:<env>Preview changes
tf:apply:<env>Apply changes
tf:destroy:<env>Destroy all resources
tf:output:<env>Show output values
tf:fmtFormat all Terraform files
tf:validateValidate configuration syntax (run after init)
tf:envsList available environments

Discovering Environments

bash
# List all available environments
task tf:envs

# Or directly check the directory
ls infrastructure/environments/

Environments are defined by directories in infrastructure/environments/<name>/. Each has:

  • backend.hcl - S3 backend configuration
  • terraform.tfvars.json - Environment-specific variables

Typical Terraform Workflow

bash
# 1. List available environments
task tf:envs

# 2. Initialize Terraform
task tf:init:dev

# 3. Preview changes
task tf:plan:dev

# 4. Apply changes (after review)
task tf:apply:dev

# 5. View outputs
task tf:output:dev

Backend Commands (Python/FastAPI)

CommandDescription
backend:installInstall Python deps with uv
backend:devRun FastAPI dev server on :3001
backend:testRun pytest
backend:test:coverageRun pytest with coverage
backend:lintRun ruff linter
backend:typecheckRun mypy type checker

Frontend Commands (Next.js)

CommandDescription
frontend:installInstall deps with Yarn
frontend:devRun Next.js dev server on :3000
frontend:buildBuild static export
frontend:testRun Vitest unit tests
frontend:test:e2eRun Playwright E2E tests
frontend:lintRun eslint

Combined Commands

CommandDescription
installInstall all dependencies (backend + frontend)
devRun both dev servers
testRun all tests
lintLint all code

Other Commands

CommandDescription
types:generateGenerate TypeScript types from Pydantic models
seed:<env>Seed database with test data

Instructions

When the user asks to run infrastructure or development operations:

  1. Terraform operations: ALWAYS use task tf:<action>:<env> pattern
  2. Identify environment: Ask which environment if not specified, or run task tf:envs
  3. Destructive operations: For apply and destroy, show plan output first and confirm
  4. Never bypass: If a task command fails, report the error - do NOT run raw terraform

Examples

User: "Initialize terraform for dev" Action: Run task tf:init:dev

User: "Plan changes for production" Action: Run task tf:plan:prod

User: "Deploy to dev" Action: Run task tf:plan:dev, show output, then task tf:apply:dev after confirmation

User: "What environments are available?" Action: Run task tf:envs

User: "Run backend tests" Action: Run task backend:test

User: "Start the dev servers" Action: Run task dev

User: "Validate terraform syntax" Action: Run task tf:init:dev first (if needed), then task tf:validate