patternscomposite
Composite Pattern pattern for C development
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Composite Pattern
Compose objects into tree structures. Individual objects and compositions treated uniformly through common interface.
ikigai Application
Layer system: Layers (scrollback, separator, input, spinner) compose into layer stack. Each implements same render interface:
typedef struct {
void (*render)(void *layer, ik_render_ctx_t *render);
void (*resize)(void *layer, int width, int height);
} ik_layer_vtable_t;
Rendering: REPL iterates layers, calls render on each. Doesn't care if layer is simple or composite.
Future uses:
- Nested UI components
- Tool result trees
- Message threading/nesting
Benefit: Add new layer types without changing render loop.
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!