Repository navigation
Description
Problem
uf init deploys 33 embedded Markdown files into every repository. Of these, 17 are tool-owned — identical across repos, auto-updated by uf init. The other 16 are user-owned (customized per repo, never overwritten). The tool-owned/user-owned split is already cleanly modeled in internal/scaffold/scaffold.go via the isToolOwned() function (line 286).
Centralizing the tool-owned files would reduce per-repo file counts, make version upgrades propagate instantly across repos, and keep git history focused on project-specific content.
Proposed Solution
Move tool-owned files to ~/.config/uf/scaffold/ (following XDG conventions, aligning with Replicator's existing ~/.config/uf/replicator/ path) and create symlinks from the repo.
What moves to XDG (17 files)
| Category | Count | Current Path | XDG Path |
|---|---|---|---|
| Commands | 6 | .opencode/command/*.md |
~/.config/uf/scaffold/command/*.md |
| Canonical packs | 5 | .opencode/uf/packs/{default,go,typescript,content,severity}.md |
~/.config/uf/scaffold/packs/*.md |
| Skills | 1 | .opencode/skill/speckit-workflow/SKILL.md |
~/.config/uf/scaffold/skill/... |
| Schemas | 5 | openspec/schemas/unbound-force/** |
~/.config/uf/scaffold/schemas/... |
What stays in the repo (16 files)
- All 12 agent persona files (
.opencode/agents/*.md) — user-owned, intentionally customized per repo - 4 custom convention pack stubs (
*-custom.md) — user-owned extension points
Implementation scope
The refactor touches exactly 3 files:
| File | Change |
|---|---|
internal/scaffold/scaffold.go |
Add xdgScaffoldDir(), mapAssetToXDGPath(), writeXDGFile(), ensureSymlink() helpers; modify Run() walk callback; add Linked to Result struct |
internal/scaffold/scaffold_test.go |
~8 modified tests, ~20 new tests (symlink creation, idempotency, fallback, migration) |
cmd/unbound-force/main.go |
Add --no-symlinks flag |
No new files. No new dependencies. All Go stdlib (os.Symlink, os.Readlink, os.Lstat, os.UserConfigDir, os.Remove).
Design constraints
- CI/CD workflows do not depend on
.opencode/files — unaffected - Convention pack gitignore must be per-file (
.opencode/uf/packs/go.mdis symlinked;go-custom.mdis tracked) - XDG path must be injectable via
XDGConfigDirfield in Options struct for testability - Concurrent
uf initis safe — XDG writes are deterministic per version
Additional Considerations
- The addition of a
uf synctool with profiles would be ideal for pulling from a central, authoritative, location (git repo, etc...)
Alternatives
- Implement the stack as composable lola components and allow the user to choose whether material is global or project local
Acceptance Criteria
- Implement symlink creation in the scaffold engine via
isToolOwned()seam - Store tool-owned files at
~/.config/uf/scaffold/ - Symlinks are gitignored; recreated by
uf initafter clone - Add fallback to file copying when symlinks fail (Windows without developer mode, network filesystems)
- Migrate existing deployments automatically on
uf init - Add
--no-symlinksflag for opt-out - OpenCode, Claude Code, and Cursor all follow symlinks transparently (verify)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity