BUILD-INSTRUCTIONS — fix/untrack-operator-root-files (#340)
BUILD-INSTRUCTIONS — fix/untrack-operator-root-files (#340)
Section titled “BUILD-INSTRUCTIONS — fix/untrack-operator-root-files (#340)”Created: 2026-03-22 Issue: #340 Purpose: Untrack operator custom root files so branch switches stop clobbering them
Rules for Harley
Section titled “Rules for Harley”- Run steps in order, one at a time
- Confirm each result before moving to the next
- Report any failures to operator immediately
- Do NOT merge any PRs — operator merges
Step 0 — Verify starting state
Section titled “Step 0 — Verify starting state”Regardless of what branch you’re on, get to a clean state:
cd /mnt/d/scaffolder-enginegit statusIf there are uncommitted changes to tracked files, stash them:
git stashIf git status shows the 4 operator files as modified (CLAUDE.md, STANDARDS.md, PROJECT-INSTRUCTIONS.md, RELEASE-CHECKLIST.md), that’s expected — they’re still tracked and differ from the repo versions. Do NOT stash these. Proceed.
Checkout dev and pull latest:
git checkout devgit pull origin devConfirm you are on dev:
git branch --show-currentExpected: dev
Step 1 — Create fix branch from dev
Section titled “Step 1 — Create fix branch from dev”git checkout -b fix/untrack-operator-root-files devConfirm:
git branch --show-currentExpected: fix/untrack-operator-root-files
Step 2 — Update .gitignore
Section titled “Step 2 — Update .gitignore”Add the operator custom root file rules to .gitignore. Insert these lines
after the .claude/settings.local.json line and before the templates/engine-root/ line:
# Operator custom root files — local working copies# Generic product versions live in templates/project-root/# The engine-root swap uses git add -f to force-commit generic versions for PRsCLAUDE.mdSTANDARDS.mdPROJECT-INSTRUCTIONS.mdRELEASE-CHECKLIST.mdAlso update the ai-sessions comment from:
# Session state — operator-specific, not part of the productto:
# Session state — operator-specific, local only, NO git operationsConfirm the edit:
cat .gitignoreStep 3 — Remove files from git tracking
Section titled “Step 3 — Remove files from git tracking”This removes the files from git’s index (tracking) but keeps them on disk:
git rm --cached CLAUDE.md STANDARDS.md PROJECT-INSTRUCTIONS.md RELEASE-CHECKLIST.mdConfirm they’re still on disk:
ls -la CLAUDE.md STANDARDS.md PROJECT-INSTRUCTIONS.md RELEASE-CHECKLIST.mdConfirm git no longer tracks them:
git statusExpected: The 4 files should NOT appear as untracked (gitignore hides them). The .gitignore change and the 4 deleted-from-index files should show as staged.
Step 4 — Commit
Section titled “Step 4 — Commit”git add .gitignoregit commit -m "fix: untrack operator custom root files (closes #340)"Step 5 — Push and create PR to dev
Section titled “Step 5 — Push and create PR to dev”git push origin fix/untrack-operator-root-filesCreate PR:
gh pr create --base dev --head fix/untrack-operator-root-files --title "fix: untrack operator custom root files" --body "## Summary
Removes CLAUDE.md, STANDARDS.md, PROJECT-INSTRUCTIONS.md, and RELEASE-CHECKLIST.md from git tracking so branch switches stop overwriting operator custom versions with generic product versions.
Closes #340. Replaces the incomplete approach from PR #324.
## What changed
- \`.gitignore\`: Added rules to ignore the 4 operator custom root files- \`git rm --cached\`: Removed the 4 files from the index (files stay on disk)
## Why the hotfix approach failed
PR #324 added gitignore rules via hotfix to main only. But gitignore only protects **untracked** files. Since dev and staging still tracked them, branch switches restored tracked versions and destroyed local copies.
## How this works
The fix branch merges to dev first, then flows through staging → main via normal release. Each merge propagates the untrack commit, so all three branches end up with the files untracked.
## Test plan
After merging to dev:- [ ] Verify the 4 files are untracked on dev (\`git ls-files CLAUDE.md\` returns nothing)- [ ] Verify the files still exist on disk- [ ] After full release flow (dev → staging → main): branch switches between all three do not touch operator files- [ ] \`git add -f CLAUDE.md\` still works (engine-root swap)"Step 6 — Report results
Section titled “Step 6 — Report results”Tell operator:
- Branch created and pushed
- PR number and URL
- Ready for operator to merge
STOP HERE. Do not merge. Do not proceed to other work.