Skip to content

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

Merged
OthmanAdi merged 1 commit intomasterfrom
copilot/fix-template-files-copy
Jan 10, 2026
Merged

[WIP] Fix template files not copied to cache directory#16
OthmanAdi merged 1 commit intomasterfrom
copilot/fix-template-files-copy

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

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.

@OthmanAdi OthmanAdi marked this pull request as ready for review January 10, 2026 18:04
@OthmanAdi OthmanAdi merged commit 411dee7 into master Jan 10, 2026
1 check failed
Copilot AI requested a review from OthmanAdi January 10, 2026 18:04
Copilot stopped work on behalf of OthmanAdi due to an error January 10, 2026 18:04
Copy link
Owner

@OthmanAdi OthmanAdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit authorized

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.

2 participants