Repository navigation
Description
Outcome
Move the shared skill library (lib.sh, agent.sh, signing.sh,
gates.py) into Go packages behind agentrepo subcommands, behind
one permanent thin launcher.
The area's own non-owner shell fallbacks are removed by the last
child. The owner-path shell (agent.sh, signing.sh, lib.sh) is
deleted by two cutover issues under #588, which this epic does not
wait on. The transaction skill scripts (#322 to #327) are ported by
their own issues, which depend on this epic, so the exec-only wrapper
state is not part of this outcome.
Part of #588. Phase 1 (internal/config and agentrepo config) is
already merged.
Done when
- Every child below and every existing child listed is closed.
- The three suites in
tests/skills/source/lib/are deleted or
cut to cases that need a real shell, and the retirement ledger
accounts for every Bats case. - The intentional behavior changes (gate locale, note continuity,
a missing or too-old binary stopping the already-ported
subcommands) are listed. - Machine-only settings are still read from machine configuration
only. - The Go tests pass on macOS, Linux and Windows.
- The minimum supported version is raised, with the warning
period evidenced. - The leak scans come back clean for this epic's own text and
posts. - A closing comment checks every item above against evidence.
Children
Build order follows this list; the generator child goes first. The
two-digit identifiers are stable references used in the child bodies.
Child 07 was withdrawn and its script moved to #331, so the numbering
skips it.
- The generator copies the shared libraries from an explicit list #926
- The shared library Bats suites are retired where Go already covers them #927
- Gates run in the caller's locale instead of the C locale #928
- Both commit reviews receive the operator note and the stamp binds it #929
- The owner-review label default is resolved in Go #930
- The signing key, required hooks and sign-off identity are resolved in Go #931
- The binary resolver, permanent launcher and configuration bridges are resolved in Go #932
- The residual Bats cases for the resolver and readiness groups are retired #933
- The residual Bats cases for the review and policy groups are retired #934
- The configuration parity tests are retired after N-2 #935
Existing children that stay under this epic:
- Port the gate runner and pass cache from Python to Go #713
- refactor(agents): port skill capability and worktree context discovery to Go #755
- refactor(agents): port the gh-post requirement adapter to Go #756
- refactor(agents): port GitHub quota and identity handling to Go #760
- refactor(agents): port exact-head approval selection to Go #761
- refactor(agents): port confirmation and delegation resolution to Go #762
- refactor(agents): port trusted review policy and prompt assembly to Go #763
- refactor(agents): port skill signing verification to Go #764
- refactor(agents): port review snapshots and stamps to Go #769
- refactor(agents): port unattended review bounds and reporting to Go #770
- refactor(agents): port reviewer execution and verdict integration to Go #771
- refactor(agents): remove the shell fallback for discovery and worktree readiness #772
- refactor(agents): remove the GitHub shell fallback after consumer migration #775
- refactor(agents): remove the gh-post shell adapter after consumer migration #777
Out of scope
The two cutover issues filed directly under #588: the first deletes
lib.sh and its generated copies, the second deletes agent.sh,
signing.sh and their generated copies. Each needs the owner's
exact-head review, and this epic does not wait on them.
The transaction ports (#322 to #327), and the watch-checks script,
which #331 owns.
Owner
tbhb-dev/devtools
Activity
tbhb-agent commentedon Oct 21, 2026
The operator's P0 is moving all shared skill logic to Go, leaving only short wrappers that exec a binary, and replacing the corresponding bats coverage. I will send this as a sequence of reviewable PRs, starting with configuration only.
internal/skillconfigwith separate machineMachine(key, fallback)and repositoryRepository(key, fallback)lookups. Machine lookup preserves explicit empty environment values, then reads the XDG devtools per-repository file (using the main checkout name across worktrees), thendevtools.conf, then the fallback. Repository lookup validates the entire.agents/agent-skills.conf, accepts only the existing behavior-key allowlist, and refuses duplicates, unknown keys and non-regular/symlink files. Reviewer, delegation checker, GitHub login and sign-off identity never come from a repository file. Exposeagentrepo config machine KEY [DEFAULT]andagentrepo config repository KEY [DEFAULT]; replacedt_confanddt_repo_confbodies with calls to those commands. Table-driven Go tests and old/new parity fixtures precede deleting the migrated bats assertions. Generate skills, measure tokens and install APM output, then run lint and test.internal/harnessAPIs for harness/session detection and repository/worktree context, preserving environment precedence and path fallbacks. Exposeagentrepo harness detect,agentrepo harness session, and context plumbing needed by remaining scripts. Move the matching bats cases after parity checks.internal/gatesAPIs to fingerprint inputs, look up/store successful passes, and run gates with streamed output and preserved statuses. Exposeagentrepo gates runand cache plumbing; replacegates.pyand gate shell logic. Fold in Skills export LC_ALL=C into the repository gates they run, breaking UTF-8 tools such as Ansible #379: repository gates run in the caller's locale, with UTF-8 fallback when absent; C locale is scoped to internal text processing. Compare cache invalidation, command changes, dirty trees, failures and locale using the same fixtures.internal/review(reuse its existing process-group deadline runner) and addinternal/stamp: gather immutable inputs, build prompts, parse verdicts, validate freshness and atomically record bound stamps. Exposeagentrepo review snapshot|executeandagentrepo stamp verifyplumbing while per-workflow review entry points remain in transition. Fold in commit.sh's second review drops the operator note the first review was given #380: snapshot the operator note, pass the same note to both reviews and bind its digest; changed or removed notes invalidate approval. Verify timeout/tree killing never stamps, moved inputs, policy authority and refusal/status parity before removing shell implementations.internal/confirmationwith explicit operator flag -> session preapproval -> machine-selected delegation checker, preserving 0/1/75 and separate unattended delegation-only authorization. Exposeagentrepo confirmation resolveandagentrepo delegation check, plus bounded-round/reporting plumbing foragent.sh. Fold in the touched merge-policy diagnostics from devtools can't merge itself through agent-merge-pr: no agent-skills.conf, and the error hides why #378: safefail()messages reach stderr, identifying empty keys rather than printing only an exception type. Repository merge policy itself remains explicit repository data.internal/ghquotafor command execution, quota/reset diagnostics and identity checks without retrying writes or adding polling. Exposeagentrepo github run|identityfor remaining scripts. Preserve REST/GraphQL accounting and 76 on quota exhaustion using fake gh fixtures.internal/signingand its existing machine-only configuration, adding the skill-facing probe/ensure APIs andagentrepo signing probe|ensureadapters forsigning.sh. Preserve signing failures and partial-success reporting with fake tools plus real disposable SSH fixtures. Remove shared shell logic once every behavior has Go coverage; wrappers only set arguments/environment and exec one command. Coordinate subsequent transaction ports Move the commit and agent-commit scripts into agentrepo commit #322–Move the fix-prose and write-prose-fix scripts into agentrepo prose #327 with these APIs; do not introduce agentstore or agentcontext.For every PR, run old and new implementations on the same hermetic fixtures before removing the corresponding shell. Compare exit code, stdout, stderr, files written and refusals; use fake git/gh for failure producers and real scratch repositories/worktrees where filesystem and Git behavior matter. Keep the old configuration implementation as a frozen test fixture for repeatable phase-1 parity. Most tests exercise Go APIs in process; a small command/wrapper suite verifies wiring. Retain bats cases only for behavior not migrated yet, then delete each suite when its last behavior moves. Run platform-appropriate Go tests on Linux, macOS and Windows; shell parity runs where bash/awk are available. Each PR refreshes generated skills, tokens and lock output and passes
mise run lintandmise run test.Phase 1 will reference #321 without closing it. No merge or CI wait in this run.
refactor(skills): resolve shared configuration through agentrepo
fix(skills): preserve configuration lookup on older agentrepo
refactor(skills): resolve shared configuration through agentrepo
fix(skills): preserve configuration lookup on older agentrepo
refactor(skills): resolve shared configuration through agentrepo (#385)