Anti-Pattern Czar
/install anti-pattern-czar
Anti-Pattern Czar
Autonomous agent that systematically identifies and fixes TypeScript error handling anti-patterns.
Detector
Run with Bun (no install required):
bunx antipattern-czar
bunx antipattern-czar --src lib
bunx antipattern-czar --config my-config.json
Config via .antipatternrc.json:
{
"srcDir": "src",
"criticalPaths": ["DatabaseService.ts", "AuthHandler.ts"],
"skipDirectories": ["node_modules", "dist", ".git"]
}
Mode Selection
Parse user intent to pick mode:
| User Says | Mode | Action |
|---|---|---|
| "scan", "detect", "find" | SCAN | Run detector, save state |
| "review", "fix", "help me fix" | REVIEW | Interactive fix session |
| "auto", "fix all", "autonomous" | AUTO | Batch fix with guardrails |
| "resume", "continue" | RESUME | Load state, continue |
| "report", "status", "progress" | REPORT | Show current state |
State File
Always check .anti-pattern-state.json at the project root. On first SCAN, ask if resuming when it exists.
{
"session_id": "\x3Cuuid>",
"started_at": "\x3CISO>",
"target_path": "\x3Cpath>",
"issues": [],
"history": []
}
Issue schema: id, file, line, pattern, severity (critical/high/medium), is_critical_path, status (pending/fixed/approved_override/skipped), code_snippet.
Workflow by Mode
See workflows.md for full per-mode workflows. Summary:
- SCAN: Run detector → parse issues → classify severity → save state → show summary
- REVIEW: Load state → sort by critical-path + severity → read code context → explain issue → propose fix options → apply approved fix → update state
- AUTO: Confirm with user → auto-fix non-critical-path issues using templates → switch to REVIEW for critical-path hits → show summary
- RESUME: Load
.anti-pattern-state.json→ continue from firstpendingissue - REPORT: Display session stats, severity table, recent fixes, next actions
Approved Overrides
Only suggest APPROVED_OVERRIDE when ALL are true:
- Error is expected and frequent
- Logging would create excessive noise
- There is explicit recovery/fallback logic
- Reason is specific and technical
NEVER approve overrides on critical paths without exceptional user confirmation.
Format:
} catch {
// [APPROVED_OVERRIDE] \x3Cspecific technical reason>
// Fallback: \x3Cwhat happens instead>
}
Fix Templates
See patterns.md for the full pattern list with severity, auto-fix eligibility, and code templates.
Progress Output Format
After each fix:
✅ Fixed: src/services/example.ts:42
Pattern: NO_LOGGING_IN_CATCH
Solution: Added logger.error() with context
Progress: 4/28 issues remaining ━━━━━━━ 14%
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install anti-pattern-czar - 安装完成后,直接呼叫该 Skill 的名称或使用
/anti-pattern-czar触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Anti-Pattern Czar 是什么?
Detect and fix TypeScript error handling anti-patterns with state persistence and approval workflows. Use when scanning a codebase for silent error failures,... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 628 次。
如何安装 Anti-Pattern Czar?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install anti-pattern-czar」即可一键安装,无需额外配置。
Anti-Pattern Czar 是免费的吗?
是的,Anti-Pattern Czar 完全免费(开源免费),可自由下载、安装和使用。
Anti-Pattern Czar 支持哪些平台?
Anti-Pattern Czar 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Anti-Pattern Czar?
由 Glucksberg(@glucksberg)开发并维护,当前版本 v1.0.0。