← Back to list

patternsfactory
by mgreenly
An AI Coding Agent
⭐ 1🍴 0📅 Jan 24, 2026
SKILL.md
name: patterns/factory description: Factory Pattern pattern for C development
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:
ik_scrollback_create()- creates scrollback bufferik_mark_create()- creates checkpoint marksik_input_parser_create()- creates input parser
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.
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon