- Add 60 new agents across all 10 categories (75 -> 135) - Add 95 new plugins with command files (25 -> 120) - Update all agents to use model: opus - Update README with complete plugin/agent tables - Update marketplace.json with all 120 plugins
38 lines
1.5 KiB
JavaScript
38 lines
1.5 KiB
JavaScript
const { execFileSync } = require("child_process");
|
|
const path = require("path");
|
|
|
|
const input = JSON.parse(process.argv[2] || "{}");
|
|
const filePath = input.file_path || input.filePath || "";
|
|
if (!filePath) process.exit(0);
|
|
|
|
const ext = path.extname(filePath).toLowerCase();
|
|
|
|
const fixCommands = {
|
|
".ts": { cmd: "npx", args: ["eslint", "--fix", "--no-error-on-unmatched-pattern", filePath] },
|
|
".tsx": { cmd: "npx", args: ["eslint", "--fix", "--no-error-on-unmatched-pattern", filePath] },
|
|
".js": { cmd: "npx", args: ["eslint", "--fix", "--no-error-on-unmatched-pattern", filePath] },
|
|
".jsx": { cmd: "npx", args: ["eslint", "--fix", "--no-error-on-unmatched-pattern", filePath] },
|
|
".py": { cmd: "ruff", args: ["check", "--fix", filePath] },
|
|
".go": { cmd: "gofmt", args: ["-w", filePath] },
|
|
".rs": { cmd: "rustfmt", args: [filePath] },
|
|
".css": { cmd: "npx", args: ["prettier", "--write", filePath] },
|
|
".scss": { cmd: "npx", args: ["prettier", "--write", filePath] },
|
|
".json": { cmd: "npx", args: ["prettier", "--write", filePath] },
|
|
".md": { cmd: "npx", args: ["prettier", "--write", filePath] },
|
|
};
|
|
|
|
const fixer = fixCommands[ext];
|
|
if (!fixer) process.exit(0);
|
|
|
|
try {
|
|
execFileSync(fixer.cmd, fixer.args, {
|
|
stdio: "pipe",
|
|
timeout: 15000,
|
|
cwd: path.dirname(filePath),
|
|
});
|
|
console.log(JSON.stringify({ lintFix: "applied", file: filePath }));
|
|
} catch (e) {
|
|
const stderr = (e.stderr || "").toString().slice(0, 300);
|
|
console.log(JSON.stringify({ lintFix: "skipped", file: filePath, reason: stderr || "tool not available" }));
|
|
}
|