Skip to content

Reducing reliance on agents.md for more consistent behavior

Choose a tag to compare

@pglevy pglevy released this 25 Feb 14:01
· 40 commits to main since this release
e0fc703

Summary

This release introduces scripts, hooks, steering files, and a Kiro Power that move guidance out of AGENTS.md and into programmatic checks that run automatically or on demand. The goal: less prose for agents to parse, more reliable guardrails that stay in sync with the actual codebase.

New Features

Color Palette Checker

  • scripts/check-color-palette.js — Scans source files for Tailwind color classes using steps outside the approved set (50, 100, 200, 500, 700, 900). Reports warnings with suggested alternatives.
  • npm run check:colors — Convenience script added to package.json.
  • .kiro/hooks/check-color-palette.kiro.hook — User-triggered hook to run the checker from the Agent Hooks panel.
  • Replaces the color palette guidance section that was previously only documented in AGENTS.md.

Build Verification Hook

  • .kiro/hooks/verify-build.kiro.hook — User-triggered hook that asks the agent to run npm run build and fix any errors before declaring work complete.
  • Replaces the repeated "MANDATORY build validation" instructions that appeared in multiple sections of AGENTS.md.

Auto-Synced SAIL Type Definitions

  • .kiro/steering/sail-types.md — Steering file with fileMatch inclusion on src/pages/**. Automatically loaded into agent context when working on page files.
  • Auto-sync via predev script — The scripts/check-sailwind-update.js predev script now reads the actual type definitions from node_modules/@pglevy/sailwind/dist/types/sail.d.ts and regenerates the steering file if anything has drifted.
  • Replaces the "Common SAIL Type Definitions" section in AGENTS.md with the actual source of truth from the package.

Auto-Synced Component List

  • .kiro/steering/sail-components.md — Steering file listing all available Sailwind components, categorized by type. Auto-loaded when working on page files.
  • scripts/sync-sailwind-components.js — Reads the public API exports from each component folder's index.d.ts (not story files or internal helpers) and generates the steering file.
  • Auto-sync via predev script — Runs automatically on npm run dev, keeping the component list in sync with the installed package version.
  • Replaces the "Available Sailwind Components" section in AGENTS.md.

Upgrade Power

  • .kiro/powers/upgrade/POWER.md — A Kiro Power for existing projects created from this template. Fetches the latest tooling files from the template repo on GitHub, diffs against the local project, and walks the user through what to add or update.
  • Also audits AGENTS.md for sections that are now redundant and suggests trimming them.
  • The power pulls from GitHub at runtime, so it never goes stale — the template repo is always the source of truth.

AGENTS.md Changes

Trimmed sections that are now handled programmatically:

  • Removed repeated build validation instructions (now a hook)
  • Removed color palette guidance (now a script + hook)
  • Removed SAIL type definitions (now an auto-synced steering file)
  • Removed component list (now an auto-synced steering file)
  • Kept the dev workflow section and other guidance that isn't easily automated

README Updates

  • Added npm run check:colors to the Available Scripts section
  • Added new "Agent Hooks" section documenting all three hooks
  • Added the Upgrade Power to the Kiro-Specific Features section

Minor Fixes

  • Fixed off-palette color classes across existing pages (text-blue-600 → text-blue-500, text-gray-600 → text-gray-500)