Skip to content

docs: agent-safe CLI fallback guidance + review rule - #1596

Merged
pfleidi merged 2 commits into
mainfrom
agent-fallback-instructions
Jul 1, 2026
Merged

pfleidi merged 2 commits into
mainfrom
agent-fallback-instructions

Conversation

@pfleidi

@pfleidi pfleidi commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

https://entire.io/gh/entireio/cli/trails/722

Why

Non-interactive agents can't reach output that is gated behind a TUI, picker,
wizard, confirmation dialog, or stdin question — they see a menu they can't
answer or a preview they can't expand. The repo had no written guidance for
building or reviewing CLI features against this failure mode, and the trail
review runners weren't looking for it. Several existing commands already exhibit
the problem (e.g. bare rewind, sessions stop, clean).

What changed

  • Adds an Agent-Safe CLI Fallbacks section to CLAUDE.md (AGENTS.md
    symlinks to it) under Code Patterns: what non-interactive shapes are
    acceptable (--json, list + show, a selector flag/arg, or a non-TTY text
    fallback), what reviewers should inspect, and the existing good patterns to
    copy.
  • Adds one detection bullet to each of the trail-review and
    trail-review-focus runner prompts so automated review flags commands whose
    useful result is only reachable interactively.

Decisions made during development

  • Docs-only scope. The four low-hanging code issues found while writing this
    (truncated fallback in review/fix.go; missing non-TTY guards in rewind.go,
    sessions.go, clean.go) are deferred as follow-up, not bundled here.
  • Rule lives only in .entire/runners/*.json, not the embedded defaults in
    cmd/entire/cli/runnerdefaults/runners/.
    Those are this repo's tuned
    configs; the generic defaults ship to arbitrary scaffolded repos where the
    bullet's CLI-specific tells (huh, execx.NonInteractive, entire investigate) don't apply.
  • Framed as "functional gap / missing guard, not a style issue" so the
    finding survives the trail-review prompt's own no-style/no-refactor filter.

Reviewer notes

The new review rule only inspects the branch diff, so it will not flag the
pre-existing interactive commands already on main; it fires when a future diff
introduces or changes an interactive-only path.

Rendered Markdown


Note

Low Risk
Documentation and prompt-template text only; no runtime CLI or review pipeline code changes.

Overview
Documents agent-safe CLI fallbacks in CLAUDE.md (under Code Patterns): non-interactive agents must reach the same useful output via --json, list+show, selector flags/args, or non-TTY text fallbacks—not only TUIs, pickers, or stdin prompts. The section lists what to inspect when reviewing CLI changes (CanPromptInteractively, Bubble Tea, huh, etc.), points at execx.NonInteractive for tests, and cites existing commands as patterns.

Trail automation picks up the same theme: trail-review-focus adds a focus bullet for commands with no non-interactive path; trail-review adds a high-risk-surface bullet for interactive-only output paths (framed as a functional gap, with concrete code smells). Only .entire/runners/*.json is updated—not embedded runnerdefaults shipped to other repos.

Reviewed by Cursor Bugbot for commit 061777b. Configure here.

pfleidi added 2 commits July 1, 2026 13:58
Document that CLI features must expose their useful output through a
non-interactive path (JSON, list+show, selector flag, or a non-TTY text
fallback), not only through a TUI, picker, confirmation, or stdin prompt.
The guidance lives under Code Patterns in CLAUDE.md (AGENTS.md symlinks
to it).

Entire-Checkpoint: 9587f9abf6b3
Teach the trail-review and trail-review-focus runners to flag commands
whose useful result is reachable only interactively (TUI, picker,
confirmation, or stdin prompt) with no non-interactive path. Framed as a
functional gap / missing guard rather than a style preference so the
finding survives the review runner's no-style/no-refactor filters.

Entire-Checkpoint: 0c366988bc4b
Copilot AI review requested due to automatic review settings July 1, 2026 21:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds repository guidance and automated-review prompting to ensure new/changed CLI features don’t gate “useful output” behind interactive-only flows that non-interactive agents can’t access.

Changes:

  • Documents an “Agent-Safe CLI Fallbacks” pattern in CLAUDE.md (and thus AGENTS.md) with concrete acceptable non-interactive shapes and review/test guidance.
  • Updates .entire/runners/trail-review.json to flag interactive-only output paths as a functional gap / missing guard.
  • Updates .entire/runners/trail-review-focus.json to include “interactive-only with no fallback” as a human-review focus area.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
CLAUDE.md Adds a new “Agent-Safe CLI Fallbacks” section with requirements, review checklist, and examples.
.entire/runners/trail-review.json Extends the trail review prompt to detect interactive-only output paths lacking non-interactive fallbacks.
.entire/runners/trail-review-focus.json Extends the focus prompt to highlight TUI/picker-gated commands without non-interactive paths.

@pfleidi

pfleidi commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot run

@pfleidi
pfleidi marked this pull request as ready for review July 1, 2026 21:32
@pfleidi
pfleidi requested a review from a team as a code owner July 1, 2026 21:32

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 061777b. Configure here.

@pfleidi
pfleidi merged commit 901bb88 into main Jul 1, 2026
11 checks passed
@pfleidi
pfleidi deleted the agent-fallback-instructions branch July 1, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants