justfile
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseJustfile
Justfile
Author and maintain Just task runners. House style matches this repo's root
: ≥ 1.55.0, , ,
/ / / , prefer for multi-line
bodies. Distill casey/Just principles; never paste third-party skill prose or
embed the casey README.
justfileminimum-versiondefault-listrequire()[default][doc][group][arg][script]Load reference files on demand from the index below — do not load all at once.
Frontmatter is for discovery; references carry deep procedure.
编写并维护Just任务运行器。内部规范(house style)需匹配本仓库根目录下的: ≥ 1.55.0、、、 / / / ,多行内容优先使用。提炼casey/Just的核心原则;请勿粘贴第三方技能文档或嵌入casey的README内容。
justfileminimum-versiondefault-listrequire()[default][doc][group][arg][script]按需从下方索引加载参考文件——请勿一次性加载全部文件。前置元数据用于功能探索;参考文件包含详细操作流程。
Permission posture
权限策略
write-scopedjustwrite-scopedDispatch
调度
| $ARGUMENTS | Mode |
|---|---|
(empty) / | Empty-args gallery |
| Create |
| Edit |
| Migrate |
| Check |
| Discover |
| Natural language about justfiles | Auto-detect |
| $ARGUMENTS | 模式 |
|---|---|
(空值) / | 空参数功能概览 |
| 创建 |
| 编辑 |
| 迁移 |
| 检查 |
| 探索 |
| 关于justfile的自然语言指令 | 自动检测 |
Auto-detection heuristic
自动检测规则
- Existing /
justfile+ modify/fix/rename → editJustfile - "migrate" / Makefile / scripts → just → migrate
package.json - "lint" / "check" / "fmt" / house-style audit → check
- "list" / "show" / "what recipes" / dump → discover
- New justfile or "add recipe" without existing file → create
- Pure shell / CI YAML / Make build semantics / mise / Compose → refuse (see negatives)
- 已存在/
justfile+ 修改/修复/重命名 → 编辑Justfile - 包含“migrate” / Makefile / 脚本 → 转换为just → 迁移
package.json - 包含“lint” / “check” / “fmt” / 内部规范审计 → 检查
- 包含“list” / “show” / “what recipes” / dump → 探索
- 新建justfile或无现有文件时“添加脚本” → 创建
- 纯Shell / CI YAML / Make构建语义 / mise / Compose → 拒绝处理(参见不适用场景)
Empty args
空参数
When is empty, show the mode gallery, posture line, critical rules
summary, and reference index. Do not invent a mutating default.
$ARGUMENTS当为空时,展示模式概览、权限策略、核心规则摘要及参考索引。请勿默认执行任何会修改内容的操作。
$ARGUMENTSCanonical vocabulary
标准术语
Use these exactly (canonical terms):
| Term | Meaning |
|---|---|
| May write justfiles; ask before destructive runs/deletes |
| house style | This repo's justfile conventions ( |
| discover | Read-only inspect via |
| migrate | Map Makefile/npm task scripts into Just recipes |
| Multi-line script recipe attribute (never combine with recipe-level |
| opt-in gate | Create-mode confirmations before overwrite or side effects |
请严格使用以下标准术语:
| 术语 | 含义 |
|---|---|
| 可写入justfile;执行破坏性运行/删除操作前需征得同意 |
| house style | 本仓库的justfile规范( |
| discover | 通过 |
| migrate | 将Makefile/npm任务脚本映射为Just脚本 |
| 多行脚本属性(请勿与脚本级 |
| opt-in gate | 创建模式下,覆盖文件或执行副作用操作前需确认 |
Critical rules
核心规则
- Version-first — run before using mid-2026 attributes; prefer ≥1.55.0.
just --version - Quiet vs script — never put on a
@recipe; use[script]only for line quieting.@ - Prefer for multi-line shell; avoid fragile escaped multi-line recipes.
[script] - No blind — inspect with
--fmt/--dumpfirst; apply--checkonly with intent.--fmt - Dry-run / inspect before side effects — discover with /
--listbefore running recipes that write, delete, or network.--show - check.py-before-complete — after skill or justfile edits in this repo skill, run from
uv run python scripts/check.pybefore declaring done.skills/justfile/ - No secrets in justfiles — use env / dotenv / user-owned secrets; never hardcode tokens.
- Ask before deleting Makefile or other source runners during migrate.
- 版本优先 —— 使用2026年中期新增的属性前,先运行;优先使用≥1.55.0版本。
just --version - 静默模式vs脚本 —— 请勿在脚本上添加
[script];仅在需要单行静默时使用@。@ - **优先使用**处理多行Shell代码;避免使用脆弱的转义多行脚本。
[script] - 勿盲目使用—— 先通过
--fmt/--dump查看内容;仅在明确需求时应用--check。--fmt - 执行副作用前先试运行/查看 —— 运行会写入、删除或联网的脚本前,先通过/
--list进行探索。--show - 完成前运行check.py —— 在本仓库技能中修改技能或justfile后,需从目录运行
skills/justfile/,再标记任务完成。uv run python scripts/check.py - justfile中禁止存储密钥 —— 使用环境变量/dotenv/用户自有密钥;切勿硬编码令牌。
- 迁移期间删除Makefile或其他源运行器前需征得同意。
Operator contract
操作协议
create
createcreate
create- Confirm target path; refuse overwrite without explicit approval.
- Load references/create.md (includes opt-in gate).
- Scaffold house-style settings + list recipe + grouped docs.
[default] - Prefer for hard deps; document optional tools.
require("tool")
- 确认目标路径;未经明确许可,拒绝覆盖现有文件。
- 加载references/create.md(包含opt-in gate确认步骤)。
- 生成符合内部规范的设置 + 列表脚本 + 分组文档。
[default] - 硬依赖优先使用;记录可选工具。
require("tool")
edit
editedit
edit- Read the target justfile; run discover inspect if recipes unclear.
- Load references/edit.md.
- Preserve house settings; migrate Make-flavored comment docs to
##.[doc]
- 读取目标justfile;若脚本不清晰,先执行探索查看操作。
- 加载references/edit.md。
- 保留内部规范设置;将Make风格的注释文档迁移至
##。[doc]
migrate
migratemigrate
migrate- Inventory Makefile / npm scripts; map to recipes (see references/migrate.md).
- Keep sources until user approves deletion.
- Convert Make help to Just
##/[doc]— never keep Make comment-docs as the Just help system.default-list
- 梳理Makefile/npm脚本;映射为Just脚本(参见references/migrate.md)。
- 保留源文件,直至用户批准删除。
- 将Make的帮助注释转换为Just的
##/[doc]—— 切勿保留Make注释文档作为Just的帮助系统。default-list
check
checkcheck
check- Load references/check.md.
- , then
just --version/--list/--dumpas needed.--check - Report house-style gaps; do not auto-unless asked.
--fmt
- 加载references/check.md。
- 先运行,再根据需要执行
just --version/--list/--dump。--check - 报告不符合内部规范的内容;除非用户要求,否则勿自动执行。
--fmt
discover
discoverdiscover
discover- Load references/discover.md.
- Prefer read-only: ,
--list,--show(--dump),--dump-format=json.--groups - Link casey manual for deep semantics: https://just.systems/man/en/
- 加载references/discover.md。
- 优先使用只读命令:,
--list,--show(--dump),--dump-format=json。--groups - 链接casey官方手册获取深层语义:https://just.systems/man/en/
When NOT to use
不适用场景
- Shell script generation →
shell-scripter - Shell convention-only edits →
shell-conventions - CI/CD workflow YAML →
devops-engineer - Make file-timestamp / pattern-rule builds (not task recipes)
- Docker Compose authorship
- Toolchain version management as the product → mise tooling
See references/when-not-just.md.
- Shell脚本生成 → 使用
shell-scripter - 仅修改Shell规范 → 使用
shell-conventions - CI/CD工作流YAML → 使用
devops-engineer - Make文件时间戳 / 模式规则构建(非任务脚本)
- Docker Compose编写
- 以工具链版本管理为核心需求 → 使用mise工具
参见references/when-not-just.md。
Reference index
参考索引
| File | Use when |
|---|---|
| references/discover.md | Inspect recipes with just CLI |
| references/create.md | New justfile + opt-in gate |
| references/edit.md | Change existing recipes/settings |
| references/migrate.md | Makefile / npm → just |
| references/check.md | Lint / fmt-check / house-style audit |
| references/when-not-just.md | Scope refusals and redirects |
| references/pitfalls.md | Common Just footguns |
| references/patterns.md | House-style recipe patterns |
| 文件 | 适用场景 |
|---|---|
| references/discover.md | 使用just CLI查看脚本 |
| references/create.md | 新建justfile + opt-in gate确认 |
| references/edit.md | 修改现有脚本/设置 |
| references/migrate.md | Makefile / npm → just迁移 |
| references/check.md | 代码检查/格式检查/内部规范审计 |
| references/when-not-just.md | 范围拒绝与重定向 |
| references/pitfalls.md | Just常见陷阱 |
| references/patterns.md | 符合内部规范的脚本模式 |
Validation Contract
验证协议
Run from this skill directory before declaring changes complete:
bash
uv run python scripts/check.py
uv run python skills/skill-creator/scripts/audit.py skills/justfile/
uv run python skills/skill-creator/scripts/package.py skills/justfile --dry-runscripts/check.pyvalidate_skill.pyvalidate_evals.py- exits 0.
uv run python scripts/check.py - Audit grade A (≥90).
- Package reports portable with no errors.
--dry-run - No portable-CLI violations remain under this skill directory.
在标记修改完成前,从本技能目录运行以下命令:
bash
uv run python scripts/check.py
uv run python skills/skill-creator/scripts/audit.py skills/justfile/
uv run python skills/skill-creator/scripts/package.py skills/justfile --dry-runscripts/check.pyvalidate_skill.pyvalidate_evals.py- 执行后退出码为0。
uv run python scripts/check.py - 审计等级为A(≥90分)。
- 包构建报告可移植且无错误。
--dry-run - 本技能目录下无违反可移植CLI规范的内容。
Example Blocks
示例命令
When is empty, show:
$ARGUMENTS/justfile/justfile help/justfile create <description>/justfile edit <path|recipe>/justfile migrate <Makefile|package.json>/justfile check [path]/justfile discover [query]
State the boundary (justfile writes OK; ask before destructive
recipe runs or Makefile deletion) and the validation command:
write-scopedbash
uv run python skills/justfile/scripts/check.py当为空时,展示以下命令:
$ARGUMENTS/justfile/justfile help/justfile create <description>/justfile edit <path|recipe>/justfile migrate <Makefile|package.json>/justfile check [path]/justfile discover [query]
说明边界(可写入justfile;执行破坏性脚本运行或删除Makefile前需征得同意)及验证命令:
write-scopedbash
uv run python skills/justfile/scripts/check.py