logic-fix-all – Security skill for AI agents
Autonomous repository-wide audit-and-fix pipeline: health → review → locate/explain → fix → diff-verify → iterate until clean. Starts with a mandatory consent prompt (token-intensive); after consent runs hands-free.
Install the logic-fix-all skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/logic-fix-all-777c0.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /logic-fix-all – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/logic-fix-all-777c0.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $logic-fix-all – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/logic-fix-all-777c0.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /logic-fix-all – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/logic-fix-all-777c0.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /logic-fix-all – then describe the task you want done.
SKILL.md content
Logic-Lens — Logic Fix All
When to Use
Use this skill when you need autonomous repository-wide audit-and-fix pipeline: health → review → locate/explain → fix → diff-verify → iterate until clean. Starts with a mandatory consent prompt (token-intensive); after consent runs hands-free. Trigger when the user wants ALL logic issues found and fixed — for example "fix all confirmed logic defects within this repository".
Setup
Use phase-gated lazy loading per ../_shared/common.md §13:
1. Before consent, read only ../_shared/common.md for language, scope routing, fix-all header fields, config fields, and loading budget; then read logic-fix-all-guide.md through the phase map and guide-phases-0-2-consent-scope-health.md through Phase 0.
2. After consent, read each phase file only when entering that phase.
3. Load ../_shared/logic-risks.md, ../_shared/semiformal-guide.md, ../_shared/semiformal-checklist.md, ../_shared/report-template.md, and the other skill guides on demand when that phase invokes their methodology.
Process
Step 0. Language + scope routing. Detect language per common.md §1. Default scope is the repo root; honor a user-named subpath or pasted snippet. For a pasted snippet, skip the consent prompt and run the fix pipeline directly. Read .logic-lens.yaml for ignore:, custom_risks, severity:, focus:, and fix_all.max_iterations.
Step 1. Consent + scope enumeration (guide Phase 0–1) — for repo/directory scope: mandatory consent prompt displaying scope / method / cost / iteration cap; on consent, enumerate runtime-affecting files (source / config / constraint / doc), exclude .git and build artifacts, classify by risk tier. For a pasted snippet: skip consent, enumerate the snippet's functions directly.
Step 2. Health pass (guide Phase 2) — apply logic-health methodology to map per-module Logic Scores and L-code patterns.
Step 3. Deep review (guide Phase 3) — apply logic-review per file to collect full Premises → Trace → Divergence findings.
Step 4. Conditional clarification (guide Phase 4–5) — apply logic-locate where concrete failures exist; apply logic-explain when a finding's path is unclear (call depth > 3, cross-module, or async).
Step 5. Fix queue + remedy (guide Phase 6) — sort by severity; write a paste-ready Remedy per finding; route cross-file contradictions to the correct edit target (code / constraint / config / doc).
Step 6. Apply + verify (guide Phase 7) — apply each fix, then apply logic-diff methodology comparing original vs. fixed code. Expected verdict: ⚠️ Conditionally Equivalent where the differing condition is exactly the bug scenario. Investigate a Semantically Equivalent verdict; it can be appropriate for a behavior-preserving safety/refactor change, and an LLM verdict is not proof or shows new divergences outside the bug scenario (regression). Retry up to 3×.
Step 7. Iterate + report (guide Phase 8–9) — re-run health + review on modified files and their consumers; Critical findings use the same finite run budget; Warning/Suggestion rounds capped by fix_all.max_iterations with user-escalation prompt at the cap. Output the Fix Report.
Mode line in report: Logic Fix All (Chinese: 逻辑全修).
Fix-report additions (appended after the standard Summary; localize all labels):
## Scope
| Role (source/config/constraint/doc) | Files scanned | Tier H/M/L | Truncated? |
|-------------------------------------|---------------|------------|------------|
## Skill Invocations
logic-health: N · logic-review: N · logic-locate: N · logic-explain: N · logic-diff: N
## Iteration History
| Round | Severity class | New findings | Action |
## Fix Log
| # | File | Lines | Finding | Risk | Severity | Fix Applied (one-line edit or diff summary) | Status (resolved/unresolved/reverted) |
## Resolved by Clarification
[Findings the Phase-5 logic-explain pass revealed as false positives. Empty if none.]
## Unresolved Findings
[Include reason per entry: "conflicting constraints", "user stopped iteration at round N",
"hard iteration ceiling reached", "ambiguous spec", "unclear whether spec or consumer is wrong".
Empty if all resolved.]Report header fields (replace the standard single-line header per common.md §5):
**Logic Score (before):** XX/100
**Logic Score (after):** YY/100
**Findings fixed:** N (Critical: n1 · Warning: n2 · Suggestion: n3)
**Findings unresolved:** MLimitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Missing-runtime and evidence gate
This five-file distribution does not bundle ../_shared/* or the sibling logic-health/review/locate/explain/diff methods. Verify they actually exist before claiming the branded pipeline, scores or invocations. If absent, state the gap and offer a bounded ordinary review within existing authorization; do not fabricate method results. Existing explicit authorization for repository-wide work satisfies consent; ask only when scope/budget is materially unresolved. No unlimited Critical loop is authorized: use a finite total time/token/attempt budget, checkpoint and report unresolved findings.
Related skills
- loopy – Discover, find, compare, audit, repair, adapt, craft, run, debrief, and prepare…
- luna – Reviews code for objective correctness, security, and reliability.
- macos-reverse – Authorized macOS and Mach-O reverse engineering: codesign inspection, Objective-C/Swift…
- malware-analysis – Analyze suspected malware through static, dynamic, and behavioral techniques: IOC…
- malware-analyst – Expert malware analyst specializing in defensive malware research, threat intelligence…
- marketplace-rbac-audit – Audit multi-role marketplace authorization across roles, resource ownership, tenant…
- markstream-migration – Audit and migrate an existing Markdown renderer to Markstream while preserving custom…
- meme-coin-audit – Meme coin and token security audit