Detect Kiro Specs

Detect Kiro specs with modified files in current branch. Use before PRs, spec-specific tests, or CI filtering.

majiayu000 ea6ecf0 2 files · 1.8 KB Updated 567 repo stars

File contents

Modified Kiro Specs Detection

IMPORTANT: Check .kiro/specs exists via ls before start. If absent, quit immediately with empty list.

Usage

./scripts/main.sh [-b|--branch <branch>]

Options:

  • -b, --branch: Base branch (default: repo default)

Output

Newline-separated spec names, sorted:

user-auth
product-listing

Empty if no modified specs.

main.sh Internal Detection Logic

  1. List all specs from .kiro/specs/
  2. Get modified files via git diff <branch>...HEAD
  3. Match files containing /<spec-name>/ pattern
  4. Return distinct matches sorted alphabetically

Examples

# Default branch
./scripts/main.sh

# Specific branch
./scripts/main.sh -b develop

# Count
./scripts/main.sh | wc -l

# CI loop
for spec in $(./scripts/main.sh); do
  run_tests "$spec"
done

majiayu000/claude-skill-registry-data/tree/main/testing/detect-kiro-specs commit ea6ecf000f

Frequently asked questions

npx skillmds add majiayu000/detect-kiro-specs