From e7974771c61e8894fef79068c34174b852b35d0a Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 18:14:22 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 +++ README.md | 3 + commands/update-claudemd.md | 144 ++++++++++++++++++++++++++++++++++++ plugin.lock.json | 45 +++++++++++ 4 files changed, 204 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/update-claudemd.md create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..7b09ef1 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "update-claudemd", + "description": "Automatically update CLAUDE.md file based on recent code changes", + "version": "1.0.0", + "author": { + "name": "ClaudeForge Community", + "url": "https://github.com/claudeforge/marketplace" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..336ccfe --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# update-claudemd + +Automatically update CLAUDE.md file based on recent code changes diff --git a/commands/update-claudemd.md b/commands/update-claudemd.md new file mode 100644 index 0000000..23ed42a --- /dev/null +++ b/commands/update-claudemd.md @@ -0,0 +1,144 @@ +--- +allowed-tools: Bash(git diff:*), Bash(git log:*), Bash(git status:*), Bash(find:*), Bash(grep:*), Bash(wc:*), Bash(ls:*) +description: Automatically update CLAUDE.md file based on recent code changes +--- + +# Update Claude.md File + +## Current Claude.md State +@CLAUDE.md + +## Git Analysis + +### Current Repository Status +!`git status --porcelain` + +### Recent Changes (Last 10 commits) +!`git log --oneline -10` + +### Detailed Recent Changes +!`git log --since="1 week ago" --pretty=format:"%h - %an, %ar : %s" --stat` + +### Recent Diff Analysis +!`git diff HEAD~5 --name-only | head -20` + +### Detailed Diff of Key Changes +!`git diff HEAD~5 -- "*.js" "*.ts" "*.jsx" "*.tsx" "*.py" "*.md" "*.json" | head -200` + +### New Files Added +!`git diff --name-status HEAD~10 | grep "^A" | head -15` + +### Deleted Files +!`git diff --name-status HEAD~10 | grep "^D" | head -10` + +### Modified Core Files +!`git diff --name-status HEAD~10 | grep "^M" | grep -E "(package\.json|README|config|main|index|app)" | head -10` + +## Project Structure Changes +!`find . -name "*.md" -not -path "./node_modules/*" -not -path "./.git/*" | head -10` + +## Configuration Changes +!`git diff HEAD~10 -- package.json tsconfig.json webpack.config.js next.config.js .env* docker* | head -100` + +## API/Route Changes +!`git diff HEAD~10 -- "**/routes/**" "**/api/**" "**/controllers/**" | head -150` + +## Database/Model Changes +!`git diff HEAD~10 -- "**/models/**" "**/schemas/**" "**/migrations/**" | head -100` + +## Your Task + +Based on the current CLAUDE.md content and all the git analysis above, create an updated CLAUDE.md file that: + +## 1. Preserves Important Existing Content +- Keep the core project description and architecture +- Maintain important setup instructions +- Preserve key architectural decisions and patterns +- Keep essential development workflow information + +## 2. Integrates Recent Changes +Analyze the git diff and logs to identify: +- **New Features**: What new functionality was added? +- **API Changes**: New endpoints, modified routes, updated parameters +- **Configuration Updates**: Changes to build tools, dependencies, environment variables +- **File Structure Changes**: New directories, moved files, deleted components +- **Database Changes**: New models, schema updates, migrations +- **Bug Fixes**: Important fixes that affect how the system works +- **Refactoring**: Significant code reorganization or architectural changes + +## 3. Updates Key Sections +Intelligently update these CLAUDE.md sections: + +### Project Overview +- Update description if scope changed +- Note new technologies or frameworks added +- Update version information + +### Architecture +- Document new architectural patterns +- Note significant structural changes +- Update component relationships + +### Setup Instructions +- Add new environment variables +- Update installation steps if dependencies changed +- Note new configuration requirements + +### API Documentation +- Add new endpoints discovered in routes +- Update existing endpoint documentation +- Note authentication or parameter changes + +### Development Workflow +- Update based on new scripts in package.json +- Note new development tools or processes +- Update testing procedures if changed + +### Recent Changes Section +Add a "Recent Updates" section with: +- Summary of major changes from git analysis +- New features and their impact +- Important bug fixes +- Breaking changes developers should know about + +### File Structure +- Update directory explanations for new folders +- Note relocated or reorganized files +- Document new important files + +## 4. Smart Content Management +- **Don't duplicate**: Avoid repeating information already well-documented +- **Prioritize relevance**: Focus on changes that affect how developers work with the code +- **Keep it concise**: Summarize rather than listing every small change +- **Maintain structure**: Follow existing CLAUDE.md organization +- **Add timestamps**: Note when major updates were made + +## 5. Output Format +Provide the complete updated CLAUDE.md content, organized as: + +```markdown +# Project Name + +## Overview +[Updated project description] + +## Architecture +[Updated architecture information] + +## Setup & Installation +[Updated setup instructions] + +## Development Workflow +[Updated development processes] + +## API Documentation +[Updated API information] + +## File Structure +[Updated directory explanations] + +## Recent Updates (Updated: YYYY-MM-DD) +[Summary of recent changes] + +## Important Notes +[Key information for developers] \ No newline at end of file diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..619970e --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:claudeforge/marketplace:plugins/commands/update-claudemd", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "d4c21e9743cd3775147078d9fba8c430ab7996f7", + "treeHash": "adbfad8daf3efed0696eb9159cb9ee18dbba00a1c17d9fb986634a01f3ba39b2", + "generatedAt": "2025-11-28T10:15:39.758534Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "update-claudemd", + "description": "Automatically update CLAUDE.md file based on recent code changes", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "6f28ff50fd4e7f6a80ba5827d9e5684095fce386d520ddf2a92204f20c78eb2e" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "dd26cbad8b26329029593a6ad644c211c3f39323012dab3967d871465a5fe28e" + }, + { + "path": "commands/update-claudemd.md", + "sha256": "ceb96690e50bc5a8aef9f1c5ffad30284f6bdc5e711e891778d2ed5605aed899" + } + ], + "dirSha256": "adbfad8daf3efed0696eb9159cb9ee18dbba00a1c17d9fb986634a01f3ba39b2" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file