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 | $0.00017 | $0.00462 |
| Sonnet 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 12d 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.
- 12d 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 (587 stars, last pushed today), licensed MIT. It adds 35 tokens to every session and 923 once invoked, about $0.0002 per session on Opus 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.
manage-skills
A maintenance workflow for checking whether project verification skills still cover the code and rules that changed during a session.
systematic-debugging
Structured debugging methodology — use before proposing fixes for any error or failure. Covers: code bugs, build errors, deploy failures, config conflicts, dependency issues, infra problems. Also use when previous fix attempts failed or root cause is unclear.
review-loop
Run the adversarial verification loop — implement, then hand the change to a fresh checker that did not write it, fix what it finds, and re-dispatch until APPROVE. Use before claiming any behavioural change is done, and on requests like "review loop", "adversarial review", "independent review", "get this verified"…
python-memory-safe-scripts
Memory-safe Python script patterns for long-running processes under systemd MemoryMax constraints. Covers allocator purge (mimalloc/glibc malloctrim), HTTP response lifecycle, DataFrame cleanup, thread-local connection reuse, and periodic GC cadence. Battle-tested through 5 OOM optimization cycles on production GPU…
feedback-workflow
A command-line workflow for reading and responding to approved software feedback. It keeps track of the feedback version, approval, work claim, evidence, and result.