control-cli
Skill1 starsChanged 38 days agoMITView on GitHub
Drive, inspect, and profile an interactive CLI or TUI with a repeatable local harness and no external services. Use for CLI UX checks, prompt flows, resize bugs, startup regressions, memory leaks, hangs, terminal transcripts, or when asked to \"drive the CLI\", \"test this TUI\", or \"reproduce in a terminal\".
8 other projects use a version of this, 6 of them edited.
Adopted by
Most recently taken up by
- paramcodes/skillsedited, first seen Nov 8, 2026
- ArchitektApx/cursor-skills-for-claudeedited, first seen Nov 1, 2026
- AnastasiyaW/codex-claude-code-configtheir own version, first seen Oct 30, 2026
- conscientiousness/herdr-pstack-orchestratoredited, first seen Oct 20, 2026
- anis-dr/skillsedited, first seen Oct 15, 2026
- AnastasiyaW/claude-code-configtheir own version, first seen Oct 8, 2026
Used with
Projects with it also use verify-this.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
learnerLjSkillverify-this
Verify a claim with fresh local evidence: restate it falsifiably, capture baseline and treatment, compare artifacts, and return VERIFIED, NOT VERIFIED, or INCONCLUSIVE.
Also in 4 projects that use this
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 6
- anis-dr/skills★ 347% same
- conscientiousness/herdr-pstack-orchestrator★ 247% same
- EvanBatten/pstack-for-cc★ 244% same
- ElyzeSolutions/skills★ 147% same
- ArchitektApx/cursor-skills-for-claude★ 047% same
- paramcodes/skills★ 047% same
Wrote their own version · 2
- AnastasiyaW/claude-code-config★ 214same name
- AnastasiyaW/codex-claude-code-config★ 214same name
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 repository58 other files it gives its agents.
- architectSkill
- arenaSkill
- automate-meSkill
- benchmark-checklistSkill
- blast-radiusSkill
- browser-useSkill
- control-uiSkill
- correctSkill
- create-verification-skillSkill
- cua-driverSkill
- deslopSkill
- figure-it-outSkill
- howSkill
- interrogateSkill
- maintain-verification-skillSkill
- no-commentsSkill
- poteto-modeSkill
- principle-attack-the-premiseSkill
- principle-boundary-disciplineSkill
- principle-build-the-leverSkill
- principle-encode-lessons-in-structureSkill
- principle-exhaust-the-design-spaceSkill
- principle-experience-firstSkill
- principle-explain-the-numberSkill
- principle-fix-root-causesSkill
- principle-foundational-thinkingSkill
- principle-guard-the-context-windowSkill
- principle-laziness-protocolSkill
- principle-make-operations-idempotentSkill
- principle-migrate-callers-then-delete-legacy-apisSkill
- principle-minimize-reader-loadSkill
- principle-model-the-domainSkill
- principle-never-block-on-the-humanSkill
- principle-outcome-oriented-executionSkill
- principle-prove-it-worksSkill
- principle-redesign-from-first-principlesSkill
- principle-separate-before-serializing-shared-stateSkill
- principle-sequence-verifiable-unitsSkill
- principle-small-door-big-roomSkill
- principle-subtract-before-you-addSkill
- principle-test-behavior-not-implementationSkill
- principle-tests-pay-rentSkill
- principle-type-system-disciplineSkill
- recallSkill
- reflectSkill
- setup-pstackSkill
- show-me-your-workSkill
- stacked-prsSkill
- swarmSkill
- tddSkill
- teachSkill
- technical-writingSkill
- thermo-nuclear-code-quality-reviewSkill
- thermo-nuclear-reviewSkill
- thermosSkill
- typescript-best-practicesSkill
- unslopSkill
- whySkill
The file
We split this skill into the rules it gives an agent
9 rules. 5 are common, 0 are distinctive, and 4 are very specific to this project.
5
Common
Most of the 8 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 22
If none exists, launch the CLI in an isolated terminal session with deterministic env vars.
- Common: line 25
Wait for a concrete screen pattern or prompt before the next action.
- Very specific: line 36
Scripted PTY probe: Use eval (py or js) when the flow needs exact waits and assertions in one place.
- Very specific: line 52
Wait by polling capture-pane for a concrete pattern with a deadline, not by sleeping.
- Very specific: line 56
Use eval (py) when neither tmux nor a repo harness fits.
- Common: line 94
Prefer deterministic waits over sleeps.
- Common: line 95
Do not send credentials or destructive commands into a controlled session.
- Very specific: line 96
Keep the harness in /tmp unless the repo already has a testing or demo harness.
- Common: line 97
Do not hard-code paths from another repository.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Control CLI
Exercise an interactive CLI with a repeatable harness instead of poking at it. Reuse the repo's own test or demo harness first; otherwise assemble a temporary one from the tools below.
What it is used for
- Reproducing CLI/TUI bugs with deterministic input.
- Verifying keyboard flows, prompts, interrupts, resize behavior, and terminal layout.
- Capturing before/after transcripts for bug fixes.
- Profiling startup time, slow operations, hangs, or memory growth.
- Recording a short terminal demo when output is easier to show than explain.
Harness loop
- Identify the command under test and the smallest reproducible workspace.
- Discover existing harnesses: package scripts, e2e tests, demo recorders, expect scripts, PTY helpers.
- If none exists, launch the CLI in an isolated terminal session with deterministic env vars.
- Capture the current screen before interacting.
- Send one action at a time: text, Enter, arrows, Escape, Ctrl-C, resize.
- Wait for a concrete screen pattern or prompt before the next action.
- Save the transcript and any profile artifacts.
- Kill the session cleanly.
Harness options
Pick the lightest one that fits.
- Repo-native harness. Checked-in scripts already know the app's startup, env, and prompts.
- Named
bashservice. For line-oriented prompts and REPLs that need stdin, start the program as a service:bash {command, name, ready?}with areadylog regex or port, and noasyncand notimeout(both throw in service mode). The service runs under its own broker-owned PTY, so prompts, colors, and line editing behave as for a user, and it works in subagents. Thenread proc://<name>for state and output,write proc://<name>to send stdin (an empty write sends Enter), andwrite proc://<name>/killto stop it. A plainasync: truejob takes no stdin. Foregroundbashwithpty: trueopens a human-facing overlay and is unavailable in subagents, so do not plan a harness around it. tmux. The robust path for full-screen TUIs and anything needing a stable screen or a resize, and the subagent-safe TUI path because it needs no overlay:capture-panereturns the rendered screen,send-keyssends real keys,resize-windowtests layout. Use it when raw PTY output is escape-sequence noise.- Scripted PTY probe. Use eval (py or js) when the flow needs exact waits and assertions in one place. Prefer it over hand-rolled
selectloops in shell. - Runtime inspector. Node or Bun inspector for CPU profiles, heap snapshots, and live evaluation.
xd://debug(DAP) attaches to a running process for breakpoints and stacks. - Terminal recorder. Repo-local demo tools or asciinema-compatible tools, only when the user asks for a demo.
Minimal tmux harness
SESSION="cli-harness-$(date +%s)"
tmux new-session -d -x 120 -y 40 -s "$SESSION" -- <command-under-test>
tmux capture-pane -pt "$SESSION"
tmux send-keys -t "$SESSION" "help" Enter
tmux capture-pane -pt "$SESSION"
tmux resize-window -t "$SESSION" -x 60 -y 20
tmux kill-session -t "$SESSION"Wait by polling capture-pane for a concrete pattern with a deadline, not by sleeping. For Node CLIs, start with NODE_OPTIONS="--inspect=127.0.0.1:0", read the inspector URL from the terminal, and profile with DevTools-compatible tooling or xd://debug.
Scripted PTY probe
Use eval (py) when neither tmux nor a repo harness fits. Keep it temporary, under /tmp, unless the user asks for a reusable test.
import os, pty, select, subprocess, time
master, slave = pty.openpty()
proc = subprocess.Popen(["<command>", "<arg>"], stdin=slave, stdout=slave, stderr=slave, close_fds=True)
os.close(slave)
def wait_for(text, timeout=30):
buf, end = b"", time.time() + timeout
while time.time() < end:
if select.select([master], [], [], 0.25)[0]:
buf += os.read(master, 4096)
if text in buf:
return buf.decode(errors="replace")
raise TimeoutError(f"never saw {text!r}; got {buf[-500:]!r}")
try:
wait_for(b"<ready text>")
os.write(master, b"help\n")
print(wait_for(b"<expected reply>"))
finally:
proc.terminate()
os.close(master)For richer terminal control use pty.fork() or an existing PTY library.
Profiling recipes
- Startup regression: capture baseline and treatment timings on the same machine, env, and command.
- Slow operation: start a CPU profile, perform the operation, stop the profile, compare top self-time functions.
- Memory leak: force GC if available, take a heap snapshot, repeat the operation, force GC again, take another snapshot.
- Hang: capture the screen, active handles and resources, and a stack or CPU sample before interrupting.
xd://debugcan pause the process and show stacks.
Guardrails
- Prefer deterministic waits over sleeps. If you must sleep, explain why.
- Do not send credentials or destructive commands into a controlled session.
- Keep the harness in
/tmpunless the repo already has a testing or demo harness. - Do not hard-code paths from another repository. Adapt commands to the current repo's scripts and runtime.
- Clean up tmux sessions,
proc://<name>services, temp dirs, inspector processes, and demo artifacts unless the user asks to keep them.
Adapted from cursor-team-kit (MIT).
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.

