Skip to content

Add Kiro file type detection for skills, hooks, specs, and powers #594

@avifenesh

Description

@avifenesh

Summary

Only FileType::KiroSteering exists. Add detection for other Kiro file patterns to enable validation of the full Kiro config surface.

Current state

  • FileType::KiroSteering detects .kiro/steering/*.md - working
  • No detection for other .kiro/ subdirectories

New file types needed (from research)

FileType Pattern Purpose Rules
KiroPower **/POWER.md inside power directories Power definitions KR-PW-001 to 004
KiroAgent .kiro/agents/*.json, ~/.kiro/agents/*.json Custom agent definitions KR-AG-001 to 005, KR-HK-005/006
KiroHook .kiro/hooks/*.kiro.hook IDE hook JSON files KR-HK-001 to 004
KiroMcp .kiro/settings/mcp.json, ~/.kiro/settings/mcp.json MCP configuration KR-MCP-001, 002

What was ruled out

  • KiroSpec - Specs (.kiro/specs/) are freeform AI-generated markdown, no schema to validate
  • KiroConfig - .kiro/settings/ only has mcp.json, covered by KiroMcp

Files to modify

  • crates/agnix-core/src/file_types/types.rs - Add 4 enum variants
  • crates/agnix-core/src/file_types/detection.rs - Add detection functions
  • crates/agnix-core/src/registry.rs - Register validators for new types

Detection logic

// KiroPower: POWER.md files (in any directory context)
fn is_kiro_power(path: &Path) -> bool // filename == "POWER.md"

// KiroAgent: .kiro/agents/*.json
fn is_kiro_agent(path: &Path) -> bool // under .kiro/agents/ with .json ext

// KiroHook: .kiro/hooks/*.kiro.hook (JSON files)
fn is_kiro_hook(path: &Path) -> bool // under .kiro/hooks/ with .kiro.hook ext

// KiroMcp: .kiro/settings/mcp.json
fn is_kiro_mcp(path: &Path) -> bool // .kiro/settings/mcp.json

Acceptance criteria

  • 4 new FileType variants added
  • Detection logic with tests
  • Registered in validator registry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions