Skip to content

Latest commit

 

History

History
989 lines (788 loc) · 30.4 KB

File metadata and controls

989 lines (788 loc) · 30.4 KB

Implementation Plan: Memory-Focused Claude Code Plugin with Scaffold Approach

Project Goal: Transform the claude-code-infrastructure-showcase into a streamlined, bulletproof memory and context management plugin for Claude Code, while keeping tech-specific skills as customizable scaffolds.

Total Estimated Time: 10-12 hours


Overview

This plugin focuses on:

  1. Intentional Memory Management - Context, plan, and scratchpad auxiliary folders
  2. Scaffold Approach - Production-tested skills that users can customize for their tech stack
  3. Plan-Approval Workflow - User control over AI actions
  4. Easy Setup - Automated installation and customization

Opinionated Tech Stack (Default Scaffolds)

We provide opinionated, modern, production-ready defaults that work together seamlessly:

Backend Stack (Supabase + Edge Functions)

  • Database: Supabase PostgreSQL
  • Backend: Supabase Edge Functions (Deno runtime)
  • Auth: Supabase Auth
  • Storage: Supabase Storage
  • Real-time: Supabase Realtime
  • Email: Resend
  • Payments: Stripe
  • Language: TypeScript
  • Deployment: Supabase (auto-deployed with git push)

Frontend Stack (Next.js + React 19)

  • Framework: Next.js 14+ (App Router)
  • UI Library: React 19
  • Components: shadcn/ui (Radix primitives + Tailwind CSS)
  • Styling: Tailwind CSS
  • Router: React Router DOM / Next.js App Router
  • State Management: React Context + hooks, TanStack Query for server state
  • Forms: React Hook Form + Zod validation
  • Language: TypeScript
  • Deployment: Vercel
  • Performance: Lazy loading, code splitting, Suspense boundaries

Integration Services

  • Email: Resend (transactional emails)
  • Payments: Stripe (subscriptions + one-time payments)
  • Analytics: Vercel Analytics (optional)
  • Monitoring: Supabase Dashboard + Vercel Logs

Why These Choices?

  1. Supabase: Full backend-as-a-service, no server management, instant APIs
  2. Next.js: Best-in-class React framework, excellent DX, perfect Vercel integration
  3. shadcn/ui: Accessible, customizable, copy-paste components (not a dependency)
  4. Tailwind: Utility-first, fast development, excellent with shadcn/ui
  5. TypeScript: Type safety across the stack
  6. Vercel: Zero-config deployment, edge network, perfect Next.js integration
  7. Resend: Developer-friendly email API, great DX
  8. Stripe: Industry-standard payments, excellent docs and SDK

Phase 1: Restructure Repository (20 min) ✅ COMPLETED

Keep as Scaffolds

  • ✅ backend-dev-guidelines (Supabase + Edge Functions template) - UPDATED with opinionated stack
  • ✅ frontend-dev-guidelines (Next.js + React 19 + shadcn/ui template) - UPDATED with opinionated stack
  • ✅ skill-developer (enhanced with memory patterns)

Remove

  • ✅ route-tester (too specific)
  • ✅ error-tracking (Sentry-specific)
  • ✅ Optional Stop hooks (tsc-check, trigger-build-resolver, error-handling-reminder, stop-build-check-enhanced)
  • ✅ Auth-specific agents (auth-route-tester, auth-route-debugger)
  • ✅ Tech-specific agents (frontend-error-fixer, auto-error-resolver, code-refactor-master)
  • ✅ Specific command (route-research-for-testing)
  • ✅ Old integration guides (CLAUDE_INTEGRATION_GUIDE.md, CLAUDE_CODE_INTEGRATION_adapted.md)

New Directory Structure

