Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add winstonkoh87/Athena-Public --skill diagnostic-refactorgit clone --depth 1 https://github.com/winstonkoh87/Athena-PublicWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/winstonkoh87/athena-public/diagnostic-refactor)<a href="https://agentmods.dev/skills/winstonkoh87/athena-public/diagnostic-refactor"><img src="https://agentmods.dev/badge/skills/winstonkoh87/athena-public/diagnostic-refactor/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/winstonkoh87/athena-public/diagnostic-refactor"><img src="https://agentmods.dev/badge/skills/winstonkoh87/athena-public/diagnostic-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00035 | $0.00923 |
| Opus 5.5 | $0.00014 | $0.00369 |
| Sonnet 5.5 | $0.00007 | $0.00185 |
| Haiku 4.5 | $0.00003 | $0.00092 |
Grade A, and why
Diagnostic-First Refactoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🩺 Diagnostic-First Refactoring (The "Surgeon's Scan")
Philosophy: Diagnose first. Cut second. Source: r/vibecoding ("Tip #1 - don't forget to have AI review its own code")
1. The Prompt (Universal Polyglot)
When invoking this skill on a file (or set of files), use the following System Prompt logic.
Role: Senior Software Architect & Performance Engineer.
Objective: Analyze the provided code files and generate a "Refactoring & Optimization Report." DO NOT rewrite the full files or generate refactored code blocks yet. Instead, provide a diagnostic report.
Specific Focus Areas:
- Dead & Unreachable Code: Identify variables, functions, or imports that are declared but never used.
- Cognitive Complexity: Highlight areas with excessive nesting (if/else hell), complex state management, or hard-to-read logic.
- Redundancy: Point out repeated logic that should be abstracted into utility functions (violation of DRY principles).
- Performance Heavy-Lifters: Analyze loops, recursive functions, DOM manipulations (if JS), and resource-heavy operations.
- Check: Is this technically unneeded? Can it be replaced by a lighter alternative (e.g., CSS instead of JS animation)?
- Modernization: Identify where language-specific modern syntax (e.g., Python 3.12+ features, ES6+ features) could reduce LOC.
Constraints for AI:
- NO DIRECT EDITING: Do not output the full modified code files.
- Strictly Diagnostic: Focus on what can be improved and why.
- Quantify Impact: Estimate LOC reduction (Low/Medium/High) and Complexity Impact.
2. Output Format (The "Bill of Materials")
The output MUST be written to a report file using the following structure:
# Refactoring & Optimization Report: [Filename]
## 📊 Summary
* **Est. LOC Reduction**: ~[X] lines
* **Complexity Reduction**: [Low/Medium/High]
* **Critical Issues**: [Count]
## 1. Issue Matrix
| Issue Category | Description of Inefficiency | Proposed Solution | Est. LOC Reduction | Complexity Impact |
| :--- | :--- | :--- | :--- | :--- |
| **Dead Code** | Unused import `foo` on line 12 | Remove import | ~1 line | None |
| **Bloat** | Animation function X uses complex JS loop | Replace with CSS Keyframes | ~15 lines | High |
| **Syntax** | Old style variable declarations | Convert to const/let & arrow funcs | ~5 lines | Low |
| **DRY** | Repeated error handling logic in 3 functions | Create `handle_error` utility | ~20 lines | Medium |
## 2. Critical Recommendations (Bulleted)
* [Recommendation 1]
* [Recommendation 2]
## 3. Risks & Regressions
* [Potential side effect of refactoring]
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 90 lines · 35 tokens per session scan A fa1bebe04043
Diagnostic-First Refactoring is a skill published in the GitHub repository winstonkoh87/Athena-Public (619 stars, last pushed yesterday), licensed MIT. It adds 35 tokens to every session and 923 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
credit-note-fixer
Fix the tiny credit-note formatting bug and rerun the exact targeted test command.
explain
Deep research into a topic or issue — investigates until confident, then presents an executive summary and root-cause analysis. Use when you need to understand WHY something happens. Takes [topic, question, or issue description].
second-opinion
Get an independent review of the current change from a different model family (GPT via Codex, Copilot or Cursor; Gemini via Antigravity) through agent-intern, then check each finding against the code and reconcile it with your own view. Use before merging a risky diff, when stuck on a bug, or when the user asks for a…
REFACTORING & TECHNICAL DEBT
Use this skill when improving code structure without changing external behavior, reducing technical debt, deciding between refactor vs rewrite, or planning legacy system modernization. Activated when the user mentions cleaning up code, reducing complexity, making code maintainable, improving a module that keeps…
PERFORMANCE ENGINEERING
Use this skill when diagnosing or resolving performance problems, optimizing slow systems, or proactively preparing for load. Activated when the user mentions slow response times, high resource consumption, timeouts, memory leaks, or anticipates increased traffic. Signal phrases: "it's slow", "optimize this"…
DEBUGGING & SYSTEMATIC TROUBLESHOOTING
Use this skill when investigating errors, crashes, unexpected behavior, or system failures. Activated when the user reports a bug, shares a stack trace or error message, describes tests failing unexpectedly, notices a regression (a feature that used to work no longer does), or when production telemetry alerts have…