Skip to content

Fix: manifest-based selective installation for skills setup#10

Open
sgbett wants to merge 1 commit intocodenamev:mainfrom
bettison-org:main
Open

Fix: manifest-based selective installation for skills setup#10
sgbett wants to merge 1 commit intocodenamev:mainfrom
bettison-org:main

Conversation

@sgbett
Copy link
Contributor

@sgbett sgbett commented Feb 14, 2026

Summary

Fixes the skills-based installation which currently copies the entire .architecture/ directory (40+ framework-internal files) into target projects. Replaces with a manifest-based approach that copies only what a new project needs.

  • Add .install-manifest declaring exactly what to install (templates, agent_docs, empty directories, config)
  • Add install-framework.sh deterministic script: clones to /tmp, reads manifest, copies only listed items
  • Add next-adr-number.sh for deterministic ADR numbering (sequential and date-based)
  • Update SKILL.md: members.yml and principles.md created from scratch by the skill, not copied
  • Add CI tests: manifest success path, idempotency, cruft leak checks, ADR numbering

This implements ADR-009 (Script-Based Deterministic Operations) — the installation was the highest-stakes deterministic operation, and the trigger condition ("bash command construction causes bugs") was hit during real-world setup attempts.

What changed

File Change
.install-manifest New — declares what to copy to target projects
scripts/install-framework.sh New — deterministic manifest-based installer
scripts/next-adr-number.sh New — deterministic ADR numbering
setup-architect/SKILL.md Updated — create members/principles from scratch
installation-procedures.md Rewritten — documents new script interface
_patterns.md Updated — documents script-based pattern
claude-code-tests.yml Updated — manifest-based tests with cruft checks
config.yml / templates/config.yml Updated — ADR numbering options
create-adr/SKILL.md Updated — uses next-adr-number.sh

Test plan

  • CI passes (12/12 checks green)
  • Installed project contains only: templates/, agent_docs/, config.yml, empty directories
  • Installed project does NOT contain: framework ADRs, reviews, comparisons, research, deferrals.md
  • Idempotent: running setup twice preserves existing config
  • ADR numbering: sequential (default, custom padding) and date-based modes

Closes #9

🤖 Generated with Claude Code

* feat: extract deterministic operations into shell scripts (#2)

* feat: add install-framework.sh for deterministic installation

Shell script handling all file operations for the setup-architect
skill: prerequisites check, framework file copy (using the exact
PR codenamev#5 path), clone removal, directory creation, config initialisation,
doc cleanup, and safe .git removal with all 5 safeguards.

Structured status tokens on stdout, errors on stderr, and specific
exit codes for each failure mode. This replaces LLM-interpreted
bash commands that caused repeated installation failures.

First implementation of ADR-009 (script-based deterministic operations).
Trigger condition met: bash command construction caused bugs (codenamev#4/codenamev#5).

Refs codenamev#8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add next-adr-number.sh for deterministic ADR prefix generation

Shell script that reads numbering config from .architecture/config.yml
and returns the correct ADR prefix. Supports sequential (zero-padded)
and date-based (strftime format) numbering.

Config options:
  numbering_format: sequential | date-based
  sequential_format: "000"   (zero-padding width, default: 3 digits)
  date_format: "%Y%m%d"      (strftime format, default: YYYYMMDD)

Includes collision detection: exits non-zero if an ADR with the same
prefix and topic already exists, alerting the user to a likely duplicate.

Supersedes PR codenamev#7 which documented date-based numbering as LLM-interpreted
instructions — this makes the config deterministic.

Refs codenamev#8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add sequential_format and date_format ADR config options

Expand ADR numbering configuration with explicit format strings:
- sequential_format: zero-padding pattern ("000" = 3 digits)
- date_format: strftime format string ("%Y%m%d" = YYYYMMDD)

Both are commented out with sensible defaults, making them
self-documenting. Backward compatible with existing
numbering_format: sequential | date-based.

Refs codenamev#8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: restructure setup-architect to use install script

Collapse 9-step workflow to 7 steps by replacing the three
deterministic steps (prerequisites, install, cleanup) with a single
invocation of install-framework.sh.

Project analysis now runs first (before installation) so the LLM
knows the tech stack before customisation begins.

All file operations are now handled by the script — the skill
only handles interpretive work (project analysis, team customisation,
principles, initial analysis, reporting).

Refs codenamev#8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: replace inline bash with script interface docs

Remove ~250 lines of bash code blocks from installation-procedures.md
that are now handled by install-framework.sh. Replace with script
interface documentation (arguments, exit codes, status tokens),
troubleshooting, and recovery procedures.

The reference file's role changes from "instructions for the LLM to
interpret" to "documentation for when things go wrong."

Refs codenamev#8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use American English spelling in upstream project files

British spellings (customise, analyse, initialise, prioritise) were
incorrectly introduced from personal CLAUDE.md preferences. This is an
upstream project that uses American English throughout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: replace inline ADR numbering with next-adr-number.sh

The create-adr skill now invokes the deterministic numbering script
instead of constructing bash commands inline. This ensures config
options (numbering_format, sequential_format, date_format) are always
respected, and adds collision detection for duplicate ADR topics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add script-based deterministic operations pattern

Documents the pattern for extracting deterministic operations into shell
scripts, first implementation of ADR-009. Includes when-to-script
criteria, interface conventions, script location conventions, and the
background that triggered implementation. Also updates create-adr
permission scope in the permissions table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add CI tests for install-framework.sh and next-adr-number.sh

Tests the actual scripts deterministically rather than simulating what
the LLM might do. Covers:

install-framework.sh:
- Success path (copy, cleanup, verify)
- Missing clone (exit 1)
- Relative path rejection (exit 1)

next-adr-number.sh:
- Sequential default (001, 002, 003)
- Sequential custom padding (0001)
- Date-based default (%Y%m%d)
- Date-based custom format (%Y-%m-%d)
- Collision detection (exit 2)
- Missing config falls back to defaults

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix: replace blind copy with manifest-based selective installation

The install script was copying the entire .architecture/ directory from
the cloned repo (40+ framework-internal files including ADRs, reviews,
comparisons, research docs) into target projects. Only templates and
agent docs are needed.

Changes:
- Add .install-manifest declaring exactly what to install
- Rewrite install-framework.sh: clone to /tmp, read manifest, copy
  only listed items, trap-based cleanup
- Remove triple-nesting clone path (.architecture/.architecture/.architecture/)
- SKILL.md: members.yml and principles.md created from scratch by skill,
  not copied from repo
- Update CI tests for manifest-based approach with cruft leak checks

Closes #1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skills-based setup copies framework's own files into target projects

1 participant