claude-memory-plugin/
├── README.md
├── INSTALLATION.md
├── PHILOSOPHY.md
├── SCAFFOLD_GUIDE.md
├── IMPLEMENTATION_PLAN.md (this file)
├── .claude/
│   ├── settings.json.template
│   ├── skills/
│   │   ├── skill-rules.json
│   │   ├── skill-developer/ (enhanced)
│   │   ├── backend-dev-guidelines/ (scaffold)
│   │   ├── frontend-dev-guidelines/ (scaffold)
│   │   ├── memory-management/ (new)
│   │   ├── context-persistence/ (new)
│   │   └── plan-approval/ (new)
│   ├── hooks/
│   │   ├── skill-activation-prompt.*
│   │   ├── post-tool-use-tracker.sh
│   │   ├── context-tracker.* (new)
│   │   └── package.json
│   ├── commands/
│   │   ├── create-plan.md (renamed)
│   │   ├── update-context.md (renamed)
│   │   ├── resume.md (new)
│   │   └── customize-scaffold.md (new)
│   └── agents/
│       ├── scaffold-customizer.md (new)
│       ├── context-analyzer.md (new)
│       └── plan-reviewer.md
├── scripts/
│   ├── setup.sh (new)
│   └── customize-scaffold.sh (new)
├── examples/
│   ├── sample-project/ (new)
│   └── customized-backend/ (new)
└── plans/ (keep existing)

Phase 2: Enhance skill-developer Skill (3-4 hours) ✅ COMPLETED

2.1 Critical Fixes (HIGH PRIORITY - 1 hour) ✅

