devkit.refactor

A guided command for restructuring existing software while considering its dependencies and compatibility needs. Refactoring means improving the internal code without changing what the software is meant to do.

In plain words
What is it for?
Use it to refactor a file, module, or feature in Java, Spring Boot, TypeScript, NestJS, React, Python, or a general codebase. It helps understand the current structure, choose a safe approach, make the changes, and verify them.
Why use it?
It helps reduce the risk of breaking callers, integrations, or expected behaviour during a large code change. It also supports incremental work and thorough checks.

Command

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.

agentmods
npx agentmods add commands/giuseppe-trisciuoglio/developer-kit/devkit.refactor
Clone the repo
git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,420 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00027 $0.05420
Opus 5 $0.00014 $0.02710
Sonnet 5 $0.00005 $0.01084
Haiku 4.5 $0.00003 $0.00542

Measured yesterday against content hash 3b7812a73e6b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

devkit.refactor 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 yesterday.

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.

plugins/developer-kit-core/commands/devkit.refactor.md · 619 lines

How it starts

The opening of the file, as written. The whole thing — 619 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Refactoring

Overview

You are helping a developer refactor existing code. Follow a systematic approach: deeply understand the codebase and its dependencies, clarify compatibility requirements, design safe refactoring strategies, implement incrementally, and verify thoroughly.

Usage

/developer-kit:devkit.refactor [--lang=java|spring|typescript|nestjs|react|python|general] [--scope=file|module|feature] [refactor-description]

Arguments

Argument Description
$ARGUMENTS Combined arguments passed to the command

Current Context

The command will automatically gather context information when needed:

  • Current git branch and status
  • Recent commits and changes
  • Available when the repository has history

Execution Instructions

Agent Selection: Based on the --lang parameter, select the appropriate agents:

Integration with Sub-agents

This command leverages four specialized sub-agents for comprehensive refactoring:

Language/Framework Selection

Parse $ARGUMENTS to detect the optional --lang parameter:

  • --lang=spring or --lang=java: Use Java/Spring Boot specialized agents
  • --lang=typescript or --lang=ts: Use TypeScript specialized agents
  • --lang=nestjs: Use NestJS specialized agents
  • --lang=react: Use React frontend specialized agents
  • --lang=aws: Use AWS specialized agents (architecture, CloudFormation, IaC)
  • --lang=python or --lang=py: Use Python specialized agents
  • --lang=general or no flag: Use general-purpose agents (default)

Scope Selection

Parse $ARGUMENTS to detect the optional --scope parameter:

  • --scope=file: Single file refactoring
  • --scope=module: Module/package level refactoring
  • --scope=feature: Cross-cutting feature refactoring (default)

Agent Mapping by Language:

Phase General (default) Java/Spring Boot (--lang=spring or --lang=java) TypeScript (--lang=typescript or --lang=ts) NestJS (--lang=nestjs) React (--lang=react) AWS (--lang=aws) Python (--lang=python or --lang=py)
Deep Exploration developer-kit:general-code-explorer developer-kit-java:spring-boot-backend-development-expert developer-kit:general-code-explorer developer-kit-typescript:nestjs-backend-development-expert developer-kit-typescript:react-frontend-development-expert developer-kit-aws:aws-solution-architect-expert developer-kit:general-code-explorer
Refactoring Expert developer-kit:refactor-expert developer-kit-java:java-refactor-expert developer-kit-typescript:typescript-refactor-expert developer-kit-typescript:typescript-refactor-expert developer-kit-typescript:typescript-refactor-expert developer-kit-aws:refactor-expert developer-kit-python:python-refactor-expert
Architecture Review developer-kit:general-software-architect developer-kit-java:java-software-architect-review developer-kit-typescript:typescript-software-architect-review developer-kit-typescript:typescript-software-architect-review developer-kit-typescript:react-software-architect-review developer-kit-aws:aws-solution-architect-expert developer-kit-python:python-software-architect-expert
Code Review developer-kit:general-code-reviewer developer-kit-java:spring-boot-code-review-expert developer-kit:general-code-reviewer developer-kit-typescript:nestjs-code-review-expert developer-kit:general-code-reviewer developer-kit-aws:aws-architecture-review-expert developer-kit-python:python-code-review-expert

Read the full file on GitHub · 619 lines

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. yesterday First seen · 619 lines · 27 tokens per session scan A 3b7812a73e6b

Subscribe to this mod's changes

devkit.refactor is a command published in the GitHub repository giuseppe-trisciuoglio/developer-kit (335 stars, last pushed 13d ago), licensed MIT. It adds 27 tokens to every session and 5,420 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-08-30.