vercel-composition-patterns
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
- License 许可
- MIT
- 所属仓库
- ogdakke/voidmesh
- 最近更新
- 2026-11-09
- Stars
- ★ 4
- Forks
- 2
02 资源文件 13
- 参考文档AGENTS.md22.0 KB
- 参考文档metadata.json530 B
- 参考文档README.md2.1 KB
- 参考文档rules/_sections.md829 B
- 参考文档rules/_template.md329 B
- 参考文档rules/architecture-avoid-boolean-props.md2.2 KB
- 参考文档rules/architecture-compound-components.md2.5 KB
- 参考文档rules/patterns-children-over-render-props.md1.8 KB
- 参考文档rules/patterns-explicit-variants.md2.3 KB
- 参考文档rules/react19-no-forwardref.md958 B
- 参考文档rules/state-context-interface.md4.9 KB
- 参考文档rules/state-decouple-implementation.md2.6 KB
- 参考文档rules/state-lift-state.md3.2 KB
03 SKILL.md 正文
{% raw %}
name: hotpath-cloud description: Read hotpath Cloud performance verdicts with the hotpath cloud CLI and fix Rust performance regressions. Fetches the benchmark report of a commit or pull request, compares it with its baseline under the repository's regression policy and performance budgets, and lists what regressed and which budgets broke, as JSON. Use when the user wants to check a pull request's performance, wait for a CI benchmark, investigate a hotpath.rs PR comment, fix a performance regression or a broken budget, or validate a hotpath policy file. allowed-tools: Bash, Read, Edit, Write, Glob, Grep
hotpath Cloud CLI
hotpath cloud is the command line client of hotpath.rs. CI uploads a hotpath benchmark report on
every push to the default branch and every pull request. hotpath.rs compares each pull request
report with its baseline (the report of the base branch), judges it under the repository's policy
file and posts a comment on the pull request. The CLI returns the same judgement as JSON.
Docs: https://hotpath.rs/agents_cli, https://hotpath.rs/regression_policy, https://hotpath.rs/performance_budgets.
Setup
- Check the CLI:
hotpath cloud --help. If it is missing or has nocloudcommand, install it withcargo install hotpath --features cloud. - Check the token:
hotpath cloud auth. It readsHOTPATH_API_TOKEN. If it fails withinvalid_tokenor the variable is unset, ask the user to create a token at https://hotpath.rs/app/tokens and export it. Never ask the user to paste the token into the conversation. - Find the repository (
OWNER/NAME, fromgit remote get-url origin) and the benchmark name:hotpath cloud benchmarks --repo OWNER/NAME. The benchmark is also theHOTPATH_BENCHMARKvalue in the repository's.github/workflows/*.yml.
validate-policy and init need no token.
Output contract
- Every command prints one JSON document on stdout (
--prettyto indent,--output FILEto write a file). - An error prints one JSON document on stderr, like
{"error":"...","code":"not_found"}, and nothing on stdout. - Exit codes:
0success,1error,2usage error. Fordiff,0means exactly "judged and nothing regressed"; anything else is1with the answer still on stdout.
Branch on the exit code, then read the JSON. Do not parse the human text of the pull request comment.
Selecting a report
report and diff take --repo OWNER/NAME --benchmark NAME and one of:
--commit SHA: a full 40-character sha. It matches the measured commit or a pull request's head commit, so--commit $(git rev-parse HEAD)works on a pull request branch.--pr N: the newest report of the pull request.--id ID: one report.
--event push|pull_request narrows --pr or --commit to one event.
Workflow: check or fix a change
-
Push the commit. CI runs the benchmark and uploads the report, which takes as long as the benchmark job.
-
Wait for the report. Poll until it exits
0, waiting about 30 seconds between attempts and giving up after about 30 minutes:hotpath cloud report --repo OWNER/NAME --benchmark NAME --commit $(git rev-parse HEAD) --no-payloadnot_foundmeans the upload has not arrived yet. If it never arrives, check the CI run withgh run list/gh run view. -
Read the judgement:
hotpath cloud diff --repo OWNER/NAME --benchmark NAME --commit $(git rev-parse HEAD) -
Exit
0: done, report the verdict to the user. Exit1: read the regressions and broken budgets (below), fix the code, and repeat from step 1.
Reading diff
verdict:judged(anything was judged),regressed(a judged section regressed or a budget broke),regressions,improvements,budgets_broken.result.status:compared,no_baseline(the base branch has no report yet; only budgets are judged) orunreadable(a report or its policy cannot be read; nothing is judged).result.sections[]: one per section of the policy (resource+kind, e.g.functions+alloc).family.judgedsays whether it counts toward the verdict,family.metricswhich columns it judges,family.countshow many rows had each outcome.rows[]:name,location(file,lineof the function in the measured commit),outcome(regression,improvement,added,removed) andcells.cells[]:column,unit,base,head(formatted strings like"24 B","2.06 ms"),change_percent(a number, the exact figure to reason about) andcrossed(up/down) on the cells that crossed the policy's bar.budgets.findings[]: broken budget checks, withentity.name,actual,limit,bound(maxormin) and the rule'smessage.budgets.notessays what could not be checked.head.policy_path: the policy file the report was judged under.dashboard_url: the comparison page, to give to the user.
By default diff lists only what the pull request comment lists. Add --advisory to see findings
of sections the policy lists but does not judge (for example timing on shared runners), and --full
for every row and value.
Useful extracts:
# Regressions with the values that crossed the bar
hotpath cloud diff ... | jq '.result.sections[]? | .rows[] | select(.outcome == "regression")
| {name, location, cells: [.cells[] | select(.crossed) | {column, base, head, change_percent}]}'
# Broken budgets with their messages
hotpath cloud diff ... | jq '.budgets.findings[] | {entity: .entity.name, actual, limit, message}'
Fixing a regression
- Start from
locationof each regressed row and thecrossedcells: an allocation regression points at new or larger allocations in that function, acalls/countchange at extra work,sql_per_requestat an N+1 query. - Allocations are deterministic for a fixed workload, so an allocation change is real. Timing on shared CI runners is noisy; be careful attributing a small timing change to the code.
- Profile locally to confirm before and after a fix: run the benchmark the CI workflow runs, with
the same
--features, and compare the printed hotpath report. - A broken budget names its rule's
message, which usually says what the limit protects.
Rules
- Never loosen the policy (
hotpath/*.toml) or a budget to make a regression or a broken budget go away. Fix the code, or explain the trade-off to the user and let them decide. - If the user asks to change the policy, edit
hotpath/policy.toml(orhotpath/<benchmark>-policy.toml) and check it withhotpath cloud validate-policy(--benchmark NAMEfor a benchmark's own file) before pushing. An upload with an invalid policy is refused. hotpath cloud initwrites the default policy when the repository has none. It never replaces an existing file without--force; do not pass--forceunless the user asks.HOTPATH_API_TOKENis a credential: never print it, echo it, log it or commit it. {% endraw %}
04 同仓库更多 Skills
update-intent
Update AGENTS.md intent nodes only when a diff changes a durable module contract, ownership rule, dependency boundary, architectural pattern, or project-wide invariant. Use when explicitly asked to refresh intent documentation or when those structural changes make existing guidance inaccurate; do not use for ordinary commits, bug fixes, tuning, thresholds, benchmark results, or implementation details. Accepts an optional git range such as main..HEAD or HEAD~5.
find-icon
Find iconoir-react icon component names by keyword.