✅ Updated SKILL.md:

  • Added "Memory-Aware Skills" section (~80 lines)
    • Purpose and when to use
    • Key capabilities (context persistence, plan-approval, session state)
    • Reference to MEMORY_PATTERNS.md
    • Example of user preference memory
    • Best practices (DOs and DON'Ts)
  • Updated YAML frontmatter description with memory keywords

✅ Updated skill-rules.json for skill-developer:

  • Added 15 keywords: "progressive disclosure", "500-line rule", "guardrail", "memory pattern", "context persistence", "plan approval", "session state", "UserPromptSubmit", "PreToolUse", "Stop hook", "skill debugging", "YAML frontmatter"
  • Added 6 intent patterns for troubleshooting, memory implementation, planning
  • Added file triggers: .claude/skills/**/*.md, .claude/skills/skill-rules.json, .claude/hooks/*skill*.ts
  • Added content patterns for YAML frontmatter and trigger detection

2.2 Create MEMORY_PATTERNS.md (HIGH PRIORITY - 2 hours) ✅

✅ Created: .claude/skills/skill-developer/MEMORY_PATTERNS.md (~250 lines)

Sections:

  1. Context Persistence - When to persist, how to implement, storage locations
  2. User Preference Tracking - Correction counter, choice patterns, workflow preferences
  3. Plan-Approval Workflows - 5-stage workflow (Analysis → Presentation → Decision → Execution → Learning)
  4. Session State Management - Enhanced state schema beyond "skill used" flags
  5. Memory Refresh Triggers - File-based, time-based, conflict detection, user-initiated

2.3 Create QUICK_REFERENCE.md (30 min) ✅

✅ Created: .claude/skills/skill-developer/QUICK_REFERENCE.md (~120 lines)

One-page cheat sheet with:

  • Commands (test triggers, validate config)
  • File structure diagram
  • Trigger pattern syntax (keywords, intent, file, content)
  • Exit code reference table
  • Enforcement levels
  • Common patterns
  • Troubleshooting quick fixes

Phase 3: Prepare Scaffolds for Customization (2 hours) ✅ COMPLETED

3.1 Add Scaffold Markers ✅

✅ backend-dev-guidelines/SKILL.md - Added marker:

> **📋 SCAFFOLD TEMPLATE**: This skill contains example patterns for Node.js/Express/Prisma/TypeScript.
> **To customize**: Run `/customize-scaffold backend` or use the scaffold-customizer agent
> to adapt for your tech stack (NestJS, Fastify, Koa, Django, Rails, Go, etc.)

✅ frontend-dev-guidelines/SKILL.md - Added marker:

> **📋 SCAFFOLD TEMPLATE**: This skill contains example patterns for React 18+/MUI v7/TanStack Query/TypeScript.
> **To customize**: Run `/customize-scaffold frontend` or use the scaffold-customizer agent
> to adapt for your tech stack (Vue, Angular, Svelte, vanilla JS, different UI libraries, etc.)

3.2 Create Scaffold Placeholders File (PENDING)

TODO: Create .claude/skills/SCAFFOLD_PLACEHOLDERS.md

Document all tech-specific terms that should be replaced:

Backend Placeholders:

  • {framework}: Express, NestJS, Fastify, Koa, Hono
  • {orm}: Prisma, TypeORM, Sequelize, Drizzle
  • {language}: TypeScript, JavaScript, Python, Go
  • {error-tracker}: Sentry, Rollbar, Datadog, New Relic
  • {validation}: Zod, Joi, Yup, class-validator

Frontend Placeholders:

  • {framework}: React, Vue, Angular, Svelte, Solid
  • {ui-library}: MUI v7, Ant Design, shadcn/ui, Chakra
  • {state-mgmt}: TanStack Query, Redux, Zustand, Pinia
  • {router}: TanStack Router, React Router, Vue Router

3.3 Update skill-rules.json with Scaffold Metadata ✅

✅ Added to both scaffold skills:

{
  "scaffold": {
    "isTemplate": true,
    "techStack": ["Node.js", "Express", "Prisma", "TypeScript"],
    "customizationRequired": true,
    "customizationAgent": "scaffold-customizer"
  }
}

Phase 3.5: Update Scaffolds with Opinionated Tech Stack (2-3 hours) IN PROGRESS

Purpose

Replace generic/old examples with modern, opinionated stack that works together seamlessly.

3.5.1 Update backend-dev-guidelines (1.5 hours)

Replace: Express + Prisma + Zod + Sentry With: Supabase + Edge Functions + PostgreSQL + Resend + Stripe

Key Changes:

  • Framework: Express → Supabase Edge Functions (Deno runtime)
  • Database: Prisma → Supabase PostgreSQL (direct SQL + auto-generated TypeScript types)
  • Auth: Custom middleware → Supabase Auth
  • Storage: File system → Supabase Storage
  • Email: Generic SMTP → Resend
  • Payments: Generic → Stripe
  • Deployment: Manual → Git push to Supabase

Files to Update (all resource files in backend-dev-guidelines/):

  • SKILL.md - Replace framework intro
  • ROUTING_AND_CONTROLLERS.md → EDGE_FUNCTIONS.md (Edge Function patterns)
  • SERVICES_AND_REPOSITORIES.md → SUPABASE_CLIENT.md (Supabase client usage)
  • DATABASE_ACCESS.md → SUPABASE_DATABASE.md (Row-level security, direct SQL)
  • VALIDATION.md - Keep Zod (works well with Supabase)
  • ERROR_HANDLING.md - Update for Deno runtime
  • MIDDLEWARE.md → AUTH_AND_RLS.md (Row-level security policies)
  • TESTING.md - Update for Deno test
  • Add: RESEND_EMAIL.md - Email patterns
  • Add: STRIPE_PAYMENTS.md - Payment patterns
  • Add: SUPABASE_REALTIME.md - Realtime subscriptions
  • Add: DEPLOYMENT.md - Git-based deployment

skill-rules.json updates:

{
  "backend-dev-guidelines": {
    "description": "Backend patterns for Supabase Edge Functions + PostgreSQL",
    "scaffold": {
      "techStack": ["Supabase", "Edge Functions", "PostgreSQL", "Deno", "TypeScript"]
    },
    "promptTriggers": {
      "keywords": [
        "backend", "supabase", "edge function", "database",
        "PostgreSQL", "row-level security", "RLS", "auth",
        "resend", "email", "stripe", "payments", "realtime"
      ]
    },
    "fileTriggers": {
      "pathPatterns": [
        "supabase/functions/**/*.ts",
        "app/api/**/*.ts",          // Next.js API routes
        "lib/supabase/**/*.ts",
        "lib/database/**/*.ts"
      ],
      "contentPatterns": [
        "from 'supabase'",
        "createClient",
        "supabaseClient",
        "edge-runtime"
      ]
    }
  }
}

3.5.2 Update frontend-dev-guidelines (1.5 hours)

Replace: React + MUI v7 + TanStack Query/Router With: Next.js 14+ + React 19 + shadcn/ui + Tailwind + React Hook Form

Key Changes:

  • Framework: Generic React → Next.js 14+ (App Router)
  • UI Library: MUI v7 → shadcn/ui (copy-paste components)
  • Styling: MUI sx prop → Tailwind CSS utility classes
  • Router: TanStack Router → Next.js App Router (file-based)
  • Forms: Generic → React Hook Form + Zod
  • Data Fetching: TanStack Query (keep, works great with Next.js)
  • Deployment: Generic → Vercel

