ASD

Cli E2e Testcase Writer

Úsalo al añadir o actualizar cobertura E2E de CLI en Go para un dominio tests/cli_e2e/{domain} del lark-cli compilado, con exploración en vivo de --help/schema, flujos clie2e.RunCmd y mantenimiento de coverage.md.

Estrellas
16.4k

en todo el repo

Actividad
40

0–100, la ruta de este skill

Actualizado
hace 4 meses

último commit aquí

Commits
0

últimos 90 días

Contexto
1.5k tok

68 tok en reposo

Paquete
1 archivo

6 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add larksuite/cli --skill cli-e2e-testcase-writer --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Genera y actualiza pruebas E2E en Go para un dominio de tests/cli_e2e/{domain} del lark-cli compilado
  • Explora lark-cli --help y schema en vivo antes de escribir código
  • Cuenta comandos leaf para calcular el denominador de cobertura
  • Escribe testcases basados en escenarios usando clie2e.RunCmd
  • Mantiene el archivo coverage.md de cada dominio con tabla de comandos

Úsalo cuando

  • Al añadir o actualizar cobertura E2E de CLI en Go para un dominio de tests/cli_e2e/{domain} del lark-cli compilado
  • Cuando el trabajo requiere exploración en vivo de --help o schema
  • Cuando se necesitan flujos basados en escenarios con clie2e.RunCmd y mantenimiento de coverage.md por dominio

No lo uses cuando

    Qué lo activa

    Di cualquiera de estas frases y el agente debería cargar este skill.

    • Añade cobertura E2E para el dominio task del lark-cli
    • Actualiza el coverage.md del dominio chat con los nuevos comandos
    • Escribe un testcase de workflow para +create y +assign en task

    SKILL.md

    En inglés

    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.

    Reproducido de larksuite/cli bajo licencia MIT. Leer esta página en markdown.

    Archivos

    1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

    Antes de instalar

    Requiere el binario lark-cli disponible.

    Detalles

    Creador
    larksuite
    Categoría
    Testing y QA
    Licencia
    MIT
    Recursos incluidos
    Solo SKILL.md
    Repositorio
    larksuite/cli
    Código fuente
    Ver SKILL.md

    Más de larksuite/cli

    Este repo incluye 28 skills. Si instalas uno, normalmente ya tienes los demás.

    飞书幻灯片: crea y edita presentaciones, lee contenido de slides, gestiona páginas (crear, eliminar, leer, reemplazo parcial). No cubre documentos, pizarras ni archivos generales.

    Costo de contexto al activarse
    7k tok
    Tamaño del paquete
    50 archivos
    Última actualización
    hace 3 días
    documentos

    Drive de Feishu/Lark: gestiona archivos y carpetas (subir/descargar, copiar/mover/eliminar, metadatos, permisos, comentarios, versiones, etiquetas de confidencialidad) e importa archivos locales como docx/sheet/bitable/slides.

    Costo de contexto al activarse
    6.3k tok
    Tamaño del paquete
    61 archivos
    Última actualización
    hace 3 días
    documentos

    Operaciones sobre documentos en la nube de Lark (Docx/Wiki): leer, crear y editar documentos, insertar o descargar imágenes/adjuntos, y gestionar notas mentales.

    Costo de contexto al activarse
    1k tok
    Tamaño del paquete
    44 archivos
    Última actualización
    hace 3 días
    documentos

    Operaciones en Lark Base (multitabla): tablas, campos, registros, vistas, fórmulas/lookup, formularios, dashboards, workflows y roles; se usa ante Base/多维表格/bitable o enlaces /base/.

    Costo de contexto al activarse
    6.2k tok
    Tamaño del paquete
    30 archivos
    Última actualización
    anteayer
    bases de datos

    Lark Im

    16.4k

    Mensajería instantánea de Feishu/Lark: enviar y responder mensajes, buscar historial, gestionar miembros de grupo, subir/descargar archivos, reacciones, avisos urgentes y tarjetas interactivas con sus callbacks.

    Costo de contexto al activarse
    5.3k tok
    Tamaño del paquete
    59 archivos
    Última actualización
    hace 7 días
    automatizacion

    Desarrollo y hosting de apps Miaoda/Spark: creación, desarrollo local o en la nube, diseño creativo, integraciones de IA/Feishu, logs, métricas, variables de entorno, colaboradores, roles y triggers.

    Costo de contexto al activarse
    6.2k tok
    Tamaño del paquete
    55 archivos
    Última actualización
    hace 3 días
    herramientas desarrollo

    Skills relacionados

    Úsalo al completar tareas, implementar features mayores, o antes de mergear, para verificar que el trabajo cumple los requisitos.

    Costo de contexto al activarse
    739 tok
    Tamaño del paquete
    2 archivos
    Última actualización
    anteayer
    testing qa

    Úsalo antes de afirmar que un trabajo está completo, corregido o pasando, antes de hacer commit o crear PRs: exige ejecutar comandos de verificación y confirmar la salida antes de cualquier afirmación de éxito.

    Costo de contexto al activarse
    912 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    el mes pasado
    testing qa

    Úsalo al recibir feedback de code review, antes de implementar sugerencias, sobre todo si el feedback parece poco claro o técnicamente cuestionable: exige rigor técnico y verificación, no acuerdo performativo ni implementación ciega.

    Costo de contexto al activarse
    1.6k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    el mes pasado
    testing qa