Skip to content

Enhance JavaParser Power with Kiro Hooks #1

Description

@verhasi

Goal

Add Kiro hooks to automate mechanical compliance steps that currently rely on AI memory via steering files.

Rationale

JavaParser has a self-referential build where modifying generator source requires running generators before building. Currently the steering files tell the AI to remind the developer. Hooks make this deterministic and zero-context-cost.

Planned Hooks

1. Run Code Generators on Generator Source Change

  • Trigger: File changed in javaparser-core-generators/src/**/*.java
  • Action: ./run_core_generators.sh
  • Post-check: git diff --exit-code — notify if generated files changed

2. Rebuild Metamodel on AST Node Change

  • Trigger: File changed in javaparser-core/src/main/java/com/github/javaparser/ast/**/*.java
  • Action: ./run_core_metamodel_generator.sh && ./run_core_generators.sh
  • Post-check: git diff --exit-code

3. Verify Pre-PR Compliance

  • Trigger: User-triggered (before PR submission)
  • Action: Run generators + checkstyle + verify empty diff

Design Principle

  • Hooks handle mechanical steps that should never be skipped
  • Steering handles judgment and reasoning that need intelligence

Tasks

  • Research Kiro hooks documentation for exact trigger syntax
  • Implement hooks in javaparser-contributor/hooks/
  • Test locally with file change triggers
  • Update POWER.md onboarding section to install hooks
  • Update steering files to reference hooks instead of manual reminders

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions