Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:16:51 +08:00
commit 4e8a12140c
88 changed files with 17078 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
# Mode 1: Search Conversations
**When to use**: Find specific past conversations
## Trigger Phrases
- "Find conversations about React performance optimization"
- "Search for times I fixed authentication bugs"
- "Show me conversations that modified Auth.tsx"
- "What conversations mention TypeScript strict mode?"
## Process
1. User asks to search for a topic or file
2. Skill performs RAG semantic search
3. Returns ranked results with context snippets
4. Optionally show full conversation details
## Search Types
### Semantic Search (by meaning)
```
User: "Find conversations about fixing bugs related to user authentication"
Skill: [Performs RAG search]
Found 3 conversations:
1. "Debug JWT token expiration" (Oct 24)
2. "Fix OAuth redirect loop" (Oct 20)
3. "Implement session timeout handling" (Oct 18)
```
### Metadata Search (by files/tools)
```
User: "Show conversations that modified src/auth/token.ts"
Skill: [Queries SQLite metadata]
Found 5 conversations touching src/auth/token.ts:
1. "Implement token refresh logic" (Oct 25)
2. "Add token validation" (Oct 22)
...
```
### Time-based Search
```
User: "What did I work on last week?"
Skill: [Queries by date range]
Last week (Oct 19-25) you had 12 conversations:
- 5 about authentication features
- 3 about bug fixes
- 2 about testing
- 2 about refactoring
```
## Output Format
```
Found 5 conversations about "React performance optimization":
1. [Similarity: 0.89] "Optimize UserProfile re-renders" (Oct 25, 2025)
Files: src/components/UserProfile.tsx, src/hooks/useUser.ts
Snippet: "...implemented useMemo to prevent unnecessary re-renders..."
2. [Similarity: 0.82] "Fix dashboard performance issues" (Oct 20, 2025)
Files: src/pages/Dashboard.tsx
Snippet: "...React.memo wrapper reduced render count by 60%..."
[View full conversations? Type the number]
```

View File

@@ -0,0 +1,75 @@
# Mode 2: Generate Insights
**When to use**: Understand patterns and trends
## Trigger Phrases
- "Generate weekly insights report"
- "Show me my most active files this month"
- "What patterns do you see in my conversations?"
- "Create a project summary report"
## Process
1. User asks for insights on a timeframe
2. Skill analyzes metadata and patterns
3. Creates markdown report with visualizations
4. Offers to save report to file
## Report Sections
- **Executive Summary**: Key metrics
- **Activity Timeline**: Conversations over time
- **File Hotspots**: Most modified files
- **Tool Usage Breakdown**: Which tools you use most
- **Topic Clusters**: Recurring themes
- **Knowledge Highlights**: Key solutions and learnings
## Example Output
```markdown
# Weekly Insights (Oct 19-25, 2025)
## Overview
- 12 conversations
- 8 active days
- 23 files modified
- 45 tool uses
## Top Files
1. src/auth/token.ts (5 modifications)
2. src/components/Login.tsx (3 modifications)
3. src/api/auth.ts (3 modifications)
## Activity Pattern
Mon: ████████ 4 conversations
Tue: ██████ 3 conversations
Wed: ██████ 3 conversations
Thu: ████ 2 conversations
Fri: ████ 2 conversations
## Key Topics
- Authentication (6 conversations)
- Testing (3 conversations)
- Bug fixes (2 conversations)
## Knowledge Highlights
- Implemented JWT refresh token pattern
- Added React Testing Library for auth components
- Fixed OAuth redirect edge case
[Save report to file? Y/n]
```
## File-Centric Analysis
```
# File Hotspots (All Time)
🔥🔥🔥 src/auth/token.ts (15 conversations)
🔥🔥 src/components/Login.tsx (9 conversations)
🔥🔥 src/api/auth.ts (8 conversations)
🔥 src/hooks/useAuth.ts (6 conversations)
Insight: Authentication module is your most active area.
Consider: Review token.ts for refactoring opportunities.
```

View File

@@ -0,0 +1,69 @@
# Mode 3: Interactive Dashboard
**When to use**: Rich visual exploration and ongoing monitoring
## Trigger Phrases
- "Launch the insights dashboard"
- "Start the visualization server"
- "Show me the interactive insights"
## Process
1. User asks to start the dashboard
2. Skill launches Next.js dev server
3. Opens browser to http://localhost:3000
4. Provides real-time data from SQLite + ChromaDB
## Dashboard Pages
### Home
- Timeline of recent conversations
- Activity stats and quick metrics
- Summary cards
### Search
- Interactive semantic + keyword search interface
- Real-time results
- Filter by date, files, tools
### Insights
- Auto-generated reports with interactive charts
- Trend visualizations
- Pattern detection results
### Files
- File-centric view of all conversations
- Click to see all conversations touching a file
- Modification frequency heatmap
### Analytics
- Deep-dive into patterns and trends
- Tool usage statistics
- Activity patterns by time of day/week
## Tech Stack
- **Framework**: Next.js 15 with React Server Components
- **Styling**: Tailwind CSS
- **Charts**: Recharts
- **Data**: SQLite + ChromaDB
- **URL**: http://localhost:3000
## Starting the Dashboard
```bash
# Navigate to dashboard directory
cd ~/.claude/skills/cc-insights/dashboard
# Install dependencies (first time only)
npm install
# Start development server
npm run dev
```
The browser will automatically open to http://localhost:3000.
## Stopping the Dashboard
Press `Ctrl+C` in the terminal or close the terminal window.

View File

@@ -0,0 +1,68 @@
# Mode 4: Export and Integration
**When to use**: Share insights or integrate with other tools
## Trigger Phrases
- "Export weekly insights as markdown"
- "Save conversation metadata as JSON"
- "Generate HTML report for sharing"
## Process
1. User asks to export in a specific format
2. Skill generates formatted output
3. Saves to specified location
## Export Formats
### Markdown
Human-readable reports with formatting.
```bash
Export location: ./insights/weekly-report.md
```
### JSON
Machine-readable data for integration with other tools.
```json
{
"period": "2025-10-19 to 2025-10-25",
"conversations": 12,
"files_modified": 23,
"tool_uses": 45,
"top_files": [
{"path": "src/auth/token.ts", "count": 5},
{"path": "src/components/Login.tsx", "count": 3}
],
"topics": ["authentication", "testing", "bug fixes"]
}
```
### CSV
Activity data for spreadsheets.
```csv
date,conversation_count,files_modified,tool_uses
2025-10-19,4,8,12
2025-10-20,3,6,9
...
```
### HTML
Standalone report with styling for sharing.
```html
<!-- Self-contained report with inline CSS -->
<!-- Can be opened in any browser -->
```
## Example Usage
```
User: "Export this month's insights as JSON for my dashboard"
Skill: [Generates JSON report]
Exported to: ./insights/october-2025.json
Contains: 45 conversations, 89 files, 156 tool uses
```