feat(001): skillrig init + single origin resolver#3
Conversation
First feature spec for the skillrig CLI: `skillrig init` plus the single origin-resolution primitive (env > project config > global default). Offline config bootstrap only — search/add/verify/lockfile/network and origin bootstrapping are explicitly out of scope. Includes prioritized user stories (bind / precedence / actionable failure), functional requirements, measurable success criteria, and a Constitution Alignment section (Quickstart-as-Contract, Ground-Truth Anchoring, Skill-CLI Co-Evolution). Quality checklist passed on first iteration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…(001) Resolve reviewer comments via SpecLedger review: - Spec stays command-agnostic; concrete command surface decided at plan (research + quickstart.md), grounded in architecture.md and cli.md. - Origin binding is origin-only: prompt-if-missing in interactive sessions, non-interactive when supplied (FR-006a); no extra onboarding metadata such as repo tags (FR-006b) — deferred to a later version. - No dedicated config command; config file is hand-editable input, detailed structure documented on the docs website (referenced). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 0/1 planning output: plan.md (Go + spf13/cobra + go-toml/v2, single ResolveOrigin per AP-06, init = Environment pattern), research.md (10 resolved decisions), data-model.md (config.toml ground-truth fixture + 7-row precedence matrix), contracts/ (init command surface + resolver contract), and quickstart.md (executable TestQuickstart_*/TestResolveOrigin_* scenarios with output-shape assertions, per Constitution II). Also harvest the additive (non-conflicting) ideas from agentic-cli-design into docs/design/cli.md as a "Borrowed Ideas (vNext)" section — machine introspection, install-skills, scorecard — noting cli.md stays authoritative where they conflict (exit codes, JSON-default, prose errors). Bind project to the SpecLedger web app (project id) and refresh CLAUDE.md agent context. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Install the Go-focused agent skills used to build this CLI (golang-cli, golang-spf13-cobra, golang-testing, golang-code-style, golang-lint from samber/cc-skills-golang) and record them in skills-lock.json. The agentic-cli-design skill was intentionally removed after harvesting its additive ideas into docs/design/cli.md, to keep cli.md authoritative during implementation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Empty commit to re-fire the SpecLedger GitHub App webhook after it failed to parse the newly added plan.md/research.md/data-model.md/contracts/quickstart.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… (001) Revise research.md per crit review: D2 (XDG OS/shell support + os.UserHomeDir, adrg/xdg deferred), D3 (git is a fair baseline — git-root write, fs walk-up resolve), D4 (explicit --non-interactive flag + flag/prompt model), D9 (POSIX same-fs + Windows MoveFileEx atomic-write caveats), D10 (viper evaluated and rejected for v0; TOML supported; cobra/viper/huh orthogonal). Add spike S1 (research/2026-05-24-interactive-prompt-library.md): measured stripped-binary deltas (stdlib +0, promptui +768B, survey +0.23MB/+39 mods, huh +0.61MB/+39 mods) → use stdlib bufio for v0, defer charmbracelet/huh (v1.0.0, accessible mode) to a future multi-field flow. D5 resolved. plan.md + CLAUDE.md: Go 1.24+ (toolchain is 1.24.4) per review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add the crit review/plan-review/code-review agent skills installed via `crit setup-claude` (kevindutra/crit, the Go review TUI) so the inline-review workflow travels with the repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Epic SL-227789 + 6 phases (Setup, Foundational, US1, US2, US3, Polish) and 18 tasks in the sl issue store (issues.jsonl), linked into a blocking graph. Tests are first-class per Constitution II (quickstart scenarios -> failing Go tests before impl; DoD = scenarios match stories + tests pass); includes ground-truth fixtures (III), the skillrig-init agent skill (IX), and the gofmt/vet/golangci-lint gate (V). tasks.md is the navigational index. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…, git-root write target, traceability Cross-artifact verification of the init & origin-resolution feature surfaced seams between the init task design and the contract/quickstart. Resolved: - FR-006c: explicit force-non-interactive mode (flag) — fail fast instead of prompting even on a TTY. Added to spec (US3 scenario 4), contract, and quickstart (TestQuickstart_NonInteractiveFlag). - git-root write target: documented offline `git rev-parse --show-toplevel` resolution + cwd fallback in contract/data-model; declared `git` a required dependency in plan; added TestQuickstart_BindFromGitSubdir / BindNonGitCwdFallback and a dedicated git-fixture task (SL-3b4985, with a scope-boundary note on the harness task SL-4958e2). - traceability: backfilled requirement: labels across tasks. - naming: clarified spec "bind command" -> `skillrig init` (no config command). - saved analysis to specledger/001-init-origin-resolution/reviews/001-review.md. Also adds the `kevindutra/crit` review tool to mise.toml. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deliver the first slice of the skillrig CLI: `skillrig init` (Environment pattern) binds a repo or per-user global default to an OWNER/REPO origin, plus the single ResolveOrigin primitive (AP-06) with precedence SKILLRIG_ORIGIN > project > global. - cobra root with --json/--verbose, errors-as-navigation, load-bearing exit codes - atomic config.toml read/write (go-toml/v2), git-root write target + cwd fallback - idempotent re-bind, TTY-gated stdlib prompt, --non-interactive fail-fast (FR-006c) - 11 TestQuickstart_* E2E (build+exec) + TestResolveOrigin precedence matrix + unit tests - skillrig-init agent skill (Constitution IX) + trigger eval-set; README usage docs - full gate green: gofmt/vet/golangci-lint clean, go test ./... passing All 19 tasks closed under epic SL-227789. Fixture/docs anchored to real go-toml/v2 output (single-quote TOML literal; review finding G1). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… gaps Resolve the post-implementation checkpoint findings on the origin resolver so a future --verbose caller can never mistake a silent skip for intended behavior. - config.MalformedError: typed, unwrappable. Load returns it for parse failures and a plain wrapped error for genuine I/O failures, so callers distinguish a skippable malformed file from a fatal read error (FR-004 / contract resolve.md). - ResolveOrigin: add ResolutionResult.Diagnostics ([]SourceDiagnostic). New originFromFile classifies each source into four honest outcomes — usable / skippable-with-diagnostic (malformed or invalid origin) / quiet fall-through (absent or origin-less) / fatal I/O — replacing usableOrigin which collapsed everything (including I/O errors) to (zero, false). Diagnostics accumulate regardless of the final Source. - Tests: malformed-project, invalid-shape, origin-less, unreadable-fatal, unreadable-project-fatal-despite-global (A3), and malformed-SKILLRIG_ORIGIN hard-error (A1); TestLoadMalformedErrors asserts errors.As(*MalformedError). - Remove dead Origin.IsZero() (A4 — no callers). - Reconcile research.md D9 to the shipped 0o600/0o750 perms (self-review #2). - contracts/resolve.md + data-model.md document Diagnostics and the malformed-vs-fatal split, with a "never re-introduce a silent skip" note. Gate green: go test ./... · gofmt · go vet · golangci-lint (0 issues). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Record the post-implementation divergence review, the independent fresh-eyes adversarial review, and the disposition of every finding (A1–A6 + self-review divergences). All resolved or justified-and-deferred; tracker is 0 open / 0 force-closed (47/47 DoD items checked). issues.jsonl carries the A5 clarifying note on SL-db8e96 (interactive-prompt test relocated in-process). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
/agentic_review |
Code Review by Qodo
1. Checkbox task list in plan.md
|
…igin String, scope todo rule Resolve the three real bugs from the Qodo PR review (#2/#3/#4); #1 dismissed as a false positive with an AGENTS.md clarification. - #2 FindProjectConfig now returns (string, bool, error): a non-fs.ErrNotExist stat failure (e.g. permission denied on an ancestor .skillrig dir) is surfaced as fatal instead of masked as "not found"; ResolveOrigin fails fast. Closes the discovery-stage gap symmetric to Load's I/O-fatal path. - #3 Origin.String() returns "" for the zero Origin (the SourceNone sentinel) instead of a misleading "/"; precedence test compares directly. - #4 gitRoot returns (string, error); ProjectWriteTarget falls back to cwd ONLY for expected cases (git absent / not a repo) and propagates unexpected errors (context cancellation/timeout, exec failures), so init never writes config to the wrong directory. - #1 (markdown checkbox rule violation): false positive — the cited checkboxes are /specledger in-document spec/plan checklists, not work tracking. AGENTS.md reworded to scope the rule to work-item tracking and explicitly allow them. Tests (TDD, real fixtures): zero-origin String, permission-denied walk-up fatal, cancelled-ctx write-target fatal, non-repo cwd fallback preserved. Gate green: go test ./... · gofmt · go vet · golangci-lint (0 issues). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review findings addressed (commit d95b830)
All fixes are TDD with real-filesystem tests (no mocks). Gate green: |
Summary
First slice of the
skillrigCLI: theskillrig initcommand (Environment pattern) that binds a repo (or a per-user global default) to anOWNER/REPOorigin, plus the singleconfig.ResolveOriginprimitive (AP-06) every later command will use. Offline config bootstrap only — no network, no consuming commands.skillrig init— binds the origin into.skillrig/config.tomlat the git repo root (offlinegit rev-parse, cwd fallback);--global,--json,--non-interactive; idempotent re-bind; TTY-gated stdlib prompt; errors-as-navigation (what/why/fix) with load-bearing exit codes.ResolveOrigin— precedenceSKILLRIG_ORIGIN> project (walk-up) > global; blank-env-unset; malformed sources skipped and surfaced viaResolutionResult.Diagnostics; genuine I/O errors fatal (typedconfig.MalformedError)..golangci.yml, README, and theskillrig-initagent skill (Constitution IX).Tests & gate
TestQuickstart_*E2E (build + exec the real binary) +TestResolveOrigin_*precedence matrix (rows 1–7 + FromSubdir + diagnostics/fatal cases) + unit tests.go test ./...green ·gofmtclean ·go vetclean ·golangci-lint0 issues.Review trail
Implemented per
/specledger.implement; reviewed via/specledger.checkpoint(self-review) and an independent fresh-eyes adversarial pass. Full disposition insessions/001-init-origin-resolution-checkpoint.md.Tracker: 26 closed, 0 open, 0 force-closed (47/47 DoD items checked). No CRITICAL/HIGH findings.
All review findings resolved or justified, including post-review fixes in this PR:
MalformedError.SKILLRIG_ORIGINhard-error test (A1); deadOrigin.IsZero()removed (A4); research.md D9 perms reconciled (0o600/0o750).Conscious decisions
origin = 'my-org/my-skills', go-toml/v2 default); fixture/docs anchored to real output (review G1).Deferred to the next feature (no actionable surface in this slice; justified in the log)
ResolveOrigin'sSource==nonerender +Diagnostics--verboseto the first consuming command (search/add/verify). The resolver ships as a tested primitive with no production caller, by design (spec Out of Scope).🤖 Generated with Claude Code