Files to Update (all resource files in frontend-dev-guidelines/):

  • SKILL.md - Replace framework intro
  • COMPONENT_PATTERNS.md → NEXTJS_COMPONENTS.md (Server vs. Client components)
  • STYLING.md → TAILWIND_SHADCN.md (Tailwind + shadcn/ui patterns)
  • DATA_FETCHING.md → NEXTJS_DATA_FETCHING.md (Server Actions, streaming)
  • ROUTING.md → APP_ROUTER.md (Next.js App Router patterns)
  • STATE_MANAGEMENT.md - Update for Next.js (Context, Server State)
  • FORMS.md → REACT_HOOK_FORM.md (Form patterns with Zod)
  • PERFORMANCE.md → NEXTJS_PERFORMANCE.md (Image, Font optimization)
  • Add: SUPABASE_INTEGRATION.md - Frontend Supabase client
  • Add: VERCEL_DEPLOYMENT.md - Deployment patterns
  • Add: SERVER_ACTIONS.md - Server Actions patterns
  • Add: LAZY_LOADING.md - Code splitting, dynamic imports

skill-rules.json updates:

{
  "frontend-dev-guidelines": {
    "description": "Frontend patterns for Next.js + React 19 + shadcn/ui + Tailwind",
    "scaffold": {
      "techStack": ["Next.js", "React 19", "shadcn/ui", "Tailwind CSS", "TypeScript"]
    },
    "promptTriggers": {
      "keywords": [
        "frontend", "nextjs", "react", "component", "page",
        "shadcn", "tailwind", "app router", "server component",
        "client component", "server action", "form", "supabase client"
      ]
    },
    "fileTriggers": {
      "pathPatterns": [
        "app/**/*.tsx",              // Next.js App Router
        "components/**/*.tsx",
        "lib/**/*.ts",
        "app/api/**/*.ts"           // API routes
      ],
      "contentPatterns": [
        "'use client'",
        "'use server'",
        "from 'next/",
        "shadcn|@radix-ui",
        "className=.*cn\\(",
        "useFormStatus",
        "createClient.*supabase"
      ]
    }
  }
}

3.5.3 Update scaffold markers

backend-dev-guidelines/SKILL.md:

> **📋 OPINIONATED SCAFFOLD**: Modern Supabase + Edge Functions stack
> **Stack**: Supabase (PostgreSQL + Auth + Storage + Edge Functions) + Resend + Stripe + TypeScript
> **To customize**: Use scaffold-customizer agent to adapt for Express, NestJS, Django, etc.

frontend-dev-guidelines/SKILL.md:

> **📋 OPINIONATED SCAFFOLD**: Modern Next.js + React 19 stack
> **Stack**: Next.js 14+ (App Router) + React 19 + shadcn/ui + Tailwind CSS + TypeScript
> **To customize**: Use scaffold-customizer agent to adapt for Vue, Angular, vanilla React, etc.

Phase 4: Create scaffold-customizer Agent (1.5 hours) ✅ COMPLETED

4.1 Create Agent File

TODO: Create .claude/agents/scaffold-customizer.md (~400 lines)

Purpose: Automate customization of scaffold skills for user's tech stack

Agent workflow:

  1. Analyze user's project (package.json, directory structure)
  2. Interview user (5-7 targeted questions about tech stack)
  3. Create customization plan
  4. Execute replacements (MultiEdit tool)
  5. Update skill-rules.json triggers
  6. Verify customization
  7. Generate report

Tech Stack Detection:

  • Backend frameworks: Express, NestJS, Fastify, Koa, Hapi, Hono
  • ORMs: Prisma, TypeORM, Sequelize, Drizzle, Mongoose
  • Frontend frameworks: React, Vue, Angular, Svelte, Solid

Replacement Strategy:

  • Framework-specific patterns (Express → NestJS code examples)
  • File path updates in skill-rules.json
  • Terminology updates (router.get → @Get() decorator)

4.2 Create Customization Command

TODO: Create .claude/commands/customize-scaffold.md (~100 lines)

