Skills

Skillshare CLI E2e Test

Run isolated E2E tests in devcontainer from ai_docs/tests runbooks.

Install

npx skills add runkids/skillshare --skill skillshare-cli-e2e-test -g -a claude-code -y
Repository
runkids/skillshare2.9k
Category
Testing
Updated
3d ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Run isolated E2E tests in devcontainer from ai_docs/tests runbooks. Use this skill whenever the user asks to: run an E2E test, execute a test runbook, validate a feature end-to-end, create a new runbook, or test CLI behavior in isolation. If you need to run a multi-step CLI validation sequence (init → install → sync → verify), this is the skill, it handles ssenv isolation, flag verification, and structured reporting. Prefer this over ad-hoc docker exec sequences for any test that follows a runbook or needs reproducible isolation.

Run isolated E2E tests in devcontainer. $ARGUMENTS specifies runbook name or "new".

Before acting, run python3 scripts/ai-context.py testing. The topic is the source of truth for isolation, runbook quality and reporting rules; this skill retains the execution flow and mdproof recipes.

Flow

Phase 0: Environment Check

  1. Confirm devcontainer is running and get container ID:

    CONTAINER=$(docker compose -f .devcontainer/docker-compose.yml ps -q skillshare-devcontainer)
    
    • If empty → prompt user: docker compose -f .devcontainer/docker-compose.yml up -d
    • Ensure CONTAINER is set for all subsequent docker exec calls.
  2. Confirm Linux binary is available:

    docker exec $CONTAINER bash -c \
      '/workspace/.devcontainer/ensure-skillshare-linux-binary.sh && ss version'
    
  3. Confirm mdproof is installed:

    docker exec $CONTAINER /workspace/.devcontainer/ensure-mdproof.sh
    

    This auto-installs from GitHub release, or falls back to /workspace/bin/mdproof (local dev binary).

  4. Check for lessons learned from previous runs:

    test -f /workspace/.mdproof/lessons-learned.md && cat /workspace/.mdproof/lessons-learned.md
    

    If the file exists, read it before writing or debugging runbooks, it contains known gotchas and assertion patterns.

Phase 1: Detect Scope

  1. Preview all available runbooks via the container:

    docker exec $CONTAINER mdproof --dry-run --report json /workspace/ai_docs/tests/
    

    This returns JSON with every runbook's steps, commands, and expected assertions, no manual markdown parsing needed. Use this to understand what each runbook covers.

  2. Identify recent changes (unstaged + recent commits):

    git diff --name-only HEAD~3
    
  3. Match changes to relevant runbooks (compare changed file paths against step commands in the JSON output).

Phase 2: Select Tests

Prompt user (via AskUserQuestion):

Read the whole SKILL.md on GitHub

More in Testing