feat: improved the Claude Kit as a plugin

This commit is contained in:
duthaho
2026-04-19 14:09:14 +07:00
parent 3103a8da1b
commit d1a6d2a2bc
186 changed files with 771 additions and 1691 deletions
+123
View File
@@ -0,0 +1,123 @@
---
name: session-management
argument-hint: "[save/list/restore/index/load/status]"
description: >
Use when managing session state — including saving/restoring checkpoints, generating project structure indexes, loading project components into context, or checking project status. Trigger for keywords like "checkpoint", "save state", "restore", "index", "project structure", "load context", "status", "what's the state", or any request to manage the working session. Also activate when resuming work from a previous session or when needing to understand the current project layout.
---
# Session Management
## When to Use
- Saving or restoring session state (checkpoints)
- Generating project structure indexes
- Loading specific project components into context
- Checking current project status (git, tasks, PRs)
- Resuming work from a previous session
## When NOT to Use
- Git operations (commit, push, PR) — use `git-workflows`
- Branch management — use `using-git-worktrees`
- Launching parallel background work — use `dispatching-parallel-agents`
---
## Quick Reference
| Topic | Reference | Key content |
|-------|-----------|-------------|
| Checkpoints | `references/checkpoints.md` | Save/restore/list/delete session state |
| Project indexing | `references/indexing.md` | Generate PROJECT_INDEX.md, scan structure |
| Context loading | `references/loading.md` | Load components by category or path |
| Status checking | `references/status.md` | Git state, tasks, recent activity |
---
## Checkpoints
Save and restore conversation context using git-based state:
```bash
# Save current state
# → creates git stash + metadata in .claude/checkpoints/
/checkpoint save feature-auth
# List available checkpoints
/checkpoint list
# Restore a checkpoint
/checkpoint restore feature-auth
# Delete old checkpoint
/checkpoint delete old-checkpoint
```
Auto-checkpoint is suggested before major refactoring, context switches, and risky operations.
---
## Project Indexing
Generate a comprehensive project structure index:
```bash
# Generate PROJECT_INDEX.md
/index
# Shallow index (3 levels deep)
/index --depth=3
```
The index categorizes files by type: entry points, API routes, models, services, utilities, tests, and configuration.
---
## Context Loading
Load specific components into context for focused work:
| Category | What It Loads |
|----------|---------------|
| `api` | API routes and endpoints |
| `models` | Data models and types |
| `services` | Business logic services |
| `auth` | Authentication related |
| `db` | Database related |
| `tests` | Test files |
| `config` | Configuration files |
```bash
/load api # Load all API routes
/load src/services/user.ts # Load specific file
/load auth --related # Load auth + related files
/load --all --shallow # Quick overview of everything
```
---
## Status
Get current project status:
```bash
/status
```
Shows: git branch and status, in-progress/pending/completed tasks, recent commits, open PRs.
---
## Best Practices
1. **Checkpoint before context switches** — save state when switching tasks.
2. **Index periodically** — regenerate when project structure changes significantly.
3. **Load narrow, expand as needed** — start with specific components, add related files.
4. **Name checkpoints descriptively**`auth-progress` beats `checkpoint-1`.
---
## Related Skills
- `using-git-worktrees` — Isolated branch management for parallel work
- `dispatching-parallel-agents` — Launching parallel background tasks
@@ -0,0 +1,48 @@
# Checkpoints
## Save Checkpoint
```bash
/checkpoint save [name]
```
Creates a git stash with metadata in `.claude/checkpoints/[name].json`:
```json
{
"name": "feature-auth",
"created": "2026-04-19T14:30:00Z",
"git_stash": "stash@{0}",
"files_in_context": ["src/auth/login.ts", "src/auth/token.ts"],
"current_task": "Implementing JWT refresh",
"notes": "User-provided notes"
}
```
## List Checkpoints
```bash
/checkpoint list
```
## Restore Checkpoint
```bash
/checkpoint restore [name]
```
Applies git stash, loads metadata, summarizes restored context.
## Delete Checkpoint
```bash
/checkpoint delete [name]
```
## Auto-Checkpoint Triggers
Suggest checkpoints before:
- Major refactoring
- Context switches
- Risky operations
- Natural breakpoints in complex work
@@ -0,0 +1,45 @@
# Project Indexing
## Generate Index
Scan the project and create `PROJECT_INDEX.md`:
### Excluded Directories
`node_modules/`, `.git/`, `__pycache__/`, `dist/`, `build/`, `.next/`, `venv/`, `.venv/`, coverage, cache
### File Categories
- **Entry Points**: Main files, index files, app entry
- **API/Routes**: Endpoint definitions
- **Models/Types**: Data structures, schemas
- **Services**: Business logic
- **Utilities**: Helper functions
- **Tests**: Test files
- **Configuration**: Config files, env templates
### Output Format
```markdown
# Project Index: [Name]
Generated: [timestamp]
## Quick Navigation
| Category | Key Files |
|----------|-----------|
| Entry Points | [list] |
| API Routes | [list] |
## Directory Structure
[tree view]
## Key Files
### Entry Points
- `[path]` - [description]
## Dependencies
### External
- [package]: [purpose]
## Architecture Notes
[patterns observed]
```
@@ -0,0 +1,49 @@
# Context Loading
## Load Components
Load specific parts of the project into context for focused work.
### By Category
| Category | What It Loads |
|----------|---------------|
| `api` | API routes and endpoints |
| `models` | Data models and types |
| `services` | Business logic services |
| `utils` | Utility functions |
| `tests` | Test files |
| `config` | Configuration files |
| `auth` | Authentication related |
| `db` | Database related |
### By Path
```bash
/load src/services/user.ts # Specific file
/load src/auth/ # Directory
```
### Flags
| Flag | Description |
|------|-------------|
| `--all` | Load all key components |
| `--shallow` | Load only file summaries |
| `--deep` | Load full file contents |
| `--related` | Include related files |
### Output
```markdown
## Loaded Context
### Files Loaded (N)
- `path/to/file.ts` - [purpose]
### Key Components
- [Component]: [description]
### Ready For
- [suggested actions based on loaded context]
```
@@ -0,0 +1,34 @@
# Status Checking
## Project Status
Show current project state:
```bash
git status
git log --oneline -5
```
### Output Format
```markdown
## Project Status
### Git
- Branch: `feature/xyz`
- Status: Clean / X modified files
### Tasks
- In Progress: X
- Pending: Y
- Completed: Z
### Recent Commits
1. [commit message]
2. [commit message]
### Open PRs
- #123: [title]
```
Combines git state, TodoWrite tasks, and recent activity into a single snapshot.