---
name: customize-scaffold
description: Customize a scaffold skill (backend/frontend) for your tech stack
---

## Usage
/customize-scaffold [backend|frontend]

## What This Does
1. Launches scaffold-customizer agent
2. Detects tech stack
3. Asks clarifying questions
4. Customizes skill
5. Updates skill-rules.json
6. Generates report

4.3 Update setup.sh

Add prompt after file copy:

echo "Would you like to customize scaffolds for your project now? (y/n)"
read -r customize
if [ "$customize" = "y" ]; then
  echo "Run: /customize-scaffold backend"
  echo "Run: /customize-scaffold frontend"
fi

Phase 5: Create Memory-Focused Skills (45 min) PENDING

5.1 memory-management Skill (~300 lines)

TODO: Create .claude/skills/memory-management/SKILL.md

Purpose: Context tracking patterns and decision logging

Content:

  • When to capture context
  • Decision tracking techniques
  • Context boundaries (what to track vs. ignore)
  • Storage mechanisms
  • Examples: tracking user corrections, preference patterns

5.2 context-persistence Skill (~250 lines)

TODO: Create .claude/skills/context-persistence/SKILL.md

Purpose: Dev docs methodology and session survival

Content:

  • Three-file structure (plan/context/tasks)
  • SESSION PROGRESS patterns
  • Quick resume instructions
  • Update frequency guidelines
  • Long-running feature workflows

5.3 plan-approval Skill (~200 lines)

TODO: Create .claude/skills/plan-approval/SKILL.md

Purpose: Approval workflow patterns

Content:

  • Plan creation workflow
  • User approval checkpoints
  • Plan deviation tracking
  • Revision management
  • Memory of approved/rejected plans

5.4 Update skill-rules.json

TODO: Add entries for all 3 new skills:

{
  "memory-management": {
    "type": "domain",
    "enforcement": "suggest",
    "priority": "high",
    "promptTriggers": {
      "keywords": ["remember", "track decision", "context", "memory"],
      "intentPatterns": ["(track|remember|save).*?(decision|context|preference)"]
    },
    "fileTriggers": {
      "pathPatterns": ["plans/**/*.md"]
    }
  },
  "context-persistence": {
    "type": "domain",
    "enforcement": "suggest",
    "priority": "high",
    "promptTriggers": {
      "keywords": ["waypoint plans", "session survival", "resume", "context"],
      "intentPatterns": ["(resume|continue|restore).*?(work|session|context)"]
    },
    "fileTriggers": {
      "pathPatterns": ["plans/active/**/context.md", "plans/active/**/plan.md"]
    }
  },
  "plan-approval": {
    "type": "domain",
    "enforcement": "suggest",
    "priority": "high",
    "promptTriggers": {
      "keywords": ["plan", "approve", "propose", "review plan"],
      "intentPatterns": ["(create|review|approve).*?plan"]
    },
    "fileTriggers": {
      "pathPatterns": ["plans/active/**/*"]
    }
  }
}

Phase 6: Create Memory-Focused Hooks (30 min) PENDING

6.1 context-tracker Hook (PostToolUse)

TODO: Create:

  • .claude/hooks/context-tracker.sh (~30 lines)
  • .claude/hooks/context-tracker.ts (~120 lines)

Purpose: Automatically capture significant decisions after Edit/Write operations

Functionality:

  • Detect significant edits (not minor formatting)
  • Extract decision context (why change was made)
  • Append to plans/active/{task}/context.md
  • Filter noise (minor edits, whitespace changes)

Example output:

### Decision: Switch from sessions to JWT (2025-01-15 11:30)
**Files Modified**: auth.service.ts, app.ts
**Rationale**: User requested stateless authentication for mobile apps
**Impact**: Requires database migration for refresh tokens

6.2 Update skill-rules.json

Add file triggers for context-tracker hook to activate on relevant file edits.


Phase 7: Update Commands (20 min) PENDING

7.1 Rename & Enhance create-plan

TODO: Rename and update .claude/commands/create-plan.md

Changes:

  • Focus on plan-approval workflow
  • Add explicit approval prompt
  • Include decision log template
  • Add risk assessment section

7.2 Rename & Enhance update-context

