dprint
Runs dprint for the project. The first argument selects the action - init checks for the plugin's minimum dprint version, installs or updates dprint at user level after confirmation via AskUserQuestion, offers to create a dprint config when none exists and to add dprint plugins for file types the config does not cover; check [scope] runs dprint check; fmt [scope] runs dprint fmt and rewrites files; without an argument it runs fmt on the whole current directory. Use init when the user wants dprint set up, installed, updated, checked or its plugins completed; check when they want formatting verified with dprint; fmt only when they ask to format files with dprint. When invoking this skill yourself, always pass init, check or fmt as the first argument.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- dprint
- description
- Runs dprint for the project. The first argument selects the action - init checks for the plugin's minimum dprint version, installs or updates dprint at user level after confirmation via AskUserQuestion, offers to create a dprint config when none exists and to add dprint plugins for file types the config does not cover; check [scope] runs dprint check; fmt [scope] runs dprint fmt and rewrites files; without an argument it runs fmt on the whole current directory. Use init when the user wants dprint set up, installed, updated, checked or its plugins completed; check when they want formatting verified with dprint; fmt only when they ask to format files with dprint. When invoking this skill yourself, always pass init, check or fmt as the first argument.
- allowed-tools
- [ "AskUserQuestion", "Bash(node:*)" ]
- argument-hint
- [init|check|fmt] [scope]
02 资源文件 10
- 脚本check-dprint.mjs1.3 KB
- 参考文档check-dprint.reference.md3.3 KB
- 脚本config-names.mjs134 B
- 参考文档dprint-plugins.json5.5 KB
- 脚本find-config.mjs538 B
- 脚本find-dprint.mjs1.3 KB
- 脚本run-dprint.mjs985 B
- 参考文档run-dprint.reference.md5.0 KB
- 脚本scan-plugins.mjs3.0 KB
- 参考文档scan-plugins.reference.md5.1 KB
03 SKILL.md 正文
dprint
Runs one of three actions, selected by the first argument:
init: makes sure a usable dprint is installed, a dprint config exists and the config's plugins cover the project's file types.check [scope]: runsdprint check(read-only).fmt [scope]: runsdprint fmt, which rewrites files in place.
Without any argument the skill runs fmt on the whole current working directory. scope limits
check / fmt to one file, directory or glob; without it dprint runs on the current directory.
dprint may treat an explicit scope as overriding the config's includes (the excludes still
apply), so fmt with a scope can rewrite files the config leaves out.
check and fmt need dprint and a project dprint config (in the current directory or an
ancestor up to the git root); when either is missing they run nothing and tell the user to run /dprint init
(/dprint:dprint init) first.
init makes sure a usable dprint (a native binary, or the dprint npm package via npx when no binary is
installed), at least the minimum version pinned in check-dprint.mjs, is available. Detection is read-only. Installing or updating happens only after an explicit
Install / Update answer, and the command then runs visibly through the Bash tool (its normal
permission prompt is a second gate; install/update commands are deliberately not pre-allowed).
With a usable dprint it then scans the project's file types against dprint-plugins.json and, per
uncovered type, offers matching plugins; a plugin is added only after an explicit answer, via
dprint config add through the normal Bash permission prompt. When the current directory has no
dprint config, init offers to create one via dprint init -y, only after an explicit Create
answer.
Dispatch
Arguments: "$ARGUMENTS"
- Split the arguments above (empty when none were given):
- action: the first whitespace-separated word (case-sensitive).
- scope: everything after that word, trimmed. If the whole scope is enclosed in one matching
pair of
'or", remove that pair. Alter nothing else: spaces inside stay, and the scope is passed to dprint as one argument.
- Branch:
-
No arguments at all: action
fmtwithout scope; go to## check / fmt. -
checkorfmt: go to## check / fmtwith that scope (empty scope = no scope). -
initwith an empty scope: go to## init, steps 1-8. -
initwith a non-empty scope, or any other first word: print this line and stop, running nothing:usage: /dprint [init|check|fmt] [scope] (no argument = fmt on the whole current directory)
-
check / fmt
-
Read
${CLAUDE_SKILL_DIR}/run-dprint.reference.md(output and exit-code contract). -
From the current working directory, run exactly one Bash command. Without a scope:
node ${CLAUDE_SKILL_DIR}/run-dprint.mjs <check|fmt>With a scope, single-quote it so the shell passes it unchanged and expands no globs; write each
'inside the scope as'\'':node ${CLAUDE_SKILL_DIR}/run-dprint.mjs <check|fmt> '<scope>' -
Branch on the exit code. No retry in any case:
3(not set up): tell the user that dprint must first be initialized with/dprint init(/dprint:dprint init) and name the reason from thestatus=notsetup reason=line (missing= no dprint found,noconfig= no dprint config in this directory or its ancestors up to the git root). Run nothing else and never start init on your own.0: report success; forfmt, quote dprint's summary line if it printed one.20(check): list the unformatted files from the output and mention/dprint fmtwith the same scope.14: report that no files matched the scope.2: report the stderr diagnostic.- Any other code: report dprint's error output and the exit code.
init
-
All questions go through the
AskUserQuestiontool, never as plain text. Never run an install or update command without an explicitInstall/Updateanswer. Never runconfig addwithout an explicit answer naming that plugin. Never run<dprint> init -ywithout an explicitCreateanswer. -
Read
${CLAUDE_SKILL_DIR}/check-dprint.reference.md(output line and exit-code contract). -
Run the check:
node ${CLAUDE_SKILL_DIR}/check-dprint.mjsParse
status,version,minandpathfrom its single stdout line. From here on,<dprint>means<path>, ornpx --yes dprintwhenpathisnpx(dprint runs through npx because no binary is installed). Branch on the exit code, per the table incheck-dprint.reference.md:0(ok): reportdprint <version> at <path> (>= <min>), ordprint <version> via npx (>= <min>)whenpathisnpx, and go to step 7. Ask nothing about installing.2(error): report the stderr diagnostic and stop. Never guess, never install.10(missing) or11(outdated): go to step 4.
-
Ask exactly one
AskUserQuestion, single-select (multiSelect: false), no pre-selected option:- missing (exit 10):
- header:
dprint [currently: not installed] - question:
Install dprint (minimum <min>) to ~/.dprint/bin (or $DPRINT_INSTALL/bin when set) via the official installer? - options:
Install, described as "Runs curl -fsSL https://dprint.dev/install.sh | sh";Skip, described as "Install nothing."
- header:
- outdated (exit 11) with
path=npx(upgradedoes not apply to npx):- header:
dprint [currently: <version> via npx, needs >= <min>] - question:
Install dprint (minimum <min>) to ~/.dprint/bin (or $DPRINT_INSTALL/bin when set) via the official installer? It takes precedence over npx. - options:
Install, described as "Runs curl -fsSL https://dprint.dev/install.sh | sh";Skip, described as "Install nothing."
- header:
- outdated (exit 11) with an absolute
path:- header:
dprint [currently: <version>, needs >= <min>] - question:
Update dprint at <path>? - options:
Update, described as the exact update command chosen in step 5 (for example "Runs <path> upgrade");Skip, described as "Change nothing."
- header:
Skip, or any answer other thanInstall/Update: report "skipped, nothing changed" and stop (no plugin scan without a usable dprint).
- missing (exit 10):
-
Apply only after
Install/Update, via the Bash tool, one command, visibly:-
Install:
curl -fsSL https://dprint.dev/install.sh | sh -
Update (every outdated version has the
upgradesubcommand, since the minimum is far above 0.30.0):<path> upgrade -
Non-zero exit (or the permission prompt is denied): report the command's error output and stop. No retry, no fallback to another install method.
-
-
Re-run the check:
node ${CLAUDE_SKILL_DIR}/check-dprint.mjs-
Exit
0: report the new version and path. Ifpathis<home>/.dprint/bin/dprint(or$DPRINT_INSTALL/bin/dprint; use that directory in the line below), also check whether that directory is onPATHwithnode -e "console.log(process.env.PATH)". If it is not, print this line for the user to add to their shell profile (never edit shell rc files yourself):export PATH="$HOME/.dprint/bin:$PATH"Then go to step 7.
-
Non-zero exit: report the state and stop. If it is still
outdatedafter the upgrade, dprint is likely managed by a package manager (npm, Homebrew, ...) that refused the self-upgrade: tell the user to update it through that package manager. Never force a reinstall that would shadow the managed copy.
-
-
Plugin coverage. Only reached with exit
0from step 3 or step 6.<dprint>is built (as defined in step 3) from thepathof that check.-
Read
${CLAUDE_SKILL_DIR}/scan-plugins.reference.md(output lines and exit-code contract). -
From the project root, run the scan and report every stderr line:
node ${CLAUDE_SKILL_DIR}/scan-plugins.mjsParse
status,configandmissingfrom the first stdout line andtype,filesandcandidatesfrom each following line, then branch on the exit code:0(ok): report "<config>covers every detected file type" and go to step 8.11(noconfig): if the create question was not yet asked in this run, ask exactly oneAskUserQuestion, single-select (multiSelect: false), no pre-selected option:-
header:
dprint config -
question:
No dprint config (dprint.json, dprint.jsonc, .dprint.json, .dprint.jsonc, .config/dprint.json, .config/dprint.jsonc) in the current directory or an ancestor up to the git root. Create dprint.json here with plugins for the file types found? -
options:
Create, described as "Runs<dprint> init -y";Skip, described as "Create no config; the plugin scan, check and fmt need one." -
Create: run it via the Bash tool, one command, visibly (its normal permission prompt applies):<dprint> init -yNon-zero exit (or the permission prompt is denied): report the command's error output and go to step 8. Success: go to step 7.5.
-
Skip, any other answer, or the question was already asked in this run: report "no dprint config; plugin scan skipped" and go to step 8.
-
2(error): report the stderr diagnostic and go to step 8.10(missing): continue with step 7.3.
-
Take the first
type=line whose type has not been asked about in this run. If there is none, go to step 8. Ask exactly oneAskUserQuestion, single-select (multiSelect: false), no pre-selected option:- header: the type (for example
.ts,Dockerfile), cut to 12 characters - question with one candidate:
No plugin in <config> formats <type> files (<files> found). Add the dprint plugin <candidate>? - question with several candidates:
No plugin in <config> formats <type> files (<files> found). Which dprint plugin should format them?With more than 3 candidates, appendOther candidates (type the exact name via Other): <4th>, <5th>, ... - options: the first 3 candidates in output order, each labelled with the candidate name and
described as "Runs
<dprint> config add <candidate>"; thenSkip, described as "Add nothing for<type>." - The chosen plugin is the selected candidate label, or an "Other" answer that exactly equals one of this line's candidates: go to step 7.4.
Skip, or any other answer: record<type>as skipped and go to step 7.5.
- header: the type (for example
-
Add the chosen plugin via the Bash tool, one command, visibly:
<dprint> config add <candidate>Non-zero exit (or the permission prompt is denied): report the command's error output, ask nothing further and go to step 8. No retry.
-
Re-run
node ${CLAUDE_SKILL_DIR}/scan-plugins.mjs(an added plugin may cover further types) and branch as in step 7.2, except that exit10goes back to step 7.3.
-
-
Final output, as a terse bullet list:
- state before (
status,version,path) - action taken (command run, or "skipped")
- state after (
status,version,path, plus theexport PATHline when needed) - plugin scan: config file (and the
<dprint> init -ycommand run when step 7.2 created it), plugins added (eachconfig addcommand run), types skipped, types still uncovered. If the scan did not run, say why.
- state before (
04 同仓库更多 Skills
universal-lint
User-invoked. Takes a free-text description of a set of files ("all files in src/", "files changed in PR 123", or an explicit list) and lints each of them exactly as this plugin's Write/Edit hook would — read-only, no autofix — printing one aggregated findings report. Self-contained: depends on no other plugin.
solve
Single entry point for any coding task (change, feature, refactor, bug). Triages the task through the jev-api tools and routes it to the right track, loading the phase references it needs. Flags --headless (the decider agent answers every question) and --size=<S|M|L|XL>. Use when the user hands over a task to implement or fix.
split-hooks-lib
Split the hooks module of a function-hooks plugin of this repository into a readable entry register.mts plus helper modules that the build bundles into one compressed plugin/hooks/lib.mjs, to keep the shipped size small. Use when the user asks to split a plugin's register.mts, to make a plugin smaller, to move a plugin to register.mjs plus lib.mjs, or when a hooks module has grown too large for one file.
__SKILL_NAME__
__SKILL_DESCRIPTION__ Use when the user asks to …
scaffold-plugin
Scaffold a new Claude Code plugin in this repository with the repo layout (<name>/package.json, plugin/, src/, tests/). Use when the user asks to create, add, scaffold or start a new plugin here.
refactor-plugin
Refactor one plugin of this repository end to end in a fresh worktree on its own branch cut from a freshly fetched origin/main - perf-worklist, then bughunt, then a merge-ready PR. Use when the user asks to refactor, overhaul or run the full performance and bug hunt pass on a plugin.