关于 task-runner
task-runner 是通过跨平台命令运行器 just 执行项目专属命令的技能。它介绍如何发现可用配方,并运行测试、构建和代码检查等任务。
主要功能
- 01列出可用配方
- 02查看配方详情
- 03运行项目定义的命令
- 04执行测试、构建和代码检查
适用场景
- 01发现新项目中的可用命令
- 02运行项目测试或构建任务
- 03执行前查看配方详情
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ 0xdarkmatter/ claude-mods --skill task-runner安装后在 Claude Code 中输入/task-runner确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
assets/.gitkeepreferences/.gitkeepscripts/.gitkeep详细介绍
任务运行器
用途
使用现代命令运行器 just 执行项目专用命令。just 比 make 更简单,且支持跨平台。
工具
| 工具 | 命令 | 用途 |
|---|---|---|
| just | just | 列出可用的配方 |
| just | just test | 运行指定配方 |
使用示例
基本用法
# List all available recipes
just
# Run a recipe
just test
just build
just lint
# Run recipe with arguments
just deploy production
# Run specific recipe from subdirectory
just --justfile backend/justfile test
常见的 justfile 配方
# Example justfile
# Run tests
test:
pytest tests/
# Build project
build:
npm run build
# Lint code
lint:
ruff check .
eslint src/
# Start development server
dev:
npm run dev
# Clean build artifacts
clean:
rm -rf dist/ build/ *.egg-info/
# Deploy to environment
deploy env:
./scripts/deploy.sh {{env}}
探索
# Check if justfile exists
just --summary
# Show recipe details
just --show test
# List recipes with descriptions
just --list
适用场景
- 首先运行:
just,查看可用的项目命令 - 运行测试:
just test - 构建:
just build - 执行任何项目专用任务
- 跨平台运行命令
最佳实践
进入新项目时,务必检查是否有 justfile:
just --list
无需阅读文档即可查看可用命令。
评论
支持 Markdown