AGENT SKILL

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 it
  • python3 scripts/ci/ruff_pinned.py check . / ... format --check . — lint/format through the pinned-ruff wrapper; this is what CI and .worktrail/policy.yaml's pre_commit_cmd/integrate_smoke_cmd invoke
  • python3 scripts/ci/check_shebang_exec_bits.py — EXE001/EXE002 read from git's index modes
  • python3 -m build — sdist/wheel build (mirrors CI's own build step)

Critical Conventions

  • Never pip install -e from a task worktree. The editable install records the checkout's absolute path; deleting a merged worktree (the standard teardown-after-merge step) then breaks every worktrail-* console script with ModuleNotFoundError: No module named 'worktrail' until someone manually reinstalls from the canonical checkout. dev-install.sh enforces this by refusing to run from a worktree.
  • Lint through the two scripts/ci/ wrappers, never a bare ruff — both exist because a local PASS was not evidence about CI. ruff_pinned.py runs the exact pin from pyproject.toml (PATH when it already matches, else uvx ruff@<pin>) and refuses anything else, because a global ruff installed 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.py enforces 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 in pyproject.toml. A skill, doc, or code path that names a worktrail-* command must match a real entry point exactly — tests/test_plugin_surface.py enforces 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 Check validates only PRs that actually change pyproject.toml's version: valid semver, increased over base, and .codex-plugin/plugin.json in sync.
  • Never commit or develop directly on main. Branch off main into 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, headless worktrail-skill-dispatch) go through worktrail-detach launch, never the Bash tool's run_in_background — the harness reaps its own tracked background tasks on this host (see the detach skill).

Structure

  • src/worktrail/conductor/ — compiles a spec/change into a schedulable RunPlan (see the worktrail skill)
  • src/worktrail/orchestrator/ — parallel git-worktree fan-out execution, live agent spawning, branch integration + PR creation (see the worktrail skill)
  • src/worktrail/taskformats/ — the TaskSource adapter interface plus devkit, openspec, and speckit implementations (see the worktrail skill)
  • src/worktrail/addons/ — opt-in post-task tooling, e.g. the aspens skill-doc sync add-on (see the worktrail skill)
  • src/worktrail/workqueue/ — the $WORK_QUEUE_DIR handoff-brief claim/done/release lifecycle (see the workqueue skill)
  • src/worktrail/router/ — the deterministic route classifier, resume dashboard, policy loader, and run records (see the router skill)
  • src/worktrail/drain/ — unattended queue-draining loop (see the drain skill)
  • src/worktrail/onboarding/ — worktrail-repo-init: scaffolds/migrates a repo onto the repo-standards doctrine (see the onboarding skill)
  • src/worktrail/runtime/ — provider-neutral runtime primitives: routing-catalog/target selection (routing_source.py, selection.py) and the worktrail-detach supervised-launch primitive (detach.py, see the detach skill)
  • src/worktrail/shared/ — cross-cutting helpers (homedir.py, brief_frontmatter.py)
  • scripts/ci/ — CI gate scripts callable locally, each with its test_*.py beside it
  • tests/ — mirrors the src/worktrail/ layout (see the tests skill)
  • 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

behindthedash
behindthedash/worktrail

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.

★ 0
behindthedash
behindthedash/worktrail

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).

★ 0
behindthedash
behindthedash/worktrail

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".

★ 0
behindthedash
behindthedash/worktrail

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).

★ 0
behindthedash
behindthedash/worktrail

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>.

★ 0
behindthedash
behindthedash/worktrail

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.

★ 0