スキル一覧に戻る
mgreenly

patternscontext-struct

by mgreenly

An AI Coding Agent

1🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: patterns/context-struct description: Context Struct Pattern (C-Specific) pattern for C development

Context Struct Pattern (C-Specific)

Pass state explicitly as struct pointer parameter rather than using globals. First parameter to functions is context containing state and dependencies.

ikigai Application

Core pattern: Every module uses this:

  • ik_repl_ctx_t - REPL state
  • ik_term_ctx_t - Terminal state
  • ik_scrollback_t - Scrollback state
  • ik_env_t - Runtime environment (planned)

Convention: Context is first parameter after talloc context:

res_t ik_scrollback_append(ik_scrollback_t *ctx, const char *line);

Benefits:

  • No global state
  • Multiple instances possible
  • Explicit dependencies
  • Testable (inject mock contexts)

See: project/explicit_context.md for ik_env_t design.

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

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

レビュー

💬

レビュー機能は近日公開予定です