feat: drop the kettle plugin; the binary writes its own skills

The plugin and the binary shipped on two release cadences and nothing on an
operator's machine ever checked that the one they installed described the other.
The generated flag block existed precisely so a renamed flag could not ship with
documentation recommending the old one — and then shipped one version behind the
registry it came from, which is the same bug one hop downstream.

So the prose moved into the binary. `internal/scaffold` embeds every document;
`kettle init` and `kettle gen scaffold` write them into a project's own
`.claude/`. The two cannot disagree because there is one artefact.

The namespace survived the move. A project's skills are flat, so the prefix is
spelled into the directory name (`kettle-issue`); a project's *commands* take
their namespace from a subdirectory, so `commands/kettle/init.md` is still
`/kettle:init`. Four of the six command files are thin pointers at a skill, and
that is what kept ~1,600 lines of `/kettle:…` cross-references true without a
rewrite. `init` and `auth` lost `disable-model-invocation: true` — being a
command is that property — and `auth` now restricts `allowed-tools` so a model
cannot reach `kettle auth add` at all.

`gen scaffold` writes files whole rather than splicing a region. The old
refusal protected somebody's hand-written prose around the block; that prose is
embedded now, so there is none to protect, and preserving local edits would
freeze a project's documentation at whatever version first initialized it.
`--check` warns before an upgrade discards one.

The plugin's `agents-sync.sh` — 141 lines of Python behind a filename that said
`.sh` — became `internal/mirror` and `kettle mirror`. Same seven branches, same
refusal to merge two real files that differ, now with a table test per branch
and a check that a repair converges in one pass. `--hook` is the PreToolUse
form and exits 0 on every path including a panic. It is opt-in per project,
which is strictly narrower than the plugin hook that was on for everybody who
installed it.

`kettle init --interactive` walks a person through the login, the token (read
with the echo off, so it lands in no history and no file), the repository, the
`.claude/` tree and the mirror hook. It refuses a stdin that is not a terminal
and names the flags instead: every question it asks has one, and it performs
nothing itself, so an interactive run and a flag run are one code path.

Two rules that used to be prose are now the binary's: init refuses a linked
worktree and names the main checkout, and writing into an existing
`.claude/settings.json` is refused with the snippet printed rather than
reformatting a file the operator commits.

The scaffold version stamp went to its own `.kettle/scaffold.yaml` rather than
into `config.yaml`, because unknown keys there are a hard error and that file
may be committed and read by whatever build each machine has.

golang.org/x/term becomes a direct dependency; it was already in the tree
indirectly, so no module was added.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
naudachu
2026-08-12 16:17:24 +05:00
parent f18a633185
commit 8b1b11001a
445 changed files with 231172 additions and 1339 deletions
+59
View File
@@ -0,0 +1,59 @@
package scaffold
import (
"os/exec"
"strings"
"testing"
)
// This package is prose and a table of contents. It hands out embedded bytes and
// says which of them carry a generated region; it renders nothing, resolves
// nothing and reads no file off the disk.
//
// That matters because of what sits above it: internal/cmd imports this to write
// a project's `.claude/` tree, and if this package imported the registry back the
// two would be a cycle. The dependency walk, so a helper pulled in three packages
// deep is caught as the same violation as one written at the top of a file.
func TestScaffoldDependsOnNothing(t *testing.T) {
out, err := exec.Command("go", "list", "-deps", ".").Output()
if err != nil {
t.Fatalf("go list: %v", err)
}
for _, dep := range strings.Fields(string(out)) {
if dep == "git.noodles.cam/claude-skills/marketplace/cli/internal/scaffold" {
continue
}
// A standard-library import path has no dot in its first element,
// because it has no domain name in front of it.
if first, _, _ := strings.Cut(dep, "/"); strings.Contains(first, ".") {
t.Errorf("scaffold imports %s — these are embedded documents, and nothing else belongs here", dep)
}
}
}
// The other half: os and net/http are standard library, so "no third-party
// imports" would not catch a read off the disk written by hand here. The whole
// premise is that these documents travel INSIDE the binary — one os.ReadFile and
// they are back to being files on a machine that may not have them.
//
// DIRECT imports, not the dependency walk — embed reaches io/fs on its own, and
// the question this asks is what THIS package reaches for.
func TestScaffoldReadsNothingOffTheDisk(t *testing.T) {
forbidden := map[string]string{
"os": "these documents are embedded; a file read here is a file that can be missing",
"os/exec": "nothing here shells out",
"net/http": "nothing here is fetched",
"net": "nothing here is fetched",
"time": "a document has no clock in it",
}
out, err := exec.Command("go", "list", "-f", `{{join .Imports "\n"}}`, ".").Output()
if err != nil {
t.Fatalf("go list: %v", err)
}
for _, dep := range strings.Fields(string(out)) {
if why, bad := forbidden[dep]; bad {
t.Errorf("scaffold imports %s — %s", dep, why)
}
}
}