Dosu LogoDosu Logo
Ask
Join our Discord
Organization avatar
stringyPublic
EvilBit Labs LLC
Documentsstringy
Kiro Automation Hooks
Kiro Automation Hooks
Type
Document
Status
Published
Created
Oct 31, 2025
Updated
Oct 31, 2025
Updated by
Dosu Bot

The Kiro hooks system in this project provides a declarative, event-driven automation framework for maintaining code quality, formatting, documentation accuracy, and CI reliability. Hooks are configured as JSON files in .kiro/hooks, each specifying its name, activation status, purpose, trigger conditions, file patterns, and the action or prompt to execute when triggered. This modular approach ensures that only relevant files and events activate automation, minimizing unnecessary changes and maximizing safety and maintainability.

Key Hooks Overview#

Rust Code Analyzer#

The rust-code-analyzer hook monitors Rust source files (*.rs) and Cargo.toml for user-triggered changes. When activated, it analyzes only the files changed in the current branch, detected via git --no-pager diff --name-only origin/main. The hook applies safe, mechanical, non-breaking improvements across eight categories: code smells, design patterns, best practices, readability, maintainability, performance, type safety, and error handling. All changes are validated by running just lint && just test to ensure no breakage. The hook produces a detailed report of applied changes and deferred items, preserving public APIs and project conventions. See configuration

Code Quality Check#

The code-quality-check hook runs just check when a code file is saved (triggered by fileEdited on *.rs, Cargo.toml, Cargo.lock, and justfile). This validates formatting, linting, and basic compilation. If the first run makes formatting changes, the hook runs the check again to ensure all issues are resolved. Results and any issues needing attention are reported. See configuration

Markdown Format Fix#

The markdown-format-fix hook activates when a markdown file (*.md) is created. It runs mdformat across all markdown files in the repository, focusing on identifying and fixing formatting issues in embedded code blocks. The hook instructs agents to make only safe, targeted corrections, avoiding risky blanket changes or disabling formatters. This ensures code blocks remain valid and documentation formatting is consistent. See configuration

Documentation Synchronization#

The docs-sync-hook monitors a broad set of files for user-triggered changes, including Rust source files, configuration files (Cargo.toml, Cargo.lock, justfile, *.toml, *.yaml, *.yml), and documentation files (README.md, docs/src/**/*.md, spec/*.md, .kiro/steering/**/*.md). When triggered, it prompts an agent to review the codebase and update both the README.md and the mdbook user guide in /docs/src/ to reflect new features, API changes, usage patterns, and architecture changes. This ensures documentation remains accurate and up-to-date with the current project state. See configuration

CI Auto-Fix#

The ci-auto-fix hook automatically runs CI checks when source files change (user-triggered on *.rs, Cargo.toml, Cargo.lock, justfile, deny.toml, rust-toolchain.toml). It starts by running just ci-check to identify failures, then applies minimal, targeted fixes for formatting, linting, compilation errors, test failures, security audits, and license compliance. After each fix, it verifies success by rerunning the CI check, repeating as needed until all checks pass. The hook provides a summary of what was fixed, ensuring CI reliability and compliance. See configuration

Trigger Conditions and File Change Detection#

Each hook defines its trigger conditions using a combination of event types (userTriggered, fileEdited, fileCreated) and file patterns (e.g., **/*.rs, **/*.md). For example, the Rust Code Analyzer uses userTriggered events and detects changed files via git diff against the main branch, ensuring only relevant files are analyzed and modified. Other hooks respond to file save or creation events, scoped to specific file types.

Contribution to Code Quality and Documentation Maintenance#

The Kiro hooks system enforces code quality by automating linting, formatting, and safe code improvements, ensuring that only validated, non-breaking changes are applied. Documentation hooks keep user guides and READMEs synchronized with the codebase, reducing drift and improving onboarding. CI hooks maintain continuous integration reliability by automatically fixing and verifying issues as code evolves. This tightly integrated automation framework supports a zero-warnings policy, prioritizes safety, and streamlines developer workflows, resulting in a maintainable, high-quality codebase and accurate documentation.

Documents
Binary Container Parsers
Binary Section Weighting and Symbol Extraction
Project Specification and Task Documentation
Section Weighting and Symbol Extraction
Stringy Binary Analyzer Specification
Stringy Project Specification
Code Quality and Formatting Tools
contributing
Developer Tooling and Quality Configurations
Developer Tooling and Quality Configurations
Documentation and Repository Naming Conventions
Kiro Automation Hooks
Rust Code Analysis and Performance Hooks
Continuous Integration and Dependency Management
AI Agent Contribution Guidelines
CI/CD Pipeline and Release Workflow
Kiro Automation Hooks
release-process
Security Analysis with CodeQL
Security Analysis with CodeQL
Memory-Mapped File I/O Abstraction
api-reference
architecture
development
getting-started
integration
release-process
safety
testing
Project Overview
product
tech
Specification-Driven Development
Documentation and Repository Naming Consistency
Project Specification and Task Documentation
Stringy Project Specification
String Extraction and Deduplication
Binary Section Weighting and Symbol Extraction
Project Specification and Task Documentation
Section Weighting and Symbol Extraction
Stringy Binary Analyzer Specification
Stringy Project Specification
tech
Testing Infrastructure and Quality Assurance
contributing
Contributor Code of Conduct
Documentation and Repository Naming Conventions
release-process
Rust Code Analysis and Performance Hooks
Stringy Binary Analyzer Specification
Stringy Project Specification
testing
AGENTS
Architecture & Design Internals
Architecture Decision Records (ADR) Summary
CHANGELOG
CLAUDE
CODE_OF_CONDUCT
CONTRIBUTING
Contributor & AI-Agent Guidelines - Stringy
GOTCHAS
Product Overview
README
Recently Opened Issues / Near-Term Planned Work
SECURITY
SKILL
SUMMARY
SUMMARY
Strategy
THIRD_PARTY_NOTICES
api
architecture
binary-formats
classification
cli
coding-style
commit-instructions
configuration
development
hooks
installation
introduction
introduction
output-formats
patterns
performance
quickstart
ranking
security
security-assurance
string-extraction
structure
testing
troubleshooting