refactor-dictionaries

Audit dictionary usage in public APIs and output a Markdown report.

6|1|Updated Jan 5, 2026
One-click install
npx skills add https://github.com/JordanGunn/skills --skill refactor-dictionaries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-dictionaries
Source: https://github.com/JordanGunn/skills/tree/main/skills/refactor/dictionaries
Command: npx skills add https://github.com/JordanGunn/skills --skill refactor-dictionaries

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Audit dictionary usage against the Dictionary Usage Doctrine. The goal is to identify improper dictionary usage in public APIs and across module boundaries, ensuring explicit structure and typing and preventing dictionaries from acting as hidden state.

Core Features & Use Cases

  • Detect improper dictionary usage in public APIs where a Dict represents a known structure.
  • Classify findings by severity and propose minimal refactors (TypedDict, dataclass, or explicit objects).
  • Produce a single Markdown report summarizing issues and recommended fixes.

Quick Start

Run the audit against your codebase to generate a structured Markdown report.

Frequently Asked Questions about refactor-dictionaries

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit dictionary usage in public APIs to enforce explicit typing?

You can audit dictionary usage by running this static analysis tool against your codebase to detect where Dict encodes known structure. It outputs a Markdown report with severity-based findings and minimal refactor recommendations.

When do I need to refactor dictionaries into TypedDict or dataclasses?

You need to refactor dictionaries into TypedDict or dataclasses when they pass configuration, encode known structure, or cross module boundaries, acting as hidden state instead of explicit typed objects.

What is the best way to find improper dictionary usage across module boundaries?

The best way to find improper dictionary usage across module boundaries is applying a Dictionary Usage Doctrine audit to classify findings by severity and propose minimal refactors like TypedDict or explicit objects.

Does dictionary static analysis provide specific refactor recommendations?

Dictionary static analysis provides specific refactor recommendations by classifying findings by severity and proposing minimal structural changes to TypedDict, dataclass, or explicit objects in a summarized Markdown report.

What are the limitations of auditing dictionary usage for safer code?

Limitations of auditing dictionary usage include relying on the Dictionary Usage Doctrine to detect improper public API patterns, meaning it targets known structures and module boundaries rather than dynamic or arbitrary dictionary payloads.