KeiSeiKit-1.0/docs
Parfii-bot aa8333ccda feat(agent-substrate/phase-4): hook wiring — 3-line glue for kei-capability
PreToolUse hooks route through kei-capability check when orchestrator
registers a capability via KEI_CAPABILITY_NAME env var on agent spawn.

hooks/agent-capability-check.sh (22 LOC):
- Pass-through (exit 0) when KEI_CAPABILITY_NAME unset — no-op by default
- Fail-open (exit 0) when kei-capability binary missing — kit convention
- Sources _lib/gate.sh for KEI_DISABLED_HOOKS / KEI_HOOK_PROFILE respect
- exec kei-capability check "$CAP_NAME" when active

hooks/agent-capability-verify.sh (24 LOC):
- Orchestrator-driven, NOT a Claude Code native hook
- Carries env: AGENT_ID, TASK_TOML, WORKTREE_PATH, MAIN_REPO, RUN_MODE
- exec kei-capability verify "$CAP_NAME"

Registered in hooks/hooks.json + settings-snippet.json under both
PreToolUse:Bash and PreToolUse:Edit|Write matchers. Internal NotApplicable
returns exit 0 so non-matching tool calls cost nothing.

install.sh unchanged — hooks/*.sh glob picks up both new files.

tests/hook_wiring_integration.sh (64 LOC) — 3 contract assertions:
  (1) pass-through on unset KEI_CAPABILITY_NAME
  (2) deny+exit 2 on git-op pattern
  (3) allow+exit 0 on cargo-check pattern

Multi-capability routing (for phase 5): KEI_CAPABILITY_NAME currently
holds ONE name. When a role requires N capabilities, orchestrator will
either iterate or kei-capability gains a compose subcommand. Design
note left for phase 5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 02:51:10 +08:00
..
AGENT-ROLES.md feat(agent-substrate/phase-2): role matrix — 5 roles + AGENT-ROLES.md 2026-04-23 02:35:52 +08:00
AGENT-SCHEMA-LOCKED.md feat(agent-substrate): LOCK schema — 8 decisions resolved, 3-phase parallel window opens 2026-04-23 02:05:21 +08:00
AGENT-SUBSTRATE-SCHEMA.md feat(agent-substrate/phase-4): hook wiring — 3-line glue for kei-capability 2026-04-23 02:51:10 +08:00
ARCHITECTURE.md docs(readme): split 89 KB monolith into hero-pitch + 6 docs/ files 2026-04-22 22:20:22 +08:00
INSTALL.md docs(readme): split 89 KB monolith into hero-pitch + 6 docs/ files 2026-04-22 22:20:22 +08:00
REFERENCE.md docs(readme): split 89 KB monolith into hero-pitch + 6 docs/ files 2026-04-22 22:20:22 +08:00
SCHEMA-LOCKED.md feat(substrate): LOCK schema — 6-week parallel Stream A/B/C/D window opens 2026-04-23 00:00:33 +08:00
SECURITY.md docs(readme): split 89 KB monolith into hero-pitch + 6 docs/ files 2026-04-22 22:20:22 +08:00
SLEEP-LAYER.md docs(readme): split 89 KB monolith into hero-pitch + 6 docs/ files 2026-04-22 22:20:22 +08:00
SUBSTRATE-SCHEMA.md fix(substrate): amendment A-1 (input/output required all kinds) + integration test + jsonschema 0.18 relative-$id bug 2026-04-23 00:56:27 +08:00
USB-BRAIN-GUIDE-linux.md feat(v0.22): FS warn + battle-test matrix + USB docs platform split (Track C) 2026-04-22 20:56:42 +08:00
USB-BRAIN-GUIDE-macos.md feat(v0.22): FS warn + battle-test matrix + USB docs platform split (Track C) 2026-04-22 20:56:42 +08:00
USB-BRAIN-GUIDE-windows.md feat(v0.22): FS warn + battle-test matrix + USB docs platform split (Track C) 2026-04-22 20:56:42 +08:00
USB-BRAIN-GUIDE.md feat(v0.22): FS warn + battle-test matrix + USB docs platform split (Track C) 2026-04-22 20:56:42 +08:00
WHY.md docs(readme): split 89 KB monolith into hero-pitch + 6 docs/ files 2026-04-22 22:20:22 +08:00