Agent skill
patterns/observer
Observer Pattern (Callbacks) pattern for C development
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/observer
SKILL.md
Observer Pattern (Callbacks)
Objects register interest in events and get notified when they occur. In C, implemented as callback function pointers with context.
ikigai Application
Streaming chunks: LLM client notifies REPL as response chunks arrive:
typedef void (*chunk_callback_t)(void *ctx, const char *chunk, size_t len);
res_t ik_llm_stream(client, messages, on_chunk, user_ctx);
Terminal resize: Signal handler notifies REPL of SIGWINCH.
Future uses:
- Database change notifications
- Tool execution progress
- Background task completion
Convention: Always pair callback function pointer with void *user_ctx parameter.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?