How ibm/tksfw works
KeelStone is a harness-level framework for structuring, delegating, and governing agent work through project files and hooks. A typical flow starts with a human initializing a project, then an agent works inside Claude Code or Codex: hooks supply project context and route delegation, while edit tracking and ledger skills record and validate work. State refresh and stop-time checks support resumability and auditability. The graph uses documented capabilities and shown hook relationships; unsampled implementation details are not inferred.
Main entry points: inject_state.py Context injection · track_edits.py Edit tracking · route_model.py Model routing · workarea Project ledgers
Components 18
Project setup
- Project initializer
tools/new_project.py - Project method
template/AGENTS.md
Agent runtime
- Layer resolver
plugins/tksfw/hooks/layers.py - Context injection
plugins/tksfw/hooks/inject_state.py - State projection
plugins/tksfw/hooks/refresh_state.py - Model routing
plugins/tksfw/hooks/route_model.py - Agent definitions
plugins/tksfw/hooks/agentlib.py - Session cleanup
plugins/tksfw/hooks/session_end.py
Work governance
- Work delegation
plugins/tksfw/skills/delegate-work/SKILL.md - Subagent tracking
plugins/tksfw/hooks/subagent_track.py - Edit tracking
plugins/tksfw/hooks/track_edits.py - Ledger operations
plugins/tksfw/skills/yaml-log-entry/SKILL.md - Ledger validation
plugins/tksfw/skills/yaml-log-entry/assets/validate_yaml_log.py - Project ledgers
template/.agents/workarea - Turn-end checks
plugins/tksfw/hooks/check_ledgers_on_stop.py
Harness integrations
- Optional MCP tools
plugins/tksfw-tools
Other components
- Human operator
- Agent harness
Connections 20
- Human operator → Project initializer: initializes project
README.md - Project initializer → Project method: instantiates method
README.md - Human operator → Agent harness: works in
README.md - Agent harness → Context injection: starts session
plugins/tksfw/hooks/inject_state.py - Context injection → State projection: refreshes state
plugins/tksfw/hooks/inject_state.py - Context injection → Layer resolver: resolves layers
plugins/tksfw/hooks/inject_state.py - Agent harness → Model routing: dispatches delegation
plugins/tksfw/hooks/route_model.py - Model routing → Subagent tracking: checks live agents
plugins/tksfw/hooks/route_model.py - Agent definitions → Model routing: provides agent tier
plugins/tksfw/hooks/agentlib.py - Human operator → Work delegation: delegates work
README.md - Agent harness → Edit tracking: tracks edits
plugins/tksfw/hooks/track_edits.py - Edit tracking → Ledger validation: validates ledgers
plugins/tksfw/hooks/track_edits.py - Edit tracking → Project ledgers: journals changes
plugins/tksfw/hooks/track_edits.py - Human operator → Ledger operations: records work
README.md - Ledger operations → Project ledgers: updates ledgers
README.md - Agent harness → Turn-end checks: checks turn end
plugins/tksfw/hooks/check_ledgers_on_stop.py - Turn-end checks → Project ledgers: checks completeness
plugins/tksfw/hooks/check_ledgers_on_stop.py - Agent harness → Session cleanup: ends session
plugins/tksfw/hooks/session_end.py - Session cleanup → Subagent tracking: clears live set
plugins/tksfw/hooks/session_end.py - Agent harness → Optional MCP tools: optionally uses
README.md