ink-tui
Skill197 starsChanged 2 months agoMITView on GitHub
Build or modify the PostHog wizard's Ink screens, primitives, keyboard interactions, and session-driven screen flow. Use for TUI work in this repository.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- e2e-tests/test-applications/react-native-test-app/.cursor/rules/posthog-integration.mdcCursor rule
- adding-framework-supportSkill
- adding-skill-programSkill
- exploring-the-wizardSkill
- wizard-developmentSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Create a component in screens.
- Very specific: line 38
Add its ScreenId in screen-sequences.ts.
- Very specific: line 61
Use an explicit setter that notifies subscribers.
- Very specific: line 74
Run pnpm try --playground to inspect primitives.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ink TUI
The wizard renders its terminal interface with Ink and React. Pi is an agent harness; it does not replace this renderer. Read wizard-development for architecture and harness/sequence policy before structural changes.
Start with the existing surface
- For screen flow or state, read ARCHITECTURE.md.
- For layout or controls, read PRIMITIVES.md and the relevant component's props.
- For composition and keyboard behavior, read PATTERNS.md.
- For terminal sizing, startup, or noninteractive behavior, read TERMINAL-COMPAT.md.
package.json owns supported versions: currently Node
≥22.22.0, Ink ^6.8.0, React ^19.2.4, and @inkjs/ui ^2.0.0. Use installed
package types for API details; keep this skill focused on the wizard's
conventions rather than copying upstream component manuals.
Add a screen
- Create a component in screens.
- Add its
ScreenIdin screen-sequences.ts. - Register the component in screen-registry.tsx.
- Reference it through
screenIdin the owning program's steps, with the appropriate visibility, completion, and gate predicates.
Screen sequences derive from program steps. Do not hand-maintain a second
sequence array or add program navigation to the router. Additional state or
service wiring depends on the screen's needs; App remains the shared shell.
Preserve the UI boundary
Business logic calls WizardUI through getUI. Screens use WizardStore setters for reactive changes. The router resolves program screens from session predicates; overlays interrupt that resolution. Local state is appropriate for presentation details such as tab selection, not wizard progression.
For new state, first decide whether it belongs in
WizardSession or display-only store state.
Use an explicit setter that notifies subscribers. When business logic needs the
operation, extend WizardUI, InkUI, and
LoggingUI together. Reuse existing enums and
union types rather than introducing competing status vocabularies.
Reuse and check
Compose existing primitives and use styles.ts for shared colors, icons, and alignment. Export new public primitives from primitives/index.ts, add a realistic playground demo, and register it in PlaygroundApp.tsx.
Run pnpm try --playground to inspect primitives. Use
exploring-the-wizard when exercising actual
screen flows. Follow the repository's validation guidance; choose focused
behavior checks for changed predicates or input handling, and visual inspection
for layout changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

