install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/factory" ~/.claude/skills/majiayu000-claude-skill-registry-patterns-factory && rm -rf "$T"
manifest:
skills/data/factory/SKILL.mdsource content
Factory Pattern
Function that encapsulates object creation, returning an allocated and initialized struct. Centralizes construction logic and hides allocation details from callers.
ikigai Application
Current usage:
- creates scrollback bufferik_scrollback_create()
- creates checkpoint marksik_mark_create()
- creates input parserik_input_parser_create()
Convention: Use
*_create() for heap allocation (caller owns), *_init() for initializing pre-allocated memory.
With ik_env_t: Factories should receive
ik_env_t *env as first parameter for access to logger, config, and clock during construction.
Testing: Factories enable injecting dependencies at creation time rather than reaching for globals.