一键导入
tui-session-audit
Audit and improve Bramble TUI session rendering, interaction flows, and replay fidelity.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit and improve Bramble TUI session rendering, interaction flows, and replay fidelity.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Fully autonomous PR polish loop. Runs N rounds of local bramble review (codex + cursor, optionally + gemini), folds in any existing PR comments and CI failures as round-1 input, fixes findings locally, pushes once at the end.
Compare bramble code-review output across reviewer configs (cursor with composer-2, codex with gpt-5.4-mini, gemini with gemini-3.1-flash-lite-preview). Runs each config three times against the same branch — turn 1 fresh, turn 2 resumed with default follow-up prompt, turn 3 resumed with fresh prompt — to also characterize backend resume behavior, then compares findings side-by-side and logs results.
Build and use a ground-truth eval dataset for bramble code-review. Two modes. COLLECTION scans past /pr-polish'd PRs and judges each into a frozen ground truth — multiple rounds of bramble re-review + an independent judge sub-agent per round, until the judge's full-diff bug census saturates. REPLAY runs a reviewer-under-test and scores it mechanically against that frozen ground truth — precision/recall/F1, no sub-agents, cheap and repeatable.
One-shot review of an external GitHub PR. Checks out the PR into an isolated worktree (or temp clone), runs `bramble code-review` against the diff, and produces a calibrated verdict — APPROVE unless there is a blocking correctness issue, with optional improvements listed separately. Read-only on the remote PR, never pushes. User-invoked only via `/external-pr-review`.
Iterative review of a markdown design document. Reads the doc, proposes a tailored grilling rubric, runs N rounds of codex+cursor (optionally +gemini) against the doc with that rubric, edits between rounds, commits locally each round. Never pushes.
Ensure the current branch is cleanly rebased onto the remote base branch so that `origin/{base}..HEAD` only shows this branch's commits.
| name | tui-session-audit |
| description | Audit and improve Bramble TUI session rendering, interaction flows, and replay fidelity. |
| disable-model-invocation | true |
Systematically test and improve Bramble's terminal UI to ensure sessions render correctly, interactive flows work end-to-end, and replay faithfully reproduces live sessions — across all providers.
/tui-session-audit [--iterations N] [--until "condition"] [--focus <area>]
| Flag | Default | Description |
|---|---|---|
--iterations N | 5 | Stop after N rounds |
--until "cond" | — | Stop when condition met (e.g., "no gaps in rendering") |
--focus <area> | all | Focus: rendering, replay, interaction, layout, persistence |
Read these files to understand Bramble's architecture:
bramble/session/types.go — Session, OutputLine, SessionProgress typesbramble/session/event_handler.go — How provider events become OutputLinesbramble/app/output.go — How OutputLines render in the TUIbramble/app/text_render.go — Text and markdown renderingbramble/replay/ — Session replay parsing (Claude and Codex formats)bramble/session/store.go — Session persistence formatAlso check the current audit state in memory/gap-matrix.md (this skill's directory).
Bramble's rendering pipeline:
Provider SDK Event
→ agentstream interface (type assertion)
→ bridgeProviderEvents() goroutine
→ trackingEventHandler (turn filtering, dedup)
→ sessionEventHandler (convert to OutputLine)
→ Manager.addOutput(sessionID, line)
→ TUI Model listens on Manager.Events()
→ OutputModel.View() renders lines
For replay:
messages.jsonl or codex log file
→ replay.Parse() (auto-detect format)
→ []OutputLine (unified)
→ OutputModel.View() renders lines
The key insight: both live sessions and replay share the same rendering path through OutputLine → OutputModel.View(). Fixes to rendering benefit both.
Every piece of session output is an OutputLine with a Type:
| Type | Renders As | Source |
|---|---|---|
Text | Prose, optionally markdown-rendered | Text streaming from provider |
Thinking | Dim/italic text | Thinking/reasoning events |
ToolStart | [Tool] ToolName: summary (running state) | Tool invocation begin |
ToolResult | Updated tool line with result, duration, cost | Tool completion |
Error | Error-styled text | Provider errors |
Status | Dim status text | Status messages, token summaries |
TurnEnd | Turn summary line | Turn completion |
PlanReady | Plan notification | Planner sessions only |
Tool summaries are truncated for display (event_handler.go):
"Read /path/to/file""Write → /path" / "Edit → /path""Bash: command" (50 char truncation)"Glob pattern""Grep pattern" (40 char truncation)For each OutputLine type and each provider, verify:
bridgeProviderEvents() translating the SDK event correctly?sessionEventHandler produce the right OutputLine? — Correct type, content, tool metadata?OutputModel.View() render it well? — Readable, properly styled, not truncated badly?replay.Parse() produce equivalent OutputLines from recorded sessions?Store.SaveSession() → Store.LoadSession() preserve all data?Run Bramble and exercise each provider. For each, try:
For sessions recorded by each provider:
~/.bramble/sessions/)bramble logview <path> (or bramble logview --compact)Create a table in memory/gap-matrix.md:
works / broken / partial / untested with notesSort by severity: broken rendering > missing data > degraded display > cosmetic.
Select highest-impact rendering or interaction issues.
Each gap maps to a specific layer:
| Symptom | Likely Fix Location |
|---|---|
| Event never reaches TUI | multiagent/agent/<provider>_provider.go or bridge.go |
| Wrong OutputLine type/content | bramble/session/event_handler.go |
| Bad rendering | bramble/app/output.go or bramble/app/text_render.go |
| Replay doesn't match live | bramble/replay/claude.go or bramble/replay/codex.go |
| Data lost after restart | bramble/session/store.go |
| Layout broken at certain widths | bramble/app/view.go or bramble/app/model.go |
| Compact mode wrong | bramble/replay/compact.go |
Follow TDD:
Write a test first — Unit test for the specific rendering/parsing behavior
integration/ directory pattern with # gazelle:ignore BUILD.bazelFix the implementation — Work at the right layer (don't paper over event handler bugs in the renderer)
Check the compact mode path too — compact.go merges verbose status lines; make sure your fix works in both normal and compact modes
scripts/lint.sh
bazel build //...
bazel test //bramble/... --test_timeout=60
For replay changes, also test with real session files:
bazel run //bramble -- logview <path-to-session>
bazel run //bramble -- logview --compact <path-to-session>
Mark rows in memory/gap-matrix.md. Note any provider-specific quirks discovered.
Stop if: max iterations reached, --until condition met, or no actionable gaps remain.
For event handler changes:
// bramble/session/event_handler_test.go
func TestEventHandler_ToolStartProducesCorrectOutputLine(t *testing.T) {
handler := newSessionEventHandler(...)
handler.OnToolStart("Read", "tool-123", map[string]interface{}{"file_path": "/tmp/test"})
// Assert the OutputLine has correct Type, ToolName, Content
}
For replay changes:
// bramble/replay/claude_test.go
func TestClaudeReplay_ToolCallSequence(t *testing.T) {
result, err := Parse("testdata/session-with-tools/")
require.NoError(t, err)
// Assert OutputLine sequence matches expected
}
For store round-trip:
// bramble/session/integration/store_test.go
func TestStorePersistenceRoundtrip(t *testing.T) {
// Create session with varied OutputLines
// Save, Load, compare
}
Place in integration/ directories with:
//go:build integration build tag# gazelle:ignore in BUILD.bazeltags = ["manual"] to exclude from bazel test //...Keep sample session recordings in bramble/replay/testdata/ for regression testing. Include sessions from each provider format.
| File | Purpose |
|---|---|
bramble/session/types.go | OutputLine, Session, SessionProgress types |
bramble/session/event_handler.go | Provider event → OutputLine translation |
bramble/session/provider_runner.go | Provider event bridging to session handler |
bramble/app/output.go | OutputModel and rendering logic |
bramble/app/text_render.go | Text and markdown rendering |
bramble/replay/claude.go | Claude session replay parser |
bramble/replay/codex.go | Codex session replay parser |
bramble/replay/compact.go | Compact mode line merging |
bramble/session/store.go | Session persistence (JSON) |