autospec-e2e-clone
Use when you need to provision an isolated, scaled-down, anonymized clone of a production environment for autospec-test E2E testing (Mode II). Handles snapshot capture, PII anonymization, edge-case data seeding, and URL exposure.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- autospec-e2e-clone
- description
- Use when you need to provision an isolated, scaled-down, anonymized clone of a production environment for autospec-test E2E testing (Mode II). Handles snapshot capture, PII anonymization, edge-case data seeding, and URL exposure.
02 资源文件 73
- 参考文档codex/prompt.md6.7 KB
- 脚本install.sh4.8 KB
- 参考文档opencode/agent.md6.9 KB
- 参考文档package-lock.json807 B
- 参考文档package.json264 B
- 参考文档README.md1.5 KB
- 脚本scripts/anonymize.mjs19.5 KB
- 脚本scripts/edge-case-seed.mjs9.7 KB
- 脚本scripts/edge-case-seed/csv.mjs1.6 KB
- 脚本scripts/edge-case-seed/shapes.mjs1.7 KB
- 脚本scripts/edge-case-seed/sqlite.mjs1.5 KB
- 脚本scripts/expose/compose.sh6.7 KB
- 脚本scripts/expose/custom.sh3.5 KB
- 脚本scripts/expose/dispatch.sh6.8 KB
- 脚本scripts/expose/k8s.sh4.7 KB
- 脚本scripts/expose/staging.sh3.5 KB
- 脚本scripts/load-contract.sh4.8 KB
- 脚本scripts/pii-assertions.sh8.0 KB
- 脚本scripts/provision.sh5.8 KB
- 脚本scripts/scale-down.mjs16.4 KB
- 脚本scripts/seed-shapes/overlay.yml1.1 KB
- 脚本scripts/snapshot/custom.sh2.0 KB
- 脚本scripts/snapshot/dispatch.sh7.5 KB
- 脚本scripts/snapshot/fs.sh3.2 KB
- 脚本scripts/snapshot/mysql.sh5.7 KB
- 脚本scripts/snapshot/pg.sh4.3 KB
- 脚本scripts/snapshot/s3.sh4.6 KB
- 脚本scripts/snapshot/sqlite.sh2.0 KB
- 脚本scripts/teardown.sh5.5 KB
- 其他tests/integration/dogfood.bats7.2 KB
- 其他tests/integration/expose-compose.bats5.1 KB
- 参考文档tests/integration/fixtures/compose/docker-compose.clone.yml203 B
- 其他tests/integration/snapshot-custom.bats2.9 KB
- 其他tests/integration/snapshot-fs.bats3.9 KB
- 其他tests/integration/snapshot-mysql.bats4.3 KB
- 其他tests/integration/snapshot-pg.bats4.1 KB
- 其他tests/integration/snapshot-s3.bats4.0 KB
- 其他tests/integration/snapshot-sqlite.bats3.3 KB
- 其他tests/integration/teardown.bats9.2 KB
- 参考文档tests/targets/mode-ii-real/.autospec/clone.yml1.0 KB
- 参考文档tests/targets/mode-ii-real/.autospec/test.yml352 B
- 参考文档tests/targets/mode-ii-real/docker-compose.yml1.4 KB
- 其他tests/targets/mode-ii-real/seed.sql890 B
- 参考文档tests/targets/postgres-fixture/.autospec/clone.yml645 B
- 参考文档tests/targets/postgres-fixture/docker-compose.yml386 B
- 其他tests/targets/postgres-fixture/seed.sql833 B
- 参考文档tests/targets/s3-fixture/.autospec/clone.yml477 B
- 参考文档tests/targets/s3-fixture/docker-compose.yml1.0 KB
- 参考文档tests/targets/sqlite-fixture/.autospec/clone.yml568 B
- 其他tests/targets/sqlite-fixture/seed.sql670 B
- 其他tests/unit/anonymize-rules.bats13.8 KB
- 其他tests/unit/contract-loader.bats2.1 KB
- 其他tests/unit/edge-case-seed.bats10.3 KB
- 其他tests/unit/expose-adapters.bats9.6 KB
- 参考文档tests/unit/fixtures/anonymize-fixture/.autospec/clone.yml662 B
- 资产文件tests/unit/fixtures/anonymize-fixture/snapshot/events.csv101 B
- 资产文件tests/unit/fixtures/anonymize-fixture/snapshot/users.csv197 B
- 参考文档tests/unit/fixtures/edge-case-seed-fixture-surplus/.autospec/test.yml128 B
- 资产文件tests/unit/fixtures/edge-case-seed-fixture-surplus/snapshot/tasks.csv124 B
- 参考文档tests/unit/fixtures/edge-case-seed-fixture/.autospec/test.yml128 B
- 资产文件tests/unit/fixtures/edge-case-seed-fixture/snapshot/tasks.csv97 B
- 参考文档tests/unit/fixtures/full-shape/.autospec/clone.yml781 B
- 参考文档tests/unit/fixtures/minimal-valid/.autospec/clone.yml173 B
- 参考文档tests/unit/fixtures/missing-expose/.autospec/clone.yml53 B
- 参考文档tests/unit/fixtures/missing-sources/.autospec/clone.yml119 B
- 参考文档tests/unit/fixtures/scale-down-fixture/.autospec/clone.yml196 B
- 参考文档tests/unit/fixtures/scale-down-fixture/snapshot/fk-meta.json217 B
- 资产文件tests/unit/fixtures/scale-down-fixture/snapshot/order_items.csv67 B
- 资产文件tests/unit/fixtures/scale-down-fixture/snapshot/orders.csv74 B
- 资产文件tests/unit/fixtures/scale-down-fixture/snapshot/products.csv80 B
- 参考文档tests/unit/fixtures/unparseable/.autospec/clone.yml55 B
- 其他tests/unit/scale-down.bats7.2 KB
- 脚本uninstall.sh3.7 KB
03 SKILL.md 正文
autospec-e2e-clone — Clone Environment Provisioner
Provision an isolated, scaled-down, anonymized clone of a production environment that autospec-test can run E2E tests against. The clone exposes a routable URL the autospec-test contract consumes via e2e.clone_url_env.
Self-update mode
Decide this purely from the request text the harness handed you. Do NOT
shell out (no grep, sed, [[ =~ ]], command substitution, etc.) to
test the user's free-form request — passing it through a shell is what
historically tripped harness permission engines. Read the request, normalize
it in your reasoning (collapse whitespace, trim, lowercase), and if the result is
exactly update, this skill enters self-update mode and does NOT run the
normal pipeline.
- Detect harness by checking which install path exists for this skill:
- Claude Code:
~/.claude/skills/autospec-e2e-clone/SKILL.md - OpenCode:
~/.config/opencode/agent/autospec-e2e-clone.md - Codex CLI:
~/.codex/prompts/autospec-e2e-clone.md
- Claude Code:
- Re-install from
mainby piping the canonical installer:
Run this one-liner once; it refreshes all autospec skills across all harnesses.curl -fsSL https://raw.githubusercontent.com/berlinguyinca/autospec/main/bootstrap.sh | bash -s -- --skill all --harness all --update - Show the diff between the prior installed file(s) and the freshly fetched copy.
- Stop. Do not enter any pipeline phase. Print the upgrade summary and return to the user.
If no install path is detected, print Self-update: no installed copy of autospec-e2e-clone found; run install.sh first. and exit.
Model tier
reasoning:standard, ctx:120k
Required capabilities & harness adapter
This workflow assumes five capabilities. Map each one to your harness's actual tool.
| Capability | Claude Code | OpenCode | Codex CLI | Fallback if missing |
|---|---|---|---|---|
| Read-only codebase research | Agent (subagent_type=Explore) |
task agent in read-only mode |
shell grep |
Do the search in-thread |
| Foreground delegation | Agent (subagent_type=general-purpose) |
nested task agent |
spawn nested CLI session | Do the work in-thread |
| Ask the user a question | AskUserQuestion |
inline prompt | inline prompt | Ask in response and wait |
| Subagent model tier | Model tier: TIER_B for provisioning work; TIER_A for review |
top task model + high reasoning | top GPT + reasoning_effort=high | Honor per-phase tier mapping |
| <!-- autospec-block:harness-adapter-core --> |
Harness detection
Detect your harness by checking available tools before any phase:
-
Claude Code — the
Agenttool with asubagent_typeparameter is available.TIER_A=opus+ultrathinkTIER_B=sonnet
-
OpenCode — a
tasktool with model/tier configuration is available.TIER_A= top-tier task model + high reasoningTIER_B= smaller-tier task model + medium reasoning
-
Codex CLI — neither
Agentnor a configurabletasktool is available.TIER_A= current top GPT model +reasoning_effort=highTIER_B= the spark / cost-optimized variant of the configured model when one exists, else the configured model +reasoning_effort=medium
Fallback rule: If TIER_B is unavailable (quota, capacity, or auth failure), silently retry with TIER_A. Never ask the user.
Adapter row
| Skill | Trigger | Output |
|---|---|---|
| autospec-e2e-clone | /autospec-e2e-clone or autospec-test Mode II gate |
.autospec/clone-url.txt + provisioned routable URL |
Contract
Contract file: .autospec/clone.yml in the target repository. Load and validate with:
bash "${AUTOSPEC_SKILLS_DIR:-$HOME/.autospec/skills}/autospec-e2e-clone/scripts/load-contract.sh" <repo_root>
Exit codes from load-contract.sh:
0— resolved contract JSON on stdout1— fatal (tool missing, parse error, internal error)2— refuse-to-run (contract invalid or missing required fields)
Required contract fields:
sources— array of ≥1 source entries (each withkind)expose.kind— one ofdocker_compose | k8s_ephemeral_namespace | dedicated_staging_slot | custom_cmd
Example .autospec/clone.yml:
sources:
- kind: postgres
dsn_env: PROD_DB_URL
tables_full: [users, products]
tables_sample: { events: 10000, logs: 5000 }
anonymize:
rules:
- table: users
columns:
email: hash_with_domain
ssn: redact
scale_down:
default_sample: 10000
foreign_key_aware: true
edge_case_seed:
consume_from: .autospec/test.yml
expose:
kind: docker_compose
compose_file: deploy/docker-compose.clone.yml
url_template: "http://localhost:8080"
health_endpoint: /health
ready_wait_secs: 60
Pipeline
1. Snapshot → capture DB + filesystem + S3 state
2. Anonymize → redact PII per declarative rules
3. Scale down → sample large tables (foreign-key-aware)
4. Edge-case seed → consume edge_case_seeds.require_shapes from .autospec/test.yml
5. Expose URL → provision routable URL + credentials
6. Health check → verify URL responds; matrix of expected endpoints
7. Output → writes .autospec/clone-url.txt for autospec-test gate to read
Components (C1–C10)
| Component | Description | Status |
|---|---|---|
| C1 | Skill scaffold + clone.yml contract + JSON Schema | This PR |
| C2 | Snapshot drivers: pg + mysql + sqlite | Pending |
| C3 | Snapshot drivers: s3 + filesystem + custom_cmd | Pending |
| C4 | Anonymize engine + reversible map + pii_assertions | Pending |
| C5 | Scale-down with foreign-key reachability | Pending |
| C6 | Edge-case seed consumer + catalog overlay | Pending |
| C7 | Expose adapter: docker_compose | Pending |
| C8 | Expose adapters: k8s + staging_slot + custom_cmd | Pending |
| C9 | Teardown + autospec-test contract integration | Pending |
| C10 | Synthetic targets + integration tests + dogfood | Done |
Constraints
- Source DSNs are never logged.
- Snapshot artifacts go to
.autospec/clone-snapshots/(gitignored). - PII assertions must pass post-anonymization or provisioning fails (fail-closed).
- Teardown runs automatically on test completion (success or failure).
04 同仓库更多 Skills
trio-pass-skill
暂无简介
duo-pass-skill
暂无简介
duo-divergence-skill
暂无简介
autospec
Use when the user wants to ship a feature end-to-end across multiple commits — bootstraps repo if missing, brainstorms a design spec, decomposes into linked GitHub issues, or splits an existing spec into issues, then runs an autonomous implementation loop with auto-merge.
autospec-upgrade
Use when the user wants to upgrade an Angular, Next.js, or React project to the latest official versions safely — by locking observable behavior before touching versions, upgrading one major at a time with official codemods, and gating completion on mutation score rather than coverage theater.
autospec-ui-audit
Use when a React Router application needs a deterministic whole-site route inventory before UI, UX, navigation, or evidence auditing begins.