write-feature-tests
Write or change Agentty PTY scenarios with the FeatureTest builder, name published feature demos consistently, keep their freshness hashes deterministic, and…
от agentty-xyz★ 46 звёзд на GitHub
Установить write-feature-tests в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Write Feature Tests
Use this skill when adding or changing a visible Agentty UI scenario under
crates/agentty/tests/e2e/, or when a published demo's freshness hash varies for
unchanged UI. Follow crates/agentty/tests/e2e/AGENTS.md for scenario rules and
skills/refresh-feature-recordings/SKILL.md to record published artifacts.
Name the Feature
A published feature demo uses one name throughout the pipeline:
| Artifact | Path |
|---|---|
| Test function | test_{name} in crates/agentty/tests/e2e/{module}.rs |
| GIF file | docs/site/static/features/{name}.gif |
| PNG poster | docs/site/static/features/{name}.png |
| Zola page | docs/site/content/features/{name}.md |
Choose a short, descriptive snake_case feature name, such as session_creation,
help_overlay, or tab_switch.
Steps
Choose the test module. Place the test in the E2E module matching the feature area. Session lifecycle, prompt, diff, review, and related topics live under
session/. If no module fits, create one and register it incrates/agentty/tests/e2e/main.rs, or incrates/agentty/tests/e2e/session.rsfor a new session topic.Seed fixtures. For scenarios unrelated to model selection, seed explicit sessions and settings with
ag_session::test_supportfrom thetest-utilsfeature. Its named model fixture is pinned independently of provider defaults, keeping recordings stable when a default changes. Tests and demos of model pickers, defaults, and retirement behavior keep explicit model-id expectations and refresh their recordings when that behavior changes.Write the test with
FeatureTestfromcrates/agentty/tests/e2e/common.rs, as described in Builder Reference. Omit.zola(...)when only PTY coverage is needed.Verify the Zola page. With
.zola(...),FeatureTestgeneratesdocs/site/content/features/{name}.mdon first run with this front matter:+++ title = "Feature title" description = "One-line description shown on the card." weight = 50 [extra] gif = "{name}.gif" +++The
features.htmltemplate discovers every page incontent/features/, sorted byweight, so no template edits are needed.Run the focused check in Focused Validation, then record any published artifacts with
skills/refresh-feature-recordings/SKILL.md.
Builder Reference
FeatureTest handles TempDir and BuilderEnv creation, scenario execution, optional
GIF generation with content-hash caching, and optional Zola page creation in one
declarative chain. The example below publishes a feature demo:
use testty::assertion;
use testty::region::Region;
use crate::common;
use crate::common::FeatureTest;
#[tokio::test]
async fn test_{name}() -> Result<(), Box<dyn std::error::Error>> {
// Arrange, Act, Assert
FeatureTest::new("{name}")
.with_git() // Required for features that create sessions/worktrees.
.zola(
"Human-readable title",
"One-line description for the feature card.",
50, // Weight for ordering on the features page.
)
.run(
|scenario| {
scenario
.compose(&common::wait_for_agentty_startup())
// Navigate to the relevant tab/state.
.compose(&common::switch_to_tab("Sessions"))
.viewing_pause_ms(1500)
// Perform the feature interaction.
.press_key("a")
.wait_for_stable_frame(300, 5000)
.viewing_pause_ms(1500)
.capture_labeled("label", "Description of captured state")
},
|frame, _report| {
Box::pin(async move {
let full = Region::full(frame.cols(), frame.rows());
assertion::assert_text_in_region(frame, "expected text", &full);
})
},
)
.await?;
Ok(())
}
new(name): set the feature name used for the GIF filename and Zola page..with_git(): initialize a Git repository in the workdir, required for session and worktree features..zola(title, description, weight): generate the Zola page with these front matter fields; an existing page is not overwritten..setup(setup): supply an async fixture closure returningBox::pin(async move { ... })..run(build_scenario, assert).await: execute the scenario, await the boxed async assertion closure, and generate the GIF when recording mode is enabled.
VHS replay sets VHS_REPLAY_ENV_VAR so command fixtures can use recording delays where
the PTY proof uses Rust-controlle
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл write-feature-tests?
Write or change Agentty PTY scenarios with the FeatureTest builder, name published feature demos consistently, keep their freshness hashes deterministic, and run focused scenario checks without VHS.
Как установить скилл write-feature-tests?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл write-feature-tests запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…