ai-code-review-refactor

Review AI-assisted code for hallucinated APIs, hidden assumptions, and unsafe refactors.

4|Updated May 16, 2026
One-click install
npx skills add https://github.com/machenjie/rd-skills --skill ai-code-review-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-code-review-refactor
Source: https://github.com/machenjie/rd-skills/tree/main/src/professional-skills/ai-code-review-refactor
Command: npx skills add https://github.com/machenjie/rd-skills --skill ai-code-review-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you prevent broken or risky refactors by reviewing AI-generated or heavily assisted code for hallucinated APIs, hidden assumptions, architecture drift, dependency bloat, missing tests, type unsafety, and unsafe behavioral changes.

Core Features & Use Cases

  • Verify real API existence: Checks that imports, method calls, and parameter signatures exist in the declared versions to stop runtime failures from hallucinated code.
  • Enforce safe refactor boundaries: Ensures behavioral equivalence and surfaces any silent changes to observable behavior as reviewable, separated work.
  • Require evidence-backed completion: Demands an evidence inventory and an Execution Discipline Report so “completion” claims are grounded in validation outputs rather than plausibility.
  • Harden security and reliability: Flags swallowed exceptions, silent null returns, insecure paths (auth/permissions/data access), and missing adversarial review where needed.

Quick Start

Ask an AI to review a proposed refactor of AI-assisted code and return a checklist of verified APIs, hidden assumptions, dependency risks, missing tests, and an explicit refactor boundary assessment before any changes are accepted.

Frequently Asked Questions about ai-code-review-refactor

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

FAQPage Schema
How do I verify AI-generated code APIs to prevent hallucinated method calls?

To verify AI-generated code APIs, check that imports, method calls, and parameter signatures exist in declared versions to stop runtime failures. This prevents hallucinated APIs from reaching production environments.

What is a safe refactor boundary for AI-assisted code changes?

A safe refactor boundary ensures behavioral equivalence and surfaces silent changes to observable behavior as reviewable, separated work. This prevents unsafe behavioral changes during AI-assisted code modifications.

How do I review AI code for missing tests and type safety failures?

Review AI code for missing tests and type safety failures by demanding an evidence inventory and explicit test adequacy expectations. This grounds completion claims in validation outputs rather than plausibility.

Does AI code refactoring require dependency and security auditing?

AI code refactoring requires dependency and security auditing to harden reliability. This flags swallowed exceptions, silent null returns, insecure data access paths, and missing adversarial review where needed.

How to prevent architecture drift and dependency pollution when integrating AI code?

Prevent architecture drift and dependency pollution by reviewing AI-assisted changes for hidden assumptions and over-abstraction. Apply strict API verification and bounded secure refactor scope before accepting changes.

When do I need an evidence-based completion report for AI code review?

You need an evidence-based completion report when validating or approving AI-assisted changes across existing codebases. It ensures completion claims are grounded in validation outputs rather than plausibility, especially for behavioral changes.