agentleFS
natsustannatsustan/skdeck/.agents/skills/terminal-ui/AGENTS.md

skdeck / terminal-ui

AGENTS.md1 starsChanged 3 months agoMITView on GitHub

Version 0.1.0 DevEx January 2026 Note: This document is mainly for agents and LLMs to follow when maintaining, generating, or refactoring codebases. Humans may also find it useful, but guidance here is optimized for automation and consistency by AI-assisted workflows. Comprehensive developer experience guide for building TypeScript terminal user interfaces using Ink (React for CLIs) and Clack prompts. Contains 42 rules across 8 categories, prioritized by impact from critical (rendering optimization, input handling) to incremental (robustness and compatibility). Each rule…

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 4

    1. Shelra/ShelraCode★ 3100% same
    2. yosoyjavieruiz/Distroia★ 3100% same
    3. yosoyjavieruiz/ShelraCode★ 3100% same
    4. pproenca/skai★ 1100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

Files
AGENTS.md

Developer Experience TUI

Version 0.1.0
DevEx
January 2026

Note:
This document is mainly for agents and LLMs to follow when maintaining,
generating, or refactoring codebases. Humans may also find it useful,
but guidance here is optimized for automation and consistency by AI-assisted workflows.


Abstract

Comprehensive developer experience guide for building TypeScript terminal user interfaces using Ink (React for CLIs) and Clack prompts. Contains 42 rules across 8 categories, prioritized by impact from critical (rendering optimization, input handling) to incremental (robustness and compatibility). Each rule includes detailed explanations, real-world TypeScript examples comparing incorrect vs. correct implementations, and specific impact metrics to guide automated refactoring and code generation.


Table of Contents

  1. Rendering & Output — CRITICAL
    • 1.1 Batch Terminal Output in Single Write — CRITICAL (eliminates partial frame flicker)
    • 1.2 Defer ANSI Escape Code Generation to Final Output — HIGH (reduces intermediate string allocations)
    • 1.3 Overwrite Content Instead of Clear and Redraw — CRITICAL (eliminates blank frame flicker)
    • 1.4 Target 60fps for Smooth Animation — CRITICAL (16ms frame budget for perceived smoothness)
    • 1.5 Update Only Changed Regions — CRITICAL (reduces bandwidth by 80-95%)
    • 1.6 Use Synchronized Output Protocol for Animations — CRITICAL (eliminates 100% of mid-frame flicker)
  2. Input & Keyboard — CRITICAL
    • 2.1 Always Provide Escape Routes — CRITICAL (prevents user frustration and stuck states)
    • 2.2 Handle Modifier Keys Correctly — CRITICAL (prevents missed shortcuts and input bugs)
    • 2.3 Provide Immediate Visual Feedback for Input — CRITICAL (<100ms response feels instant)
    • 2.4 Use isActive Option for Focus Management — HIGH (prevents input conflicts between components)
    • 2.5 Use useInput Hook for Keyboard Handling — CRITICAL (prevents raw stdin complexity)
  3. Component Patterns — HIGH
    • 3.1 Use Border Styles for Visual Structure — MEDIUM (reduces visual parsing time by 30-50%)
    • 3.2 Use Box Component with Flexbox for Layouts — HIGH (eliminates manual position calculations)
    • 3.3 Use measureElement for Dynamic Sizing — HIGH (enables responsive layouts based on content)
    • 3.4 Use Percentage Widths for Responsive Layouts — HIGH (prevents overflow on 100% of terminal sizes)
    • 3.5 Use Static Component for Log Output — HIGH (prevents log lines from re-rendering)
    • 3.6 Use Text Component for All Visible Content — HIGH (prevents 100% of styling bugs from raw strings)
  4. State & Lifecycle — HIGH
    • 4.1 Always Clean Up Effects on Unmount — HIGH (prevents memory leaks and orphaned timers)
    • 4.2 Memoize Expensive Computations with useMemo — MEDIUM (avoids recalculating on every render)
    • 4.3 Stabilize Callbacks with useCallback — MEDIUM (prevents unnecessary re-renders in children)
    • 4.4 Use Functional State Updates to Avoid Stale Closures — HIGH (prevents stale state bugs in callbacks)
    • 4.5 Use useApp Hook for Application Lifecycle — HIGH (prevents terminal state corruption on exit)
  5. Prompt Design — MEDIUM-HIGH
    • 5.1 Build Custom Prompts with @clack/core — MEDIUM (enables specialized input patterns)
    • 5.2 Handle Cancellation Gracefully with isCancel — MEDIUM-HIGH (prevents crashes and ensures clean exit)
    • 5.3 Use Clack group() for Multi-Step Prompts — MEDIUM-HIGH (enables sequential prompts with shared state)
    • 5.4 Use Spinner and Tasks for Long Operations — MEDIUM-HIGH (prevents perceived hang during async work)
    • 5.5 Validate Input Early with Descriptive Messages — MEDIUM-HIGH (prevents invalid data from propagating)
  6. UX & Feedback — MEDIUM
    • 6.1 Show Next Steps After Completion — MEDIUM (reduces support requests by providing clear guidance)
    • 6.2 Show Progress for Operations Over 1 Second — MEDIUM (prevents perceived hangs and user frustration)
    • 6.3 Use Colors Semantically and Consistently — MEDIUM (reduces time-to-comprehension by 2-3×)
    • 6.4 Use Intro and Outro for Session Framing — MEDIUM (improves perceived quality by 30-40% in user studies)
    • 6.5 Write Actionable Error Messages — MEDIUM (reduces user frustration and support requests)
  7. Configuration & CLI — MEDIUM
    • 7.1 Implement Comprehensive Help System — MEDIUM (enables self-service and reduces support burden)
    • 7.2 Prefer Flags Over Positional Arguments — MEDIUM (reduces user errors by 50% through self-documentation)
    • 7.3 Provide Sensible Defaults for All Options — MEDIUM (reduces friction for common use cases)
    • 7.4 Support Machine-Readable Output Format — MEDIUM (enables scripting and tool integration)
    • 7.5 Support Standard Environment Variables — MEDIUM (enables scripting and CI integration)
  8. Robustness & Compatibility — LOW-MEDIUM
    • 8.1 Always Restore Terminal State on Exit — LOW-MEDIUM (prevents broken terminal after crashes)
    • 8.2 Degrade Gracefully for Limited Terminals — LOW-MEDIUM (maintains usability in 100% of terminal environments)
    • 8.3 Detect TTY and Adjust Behavior Accordingly — LOW-MEDIUM (prevents 100% of CI hangs from interactive prompts)
    • 8.4 Handle Process Signals Gracefully — LOW-MEDIUM (enables clean shutdown and resource cleanup)
    • 8.5 Use Meaningful Exit Codes — LOW-MEDIUM (enables proper error handling in scripts)

References

  1. https://github.com/bombshell-dev/clack
  2. https://github.com/vadimdemedes/ink
  3. https://github.com/vadimdemedes/ink-ui
  4. https://clig.dev/
  5. https://textual.textualize.io/blog/2024/12/12/algorithms-for-high-performance-terminal-apps/

Source Files

This document was compiled from individual reference files. For detailed editing or extension:

FileDescription
references/_sections.mdCategory definitions and impact ordering
assets/templates/_template.mdTemplate for creating new rules
SKILL.mdQuick reference entry point
metadata.jsonVersion and reference URLs

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.