Add dedicated Kiro schema modules for agent/hook/power/mcp (#595)#616
Add dedicated Kiro schema modules for agent/hook/power/mcp (#595)#616
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes the foundational schema definitions and parsing logic for various Kiro-related configuration files. By introducing dedicated modules and structured error reporting, it significantly enhances the reliability and maintainability of Kiro's configuration processing, paving the way for improved validation and developer experience. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces dedicated schema modules for Kiro agent, hook, MCP, and power configurations, which is a great step towards structured parsing and validation. The changes are well-organized and include focused tests for each schema.
My review has identified a few areas for improvement related to maintainability and performance:
- Code Duplication: The
ParseErrorstruct is duplicated across all new schema modules. It would be better to define it in a shared location. - Performance: The JSON parsing functions in
kiro_agent,kiro_hook, andkiro_mcpmodules parse the input string twice, which is inefficient. - Maintainability: The new modules use a blanket
#![allow(dead_code)]attribute, which goes against the project's established practice of using more targeted lint suppression.
I've left specific comments with suggestions on how to address these points.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 725de2548a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds dedicated schema/parsing helpers for Kiro-specific file surfaces so the core can deserialize them into typed structures and surface parse errors with line/column metadata (foundation work for #595).
Changes:
- Introduces new schema modules for Kiro agent JSON, IDE hook JSON, MCP config JSON, and POWER.md frontmatter parsing.
- Exports the new schema modules from
crates/agnix-core/src/schemas/mod.rs. - Adds focused unit tests for valid/invalid parsing cases and documents the work in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/agnix-core/src/schemas/mod.rs | Exports the new Kiro schema modules. |
| crates/agnix-core/src/schemas/kiro_agent.rs | Adds typed deserialization + parse helper + tests for .kiro/agents/*.json. |
| crates/agnix-core/src/schemas/kiro_hook.rs | Adds typed deserialization + parse helper + tests for .kiro/hooks/*.kiro.hook. |
| crates/agnix-core/src/schemas/kiro_mcp.rs | Adds typed deserialization + parse helper + tests for Kiro MCP JSON configs. |
| crates/agnix-core/src/schemas/kiro_power.rs | Adds POWER.md frontmatter/body splitting + YAML frontmatter deserialization + tests. |
| CHANGELOG.md | Adds an Unreleased entry noting the new Kiro schema foundations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
crates/agnix-core/src/schemas/for agent JSON, IDE hook files, POWER.md frontmatter, and Kiro MCP configschemas/mod.rsand include parser helpers that return structured parse errors (message + line/column)Testing
cargo test -p agnix-core kiro_ -- --nocapturecargo test -p agnix-core schemas::kiro_ -- --nocapturecargo test -p agnix-cli --test kiro_fixture_inventory -- --nocaptureCloses #595