add-rule

Add transformation rules with inverse mappings and closed-loop tests.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/pzheng460/claude-workflow-plugin --skill add-rule
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-rule
Source: https://github.com/pzheng460/claude-workflow-plugin/tree/main/skills/add-rule
Command: npx skills add https://github.com/pzheng460/claude-workflow-plugin --skill add-rule

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adds a disciplined, step-by-step process for introducing transformations, mappings, and converters while preventing subtle correctness regressions and undocumented behavior. It prevents incomplete implementations by enforcing a concrete example, an inverse mapping when required, and a strong correctness argument before proceeding.

Core Features & Use Cases

  • Structured checklist for gathering source, target, algorithm, inverse mapping, correctness argument, example, and reference implementation.
  • Closed-loop testing guidance that mandates source → target → solve → extract → verify to ensure round-trip correctness.
  • Implementation and documentation requirements including registration in the project, example programs, and updates to docs; ideal for data migrations, type converters, compiler IR passes, and similar codebase transformations.

Quick Start

Use add-rule to implement a transformation from a verified source format to a target format with a concrete worked example and a closed-loop test.

Frequently Asked Questions about add-rule

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

FAQPage Schema
How do I verify round-trip correctness for a data migration mapping?

Round-trip correctness for a data migration mapping is verified through closed-loop testing using the source → target → solve → extract → verify sequence. This validates that inverse mappings return the original representation.

What do I need to implement a verified codebase transformation rule?

Implementing a verified codebase transformation rule requires a reference implementation, a concrete worked example, an inverse mapping if applicable, closed-loop tests, and documentation to validate correctness.

When should I use an inverse mapping for type converters and IR passes?

An inverse mapping for type converters and IR passes is required when both source and target representations already exist, ensuring transformations can be reversed to prevent subtle correctness regressions.

Does a structured checklist help prevent incomplete data migration implementations?

A structured checklist prevents incomplete data migration implementations by enforcing the gathering of source, target, algorithm, inverse mapping, correctness argument, example, and reference implementation before proceeding.

What is the best way to document transformation rules in a codebase?

The best way to document transformation rules in a codebase is to mandate implementation and documentation requirements including project registration, example programs, and docs updates alongside closed-loop tests.

Why does my transformation mapping fail correctness checks without a reference implementation?

Transformation mapping fails correctness checks without a reference implementation because a concrete worked example and a strong correctness argument are required to validate the algorithm and prevent undocumented behavior.