# Taskfile.yml Structure Standards
## Rule
All Taskfile.yml files MUST declare version 3, include descriptions on every task, organize sections in a consistent order, and group related tasks logically.
## Format
```yaml
# Taskfile.yml
version: '3'
# ─── Variables ─────────────────────────────────────
vars:
APP_NAME: myapp
VERSION:
sh: git describe --tags --always
# ─── Environment ───────────────────────────────────
env:
CGO_ENABLED: '0'
# ─── Includes ─────────────────────────────────────
includes:
docker: ./taskfiles/docker.yml
# ─── Tasks ─────────────────────────────────────────
tasks:
default:
desc: Show available commands
cmds:
- task --list
setup:
desc: First-time project setup
cmds:
- npm ci
dev:
desc: Start development server
cmds:
- npm run dev
build:
desc: Build for production
cmds:
- npm run build
test:
desc: Run test suite
cmds:
- npm test
lint:
desc: Run linters
cmds:
- npm run lint
clean:
desc: Remove build artifacts
cmds:
- rm -rf dist/ node_modules/.cache/
```
## Requirements
1. **version: '3'** at the top (always)
2. **desc on every task** (no exceptions)
3. **Section order**: vars → env → includes → tasks
4. **default task** that shows available commands
5. **Standard task names**: setup, dev, build, test, lint, clean
## Good
```yaml
version: '3'
tasks:
build:
desc: Build the application
cmds:
- go build -o bin/app ./cmd/app
```
## Bad
```yaml
# Missing version, missing desc
tasks:
build:
cmds:
- go build -o bin/app
```