From dcb92c0a64215bbfd55d8314fa04d69cccbcd05e Mon Sep 17 00:00:00 2001 From: OthmanAdi Date: Sun, 11 Jan 2026 21:47:04 +0100 Subject: [PATCH] fix: add root-level templates/scripts for CLAUDE_PLUGIN_ROOT resolution (v2.1.2) Fixes #18 - Templates not found in cache after update Root cause: ${CLAUDE_PLUGIN_ROOT} resolves to repo root, but templates were only in subfolders (planning-with-files/ and skills/planning-with-files/). Solution: Added templates/ and scripts/ at repo root level so they're accessible regardless of how CLAUDE_PLUGIN_ROOT resolves. Changes: - Add templates/ directory at repo root - Add scripts/ directory at repo root - Bump version to 2.1.2 in all manifests - Update CHANGELOG with fix details - Update troubleshooting.md with cache clearing instructions - Update README file structure diagram Co-Authored-By: Claude Opus 4.5 --- .claude-plugin/plugin.json | 2 +- CHANGELOG.md | 26 ++++++ README.md | 19 ++-- docs/troubleshooting.md | 33 +++++++ planning-with-files/SKILL.md | 2 +- scripts/check-complete.sh | 44 ++++++++++ scripts/init-session.sh | 120 +++++++++++++++++++++++++ skills/planning-with-files/SKILL.md | 2 +- templates/findings.md | 95 ++++++++++++++++++++ templates/progress.md | 114 ++++++++++++++++++++++++ templates/task_plan.md | 132 ++++++++++++++++++++++++++++ 11 files changed, 580 insertions(+), 9 deletions(-) create mode 100644 scripts/check-complete.sh create mode 100644 scripts/init-session.sh create mode 100644 templates/findings.md create mode 100644 templates/progress.md create mode 100644 templates/task_plan.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index e00b0ff..d7453df 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "planning-with-files", - "version": "2.1.1", + "version": "2.1.2", "description": "Manus-style persistent markdown files for planning, progress tracking, and knowledge storage. Includes hooks for automatic plan re-reading and completion verification. Use when starting complex tasks, multi-step projects, research tasks, or when you want structured output.", "author": { "name": "OthmanAdi", diff --git a/CHANGELOG.md b/CHANGELOG.md index e18bc89..7e9c53f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,32 @@ All notable changes to this project will be documented in this file. +## [2.1.2] - 2026-01-11 + +### Fixed + +- **Template Files Not Found in Cache** (Fixes #18) + - Root cause: `${CLAUDE_PLUGIN_ROOT}` resolves to repo root, but templates were only in subfolders + - Added `templates/` and `scripts/` directories at repo root level + - Now templates are accessible regardless of how `CLAUDE_PLUGIN_ROOT` resolves + - Works for both plugin installs and manual installs + +### Structure + +After this fix, templates exist in THREE locations for maximum compatibility: +- `templates/` - At repo root (for `${CLAUDE_PLUGIN_ROOT}/templates/`) +- `planning-with-files/templates/` - For plugin marketplace installs +- `skills/planning-with-files/templates/` - For legacy `~/.claude/skills/` installs + +### Workaround for Existing Users + +If you still experience issues after updating: +1. Uninstall: `/plugin uninstall planning-with-files@planning-with-files` +2. Reinstall: `/plugin marketplace add OthmanAdi/planning-with-files` +3. Install: `/plugin install planning-with-files@planning-with-files` + +--- + ## [2.1.1] - 2026-01-10 ### Fixed diff --git a/README.md b/README.md index cf18612..a4ff0a6 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ A Claude Code plugin that transforms your workflow to use persistent markdown fi [![Claude Code Plugin](https://img.shields.io/badge/Claude%20Code-Plugin-blue)](https://code.claude.com/docs/en/plugins) [![Claude Code Skill](https://img.shields.io/badge/Claude%20Code-Skill-green)](https://code.claude.com/docs/en/skills) [![Cursor Rules](https://img.shields.io/badge/Cursor-Rules-purple)](https://docs.cursor.com/context/rules-for-ai) -[![Version](https://img.shields.io/badge/version-2.1.1-brightgreen)](https://github.com/OthmanAdi/planning-with-files/releases) +[![Version](https://img.shields.io/badge/version-2.1.2-brightgreen)](https://github.com/OthmanAdi/planning-with-files/releases) ## Quick Install @@ -42,7 +42,8 @@ See [docs/installation.md](docs/installation.md) for all installation methods. | Version | Features | Install | |---------|----------|---------| -| **v2.1.1** (current) | Fix plugin template paths | `/plugin install planning-with-files@planning-with-files` | +| **v2.1.2** (current) | Fix template cache issue (Issue #18) | `/plugin install planning-with-files@planning-with-files` | +| **v2.1.1** | Fix plugin template paths | See [releases](https://github.com/OthmanAdi/planning-with-files/releases) | | **v2.1.0** | Claude Code v2.1 compatible, SessionStart hook, PostToolUse hook, user-invocable | See [releases](https://github.com/OthmanAdi/planning-with-files/releases) | | **v2.0.x** | Hooks, templates, scripts | See [releases](https://github.com/OthmanAdi/planning-with-files/releases) | | **v1.0.0** (legacy) | Core 3-file pattern | `git clone -b legacy` | @@ -110,6 +111,8 @@ See [docs/quickstart.md](docs/quickstart.md) for the full 5-step guide. ``` planning-with-files/ +├── templates/ # Root-level templates (for CLAUDE_PLUGIN_ROOT) +├── scripts/ # Root-level scripts (for CLAUDE_PLUGIN_ROOT) ├── docs/ # Documentation │ ├── installation.md │ ├── quickstart.md @@ -117,11 +120,15 @@ planning-with-files/ │ ├── troubleshooting.md │ ├── cursor.md │ └── windows.md -├── skills/ +├── planning-with-files/ # Plugin skill folder +│ ├── SKILL.md +│ ├── templates/ +│ └── scripts/ +├── skills/ # Legacy skill folder │ └── planning-with-files/ -│ ├── SKILL.md # Main skill definition -│ ├── templates/ # File templates -│ └── scripts/ # Helper scripts +│ ├── SKILL.md +│ ├── templates/ +│ └── scripts/ ├── .claude-plugin/ # Plugin manifest ├── .cursor/ # Cursor rules ├── CHANGELOG.md diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index f92319b..3a8f7af 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -4,6 +4,39 @@ Common issues and their solutions. --- +## Templates not found in cache (after update) + +**Issue:** After updating to a new version, `/planning-with-files` fails with "template files not found in cache" or similar errors. + +**Why this happens:** Claude Code caches plugin files, and the cache may not refresh properly after an update. + +**Solutions:** + +### Solution 1: Clean reinstall (Recommended) + +```bash +/plugin uninstall planning-with-files@planning-with-files +/plugin marketplace add OthmanAdi/planning-with-files +/plugin install planning-with-files@planning-with-files +``` + +### Solution 2: Clear Claude Code cache + +Restart Claude Code completely (close and reopen terminal/IDE). + +### Solution 3: Manual cache clear + +```bash +# Find and remove cached plugin +rm -rf ~/.claude/cache/plugins/planning-with-files +``` + +Then reinstall the plugin. + +**Note:** This was fixed in v2.1.2 by adding templates at the repo root level. + +--- + ## Planning files created in wrong directory **Issue:** When using `/planning-with-files`, the files (`task_plan.md`, `findings.md`, `progress.md`) are created in the skill installation directory instead of your project. diff --git a/planning-with-files/SKILL.md b/planning-with-files/SKILL.md index ed1a051..84d026a 100644 --- a/planning-with-files/SKILL.md +++ b/planning-with-files/SKILL.md @@ -1,6 +1,6 @@ --- name: planning-with-files -version: "2.1.1" +version: "2.1.2" description: Implements Manus-style file-based planning for complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when starting complex multi-step tasks, research projects, or any task requiring >5 tool calls. user-invocable: true allowed-tools: diff --git a/scripts/check-complete.sh b/scripts/check-complete.sh new file mode 100644 index 0000000..d17a3e4 --- /dev/null +++ b/scripts/check-complete.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Check if all phases in task_plan.md are complete +# Exit 0 if complete, exit 1 if incomplete +# Used by Stop hook to verify task completion + +PLAN_FILE="${1:-task_plan.md}" + +if [ ! -f "$PLAN_FILE" ]; then + echo "ERROR: $PLAN_FILE not found" + echo "Cannot verify completion without a task plan." + exit 1 +fi + +echo "=== Task Completion Check ===" +echo "" + +# Count phases by status (using -F for fixed string matching) +TOTAL=$(grep -c "### Phase" "$PLAN_FILE" || true) +COMPLETE=$(grep -cF "**Status:** complete" "$PLAN_FILE" || true) +IN_PROGRESS=$(grep -cF "**Status:** in_progress" "$PLAN_FILE" || true) +PENDING=$(grep -cF "**Status:** pending" "$PLAN_FILE" || true) + +# Default to 0 if empty +: "${TOTAL:=0}" +: "${COMPLETE:=0}" +: "${IN_PROGRESS:=0}" +: "${PENDING:=0}" + +echo "Total phases: $TOTAL" +echo "Complete: $COMPLETE" +echo "In progress: $IN_PROGRESS" +echo "Pending: $PENDING" +echo "" + +# Check completion +if [ "$COMPLETE" -eq "$TOTAL" ] && [ "$TOTAL" -gt 0 ]; then + echo "ALL PHASES COMPLETE" + exit 0 +else + echo "TASK NOT COMPLETE" + echo "" + echo "Do not stop until all phases are complete." + exit 1 +fi diff --git a/scripts/init-session.sh b/scripts/init-session.sh new file mode 100644 index 0000000..1c60de8 --- /dev/null +++ b/scripts/init-session.sh @@ -0,0 +1,120 @@ +#!/bin/bash +# Initialize planning files for a new session +# Usage: ./init-session.sh [project-name] + +set -e + +PROJECT_NAME="${1:-project}" +DATE=$(date +%Y-%m-%d) + +echo "Initializing planning files for: $PROJECT_NAME" + +# Create task_plan.md if it doesn't exist +if [ ! -f "task_plan.md" ]; then + cat > task_plan.md << 'EOF' +# Task Plan: [Brief Description] + +## Goal +[One sentence describing the end state] + +## Current Phase +Phase 1 + +## Phases + +### Phase 1: Requirements & Discovery +- [ ] Understand user intent +- [ ] Identify constraints +- [ ] Document in findings.md +- **Status:** in_progress + +### Phase 2: Planning & Structure +- [ ] Define approach +- [ ] Create project structure +- **Status:** pending + +### Phase 3: Implementation +- [ ] Execute the plan +- [ ] Write to files before executing +- **Status:** pending + +### Phase 4: Testing & Verification +- [ ] Verify requirements met +- [ ] Document test results +- **Status:** pending + +### Phase 5: Delivery +- [ ] Review outputs +- [ ] Deliver to user +- **Status:** pending + +## Decisions Made +| Decision | Rationale | +|----------|-----------| + +## Errors Encountered +| Error | Resolution | +|-------|------------| +EOF + echo "Created task_plan.md" +else + echo "task_plan.md already exists, skipping" +fi + +# Create findings.md if it doesn't exist +if [ ! -f "findings.md" ]; then + cat > findings.md << 'EOF' +# Findings & Decisions + +## Requirements +- + +## Research Findings +- + +## Technical Decisions +| Decision | Rationale | +|----------|-----------| + +## Issues Encountered +| Issue | Resolution | +|-------|------------| + +## Resources +- +EOF + echo "Created findings.md" +else + echo "findings.md already exists, skipping" +fi + +# Create progress.md if it doesn't exist +if [ ! -f "progress.md" ]; then + cat > progress.md << EOF +# Progress Log + +## Session: $DATE + +### Current Status +- **Phase:** 1 - Requirements & Discovery +- **Started:** $DATE + +### Actions Taken +- + +### Test Results +| Test | Expected | Actual | Status | +|------|----------|--------|--------| + +### Errors +| Error | Resolution | +|-------|------------| +EOF + echo "Created progress.md" +else + echo "progress.md already exists, skipping" +fi + +echo "" +echo "Planning files initialized!" +echo "Files: task_plan.md, findings.md, progress.md" diff --git a/skills/planning-with-files/SKILL.md b/skills/planning-with-files/SKILL.md index ed1a051..84d026a 100644 --- a/skills/planning-with-files/SKILL.md +++ b/skills/planning-with-files/SKILL.md @@ -1,6 +1,6 @@ --- name: planning-with-files -version: "2.1.1" +version: "2.1.2" description: Implements Manus-style file-based planning for complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when starting complex multi-step tasks, research projects, or any task requiring >5 tool calls. user-invocable: true allowed-tools: diff --git a/templates/findings.md b/templates/findings.md new file mode 100644 index 0000000..056536d --- /dev/null +++ b/templates/findings.md @@ -0,0 +1,95 @@ +# Findings & Decisions + + +## Requirements + + +- + +## Research Findings + + +- + +## Technical Decisions + + +| Decision | Rationale | +|----------|-----------| +| | | + +## Issues Encountered + + +| Issue | Resolution | +|-------|------------| +| | | + +## Resources + + +- + +## Visual/Browser Findings + + + +- + +--- + +*Update this file after every 2 view/browser/search operations* +*This prevents visual information from being lost* diff --git a/templates/progress.md b/templates/progress.md new file mode 100644 index 0000000..dba9af9 --- /dev/null +++ b/templates/progress.md @@ -0,0 +1,114 @@ +# Progress Log + + +## Session: [DATE] + + +### Phase 1: [Title] + +- **Status:** in_progress +- **Started:** [timestamp] + +- Actions taken: + + - +- Files created/modified: + + - + +### Phase 2: [Title] + +- **Status:** pending +- Actions taken: + - +- Files created/modified: + - + +## Test Results + +| Test | Input | Expected | Actual | Status | +|------|-------|----------|--------|--------| +| | | | | | + +## Error Log + + +| Timestamp | Error | Attempt | Resolution | +|-----------|-------|---------|------------| +| | | 1 | | + +## 5-Question Reboot Check + + +| Question | Answer | +|----------|--------| +| Where am I? | Phase X | +| Where am I going? | Remaining phases | +| What's the goal? | [goal statement] | +| What have I learned? | See findings.md | +| What have I done? | See above | + +--- + +*Update after completing each phase or encountering errors* diff --git a/templates/task_plan.md b/templates/task_plan.md new file mode 100644 index 0000000..cc85896 --- /dev/null +++ b/templates/task_plan.md @@ -0,0 +1,132 @@ +# Task Plan: [Brief Description] + + +## Goal + +[One sentence describing the end state] + +## Current Phase + +Phase 1 + +## Phases + + +### Phase 1: Requirements & Discovery + +- [ ] Understand user intent +- [ ] Identify constraints and requirements +- [ ] Document findings in findings.md +- **Status:** in_progress + + +### Phase 2: Planning & Structure + +- [ ] Define technical approach +- [ ] Create project structure if needed +- [ ] Document decisions with rationale +- **Status:** pending + +### Phase 3: Implementation + +- [ ] Execute the plan step by step +- [ ] Write code to files before executing +- [ ] Test incrementally +- **Status:** pending + +### Phase 4: Testing & Verification + +- [ ] Verify all requirements met +- [ ] Document test results in progress.md +- [ ] Fix any issues found +- **Status:** pending + +### Phase 5: Delivery + +- [ ] Review all output files +- [ ] Ensure deliverables are complete +- [ ] Deliver to user +- **Status:** pending + +## Key Questions + +1. [Question to answer] +2. [Question to answer] + +## Decisions Made + +| Decision | Rationale | +|----------|-----------| +| | | + +## Errors Encountered + +| Error | Attempt | Resolution | +|-------|---------|------------| +| | 1 | | + +## Notes + +- Update phase status as you progress: pending → in_progress → complete +- Re-read this plan before major decisions (attention manipulation) +- Log ALL errors - they help avoid repetition