autospec-sweep
Use when a project needs first-run autospec configuration, recurring spec-vs-reality sweeps, or continuous improvement across docs, tests, and code health.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- autospec-sweep
- description
- Use when a project needs first-run autospec configuration, recurring spec-vs-reality sweeps, or continuous improvement across docs, tests, and code health.
02 资源文件 12
- 参考文档areas/code-health.md1.7 KB
- 参考文档areas/dependency-health.md839 B
- 参考文档areas/docs-drift.md914 B
- 参考文档areas/spec-vs-code-drift.md662 B
- 参考文档codex/prompt.md10.0 KB
- 脚本install.sh6.6 KB
- 参考文档opencode/agent.md10.2 KB
- 参考文档README.md1.7 KB
- 脚本scripts/review.sh8.3 KB
- 脚本scripts/run.sh9.5 KB
- 脚本scripts/wizard.sh11.4 KB
- 脚本uninstall.sh2.6 KB
03 SKILL.md 正文
autospec-sweep (harness-neutral)
Create and maintain the tracked project-level autospec configuration at
.autospec/autospec.yml, then use it to run recurring sweeps that keep specs,
documentation, tests, and code aligned with reality.
<!-- autospec-block:startup-self-update SKILL_NAME=autospec-sweep -->
Self-update mode
If the feature-request argument is exactly update after trimming whitespace and
lowercasing, enter self-update mode and do not run a sweep:
- Detect whether
autospec-sweepis installed in any harness. - Run the canonical suite installer once with
--update:curl -fsSL https://raw.githubusercontent.com/berlinguyinca/autospec/main/bootstrap.sh | bash -s -- --skill all --harness all --update - Show a short before/after summary and stop.
Invocation
/autospec-sweep init
/autospec-sweep configure
/autospec-sweep run
initcreates.autospec/autospec.ymlon first use and verifies that every supported harness (Claude Code, Codex CLI, OpenCode) is wired up consistently — shared persistent memory atdocs/memory/, aMemory inventorysection inAGENTS.md, aCLAUDE.mdpointer if missing, and the~/.claude/projects/<slug>/memorysymlink resolving todocs/memory/.configurereads current repo findings and edits the tracked config.runexecutes the configured sweep and feeds resulting fixes back throughautospec-review, specs, issues, andautospec-run.
Harness detection
Resolve model tiers once at skill start:
- Claude Code:
TIER_A= Opus + maximum thinking;TIER_B= Sonnet + medium. - OpenCode:
TIER_A= top task model + high reasoning;TIER_B= smaller task model + medium. - Codex CLI:
TIER_A= current top GPT + high reasoning;TIER_B= current spark/cost-optimized Codex + medium.
If TIER_B is unavailable, silently retry the same delegated work with
TIER_A while preserving the task handoff.
Required capabilities & harness adapter
| Capability | Claude Code | OpenCode | Codex CLI | Fallback if missing |
|---|---|---|---|---|
| Repo inspection | Agent Explore |
read-only task |
rg, git, gh |
Inspect locally with bounded reads |
| Foreground delegation | Agent |
task |
native subagent/CLI | Do the synthesis in-thread |
| Ask questions | AskUserQuestion |
inline prompt | inline prompt | Ask one concise question |
| Subagent model tier | Tier A/B per harness detection | Tier A/B per harness detection | Tier A/B per harness detection | Fall back UP, never down |
| <!-- autospec-block:harness-adapter-core --> |
First-run config
Before any sweep work, check for .autospec/autospec.yml.
If it is missing:
- Run:
bash "${AUTOSPEC_SCRIPTS_DIR:-$HOME/.autospec/scripts}/autospec-sweep-wizard.sh" init - Ask only the wizard's small starter set unless repo findings require a
project-specific question:
- sweep profile, default
full - environment safety, default
strict_isolation - team personality, default
auto - competitor research, default
false
- sweep profile, default
- Commit
.autospec/autospec.ymlwith the next autospec spec/config commit. It is project source, not local runtime state.
If the config exists, read it first and treat it as the source of truth. Existing
.autospec/test.yml or .autospec/clone.yml files are compatibility inputs only;
do not make them the new source of truth.
Cross-harness setup verification (init mode)
init always runs the harness-setup doctor after the wizard, regardless of
whether .autospec/autospec.yml already existed. The doctor is idempotent —
re-running it on a fully-configured repo is a fast no-op:
bash "${AUTOSPEC_SCRIPTS_DIR:-$HOME/.autospec/scripts}/verify-harness-setup.sh"
It ensures all three supported harnesses see the same project guidance and the same persistent memory:
| Harness | Entry file | Memory source |
|---|---|---|
| Claude Code | CLAUDE.md |
~/.claude/projects/<slug>/memory → symlink → docs/memory/ |
| Codex CLI | AGENTS.md |
docs/memory/ (linked from AGENTS.md ## Memory inventory) |
| OpenCode | AGENTS.md |
docs/memory/ (linked from AGENTS.md ## Memory inventory) |
The doctor delegates the memory migration + AGENTS.md inventory block to
auto-init-memory.sh, then verifies five invariants:
docs/memory/exists and contains aMEMORY.mdindex.~/.claude/projects/<slug>/memoryis a symlink resolving todocs/memory/.AGENTS.mdexists at the repo root.AGENTS.mdcontains a## Memory inventorysection.CLAUDE.mdexists at the repo root — created as a one-line pointer toAGENTS.mdif missing, so Claude Code converges on the same source of truth.
Run verify-harness-setup.sh --check (read-only) as a doctor at any time; run
without flags to apply fixes. Exit code is non-zero only when an unfixable
invariant fails.
Configure mode
Use this mode when the user wants to modify sweep behavior or when the repo has changed enough that the config is stale.
- Inspect tracked specs,
AGENTS.md, package manifests, test commands, E2E config, deployment docs, and existing.autospec/*compatibility files. - Compare findings with
.autospec/autospec.yml. - Ask the minimum project-specific questions needed to resolve missing values.
- Edit only the relevant config sections.
- If a config change contradicts a tracked spec, update the spec in the same autospec design/spec PR before any implementation issue is filed.
Parallel area dispatch
Sweep runs fan out into 4 parallel area subagents per the AGENTS.md subagent
dispatch decision matrix. Areas are defined under
skills/autospec-sweep/areas/ and dispatched via
sweep-area-dispatch.sh:
spec-vs-code-drift— reusesexplore-research/spec-vs-code.sh.docs-drift— reusesdogfood-adapter-doc-drift.sh, which invokes/autospec-doc --full(full regen + repo-wide completeness audit viadoc-orchestrator.mjs) and surfaces missing parts as findings.code-health— reusesexplore-research/codebase-signals.sh.dependency-health— newexplore-research/dependency-health.shresearcher (also available to autospec-explore — extends the 6-researcher set to 7).
Each area subagent emits research-cycle JSON. The dispatcher aggregates into
.autospec/sweep/area-findings.json (schema: autospec-sweep.area-findings.v1)
which feeds the existing sweep report and autospec-review.
bash "${AUTOSPEC_SCRIPTS_DIR:-$HOME/.autospec/scripts}/sweep-area-dispatch.sh"
Sweep execution
Model tier: TIER_A for sweep synthesis and gap classification. Any fix implementation created by downstream
autospec-runuses that skill's Phase 4 Tier B/Tier A routing.
Start with the executable runner:
bash "${AUTOSPEC_SCRIPTS_DIR:-$HOME/.autospec/scripts}/autospec-sweep-run.sh" run
The runner validates .autospec/autospec.yml, writes
.autospec/sweep/latest.json, accepts --gaps <json> for already-emitted gap
contracts, and executes the bundled autospec-sweep-review.sh by default. Set
AUTOSPEC_SWEEP_REVIEW_CMD="<command>" to replace the deterministic wrapper with
a harness-specific or richer review command.
Run the sweep from current reality back to source artifacts:
- Read
.autospec/autospec.yml. - Run the enabled review surfaces: spec coverage, docs drift, test gaps, code health, security footguns, clone/test readiness, and implementation status.
- Emit concrete gaps with file paths, commands, and expected behavior.
- Update or create specs before creating code-fix issues when reality and specs disagree.
- File bounded
auto-implementissues for accepted gaps and hand them toautospec-run.
Continuous improvement
The default sweep is not a one-time bug hunt. It continuously improves:
- Documentation: keep user docs, API docs, runbooks, and generated docs in sync with implemented behavior.
- Documentation targets: treat
documentation.audiences[]anddocumentation.scopes[]in.autospec/autospec.ymlas the source of truth for deep docs. Emit separate gaps for missing target files or missing requiredautospec-doc-scopemarkers so user, developer, operator, security, runbook, API, and troubleshooting docs can be built as bounded reviewable work. - Tests: add missing regression, unit, integration, E2E, invariant, and negative path coverage where the sweep finds weak confidence.
- Code: reduce duplication, dead code, complexity, brittle boundaries, and security-sensitive shortcuts in small reviewable issues.
Every sweep run must execute the configured full test commands. Do not treat
review-only sweeps as sufficient. If E2E or integration tests require the
software to be deployed or started first, run project.findings.commands.deploy
before those tests. A failing deploy, unit, integration, or E2E command fails the
sweep and must be fixed before filing success claims.
Prefer small, reversible changes. File specs and issues for improvement work; do not silently refactor broad surfaces inside the sweep itself.
Spec sync
Specs must stay synchronized with reality:
- If code behavior is correct and the spec is stale, update the spec first.
- If the spec is correct and code behavior is stale, file implementation issues.
- If both are ambiguous, ask one project-specific question and record the answer in the config or spec before proceeding.
Safety
Never clone raw secrets or API keys. The config may store secret references, environment variable names, and allowlisted settings, but not secret values. Production-like sweeps default to strict isolation. Scoped production access requires explicit config, backup/restore, and the existing autospec-test safety rails.
Verification
After changing config or sweep behavior, verify:
autospec validate
bats tests/unit/test_autospec_sweep_config.bats
bats tests/unit/test_autospec_sweep_run.bats
ajv compile -s schemas/autospec-config.schema.json --spec=draft2020
Report changed config sections, generated questions, and any remaining unknowns.
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.