一键导入
on-edit-formatter
Apply code formatting rules after file edits in the source directory. Use when asked to format code or after making changes to source files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Apply code formatting rules after file edits in the source directory. Use when asked to format code or after making changes to source files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| title | on-edit-formatter |
| name | on-edit-formatter |
| description | Apply code formatting rules after file edits in the source directory. Use when asked to format code or after making changes to source files. |
| paths | ["src/**","lib/**"] |
| allowed-tools | Bash(npx prettier --write *) Bash(npx eslint --fix *) |
| user-invocable | false |
After making any file edit in src/ or lib/, apply formatting automatically. This skill runs as background context — Claude applies these rules after edits without the user needing to ask.
Run:
npx prettier --write <path-to-edited-file>
Replace <path-to-edited-file> with the actual path of the file that was just edited.
If prettier modifies the file, note what changed (e.g., "Reformatted 3 lines in src/auth/login.ts").
If prettier is not installed or not configured (no .prettierrc, prettier.config.js, or prettier key in package.json), skip this step and note: "prettier not configured in this project."
Run:
npx eslint --fix <path-to-edited-file>
Replace <path-to-edited-file> with the same path.
If eslint --fix makes changes, note what was fixed.
If eslint reports errors that --fix cannot resolve automatically, list them clearly so the user is aware. Do not hide linting errors.
If eslint is not installed or not configured (no .eslintrc*, eslint.config.*, or eslintConfig key in package.json), skip this step and note: "eslint not configured in this project."
Summarize what was done:
If neither tool is installed, report that and do not treat it as an error. The task proceeds normally.
Explains code in plain language for someone unfamiliar with the programming language. Use when asked to explain code, walk through logic, describe what a function does, or when the user says "explain this" or "walk me through this".
Summarizes uncommitted git changes in a concise machine-readable format. Use in CI pipelines, scripts, or headless invocations where the output will be piped or captured.
Explains what a skill is and demonstrates that skills are working. Use when testing skills, when asked about skills, or when asked to demonstrate how skills work.
Demonstrates the personal scope for Claude Code skills. Use when testing personal-scoped skills or when the user wants to understand the difference between personal and project skill scopes.
Lists the conventions for this project and demonstrates the project scope for Claude Code skills. Use when asked about project conventions, code style, or as a demonstration of project-scoped skills.
Draft a CHANGELOG.md entry for the current changes in Keep a Changelog format. Use when releasing, tagging a version, or updating CHANGELOG.md.