taskfile-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTask Automation System
Task自动化系统
Use this skill when working with projects that use Task to provide easy-to-discover automation commands for development workflows.
当你在使用Task的项目中工作时,可使用本技能来获取易于查找的开发工作流自动化命令。
Core Principle
核心原则
IMPORTANT: Always prefer commands over direct shell/language commands when a Taskfile is present.
taskTask provides:
- Discoverability: shows all available tasks
task --list - Consistency: Standardised commands across different environments
- Documentation: Built-in descriptions and help
- Automation: Multi-step workflows (e.g., combines testing and docs)
task dev - Safety: Interactive prompts for destructive operations
重要提示:当项目中存在Taskfile时,优先使用命令而非直接的Shell/语言命令。
taskTask提供以下特性:
- 可发现性:显示所有可用任务
task --list - 一致性:不同环境下的标准化命令
- 文档性:内置描述与帮助信息
- 自动化:多步骤工作流(例如,整合了测试与文档生成)
task dev - 安全性:针对破坏性操作的交互式提示
Task Discovery
Task任务查找
Find Available Tasks
查找可用任务
bash
undefinedbash
undefinedList all available tasks with descriptions
列出所有带描述的可用任务
task --list
task --list
Show common workflows and usage patterns
显示常见工作流和使用模式
task help
task help
Get detailed help for specific task
获取特定任务的详细帮助
task <taskname> --help
**Always start with discovery** when entering a new project with a Taskfile.task <taskname> --help
当进入一个包含Taskfile的新项目时,**始终从任务查找开始**。Common Task Patterns
常见Task任务模式
Development Workflows
开发工作流
Projects typically provide these standard tasks:
bash
undefined项目通常会提供以下标准任务:
bash
undefinedFast development cycle (common iteration loop)
快速开发周期(常见迭代循环)
task dev # Usually runs fast tests + fast docs
task dev # 通常运行快速测试 + 快速文档生成
Pre-commit workflow
提交前工作流
task precommit # Runs pre-commit hooks + fast tests
task precommit # 运行提交前钩子 + 快速测试
Full CI simulation locally
本地完整CI模拟
task ci # Complete CI pipeline locally
undefinedtask ci # 本地执行完整CI流水线
undefinedTesting Workflows
测试工作流
bash
undefinedbash
undefinedFull test suite including quality checks
包含质量检查的完整测试套件
task test
task test
Fast tests (skip quality checks for rapid development)
快速测试(跳过质量检查以实现快速开发)
task test-fast
task test:fast # Alternative naming
task test-fast
task test:fast # 替代命名方式
Quality checks only (Aqua, formatting, linting)
仅质量检查(Aqua、格式化、代码检查)
task test-quality
task test:quality
undefinedtask test-quality
task test:quality
undefinedDocumentation Building
文档构建
bash
undefinedbash
undefinedQuick docs build (recommended for development)
快速文档构建(推荐用于开发阶段)
task docs-fast
task docs:fast
task docs-fast
task docs:fast
Full documentation including slow components (notebooks, etc.)
包含慢速组件的完整文档(如笔记本等)
task docs
task docs
Interactive documentation server
交互式文档服务器
task docs-pluto # For Julia projects with Pluto notebooks
task docs:serve # For live-reload documentation server
undefinedtask docs-pluto # 适用于带有Pluto笔记本的Julia项目
task docs:serve # 用于支持热重载的文档服务器
undefinedEnvironment Management
环境管理
bash
undefinedbash
undefinedSet up development environment from scratch
从头搭建开发环境
task setup
task setup
Show package/dependency status
显示包/依赖状态
task pkg:status
task status
task pkg:status
task status
Project overview and environment information
项目概览与环境信息
task info
undefinedtask info
undefinedCode Quality
代码质量
bash
undefinedbash
undefinedLinting
代码检查
task lint
task lint
Formatting
代码格式化
task format
task format
Combined quality checks
综合质量检查
task quality
undefinedtask quality
undefinedUsing Task vs Direct Commands
Task命令与直接命令的选择
When to Use Task
何时使用Task命令
Use commands when:
task- A Taskfile exists in the project
- You need to run standard development operations
- You want to discover available workflows
- You need consistency across team members
在以下场景使用命令:
task- 项目中存在Taskfile
- 你需要运行标准开发操作
- 你想要查找可用的工作流
- 你需要在团队成员间保持操作一致性
When Task Wraps Underlying Commands
Task如何封装底层命令
Tasks are typically thin wrappers around language-specific commands:
Example - Julia:
bash
undefinedTask任务通常是对特定语言命令的轻量封装:
示例 - Julia:
bash
undefinedTask command
Task命令
task test
task test
Underlying command it runs
其执行的底层命令
julia --project=. -e 'using Pkg; Pkg.test()'
**Example - R:**
```bashjulia --project=. -e 'using Pkg; Pkg.test()'
**示例 - R:**
```bashTask command
Task命令
task docs
task docs
Underlying command it runs
其执行的底层命令
Rscript -e "devtools::document()"
undefinedRscript -e "devtools::document()"
undefinedWhen to Use Direct Commands
何时使用直接命令
Use direct language commands when:
- No Taskfile exists
- You need advanced options not exposed by tasks
- You're doing exploratory work outside standard workflows
- Tasks don't cover your specific use case
在以下场景使用直接的语言命令:
- 项目中不存在Taskfile
- 你需要使用任务未暴露的高级选项
- 你正在进行标准工作流之外的探索性工作
- 任务无法覆盖你的特定使用场景
Task Workflow Examples
Task工作流示例
Typical Development Cycle
典型开发周期
bash
undefinedbash
undefined1. Discover what's available
1. 查找可用任务
task --list
task --list
2. Run fast iteration cycle
2. 运行快速迭代周期
task dev # Fast tests + fast docs
task dev # 快速测试 + 快速文档生成
3. Before committing
3. 提交代码前
task precommit # Pre-commit checks + tests
task precommit # 提交前验证 + 测试
4. Before pushing (optional)
4. 推送代码前(可选)
task ci # Full CI simulation
undefinedtask ci # 完整CI流水线模拟
undefinedFirst-Time Setup
首次环境搭建
bash
undefinedbash
undefined1. See what setup tasks exist
1. 查看可用的搭建任务
task --list | grep setup
task --list | grep setup
2. Run setup
2. 运行搭建命令
task setup # Install dependencies, configure environment
task setup # 安装依赖、配置环境
3. Verify setup
3. 验证搭建结果
task info # Show project and environment status
task info # 显示项目与环境状态
4. Test everything works
4. 测试所有功能是否正常
task test
undefinedtask test
undefinedTask Naming Conventions
Task任务命名规范
Common patterns in task names:
Prefixes:
- - Testing-related tasks
test:* - - Documentation tasks
docs:* - - Package management tasks
pkg:* - - CI/CD related tasks
ci:*
Suffixes:
- - Quick version of the task
*-fast - - Complete version including optional steps
*-full
Special names:
- - Fast development iteration cycle
dev - - Pre-commit validation
precommit - - Full CI pipeline
ci - - Initial project setup
setup - - Clean build artifacts
clean - - Show usage information
help
任务名称的常见模式:
前缀:
- - 测试相关任务
test:* - - 文档相关任务
docs:* - - 包管理相关任务
pkg:* - - CI/CD相关任务
ci:*
后缀:
- - 任务的快速版本
*-fast - - 包含可选步骤的完整版本
*-full
特殊名称:
- - 快速开发迭代周期
dev - - 提交前验证
precommit - - 完整CI流水线
ci - - 初始项目搭建
setup - - 清理构建产物
clean - - 显示使用信息
help
Integration with Language Tools
与语言工具的集成
Julia Projects
Julia项目
bash
undefinedbash
undefinedInstead of: julia --project=. -e 'using Pkg; Pkg.test()'
替代命令:julia --project=. -e 'using Pkg; Pkg.test()'
task test
task test
Instead of: julia --project=docs docs/make.jl --skip-notebooks
替代命令:julia --project=docs docs/make.jl --skip-notebooks
task docs-fast
task docs-fast
Instead of: julia --project=. -e 'using Pkg; Pkg.update()'
替代命令:julia --project=. -e 'using Pkg; Pkg.update()'
task pkg:update
undefinedtask pkg:update
undefinedR Projects
R项目
bash
undefinedbash
undefinedInstead of: Rscript -e "devtools::test()"
替代命令:Rscript -e "devtools::test()"
task test
task test
Instead of: Rscript -e "devtools::document()"
替代命令:Rscript -e "devtools::document()"
task docs
task docs
Instead of: Rscript -e "devtools::check()"
替代命令:Rscript -e "devtools::check()"
task check
undefinedtask check
undefinedPython Projects
Python项目
bash
undefinedbash
undefinedInstead of: pytest
替代命令:pytest
task test
task test
Instead of: sphinx-build docs docs/_build
替代命令:sphinx-build docs docs/_build
task docs
task docs
Instead of: pip install -e .
替代命令:pip install -e .
task install
undefinedtask install
undefinedTask Configuration Files
Task配置文件
Taskfile Location
Taskfile位置
Look for:
- in project root
Taskfile.yml - in project root
Taskfile.yaml
查找以下文件:
- 项目根目录下的
Taskfile.yml - 项目根目录下的
Taskfile.yaml
Understanding Task Definitions
理解任务定义
When reading a Taskfile:
- - Commands executed by the task
cmds: - - Dependencies run before this task
deps: - - Description shown in
desc:task --list - - Extended description for
summary:task <name> --help
阅读Taskfile时,关注以下字段:
- - 任务执行的命令
cmds: - - 执行此任务前需运行的依赖项
deps: - - 在
desc:中显示的描述task --list - -
summary:显示的扩展描述task <name> --help
Best Practices
最佳实践
- Always discover first: Run when entering a project
task --list - Use task help: Check for project-specific guidance
task help - Prefer tasks for standard workflows: Use tasks for dev, test, docs
- Direct commands for exploration: Use language commands for ad-hoc work
- Check task definitions: Look at Taskfile.yml to understand what tasks do
- Update documentation: If tasks change workflows, note it
- 始终先查找任务:进入项目时先运行
task --list - 使用Task帮助:查看获取项目特定指南
task help - 优先使用任务完成标准工作流:使用任务进行开发、测试、文档生成等操作
- 使用直接命令进行探索:使用语言命令进行临时工作
- 查看任务定义:查看Taskfile.yml以了解任务的具体执行逻辑
- 更新文档:如果任务改变了工作流,请记录相关变更
When to Use This Skill
何时使用本技能
Activate this skill when:
- Working with projects that have a Taskfile.yml/Taskfile.yaml
- You see mentions of "Task" or "task commands" in project documentation
- Project CLAUDE.md mentions using instead of direct commands
task - You need to discover available development workflows
- Running tests, building docs, or managing project development tasks
This skill helps you leverage Task automation rather than manually running underlying commands.
Project-specific task definitions and workflows remain in project documentation.
在以下场景激活本技能:
- 你正在处理包含Taskfile.yml/Taskfile.yaml的项目
- 你在项目文档中看到提及"Task"或"task commands"
- 项目CLAUDE.md中提到使用而非直接命令
task - 你需要查找可用的开发工作流
- 你需要运行测试、构建文档或管理项目开发任务
本技能可帮助你利用Task自动化工具,而非手动执行底层命令。项目特定的任务定义与工作流请参考项目文档。