From codeant
Fetch the top 10 anti-patterns scan findings on the current branch, validate each against the source, and apply safe minimal fixes
How this skill is triggered — by the user, by Claude, or both
Slash command
/codeant:codeant-scans-anti-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Fetch the top 10 Anti-Patterns findings from the latest scan on the current branch, validate each against the current source code, and apply only safe, minimal fixes.
Fetch the top 10 Anti-Patterns findings from the latest scan on the current branch, validate each against the current source code, and apply only safe, minimal fixes.
Before doing anything else, check that the codeant CLI is on the latest version:
npm view codeant-cli version
Compare this with the installed version:
codeant --version
If the installed version is older than the latest published version, update it:
npm install -g codeant-cli@latest
If the update fails (e.g., permission error), warn the user and continue — a slightly outdated CLI is better than blocking the entire workflow.
Get the current branch and repo:
git rev-parse --abbrev-ref HEAD
git remote get-url origin
Parse the remote URL to owner/repo format:
https://github.com/owner/repo.git → owner/repo[email protected]:owner/repo.git → owner/repoIf the repo cannot be determined from the remote, ask the user to provide it explicitly as owner/repo.
Use the AskUserQuestion tool to ask the user for the severity filter:
"Which severity levels should I include? Options:
critical,high,medium,low,info,unknown, orall(default). You can specify multiple comma-separated values, e.g.critical,high."
Wait for the user's response before continuing. Default to all if the user does not answer.
codeant track --event "skill_invoked" --props '{"skill_name": "codeant-scans-anti-patterns", "source": "claude-code", "repo": "<REPO>", "branch": "<BRANCH>", "severity": "<SEVERITY>"}'
Run the following command (omit --severity when the user chose "all"):
codeant scans results \
--repo <owner/repo> \
--branch <current-branch> \
--types anti_patterns \
--limit 10 \
--filter-dismissed \
--no-false-positives \
--quiet \
--format json
When the user specified a severity, add:
--severity <user-severity>
Handle exit codes:
0 — success; parse the findings array from the JSON output2 — no scans found for this branch; tell the user and stop4 — network error; tell the user and stopIf findings is an empty array after a successful call, tell the user: "No Anti-Patterns findings matching your filters on branch <branch>." and stop.
Each finding object contains: severity, category, file_path, line_number, check_id, check_name, message.
Group findings by file_path to minimize re-reading. For each finding:
file_path with 30 lines above and 30 lines below line_number for full context.message and check_name carefully to understand:
For each finding, determine whether it can be safely fixed. Assign one of four verdicts:
ACCEPT — Safe to apply. Assign this when ALL of these are true:
message is still present at line_numberLIKELY ACCEPT — Looks correct, but verify callers. Assign this when:
DO NOT ACCEPT — Could break things. Assign this when ANY of these are true:
STALE — Code has changed since the scan. Assign this when:
line_number no longer matches what the finding describesFor each ACCEPT or LIKELY ACCEPT finding, draft the minimal fix: replace the anti-pattern with the idiomatic equivalent, touching only the flagged lines.
Before making any changes, present a clear summary:
owner/repo<branch>Then list every finding grouped by verdict:
ACCEPT — Safe to apply (N): For each, show:
LIKELY ACCEPT — Verify callers (N): For each, show:
DO NOT ACCEPT — Could break logic (N): For each, show:
STALE — Code changed since scan (N): For each, show:
Then ask the user: "I will apply the N ACCEPT fixes now. For the LIKELY ACCEPT fixes, I recommend you review the callers first — want me to apply those too, or skip them for now?"
After the user confirms:
After applying fixes, report the outcome:
codeant track --event "suggestions_applied" --props '{"skill_name": "codeant-scans-anti-patterns", "source": "claude-code", "repo": "<REPO>", "branch": "<BRANCH>", "accept_count": <N>, "likely_accept_count": <N>, "do_not_accept_count": <N>, "stale_count": <N>, "total_findings": <N>}'
Use the actual counts from the verdicts assigned in Step 4. For likely_accept_count, only count ones the user chose to apply.
Present a final report:
Applied (N findings):
Not applied — DO NOT ACCEPT (N findings):
Not applied — STALE (N findings):
After presenting the final report, check which files were modified:
git status --short
List the changed files to the user and ask:
"These are the files that were changed:
<file1><file2>Would you like me to commit and push these changes to the current branch? You can also tell me to commit only specific files."
npx claudepluginhub codeant-ai/skills --plugin codeantProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.