Back to list
mgreenly

patternsstate-machine

by mgreenly

An AI Coding Agent

1🍴 0📅 Jan 24, 2026

SKILL.md


name: patterns/state-machine description: State Machine Pattern pattern for C development

State Machine Pattern

Model system behavior as discrete states with defined transitions. Current state determines which actions are valid and what state comes next.

ikigai Application

Input parser: Tracks escape sequence state (normal, escape, CSI, etc.) to interpret terminal input bytes.

Streaming response: States like idle → requesting → streaming → complete → idle.

Implementation: Enum for states, switch or function pointer table for transitions:

typedef enum { STATE_IDLE, STATE_STREAMING, STATE_ERROR } stream_state_t;

REPL states: Input mode, scrolling mode, command mode.

Benefit: Complex input handling becomes manageable. Each state handles its valid inputs.

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