Initial commit
This commit is contained in:
12
.claude-plugin/plugin.json
Normal file
12
.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "dt-code",
|
||||||
|
"description": "Tools for improving code quality.",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"author": {
|
||||||
|
"name": "Dan Turkel",
|
||||||
|
"email": "daturkel@gmail.com"
|
||||||
|
},
|
||||||
|
"commands": [
|
||||||
|
"./commands"
|
||||||
|
]
|
||||||
|
}
|
||||||
36
commands/document.md
Normal file
36
commands/document.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
description: Add documentation to functions/classes that have been modified
|
||||||
|
argument-hint: [file_path]
|
||||||
|
allowed-tools: Read, Edit, Bash(git status:*), Bash(git diff:*), Task
|
||||||
|
---
|
||||||
|
|
||||||
|
Add or improve documentation for functions and classes that have been modified in the current git diff.
|
||||||
|
|
||||||
|
Focus on (if provided): $ARGUMENTS
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
- Modified files: !`git status --short`
|
||||||
|
- Changes in staged files: !`git diff --cached`
|
||||||
|
- Changes in unstaged files: !`git diff`
|
||||||
|
|
||||||
|
## Your task
|
||||||
|
|
||||||
|
1. Read the relevant files, making note of what the user requested to focus on (if anything)
|
||||||
|
2. Analyze the git diff output above to identify which functions/classes/methods were modified
|
||||||
|
3. Focus ONLY on documenting the functions/classes that appear in the diff
|
||||||
|
4. Use the Edit tool to add documentation directly to the file
|
||||||
|
|
||||||
|
Documentation style guidelines:
|
||||||
|
- **Concise but complete**: Explain what's non-obvious, skip what's self-evident
|
||||||
|
- **Focus on "why" and "what"**: Explain purpose and behavior, not just repeating the code
|
||||||
|
- **Include types**: Document parameter and return types if not already typed
|
||||||
|
- **Keep it maintainable**: Don't over-document trivial code
|
||||||
|
|
||||||
|
Important:
|
||||||
|
- Do NOT change any code logic, only add/improve documentation
|
||||||
|
- Preserve existing code style and formatting
|
||||||
|
- Use language-appropriate documentation conventions
|
||||||
|
- For Python, use Google-style docstrings.
|
||||||
|
- For files with existing docs, improve them rather than duplicating
|
||||||
|
- ONLY document functions/classes that appear in the git diff context above
|
||||||
42
commands/review.md
Normal file
42
commands/review.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
description: Review code changes in modified files since origin/HEAD
|
||||||
|
argument-hint: [file_path]
|
||||||
|
allowed-tools: Read, Bash(git diff:*), Bash(git log:*), Bash(git status:*), Task
|
||||||
|
---
|
||||||
|
|
||||||
|
Review all modified files since origin/HEAD, or focus on specific files if provided.
|
||||||
|
|
||||||
|
Focus on (if provided): $ARGUMENTS
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
- Modified files: !`git status --short`
|
||||||
|
- Branch comparison: !`git diff origin/HEAD...HEAD --stat`
|
||||||
|
- Recent commits: !`git log origin/HEAD..HEAD --oneline`
|
||||||
|
|
||||||
|
## Your task
|
||||||
|
|
||||||
|
1. Identify files that have been modified since origin/HEAD
|
||||||
|
2. If the user specified files in arguments, filter to only those files
|
||||||
|
3. For each modified file, launch an agent to review it (keeping in context the diff of related files)
|
||||||
|
4. Each review agent should analyze:
|
||||||
|
- **Code quality**: Logic clarity, maintainability, adherence to best practices
|
||||||
|
- **Potential issues**: Bugs, edge cases, error handling gaps
|
||||||
|
- **Security concerns**: Vulnerabilities, unsafe patterns, input validation
|
||||||
|
- **Performance**: Obvious inefficiencies or optimization opportunities
|
||||||
|
- **Testing**: Whether the changes would benefit from additional tests
|
||||||
|
- **Documentation**: Whether the changes are sufficiently documented
|
||||||
|
|
||||||
|
5. Compile the reviews and present a summary for each file
|
||||||
|
|
||||||
|
Review guidelines:
|
||||||
|
- **Be constructive**: Focus on actionable feedback
|
||||||
|
- **Prioritize**: Highlight critical issues before minor suggestions
|
||||||
|
- **Be specific**: Reference line numbers and code snippets
|
||||||
|
- **Context-aware**: Consider the file's purpose and the nature of changes
|
||||||
|
|
||||||
|
Important:
|
||||||
|
- Each agent should receive the git diff for their specific file and related files
|
||||||
|
- Focus primarily on the actual changes (diff), not the entire file
|
||||||
|
- If no files are modified, inform the user
|
||||||
|
- Format output clearly with file names as headers
|
||||||
49
plugin.lock.json
Normal file
49
plugin.lock.json
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"$schema": "internal://schemas/plugin.lock.v1.json",
|
||||||
|
"pluginId": "gh:daturkel/dt-cc:plugins/dt-code",
|
||||||
|
"normalized": {
|
||||||
|
"repo": null,
|
||||||
|
"ref": "refs/tags/v20251128.0",
|
||||||
|
"commit": "deb1071b84080fc17201525c25e63b0fbcac6cad",
|
||||||
|
"treeHash": "44d7771f1d5f18d9f02a74b616bb52839d88f23659a7f7ab2aee721f54719a04",
|
||||||
|
"generatedAt": "2025-11-28T10:16:07.649122Z",
|
||||||
|
"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": "dt-code",
|
||||||
|
"description": "Tools for improving code quality.",
|
||||||
|
"version": "0.1.0"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "README.md",
|
||||||
|
"sha256": "6ae23ed4fefeb79505d02df2f9d4193bfda9d82f63d619c4ba28ba585276b495"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".claude-plugin/plugin.json",
|
||||||
|
"sha256": "64aae7759149937e029262c5a480b121f0837ea5a72468aa03a221cc984992ec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "commands/document.md",
|
||||||
|
"sha256": "70146956b97055340be3a408867001a8b2e2d7ba7a50e66294b68f3ded6056e5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "commands/review.md",
|
||||||
|
"sha256": "0c6cdebed964aaa3a9f1519589d345a3ec596d4d857030e357392e49c26e42f4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dirSha256": "44d7771f1d5f18d9f02a74b616bb52839d88f23659a7f7ab2aee721f54719a04"
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"scannedAt": null,
|
||||||
|
"scannerVersion": null,
|
||||||
|
"flags": []
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user