sourjya/kiro-rails
Steering files, hooks, and workflow scripts that give Kiro AI coding agent persistent engineering discipline - TDD, spec-driven planning, security reviews, and structured docs - from the first commit. Works with Kiro, Claude Code, Cursor, a
Copy this rig
# review before running: this installs third-party code $ claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest --headless $ npx degit sourjya/kiro-rails/.claude ./rig-kiro-rails # inspect, then merge into .claude/
MCP servers are added to Claude Code at local scope; env vars are shown as YOUR_… placeholders — we never store values. Files are fetched with degit into a separate folder so you can review before merging.
$ claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest --headless $ npx degit sourjya/kiro-rails/.claude/skills/auth-implementation .claude/skills/auth-implementation $ npx degit sourjya/kiro-rails/.claude/skills/incident-response .claude/skills/incident-response $ npx degit sourjya/kiro-rails/.claude/skills/kiro-rails .claude/skills/kiro-rails $ npx degit sourjya/kiro-rails/.claude/skills/review-guide .claude/skills/review-guide $ npx degit sourjya/kiro-rails/.claude/skills/spec-archive .claude/skills/spec-archive $ npx degit sourjya/kiro-rails/.claude/skills/spec-implement .claude/skills/spec-implement $ npx degit sourjya/kiro-rails/.claude/skills/spec-propose .claude/skills/spec-propose $ npx degit sourjya/kiro-rails/.claude/skills/spec-verify .claude/skills/spec-verify
$ curl -fsSL --create-dirs -o .claude/agents/code-security-reviewer.md https://raw.githubusercontent.com/sourjya/kiro-rails/main/.claude/agents/code-security-reviewer.md $ curl -fsSL --create-dirs -o .claude/agents/security-verifier.md https://raw.githubusercontent.com/sourjya/kiro-rails/main/.claude/agents/security-verifier.md $ curl -fsSL --create-dirs -o .claude/agents/ux-red-team.md https://raw.githubusercontent.com/sourjya/kiro-rails/main/.claude/agents/ux-red-team.md $ curl -fsSL --create-dirs -o .claude/agents/ux-reviewer.md https://raw.githubusercontent.com/sourjya/kiro-rails/main/.claude/agents/ux-reviewer.md
Merge into .claude/settings.json (project) or ~/.claude/settings.json (user). Hook commands reference scripts in the source repo — copy those too.
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/guard-bash.sh"
},
{
"type": "command",
"command": "IN=$(cat); printf '%s' \"$IN\" | jq -r '.tool_input.command // empty' | grep -qE '(^|[^a-z])git commit|git-commit-push\\.sh' && cat .claude/hooks/prompts/changelog-maintenance.txt || echo OK"
},
{
"type": "command",
"command": "cat .claude/hooks/prompts/comment-standards-check.txt"
},
{
"type": "command",
"command": "cat .claude/hooks/prompts/security-tier1-precommit.txt"
}
]
},
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [
{
"type": "command",
"command": "IN=$(cat); printf '%s' \"$IN\" | jq -r '.tool_input.file_path // empty' | grep -qiE '\\.(tsx|jsx|css|scss)$' && cat .claude/hooks/prompts/ux-preflight-gate.txt || echo OK"
}
]
},
{
"matcher": "shell",
"hooks": [
{
"type": "prompt",
"command": "Check if the shell command about to run is exactly 'git commit' or starts with 'git commit' or calls any git-commit script. If it does NOT match any of these patterns, respond with just 'OK' and take no further action.\n\nOnly if the command "
},
{
"type": "prompt",
"command": "Check if the shell command about to run is exactly 'git commit' or starts with 'git commit' or calls 'scripts/git-commit-push.sh'. If it does NOT match any of these patterns, respond with just 'OK' and take no further action.\n\nOnly if the c"
}
]
}
]
}
} MCP servers (1)
| server | source | est. tokens |
|---|---|---|
| Chrome DevTools MCP · "chrome-devtools" | npm | 9.0k |
Skills (8)
Subagents (8)
| code-security-reviewer | Performs structured code security and quality audits with restricted tool access. Supports tiered review (T1 pre-commit, T2 feature, T3 sprint). |
| security-verifier | Adversarial verification agent. Assumes each security finding is a false positive and searches for compensating controls that disprove it. Use after the code-security-reviewer produces findings. |
| ux-red-team | Hostile UX reviewer. Assumes the implementation is flawed. Finds friction, hierarchy issues, accessibility gaps, pointer travel problems, and pattern violations. Read-only - cannot modify code. |
| ux-reviewer | Performs live browser-walk UX audits using the console-idiom rubric. Restricted to read-only browser interaction - no writes, deletes, or submissions. Requires a browser MCP. |
| code-security-reviewer | Performs structured code security and quality audits with restricted tool access. Supports tiered review (T1 pre-commit, T2 feature, T3 sprint). |
| security-verifier | Adversarial verification agent. Assumes each security finding is a false positive and searches for compensating controls that disprove it. Use after the code-security-reviewer produces findings. |
| ux-red-team | Hostile UX reviewer. Assumes the implementation is flawed. Finds friction, hierarchy issues, accessibility gaps, pointer travel problems, and pattern violations. Read-only - cannot modify code. |
| ux-reviewer | Performs live browser-walk UX audits using the console-idiom rubric. Restricted to read-only browser interaction - no writes, deletes, or submissions. Requires a browser MCP. |
Hooks (46)
| event | matcher | runs |
|---|---|---|
| UserPromptSubmit | * | bash -c 'M=$(git branch --merged main 2>/dev/null | grep -v "[*]" | grep -vw main | xargs); T=$(git branch 2>/dev/null | grep -vw main | grep -cv "[*]"); if [ -n "$M" ]; then echo "🌿 BRANCH HYGIENE: merged into main but not deleted: $M -- r |
| UserPromptSubmit | * | bash -c 'CHANGELOG="docs/changelogs/CHANGELOG.md"; if [ ! -f "$CHANGELOG" ]; then echo "OK"; exit 0; fi; LAST_MOD=$(git log -1 --format=%H -- "$CHANGELOG" 2>/dev/null); if [ -z "$LAST_MOD" ]; then echo "OK"; exit 0; fi; COMMITS_SINCE=$(git |
| UserPromptSubmit | * | bash -c 'FIXES=$(git log --oneline -5 2>/dev/null | grep -c "^[a-f0-9]\+ fix"); if [ "$FIXES" -ge 3 ]; then echo "⚠️ FIX SPIRAL DETECTED: $FIXES consecutive fix commits found in last 5 commits. BEFORE attempting another fix: 1) Map ALL code |
| UserPromptSubmit | * | bash -c 'B=$(git branch --show-current 2>/dev/null); if [ -n "$B" ] && [ "$B" != "main" ] && [ -n "$(git status --porcelain 2>/dev/null)" ]; then echo "🎯 FOCUS GUARD: uncommitted work in progress on branch $B. If this new request is UNRELAT |
| UserPromptSubmit | * | bash -c 'B=$(git branch --show-current 2>/dev/null); if [ -z "$B" ] || [ "$B" = "main" ]; then echo OK; exit 0; fi; HAS_UI=$(git diff --name-only main..HEAD 2>/dev/null | grep -cE "\.(tsx|jsx|css|scss|html)$" || true); HAS_API=$(git diff -- |
| UserPromptSubmit | * | bash -c 'if [ -f scripts/session-guard.sh ]; then OUT=$(bash scripts/session-guard.sh 2>/dev/null | grep "⚠️"); if [ -n "$OUT" ]; then echo "$OUT"; echo "See session-isolation.md - do not run destructive or cross-repo git."; else echo OK; f |
| UserPromptSubmit | * | bash -c 'B=$(git branch --show-current 2>/dev/null); case "$B" in fix/*) A=$(git rev-list --count main..HEAD 2>/dev/null || echo 0); if [ "${A:-0}" -lt 3 ]; then echo "🔎 VARIANT SEARCH: on $B. After you identify the root cause, search every |
| PreToolUse | Bash | bash .claude/hooks/guard-bash.sh |
| PreToolUse | Bash | IN=$(cat); printf '%s' "$IN" | jq -r '.tool_input.command // empty' | grep -qE '(^|[^a-z])git commit|git-commit-push\.sh' && cat .claude/hooks/prompts/changelog-maintenance.txt || echo OK |
| PreToolUse | Bash | cat .claude/hooks/prompts/comment-standards-check.txt |
| PreToolUse | Bash | cat .claude/hooks/prompts/security-tier1-precommit.txt |
| PreToolUse | Edit|Write|MultiEdit | IN=$(cat); printf '%s' "$IN" | jq -r '.tool_input.file_path // empty' | grep -qiE '\.(tsx|jsx|css|scss)$' && cat .claude/hooks/prompts/ux-preflight-gate.txt || echo OK |
| PostToolUse | Edit|Write|MultiEdit | cat .claude/hooks/prompts/adr-trigger-infra-changes.txt |
| PostToolUse | Edit|Write|MultiEdit | cat .claude/hooks/prompts/bug-doc-completion-check.txt |
| PostToolUse | Edit|Write|MultiEdit | bash -c 'if [ -d .claude ]; then NEW=$(find .kiro/steering .kiro/hooks .kiro/agents .kiro/prompts .kiro/skills -type f -newer .claude/CLAUDE.md 2>/dev/null | head -1); if [ -n "$NEW" ]; then echo "🔁 CLAUDE EXPORT STALE: .kiro/ changed after |
| PostToolUse | Edit|Write|MultiEdit | bash -c 'mkdir -p logs && uvx ruff check --fix . 2>&1 | tee logs/ruff_check.log; exit ${PIPESTATUS[0]}' |
| PostToolUse | Edit|Write|MultiEdit | bash -c 'if [ -f package.json ] && grep -q '"files"' package.json 2>/dev/null; then echo "=== npm pack dry-run ==="; npm pack --dry-run 2>&1 | tail -20; elif [ -f pyproject.toml ]; then echo "OK - verify pyproject.toml includes are correct" |
| PostToolUse | Edit|Write|MultiEdit | cat .claude/hooks/prompts/spec-validation-gate.txt |
| Stop | * | bash -c 'B=$(git branch --show-current 2>/dev/null); if [ -n "$B" ] && [ "$B" != "main" ] && [ -n "$(git status --porcelain 2>/dev/null)" ]; then N=$(git status --porcelain 2>/dev/null | wc -l | tr -d " "); echo "💾 CHECKPOINT: $N uncommitte |
| Stop | * | bash -c 'if [ -f tsconfig.json ]; then npx tsc --noEmit 2>&1 | head -20; elif [ -f pyproject.toml ] && command -v ruff &>/dev/null; then ruff check . --select E,F --no-fix 2>&1 | head -20; else echo "OK"; fi' |
| PostFileSave | **/docker-compose*.yml,**/Dockerfile*,**/infrastructure/**,**/*.tf,**/Caddyfile,**/nginx.conf,**/.github/workflows/** | An infrastructure or deployment configuration file was just modified: ${filePath} A change warrants an ADR if it: - Introduces a new service, database, or external dependency - Changes deployment topology (new container, serverless functio |
| UserPromptSubmit | * | bash -c 'MERGED=$(git branch --merged main 2>/dev/null | grep -v "[*]" | grep -vw main | tr -d " "); if [ -n "$MERGED" ]; then echo "🌿 BRANCH HYGIENE: Auto-deleting merged branches:"; for B in $MERGED; do git branch -d "$B" 2>/dev/null && e |
| PostFileSave | docs/bugs/BUG-*.md | A bug document was just edited. Read the file and verify ALL of these required fields are filled (not empty, not 'TBD', not 'TODO'): 1. **Root Cause** - must explain WHY the bug happened 2. **Fix Description** - must explain WHAT was chang |
| UserPromptSubmit | * | bash -c 'CHANGELOG="docs/changelogs/CHANGELOG.md"; if [ ! -f "$CHANGELOG" ]; then echo "OK"; exit 0; fi; LAST_MOD=$(git log -1 --format=%H -- "$CHANGELOG" 2>/dev/null); if [ -z "$LAST_MOD" ]; then echo "OK"; exit 0; fi; COMMITS_SINCE=$(git |
| BeforeCommit | * | bash scripts/changelog-draft.sh |
| PostFileSave | docs/engineering/chokepoint-log.md | The chokepoint log was just updated. Perform pattern analysis: 1. Read docs/engineering/chokepoint-log.md 2. Count entries per **Pattern:** category 3. For any category with 2 entries: note the trend ("2x TYPE_MISMATCH — worth watching") 4 |
| PostFileSave | .kiro/steering/**,.kiro/hooks/**,.kiro/agents/**,.kiro/prompts/**,.kiro/skills/** | bash -c 'if [ -d .claude ]; then NEW=$(find .kiro/steering .kiro/hooks .kiro/agents .kiro/prompts .kiro/skills -type f -newer .claude/CLAUDE.md 2>/dev/null | head -1); if [ -n "$NEW" ]; then echo "🔁 CLAUDE EXPORT STALE: .kiro/ changed after |
| PreToolUse | shell | Check if the shell command about to run is exactly 'git commit' or starts with 'git commit' or calls any git-commit script. If it does NOT match any of these patterns, respond with just 'OK' and take no further action. Only if the command |
| Stop | * | bash -c 'B=$(git branch --show-current 2>/dev/null); if [ -n "$B" ] && [ "$B" != "main" ] && [ -n "$(git status --porcelain 2>/dev/null)" ]; then N=$(git status --porcelain 2>/dev/null | wc -l | tr -d " "); echo "💾 CHECKPOINT: $N uncommitte |
| PostFileSave | **/*.py,**/*.ts,**/*.tsx,**/*.js,**/*.jsx | bash scripts/deprecated-pattern-detect.sh "${filePath}" |
Slash commands (17)
Kiro (22 steering · 1 specs · 31 hook files)
Specs: bug-scribe (loaded on demand, not counted in context tax)
MCP config: 8 auto-approved tool(s) · disabled (not counted): chrome-devtools
How Kiro files are scored: methodology.