时间线与甘特图生成
timeline
当用户调用 /timeline,或请求可视化时间线、甘特图,或用于展示剩余步骤、并行情况与时间估算的 HTML 图表,以及请求将实际工作与已记录预测进行对比的复盘时使用。构建自包含的 HTML 甘特图及流程条,进行渲染并做可视化审查,且始终在聊天中输出文本版甘特图。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- timeline
- description
- Use when the user invokes /timeline or asks for a visual timeline, Gantt chart, or HTML diagram of remaining steps, parallelism, and time estimates, or a retrospective comparing observed work with a recorded forecast. Builds a self-contained HTML Gantt plus a flow strip, renders and visually reviews it, and always prints a text Gantt in chat.
02 资源文件 4
- 资产文件assets/template.html5.7 KB
- 脚本scripts/build.py17.5 KB
- 脚本scripts/review.sh2.1 KB
- 脚本scripts/test_build.py3.5 KB
03 SKILL.md 正文
/timeline
Turn a plan into an HTML Gantt (bars, parallelism, time estimates) plus a flow strip of the remaining steps, render it and look at it, and print the same diagram in chat.
Explain the work first
Before the Gantt, use the rendered subtitle for a concise, zero-context overview of every PR and major milestone in the timeline. State what each change does and why it matters to its user; expand unfamiliar terms. A PR number, branch name, owner, status, or file name is an identifier, not an explanation. Keep the overview short, and make row names and details describe the action, outcome, and dependency in plain language. Keep unfinished work in phases and rows; never put an explanation of unfinished work in done. The subtitle appears at the top of the existing renderer, above the status and Gantt.
Build
- Re-pin live state first. Immediately before drawing, re-read git SHAs,
gh pr checks, and lane status from their sources; never copy them from earlier prose. Snapshot time is absolute with timezone (2026-10-04 12:55 PDT). - Schedule for maximum parallelism, from true dependencies, not list order. A step starts when what it truly waits on is done.
- Read-only review or verification never blocks a reversible step (push, CI start); run them side by side.
- Start the longest pole first.
- Show work handed to other lanes (subagents, CLI delegates, the dot) as its own row, labelled with the owner.
- Say in the subtitle when the plan changed because of this.
- Estimates. Each row has a start offset, a low estimate and a high estimate in minutes (
hi: null= unknown). Color is by the HIGH estimate: green < 10 min, yellow 10–30, red 30+, grey unknown. Solid bar = low estimate; faded extension = up to high. The legend states this. - Generate, do not hand-edit HTML. Write a JSON spec and run
${CLAUDE_HOME:-$HOME/.claude}/skills/timeline/scripts/build.py spec.json(stdlib only; spec in amktempdir). It applies the color rule, uses the CSS inassets/template.html, computes the header total estimate and projected finish time, and prints the text Gantt to stdout. - Every row names its owner (main session, lane, subagent, CLI delegate, CI) and, when the step has its own bead, that bead id.
build.pywarns on a row without an owner.
{"title": "...", "snapshot": "2026-10-04 12:55 PDT", "subtitle": "...",
"branch": "feat/x", "pr": 10097, "done": ["finished item"], "span": 70,
"phases": [{"title": "Phase A", "rows": [
{"id": "1", "name": "Merge main", "owner": "main session", "bead": "rev-abc",
"detail": "...", "start": 0, "lo": 15, "hi": 25, "label": "optional"}]}],
"flow": [["1 Merge", "2 Check"], "→", ["4 Review"], "→", "green", "‖", "3 Audit (dot)"]}
span is optional (defaults to the latest high end, rounded up to 10). flow items: a list = parallel stack, "→" = dependency, "‖" = independent side work, a string = single node.
Retrospective mode
Use mode: "retrospective" for a completed historical window. Set absolute,
timezone-bearing window_start and window_end; start is minutes from window
start, and span is the window length in minutes. The header shows the observed
window, never a projected finish derived from actual durations. baseline is an
optional descriptive string naming the original forecast, timestamp and source.
Each row uses kind: "observed" (default in this mode) or kind: "forecast".
Observed intervals have lo == hi; use lo: null for unknown duration, and name
uncertainty in detail. Forecast rows retain their low/high ranges. Keep both
kinds in separately named phases. Example additions to the ordinary spec:
{"mode": "retrospective", "window_start": "2026-10-11 12:00 PDT",
"window_end": "2026-10-12 12:00 PDT", "span": 1440,
"baseline": "No contemporaneous forecast recovered; comparison is qualitative"}
- Recover timestamped session/tool evidence for the requested window. Re-pin live
state only for claims about the present. Name the source and confidence in each
row's
detail; a gap is waiting/unknown, not automatically active work. - Compare against the original recorded forecast. Preserve its JSON, HTML and
source timestamp in a
mktempdirectory under/tmpbefore overwriting a stable timeline path. Publish durable provenance with the report if required. Check displayed timestamps against source events and disclose corrections. Do not invent a usual duration when no forecast exists; label any new estimate as a counterfactual, with assumptions, rather than an original prediction. - Classify each delay in
detail: critical blocker, evidence-only blocker, nonblocking side work, or waiting/unknown. Name the deliverable and exact gate blocked. Separate a required final gate from work that could run concurrently; do not relabel mandatory evidence as optional because execution was inefficient. - Report wall-clock coverage, repeated work and supported causes. Do not sum overlapping lane intervals as elapsed time or claim utilization from sparse transcript timestamps. A counterfactual critical path needs explicit dependencies.
- This is a point-in-time report: no ten-minute refresh for a completed historical window. Publication, visual review and text output remain required. For review, verify window boundaries and row kinds instead of a forecast finish time.
Stable path, gist, and bead
- One file per PR, overwritten in place. With no
out.html, the path is/tmp/timeline/<branch with / → ->-pr<N>.html(from specbranch/pror--branch/--pr), e.g./tmp/timeline/feat-same-turn-mandatory-audit-pr10097.html; the PNG sits beside it. Never mint a new path on refresh.<html>.ownerrecords the repo (origin URL without credentials, else the git toplevel; outside any git repo, passout.html), branch and PR that own the path; a build from a different repo, or a colliding branch name (foo/barvsfoo-bar) exits with an error instead of overwriting that gist, so pass an explicitout.htmlthen. - Gist (default). Every build publishes unless
--no-publishis passed. It scans the HTML for tokens and keys and refuses to upload on a hit, then creates a secret (unlisted) gist on the first run and edits the same gist afterwards; the id lives in<html>.gist. Gists are created and updated through the REST API (gh api -X POST gistswithpublic: false,gh api -X PATCH gists/<id>), so a GraphQL rate limit cannot block publishing; only the HTML is uploaded. The preview link ishttps://gistpreview.github.io/?<gist id>/<file>(always the latest gist revision). Tested 2026-10-04 in headless Chrome: gistpreview, htmlpreview.github.io and cdn.statically.io render the timeline directly; gist.githack.com and gistcdn.githack.com show a "One more step" interstitial and must not be used.build.pyshortens it once via tinyurl, then cleanuri, then spoo.me, accepting only a short URL whose HEAD answers 3xx straight to the preview URL (interstitial shorteners such as da.gd are rejected; tinyurl and is.gd rejecthtmlpreview.github.iotargets, but accept gistpreview). The result is cached in<html>.short(reused on refresh while the preview URL is unchanged) and printed first; if every shortener fails it prints the long link only. Refresh latency measured 2026-10-04: gistpreview served the new revision within 5 s of a gist edit (one render seconds after an edit still showed the previous revision), while the unversioned gist raw URL updates immediately. - Bead. Each timeline is tied to exactly one bead, id in
<html>.bead(or specbeadto reuse an existing one). The first run creates it withbr; every run appends the gist URL, preview link, and HTML path to its notes with--append-notes(existing notes are kept; an unchanged refresh is a no-op). The DB comes from specbead_dborbr info --jsonin the cwd, and every call pins--db(beads-issue-tracking skill). Measured 2026-10-04 on the 85 MB worldarchitect.ai DB: create 0.7 s, update 0.6–0.7 s, close 1.1 s, so the step runs inline; a bead failure is reported without blocking the drawing.
Always open and review (mandatory)
Never report a timeline you have not looked at.
- Render with
${CLAUDE_HOME:-$HOME/.claude}/skills/timeline/scripts/review.sh <file.html> [height_px](headless Google Chrome preferred, Aside account u0 fallback). It prints the PNG path. - Read the PNG and check: bars start/end at the right axis positions (spot-check two against ticks), no clipped or overlapping text, no empty band at the bottom (adjust
height_px), parallel steps actually overlap and dependents start after what they wait on, header total and finish time match the bars. - Fix and re-render until it passes.
Always print it in chat (mandatory)
The user may not open the files. Every reply includes the build.py stdout in a fenced block: one row per step, █ low, ░ low→high, estimate plus color word at the row end, an axis line, and the header totals. Then give, in this order: the short link (Timeline: line, the primary link the user opens), the full preview link (Preview (full):), the gist URL, the local HTML as a bare absolute path alone on its own line (secondary; terminals such as cmux linkify bare paths but not markdown file:// links), the bead id, and one line on what you checked. Never omit the Timeline: link; when publishing failed or was refused (secret scan, gh error), build.py prints only the local HTML path and a build.py: reason on stderr, so give the local path and that reason instead.
Refresh while work is active (mandatory)
Once /timeline is running for live work, rebuild it every 10 minutes until the tracked deliverable is done or blocked on the user: re-pin live state, build with --publish (same path, gist, and bead), review the render, and print the text Gantt plus the HTML and gist links each time. Schedule the next refresh before ending the turn (a 600 s wakeup, or /loop 10m when available). Fold real-time lane polls (for example the dot's 5-minute poll) into the same tick rather than drawing more often.
04 同仓库更多 Skills
disk-reclaim-playbook
Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.
claudea-bench
Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
pr
Alias for the canonical pr-lifecycle PR workflow skill (/pr-workflow, /prw).
whisper
OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
pr-report
This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, /pr-report, or wants per-PR summary with delta files/lines. Generates a structured report for one or more open PRs covering purpose, files changed, +/− line counts, /code-standards + /thermo review findings, /ponytail simplification opportunities, file-overlap combination candidates, and /green status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.