Command Palette

Search for a command to run...

Назад к скиллам
скилл № 76111

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от 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

  1. 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 in crates/agentty/tests/e2e/main.rs, or in crates/agentty/tests/e2e/session.rs for a new session topic.

  2. Seed fixtures. For scenarios unrelated to model selection, seed explicit sessions and settings with ag_session::test_support from the test-utils feature. 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.

  3. Write the test with FeatureTest from crates/agentty/tests/e2e/common.rs, as described in Builder Reference. Omit .zola(...) when only PTY coverage is needed.

  4. Verify the Zola page. With .zola(...), FeatureTest generates docs/site/content/features/{name}.md on 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.html template discovers every page in content/features/, sorted by weight, so no template edits are needed.

  5. 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 returning Box::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

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

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), без исполняемых скриптов.

Похожие скиллы

Сравнить write-feature-tests с