Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:03:19 +08:00
commit c4ecaac3b8
10 changed files with 280 additions and 0 deletions

17
commands/current.md Normal file
View File

@@ -0,0 +1,17 @@
---
description: Show the current session status
allowed-tools: Bash, Read
---
Show the current session status by:
1. Check if `.claude/sessions/.current-session` exists
2. If no active session, inform user and suggest starting one
3. If active session exists:
- Show session name and filename
- Calculate and show duration since start
- Show last few updates
- Show current goals/tasks
- Remind user of available commands
Keep the output concise and informative.

35
commands/end.md Normal file
View File

@@ -0,0 +1,35 @@
---
description: End the current development session with summary
allowed-tools: Bash, Read, Write
---
End the current development session by:
1. Check `.claude/sessions/.current-session` for the active session
2. If no active session, inform user there's nothing to end
3. If session exists, append a comprehensive summary including:
- Session duration
- Git summary:
* Total files changed (added/modified/deleted)
* List all changed files with change type
* Number of commits made (if any)
* Final git status
- Todo summary:
* Total tasks completed/remaining
* List all completed tasks
* List any incomplete tasks with status
- Key accomplishments
- All features implemented
- Problems encountered and solutions
- Breaking changes or important findings
- Dependencies added/removed
- Configuration changes
- Deployment steps taken
- Lessons learned
- What wasn't completed
- Tips for future developers
4. Empty the `.claude/sessions/.current-session` file (don't remove it, just clear its contents)
5. Inform user the session has been documented
The summary should be thorough enough that another developer (or AI) can understand everything that happened without reading the entire session.

43
commands/help.md Normal file
View File

@@ -0,0 +1,43 @@
---
description: Display help for the session management system
disable-model-invocation: true
---
Show help for the session management system:
## Session Management Commands
The session system helps document development work for future reference.
### Available Commands:
- `/session-start [name]` - Start a new session with optional name
- `/session-update [notes]` - Add notes to current session
- `/session-end` - End session with comprehensive summary
- `/session-list` - List all session files
- `/session-current` - Show current session status
- `/session-resume [filename]` - Resume a previous session
- `/session-help` - Show this help
### How It Works:
1. Sessions are markdown files in `.claude/sessions/`
2. Files use `YYYY-MM-DD-HHMM-name.md` format
3. Only one session can be active at a time
4. Sessions track progress, issues, solutions, and learnings
### Best Practices:
- Start a session when beginning significant work
- Update regularly with important changes or findings
- End with thorough summary for future reference
- Review past sessions before starting similar work
### Example Workflow:
```
/session-start refactor-auth
/session-update Added Google OAuth restriction
/session-update Fixed Next.js 15 params Promise issue
/session-end
```

18
commands/list.md Normal file
View File

@@ -0,0 +1,18 @@
---
description: List all development sessions
allowed-tools: Bash, Read
---
List all development sessions by:
1. Check if `.claude/sessions/` directory exists
2. List all `.md` files (excluding hidden files and `.current-session`)
3. For each session file:
- Show the filename
- Extract and show the session title
- Show the date/time
- Show first few lines of the overview if available
4. If `.claude/sessions/.current-session` exists, highlight which session is currently active
5. Sort by most recent first
Present in a clean, readable format.

21
commands/resume.md Normal file
View File

@@ -0,0 +1,21 @@
---
description: Resume a previous development session
argument-hint: <filename>
allowed-tools: Bash, Read, Write
---
Resume a previous development session by:
1. Check if $ARGUMENTS contains a session filename
2. If no filename provided, list available sessions and ask user to specify one
3. Verify the session file exists in `.claude/sessions/`
4. If session file exists:
- Display the session filename and title
- Show the session overview (start time, initial goals)
- Calculate and show elapsed time since session started
- Show last few updates from the session file
- Update `.claude/sessions/.current-session` to contain this filename
- Confirm the session has been resumed
5. If session file doesn't exist, show error and list available sessions
Present the information in a clear, concise format.

19
commands/start.md Normal file
View File

@@ -0,0 +1,19 @@
---
description: Start a new development session
argument-hint: [name]
allowed-tools: Bash, Write, AskUserQuestion
---
Start a new development session by creating a session file in `.claude/sessions/` with the format `YYYY-MM-DD-HHMM-$ARGUMENTS.md` (or just `YYYY-MM-DD-HHMM.md` if no name provided).
The session file should begin with:
1. Session name and timestamp as the title
2. Session overview section with start time
3. Goals section (ask user for goals if not clear)
4. Empty progress section ready for updates
After creating the file, create or update `.claude/sessions/.current-session` to track the active session filename.
Confirm the session has started and remind the user they can:
- Update it with `/session-update`
- End it with `/session-end`

43
commands/update.md Normal file
View File

@@ -0,0 +1,43 @@
---
description: Update the current development session with progress notes
argument-hint: [notes]
allowed-tools: Bash, Read, Write
---
Update the current development session by:
1. Check if `.claude/sessions/.current-session` exists to find the active session
2. If no active session, inform user to start one with `/session-start`
3. If session exists, append to the session file with:
- Current timestamp
- The update: $ARGUMENTS (or if no arguments, summarize recent activities)
- Git status summary:
* Files added/modified/deleted (from `git status --porcelain`)
* Current branch and last commit
- Todo list status:
* Number of completed/in-progress/pending tasks
* List any newly completed tasks
- Any issues encountered
- Solutions implemented
- Code changes made
Keep updates concise but comprehensive for future reference.
Example format:
```
### Update - 2025-06-16 12:15 PM
**Summary**: Implemented user authentication
**Git Changes**:
- Modified: app/middleware.ts, lib/auth.ts
- Added: app/login/page.tsx
- Current branch: main (commit: abc123)
**Todo Progress**: 3 completed, 1 in progress, 2 pending
- ✓ Completed: Set up auth middleware
- ✓ Completed: Create login page
- ✓ Completed: Add logout functionality
**Details**: [user's update or automatic summary]
```