🎯

cli-e2e-testcase-writer

🎯Skill

Part of the official Lark/Feishu CLI, providing 200+ commands and 26 AI agent skills across 18 business domains including Messenger, Docs, Sheets, Calendar, and Mail. Designed for both humans and AI agents with agent-friendly structured output.

larksuite/cli65 InstallsAdded Apr 28, 2026

Installation

$npx skills add larksuite/cli --skill cli-e2e-testcase-writer

Run it in a terminal; it asks which AI coding tools to install it for (Claude Code, Codex, Cursor and more).

Uses skills.sh Β· Node.js 22.20+

After installing

Ask for related work and the agent uses it on its own, or call it yourself.

Run it (Claude Code)/cli-e2e-testcase-writer
Install by hand

Copy the whole skill folder from GitHub to the place below. Copying only SKILL.md can leave out files the skill uses.

Open the skill folder β†’
  • This project .claude/skills/cli-e2e-testcase-writer/
  • All projects ~/.claude/skills/cli-e2e-testcase-writer/

These paths are for Claude Code. For other tools, the command above puts it in the right place.

Use when adding or updating Go CLI E2E coverage for one `tests/cli_e2e/{domain}` domain of the compiled `lark-cli`, especially when the work requires live `--help` or `schema` exploration, scenario-based `clie2e.RunCmd` workflows, and per-domain `coverage.md` maintenance.

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.

5. Run and iterate

Run go test ./tests/cli_e2e/{domain} -count=1 while iterating and before finishing. If command shape or behavior is unclear, re-check help or schema (step 1) before changing assertions.

6. Refresh the domain outputs

  • Update the workflow testcase files.
  • Update coverage.md: recompute the denominator from live help output, mark each command as shortcut or api, and keep one command table for the whole domain.

Testcase rules

  • Override BinaryPath, DefaultAs, or Format on clie2e.Request only when the testcase truly needs it.
  • Use require.NoError, result.AssertExitCode, result.AssertStdoutStatus, assert, and gjson.
  • Shortcut responses ({ok: bool}) assert true; API responses ({code: int}) assert 0.
  • Use t.Helper() only for setup or assertion helpers that are called from multiple tests.
  • Use table-driven tests only when the scenario shape repeats across inputs.
  • For expected failures, assert stderr content and exit code when the environment makes them deterministic.
  • If identity or external fixtures cannot be proven, leave the command uncovered and document the prerequisite rather than faking confidence.

coverage.md

Keep coverage.md brief and mechanical. Include:

  • a domain-specific H1 title
  • a metrics section with denominator, covered count, and coverage rate
  • a summary section restating each Test... workflow, key t.Run(...) proof points, and main blockers
  • one command table for all commands

Recommended structure:

# <Domain> CLI E2E Coverage

## Metrics
- Denominator: N leaf commands
- Covered: N
- Coverage: N%

## Summary
- TestXxx: ... key `t.Run(...)` proof points ...
- Blocked area: ...

## Command Table
| Status | Cmd | Type | Testcase | Key parameter shapes | Notes / uncovered reason |
| --- | --- | --- | --- | --- | --- |
| βœ“ | task +create | shortcut | task_status_workflow_test.go::TestTask_StatusWorkflow | basic create; create with due | |
| βœ• | task +assign | shortcut |  | none | requires real user open_id |
  • Mark each command shortcut or api.
  • Write testcase entries in go test -run friendly form.
  • Commands only exercised in parentT.Cleanup teardown are not counted as covered.
  • Do not split covered and uncovered commands into separate sections.

Guardrails

  • Run as bot identity only; do not assume --as user works.
  • Do not place new real coverage under tests/cli_e2e/demo/.
  • Do not depend on preexisting remote data.
  • Do not fabricate open_ids, chats, docs, or other remote fixtures.
  • Prefer deterministic negative cases over tenant-dependent assertions.
  • Do not guess Params or Data fields when help or schema can tell you the exact shape.
  • Do not hardcode obvious defaults unless the command truly requires explicit flags.
  • Do not put agent, model, or vendor brand names in visible remote test data; use neutral prefixes such as lark-cli-e2e- or <domain>-e2e-.
  • A command is covered only when the testcase asserts returned fields or persisted state, not just exit code.
  • Cleanup-only execution is not primary coverage, except delete in the same workflow that created the resource.

More from this repository10

🎯
lark-mail🎯Skill

Lets Claude read, search, organize and write your Feishu (Lark) email from the command line. New messages are saved as drafts first, and nothing is sent until you approve it.

🎯
lark-event🎯Skill

This skill lets your AI agent listen for live events in Lark (Feishu), a work chat app, such as new messages, approvals, task updates and meetings. The agent can then react to each event as it arrives.

🎯
lark-contact🎯Skill

Helps your AI assistant find people in Feishu/Lark, a workplace messaging app, by name or email, and search for bots by keyword. It can also show a person's department, email, status or profile signature.

🎯
lark-openapi-explorer🎯Skill

This skill lets your AI use features of Feishu/Lark, a workplace chat and office app, that lark-cli has no command for yet. It looks them up in the official docs step by step and then calls them with `lark-cli api`.

🎯
lark-skill-maker🎯Skill

Helps you write your own skills for lark-cli, the command-line tool for Feishu (Lark). A skill is a SKILL.md file that teaches your AI a Feishu task, from one action to a multi-step process.

🎯
lark-slides🎯Skill

Lets your AI agent create, read and edit presentations in Lark (Feishu) Slides. It plans each deck first and checks every slide's layout before saving it.

🎯
lark-apps🎯Skill

A skill that helps your AI agent build, publish and run apps on Miaoda (Spark), the app building and hosting service in Feishu/Lark. It also manages app data, logs, settings, team access and automatic tasks.

🎯
good-skill-minimal🎯Skill

The official Lark/Feishu CLI tool providing 200+ commands and 26 AI agent skills across core business domains including Messenger, Docs, Base, Sheets, Calendar, Mail, Tasks, and Meetings.

🎯
good-skill-complex🎯Skill

Part of the official Lark/Feishu CLI tool with 200+ commands and 26 AI agent skills across 18 business domains including Calendar, Messenger, Docs, Sheets, Base, Tasks, and Mail, featuring agent-native design and structured output.

🎯
good-skill🎯Skill

The official Lark/Feishu CLI tool with 200+ commands and 26 AI agent skills covering Messenger, Docs, Base, Sheets, Calendar, Mail, Tasks, Meetings, and more. Designed for both humans and AI agents.