diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 618e34b..852e5c3 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -10,6 +10,19 @@ "pluginRoot": "." }, "plugins": [ + { + "name": "ai-proj-plugin", + "source": "./skills-core/ai-proj-plugin", + "description": "AI project management via REST API. Works out of the box!", + "version": "2.0.1", + "category": "productivity", + "keywords": [ + "project-management", + "tasks", + "requirements" + ], + "strict": false + }, { "name": "agent-swarm-plugin", "source": "./skills-dev/agent-swarm-plugin", @@ -457,71 +470,6 @@ ], "strict": false }, - { - "name": "ai-proj-plugin", - "source": "./skills-workflow/ai-proj-plugin", - "description": "AI project management via REST API. Works out of the box!", - "version": "2.0.1", - "category": "productivity", - "keywords": [ - "project-management", - "tasks", - "requirements" - ], - "strict": false - }, - { - "name": "read-session-plugin", - "source": "./skills-workflow/read-session-plugin", - "description": "Plugin for read-session", - "version": "1.0.0", - "category": "workflow", - "keywords": [ - "session", - "workflow", - "productivity" - ], - "strict": false - }, - { - "name": "reload-session-plugin", - "source": "./skills-workflow/reload-session-plugin", - "description": "Plugin for reload-session", - "version": "1.0.0", - "category": "workflow", - "keywords": [ - "session", - "workflow", - "productivity" - ], - "strict": false - }, - { - "name": "save-session-plugin", - "source": "./skills-workflow/save-session-plugin", - "description": "Plugin for save-session", - "version": "1.0.0", - "category": "workflow", - "keywords": [ - "session", - "workflow", - "productivity" - ], - "strict": false - }, - { - "name": "search-sessions-plugin", - "source": "./skills-workflow/search-sessions-plugin", - "description": "Plugin for search-sessions", - "version": "1.0.0", - "category": "workflow", - "keywords": [ - "session", - "workflow", - "productivity" - ], - "strict": false - }, { "name": "session-plugin", "source": "./skills-workflow/session-plugin", diff --git a/generate-marketplace.py b/generate-marketplace.py index 8fcf06a..84e67e2 100644 --- a/generate-marketplace.py +++ b/generate-marketplace.py @@ -16,6 +16,7 @@ marketplace_file = script_dir / ".claude-plugin" / "marketplace.json" # Skill directories (label, directory name) SKILL_DIRS = [ + ("core", "skills-core"), ("dev", "skills-dev"), ("req", "skills-req"), ("ops", "skills-ops"), diff --git a/skills-workflow/ai-proj-plugin/.claude-plugin/plugin.json b/skills-core/ai-proj-plugin/.claude-plugin/plugin.json similarity index 100% rename from skills-workflow/ai-proj-plugin/.claude-plugin/plugin.json rename to skills-core/ai-proj-plugin/.claude-plugin/plugin.json diff --git a/skills-workflow/ai-proj-plugin/README.md b/skills-core/ai-proj-plugin/README.md similarity index 100% rename from skills-workflow/ai-proj-plugin/README.md rename to skills-core/ai-proj-plugin/README.md diff --git a/skills-workflow/ai-proj-plugin/skills/SKILL.md b/skills-core/ai-proj-plugin/skills/SKILL.md similarity index 100% rename from skills-workflow/ai-proj-plugin/skills/SKILL.md rename to skills-core/ai-proj-plugin/skills/SKILL.md diff --git a/skills-workflow/read-session-plugin/.claude-plugin/plugin.json b/skills-workflow/read-session-plugin/.claude-plugin/plugin.json deleted file mode 100644 index 653a635..0000000 --- a/skills-workflow/read-session-plugin/.claude-plugin/plugin.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "read-session-plugin", - "description": "Plugin for read-session", - "version": "1.0.0", - "author": { - "name": "qiudl" - } -} diff --git a/skills-workflow/read-session-plugin/skills/SKILL.md b/skills-workflow/read-session-plugin/skills/SKILL.md deleted file mode 100644 index ad450a9..0000000 --- a/skills-workflow/read-session-plugin/skills/SKILL.md +++ /dev/null @@ -1,211 +0,0 @@ ---- -name: read-session -description: View a saved Claude session without reloading it for continuation ---- - -# Read Session Skill - -You are now in session read mode. Your task is to display a previously saved conversation for review without loading it as active context for continuation. - -## Instructions - -1. **Get Session ID**: Extract the session ID from user's request - - Format: `YYYY-MM-DD_HHmm` (e.g., "2026-01-20_1430") - - User might provide: - - Exact ID: "2026-01-20_1430" - - Partial ID: "0120" or "1430" - - Title keywords: "read the authentication session" - - Description: "show me the JWT session from yesterday" - - If ambiguous, search `~/.claude/sessions/index.json` and ask for clarification - -2. **Find Session File**: - - First check index.json to find the exact filename - - Load `~/.claude/sessions/_.json` - - If file not found, inform user and offer similar sessions - -3. **Load and Parse**: Read the JSON file and extract: - - Metadata (id, title, date, tags) - - Summary (context, approach, changes, outcome, next steps) - - Conversation history (all messages) - - File modifications - -4. **Display Session**: Show a comprehensive read-only view: - ``` - ๐Ÿ“– Session: [Title] - - ๐Ÿ“… Date: YYYY-MM-DD HH:mm (X days ago) - ๐Ÿท๏ธ Tags: tag1, tag2, tag3 - ๐Ÿ’ฌ Messages: X messages - ๐Ÿ“ Files Modified: file1, file2, file3 - - ## Summary - - **Context**: [summary.context] - - **Approach**: [summary.approach] - - **Key Changes**: [summary.keyChanges] - - **Outcome**: [summary.outcome] - - **Next Steps**: [summary.nextSteps] - - ## Conversation History - - [Display the full conversation in a readable format] - - --- - - To reload and continue this session: /reload-session - To search for similar sessions: /search-sessions - ``` - -5. **Display Options**: - - View full conversation (show all messages) - - View summary only (already shown) - - View specific messages (by index or search) - - Export to different format - - Reload to continue working - -## Display Modes - -**Summary Mode (default):** -- Show metadata and summary only -- Don't display full conversation unless requested - -**Full Mode:** -- Show metadata, summary, AND full conversation history -- Use when user says "read full session" or "show everything" - -**Conversation-only Mode:** -- Skip summary, just show the conversation -- Use when user says "show me the conversation" or "messages only" - -## Usage Examples - -**Read summary:** -``` -/read-session 2026-01-20_1430 -read session 2026-01-20_1430 -show me the authentication session -``` - -**Read full conversation:** -``` -/read-session 2026-01-20_1430 --full -read full session about authentication -show me everything from the JWT session -``` - -**Read specific messages:** -``` -/read-session 2026-01-20_1430 --messages 5-10 -show messages 5-10 from session 2026-01-20_1430 -``` - -## Important Notes - -- This is a READ-ONLY view - don't load context for continuation -- Default to showing summary unless user asks for full conversation -- Format conversation messages clearly with role labels (User/Assistant) -- Show timestamps for each message if in full mode -- Provide options at the end to reload or search -- If session file not found, search index.json for similar titles - -## Example Output - -**Summary view (default):** -``` -๐Ÿ“– Session: Implement User Authentication with JWT - -๐Ÿ“… Date: Jan 18, 2026 16:00 (2 days ago) -๐Ÿท๏ธ Tags: authentication, jwt, security, api -๐Ÿ’ฌ Messages: 45 messages -๐Ÿ“ Files Modified: src/auth/jwt.ts, src/middleware/auth.ts, tests/auth.test.ts - -## Summary - -**Context**: User needed to implement JWT-based authentication for their REST API - -**Approach**: Created JWT service with access/refresh tokens, added middleware for route protection - -**Key Changes**: -- Implemented JWT token generation and validation -- Added authentication middleware -- Created login/logout endpoints -- Added comprehensive tests - -**Outcome**: Authentication system fully implemented and tested with 95% coverage - -**Next Steps**: Consider adding password reset functionality and rate limiting - ---- - -**Actions:** -- View full conversation: /read-session 2026-01-20_1430 --full -- Reload to continue: /reload-session 2026-01-20_1430 -- Search similar: /search-sessions authentication jwt -``` - -**Full view (with --full flag):** -``` -๐Ÿ“– Session: Implement User Authentication with JWT - -๐Ÿ“… Date: Jan 18, 2026 16:00 (2 days ago) -๐Ÿท๏ธ Tags: authentication, jwt, security, api -๐Ÿ’ฌ Messages: 45 messages -๐Ÿ“ Files Modified: src/auth/jwt.ts, src/middleware/auth.ts, tests/auth.test.ts - -## Summary - -[Summary content as above] - -## Conversation - -**[User - 16:00:00]** -I need to implement JWT authentication for my REST API - -**[Assistant - 16:00:15]** -I'll help you implement JWT authentication. Let me first explore your existing codebase... - -**[User - 16:02:30]** -The API is in src/api/ and uses Express - -**[Assistant - 16:02:45]** -Perfect! I can see your Express setup. Let me create the JWT service... - -[... full conversation continues ...] - ---- - -**Actions:** -- Reload to continue: /reload-session 2026-01-20_1430 -- Search similar: /search-sessions authentication jwt -``` - -**Session not found:** -``` -โŒ Session "2026-01-99_9999" not found. - -Did you mean one of these? - -1. [2026-01-20_1430] Implement User Authentication with JWT - ๐Ÿ“… Jan 20, 14:30 | ๐Ÿท๏ธ authentication, jwt, security - -2. [2026-01-18_1600] Setup OAuth2 Integration - ๐Ÿ“… Jan 18, 16:00 | ๐Ÿท๏ธ oauth, authentication, api - -To read: /read-session -To search: /search-sessions -``` - -## Formatting Guidelines - -When displaying conversation messages: -- Use clear role labels: **[User]** and **[Assistant]** -- Include timestamps in full mode -- Preserve code blocks and formatting -- Show system messages if present -- Use horizontal rules to separate messages -- Limit very long messages (offer to show full text) -- Number messages for easy reference diff --git a/skills-workflow/reload-session-plugin/.claude-plugin/plugin.json b/skills-workflow/reload-session-plugin/.claude-plugin/plugin.json deleted file mode 100644 index f971e2f..0000000 --- a/skills-workflow/reload-session-plugin/.claude-plugin/plugin.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "reload-session-plugin", - "description": "Plugin for reload-session", - "version": "1.0.0", - "author": { - "name": "qiudl" - } -} diff --git a/skills-workflow/reload-session-plugin/skills/SKILL.md b/skills-workflow/reload-session-plugin/skills/SKILL.md deleted file mode 100644 index 664372f..0000000 --- a/skills-workflow/reload-session-plugin/skills/SKILL.md +++ /dev/null @@ -1,177 +0,0 @@ ---- -name: reload-session -description: Reload a previously saved Claude session to continue the conversation ---- - -# Reload Session Skill - -You are now in session reload mode. Your task is to load a previously saved conversation and help the user continue from where they left off. - -## Instructions - -1. **Get Session ID**: Extract the session ID from user's request - - Format: `YYYY-MM-DD_HHmm` (e.g., "2026-01-20_1430") - - User might provide: - - Exact ID: "2026-01-20_1430" - - Partial ID: "0120" or "1430" - - Title keywords: "the authentication session" - - Description: "the one about JWT from yesterday" - - If ambiguous, search `~/.claude/sessions/index.json` and ask for clarification - -2. **Find Session File**: - - First check index.json to find the exact filename - - Load `~/.claude/sessions/_.json` - - If file not found, inform user and offer similar sessions - -3. **Load and Parse**: Read the JSON file and extract: - - Metadata (id, title, date, tags) - - Summary (context, approach, changes, outcome, next steps) - - Conversation history (all messages) - - File modifications - -4. **Display Session Context**: Show the user a comprehensive summary: - ``` - ๐Ÿ“‚ Loaded Session: [Title] - - ๐Ÿ“… Original: YYYY-MM-DD HH:mm (X days ago) - ๐Ÿท๏ธ Tags: tag1, tag2, tag3 - ๐Ÿ’ฌ Messages: X messages - ๐Ÿ“ Modified: file1, file2, file3 - - ## Summary - - **Context**: [summary.context] - - **Approach**: [summary.approach] - - **Key Changes**: [summary.keyChanges] - - **Outcome**: [summary.outcome] - - **Next Steps**: [summary.nextSteps] - - --- - - โœ… Session loaded. I have full context of this conversation. - What would you like to work on? - ``` - -5. **Maintain Context**: - - You now have the full conversation history available - - Reference specific details from the loaded session when helpful - - If user asks about the session, you can recall exact details - - Continue naturally from where the conversation ended - - Remember all files that were modified - - Recall all decisions and approaches discussed - -6. **Options to Offer**: - - Continue the last task that was being worked on (from "Next Steps") - - Review what was accomplished - - Make changes to previous work - - Answer questions about the session - - If work continues, offer to save as a new session or update existing one - -## Usage Examples - -**By exact ID:** -``` -/reload-session 2026-01-20_1430 -``` - -**By partial ID:** -``` -reload 0120_1430 -reload 1430 -``` - -**By title keyword:** -``` -reload the dark mode session -continue the authentication work -``` - -**By description:** -``` -continue the JWT work from yesterday -reload the session about React bugs -``` - -## Important Notes - -- If session file not found, search index.json for similar titles and offer alternatives -- When continuing work, naturally reference the previous conversation context -- If user wants to modify previous work, ask whether to: - - Save as a new session (recommended to preserve history) - - Update the existing session (overwrite) -- Show relative dates ("2 days ago", "last week") for better context -- If files were modified in the original session, note if they still exist -- Provide actionable options based on "Next Steps" from the summary - -## Example Output - -**Successful load:** -``` -๐Ÿ“‚ Loaded Session: Implement User Authentication with JWT - -๐Ÿ“… Original: Jan 18, 2026 16:00 (2 days ago) -๐Ÿท๏ธ authentication, jwt, security, api -๐Ÿ’ฌ 45 messages -๐Ÿ“ Modified: src/auth/jwt.ts, src/middleware/auth.ts, tests/auth.test.ts - -## Summary - -**Context**: User needed to implement JWT-based authentication for their REST API - -**Approach**: Created JWT service with access/refresh tokens, added middleware for route protection - -**Key Changes**: -- Implemented JWT token generation and validation -- Added authentication middleware -- Created login/logout endpoints -- Added comprehensive tests - -**Outcome**: Authentication system fully implemented and tested with 95% coverage - -**Next Steps**: Consider adding password reset functionality and rate limiting - ---- - -โœ… Session loaded. I have full context of this conversation. - -What would you like to work on? - -**Suggested options:** -1. Implement password reset functionality (from Next Steps) -2. Add rate limiting to prevent brute force attacks (from Next Steps) -3. Review or modify the existing authentication code -4. Something else - -Let me know and I'll continue from where we left off! -``` - -**Session not found:** -``` -โŒ Session "2026-01-99_9999" not found. - -Did you mean one of these? - -1. [2026-01-20_1430] Implement User Authentication with JWT - ๐Ÿ“… Jan 20, 14:30 | ๐Ÿท๏ธ authentication, jwt, security - -2. [2026-01-18_1600] Setup OAuth2 Integration - ๐Ÿ“… Jan 18, 16:00 | ๐Ÿท๏ธ oauth, authentication, api - -To reload: /reload-session -To search: /search-sessions -``` - -**Ambiguous request:** -``` -๐Ÿ” Found multiple sessions matching "authentication": - -1. [2026-01-20_1430] Implement JWT Authentication -2. [2026-01-18_1600] Setup OAuth2 Integration -3. [2026-01-15_1000] Add API Authentication - -Which session would you like to reload? (Use the ID) -``` diff --git a/skills-workflow/save-session-plugin/.claude-plugin/plugin.json b/skills-workflow/save-session-plugin/.claude-plugin/plugin.json deleted file mode 100644 index be228c6..0000000 --- a/skills-workflow/save-session-plugin/.claude-plugin/plugin.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "save-session-plugin", - "description": "Plugin for save-session", - "version": "1.0.0", - "author": { - "name": "qiudl" - } -} diff --git a/skills-workflow/save-session-plugin/skills/SKILL.md b/skills-workflow/save-session-plugin/skills/SKILL.md deleted file mode 100644 index b2d074b..0000000 --- a/skills-workflow/save-session-plugin/skills/SKILL.md +++ /dev/null @@ -1,206 +0,0 @@ ---- -name: save-session -description: Auto-save Claude session conversation with AI-generated title, summary, and tags in searchable JSON format ---- - -# Save Session Skill - -You are now in session save mode. Your task is to save the current conversation with a meaningful title and comprehensive summary. - -## Auto-Save Mode - -If this skill was triggered by an `` tag, operate in **auto-save mode**: -- Skip all user confirmations and questions -- Generate title, summary, and tags automatically -- Save immediately without asking for custom tags -- Output a brief confirmation only - -## Instructions - -1. **Analyze the Conversation**: Review the entire conversation history to understand: - - Main topics discussed - - Key problems solved - - Important decisions made - - Technologies or files involved - -2. **Generate Title**: Create a concise, descriptive title (5-10 words) that captures the essence of the conversation. - - Use imperative or descriptive form - - Include key technologies/features mentioned - - Example: "Implement User Authentication with JWT" - - Example: "Debug Memory Leak in React Component" - -3. **Generate Summary**: Write a structured summary (3-5 paragraphs) that includes: - - **Context**: What was the initial request or problem? - - **Approach**: What approach or solution was taken? - - **Key Changes**: What were the main changes or implementations? - - **Outcome**: What was achieved or what's the current status? - - **Next Steps** (if applicable): What remains to be done? - -4. **Extract Tags**: Identify 3-8 relevant tags: - - Technologies used (e.g., "react", "typescript", "docker") - - Task type (e.g., "bug-fix", "feature", "refactor", "documentation") - - Domain (e.g., "authentication", "ui", "api", "database") - -5. **Get Session ID**: Check `~/.claude/hooks/.current-session` for the current session ID. If it doesn't exist, generate one using format `YYYY-MM-DD_HHmm`. - -6. **Filter Conversation Content**: Before saving, clean the conversation: - - **EXCLUDE these from saved conversation:** - - Bash/shell command outputs (keep only the command intent) - - Full file contents from Read tool (keep only file path + brief note) - - Tool result outputs (Glob results, Grep results, etc.) - - `` tags and their contents - - `` tags - - Raw JSON/XML tool responses - - Error stack traces (summarize the error instead) - - Large code blocks from file reads (keep only relevant snippets) - - **INCLUDE and preserve:** - - User's questions and requests (the actual intent) - - Assistant's explanations and reasoning - - Key decisions and why they were made - - Code changes made (what was added/modified) - - Important findings and conclusions - - File paths that were modified - - Summary of what tools accomplished (not raw output) - - **Transform tool calls to summaries:** - - Instead of: `[Bash output: 500 lines of npm install...]` - - Save as: `"Installed dependencies with npm install"` - - Instead of: `[Read file: 200 lines of code...]` - - Save as: `"Read MallPurchaseManager.java to understand order push logic"` - -7. **Save to File**: Create a JSON file in `~/.claude/sessions/` with: - - Filename: `_.json` - - Content structure: - ```json - { - "id": "YYYY-MM-DD_HHmm", - "title": "[Generated Title]", - "date": "[ISO 8601 format]", - "timestamp": 1234567890, - "tags": ["tag1", "tag2"], - "summary": { - "context": "What was the initial request or problem?", - "approach": "What approach or solution was taken?", - "keyChanges": "What were the main changes or implementations?", - "outcome": "What was achieved or what's the current status?", - "nextSteps": "What remains to be done (if applicable)" - }, - "metadata": { - "messageCount": 0, - "technologies": ["tech1", "tech2"], - "filesModified": ["file1", "file2"] - }, - "conversation": [ - { - "role": "user|assistant", - "content": "cleaned message content - NO raw tool outputs", - "timestamp": "ISO 8601", - "toolSummary": "optional: brief summary of tools used in this turn" - } - ] - } - ``` - -8. **Update Index**: After saving the session, update `~/.claude/sessions/index.json`: - - Add entry with id, title, date, tags, and summary preview - - Keep index sorted by date (newest first) - - If index doesn't exist, create it - - Index structure: - ```json - { - "sessions": [ - { - "id": "YYYY-MM-DD_HHmm", - "title": "Title", - "date": "ISO 8601", - "tags": ["tag1"], - "summaryPreview": "First 200 chars of context..." - } - ], - "lastUpdated": "ISO 8601" - } - ``` - -9. **Post-Save Actions**: After saving: - - Reset autosave timer: `~/.claude/hooks/autosave-mark.sh` - - Clear pending save flag: `rm -f ~/.claude/hooks/.pending-save` - -10. **Confirm**: After saving, report back to the user: - - The session ID and filename - - The generated title - - Main tags extracted - - Brief confirmation with instructions on how to reload - -## Important Notes - -- Create `~/.claude/sessions/` directory if it doesn't exist -- Sanitize the title for filename (lowercase, replace spaces with hyphens, remove special chars) -- In manual mode, ask user if they want to add any custom tags before saving -- In auto-save mode, skip all user interactions -- Always update the index file for fast searching -- Use current timestamp in ISO 8601 format -- Count actual messages in conversation for metadata -- Each conversation MUST have its own unique JSON file - -## Conversation Filtering Example - -**RAW conversation (DON'T save like this):** -``` -User: "ๆ‰พไธ€ไธ‹่ฎขๅ•ๆŽจ้€็š„ไปฃ็ " -Assistant: [Grep tool output with 50 matching files...] -Assistant: [Read file output with 200 lines of Java code...] -Assistant: "I found the order push code in MallPurchaseManager.java" -User: "ไฟฎๆ”นๅฎƒๅŠ ไธŠchannelType" -Assistant: [Edit tool with full file diff...] -Task tools haven't been used... -``` - -**CLEANED conversation (Save like this):** -```json -{ - "conversation": [ - { - "role": "user", - "content": "ๆ‰พไธ€ไธ‹่ฎขๅ•ๆŽจ้€็š„ไปฃ็ " - }, - { - "role": "assistant", - "content": "Found order push code in MallPurchaseManager.java:5536 in the getJsonString() method. This method assembles order data for pushing to Lining platform.", - "toolSummary": "Searched codebase, read MallPurchaseManager.java" - }, - { - "role": "user", - "content": "ไฟฎๆ”นๅฎƒๅŠ ไธŠchannelType" - }, - { - "role": "assistant", - "content": "Added channelType field to the order push logic. Now when orders are pushed to Lining platform, it will include the external platform type (ๅ“ๆœ›/ๅ—่ˆช).", - "toolSummary": "Edited MallPurchaseManager.java - added order.setChannelType()" - } - ] -} -``` - -## Example Output (Manual Mode) - -``` -Session saved successfully! - -ID: 2026-01-20_1430 -Title: Implement Dark Mode Toggle Feature -Tags: react, css, ui, feature -File: ~/.claude/sessions/2026-01-20_1430_implement-dark-mode-toggle-feature.json - -The conversation has been archived with full history (45 messages). - -To reload this session: /reload-session 2026-01-20_1430 -To search sessions: /search-sessions dark mode -``` - -## Example Output (Auto-Save Mode) - -``` -[Auto-saved] 2026-01-20_1430: "Implement Dark Mode Toggle Feature" (45 messages) -``` diff --git a/skills-workflow/search-sessions-plugin/.claude-plugin/plugin.json b/skills-workflow/search-sessions-plugin/.claude-plugin/plugin.json deleted file mode 100644 index 5036cf8..0000000 --- a/skills-workflow/search-sessions-plugin/.claude-plugin/plugin.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "search-sessions-plugin", - "description": "Plugin for search-sessions", - "version": "1.0.0", - "author": { - "name": "qiudl" - } -} diff --git a/skills-workflow/search-sessions-plugin/skills/SKILL.md b/skills-workflow/search-sessions-plugin/skills/SKILL.md deleted file mode 100644 index c6fe3f5..0000000 --- a/skills-workflow/search-sessions-plugin/skills/SKILL.md +++ /dev/null @@ -1,128 +0,0 @@ ---- -name: search-sessions -description: Search saved Claude sessions by title, tags, date, or content ---- - -# Search Sessions Skill - -You are now in session search mode. Your task is to help the user find saved conversations. - -## Instructions - -1. **Read Index**: Load `~/.claude/sessions/index.json` to get the list of all sessions - - If file doesn't exist, inform user no sessions have been saved yet - -2. **Parse Search Query**: Understand what the user is looking for: - - Keywords in title or summary - - Specific tags (e.g., "react", "bug-fix", "authentication") - - Date range (e.g., "last week", "January 2026", "today") - - Combination of filters - - Special flags like "--all" to show all results - -3. **Search Logic**: - - First search in index.json (fast search by title, tags, date, summary preview) - - If user needs full content search, load individual session JSON files from `~/.claude/sessions/` - - Support case-insensitive search - - Support partial matches - - Score results by relevance - -4. **Display Results**: Show matching sessions in a clear, readable format: - ``` - ๐Ÿ” Found 3 sessions matching "react": - - 1. [2026-01-20_1430] Implement Dark Mode Toggle Feature - ๐Ÿ“… 2026-01-20 14:30 | ๐Ÿท๏ธ react, css, ui, feature - ๐Ÿ’ก Added dark mode toggle to application settings... - - 2. [2026-01-19_1015] Debug Memory Leak in React Component - ๐Ÿ“… 2026-01-19 10:15 | ๐Ÿท๏ธ react, debugging, performance - ๐Ÿ’ก Investigated and fixed memory leak caused by... - - 3. [2026-01-18_1600] Setup Authentication with JWT - ๐Ÿ“… 2026-01-18 16:00 | ๐Ÿท๏ธ authentication, jwt, security - ๐Ÿ’ก Implemented JWT-based authentication system... - - To reload a session: /reload-session - ``` - -5. **Advanced Search**: - - Support filtering by multiple tags: "react AND authentication" - - Support OR logic: "react OR vue" - - Support date ranges: "between 2026-01-01 and 2026-01-20" - - Support exclusion: "react NOT bug" - - Support tag-specific search: "tag:authentication" - -## Search Examples - -**By keyword:** -- `search sessions about react` โ†’ Search for "react" in title, tags, and summary - -**By date:** -- `find sessions from last week` โ†’ Filter by date range (last 7 days) -- `sessions from January` โ†’ Filter by month -- `sessions today` โ†’ Today's sessions only - -**By tag:** -- `search sessions tagged authentication` โ†’ Filter by specific tag -- `sessions with tag:bug-fix` โ†’ Explicit tag search - -**List all:** -- `list all sessions` โ†’ Show all sessions (newest first) -- `show recent sessions` โ†’ Show last 10 sessions - -**Combined:** -- `search react sessions from last month` โ†’ Keyword + date filter -- `find authentication AND api sessions` โ†’ Multiple tags - -## Important Notes - -- Show most recent sessions first by default -- Limit initial results to 10, offer to show more with --all flag -- If no matches found, suggest related searches or show recent sessions -- Provide the session ID clearly so user can reload it -- Display dates in human-readable format (e.g., "2 days ago", "last week") -- If only one result found, offer to load it automatically - -## Example Output Formats - -**Multiple results:** -``` -๐Ÿ” Found 5 sessions matching "authentication": - -1. [2026-01-20_1430] Setup OAuth2 Integration - ๐Ÿ“… Jan 20, 14:30 (today) | ๐Ÿท๏ธ oauth, authentication, api - ๐Ÿ’ก Integrated OAuth2 provider for third-party login... - -2. [2026-01-18_1600] Implement JWT Authentication - ๐Ÿ“… Jan 18, 16:00 (2 days ago) | ๐Ÿท๏ธ jwt, authentication, security - ๐Ÿ’ก Built JWT-based auth system with refresh tokens... - -Showing 2 of 5 results. Use "/search-sessions authentication --all" to see all. -To reload: /reload-session -``` - -**No results:** -``` -๐Ÿ” No sessions found matching "xyz" - -Suggestions: -- Try different keywords -- Check spelling -- Use broader search terms - -Recent sessions: -1. [2026-01-20_1430] Implement Dark Mode Toggle Feature -2. [2026-01-19_1015] Debug Memory Leak in React Component -... -``` - -**Single result:** -``` -๐Ÿ” Found 1 session matching "oauth": - -[2026-01-20_1430] Setup OAuth2 Integration -๐Ÿ“… Jan 20, 14:30 (today) | ๐Ÿท๏ธ oauth, authentication, api -๐Ÿ’ก Integrated OAuth2 provider for third-party login... - -Would you like to reload this session? (/reload-session 2026-01-20_1430) -```