Skip to content

[fast-path] docs(ask-user): route talk-to-user via gist + htmlpreview, require visual content - #449

Open
LiuShiyuMath wants to merge 2 commits into
mainfrom
worktree-talk-to-users-gist-html
Open

[fast-path] docs(ask-user): route talk-to-user via gist + htmlpreview, require visual content#449
LiuShiyuMath wants to merge 2 commits into
mainfrom
worktree-talk-to-users-gist-html

Conversation

@LiuShiyuMath

@LiuShiyuMath LiuShiyuMath commented May 13, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #448. [fast-path] per docs/FAST-PATH-PR.md (docs-only, single-file rule update, no new code paths, no business-logic / public-API / DB-schema / hook-protocol changes).

Update docs/ASK-USER-VIA-HTML.md + CLAUDE.md anchor block so every agent→user "talk to user" moment routes through:

  1. haiku subagent writes a self-contained visual HTML (cards / chips / color sections / inline SVG / metric cards / ASCII art — at least 3 of 6; raw boring <form> + radio + button is banned)
  2. gh gist create --public /tmp/ask-<slug>-<ts>.html uploads to the maintainer's own GitHub Gist
  3. open -a "Google Chrome" "https://htmlpreview.github.io/?<raw-gist-url>" pops the page in Chrome — any device / phone / second machine can open the same public URL
  4. User clicks → "复制选择回 agent" button → paste back into chat

Supersedes the prior /tmp file:// flow (kept only as the upload source). Aligns talk-to-user UX with the existing docs/VISUAL-PROOF-FORMAT.md § Hosting Gist + htmlpreview convention.

Also adds "what should we do everything we need to talk to users" as a canonical English trigger phrase on the anchor block, plus the matching Chinese variants ("需要跟用户沟通 / 提问 / 收集决策时怎么做").

Files changed

  • docs/ASK-USER-VIA-HTML.md — full rewrite of TL;DR, STEP 1-4, validation, and "与现有规则的关系" sections; 123 lines (under the 200-line cap).
  • CLAUDE.md — anchor block at line 137 rewritten (single line in the table-of-anchors).

Self-dogfood note

This PR does not introduce a new verbatim canned-answer anchor with strict substring-grep harness — the existing rule had no verbatim canned answer, and this PR keeps it that way. The new "what should we do everything we need to talk to users" phrase is listed as a trigger hint, not a verbatim grep contract. That keeps this PR inside the fast-path carve-out (per docs/FAST-PATH-PR.md self-dogfood clause: only new verbatim canned-anchor cards require full FIXEDFLOW grill; rule updates with soft trigger hints stay in docs-update fast-path).

Test plan

  • /review passes one turn (ADR-0007 authoritative POSTPR gate)
  • wc -l docs/ASK-USER-VIA-HTML.md < 200 (currently 123)
  • Manual verify: ASCII art at the top of the doc (AGENTS.md §10)
  • Manual verify: CLAUDE.md anchor line still lints to one logical bullet
  • No code paths changed; no test changes expected

Verification (judge-harness style)

Anchor-block lint:

grep -n "what should we do everything we need to talk to users" CLAUDE.md
# expect: 1 match on the anchor line
grep -n "gh gist create --public" CLAUDE.md docs/ASK-USER-VIA-HTML.md
# expect: at least 1 match in each file
grep -n "htmlpreview.github.io" CLAUDE.md docs/ASK-USER-VIA-HTML.md
# expect: at least 1 match in each file

Risk

Low. Docs-only. The rule it updates is agent-prompt guidance — no runtime code reads this file at execution time. Worst case: an agent reads stale guidance and still falls back to /tmp file:// (documented as fallback case (a) "no gh auth").

… file:// flow

When agent needs to talk to users, the canonical flow is now:
1. haiku subagent writes self-contained visual HTML (cards/chips/SVG/ASCII art - no raw boring text)
2. gh gist create --public uploads to the maintainer's own gist
3. open -a 'Google Chrome' "https://htmlpreview.github.io/?<raw-gist-url>"

Rationale: cross-device access, persistent audit trail, zero extra infra,
reuses VISUAL-PROOF-FORMAT.md hosting convention, avoids Chrome file:// Clipboard API restrictions.
…alk to users' trigger

Anchor block now:
- Adds 'what should we do everything we need to talk to users' as canonical trigger
- Requires haiku subagent → gh gist create --public → htmlpreview.github.io URL → Chrome
- Bans raw-boring-text plain forms; requires >=3 of {cards, chips, color sections, SVG, metric cards, ASCII art}
- Documents the 5 fallback cases (no gh auth, headless, trivial y/n, user opt-out, in-app)
- Notes /tmp is now upload source not direct file:// target

Aligns the talk-to-user UX with VISUAL-PROOF-FORMAT.md hosting convention.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 14223655dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/ASK-USER-VIA-HTML.md
3. 在主 session 里调 `open -a "Google Chrome" /tmp/ask-<topic>-<timestamp>.html`(Linux `xdg-open`、Windows `start chrome`)把页面弹给用户
4. 用户在浏览器里点选 / 填写 → 回到 agent 会话把选择口述或粘贴回来 → agent 继续推进
1. **派 haiku subagent** 写一个 self-contained **visual** HTML 文件(cards / chips / color-coded sections / 内联 SVG / ASCII art 框图),落地到 `/tmp/ask-<slug>-<unix-ts>.html` 作为本地暂存。**不**允许只写「label + radio + button」的朴素表单——HTML 必须带视觉层次(最少:分区底色 + chip 圆角标签 + 中间分隔线 + 颜色对比的选中态)。
2. **托管到 maintainer 自己的 GitHub Gist**:`gh gist create --public /tmp/ask-<slug>-<unix-ts>.html`,拿到 gist raw blob URL(形如 `https://gist.githubusercontent.com/<you>/<id>/raw/<file>.html`)。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use secret gists for ask-user uploads

This change mandates gh gist create --public for every user-question page, which makes the content publicly listed even when it may contain unreleased plans, internal repo details, or user-provided notes. The gh gist create CLI defaults to secret gists, and secret gist URLs are still shareable across devices, so forcing --public adds data-exposure risk without being required for the cross-device workflow described here.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fast-path] docs(ask-user): gist + visual content + 'talk to users' anchor

1 participant