internal/skills/content/cleanup-project/SKILL.md
Project cleanup and pruning workflow. Use when removing unused guides, cleaning up stale components, or streamlining an Samuel installation to match actual project needs.
npx skillsauth add ar4mirez/samuel cleanup-projectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Trigger | Description |
|---------|-------------|
| Post-Initialization | After initialize-project.md completes |
| Quarterly Maintenance | Every 3 months as part of project hygiene |
| Pre-Release | Before major releases to reduce deployment footprint |
| Size Threshold | When .claude/ exceeds 1MB |
| Stack Change | After removing a language/framework from the project |
Before starting cleanup:
CLAUDE.md exists or stack is clear)Step 1: Analyze Project Stack
↓
Step 2: Prune Unused Guides
↓
Step 3: Archive Stale Tasks
↓
Step 4: Consolidate Memory
↓
Step 5: Clean Patterns
↓
Step 6: Update Documentation
↓
Output: Leaner .claude/ directory
Scan project files to identify which languages are actually used:
| File | Language |
|------|----------|
| package.json | TypeScript/JavaScript |
| tsconfig.json | TypeScript |
| requirements.txt, pyproject.toml, setup.py | Python |
| go.mod | Go |
| Cargo.toml | Rust |
| build.gradle.kts, *.kt | Kotlin |
| pom.xml, build.gradle, *.java | Java |
| *.csproj, *.sln | C# |
| composer.json | PHP |
| Package.swift, *.swift | Swift |
| CMakeLists.txt, Makefile, *.cpp, *.c | C/C++ |
| Gemfile, *.rb | Ruby |
| pubspec.yaml | Dart |
AI Action: List all detected languages based on project files.
Check dependency files for framework usage:
Node.js/TypeScript (package.json dependencies):
react, react-dom → Reactnext → Next.jsexpress → ExpressPython (requirements.txt, pyproject.toml):
django → Djangofastapi → FastAPIflask → FlaskGo (go.mod):
github.com/gin-gonic/gin → Gingithub.com/labstack/echo → Echogithub.com/gofiber/fiber → FiberRust (Cargo.toml):
axum → Axumactix-web → Actix-webrocket → Rocket(Continue for all language families)
AI Action: List all detected frameworks based on dependencies.
Create .claude/active-guides.json:
{
"generated": "2025-01-15T10:00:00Z",
"languages": [
"typescript"
],
"frameworks": [
"react",
"nextjs"
],
"guides_kept": [
"skills/typescript-guide/SKILL.md",
"skills/react/SKILL.md",
"skills/nextjs/SKILL.md"
],
"guides_archived": [
"skills/python-guide/SKILL.md",
"skills/go-guide/SKILL.md",
"..."
]
}
AI Action: Create active-guides.json with detected stack.
Compare existing guides against active-guides.json:
All Language Guides: 21
Active Languages: 1 (TypeScript)
Unused Guides: 20 (95% reduction possible)
All Framework Skills: 33
Active Frameworks: 2 (React, Next.js)
Unused Skills: 31 (94% reduction possible)
Move unused guides to .claude/.archive/ for potential future use:
# Create archive directories
mkdir -p .claude/.archive/skills
# Move unused language guide skills
mv .claude/skills/python-guide/ .claude/.archive/skills/
mv .claude/skills/go-guide/ .claude/.archive/skills/
# ... (all unused)
# Move unused framework skills
mv .claude/skills/django/ .claude/.archive/skills/
mv .claude/skills/fastapi/ .claude/.archive/skills/
# ... (all unused)
For maximum reduction, delete unused guides entirely:
# Delete unused language guide skills
rm -rf .claude/skills/python-guide/
rm -rf .claude/skills/go-guide/
# ... (all unused)
# Delete unused framework skills
rm -rf .claude/skills/django/
rm -rf .claude/skills/fastapi/
# ... (all unused)
Note: Deleted guides can be restored from the template repository if needed later.
Never remove these files regardless of stack:
.claude/README.md - Directory documentation.claude/skills/README.md - Skills index (language guides, framework skills, custom skills).claude/skills/* - All skills (stack-agnostic utilities and workflows)AI Action: Execute chosen strategy (archive or delete). Report space saved.
Find PRDs and task files older than 6 months:
# Find PRDs older than 180 days
find .claude/tasks -name "*" -mtime +180 -type f
For each old PRD, determine status:
| Status | Action |
|--------|--------|
| Completed | Archive to .claude/tasks/ARCHIVE/ |
| Abandoned | Archive with ABANDONED- prefix |
| Active | Keep in place (update modified date) |
# Create archive directory
mkdir -p .claude/tasks/ARCHIVE
# Move completed/abandoned PRDs
mv .claude/tasks/0001-prd-old-feature.md .claude/tasks/ARCHIVE/
mv .claude/tasks/tasks-0001-prd-old-feature.md .claude/tasks/ARCHIVE/
# For abandoned, rename with prefix
mv .claude/tasks/0002-prd-never-built.md .claude/tasks/ARCHIVE/ABANDONED-0002-prd-never-built.md
AI Action: Identify stale tasks, confirm status with user, archive appropriately.
Find memory files older than 3 months:
# Find memory files older than 90 days
find .claude/memory -name "*" -mtime +90 -type f
Consolidate old memory files into quarterly summaries:
# Q4 2024 Decision Summary
## Overview
This file consolidates decisions from October-December 2024.
## Key Decisions
### Authentication Strategy (2024-10-15)
- Chose JWT over sessions for stateless API
- See: archived/2024-10-15-auth-strategy.md
### Database Selection (2024-11-02)
- Selected PostgreSQL over MySQL
- See: archived/2024-11-02-database-choice.md
### Caching Approach (2024-12-10)
- Implemented Redis for distributed caching
- See: archived/2024-12-10-caching-approach.md
## Archived Files
- 2024-10-15-auth-strategy.md
- 2024-11-02-database-choice.md
- 2024-12-10-caching-approach.md
# Create archive directory
mkdir -p .claude/memory/archived
# Move old files
mv .claude/memory/2024-10-* .claude/memory/archived/
mv .claude/memory/2024-11-* .claude/memory/archived/
mv .claude/memory/2024-12-* .claude/memory/archived/
AI Action: Create quarterly summary, archive old memory files.
If CLAUDE.md exists, review for:
Example: If Python was pruned, remove Python-specific patterns:
## Removed Patterns
<!-- Remove this section if Python pruned -->
## Python Patterns
...
Merge similar patterns across languages into generic versions where applicable.
AI Action: Review and clean patterns.md if it exists.
Add project-specific information:
# .claude/ Directory
> **Project**: MyApp
> **Stack**: TypeScript, React, Next.js
> **Last Cleaned**: 2025-01-15
## Active Guides
- Language: TypeScript
- Frameworks: React, Next.js
## Archived Content
See `.archive/` for pruned guides (can be restored if stack changes).
Ensure manifest reflects final state after cleanup.
If not tracking generated content:
# Optional: Don't track cleanup artifacts
.claude/active-guides.json
.claude/.archive/
.claude/memory/archived/
.claude/tasks/ARCHIVE/
AI Action: Update documentation to reflect cleaned state.
After cleanup, report:
## Cleanup Summary
### Space Reduction
- Before: 2.4 MB
- After: 156 KB
- Saved: 2.24 MB (93% reduction)
### Guides
- Language guide skills: 21 → 1 (20 archived)
- Framework skills: 33 → 2 (31 archived)
### Tasks
- Active PRDs: 3
- Archived PRDs: 5
### Memory
- Active decisions: 4
- Archived to quarterly: 12
### Files Updated
- .claude/README.md ✓
- .claude/active-guides.json ✓
If you need a pruned guide later:
# Restore from archive
mv .claude/.archive/skills/python-guide/ .claude/skills/
mv .claude/.archive/skills/django/ .claude/skills/
# Re-download language guide skill from template
curl -o .claude/skills/python-guide/SKILL.md --create-dirs \
https://raw.githubusercontent.com/ar4mirez/samuel/main/.claude/skills/python-guide/SKILL.md
# Re-download framework skill from template
curl -o .claude/skills/django/SKILL.md --create-dirs \
https://raw.githubusercontent.com/ar4mirez/samuel/main/.claude/skills/django/SKILL.md
After restoration, regenerate active-guides.json by re-running Step 1.
This workflow can be automated with a script:
#!/bin/bash
# .claude/scripts/cleanup.sh
# Run cleanup workflow
# TODO: Implement automated detection and cleanup
Before completing cleanup:
active-guides.json createddevelopment
Zig language guardrails, patterns, and best practices for AI-assisted development. Use when working with Zig files (.zig), build.zig, or when the user mentions Zig. Provides comptime patterns, allocator conventions, C interop guidelines, and testing standards specific to this project's coding standards.
tools
WordPress framework guardrails, patterns, and best practices for AI-assisted development. Use when working with WordPress projects, or when the user mentions WordPress. Provides theme development, plugin architecture, REST API, blocks, and security guidelines.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs. Use when testing web apps, automating browser interactions, or debugging frontend issues.
tools
Suite of tools for creating elaborate, multi-component web applications using modern frontend technologies (React, Tailwind CSS, shadcn/ui). Use for complex projects requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX pages.