Imported from stayhydated/frame-capture (
AGENTS.md). Install upstream withnpx skills add stayhydated/frame-capture. Copyright stays with the author.
AGENTS.md
This is the working guide for contributors and coding agents in the
frame-capture workspace. Use it to decide which crate owns a change, what
docs, examples, captures, tests, and public skills must stay synchronized, and
which narrow validation command fits the edited surface.
Start here:
- Bevy screenshot runtime:
crates/frame-capture-bevy. - egui, GPUI, raw wgpu, or host-owned screenshot routes:
crates/frame-capture-routes. - Target-neutral protocol and custom renderer integrations:
crates/frame-capture. - Route catalog tooling:
crates/frame-capture-mcp. - User guide and catalog:
book/src/SUMMARY.mdandweb/src/lib.rs. - Local command index:
justfile; runjust --list.
Quick Decision Flow
- Find the surface in the workspace map before editing.
- Route public API contracts to crate README files,
book/src, rustdocs, examples, and public skills. Keep implementation rationale near code, Rust tests, trybuild fixtures, or short comments. - When derive syntax, environment variables, route metadata, capture sizing, frame gates, output paths, scenarios, registered routes, Bevy runtime behavior, or MCP tools change, update the owning crate, docs, examples, tests, captures, affected public skill guidance, and this guide when it names the changed workflow.
- Validate with the smallest evidenced command that covers the edited crate, example, capture, docs surface, MCP tool, or workflow.
Audience Labels
- User-facing: normal entry points for application developers, public examples, and public skills.
- Public integration: public crates for facades, extensions, tooling, or deeper customization.
- Validation: tests, trybuild fixtures, example routes, and checked-in captures that encode behavior.
- Internal: workspace maintenance surfaces and generated captures that support examples.
Workspace Map
User-Facing Entry Points
-
crates/frame-capture-bevyAudience: User-facing Role: Bevy facade for live mode and deterministic capture mode. Owns the offscreen screenshot runtime,CaptureReady, capture-window plugin setup, route plugins, and the optional registered-route feature. -
crates/frame-capture-routesAudience: User-facing Role: route-only facade for egui, GPUI, raw wgpu, and applications that own rendering and screenshot output. Re-exports shared capture primitives and supports registered function routes. -
crates/frame-captureAudience: User-facing Role: target-neutral protocol and custom renderer entry point. Defines route specs, capture sessions, environment parsing, typed ids, pixel sizes, output paths, scenarios, frame gates, and route macro re-exports.
Public Integration
-
crates/frame-capture-macrosAudience: Public integration Role: proc macros for route, scenario, and registered-route declarations. Most applications should use re-exports from a facade crate. -
crates/frame-capture-routes-bevyAudience: Public integration Role: BevyAppregistered-route facade without screenshot runtime. Used by host-owned Bevy capture pipelines and byframe-capture-bevywith itsregistryfeature. -
crates/frame-capture-mcpAudience: Public integration Role: read-only MCP helpers for exposing route catalog metadata over stdio. It lists routes and returns details; it must not launch captures or save screenshots. -
crates/frame-capture-tomlAudience: Public integration Role: parser for package-local capture defaults read by route macros. Most users configureframe-capture.tomlinstead of depending on this crate.
Examples, Skills, and Tooling
-
examples/bevyAudience: User-facing Role: Bevy screenshot runtime example, source of checked-in captures underexamples/bevy/captures/. -
examples/gpuiAudience: User-facing Role: route-only GPUI enum example. It is excluded from the root workspace and has its own manifest. -
skills/use-frame-captureandskills/use-frame-capture-bevyAudience: User-facing Role: public application-developer guidance for target-neutral/route-only and Bevy capture workflows. Keep maintainer-only details in this guide, rustdocs, tests, or fixtures. -
frame-capture.tomlAudience: Internal Role: workspace-level default capture size used by route macros when no enum or route-specific size is supplied.
Documentation and Publishing
-
book/srcAudience: User-facing Role: mdBook source for integrations, routes, sessions, Bevy, route-only, MCP, and environment configuration. -
webAudience: User-facing Role: Dioxus catalog for the book, API docs, and source. -
xtaskAudience: Internal Role: reproducible book,llms.txt, and Pages-site builds.
Synchronization Rules
- When public workflows, derive or attribute syntax, environment variables,
route metadata, capture sizing, frame gates, output paths, scenario behavior,
registered-route APIs, Bevy runtime behavior, or MCP schemas change, update
the root README, matching
book/srcchapters, affected crate README files, examples, rustdocs, tests, captures, public skills, and this guide when they name the changed behavior. - Keep
frame-capture.tomlguidance aligned with route macro default-size behavior. - Keep
justfilecapture recipes aligned with direct environment-variable capture commands in the root README and examples. - Update trybuild
.stderrfiles only when macro diagnostics intentionally change. - Regenerate checked-in PNG captures only when expected visual output changes.
- Build
web/public/book,web/public/llms*, andweb/distthroughcargo xtask; editbook/srcandweb/srcas their sources.
Validation and Editing Rules
- Use
just --listto inspect available repository recipes. - Use
just fmt,just check,just clippy,just test, orjust ciwhen a change spans the scope of those recipes. - Use
just test-docsfor rustdoc changes andcargo package --workspace --listwhen matching the CI package job. - Use
cargo xtask build bookandcargo xtask build llms-txtfor book changes andcargo xtask build webfor the catalog.just web-buildruns the complete publication pipeline. - For focused Rust work, prefer the smallest package-specific
cargo checkorcargo testcommand that covers the affected crate. - For route macro or typed-id changes, keep
CaptureRoute,CaptureScenario,routes, andcapture_routesbehavior aligned with trybuild tests and facade re-exports. - For registered routes, preserve duplicate route-id validation and keep route
key names, explicit
key = ...behavior, and installer signatures documented and tested. - For Bevy capture runtime changes, keep live mode as normal Bevy plugin
behavior and capture mode as offscreen schedule-runner output that respects
route, size, frame, output path, scenario, and
CaptureReady. - For MCP route catalog changes, keep helpers read-only and keep enum route and registered-route tools aligned.
- For public examples, keep route ids, titles, sizes, README snippets, and checked-in captures aligned.
- If validation cannot be run, state exactly what was skipped and what remains unvalidated.