TODO: Rename and update .claude/commands/update-context.md

Changes:

  • Add prompts for decision capture
  • Include SESSION PROGRESS template
  • Add quick resume checklist
  • Prompt for blockers/learnings

7.3 Create /resume Command

TODO: Create .claude/commands/resume.md (~100 lines)

Functionality:

  • Read most recent context.md
  • Display tasks from tasks.md
  • Show SESSION PROGRESS summary
  • Suggest next action
  • Warn if context is stale (> 7 days)

Example output:

📂 Resuming: user-authentication-jwt

📋 CONTEXT SUMMARY:
- Last updated: 2 hours ago
- In progress: Implementing token refresh logic

✅ COMPLETED (3/5):
- [x] Create auth.middleware.ts
- [x] Create auth.service.ts

🟡 IN PROGRESS (1/5):
- [ ] Implement token refresh logic (CURRENT)

⏳ PENDING (1/5):
- [ ] Add integration tests

➡️ NEXT ACTION: Continue implementing refreshToken() in auth.service.ts

Phase 8: Create Setup Automation (30 min) PENDING

8.1 setup.sh Script

TODO: Create scripts/setup.sh (~250 lines)

Interactive wizard:

  1. Check prerequisites (Node.js, bash, jq)
  2. Create .claude/ directory structure
  3. Copy template files
  4. Install hook dependencies
  5. Make hooks executable
  6. Prompt for project-specific configuration
  7. Generate customized skill-rules.json
  8. Generate settings.json from template
  9. Validate setup
  10. Display success message

Usage:

curl -fsSL https://raw.githubusercontent.com/user/claude-memory-plugin/main/scripts/setup.sh | bash
# OR
git clone https://github.com/user/claude-memory-plugin.git
cd claude-memory-plugin
./scripts/setup.sh /path/to/your/project

Phase 9: Write Bulletproof Documentation (2.5 hours) PENDING

9.1 README.md (~500 lines)

TODO: Complete rewrite

Sections:

  1. What Problem This Solves - Context loss, plan approval, memory
  2. Scaffold Approach - Production patterns you customize
  3. Philosophy - Intentional memory management
  4. 5-Minute Quick Start - One-line installation
  5. Visual Examples - Before/after screenshots
  6. Components Overview - 3 memory skills + 2 scaffolds
  7. Customization - How to adapt scaffolds
  8. Links - Installation, philosophy, troubleshooting

9.2 INSTALLATION.md (~350 lines)

TODO: Create

Sections:

  1. Prerequisites - Node.js >= 18, bash, jq
  2. Automated Installation - Using setup.sh
  3. Manual Installation - 6-step process
  4. Scaffold Customization - Automated vs. manual
  5. Troubleshooting - Common issues
  6. Migration - From manual waypoint plans

9.3 PHILOSOPHY.md (~300 lines)

TODO: Create

Sections:

  1. Why Claude Needs Intentional Memory - Context limits, resets
  2. The Plan-Approve-Implement Cycle - User control workflow
  3. Scaffold Philosophy - Why this approach works
  4. Context Boundaries & Noise Filtering - Signal vs. noise
  5. Session State vs. Project Knowledge - Temporary vs. persistent

9.4 SCAFFOLD_GUIDE.md (~400 lines)

TODO: Create

Sections:

  1. What Are Scaffolds? - Production-tested starting points
  2. When to Customize - Different tech stack
  3. Automated Customization - Using command/agent
  4. Manual Customization - Step-by-step checklist
  5. Common Scenarios - Express→NestJS, React→Vue examples
  6. Placeholder Reference - Link to SCAFFOLD_PLACEHOLDERS.md

9.5 Update CLAUDE.md (~550 lines)

TODO: Major restructure

Remove:

  • Tech-specific sections
  • Complex build hook documentation
  • Detailed tech stack tables

Add/Update:

  • Memory management architecture
  • Scaffold approach explanation
  • Context persistence patterns
  • Plan-approval workflow
  • Integration workflow (memory-focused)

Phase 10: Create Example Projects (30 min) PENDING

10.1 examples/sample-project/

TODO: Create working example with all features

Structure:

