AGENT SKILL
code-formatter
暂无简介
适用职业开发工程师
- License 许可
- MIT
- 最近更新
- 2026-04-13
- Stars
- ★ 0
- Forks
- 0
02 资源文件 5
- 脚本handler.js4.4 KB
- 脚本lib/eslint-wrapper.js769 B
- 脚本lib/import-optimizer.js1.3 KB
- 脚本lib/prettier-wrapper.js765 B
- 脚本lib/unused-remover.js905 B
03 SKILL.md 正文
Code Formatter Skill
Overview
The Code Formatter skill automatically fixes code style, formatting, imports, and removes unused code. Supports Prettier, ESLint, and custom formatting rules.
Authorization Level
Required: 2 (write capability)
Input Schema
{
"files": ["src/app.js", "src/utils.js"],
"project_root": "/home/user/project",
"config": "prettier",
"rules": ["format", "imports", "unused", "eslint"],
"dry_run": true
}
Output Schema
{
"fixed_files": [
{
"file": "src/app.js",
"changes": 8,
"lines_affected": 12,
"status": "preview",
"diff": [...]
}
],
"summary": {
"total_fixed": 2,
"total_changes": 15,
"dry_run": true,
"rules_applied": "format, imports, unused, eslint"
}
}
Features
- Prettier formatting: Code style standardization
- ESLint fixes: Automatic linting fixes
- Import optimization: Sorts and organizes imports
- Unused code removal: Identifies and removes unused variables
- Dry-run mode: Preview changes before applying
- Detailed diff: Shows exact changes per file
Formatting Rules
format- Code formatting (whitespace, indentation)imports- Organize imports (sort, deduplicate)unused- Remove unused variableseslint- Apply ESLint auto-fixessemicolons- Add/remove semicolons
Constraints
canRead: true- Read source filescanWrite: true- Write formatted filescanExecute: false- No command executioncanAccessSecrets: false- No secret access