~ / rigs / sourjya / kiro-rails

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

↗ GitHub ★ 9 MIT updated 4mo ago project Claude CodeKiro
share on X
ARCHETYPE
Orchestrator
A bench of specialised subagents. The main agent mostly delegates.
CONTEXT TAX · EVERY TURN
up to ~39.9k tokens
Claude Code loads MCP tools on demand, so the real cost is usually lower.
Context hog · median rig: 2.3k · breakdown
GUARDRAILS
3/5
Blocks destructive commands · Pre-tool screening hook · No YOLO mode · details
Quality 48/100 Guardrails v2

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)

serversourceest. tokens
Chrome DevTools MCP · "chrome-devtools" npm 9.0k

Skills (8)

Subagents (8)

code-security-reviewerPerforms structured code security and quality audits with restricted tool access. Supports tiered review (T1 pre-commit, T2 feature, T3 sprint).
security-verifierAdversarial 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-teamHostile 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-reviewerPerforms 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-reviewerPerforms structured code security and quality audits with restricted tool access. Supports tiered review (T1 pre-commit, T2 feature, T3 sprint).
security-verifierAdversarial 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-teamHostile 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-reviewerPerforms 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)

eventmatcherruns
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
PreToolUseBashbash .claude/hooks/guard-bash.sh
PreToolUseBashIN=$(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
PreToolUseBashcat .claude/hooks/prompts/comment-standards-check.txt
PreToolUseBashcat .claude/hooks/prompts/security-tier1-precommit.txt
PreToolUseEdit|Write|MultiEditIN=$(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
PostToolUseEdit|Write|MultiEditcat .claude/hooks/prompts/adr-trigger-infra-changes.txt
PostToolUseEdit|Write|MultiEditcat .claude/hooks/prompts/bug-doc-completion-check.txt
PostToolUseEdit|Write|MultiEditbash -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
PostToolUseEdit|Write|MultiEditbash -c 'mkdir -p logs && uvx ruff check --fix . 2>&1 | tee logs/ruff_check.log; exit ${PIPESTATUS[0]}'
PostToolUseEdit|Write|MultiEditbash -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"
PostToolUseEdit|Write|MultiEditcat .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
PostFileSavedocs/bugs/BUG-*.mdA 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
PostFileSavedocs/engineering/chokepoint-log.mdThe 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
PreToolUseshellCheck 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,**/*.jsxbash scripts/deprecated-pattern-detect.sh "${filePath}"

Slash commands (17)

/review-ai-agent-surface/review-api-contracts/review-cicd-pipeline/review-code-maintainability/review-code-security/review-commit-pr-discipline/review-css-architecture/review-dependency-risk/review-frontend-performance/review-hardcoded-values/review-iac-consistency/review-observability/review-spec-readiness/review-test-quality/review-ux-audit/review-ux-live/review-ux-preflight

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.

Permissions

deny (0)
—
ask (0)
—
allow (14)
read
grep
glob
knowledge
read
grep
glob
read
glob
grep
code
read
grep
glob

Similar rigs

copied ✓