← 返回 Skills 市场
glucksberg

Anti-Pattern Czar

作者 Glucksberg · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
628
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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,...
使用说明 (SKILL.md)

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 first pending issue
  • REPORT: Display session stats, severity table, recent fixes, next actions

Approved Overrides

Only suggest APPROVED_OVERRIDE when ALL are true:

  1. Error is expected and frequent
  2. Logging would create excessive noise
  3. There is explicit recovery/fallback logic
  4. 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%
安全使用建议
This skill appears to be a coherent code-scanning/fix assistant, but there are a couple of important unknowns you should resolve before installing or running it on important repositories: - Clarify the `bunx antipattern-czar` dependency. The SKILL.md expects an external command but the skill declares no required binary or install. Ask the author: where does `antipattern-czar` come from (npm package name, GitHub repo, release URL)? Will bunx fetch code at runtime? If so, you are granting the agent the ability to execute remote package code — inspect that package first. - Prefer Review mode initially. Use the REVIEW mode (interactive, one fix at a time) rather than AUTO, so you can inspect each proposed edit and avoid mass automated changes. - Backup and limit scope. Run the tool on a branch or a copy of the repo and ensure you have VCS backups before allowing fixes. The skill writes edits and a `.anti-pattern-state.json` file to the project root; be prepared to revert. - Ask for provenance. The package/source is listed as unknown with no homepage. Lack of origin is a supply-chain risk — request a homepage, source repo, or published package details. - Check environment readiness. Ensure bun (bunx) is present and that your environment's policy for executing fetched packages is acceptable. If you prefer avoiding network fetches, ask the maintainer for a packaged release or include the detector logic in the skill bundle. If the author provides a trustworthy source for `antipattern-czar` (e.g., a well-known repository or published package) and documents how bunx will be used, this skill becomes largely coherent and its remaining behaviors are appropriate for its purpose.
功能分析
Type: OpenClaw Skill Name: anti-pattern-czar Version: 1.0.0 The skill bundle is designed to detect and fix TypeScript error handling anti-patterns. All instructions in SKILL.md, references/patterns.md, and references/workflows.md consistently align with this stated purpose. The skill uses `bunx antipattern-czar` to run its detector and instructs the agent to use OpenClaw's 'Read tool' and 'Edit tool' for legitimate code analysis and modification. There are no instructions for data exfiltration, malicious execution, persistence, or prompt injection against the agent to perform unauthorized actions. Explicit safety measures, such as requiring user confirmation for 'AUTO' mode and strict rules for 'Approved Overrides', further indicate a benign intent.
能力评估
Purpose & Capability
The name/description (detect and fix TypeScript error-handling anti-patterns, with state and approval workflows) matches the SKILL.md workflows: scanning, review, auto-fix, state persistence, and reporting. However, the SKILL.md expects an external runtime command (`bunx antipattern-czar`) but the skill declares no required binaries or install spec — this mismatch is unexpected and should be clarified.
Instruction Scope
Instructions explicitly direct the agent to read project source, parse code contexts, propose and apply edits, and read/write a state file at the project root. Those actions are consistent with the stated purpose (code scanning and in-place fixes). There are no instructions to read unrelated system files, access secrets, or transmit code to external endpoints in the provided content.
Install Mechanism
This is an instruction-only skill (no install spec). Yet SKILL.md tells the agent to run `bunx antipattern-czar`. That implies either (a) a binary/package must already exist in the environment, or (b) bunx will fetch and run code from a registry at runtime. The skill provides no declaration of this dependency or source for `antipattern-czar`, which is an installation/ supply-chain ambiguity and a potential execution-of-untrusted-code risk.
Credentials
The skill requests no environment variables, credentials, or config paths beyond a project-local `.anti-pattern-state.json`. That is proportionate for a code-modifying linter/repair tool. No unrelated secrets or broad system config access is requested.
Persistence & Privilege
The skill persists state to a project-local `.anti-pattern-state.json` and writes edits to source files as part of normal operation. It is not force-installed (always:false). The combination of write-edit capability plus autonomous invocation (platform default) means users should be careful about allowing the skill to run in auto/fix-all modes — the skill can modify repository files, which is intended but potentially impactful if misconfigured.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install anti-pattern-czar
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /anti-pattern-czar 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: autonomous TypeScript error handling anti-pattern detector and fixer with state persistence, 5 operation modes, approval workflows, and 10 pattern types.
元数据
Slug anti-pattern-czar
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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。

💬 留言讨论