skills/openspec-ext/openspec-ext-hack-through-test/SKILL.md
Manual invocation only. OpenSpec-specific hack-through-testing workflow targeting production-level end-to-end paths using real data and real user workflows — not CI smoke/unit/integration tests. Three subskills: `propose` to create an OpenSpec change with HTT-ready test cases (automatic scripts and interactive guides) by invoking `openspec-propose` or `openspec-ff-change`, `revise` to update an existing OpenSpec change so its artifacts support hack-through-testing-driven implementation and testing, and `run` to exercise an implemented OpenSpec change through the full hack-through-testing loop (in-place by default, or in a disposable snapshot worktree when requested). Use when the user explicitly asks for `openspec-ext-hack-through-test`, points to `openspec/changes/...` while asking to propose, revise, run, exercise, or prepare work under hack-through-testing principles, or wants OpenSpec work shaped for fast blocker discovery through patch-forward testing.
npx skillsauth add igamenovoer/magic-context openspec-ext-hack-through-testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Manual invocation only: use this skill only when the user explicitly wants this workflow.
Use this skill as the OpenSpec-specific version of hack-through-testing.
It has three subskills:
propose: create an OpenSpec change with HTT-ready test cases (automatic scripts and interactive guides) by invoking openspec-propose or openspec-ff-changerevise: revise an existing OpenSpec change so its artifacts support HTT-friendly implementation and testingrun: drive an implemented OpenSpec change through the full hack-through-testing loop (in-place by default, or in a disposable snapshot worktree when requested)This skill is self-contained. Use only the files bundled inside this skill directory for its workflow and references.
Hack-through-testing targets production-level end-to-end paths: real data, real user workflows, real API calls, real output artifacts. It is not a CI smoke run, not a unit test harness, and not a mock-based integration check.
In all three subskills, the canonical path to propose, revise for, or run must be a real production user scenario — the full flow a real user would perform, end to end. Do not treat existing CI test suites, smoke tests, or mock-based integration tests as the target.
If the only testable surface you can identify from the change artifacts or repository context is CI-style, stop and ask the user what the real production user path or end-to-end scenario is before proceeding. For example:
I can see unit/smoke/integration tests already covered by CI. What's the real production user path you want to exercise — the end-to-end scenario, the live data workflow, or a specific user journey?
Choose the subskill before doing deeper work:
propose when the user wants a design or implementation approach, there is no existing change to edit, or the request is grounded mainly in chat context.revise when the user points to an existing OpenSpec change and wants its proposal, design, specs, or tasks made compatible with hack-through-testing principles.run when the user says the OpenSpec change is already implemented, or clearly asks to run, test, exercise, or patch forward through the implementation.If the request is ambiguous:
revise for an existing change path when the ask is about design or artifact readinessrun only when the user clearly wants execution against implementationWhen using run, determine the isolation mode from context:
If the user does not specify → default to in-place.
Read references/hack-through-testing-principles.md in every mode.
Then read the mode-specific references:
propose or revise: references/propose-revise-checklist.mdrun: references/run-mode-openspec-adaptation.mdFor run, also use these bundled resources:
scripts/create_snapshot_worktree.sh (worktree mode only)references/log-template.mdreferences/issue-template.mdreferences/git-snapshot-plumbing.md (worktree mode only)For revise and run, resolve the change through OpenSpec CLI before assuming artifact layout:
openspec status --change "<change-name>" --json
openspec instructions apply --change "<change-name>" --json
Use these outputs to determine:
changeDirschemacontextFilesRead every existing file referenced by contextFiles.
If a value is a glob such as specs/**/*.md, expand it on disk and read the matching files.
Use these commands when they add signal:
openspec show --type change --json --no-interactive "<change-name>"
openspec validate --type change --strict --json --no-interactive "<change-name>"
Do not assume files such as proposal.md or design.md exist without checking the OpenSpec output first.
propose And reviseWhen the change includes automatic or agent-driven test execution as part of the intended delivery, use these artifact conventions unless the user explicitly asks for a different structure or the target repository already has a stronger local convention:
openspec/changes/<change>/testplans/.testplans/case-<case-id>.md.testplans/ files as design-phase artifacts, not as final implementation docs.case-*.md should describe:
case-*.md should include at least one Mermaid sequenceDiagram that shows the canonical flow for that case.<implementation-root>/autotest/.<implementation-root>/autotest/.autotest/case-<case-id>.<case-script-ext> — an executable script that runs unattended and exits with a clear pass/fail signal.<case-script-ext> to match the target project, operating system, and execution model. It is not fixed to .sh.autotest/case-<case-id>.md — a step-by-step interactive test guide designed for agent-driven execution with user observation.
Each interactive guide must contain inline instructions that explain what to do at each step, what to observe, and what success or failure looks like.
Do not reduce interactive guides to "run case-<id>.<ext>". They are independent test procedures where an agent executes steps on the user's behalf while the user watches results and decides how to proceed.
Structure each guide as an ordered sequence of steps. Each step should include:
Do not require the implemented interactive guides to match the design-phase openspec/.../testplans/ files line by line. They describe the shipped behavior for interactive testing; the change-owned testplans/ remain the design source of truth.
<implementation-root>/autotest/helpers/.autotest/helpers/ instead of duplicating common behavior.<implementation-root>/autotest/<project-dependent-harness-script>..sh for POSIX shell-first repos.ps1 for PowerShell-first Windows automation.py for Python-oriented projects.ts for TypeScript/Node-oriented projectscase-*.<case-script-ext> files.proposeUse propose to create an OpenSpec change with HTT-ready test cases — both automatic scripts and interactive guides.
Create an OpenSpec change centered on one canonical production-level end-to-end user path: the full flow a real user would perform with real data, from input to output. The change must include test case designs (both automatic and interactive variants) that favor fail-fast behavior, explicit artifact capture, and an implementation order that supports patch-forward discovery.
If the feature intent from context does not make the real user path obvious, ask the user to describe it before designing. Do not default to designing a CI-style test harness.
An OpenSpec change created by invoking openspec-propose or openspec-ff-change, with test case artifacts included in the change design.
testplans/ layout with both automatic and interactive case plansautotest/ layout: automatic scripts (case-<id>.<ext>) and interactive guides (case-<id>.md)openspec-propose (for a single-step proposal) or openspec-ff-change (to fast-forward through all artifacts) to create the OpenSpec change. Pass the HTT design context so the change artifacts encode the canonical path, test case variants, and safety model.reviseUse revise to update an existing OpenSpec change so it supports hack-through-testing-friendly implementation and later execution.
Revise the change artifacts in place so the implementation can expose one canonical non-interactive path, fail fast on missing prerequisites, preserve useful outputs, and isolate unsafe dependencies during automated or agent-driven testing.
Update the existing change artifacts in place. Typical targets are:
proposal.mddesign.mdspecs/**/*.mdtasks.mdopenspec/changes/<change>/testplans/case-*.md covering both automatic and interactive variants<implementation-root>/autotest/case-*.<ext><implementation-root>/autotest/case-*.md<implementation-root>/autotest/helpers/<implementation-root>/autotest/<project-dependent-harness-script>openspec validate --type change --strict --json --no-interactive "<change-name>"
If important product decisions are still unresolved, make the smallest safe assumption only when the artifacts already lean that way; otherwise record the open question or tell the user a review or decision pass is still needed.
runUse run when the OpenSpec change is already implemented and the user wants the full hack-through-testing workflow.
Drive the implemented change forward along the real production user path — using real data and real service calls within safe limits — patching around blockers just enough to reach later failures quickly, while keeping every workaround reviewable and ending with a synthesis of the real fixes.
By default, operate in-place (stash + test on current branch). Use a disposable snapshot worktree only when the user explicitly requests it.
Do not target existing CI tests, unit tests, or smoke scripts as the canonical path. If the implementation's only runnable surface is CI-oriented, stop and ask the user what the real end-to-end user scenario looks like before starting the loop.
Produce:
references/run-mode-openspec-adaptation.md to determine:
In-place mode (default):
Stash the user's uncommitted changes, including untracked files:
git stash push --include-untracked -m "hacktest snapshot <timestamp>"
Record the stash ref in the session log. Testing proceeds from clean HEAD on the current branch.
Each subsequent workaround is captured as a stash snapshot without disturbing the working tree:
stash_sha=$(git stash create)
git stash store -m "hacktest <issue-id>: <short description>" "$stash_sha"
Create the log and runs directories:
mkdir -p <htt-home>/logs/issues <htt-home>/runs
Worktree mode:
Snapshot the current repository state into a throwaway worktree with the bundled helper:
bash ./scripts/create_snapshot_worktree.sh --topic TOPIC_SLUG
Optional arguments:
bash ./scripts/create_snapshot_worktree.sh --repo PATH --topic TOPIC_SLUG --branch hacktest/TOPIC_SLUG --htt-home HTT_HOME --path WORKTREE_PATH
htt-branch and worktree path (worktree).revise mode.If the change is not implemented enough to exercise responsibly, stop and report that the correct next step is propose or revise, with the concrete evidence that led to that conclusion.
propose or revise.Use $openspec-ext-hack-through-test in propose mode and create an OpenSpec change with HTT-ready test cases for this feature.Use $openspec-ext-hack-through-test in revise mode on openspec/changes/<change> and update the artifacts for HTT compatibility.Use $openspec-ext-hack-through-test in run mode on openspec/changes/<change> and patch forward through the implemented flow.Use $openspec-ext-hack-through-test in run mode with a worktree on openspec/changes/<change> so my checkout stays clean.Take this OpenSpec change and either revise or run it under hack-through-testing principles, depending on what the current state supports.Pointing to a file or directory under openspec/ counts as the same trigger signal as explicitly saying openspec.
run mode unless the user explicitly asks to switch modes.run mode as the final fix.propose or revise.testplans/ and implemented autotest/ artifacts into the same artifact role; keep the design-versus-implementation distinction explicit.autotest/helpers/.autotest/case-*.md) to wrappers that just say "run the automatic script"; they must be independent step-by-step procedures for agent-driven execution with user observation.data-ai
Create readable Mermaid diagrams inside Markdown files. Use for flowcharts and sequence diagrams that must render cleanly in common Markdown renderers (e.g., GitHub) without horizontal scrolling. Covers fenced mermaid blocks, init/theme styling, label wrapping with <br/>, and sequenceDiagram layout rules (short IDs, wrapped labels, don’t break identifiers).
development
Manual invocation only; use only when the user explicitly requests `make-program-tutorial` by exact name, OR when the user asks to use a skill to create an SDK/API/library tutorial. Create a clear, reproducible, step-by-step tutorial for a specific API/SDK/library (or a set of functions/classes), with runnable examples, expected outputs, and basic troubleshooting.
testing
Use when the user wants to create a self-hosted, offline-installable Conda channel (mirror) containing a specific subset of packages using Pixi.
tools
Guides the agent to setup a new or existing Pixi environment for compiling C++ and CUDA code. It ensures the correct compilers, toolkits, and CMake configurations are in place for a robust user-space build.