commit 946e3c351f8bc419f71056b8d05977ce38729bc8 Author: Zhongwei Li Date: Sat Nov 29 18:00:12 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..4a0a434 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "codanna-cc-plugin", + "description": "Codanna code intelligence integration for Claude Code - semantic search, symbol analysis, and call graph exploration", + "version": "0.1.0", + "author": { + "name": "bartolli" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..4c59425 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# codanna-cc-plugin + +Codanna code intelligence integration for Claude Code - semantic search, symbol analysis, and call graph exploration diff --git a/commands/ask.md b/commands/ask.md new file mode 100644 index 0000000..b6e1a30 --- /dev/null +++ b/commands/ask.md @@ -0,0 +1,27 @@ +--- +description: Look up a symbol and ask Claude a specific question about it +argument-hint: "" +--- + +## Context + +Symbol to analyze: **$1** + +User's question: **$2** + +## Your task + +Use the Bash tool to fetch symbol information, then answer the user's question. + +**Workflow:** +1. Execute: `node .claude/scripts/context-provider.js symbol $1` +2. Analyze the symbol details returned +3. Answer the question: "$2" + +When answering: +- Reference actual code locations (file:line) +- Explain relationships (calls, called_by, implements, defines) +- Use the signature and documentation from the symbol +- Be specific about how the symbol is used in the codebase + +Focus on what the code actually shows, not general programming principles. diff --git a/commands/find.md b/commands/find.md new file mode 100644 index 0000000..6c0d451 --- /dev/null +++ b/commands/find.md @@ -0,0 +1,51 @@ +--- +description: Smart semantic search for code with full context +argument-hint: "" +--- + +## Search Query Analysis + +**User's Original Query**: "$ARGUMENTS" + +### Query Optimization + +Claude, analyze the query above and improve it for code search: + +1. **If vague** (e.g., "that parsing thing") → Make it specific (e.g., "language parser implementation") +2. **If a question** (e.g., "how does parsing work?") → Extract keywords (e.g., "parsing implementation process") +3. **If conversational** (e.g., "the stuff that handles languages") → Use technical terms (e.g., "language handler processor") +4. **If too broad** (e.g., "errors") → Add context (e.g., "error handling exception management") + +**YourOptimizedQuery**: _{Claude: Write your improved query here, then use it below}_ + +Execute this command with your optimized query: + +## Your task + +Use the Bash tool to perform semantic code search. + +**Workflow:** +1. Execute: `node .claude/scripts/context-provider.js find "$YourOptimizedQuery" --limit=5` +2. Analyze the results with their relevance scores +3. **To see actual implementation** of interesting results: + - Use the line range from the Location field to read just the relevant code + - Example: If you see "Location: `src/io/exit_code.rs:108-120`" + - Execute: `sed -n '108,120p' src/io/exit_code.rs` to read lines 108-120 + - This shows the actual code implementation, not just the signature +4. **When relationships are shown** (called_by, calls, defines, implements): + - If a relationship looks relevant to answering the query, investigate it + - Execute: `node .claude/scripts/context-provider.js symbol ` + - Example: If you see "Called by: `initialize_registry`", run: `node .claude/scripts/context-provider.js symbol initialize_registry` +5. Build a complete picture by following 1-2 key relationships and reading relevant code sections +6. Present findings to the user with context from search results, relationships, and actual code snippets + +**The results include:** +- Relevance scores (how well each result matches the query) +- Symbol documentation and signatures +- Relationships (who calls this, what it calls, what it defines) +- System guidance for follow-up investigation + +**Tips:** +- Add `--lang=rust` (or python, typescript, etc.) to narrow results by language +- Follow relationships that appear in multiple results (they're likely important) +- Use the `symbol` command to get full details about interesting relationships diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..8950461 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,49 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:bartolli/codanna-cc-plugin:", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "2e3b9e14b30363c77fcc5a59399c58cc6f4c694b", + "treeHash": "8c5367269e5b4f0ab47c9bccfa9aa5089b61c07423f33c4b6607647920e4bc9f", + "generatedAt": "2025-11-28T10:14:10.461490Z", + "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": "codanna-cc-plugin", + "description": "Codanna code intelligence integration for Claude Code - semantic search, symbol analysis, and call graph exploration", + "version": "0.1.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "f784155fbd5c4518b6f332c01976141456c482e3f191771abad1a724902885fb" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "9c3e304d277eb95ed57e5942d6b3334de9ddaf85fcb06e09bc590b785b0c6178" + }, + { + "path": "commands/find.md", + "sha256": "ec7a1f45bf0899432b2c35c40c9ee90a50bb4189098a5f3d2b4e2c6e309f6023" + }, + { + "path": "commands/ask.md", + "sha256": "6a7b4f3a923ce513d5492fa5acba217c9cf5cabaf003a17a180de58ab1329cc5" + } + ], + "dirSha256": "8c5367269e5b4f0ab47c9bccfa9aa5089b61c07423f33c4b6607647920e4bc9f" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file