Skip to content

Commit 889a23e

Browse files
committed
refactor(claude): upgrade slash commands to md files
Latest way of doing slash commands for claude is to use markdown files under .claude/commands. YOu can namespace them, and doing this gets you integration with the /help command and the ability to run bash using the ! marker.
1 parent 6530a0a commit 889a23e

19 files changed

+1238
-194
lines changed

claude/.claude/CLAUDE.md

Lines changed: 168 additions & 64 deletions
Large diffs are not rendered by default.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[
2+
{
3+
"name": "memin",
4+
"description": "Load global and project memory files",
5+
"prompt": "Read the following memory files in order:\n1. Global memory at ~/.claude/CLAUDE.md\n2. Project memory at @CLAUDE.md (if it exists)\n\nSummarize what you've learned from these files, particularly any rules about git commits, PR descriptions, and coding standards."
6+
},
7+
{
8+
"name": "security-rules",
9+
"description": "Show DevSkim and CodeQL suppression syntax",
10+
"prompt": "Show me the security scanning suppression syntax rules from the global memory, specifically the DevSkim and CodeQL sections. Focus on the correct placement and syntax for each tool."
11+
},
12+
{
13+
"name": "preflight",
14+
"description": "Show preflight checks for current project",
15+
"prompt": "Based on the project type (check for deno.json, package.json, pyproject.toml, etc.), show me the appropriate preflight checks I should run before committing code."
16+
},
17+
{
18+
"name": "owasp",
19+
"description": "Show OWASP Top 10 security checklist",
20+
"prompt": "Show me the OWASP Top 10 checklist from global memory. Display each item with its title and key verification points."
21+
},
22+
{
23+
"name": "commit-style",
24+
"description": "Show conventional commit format and InfoSec guidelines",
25+
"prompt": "Show me the conventional commit format and InfoSec guidelines from global memory. Include examples of when to use InfoSec comments and the proper format."
26+
},
27+
{
28+
"name": "directory-structure",
29+
"description": "Show recommended project directory structure",
30+
"prompt": "Show me the recommended project directory structure from global memory. Include the standard directories, their purposes, and examples for different languages."
31+
},
32+
{
33+
"name": "checkpoint",
34+
"description": "Save session summary to docs/checkpoints/checkpoint-YYYY-MM-DD-{descriptive-name}.md",
35+
"prompt": "Create a session checkpoint by following these steps in order:\n\n1. CREATE CHECKPOINT FILE:\n - Path: `docs/checkpoints/checkpoint-YYYY-MM-DD-{descriptive-name}.md` (use today's date and a descriptive name based on the work done)\n - Create directory if needed: `mkdir -p docs/checkpoints`\n - Use markdown format\n\n2. CHECKPOINT CONTENT (use these exact sections):\n # Session Checkpoint - YYYY-MM-DD - {Descriptive Name}\n \n ## Summary of Work Accomplished\n List main tasks completed with brief descriptions\n \n ## Key Technical Decisions\n Document important architectural/implementation choices and rationale\n \n ## Files Created/Modified\n ### Created\n - List new files with purpose\n ### Modified\n - List changed files with type of change\n \n ## Problems Solved\n List issues resolved and their solutions\n \n ## Lessons Learned\n Key insights or patterns discovered\n \n ## Next Steps\n Potential future work or improvements\n\nIf a checkpoint for today already exists with the same descriptive name, append to it with a timestamp separator. Show progress after each step. If any step fails, report the error and continue with remaining steps."
36+
},
37+
{
38+
"name": "project",
39+
"description": "Manage project-specific memory",
40+
"prompt": "Manage project-specific memory files. Use the following commands:\n- `/project add <file>`: Add a file to the project context\n- `/project remove <file>`: Remove a file from the project context\n- `/project list`: List all files in the project context"
41+
},
42+
{
43+
"name": "commands",
44+
"description": "List all available slash commands",
45+
"prompt": "List all available slash commands from ~/.claude/settings.json in a clear, formatted way. You can use jq to do this. Include the command name, description, and prompt for each command."
46+
},
47+
{
48+
"name": "addglobal",
49+
"description": "Add global config to project context",
50+
"prompt": "/project add ~/.claude/CLAUDE.md"
51+
}
52+
]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[
2+
{
3+
"name": "memin",
4+
"description": "Load global and project memory files",
5+
"prompt": "Read the following memory files in order:\n1. Global memory at ~/.claude/CLAUDE.md\n2. Project memory at @CLAUDE.md (if it exists)\n\nSummarize what you've learned from these files, particularly any rules about git commits, PR descriptions, and coding standards."
6+
},
7+
{
8+
"name": "security-rules",
9+
"description": "Show DevSkim and CodeQL suppression syntax",
10+
"prompt": "Show me the security scanning suppression syntax rules from the global memory, specifically the DevSkim and CodeQL sections. Focus on the correct placement and syntax for each tool."
11+
},
12+
{
13+
"name": "preflight",
14+
"description": "Show preflight checks for current project",
15+
"prompt": "Based on the project type (check for deno.json, package.json, pyproject.toml, etc.), show me the appropriate preflight checks I should run before committing code."
16+
},
17+
{
18+
"name": "owasp",
19+
"description": "Show OWASP Top 10 security checklist",
20+
"prompt": "Show me the OWASP Top 10 checklist from global memory. Display each item with its title and key verification points."
21+
},
22+
{
23+
"name": "commit-style",
24+
"description": "Show conventional commit format and InfoSec guidelines",
25+
"prompt": "Show me the conventional commit format and InfoSec guidelines from global memory. Include examples of when to use InfoSec comments and the proper format."
26+
},
27+
{
28+
"name": "directory-structure",
29+
"description": "Show recommended project directory structure",
30+
"prompt": "Show me the recommended project directory structure from global memory. Include the standard directories, their purposes, and examples for different languages."
31+
},
32+
{
33+
"name": "checkpoint",
34+
"description": "Save session summary to docs/checkpoints/checkpoint-YYYY-MM-DD-{descriptive-name}.md",
35+
"prompt": "Create a session checkpoint by following these steps in order:\n\n1. CREATE CHECKPOINT FILE:\n - Path: `docs/checkpoints/checkpoint-YYYY-MM-DD-{descriptive-name}.md` (use today's date and a descriptive name based on the work done)\n - Create directory if needed: `mkdir -p docs/checkpoints`\n - Use markdown format\n\n2. CHECKPOINT CONTENT (use these exact sections):\n # Session Checkpoint - YYYY-MM-DD - {Descriptive Name}\n \n ## Summary of Work Accomplished\n List main tasks completed with brief descriptions\n \n ## Key Technical Decisions\n Document important architectural/implementation choices and rationale\n \n ## Files Created/Modified\n ### Created\n - List new files with purpose\n ### Modified\n - List changed files with type of change\n \n ## Problems Solved\n List issues resolved and their solutions\n \n ## Lessons Learned\n Key insights or patterns discovered\n \n ## Next Steps\n Potential future work or improvements\n\nIf a checkpoint for today already exists with the same descriptive name, append to it with a timestamp separator. Show progress after each step. If any step fails, report the error and continue with remaining steps."
36+
},
37+
{
38+
"name": "project",
39+
"description": "Manage project-specific memory",
40+
"prompt": "Manage project-specific memory files. Use the following commands:\n- `/project add <file>`: Add a file to the project context\n- `/project remove <file>`: Remove a file from the project context\n- `/project list`: List all files in the project context"
41+
},
42+
{
43+
"name": "commands",
44+
"description": "List all available slash commands",
45+
"prompt": "List all available slash commands from ~/.claude/settings.json in a clear, formatted way. You can use jq to do this. Include the command name, description, and prompt for each command."
46+
},
47+
{
48+
"name": "addglobal",
49+
"description": "Add global config to project context",
50+
"prompt": "/project add ~/.claude/CLAUDE.md"
51+
}
52+
]
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Claude Commands Migration Summary
2+
3+
## Migration Details
4+
- **Date**: 2025-07-14
5+
- **Migration Type**: Legacy commands to MCP (Model Context Protocol) format
6+
- **Backup Location**: Original commands preserved with `.bak` extension
7+
8+
## Commands Migrated
9+
10+
The following 10 commands were successfully migrated to the new MCP format:
11+
12+
1. **analyze-project**`mcp__aichaku-reviewer__analyze_project`
13+
- Analyzes project structure, languages, architecture, and dependencies
14+
15+
2. **create-doc-template**`mcp__aichaku-reviewer__create_doc_template`
16+
- Creates documentation template files for tutorials, how-tos, references, etc.
17+
18+
3. **generate-documentation**`mcp__aichaku-reviewer__generate_documentation`
19+
- Generates comprehensive documentation following selected standards
20+
21+
4. **get-standards**`mcp__aichaku-reviewer__get_standards`
22+
- Gets currently selected standards for the project
23+
24+
5. **get-statistics**`mcp__aichaku-reviewer__get_statistics`
25+
- Gets usage statistics and analytics for MCP tool usage
26+
27+
6. **repo-list**`mcp__github-operations__repo_list`
28+
- Lists user repositories
29+
30+
7. **review-file**`mcp__aichaku-reviewer__review_file`
31+
- Reviews a file for security, standards, and methodology compliance
32+
33+
8. **review-methodology**`mcp__aichaku-reviewer__review_methodology`
34+
- Checks if project follows selected methodology patterns
35+
36+
9. **run-list**`mcp__github-operations__run_list`
37+
- Lists GitHub Actions workflow runs
38+
39+
10. **run-view**`mcp__github-operations__run_view`
40+
- Views GitHub Actions workflow run details
41+
42+
## Benefits of the New MCP Format
43+
44+
### 1. **Standardized Protocol**
45+
- MCP provides a consistent interface for all tools
46+
- Better integration with Claude's capabilities
47+
- Improved error handling and validation
48+
49+
### 2. **Enhanced Type Safety**
50+
- Proper parameter validation
51+
- Clear type definitions for inputs and outputs
52+
- Better error messages
53+
54+
### 3. **Automatic Discovery**
55+
- Tools are automatically discovered by Claude
56+
- No manual registration required
57+
- Seamless updates when new tools are added
58+
59+
### 4. **Better Documentation**
60+
- Each tool has built-in description
61+
- Parameter documentation included
62+
- Examples and usage patterns
63+
64+
### 5. **Server-Based Architecture**
65+
- Tools run as separate MCP servers
66+
- Better isolation and security
67+
- Can be updated independently
68+
69+
## How to Use the New Commands
70+
71+
The new MCP commands are automatically available in Claude. Simply use them by their new names:
72+
73+
### Examples:
74+
75+
**Analyze a project:**
76+
```
77+
Use mcp__aichaku-reviewer__analyze_project with projectPath: "/path/to/project"
78+
```
79+
80+
**Review a file:**
81+
```
82+
Use mcp__aichaku-reviewer__review_file with file: "/path/to/file.ts"
83+
```
84+
85+
**List repositories:**
86+
```
87+
Use mcp__github-operations__repo_list
88+
```
89+
90+
**Generate documentation:**
91+
```
92+
Use mcp__aichaku-reviewer__generate_documentation with projectPath: "/path/to/project"
93+
```
94+
95+
### Key Differences:
96+
1. Commands now use the `mcp__` prefix
97+
2. Server name is included (e.g., `aichaku-reviewer`, `github-operations`)
98+
3. Parameters are passed as named arguments
99+
4. No need to manually load or configure commands
100+
101+
## Legacy Command Backups
102+
103+
All original command files have been preserved with a `.bak` extension in case you need to reference them:
104+
- `analyze-project.md.bak`
105+
- `create-doc-template.md.bak`
106+
- `generate-documentation.md.bak`
107+
- etc.
108+
109+
These backups are located in the same `~/.claude/commands/` directory.
110+
111+
## Next Steps
112+
113+
1. The new MCP commands are immediately available for use
114+
2. No action required - Claude will automatically use the new format
115+
3. Legacy backups can be safely deleted once you're comfortable with the new system
116+
4. Check MCP server logs at `~/.claude/logs/` if you encounter any issues
117+
118+
## Additional Resources
119+
120+
- MCP Documentation: Available in your Claude settings
121+
- Server Configuration: `~/.claude/mcp-settings.json`
122+
- Logs: `~/.claude/logs/mcp-*.log`
123+
124+
---
125+
126+
*This migration was performed automatically to improve the command system's reliability and features.*
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
allowed-tools: Write, Bash
3+
description: Save session summary to docs/checkpoints/checkpoint-YYYY-MM-DD-{descriptive-name}.md
4+
---
5+
6+
## Context
7+
- Current date: !`date +%Y-%m-%d`
8+
- Current time: !`date +%H%M%S`
9+
- Current directory: !`pwd`
10+
- Git status: !`git status --porcelain | head -10`
11+
12+
## Your task
13+
Create a session checkpoint documenting our work. Use the arguments "$ARGUMENTS" as the descriptive name.
14+
15+
Create the checkpoint file at `docs/checkpoints/checkpoint-{current-date}-{descriptive-name}.md` with the following structure:
16+
17+
```markdown
18+
# Session Checkpoint - {current-date} - {Descriptive Name}
19+
20+
## Summary of Work Accomplished
21+
[List main tasks completed with brief descriptions]
22+
23+
## Key Technical Decisions
24+
[Document important architectural/implementation choices and rationale]
25+
26+
## Files Created/Modified
27+
28+
### Created
29+
- [List new files with purpose]
30+
31+
### Modified
32+
- [List changed files with type of change]
33+
34+
## Problems Solved
35+
[List issues resolved and their solutions]
36+
37+
## Lessons Learned
38+
[Key insights or patterns discovered]
39+
40+
## Next Steps
41+
[Potential future work or improvements]
42+
43+
---
44+
*Checkpoint created: {timestamp}*
45+
```
46+
47+
First create the docs/checkpoints directory if it doesn't exist, then create the checkpoint file with today's date and the descriptive name from the arguments.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
allowed-tools: Read
3+
description: Load global and project memory files
4+
---
5+
6+
# Load Memory Files
7+
8+
I'll load and analyze the relevant memory files for this session.
9+
10+
## 1. Global Memory
11+
Loading the global memory file that applies to all projects:
12+
13+
@~/.claude/CLAUDE.md
14+
15+
## 2. Project Memory
16+
Checking for project-specific memory:
17+
18+
@CLAUDE.md
19+
20+
## Summary
21+
22+
Based on the memory files loaded, I'll summarize what I've learned, particularly:
23+
- Rules about git commits and PR descriptions
24+
- Coding standards and conventions
25+
- Security requirements (OWASP, InfoSec)
26+
- Project-specific guidelines
27+
28+
$ARGUMENTS
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
allowed-tools: Read, Write, Edit, LS
3+
description: Manage project-specific memory
4+
---
5+
6+
## Context
7+
8+
Arguments provided: $ARGUMENTS
9+
10+
Project memory context file: !`echo ~/.claude/project-context.md`
11+
Current working directory: !`pwd`
12+
13+
## Your task
14+
15+
You are managing project-specific memory files. Parse the subcommand from the arguments and execute the appropriate action:
16+
17+
### If arguments contain "add":
18+
1. Extract the file path from the arguments (everything after "add")
19+
2. Validate the file path exists using the Read tool
20+
3. Add the file path to ~/.claude/project-context.md (create if it doesn't exist)
21+
4. Confirm the file was added to project context
22+
23+
### If arguments contain "remove":
24+
1. Extract the file path from the arguments (everything after "remove")
25+
2. Remove the file path from ~/.claude/project-context.md
26+
3. Confirm the file was removed from project context
27+
28+
### If arguments contain "list":
29+
1. Read ~/.claude/project-context.md if it exists
30+
2. Display all files currently in the project context
31+
3. If no context file exists, inform that no files are tracked
32+
33+
### Format for ~/.claude/project-context.md:
34+
```
35+
# Project Context Files
36+
37+
## Currently Tracked Files
38+
- /path/to/file1.md
39+
- /path/to/file2.md
40+
- /path/to/file3.md
41+
42+
Last updated: [timestamp]
43+
```
44+
45+
Execute the appropriate action based on the subcommand in the arguments.

0 commit comments

Comments
 (0)