base
Core conventions, tech stack, and project structure for worktrail
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- base
- triggers
- { "alwaysActivate": true }
- description
- Core conventions, tech stack, and project structure for worktrail
03 SKILL.md 正文
You are working in worktrail, a spec-format-agnostic task orchestration package.
Tech Stack
Python 3.14+ | one runtime dependency: pyyaml | pytest for tests (dev extra) | setuptools src/ layout packaging | ruff is pinned exactly (ruff==<version> in pyproject.toml's dev extra) — CI's "Lint, Test & Build" job runs ruff lint + ruff format check + a shebang/exec-bit check + pytest + a golden regression check + build
Commands
./scripts/dev-install.sh—pip install -e ".[dev]"; refuses to run from a linked worktree (must be the canonical checkout, e.g.~/projects/worktrail)pytest/pytest -q— full test suite (testpaths = ["tests", "hooks", "scripts/ci"])python3 -m worktrail.orchestrator.orchestrate check— golden record/replay regression for the orchestrator; run alongside pytest, not a substitute for itpython3 scripts/ci/ruff_pinned.py check ./... format --check .— lint/format through the pinned-ruff wrapper; this is what CI and.worktrail/policy.yaml'spre_commit_cmd/integrate_smoke_cmdinvokepython3 scripts/ci/check_shebang_exec_bits.py— EXE001/EXE002 read from git's index modespython3 -m build— sdist/wheel build (mirrors CI's own build step)
Critical Conventions
- Never
pip install -efrom a task worktree. The editable install records the checkout's absolute path; deleting a merged worktree (the standard teardown-after-merge step) then breaks everyworktrail-*console script withModuleNotFoundError: No module named 'worktrail'until someone manually reinstalls from the canonical checkout.dev-install.shenforces this by refusing to run from a worktree. - Lint through the two
scripts/ci/wrappers, never a bareruff— both exist because a local PASS was not evidence about CI.ruff_pinned.pyruns the exact pin frompyproject.toml(PATH when it already matches, elseuvx ruff@<pin>) and refuses anything else, because a globalruffinstalled once for every repo drifts from the pin (0.16.5 against a 0.16.7 pin on 2026-09-19) and ruff's behavior changes between patch releases.check_shebang_exec_bits.pyenforces EXE001/EXE002 from git's index modes, because ruff disables those two rules on Windows and WSL (its own docs) while GitHub's Linux runners enforce them — PR #1279 passed lint locally and failed CI on both matrix legs over exactly that, and pinning the version does not help since the rules are off by platform. - ~70 console scripts, one per
[project.scripts]entry inpyproject.toml. A skill, doc, or code path that names aworktrail-*command must match a real entry point exactly —tests/test_plugin_surface.pyenforces this in CI. - Version bumps are batched, standalone commits, not per-PR (real semver, unlike sibling plugin repos' version-less/SHA-tracked model). Ordinary feature/fix PRs need no label or bump.
CI: Release Metadata Checkvalidates only PRs that actually changepyproject.toml's version: valid semver, increased over base, and.codex-plugin/plugin.jsonin sync. - Never commit or develop directly on
main. Branch offmaininto a sibling worktree (git worktree add ../worktrail-worktrees/<branch> -b <branch> main); merge only after CI is green; delete the branch once its PR lands. - Long-running launches (
worktrail-live full-real, headlessworktrail-skill-dispatch) go throughworktrail-detach launch, never the Bash tool'srun_in_background— the harness reaps its own tracked background tasks on this host (see thedetachskill).
Structure
src/worktrail/conductor/— compiles a spec/change into a schedulable RunPlan (see theworktrailskill)src/worktrail/orchestrator/— parallel git-worktree fan-out execution, live agent spawning, branch integration + PR creation (see theworktrailskill)src/worktrail/taskformats/— theTaskSourceadapter interface plusdevkit,openspec, andspeckitimplementations (see theworktrailskill)src/worktrail/addons/— opt-in post-task tooling, e.g. theaspensskill-doc sync add-on (see theworktrailskill)src/worktrail/workqueue/— the$WORK_QUEUE_DIRhandoff-brief claim/done/release lifecycle (see theworkqueueskill)src/worktrail/router/— the deterministic route classifier, resume dashboard, policy loader, and run records (see therouterskill)src/worktrail/drain/— unattended queue-draining loop (see thedrainskill)src/worktrail/onboarding/—worktrail-repo-init: scaffolds/migrates a repo onto the repo-standards doctrine (see theonboardingskill)src/worktrail/runtime/— provider-neutral runtime primitives: routing-catalog/target selection (routing_source.py,selection.py) and theworktrail-detachsupervised-launch primitive (detach.py, see thedetachskill)src/worktrail/shared/— cross-cutting helpers (homedir.py,brief_frontmatter.py)scripts/ci/— CI gate scripts callable locally, each with itstest_*.pybeside ittests/— mirrors thesrc/worktrail/layout (see thetestsskill)skills/,commands/— this repo's own Claude Code plugin marketplace surface (see AGENTS.md "Claude Code plugin surface")
Last Updated: 2026-09-20
04 同仓库更多 Skills
worktrail-sdd-workflow
Internal SDD workflow executor invoked by /go only. Do not call directly. Executes classified routes A–J: feature planning, implementation (parallel orchestration, PR generation), defect repair, refactoring, spec changes, investigation, and workflow evolution.
worktrail-routing-config
Configure Worktrail's agent routing table (`~/.worktrail/routing.yaml`, or a repo-local `routing:` policy block) — which harness/model executes each role and tier, and how fallback between them works. Use when the operator wants to add or remove a harness/adapter (claude/codex/opencode), add a model to an existing harness (e.g. adding a DeepSeek model to opencode), pin or change who does code review, add a new tier or purpose mapping, change the default tier, or is confused about which harness actually served a spawn (e.g. "why did this use Codex when I only configured Claude"). Trigger phrases: "routing.yaml", "add a harness", "disable a harness", "add an adapter", "remove an adapter", "add a model", "add deepseek to opencode", "change the reviewer", "pin the reviewer", "routing tiers", "routing targets", "default_tier", "independent reviewer", "why did codex get called". This skill is about *editing the config file*; it does not cover `/go`'s own dispatch mechanics (see `worktrail-go`'s SKILL.md Phase 7 for how `tier_for()`/`select_cell()` resolve it at runtime).
worktrail-repo-init
Bootstrap a new repo, or migrate an existing single-branch repo, onto the workspace's repo-standards doctrine (~/rules/CLAUDE.repo.md): the AGENTS.md-is-truth/CLAUDE.md-imports-it split, a dev/prd, dev/stg/prd, or main-only (trunk) branch model with matching GitHub rulesets, an OpenSpec scaffold, an auto-merge workflow, and a seeded .worktrail/policy.yaml. Trigger phrases: "onboard this repo", "apply repo standards", "initialize repo standards", "set up this repo like the rest of the fleet", "bring this repo into line with the repo standards doctrine".
worktrail-help
Show the Worktrail front-door commands and accepted positional arguments. Use when the user asks how to invoke worktrail-go, wants the available handoff, spec, pr, repo, or route forms, invokes worktrail-go with help or with a bare noun, or asks how to answer a filed product decision (worktrail-decision).
worktrail-handoff
Capture a discovered problem, gap, tech debt, or deferred work into a local work queue so a future agent session can pick it up cold. Use mid-session whenever you set work aside instead of doing it now — a fix you judge out of scope for this PR, work that belongs in a follow-up or a separate/later PR, an item you're deferring, or something worth fixing you won't tackle now — so the outstanding item isn't lost without derailing current work; can be called multiple times per session. Trigger phrases: "defer this", "item deferred", "out of scope for this PR", "follow-up work", "leave for another PR", "capture for later", "outstanding item". This skill captures only. Picking a brief back up is the front door's job: worktrail-go <brief-id>.
worktrail-go
Use when the user invokes worktrail-go, asks to pick up queued work, resume active specs, implement or fix a spec, route engineering work, or orient across repositories. Renders the orientation dashboard, classifies free-text requests, claims/resumes handoff briefs, and dispatches SDD work without requiring the user to know sdd-workflow. Grammar: worktrail-go [REPO] <noun> <verb>, nouns handoff / spec / pr / decision. Triggers: worktrail-go, worktrail-go help, worktrail-go spec fix, worktrail-go spec implement, worktrail-go spec route F, worktrail-go handoff new, worktrail-go handoff auto, worktrail-go decision answer, worktrail-go BRIEF-ID, bare worktrail-go, multi-repo orientation.