From c4ecaac3b82e585f2272764e23e212953f4dcb96 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 18:03:19 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 +++++++ README.md | 3 ++ commands/current.md | 17 ++++++++++ commands/end.md | 35 +++++++++++++++++++ commands/help.md | 43 ++++++++++++++++++++++++ commands/list.md | 18 ++++++++++ commands/resume.md | 21 ++++++++++++ commands/start.md | 19 +++++++++++ commands/update.md | 43 ++++++++++++++++++++++++ plugin.lock.json | 69 ++++++++++++++++++++++++++++++++++++++ 10 files changed, 280 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/current.md create mode 100644 commands/end.md create mode 100644 commands/help.md create mode 100644 commands/list.md create mode 100644 commands/resume.md create mode 100644 commands/start.md create mode 100644 commands/update.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..885dd09 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "session-management", + "description": "Flat session management system with .current-session tracking. Adapted from iannuttall/claude-sessions.", + "version": "1.1.0", + "author": { + "name": "Mae Capacite; Ian Nuttall (original)", + "email": "cadrianmae@users.noreply.github.com" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..bf48e66 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# session-management + +Flat session management system with .current-session tracking. Adapted from iannuttall/claude-sessions. diff --git a/commands/current.md b/commands/current.md new file mode 100644 index 0000000..97eb982 --- /dev/null +++ b/commands/current.md @@ -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. diff --git a/commands/end.md b/commands/end.md new file mode 100644 index 0000000..1ef7d9f --- /dev/null +++ b/commands/end.md @@ -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. \ No newline at end of file diff --git a/commands/help.md b/commands/help.md new file mode 100644 index 0000000..771cf3b --- /dev/null +++ b/commands/help.md @@ -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 +``` \ No newline at end of file diff --git a/commands/list.md b/commands/list.md new file mode 100644 index 0000000..83da19a --- /dev/null +++ b/commands/list.md @@ -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. \ No newline at end of file diff --git a/commands/resume.md b/commands/resume.md new file mode 100644 index 0000000..8bab8f4 --- /dev/null +++ b/commands/resume.md @@ -0,0 +1,21 @@ +--- +description: Resume a previous development session +argument-hint: +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. diff --git a/commands/start.md b/commands/start.md new file mode 100644 index 0000000..e24cd30 --- /dev/null +++ b/commands/start.md @@ -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` \ No newline at end of file diff --git a/commands/update.md b/commands/update.md new file mode 100644 index 0000000..9577a72 --- /dev/null +++ b/commands/update.md @@ -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] +``` \ No newline at end of file diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..2e3d445 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,69 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:cadrianmae/claude-marketplace:plugins/session-management", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "d0918de77ee4309cbfcff1ddbeec6be304f5f7d3", + "treeHash": "c4cfa232870754a9dd40b34abb5a0defaf7490e4ceb6d3a8c287d29167ea0879", + "generatedAt": "2025-11-28T10:14:27.165166Z", + "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": "session-management", + "description": "Flat session management system with .current-session tracking. Adapted from iannuttall/claude-sessions.", + "version": "1.1.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "ce7499211e4e98612529128e2f8bcfd7472420a38c0be02c0d08782c9f3cbda4" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "7a3b4a96e1221ea9018313182d0bd4fa69b1538d2ce1f8ab4d2a96b3450c65fb" + }, + { + "path": "commands/help.md", + "sha256": "203cb39ea08e737fa35172392be4ac13963c32ab72f26b00a59326d519d1e23c" + }, + { + "path": "commands/list.md", + "sha256": "7c2da0edd4ec78cf47613db610cfb84097f1faa74e7908a8e2b768a35c6f8b53" + }, + { + "path": "commands/resume.md", + "sha256": "32d58f53a3b4b2161f43019ef736f4004a2e9924c87ce2c5fa0cfe3ef60dd73f" + }, + { + "path": "commands/update.md", + "sha256": "0fdf11ae5f350cbabb3350cace005d0bcd12fdcc0076feb72187fe7e66e3763c" + }, + { + "path": "commands/current.md", + "sha256": "33b346f60453db71cf00acf2a42215f8f68a08f42dab9ee7486e285bef5eeecd" + }, + { + "path": "commands/end.md", + "sha256": "f66c6edc267b7f6e5e0f84502cc8a9e993faf24195c9884fddc67fde260b60d9" + }, + { + "path": "commands/start.md", + "sha256": "9ea19622ff49fd8896c8d6693f94dc322bc81ca465885ddf59ecc06bdde66df4" + } + ], + "dirSha256": "c4cfa232870754a9dd40b34abb5a0defaf7490e4ceb6d3a8c287d29167ea0879" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file