Agent skill

formax-surface-reset-workflow

Use when changing REPL clear/reset/resume/surface behavior (onClearTerminal, transcriptSeq remount, Ink Static paths, Ctrl+O/Ctrl+E transitions). Enforces single-owner reset transaction and prevents black-screen/flicker/duplicate-row regressions.

Stars 138
Forks 7

Install this agent skill to your Project

npx add-skill https://github.com/yusifeng/formax/tree/main/.codex/skills/formax-surface-reset-workflow

SKILL.md

Formax Surface Reset Workflow

Goal

Use this skill when changing REPL clear/reset/resume behavior or any transcript surface transition that can remount Static.

Read First

  • docs/contracts/transcript-surface-contract.md
  • docs/runbooks/repl-surface-debugging.md
  • docs/contracts/invariants.md when ownership or sequencing is unclear

These docs are canonical. If stable surface behavior changes, update them before or with code.

Code Map

  • Reset helpers / queue owner:
    • replaceTranscript
    • queueTranscriptSurfaceReplace
    • resetTranscriptSurface
    • queueTranscriptSurfaceReset
    • surfaceOpQueueRef
  • High-risk flows:
    • packages/core/src/features/repl/controller/ui/
    • packages/core/src/features/repl/controller/session/
    • packages/core/src/features/repl/useReplController.ts
    • packages/core/src/screens/repl/
    • packages/core/src/runtime/bootstrap/runLegacyCli.tsx
  • Call sites to watch:
    • onClearTerminal
    • clearTerminal
    • resetInkStaticOutputForStdout
    • transcriptSeq remount behavior in ReplTranscript / ExpandedReplTranscript

Trigger Conditions

Use this skill whenever the change touches any of:

  • /resume, /clear, compact boundary transitions
  • Ctrl+O / Ctrl+E transcript view switches
  • onClearTerminal, clearTerminal, or resetInkStaticOutputForStdout
  • replaceTranscript, queueTranscriptSurfaceReplace, resetTranscriptSurface, queueTranscriptSurfaceReset, or surfaceOpQueueRef
  • files under packages/core/src/features/repl/controller/ui/, packages/core/src/features/repl/controller/session/, packages/core/src/features/repl/useReplController.ts, packages/core/src/screens/repl/, or packages/core/src/runtime/bootstrap/runLegacyCli.tsx

Minimal Workflow

  1. Identify the exact path (/resume, /clear, Ctrl+O / Ctrl+E, compact boundary, etc.).
  2. Route it through replaceTranscript / resetTranscriptSurface instead of local clear / remount sequencing.
  3. Treat reset as one transaction, not scattered side effects.
  4. Add or extend regression tests for ordering and surface reset ownership.
  5. Run the minimum regression set below and at least one real surface smoke path.

Minimum Regression

  • bun run test -- packages/core/src/features/repl/controller/ui/surfaceReset.test.ts
  • bun run test -- packages/core/src/features/repl/useReplController.test.tsx -t "resume|clear|compact"
  • bun run test -- packages/core/src/screens/repl/surfaceSmoke.test.tsx
  • bun run type-check
  • If change touches compact / expanded toggles broadly: bun run test:surface-screen-model

Guardrails

  • Keep one surface owner; do not add a second independent clear / remount path.
  • Do not stack replInstance.clear() and ANSI clear in legacy paths unless ownership is explicit and serialized.
  • Do not accept a Vitest-only fix without running a real surface smoke path.

References

  • docs/pitfalls/summary.md sections covering /clear, compact + Ctrl+O, and resume black-screen regressions
  • docs/pitfalls/repl-transcript-surface-handoff-pitfall.md
  • docs/pitfalls/repl-transcript-static-rootcause.md

Expand your agent's capabilities with these related and highly-rated skills.

yusifeng/formax

formax-dev-loop-workflow

Use when working on Formax code changes and you need a disciplined dev loop: keep a single mainline task, avoid scope drift, run only targeted tests (no coverage), avoid partial staging (MM), run mandatory review before commit, include an incremental optimization check, and keep commits small and reviewable.

138 7
Explore
yusifeng/formax

formax-rework-convergence-workflow

Use when code has gone through repeated rework and may contain redundant logic, style drift, or tangled structure. Trigger when user asks for "返工收敛", "cleanup-pass", or requests a focused cleanup pass that reduces churn without changing behavior.

138 7
Explore
yusifeng/formax

formax-tool-ui-blocks-workflow

Implement or refactor Formax tool transcript UI using the Tool UI Blocks (C-lite) pattern (ToolUiBlocks renderer + blocks presenters) to avoid touching many tool presenter files; use when adjusting ⏺/⎿ spacing, indent rules, or migrating additional tools to blocks presenters with targeted Ink/Vitest tests and Codex review before commit.

138 7
Explore
yusifeng/formax

formax-web-css-convergence-workflow

Use when changing web CSS/UI styling so requirements, state ownership, and acceptance checks are locked before edits to prevent rework churn.

138 7
Explore
yusifeng/formax

formax-config-settings-workflow

Use when implementing or extending /config (storage, prompt injection, request params, UI-only toggles) with tests and strict UI parity.

138 7
Explore
yusifeng/formax

formax-semantics-parity-workflow

Use when implementing or modifying behavior that must stay consistent across TUI and Web (mode/input/tool/replay/order). Require canonical semantics first, then TUI/Web adapters, then renderer-specific UI.

138 7
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results