Commit graph

4 commits

Author SHA1 Message Date
Roo Code
3fd2ca47c8 refactor: dynamically generate roomodes JSON schema from Zod types
Replace the hand-crafted schemas/roomodes.json with one generated from
the Zod schemas in packages/types/src/mode.ts using zod-to-json-schema.
This ensures the schema stays in sync when TypeScript types change.

- Add zod-to-json-schema dev dependency to packages/types
- Create packages/types/scripts/generate-roomodes-schema.ts
- Add generate:schema npm script to packages/types
- Add drift-detection test in packages/types to catch schema/type mismatches
- Update existing AJV validation tests with documentation comment
2026-03-02 15:31:19 +00:00
Roo Code
70db387a69 fix: make content optional in RuleFile schema definition
The content property in RuleFile is now optional, matching the
defensive runtime check in CustomModesManager that handles missing
content. Only relativePath remains required.
2026-02-27 22:14:43 +00:00
Roo Code
d399085caf fix: add browser tool group and rulesFiles property to roomodes schema
- Add "browser" to ToolGroup enum (deprecated but accepted for backward compat)
- Add RuleFile definition with relativePath and content properties
- Add optional rulesFiles array property to CustomMode
- Add 6 new tests covering browser groups and rulesFiles validation
2026-02-27 22:07:39 +00:00
Roo Code
cfc8a556cf feat: add correct JSON schema for .roomodes configuration files
Adds schemas/roomodes.json that accurately reflects the actual .roomodes
format as defined in packages/types/src/mode.ts. The schema supports:

- All CustomMode properties including optional description and source
- Tuple-style group entries like ["edit", { fileRegex, description }]
- All five tool groups: read, edit, command, mcp, modes

Also adds comprehensive tests validating the schema against valid and
invalid configurations.

Closes #11790
2026-02-27 21:32:38 +00:00