$npx -y skills add Dianel555/DSkills --skill ace-toolSemantic codebase search, code indexing, and prompt enhancement via standalone CLI. Use when: (1) Semantic code search with natural language queries, (2) Code indexing for remote codebase retrieval, (3) Prompt enhancement with codebase context, (4) Before grep/find/glob operation
| 1 | # ACE-Tool - Semantic Code Search & Prompt Enhancement |
| 2 | |
| 3 | High-performance semantic search, code indexing, and AI-powered prompt enhancement. Standalone CLI (no MCP dependency). |
| 4 | |
| 5 | ## Execution Methods |
| 6 | |
| 7 | ```bash |
| 8 | # Prerequisites: pip install httpx tenacity |
| 9 | # Environment: ACE_API_URL, ACE_API_TOKEN (optional for local fallback) |
| 10 | |
| 11 | # Index project for remote search (upload code blobs to ACE service) |
| 12 | python scripts/ace_cli.py index -p /path/to/project |
| 13 | |
| 14 | # Search codebase with natural language (remote if API configured, else local fallback) |
| 15 | python scripts/ace_cli.py search_context -p /path/to/project -q "function that handles authentication" |
| 16 | |
| 17 | # Enhance prompt (interactive mode - default, opens browser) |
| 18 | python scripts/ace_cli.py enhance_prompt -p "implement login feature" -H "User: what auth method?\nAssistant: JWT" |
| 19 | |
| 20 | # Enhance prompt (non-interactive, JSON output) |
| 21 | python scripts/ace_cli.py enhance_prompt --no-interactive -p "implement login feature" |
| 22 | |
| 23 | # Enhance prompt with project context (enables cloud retrieval for all endpoints) |
| 24 | python scripts/ace_cli.py enhance_prompt -p "implement login feature" --project-root /path/to/project |
| 25 | |
| 26 | # Enhance prompt with specific endpoint |
| 27 | python scripts/ace_cli.py --endpoint claude enhance_prompt -p "implement login feature" |
| 28 | |
| 29 | # Enhance prompt with codex endpoint |
| 30 | python scripts/ace_cli.py --endpoint codex enhance_prompt -p "implement feature" |
| 31 | |
| 32 | # Check configuration |
| 33 | python scripts/ace_cli.py get_config |
| 34 | ``` |
| 35 | |
| 36 | ## Tool Routing Policy |
| 37 | |
| 38 | ### Prefer ACE-Tool Over Built-in Tools |
| 39 | |
| 40 | | Task | Avoid | Use ACE-Tool CLI | |
| 41 | |------|-------|------------------| |
| 42 | | Find function by purpose | `grep "def func"` | `search_context -q "function that..."` | |
| 43 | | Locate feature code | `find . -name "*.py"` | `search_context -q "feature description"` | |
| 44 | | Clarify requirements | Manual analysis | `enhance_prompt -p "requirement"` | |
| 45 | | Understand code flow | Multiple grep/read | `search_context -q "flow description"` | |
| 46 | | Index codebase | N/A | `index -p <project_root>` | |
| 47 | |
| 48 | ### When to Use Built-in Tools |
| 49 | - Exact string matching (known identifiers) |
| 50 | - File path patterns (known naming conventions) |
| 51 | - Simple text replacement |
| 52 | |
| 53 | ## Command Reference |
| 54 | |
| 55 | ### index |
| 56 | Index project files for remote codebase retrieval. Scans, hashes, chunks large files, and uploads to the ACE batch-upload API. Uses incremental indexing with gzip JSON cache at `.ace-tool/index.json.gz`. Respects both `.gitignore` and `.aceignore` patterns. |
| 57 | |
| 58 | ```bash |
| 59 | python scripts/ace_cli.py index -p <project_root> |
| 60 | |
| 61 | Options: |
| 62 | -p, --project-root Project root path (required) |
| 63 | ``` |
| 64 | |
| 65 | ### search_context |
| 66 | Search codebase using natural language descriptions. Routes to remote API (`POST /agents/codebase-retrieval`) when configured, with automatic local keyword fallback. |
| 67 | |
| 68 | ```bash |
| 69 | python scripts/ace_cli.py search_context -p <project_root> -q <query> |
| 70 | |
| 71 | Options: |
| 72 | -p, --project-root Project root path (required) |
| 73 | -q, --query Natural language query (required) |
| 74 | ``` |
| 75 | |
| 76 | ### enhance_prompt |
| 77 | Enhance prompts with codebase context and conversation history. All endpoints inject cloud retrieval context when `--project-root` is provided. Third-party endpoints additionally support search context injection via `PROMPT_ENHANCER_INCLUDE_SEARCH_CONTEXT`. |
| 78 | |
| 79 | ```bash |
| 80 | python scripts/ace_cli.py [--endpoint TYPE] enhance_prompt -p <prompt> [options] |
| 81 | |
| 82 | Global Options: |
| 83 | --endpoint Endpoint type: new, old, claude, openai, gemini, codex (default: new) |
| 84 | --api-url Override API base URL |
| 85 | --token Override API token |
| 86 | |
| 87 | Command Options: |
| 88 | -p, --prompt Original prompt (required) |
| 89 | -H, --history Conversation history: "User: xxx\nAssistant: yyy" |
| 90 | --history-file File containing conversation history |
| 91 | --project-root Project root path (enables cloud retrieval context) |
| 92 | --no-interactive Disable web UI, output JSON directly |
| 93 | --no-browser Don't auto-open browser, just print URL |
| 94 | --port Port for web server (default: 8765) |
| 95 | ``` |
| 96 | |
| 97 | ### get_config |
| 98 | Show current configuration status including endpoint resolution, env readiness, authentication source, and search context injection state. |
| 99 | |
| 100 | ```bash |
| 101 | python scripts/ace_cli.py get_config |
| 102 | ``` |
| 103 | |
| 104 | **Output fields:** |
| 105 | - `base_url` - Currently configured API base URL |
| 106 | - `endpoint` - Active enhancer endpoint (new/old/claude/openai/gemini/codex) |
| 107 | - `endpoint_effective` - Resolved endpoint after env variable |