Initial commit
This commit is contained in:
14
.claude-plugin/plugin.json
Normal file
14
.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "ospack",
|
||||||
|
"description": "Semantic context packer - combines import resolution with semantic search",
|
||||||
|
"version": "0.4.0",
|
||||||
|
"author": {
|
||||||
|
"name": "ospack"
|
||||||
|
},
|
||||||
|
"skills": [
|
||||||
|
"./skills"
|
||||||
|
],
|
||||||
|
"commands": [
|
||||||
|
"./commands"
|
||||||
|
]
|
||||||
|
}
|
||||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# ospack
|
||||||
|
|
||||||
|
Semantic context packer - combines import resolution with semantic search
|
||||||
38
commands/pack.md
Normal file
38
commands/pack.md
Normal 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
39
commands/search.md
Normal 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
|
||||||
53
plugin.lock.json
Normal file
53
plugin.lock.json
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"$schema": "internal://schemas/plugin.lock.v1.json",
|
||||||
|
"pluginId": "gh:Tylerbryy/ospack:plugins/ospack",
|
||||||
|
"normalized": {
|
||||||
|
"repo": null,
|
||||||
|
"ref": "refs/tags/v20251128.0",
|
||||||
|
"commit": "da7fde86962a19678a115b4d0527fef85d98b05e",
|
||||||
|
"treeHash": "7edf64051f6ef94114569a83b5f174042f1b602ef4df0a57f0ca6ac6a7a0c0f4",
|
||||||
|
"generatedAt": "2025-11-28T10:12:55.205847Z",
|
||||||
|
"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": "ospack",
|
||||||
|
"description": "Semantic context packer - combines import resolution with semantic search",
|
||||||
|
"version": "0.4.0"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "README.md",
|
||||||
|
"sha256": "ac8bf8b8c128241dc5f7681d76cd05185b86a75750be0a1ee3efc616b4977535"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".claude-plugin/plugin.json",
|
||||||
|
"sha256": "795810d99280973e5b37f444ec2c1d05bcd5e9f4f46d2b9ff2b6869dc084b833"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "commands/search.md",
|
||||||
|
"sha256": "ab6904652aa2b93a19c3db8a0082771547ca4c9f9d8541107fe6a25eb88a03b8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "commands/pack.md",
|
||||||
|
"sha256": "067540cbb352952104065f64419797aa0a3912cbd76fbd788be4059db7e1db5a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "skills/ospack/SKILL.md",
|
||||||
|
"sha256": "2918072372a33f14d447b2e70e8ea4e76335d9010065e3ea6f5e1d13863d2160"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dirSha256": "7edf64051f6ef94114569a83b5f174042f1b602ef4df0a57f0ca6ac6a7a0c0f4"
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"scannedAt": null,
|
||||||
|
"scannerVersion": null,
|
||||||
|
"flags": []
|
||||||
|
}
|
||||||
|
}
|
||||||
49
skills/ospack/SKILL.md
Normal file
49
skills/ospack/SKILL.md
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# ospack - Semantic Context Packer
|
||||||
|
|
||||||
|
Use ospack to gather relevant code context through import resolution and semantic search.
|
||||||
|
|
||||||
|
## When to use this skill
|
||||||
|
|
||||||
|
Use ospack when you need to:
|
||||||
|
- Understand a file and all its dependencies
|
||||||
|
- Find code related to a concept across the codebase
|
||||||
|
- Build comprehensive context for refactoring, debugging, or feature work
|
||||||
|
- Explore unfamiliar codebases
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
### Pack context (recommended)
|
||||||
|
|
||||||
|
Combines import resolution with semantic search:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# From a focus file
|
||||||
|
ospack pack --focus src/auth.py --root $(pwd)
|
||||||
|
|
||||||
|
# With semantic query
|
||||||
|
ospack pack --query "error handling" --root $(pwd)
|
||||||
|
|
||||||
|
# Both together (best results)
|
||||||
|
ospack pack --focus src/api.py --query "validation" --root $(pwd)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Quick search
|
||||||
|
|
||||||
|
For fast semantic searches:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ospack search "database connection" --root $(pwd)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output formats
|
||||||
|
|
||||||
|
- `--format xml`: Structured XML (default, best for context)
|
||||||
|
- `--format compact`: Human-readable markdown
|
||||||
|
- `--format chunks`: Function-level results with scores
|
||||||
|
|
||||||
|
## Tips
|
||||||
|
|
||||||
|
- Use `--focus` when you have a specific entry point
|
||||||
|
- Use `--query` when searching by concept
|
||||||
|
- Combine both for comprehensive context
|
||||||
|
- Increase `--max-files` for larger explorations
|
||||||
Reference in New Issue
Block a user