diagnostic-first-refactoring

diagnostic-first-refactoring is a skill for Claude Code, Codex from winstonkoh87/Athena-Public. It costs 22 tokens per session (295 once invoked), scanned A, original, MIT.

A refactoring workflow that examines a codebase’s structure and dependencies before changing code.

In plain words
What is it for?
Use it to scan a target module, plan dependency-safe changes, apply them step by step, and run tests for regressions.
Why use it?
It reduces the risk of breaking related modules by finding coupling, unused code, and missing tests before editing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to scan a target module, plan dependency-safe changes, apply them step by step, and run tests for regressions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/winstonkoh87/athena-public/dia
Install

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.

Any agent
npx skills add winstonkoh87/Athena-Public --skill dia
Clone the repo
git clone --depth 1 https://github.com/winstonkoh87/Athena-Public

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for diagnostic-first-refactoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/winstonkoh87/athena-public/dia/github.svg)](https://agentmods.dev/skills/winstonkoh87/athena-public/dia)
Your own site
<a href="https://agentmods.dev/skills/winstonkoh87/athena-public/dia"><img src="https://agentmods.dev/badge/skills/winstonkoh87/athena-public/dia/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.

agentmods 80×15 button for diagnostic-first-refactoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/winstonkoh87/athena-public/dia"><img src="https://agentmods.dev/badge/skills/winstonkoh87/athena-public/dia.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 295 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.00295
Opus 5 $0.00011 $0.00148
Sonnet 5 $0.00004 $0.00059
Haiku 4.5 $0.00002 $0.00030

Measured 8d ago against content hash cc0b59abfd43, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

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 8d 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.

examples/protocols/diagnostics/DIA-SKILL.md · 36 lines

What it actually says

Diagnostic-First Refactoring (Surgeon's Scan)

Core Principle: Understand before you cut.

Protocol

  1. Scan: Map the target module's file structure and dependencies
  2. Diagnose: Identify coupling, dead code, and test coverage gaps
  3. Plan: Design the refactoring sequence (dependency-safe order)
  4. Execute: Apply changes with verification at each step
  5. Verify: Run tests, check for regressions

Anti-Patterns

  • ❌ Editing files without reading them first
  • ❌ Refactoring multiple modules simultaneously
  • ❌ Skipping the dependency scan
  • ❌ Not running tests after each change
  • DIAG-001: Knowledge-Action Gap
  • DIAG-002: Baseline Check
  • DIAG-003: Frame Collision
Changes

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.

  1. 8d ago First seen · 36 lines · 22 tokens per session scan A cc0b59abfd43

Subscribe to this mod's changes

diagnostic-first-refactoring is a skill published in the GitHub repository winstonkoh87/Athena-Public (587 stars, last pushed yesterday), licensed MIT. It adds 22 tokens to every session and 295 once invoked, about $0.0001 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-09-03.

Related

Other skills, from other repositories

credit-note-fixer

Fix the tiny credit-note formatting bug and rerun the exact targeted test command.

openai/openai-agents-python · 21 tokens

ai-agents-empirical-probe-toolkit

Prove-it methods for this repo. Six recipes for runtime-contract probes, guard and threshold calibration, eval A/B, docs-vs-reality audits, reproduce-on-main CI triage, and negative-control test design, each with a worked example from repo history. Use when you say probe the runtime contract, calibrate this guard…

rjmurillo/ai-agents · 119 tokens

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

PM-Shawn/Abu-Cowork · 35 tokens

test-corpus

The testdocuments submodule is a bucket-fetched fixture corpus that is not committed. This skill covers readtestfixture, missing fixtures, valid A/B controls, and submodule push order. Load before running Rust tests on a fresh clone, setting up an A/B control, adding a fixture-backed test, or diagnosing…

xberg-io/xberg · 72 tokens

typescript-testing

Select and run TypeScript SDK verification for packages, examples, type checks, linting, builds, Vitest suites, Effect v4 CLI tests, and runtime E2E tests. Use when adding tests, diagnosing TypeScript CI, choosing a focused test command, validating TypeScript package changes, or writing/porting CLI tests against…

ComposioHQ/composio · 95 tokens

develop-web-game

Use when Codex is building or iterating on a web game (HTML/JS) and needs a reliable development + testing loop: implement small changes, run a Playwright-based test script with short input bursts and intentional pauses, inspect screenshots/text, and review console errors with rendergametotext.

netease-youdao/LobsterAI · 64 tokens