sample-project/
├── README.md (how this demonstrates the plugin)
├── .claude/ (fully configured)
│   ├── settings.json
│   ├── skills/ (all 6 skills)
│   ├── hooks/ (all 3 hooks)
│   ├── commands/ (all 4 commands)
│   └── agents/ (3 agents)
├── plans/active/add-user-feature/
│   ├── plan.md (sample plan)
│   ├── context.md (sample context)
│   └── tasks.md (sample checklist)
├── src/
│   ├── user.service.ts
│   └── user.controller.ts
└── package.json

10.2 examples/customized-backend/

TODO: Create example showing scaffold customization

Structure:

customized-backend/
├── README.md (customization story)
├── BEFORE/ (original Express + Prisma)
├── AFTER/ (customized for NestJS + TypeORM)
├── DIFF.md (side-by-side comparison)
└── customization-report.md (agent output)

Phase 11: Clean Up & Polish (15 min) PENDING

11.1 Create Meta Files

TODO: Create:

.gitignore:

node_modules/
.DS_Store
*.log
.claude/hooks/node_modules/
.env
.claude/memory/  # Don't commit user memory

CONTRIBUTING.md (~80 lines):

  • How to contribute improvements
  • Testing guidelines
  • Documentation standards
  • Issue reporting

CHANGELOG.md (~30 lines):

# Changelog

## [1.0.0] - 2025-01-15

### Added
- Memory-focused Claude Code plugin
- Three memory management skills
- Context tracking hook
- Plan approval workflow
- Scaffold customization system
- Setup automation script

### Changed
- Forked from claude-code-infrastructure-showcase
- Focused on memory/context management
- Enhanced skill-developer with memory patterns
- Converted backend/frontend skills to scaffolds

### Removed
- Tech-specific skills (route-tester, error-tracking)
- Optional build hooks
- Auth-specific agents

11.2 Final Validation

Checklist:

  • All JSON files valid (jq validation)
  • All hooks executable (chmod +x)
  • skill-rules.json has 6 skills configured
  • Scaffolds have customization markers
  • scaffold-customizer agent works
  • /customize-scaffold command works
  • All cross-references valid
  • SKILL.md files < 500 lines
  • README.md has working quick start
  • setup.sh works end-to-end
  • Example project demonstrates all features

Test full workflow:

  1. Run setup.sh on clean project
  2. Edit a file → verify context-tracker activates
  3. Ask about memory → verify memory-management activates
  4. Run /create-plan → verify plan generation
  5. Run /update-context → verify context update
  6. Run /resume → verify context loading
  7. Run /customize-scaffold backend → verify customization

File Changes Summary

Deleted (~12 files, ~400 lines)

  • ✅ 2 skill directories (route-tester, error-tracking)
  • ✅ 4 complex hooks
  • ✅ 5 specific agents
  • ✅ 1 specific command
  • ✅ 2 old integration guides

Created (~22 new files, ~3500 lines)

Documentation:

  • INSTALLATION.md (350 lines)
  • PHILOSOPHY.md (300 lines)
  • SCAFFOLD_GUIDE.md (400 lines)
  • SCAFFOLD_PLACEHOLDERS.md (150 lines)
  • CONTRIBUTING.md (80 lines)
  • CHANGELOG.md (30 lines)
  • IMPLEMENTATION_PLAN.md (this file)

Skills:

  • memory-management/SKILL.md (300 lines)
  • context-persistence/SKILL.md (250 lines)
  • plan-approval/SKILL.md (200 lines)
  • skill-developer/MEMORY_PATTERNS.md (250 lines) ✅
  • skill-developer/QUICK_REFERENCE.md (120 lines) ✅

Agents:

  • scaffold-customizer.md (400 lines)
  • context-analyzer.md (200 lines)

Commands:

  • customize-scaffold.md (100 lines)
  • resume.md (100 lines)

Hooks:

  • context-tracker.sh (30 lines)
  • context-tracker.ts (120 lines)

Infrastructure:

  • scripts/setup.sh (250 lines)
  • scripts/customize-scaffold.sh (100 lines)
  • .gitignore (15 lines)
  • settings.json.template (50 lines)

Examples:

  • examples/sample-project/ (~500 lines total)
  • examples/customized-backend/ (~200 lines total)

