Taskfile Skill
Use this skill to create production-grade Taskfile.yml automation for local dev, CI, and monorepos.
Task is a YAML task runner with:
- dependency graphs (
deps) - templating via Go
text/template+ slim-sprig functions - incremental execution (
sources,generates,status,method) - task composition via
includes
What to do first
- Identify the user's goal (dev workflow, build, test, release, codegen, deploy).
- Inspect existing
Taskfile.ymland project scripts (package.json, Makefile, CI configs). - Decide whether to:
- add tasks to existing Taskfile,
- split into included Taskfiles,
- or bootstrap a fresh Taskfile.
- Prefer small, composable tasks with clear
descand predictable variables.
Core implementation rules
- Keep root schema on
version: '3'unless user needs stricter semver gating. - Use
descon user-facing tasks sotask --listis useful. - Use
internal: truefor helper tasks not meant for direct invocation. - Use
depsfor parallelizable prerequisites; usecmds: - task: ...for ordered execution. - Use
requires.varsfor mandatory inputs and enum constraints for safety. - Use
sources+generates(orstatus) to skip unnecessary work. - Use
preconditionsfor hard-fail checks (missing tools/files/env). - Use
ifto conditionally skip tasks without failing. - Use task-level
dirwhen running in subfolders/services.
Output expectations
When writing or editing Taskfiles:
- return valid YAML that can run as-is;
- include concise comments only for non-obvious behavior;
- include at least one
defaultor clearly documented entrypoint task when useful; - include practical examples of calling tasks (with variables and
--CLI args) in your response.
Routing guide
- Schema keys and valid shapes:
references/schema-and-model.md - Templating and special variables:
references/templating-and-vars.md - Execution model, caching, and reliability:
references/execution-patterns.md - CLI flags, debug flow, and troubleshooting:
references/cli-and-debugging.md - Ready-to-copy Taskfiles:
examples/basic-taskfile.yml,examples/monorepo-taskfile.yml
High-value patterns to prefer
1) Safe deploy tasks
promptfor confirmationrequires.varsfor environment selectionpreconditionsfor required secrets/tools
2) Fast local dev loops
- a top-level
devtask that fans out to service tasks watchwhere appropriate- clear task aliases for common commands
3) Incremental builds/codegen
sourcesandgeneratesfor deterministic re-runsmethod: checksumfor content-sensitive workflowsmethod: timestamponly when filesystem mtime behavior is desired
4) Monorepo composition
includeswith namespacesflattenonly when naming collisions are controlledexcludesfor clashing task names
Anti-patterns to avoid
- Giant single tasks that hide multiple concerns.
- Relying on shell state shared between separate commands.
- Omitting
descon user-facing tasks. - Using
--forceroutinely instead of modelingsources/statuscorrectly. - Putting sensitive values directly in Taskfiles when env/dotenv is more appropriate.
Minimal quality checklist
Before finishing, verify:
task --listis readable and meaningful.- Required variables are enforced (
requires). - Tasks run from expected directories (
dir,USER_WORKING_DIRwhen needed). - Incremental tasks have correct invalidation (
sources/generates/status). - Task names and namespaces are consistent and predictable.