‹ 首页

formax-approval-ui-workflow

@yusifeng · 收录于 5 天前 · 上游提交 3 周前

Use when adding or changing any Approval prompt/presenter.

适合你,如果需要频繁修改审批提示或展示逻辑

/ 通过 npx 安装 校验哈希
npx oh-my-skill add yusifeng/formax/formax-approval-ui-workflow
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- yusifeng/formax/formax-approval-ui-workflow
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify yusifeng/formax/formax-approval-ui-workflow
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
192GitHub stars
~970上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 5a48573 · 表述以原文为准
它做什么

装了这个技能后,当你要求添加或修改审批提示或展示工具时,Claude 会保持界面视觉一致性、保留现有的键盘操作逻辑(如Enter/Esc/Shift+Tab),并确保预览渲染快速安全(避免阻塞和性能问题)。

什么时候触发

当你要求添加或更改任何审批提示或展示工具时触发。

装好后可以这样说
技能原文 SKILL.md作者撰写 · MIT · 5a48573

formax-approval-ui-workflow

Goal
  • Keep Approval prompts visually consistent + Claude Code-aligned (only when explicitly requested).
  • Preserve existing behavior + keyboard flow (Enter/Esc/Shift+Tab), avoid UI regressions.
  • Keep preview rendering fast and safe (no sync IO in render; guard against quadratic diffs).
Where to change what
  • Shared approval “chrome”
  • packages/core/src/components/ui/ApprovalHeader.tsx (top divider + title color)
  • packages/core/src/components/ui/ConfirmMenu.tsx (numbered options + selection color)
  • Preview (optional section under header)
  • packages/core/src/components/tool/ApprovalPreview.tsx (simple file preview)
  • packages/core/src/components/tool/PatchApprovalPreview.tsx (edit-file wrapper: header + file + preview)
  • packages/core/src/components/tool/PatchPreview.tsx (diff rendering + performance guards)
  • Per-tool approval prompts (labels, options, allow/ask/deny / remember write paths)
  • packages/core/src/components/tool/bashApprovalPrompt.tsx
  • packages/core/src/components/tool/fsReadApprovalPrompt.tsx
  • packages/core/src/components/tool/fsWriteApprovalPrompt.tsx
  • packages/core/src/components/tool/skillApprovalPrompt.tsx
  • (if present) packages/core/src/components/tool/editApprovalPrompt.tsx (legacy)
  • Tool presenters that mount approval prompts
  • packages/core/src/tools/modules/bash/presenter.tsx
  • packages/core/src/tools/modules/read/presenter.tsx
  • packages/core/src/tools/modules/write/presenter.tsx
  • packages/core/src/tools/modules/edit/presenter.tsx
  • packages/core/src/tools/modules/skill/presenter.tsx
  • Colors / theme
  • packages/core/src/tui/theme.ts (theme.permission, theme.text, theme.diff.*)
Patterns
  • Layout skeleton (keep consistent)
  • [Top divider line]
  • Title (color = theme.permission)
  • Optional Preview box
  • Question line (e.g. “Do you want to … <file>?”)
  • Options list (numbered)
  • Bottom hint (e.g. “Esc to cancel”)
  • Options rendering (text + emphasis)
  • If an option needs mixed styling (e.g. make capture-terminal/ bold/white): make ConfirmMenu accept ReactNode labels.
  • Ensure selection color wins over nested Text color={...} when highlighted:
  • Prefer passing “unstyled” children and let row wrapper decide color, or
  • In nested text, only set bold, avoid hardcoding color unless required.
  • Preview performance (must not block UI)
  • No fs.readFileSync/fs.statSync/blocking IO inside render path (useMemo included).
  • If file context is needed (e.g. line numbers), compute via async fs/promises + useEffect.
  • Diff safety (avoid OOM / hangs)
  • Any token/word diff based on DP/LCS must have a hard cap (max cells).
  • If cap exceeded: fall back to truncated / line-only / “too large to diff” preview.
Tests to update
  • Unit/component tests (minimum regression set):
  • packages/core/src/components/ui/ConfirmMenu.test.tsx (ReactNode label + selection color)
  • packages/core/src/components/tool/bashApprovalPrompt.test.tsx (if exists)
  • packages/core/src/components/tool/fsReadApprovalPrompt.test.tsx (if exists)
  • packages/core/src/components/tool/fsWriteApprovalPrompt.test.tsx (if exists)
  • packages/core/src/components/tool/skillApprovalPrompt.test.tsx (if exists)
  • packages/core/src/tools/modules/edit/presenter.test.tsx (preview/diff layout + performance guard)
  • Manual spot-check (fast)
  • Trigger one approval for each kind: Bash, Read(outside workspace), Write, Edit.
  • Verify: top divider, title color, option numbering, selection color, Esc behavior.
Guardrails
  • Do not change UI copy/spacing/colors unless explicitly requested for Claude Code parity.
  • Treat UI output vs model context injection as orthogonal; don’t change injection behavior as a side-effect of approval UI work.
  • Do not add a syntax highlighting library (keep preview rendering lightweight).
  • Do not broaden scope (“refactor approval system”); only touch what the prompt requires.
  • Keep rendering responsive:
  • no sync IO in render
  • hard caps for quadratic diff algorithms
  • Loop discipline:
  • run targeted tests first, then bun run test if needed
  • run review before committing using AGENTS.md -> Review Profile (Single Source of Truth); fix all high/medium findings
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。