npx skills add https://github.com/terrylica/cc-skills --skill mise-tasks使用 mise 的 [tasks] 部分来编排多步骤项目工作流,具备依赖管理、参数处理和文件跟踪功能。
显式触发条件:
mise tasks、mise run、[tasks] 部分depends、depends_post.mise.toml 中实现工作流自动化usage 规范AI 发现触发条件(建议性):
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
当
mise-configuration技能检测到多步骤工作流(测试套件、构建流水线、迁移)时,建议性地调用此技能以生成适当的[tasks]定义。
[tasks.build]
description = "构建项目"
run = "cargo build --release"
mise run build # 运行单个任务
mise run test build # 运行多个任务
mise run test ::: build # 并行运行
mise r build # 简写形式
| 类型 | 语法 | 何时运行 |
|---|---|---|
depends | depends = ["lint", "test"] | 在任务之前运行 |
depends_post | depends_post = ["notify"] | 在任务成功之后运行 |
wait_for | wait_for = ["db"] | 仅当依赖任务运行时才等待 |
| 属性 | 用途 | 示例 |
|---|---|---|
description | AI 代理可发现性(关键) | "运行 pytest 并生成覆盖率报告。失败时退出码非零。" |
alias | 简短名称 | alias = "t" |
dir | 工作目录 | dir = "packages/frontend" |
env | 任务特定的环境变量(不传递给依赖项) | env = { LOG_LEVEL = "debug" } |
hide | 在 mise tasks 输出中隐藏 | hide = true |
sources | 用于缓存的文件跟踪 | sources = ["src/**/*.rs"] |
outputs | 如果比源文件新则跳过 | outputs = ["target/release/myapp"] |
confirm | 执行前提示 | confirm = "删除所有数据?" |
quiet | 抑制 mise 输出 | quiet = true |
silent | 抑制所有输出 | silent = true |
raw | 直接 stdin/stdout(禁用并行) | raw = true |
tools | 任务特定的工具版本 | tools = { python = "3.9" } |
shell | 自定义 shell | shell = "pwsh -c" |
usage | 参数规范(优先于 Tera) | 参见 任务参数 |
mise run 'test:*' # 所有以 test: 开头的任务
mise run 'db:**' # 嵌套任务:db:migrate:up, db:seed:test
mise tasks --hidden # 查看隐藏任务(以 _ 为前缀)
关于所有级别的详细示例和模式,请参阅 任务级别参考。
要求:MISE_EXPERIMENTAL=1 和 experimental_monorepo_root = true
mise run //projects/frontend:build # 从根目录开始的绝对路径
mise run :build # 当前 config_root
mise run //...:test # 所有项目
mise run '//projects/...:build' # 构建 projects/ 下的所有项目
子目录中的任务会自动发现并带有路径前缀(packages/api/.mise.toml 中的任务变为 packages/api:taskname)。
完整的单体仓库文档,请参阅:advanced.md
对于重度使用 Python 的多语言单体仓库(10-50 个包),结合使用 mise 进行运行时管理和 Pants 进行构建编排及原生变更检测。
| 工具 | 职责 |
|---|---|
| mise | 运行时版本(Python、Node、Rust)+ 环境变量 |
| Pants | 构建编排 + 原生变更检测 + 依赖推断 |
# 原生变更检测(无需手动 git 脚本)
pants --changed-since=origin/main test
pants --changed-since=origin/main lint
pants --changed-since=origin/main package
| 规模 | 推荐方案 |
|---|---|
| < 10 个包 | mise + 自定义变更检测(级别 10 模式) |
| 10-50 个包(重度使用 Python) | Pants + mise(本节内容) |
| 50+ 个包 | 考虑 Bazel |
完整的 Pants + mise 集成指南和工具比较,请参阅 polyglot-affected.md。
任务自动继承 [env] 值。使用 _.file 处理外部环境文件,使用 redact = true 处理密钥。
[env]
DATABASE_URL = "postgresql://localhost/mydb"
_.file = { path = ".env.secrets", redact = true }
[tasks._check-env]
hide = true
run = '[ -n "$API_KEY" ] || { echo "Missing API_KEY"; exit 1; }'
[tasks.deploy]
depends = ["_check-env"]
run = "deploy.sh" # $DATABASE_URL 和 $API_KEY 可用
完整的环境集成模式,请参阅 环境集成。
| 反模式 | 为何不好 | 替代方案 |
|---|---|---|
| 用 mise tasks 替换 /itp:go | 没有 TodoWrite,没有 ADR 跟踪,没有检查点 | 使用 mise tasks 处理项目工作流,使用 /itp:go 进行 ADR 驱动开发 |
| 在任务中硬编码密钥 | 安全风险 | 使用 _.file = ".env.secrets" 并设置 redact = true |
| 庞大的单体任务 | 难以调试,无法复用 | 拆分为具有依赖关系的小任务 |
跳过或最小化 description | AI 代理无法仅从名称推断任务目的 | 编写丰富的描述:它做什么、需要什么、产生什么、何时运行 |
发布没有构建 depends | 运行时失败而非 DAG 预防 | 在发布任务中添加 depends = ["build"] |
| 编排器不包含所有阶段 | "接下来运行 X" 的消息被忽略 | 在 release:full 的依赖数组中包含所有阶段 |
特定于发布的反模式和模式,请参阅 发布工作流模式。
先决条件:在定义任务之前,确保 [env] 部分已配置。
建议性:定义任务后,调用
mise-configuration技能 以确保应用 [env] 单一事实来源模式。
mise-configuration 技能涵盖:
[env] - 带有默认值的环境变量[settings] - mise 行为配置[tools] - 版本锁定_.file、_.path、_.python.venv| 问题 | 原因 | 解决方案 |
|---|---|---|
| 找不到任务 | 拼写错误或错误的 mise.toml | 运行 mise tasks 列出可用任务 |
| 依赖项未运行 | 循环依赖 | 检查任务的 depends 数组是否存在循环 |
| sources 不工作 | 错误的 glob 模式 | 使用相对于 mise.toml 位置的路径 |
| watch 未触发 | 文件不在 sources 列表中 | 将文件模式添加到 sources 数组 |
| 环境变量不可用 | 任务在错误的目录中 | 确保 mise.toml 在 cwd 或其父目录中 |
| 运行失败并报错 | 脚本路径问题 | 使用绝对路径或相对于 mise.toml 的路径 |
每周安装次数
128
仓库
GitHub 星标数
22
首次出现
2026年1月24日
安全审计
安装于
opencode121
gemini-cli120
codex119
github-copilot118
cursor116
amp115
Orchestrate multi-step project workflows using mise [tasks] section with dependency management, argument handling, and file tracking.
Explicit triggers :
mise tasks, mise run, [tasks] sectiondepends, depends_post.mise.tomlusage specAI Discovery trigger (prescriptive):
When
mise-configurationskill detects multi-step workflows (test suites, build pipelines, migrations), prescriptively invoke this skill to generate appropriate[tasks]definitions.
[tasks.build]
description = "Build the project"
run = "cargo build --release"
mise run build # Run single task
mise run test build # Run multiple tasks
mise run test ::: build # Run in parallel
mise r build # Short form
| Type | Syntax | When |
|---|---|---|
depends | depends = ["lint", "test"] | Run BEFORE task |
depends_post | depends_post = ["notify"] | Run AFTER task succeeds |
wait_for | wait_for = ["db"] | Wait only if running |
| Property | Purpose | Example |
|---|---|---|
description | AI-agent discoverability (CRITICAL) | "Run pytest with coverage. Exits non-zero on failure." |
alias | Short name | alias = "t" |
dir | Working directory | dir = "packages/frontend" |
env |
mise run 'test:*' # All tasks starting with test:
mise run 'db:**' # Nested: db:migrate:up, db:seed:test
mise tasks --hidden # View hidden tasks (prefixed with _)
For detailed examples and patterns for all levels, see Task Levels Reference.
Requires : MISE_EXPERIMENTAL=1 and experimental_monorepo_root = true
mise run //projects/frontend:build # Absolute from root
mise run :build # Current config_root
mise run //...:test # All projects
mise run '//projects/...:build' # Build all under projects/
Tasks in subdirectories are auto-discovered with path prefix (packages/api/.mise.toml tasks become packages/api:taskname).
For complete monorepo documentation, see: advanced.md
For Python-heavy polyglot monorepos (10-50 packages), combine mise for runtime management with Pants for build orchestration and native affected detection.
| Tool | Responsibility |
|---|---|
| mise | Runtime versions (Python, Node, Rust) + environment variables |
| Pants | Build orchestration + native affected detection + dependency inference |
# Native affected detection (no manual git scripts)
pants --changed-since=origin/main test
pants --changed-since=origin/main lint
pants --changed-since=origin/main package
| Scale | Recommendation |
|---|---|
| < 10 packages | mise + custom affected (Level 10 patterns) |
| 10-50 packages (Python-heavy) | Pants + mise (this section) |
| 50+ packages | Consider Bazel |
See polyglot-affected.md for complete Pants + mise integration guide and tool comparison.
Tasks automatically inherit [env] values. Use _.file for external env files and redact = true for secrets.
[env]
DATABASE_URL = "postgresql://localhost/mydb"
_.file = { path = ".env.secrets", redact = true }
[tasks._check-env]
hide = true
run = '[ -n "$API_KEY" ] || { echo "Missing API_KEY"; exit 1; }'
[tasks.deploy]
depends = ["_check-env"]
run = "deploy.sh" # $DATABASE_URL and $API_KEY available
For full env integration patterns, see Environment Integration.
| Anti-Pattern | Why Bad | Instead |
|---|---|---|
| Replace /itp:go with mise tasks | No TodoWrite, no ADR tracking, no checkpoints | Use mise tasks for project workflows, /itp:go for ADR-driven development |
| Hardcode secrets in tasks | Security risk | Use _.file = ".env.secrets" with redact = true |
| Giant monolithic tasks | Hard to debug, no reuse | Break into small tasks with dependencies |
Skip or minimal description | AI agents cannot infer task purpose from name alone | Write rich descriptions: what it does, requires, produces, when to run |
Publish without build depends | Runtime failure instead of DAG prevention |
For release-specific anti-patterns and patterns, see Release Workflow Patterns.
Prerequisites : Before defining tasks, ensure [env] section is configured.
PRESCRIPTIVE : After defining tasks, invoke
mise-configurationskill to ensure [env] SSoT patterns are applied.
The mise-configuration skill covers:
[env] - Environment variables with defaults[settings] - mise behavior configuration[tools] - Version pinning_.file, _.path, _.python.venv| Issue | Cause | Solution |
|---|---|---|
| Task not found | Typo or wrong mise.toml | Run mise tasks to list available tasks |
| Dependencies not run | Circular dependency | Check task depends arrays for cycles |
| Sources not working | Wrong glob pattern | Use relative paths from mise.toml location |
| Watch not triggering | File outside sources list | Add file pattern to sources array |
| Env vars not available | Task in wrong directory | Ensure mise.toml is in cwd or parent |
| Run fails with error | Script path issue | Use absolute path or relative to mise.toml |
Weekly Installs
128
Repository
GitHub Stars
22
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode121
gemini-cli120
codex119
github-copilot118
cursor116
amp115
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
138,800 周安装
| Task-specific env vars (NOT passed to deps) |
env = { LOG_LEVEL = "debug" } |
hide | Hidden from mise tasks output | hide = true |
sources | File tracking for caching | sources = ["src/**/*.rs"] |
outputs | Skip if newer than sources | outputs = ["target/release/myapp"] |
confirm | Prompt before execution | confirm = "Delete all data?" |
quiet | Suppress mise output | quiet = true |
silent | Suppress ALL output | silent = true |
raw | Direct stdin/stdout (disables parallelism) | raw = true |
tools | Task-specific tool versions | tools = { python = "3.9" } |
shell | Custom shell | shell = "pwsh -c" |
usage | Argument spec (preferred over Tera) | See Task Arguments |
Add depends = ["build"] to publish tasks |
| Orchestrator without all phases | "Run X next" messages get ignored | Include all phases in release:full depends array |