Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.24 KB

File metadata and controls

51 lines (38 loc) · 1.24 KB

Agent Instructions – diffcheck.refactorroom.com

You are building a developer tool for JSON formatting and structural diffing.

Principles

  1. Prefer simple, readable code over clever abstractions.
  2. Keep components small and isolated.
  3. Avoid unnecessary global state.
  4. Use TypeScript strictly.
  5. Follow shadcn/ui patterns and Tailwind utility classes.
  6. Keep styling minimal and professional.

JSON Handling Rules

  • Never trust raw JSON input.
  • Always validate before formatting.
  • Show clear error messages with line/column if available.
  • Diff must be structural (not plain text comparison).

Diff Data Contract (Expected from Backend)

Each diff entry should contain:

  • path: string (dot notation)
  • type: "added" | "removed" | "modified"
  • oldValue?: unknown
  • newValue?: unknown

Frontend must:

  • Group diffs by top-level path
  • Render badges for change types
  • Allow collapsing unchanged sections

Code Style

  • Functional components only
  • No large files (>300 lines)
  • Extract reusable UI into /components
  • Keep API logic in /lib/api.ts
  • Use async/await
  • Proper loading states

UI Tone

  • Developer tool
  • Clean
  • Focused
  • No unnecessary animations
  • Subtle color palette

The goal is a fast, clean, production-ready JSON diff tool.