Agent skill
patterns/strategy
Strategy Pattern pattern for C development
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/patternsstrategy
SKILL.md
Strategy Pattern
Define a family of algorithms as interchangeable function pointers. Clients select which algorithm to use at runtime without changing calling code.
ikigai Application
LLM Provider abstraction: Each provider (OpenAI, Anthropic, Google) implements same interface:
typedef struct {
res_t (*send)(void *ctx, ik_message_t **msgs, size_t count);
res_t (*stream)(void *ctx, ik_message_t **msgs, chunk_cb cb);
} ik_llm_provider_t;
Selection: Config determines which provider vtable is used. REPL calls through interface, unaware of provider.
Testing: Inject mock provider that returns canned responses.
Future: Tool execution strategies, different database backends.
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?