From 31e266697247193852ba0c7f219f99e6297cc892 Mon Sep 17 00:00:00 2001 From: testtest126 <44771568+testtest126@users.noreply.github.com> Date: Mon, 13 Jul 2026 13:12:05 +0200 Subject: [PATCH] tests: derive expected file list from templates/; README: note dogfooding Code-review pass on the bootstrapped repo: - tests/install.bats derived the expected file set and the byte-identical checks from a hardcoded 6-file list, which silently contradicted the installer's headline property (copy list derived from templates/, add a file and it ships automatically). Replace both with a `template_dest` helper + `find templates/` derivation, so dropping a template in is covered end-to-end with nothing to hand-maintain. Verified: a new template is auto-covered, and the byte-identical check still goes red on a mismatch. - README: add a one-line "dogfooded" note now that the repo runs its own kit. No changes to install.sh behavior. shellcheck clean, bats 10/10. Co-Authored-By: Claude Opus 4.8 --- README.md | 3 +++ tests/install.bats | 33 +++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e455603..f604302 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,9 @@ repo is agent-ready. - **`docs/scaling.md`** — optional multi-agent coordination, for when one repo has many agents at once. Most projects never need it — and the kit says so. +> **Dogfooded:** this repo runs on its own kit — the `AGENTS.md`, adapters, and +> `memory/` at the root were produced by running `install.sh` on itself. + ## Deep dives The reasoning underneath the kit, at maximum technical depth — for developers and diff --git a/tests/install.bats b/tests/install.bats index 2908546..13dd38e 100644 --- a/tests/install.bats +++ b/tests/install.bats @@ -12,15 +12,23 @@ teardown() { rm -rf "$WORK" } +# Map a template's absolute path to the path install.sh should produce, relative +# to the target (adapters/* land at the target root — same rule as the installer). +template_dest() { + rel="${1#"$KIT"/templates/}" + case "$rel" in + adapters/*) rel="${rel#adapters/}" ;; + esac + printf '%s\n' "$rel" +} + +# The full set of expected files, derived from templates/ rather than hardcoded. +# Kept dynamic on purpose: drop a file into templates/ and both the installer and +# these tests cover it, with nothing to hand-maintain here. expected_files() { - cat <<'EOF' -AGENTS.md -CLAUDE.md -.github/copilot-instructions.md -.cursor/rules/agents.mdc -memory/MEMORY.md -memory/EXAMPLE.md -EOF + find "$KIT/templates" -type f | sort | while IFS= read -r src; do + template_dest "$src" + done } @test "fresh install copies every expected file" { @@ -33,12 +41,9 @@ EOF @test "installed files are byte-identical to their templates" { "$INSTALL" "$WORK" >/dev/null - diff "$WORK/AGENTS.md" "$KIT/templates/AGENTS.md" - diff "$WORK/CLAUDE.md" "$KIT/templates/adapters/CLAUDE.md" - diff "$WORK/.github/copilot-instructions.md" "$KIT/templates/adapters/.github/copilot-instructions.md" - diff "$WORK/.cursor/rules/agents.mdc" "$KIT/templates/adapters/.cursor/rules/agents.mdc" - diff "$WORK/memory/MEMORY.md" "$KIT/templates/memory/MEMORY.md" - diff "$WORK/memory/EXAMPLE.md" "$KIT/templates/memory/EXAMPLE.md" + while IFS= read -r src; do + diff "$WORK/$(template_dest "$src")" "$src" || return 1 + done < <(find "$KIT/templates" -type f) } @test "default target is the current directory" {