Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 09:03:14 +08:00
commit d5d4df5f17
6 changed files with 196 additions and 0 deletions

38
commands/pack.md Normal file
View File

@@ -0,0 +1,38 @@
---
description: Pack context from a focus file and/or semantic query
allowed-tools: Bash
---
# Pack Context
Use ospack to gather relevant code context for the current task.
## Usage
Run `ospack pack` with the appropriate flags:
```bash
# Pack from a specific file + its imports
ospack pack --focus <file_path> --root $(pwd)
# Semantic search for related code
ospack pack --query "<search_terms>" --root $(pwd)
# Combine both (recommended)
ospack pack --focus <file_path> --query "<search_terms>" --root $(pwd)
```
## Options
- `--focus, -f`: Entry point file for import resolution
- `--query, -q`: Natural language semantic search
- `--max-files, -m`: Max files to include (default: 10)
- `--import-depth, -d`: Import traversal depth (default: 2)
- `--format, -o`: Output format: xml, compact, or chunks
## When to use
Use this command when you need to:
- Understand a file and its dependencies
- Find related code for a concept
- Build context for refactoring or debugging

39
commands/search.md Normal file
View File

@@ -0,0 +1,39 @@
---
description: Semantic search for code in the current repository
allowed-tools: Bash
---
# Semantic Search
Use ospack to find code semantically by concept, not just keywords.
## Usage
```bash
ospack search "<query>" --root $(pwd)
```
## Examples
```bash
# Find authentication logic
ospack search "user authentication" --root $(pwd)
# Find error handling patterns
ospack search "error handling middleware" --root $(pwd)
# Find database queries
ospack search "database connection pooling" --root $(pwd)
```
## Options
- `--limit, -l`: Max results to return (default: 10)
- `--root`: Repository root directory
## When to use
Use this for quick semantic searches when you need to find:
- Where a concept is implemented
- Related code across the codebase
- Patterns and examples