Bugfix spec: the-loop duplicates its internal templates into every project
Phase 1 of 3 for a bug (bugfix → design → tasks).
Summary
When /the-loop:init runs in a project, it copies the whole template set into that project's .the-loop/templates/ directory (e.g. https://github.com/MadaraUchiha-314/alter-ego/tree/main/.the-loop/templates). These templates are internal to the-loop — the harness reads them when it authors an artifact — so materializing them in every consuming repo produces duplicated, noisy, never-edited files that drift from the plugin's own copy. Tracked as issue #36.
Steps to reproduce
- Install the-loop as a plugin.
- Run
/the-loop:initin a fresh project repository. - Inspect the project:
.the-loop/templates/now holds ~18 copied template files that the user never authored and does not maintain.
Expected vs actual
- Expected:
/the-loop:initscaffolds only the project's own artifacts (config, manifest, user-owned registries, docs/learnings skeleton). Templates stay inside the plugin and are read from there when needed. - Actual: the whole template set is duplicated into
.the-loop/templates/in every project the-loop is initialized in.
Root cause (confirmed)
.the-loop/manifest.yaml listed the templates under a templates: section and commands/init.md step 2 instructed init to create .the-loop/templates/ in the target repo. Commands and config referenced templates by the repo-relative path .the-loop/templates/..., which only resolves because init had copied them in.
Acceptance criteria (EARS)
- WHEN
/the-loop:initruns in a project THEN the system SHALL NOT create a.the-loop/templates/directory in that project. - The templates SHALL live with the plugin under
skills/the-loop/templates/and be read from${CLAUDE_PLUGIN_ROOT}when an artifact is authored. - WHEN
/the-loop:upgrade-the-loopruns on a project that an older version scaffolded a.the-loop/templates/folder into THEN the system SHALL remove that folder, confirming first only if the user added their own files under it. - All command/skill/config references to templates SHALL point at the internal
skills/the-loop/templates/location; runtime consumers with a built-in fallback (the webhook dispatcher) SHALL keep working when the path is absent in a project repo.
Out of scope
- Restructuring the artifact chain or the templates' contents.
- Changing how user-owned files (
config.yaml,collaborators.yaml,external-tools.md) are scaffolded — these are still created per project, just read from the internal template location.
Open questions
None.