cli-e2e-testcase-writer

A guide for adding end-to-end tests to one domain of lark-cli, a command-line tool. End-to-end tests check a complete user workflow rather than one isolated function.

In plain words
What is it for?
Use it when creating or updating Go test workflows under tests/cli_e2e for one lark-cli domain, including its testcase files and coverage report.
Why use it?
It makes tests prove that commands work together and that changes persist, while documenting paths that cannot be tested because they need unavailable setup.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/larksuite/cli/cli-e2e-testcase-writer
Any agent
npx skills add larksuite/cli --skill cli-e2e-testcase-writer
Clone the repo
git clone --depth 1 https://github.com/larksuite/cli

Made for: Claude Code, Codex.

Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,416 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00078 $0.01416
Opus 5 $0.00039 $0.00708
Sonnet 5 $0.00016 $0.00283
Haiku 4.5 $0.00008 $0.00142

Measured 2d ago against content hash 9c85b9d3faf8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cli-e2e-testcase-writer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

tests/cli_e2e/cli-e2e-testcase-writer/SKILL.md · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLI E2E Testcase Writer

Work on one domain per run. Produce exactly two artifacts for that domain:

  • workflow testcase files under tests/cli_e2e/{domain}/
  • tests/cli_e2e/{domain}/coverage.md

Focus on domain testcase files. Do not change shared E2E support code such as tests/cli_e2e/core.go unless the user explicitly asks. Treat tests/cli_e2e/demo/ as reference only.

Core standard

  • Make the testcase scenario-based and self-contained.
  • Prove one workflow end to end: create plus follow-up read, or mutate plus teardown.
  • Prefer one file per workflow or one closely related feature.
  • For mutable flows, prove persisted state with read-after-write assertions, not just exit code.
  • Leave prerequisite-heavy paths uncovered when they cannot be proven, and explain why in coverage.md.

Workflow

1. Explore the live CLI before writing code

lark-cli --help
lark-cli <domain> --help
lark-cli <domain> +<shortcut> -h
lark-cli <domain> <group> --help
lark-cli <domain> <group> <method> -h
lark-cli schema <domain>.<group>.<method>

2. Count leaf commands for the denominator

  • A leaf command is one that executes an action — it has no further subcommands.
  • If lark-cli <domain> <group> --help lists no subcommands, <group> itself is the leaf.
  • Count task +create as one leaf and task tasks get as one leaf.
  • Do not count parameter combinations.
  • Reuse coverage already present under tests/cli_e2e/{domain}/. Do not count tests/cli_e2e/demo/.

3. Choose the proof surface before editing

Identify the provable risks for the touched workflow: invalid input, missing prerequisite, identity or permission, state transition, output shape, cleanup safety. If only the happy path is testable, document the blocked risk areas in coverage.md.

4. Add or update the workflow testcase

  • Use clie2e.RunCmd(ctx, clie2e.Request{...}).
  • Put command path and plain flags in Args; put JSON in Params (URL/path parameters) and Data (request body).
  • Prefer one top-level test per workflow with t.Run substeps.
  • Register teardown on parentT.Cleanup so it survives subtest failures.
  • When touching an existing command, verify the JSON response shape is stable: assert status type, field paths, and identifiers consumed by later steps before changing assertions.

Read the full file on GitHub · 123 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 123 lines · 78 tokens per session scan A 9c85b9d3faf8

Subscribe to this mod's changes

cli-e2e-testcase-writer is a skill published in the GitHub repository larksuite/cli (16,925 stars, last pushed today), licensed MIT. It adds 78 tokens to every session and 1,416 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

studio-e2e-tests

Write and run Playwright E2E tests for Supabase Studio (e2e/studio). Use when asked to run e2e tests, write new E2E tests, or debug flaky or failing Playwright tests. Covers running commands, avoiding race conditions, waiting strategies, selectors, helper functions, and CI vs local differences.

supabase/supabase · 74 tokens

smoke-tests

Use when running VS Code smoke tests or working on smoke-test CI steps. Covers npm run smoketest / smoketest-no-compile, grep filtering tests, and a temporary repeat-loop technique for tracking down flaky smoke tests in CI.

microsoft/vscode · 50 tokens

playwright-cli

Automate browser interactions, test web pages and work with Playwright tests.

microsoft/playwright · 19 tokens

router-act

How to write end-to-end tests using createRouterAct and LinkAccordion. Use when writing or modifying tests that need to control the timing of internal Next.js requests (like prefetches) or assert on their responses. Covers the act API, fixture patterns, prefetch control via LinkAccordion, fake clocks, and avoiding…

vercel/next.js · 71 tokens

studio-testing

Testing strategy for Supabase Studio. Use when writing tests, deciding whether a change needs tests and which type, extracting logic from components into testable utility functions, or reviewing test coverage. Covers unit tests, component tests, and E2E test selection criteria.

supabase/supabase · 55 tokens