[PR #16] [MERGED] [WIP] Fix template files not copied to cache directory #61

Closed
opened 2026-03-03 18:50:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OthmanAdi/planning-with-files/pull/16
Author: @Copilot
Created: 1/10/2026
Status: Merged
Merged: 1/10/2026
Merged by: @OthmanAdi

Base: masterHead: copilot/fix-template-files-copy


📝 Commits (1)

📄 Description

Fix Plugin Template and Script Bundling

Plan:

  • Add assets field to .claude-plugin/plugin.json to include templates and scripts
  • Update version from 2.1.0 to 2.1.1 in .claude-plugin/plugin.json
  • Update version from 2.1.0 to 2.1.1 in skills/planning-with-files/SKILL.md (line 3)
  • Add changelog entry for v2.1.1 in CHANGELOG.md
  • Verify all changes are correct

Changes Made:

  1. .claude-plugin/plugin.json:

    • Added assets array with 5 files (3 templates + 2 scripts)
    • Bumped version from 2.1.0 to 2.1.1
  2. skills/planning-with-files/SKILL.md:

    • Updated version from 2.1.0 to 2.1.1
  3. CHANGELOG.md:

    • Added new v2.1.1 section documenting the fix

Root Cause:

Template and script files existed in the repository but were not bundled during plugin installation because the plugin.json manifest lacked an assets field.

Expected Result:

After the fix, running /plugin install planning-with-files@planning-with-files will correctly copy all template and script files to the cache directory at ~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.1/, preventing "Error reading file" errors when Claude references ${CLAUDE_PLUGIN_ROOT}/templates/ or ${CLAUDE_PLUGIN_ROOT}/scripts/.

Original prompt

Bug Description

In version 2.1.0, when the plugin is installed via /plugin install planning-with-files@planning-with-files, the template files are not copied to the cache directory, causing "Error reading file" when Claude tries to use them.

Error locations reported:

  • ~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.0/templates/task_plan.md
  • ~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.0/templates/findings.md
  • ~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.0/templates/progress.md

Root Cause:
The .claude-plugin/plugin.json manifest does not include an assets field to specify which files should be bundled during plugin installation. The templates exist in the repo at skills/planning-with-files/templates/ but are not being packaged.

Files That Need Changes

1. .claude-plugin/plugin.json

Add an assets field to include templates and scripts:

{
  "name": "planning-with-files",
  "version": "2.1.0",
  "description": "...",
  "assets": [
    "skills/planning-with-files/templates/task_plan.md",
    "skills/planning-with-files/templates/findings.md",
    "skills/planning-with-files/templates/progress.md",
    "skills/planning-with-files/scripts/check-complete.sh",
    "skills/planning-with-files/scripts/init-session.sh"
  ]
}

Note: The scripts should also be included since SKILL.md references ${CLAUDE_PLUGIN_ROOT}/scripts/check-complete.sh in the Stop hook.

2. Version Bump

Update version to 2.1.1 in:

  • .claude-plugin/plugin.json
  • skills/planning-with-files/SKILL.md (line 3)

3. CHANGELOG.md

Add a new entry for v2.1.1 at the top documenting this fix:

## [2.1.1] - 2026-01-10

### Fixed

- **Template files not included in plugin package** - Added `assets` field to plugin.json to ensure templates and scripts are bundled during installation
- Templates (`task_plan.md`, `findings.md`, `progress.md`) now correctly copied to cache directory
- Scripts (`check-complete.sh`, `init-session.sh`) now correctly copied to cache directory
- Fixes "Error reading file" when accessing templates after `/plugin install`

Expected Behavior After Fix

After running /plugin install planning-with-files@planning-with-files:

  1. Template files should exist at ~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.1/skills/planning-with-files/templates/
  2. Script files should exist at ~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.1/skills/planning-with-files/scripts/
  3. No "Error reading file" when Claude references ${CLAUDE_PLUGIN_ROOT}/templates/ or ${CLAUDE_PLUGIN_ROOT}/scripts/

References

  • SKILL.md lines 44, 50, 58-60, 185-187, 193-194 reference ${CLAUDE_PLUGIN_ROOT}/templates/ and ${CLAUDE_PLUGIN_ROOT}/scripts/
  • Stop hook on line 33 references ${CLAUDE_PLUGIN_ROOT}/scripts/check-complete.sh
  • Claude Code plugin.json assets specification: https://code.claude.com/docs/en/plugins-reference

This pull request was created from Copilot chat.


Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OthmanAdi/planning-with-files/pull/16 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 1/10/2026 **Status:** ✅ Merged **Merged:** 1/10/2026 **Merged by:** [@OthmanAdi](https://github.com/OthmanAdi) **Base:** `master` ← **Head:** `copilot/fix-template-files-copy` --- ### 📝 Commits (1) - [`8cda623`](https://github.com/OthmanAdi/planning-with-files/commit/8cda623cbd62fa9c05d558b4474b531124a950b2) Initial plan ### 📄 Description ## Fix Plugin Template and Script Bundling ### Plan: - [x] Add `assets` field to `.claude-plugin/plugin.json` to include templates and scripts - [x] Update version from 2.1.0 to 2.1.1 in `.claude-plugin/plugin.json` - [x] Update version from 2.1.0 to 2.1.1 in `skills/planning-with-files/SKILL.md` (line 3) - [x] Add changelog entry for v2.1.1 in `CHANGELOG.md` - [x] Verify all changes are correct ### Changes Made: 1. **`.claude-plugin/plugin.json`**: - Added `assets` array with 5 files (3 templates + 2 scripts) - Bumped version from 2.1.0 to 2.1.1 2. **`skills/planning-with-files/SKILL.md`**: - Updated version from 2.1.0 to 2.1.1 3. **`CHANGELOG.md`**: - Added new v2.1.1 section documenting the fix ### Root Cause: Template and script files existed in the repository but were not bundled during plugin installation because the plugin.json manifest lacked an `assets` field. ### Expected Result: After the fix, running `/plugin install planning-with-files@planning-with-files` will correctly copy all template and script files to the cache directory at `~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.1/`, preventing "Error reading file" errors when Claude references `${CLAUDE_PLUGIN_ROOT}/templates/` or `${CLAUDE_PLUGIN_ROOT}/scripts/`. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > ## Bug Description > > In version 2.1.0, when the plugin is installed via `/plugin install planning-with-files@planning-with-files`, the template files are not copied to the cache directory, causing "Error reading file" when Claude tries to use them. > > **Error locations reported:** > - `~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.0/templates/task_plan.md` > - `~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.0/templates/findings.md` > - `~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.0/templates/progress.md` > > **Root Cause:** > The `.claude-plugin/plugin.json` manifest does not include an `assets` field to specify which files should be bundled during plugin installation. The templates exist in the repo at `skills/planning-with-files/templates/` but are not being packaged. > > ## Files That Need Changes > > ### 1. `.claude-plugin/plugin.json` > Add an `assets` field to include templates and scripts: > > ```json > { > "name": "planning-with-files", > "version": "2.1.0", > "description": "...", > "assets": [ > "skills/planning-with-files/templates/task_plan.md", > "skills/planning-with-files/templates/findings.md", > "skills/planning-with-files/templates/progress.md", > "skills/planning-with-files/scripts/check-complete.sh", > "skills/planning-with-files/scripts/init-session.sh" > ] > } > ``` > > Note: The scripts should also be included since `SKILL.md` references `${CLAUDE_PLUGIN_ROOT}/scripts/check-complete.sh` in the Stop hook. > > ### 2. Version Bump > Update version to `2.1.1` in: > - `.claude-plugin/plugin.json` > - `skills/planning-with-files/SKILL.md` (line 3) > > ### 3. CHANGELOG.md > Add a new entry for v2.1.1 at the top documenting this fix: > ```markdown > ## [2.1.1] - 2026-01-10 > > ### Fixed > > - **Template files not included in plugin package** - Added `assets` field to plugin.json to ensure templates and scripts are bundled during installation > - Templates (`task_plan.md`, `findings.md`, `progress.md`) now correctly copied to cache directory > - Scripts (`check-complete.sh`, `init-session.sh`) now correctly copied to cache directory > - Fixes "Error reading file" when accessing templates after `/plugin install` > ``` > > ## Expected Behavior After Fix > > After running `/plugin install planning-with-files@planning-with-files`: > 1. Template files should exist at `~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.1/skills/planning-with-files/templates/` > 2. Script files should exist at `~/.claude/plugins/cache/planning-with-files/planning-with-files/2.1.1/skills/planning-with-files/scripts/` > 3. No "Error reading file" when Claude references `${CLAUDE_PLUGIN_ROOT}/templates/` or `${CLAUDE_PLUGIN_ROOT}/scripts/` > > ## References > - SKILL.md lines 44, 50, 58-60, 185-187, 193-194 reference `${CLAUDE_PLUGIN_ROOT}/templates/` and `${CLAUDE_PLUGIN_ROOT}/scripts/` > - Stop hook on line 33 references `${CLAUDE_PLUGIN_ROOT}/scripts/check-complete.sh` > - Claude Code plugin.json assets specification: https://code.claude.com/docs/en/plugins-reference </details> <!-- START COPILOT CODING AGENT SUFFIX --> *This pull request was created from Copilot chat.* > <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/OthmanAdi/planning-with-files/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 18:50:23 +03:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/planning-with-files#61
No description provided.