Runtime bundle
Runtime
CafeKit cài một operating system cho assistant.
Package thêm skills, agents, rules, scripts, hooks, statusline, runtime config, và state synchronization vào project.
.claude/ runtime bundle
skills/
29 packaged workflows and domain capabilities
agents/
13 specialist agents for planning, code, QA, docs, git, and deploy
hooks/
Privacy, scope, state, usage, docs sync, and spec-state gates
runtime.json
Runtime configuration, paths, locale, usage, and model hints
settings.json
Claude Code hook wiring and statusline command
status.cjs
Git, context, usage, task, and agent statusline
Hooks#
Claude Code dùng CommonJS hooks trong .claude/hooks/. OpenCode dùng TypeScript plugins trong .opencode/plugins/ — xem OpenCode platform để biết mapping plugin ↔ hook.
| Hook | Mục đích |
|---|---|
privacy-block.cjs | Yêu cầu user approval cho file nhạy cảm như .env, keys, credentials, tokens. |
inspect-block.cjs | Chặn scope nặng hoặc không an toàn như .git, node_modules, build outputs, glob quá rộng. |
rules.cjs | Inject reminder về workflow, skill routing, docs path, modularization. |
spec-state.cjs | Tìm active spec và inject state sync tollgate. |
docs-sync.cjs | Detect docs thiếu hoặc stale. |
state.cjs | Persist session state và modified-file summary. |
agent.cjs | Cấp context nhẹ cho subagent. |
usage.cjs | Fetch usage limits cho statusline cache. |
Validators#
node .claude/scripts/validate-spec-output.cjs specs/<feature>
node .claude/scripts/validate-docs.cjs docs
node .claude/scripts/validate-docs-reconstruct.cjs docs/as-is/<scope>
node .claude/scripts/generate-skill-catalog.cjs --skills
Validator là hard backstop. Prompt có thể drift; script thì không nên.
State model#
spec.jsonlưu phase, status,task_files, vàtask_registry.tasks/task-R*.mdlưu context, steps, criteria, và evidence.
Hai layer này phải sync với nhau. Chat không phải source of truth.