Keep (IMPORTANT)

  • ✅ backend-dev-guidelines/ (all 12 resource files)
  • ✅ frontend-dev-guidelines/ (all 11 resource files)
  • ✅ skill-developer/ (enhanced)

Updated (~15 files, ~1000 lines modified)

Completed:

  • skill-developer/SKILL.md (+80 lines memory section) ✅
  • backend-dev-guidelines/SKILL.md (+scaffold marker) ✅
  • frontend-dev-guidelines/SKILL.md (+scaffold marker) ✅
  • skill-rules.json (+enhanced triggers, +scaffold metadata, -removed skills) ✅

Pending:

  • README.md (complete rewrite, 500 lines)
  • CLAUDE.md (major restructure, 550 lines)
  • .claude/commands/dev-docs.md → create-plan.md (rename + enhance)
  • .claude/commands/dev-docs-update.md → update-context.md (rename + enhance)
  • .claude/settings.json → settings.json.template (clean up)
  • plans/README.md (enhance with new patterns)

Key Design Principles

  1. Scaffold-First Approach: Start with production patterns, customize easily
  2. Memory-First Architecture: Everything revolves around intentional memory
  3. Automated Customization: One command to adapt scaffolds
  4. Minimal Dependencies: Only TypeScript/Node for hooks
  5. Zero Configuration: setup.sh handles everything
  6. Progressive Adoption: Start simple → add scaffolds → customize
  7. Clear Philosophy: Document WHY scaffolds + memory work
  8. Real Examples: Show customization process
  9. Bulletproof Setup: Validate scaffolds after customization
  10. User Control: Memory and scaffolds are transparent

Success Criteria

After completion, users should be able to:

  • ✅ Install plugin in < 5 minutes
  • ✅ Customize scaffolds in < 10 minutes (automated) or < 20 minutes (manual)
  • ✅ See immediate value (tech-specific guidance + memory)
  • ✅ Use scaffolds for ANY tech stack
  • ✅ Track context and decisions automatically
  • ✅ Approve/reject plans before execution
  • ✅ Resume work seamlessly after context resets
  • ✅ Learn from examples (see customization in action)

What Makes This Different

vs. Original Showcase

Original:

  • Reference library with 5 diverse skills
  • Tech-specific (backend, frontend, testing)
  • Complex (6 hooks, 10 agents)
  • Copy-and-customize approach
  • Production examples from real project

This Plugin:

  • Focused memory management tool
  • Tech-agnostic (works with any stack via scaffolds)
  • Simple (3 hooks, 3 agents, core features only)
  • Automated setup + wizard
  • Generic examples anyone can use

Scaffold Approach Benefits

vs. Generic Skills:

  • ❌ Generic: "Follow best practices" (vague)
  • ✅ Scaffold: "Use BaseController pattern like this: [code]" (specific)

vs. Writing from Scratch:

  • ❌ Scratch: 4-6 hours to write a good skill
  • ✅ Scaffold: 5-10 minutes to customize

vs. Tech-Specific Only:

  • ❌ Specific: Only works for Express + Prisma
  • ✅ Scaffold: Works for ANY backend after customization

Progress Tracking

✅ Completed Phases

  • Phase 1: Repository restructuring (20 min)
  • Phase 2: Enhanced skill-developer (3-4 hours)
  • Phase 3: Scaffold preparation (1 hour)

🔄 In Progress

  • Phase 4: scaffold-customizer agent (1.5 hours)

⏳ Pending Phases

  • Phase 5: Memory-focused skills (45 min)
  • Phase 6: Memory-focused hooks (30 min)
  • Phase 7: Update commands (20 min)
  • Phase 8: Setup automation (30 min)
  • Phase 9: Documentation (2.5 hours)
  • Phase 10: Example projects (30 min)
  • Phase 11: Final cleanup (15 min)

Total Remaining: ~6-8 hours


Next Steps

  1. Continue with Phase 4: Create scaffold-customizer agent
  2. Create SCAFFOLD_PLACEHOLDERS.md
  3. Create customize-scaffold command
  4. Create memory-focused skills (Phase 5)
  5. Write comprehensive documentation (Phase 9)
  6. Create examples and final polish

Last Updated: 2025-01-04 Status: In Progress - Foundation Complete