Ace Tool logo

Ace Tool

Community
Dianel555
ace-tool

Semantic 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 operations for better accuracy, (5) Complex requirements clarification, (6) Large codebase navigation. Triggers: "search context", "enhance prompt", "find code that", "index project", "clarify requirements". IMPORTANT: Always use ace-tool BEFORE grep/find/glob for semantic-level code location.

Overview

PublisherDianel555
RepositoryDSkills
Skill nameace-tool
Stars
65
Forks
8
Bundled files
31
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 31 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Dianel555 on GitHub. Read the source before you install it.

Installation

Install the Ace Tool AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Dianel555/DSkills/tree/main/skills/ace-tool
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Dianel555/DSkills.git /tmp/DSkills
mkdir -p .claude/skills
cp -r /tmp/DSkills/skills/ace-tool .claude/skills/ace-tool
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ace Tool in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ace Tool on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ace Tool is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

ACE-Tool - Semantic Code Search & Prompt Enhancement

High-performance semantic search, code indexing, and AI-powered prompt enhancement. Standalone CLI (no MCP dependency).

Execution Methods

bash
# Prerequisites: pip install httpx tenacity "pathspec>=1.1.1,<2"
# Environment: ACE_API_URL, ACE_API_TOKEN (optional for local fallback)

# Index project for remote search (upload code blobs to ACE service)
python scripts/ace_cli.py index -p /path/to/project

# Search codebase with natural language (remote if API configured, else local fallback)
python scripts/ace_cli.py search_context -p /path/to/project -q "function that handles authentication"

# Enhance prompt (interactive mode - default, opens browser)
python scripts/ace_cli.py enhance_prompt -p "implement login feature" -H "User: what auth method?\nAssistant: JWT"

# Enhance prompt (non-interactive, JSON output)
python scripts/ace_cli.py enhance_prompt --no-interactive -p "implement login feature"

# Enhance prompt with project context (enables cloud retrieval for all endpoints)
python scripts/ace_cli.py enhance_prompt -p "implement login feature" --project-root /path/to/project

# Enhance prompt with specific endpoint
python scripts/ace_cli.py --endpoint claude enhance_prompt -p "implement login feature"

# Enhance prompt with codex endpoint
python scripts/ace_cli.py --endpoint codex enhance_prompt -p "implement feature"

# Check configuration
python scripts/ace_cli.py get_config

Tool Routing Policy

Prefer ACE-Tool Over Built-in Tools

TaskAvoidUse ACE-Tool CLI
Find function by purposegrep "def func"search_context -q "function that..."
Locate feature codefind . -name "*.py"search_context -q "feature description"
Clarify requirementsManual analysisenhance_prompt -p "requirement"
Understand code flowMultiple grep/readsearch_context -q "flow description"
Index codebaseN/Aindex -p <project_root>

When to Use Built-in Tools

  • Exact string matching (known identifiers)
  • File path patterns (known naming conventions)
  • Simple text replacement

Command Reference

index

Index project files for remote codebase retrieval. Scans, hashes, and uploads whole files (up to 128 KiB) with their original paths to the ACE batch-upload API; chunking is left to the service. Uses incremental indexing with gzip JSON cache at .ace-tool/index.json.gz; legacy chunk-based caches are rebuilt once. Respects both .gitignore and .aceignore patterns. The supplied project root is the index and upload boundary; each root keeps its own cache, and indexing a parent does not delete child caches. Symbolic links, junctions and other reparse points below the root are never followed, so only real files inside the root are read and uploaded; an unreadable or out-of-boundary path is skipped instead of falling back to a plain path read. The backend must confirm upload hashes and support the OCE-compatible /agents/blob-status endpoint; indexing, search, and scoped enhancement wait for readiness and report a timeout or unsupported status explicitly. Unknown blobs trigger one rebuild and re-upload.

bash
python scripts/ace_cli.py index -p <project_root>

Options:
  -p, --project-root    Project root path (required)

search_context

Search codebase using natural language descriptions. Routes to remote API (POST /agents/codebase-retrieval) when configured, with local keyword fallback for remote errors or empty results. Upload and readiness failures remain explicit errors. Local fallback supplies matching file paths, not semantic code snippets.

bash
python scripts/ace_cli.py search_context -p <project_root> -q <query>

Options:
  -p, --project-root    Project root path (required)
  -q, --query           Natural language query (required)

enhance_prompt

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.

bash
python scripts/ace_cli.py [--endpoint TYPE] enhance_prompt -p <prompt> [options]

Global Options:
  --endpoint            Endpoint type: new, old, claude, openai, gemini, codex (default: new)
  --api-url             Override API base URL
  --token               Override API token

Command Options:
  -p, --prompt          Original prompt (required)
  -H, --history         Conversation history: "User: xxx\nAssistant: yyy"
  --history-file        File containing conversation history
  --project-root        Project root path (enables cloud retrieval context)
  --no-interactive      Disable web UI, output JSON directly
  --no-browser          Don't auto-open browser, just print URL
  --port                Port for web server (default: 8765)

get_config

Show current configuration status including endpoint resolution, env readiness, authentication source, and search context injection state.

bash
python scripts/ace_cli.py get_config

Output fields:

  • base_url - Currently configured API base URL
  • endpoint - Active enhancer endpoint (new/old/claude/openai/gemini/codex)
  • endpoint_effective - Resolved endpoint after env variable resolution
  • endpoint_env_ready - Whether required endpoint configuration is complete
  • token_configured - Whether authentication token is set
  • third_party_configured - Whether third-party endpoint config is complete
  • auth_source - Authentication source: constructor | session.json | AUGMENT_SESSION_AUTH | ACE_API_TOKEN | none
  • search_context_injection - Whether search context injection is enabled

Interactive Enhancement

Default mode opens web UI with actions:

ButtonAction
RegenerateDiscard current, generate new enhancement from original prompt
RefineIteratively improve current version, preserving your edits
Use OriginalReturn the original prompt without enhancement
Send EnhancedConfirm and use the current enhanced prompt
CancelAbort the enhancement process

Keyboard Shortcuts: Ctrl+Enter Send | Esc Cancel

Endpoint Architecture

Supported Endpoints

EndpointAPI PathDefault ModelAuth HeaderStatus
new/prompt-enhancerclaude-sonnet-4-5Bearer ACE_API_TOKEN⚠️ Currently unavailable
old/chat-stream (SSE)claude-sonnet-4-5Bearer ACE_API_TOKEN⚠️ Currently unavailable
claude/v1/messagessonnet-4-6-20250929x-api-key✅ Available
openai/v1/chat/completionsgpt-5.4Bearer PROMPT_ENHANCER_TOKEN✅ Available
gemini/v1beta/models/{model}:generateContentgemini-3-flash-previewx-goog-api-key✅ Available
codex/v1/responsesgpt-5.4Bearer PROMPT_ENHANCER_TOKEN✅ Available

Note: The official Augment endpoints (new and old) are currently experiencing service issues. Use third-party endpoints for prompt enhancement.

Endpoint Resolution Order

PROMPT_ENHANCER_ENDPOINT > ACE_ENHANCER_ENDPOINT (legacy) > --endpoint CLI flag > new (default)

Third-Party Endpoints

claude, openai, gemini, codex are third-party endpoints. They require:

  • PROMPT_ENHANCER_BASE_URL — API base URL
  • PROMPT_ENHANCER_TOKEN — API key/token
  • PROMPT_ENHANCER_MODEL — (optional) override default model

Missing configuration raises ValueError immediately (hard error, no silent fallback).

URL Construction

All HTTP calls use build_api_url(base_url, path) which handles /v1/, /v1beta/ version prefix deduplication. No hardcoded f-string URL construction.

Environment Variables

Authentication (Priority Order)

ACE-Tool supports multiple authentication methods with the following priority:

  1. Constructor parameters (highest priority, programmatic use only)
  2. ~/.augment/session.json (recommended, created by auggie login)
  3. AUGMENT_SESSION_AUTH (CI/CD and headless environments)
  4. Legacy ACE_API_* (deprecated, backward compatibility only)
VariableDescription
AUGMENT_SESSION_AUTHJSON string with accessToken and tenantURL (new format, recommended for CI/CD)
ACE_API_URL⚠️ Deprecated - ACE API base URL (use session.json or AUGMENT_SESSION_AUTH instead)
ACE_API_TOKEN⚠️ Deprecated - ACE API authentication token (use session.json or AUGMENT_SESSION_AUTH instead)

Recommended: Use ~/.augment/session.json

Create this file via auggie login, or manually with this format:

json
{
  "accessToken": "your-token-here",
  "tenantURL": "https://api.example.com/",
  "scopes": ["email"]
}

For CI/CD: Use AUGMENT_SESSION_AUTH environment variable

bash
export AUGMENT_SESSION_AUTH='{"accessToken":"token","tenantURL":"https://api.example.com/"}'

Migration Guide: Legacy to New Format

If currently using ACE_API_URL and ACE_API_TOKEN:

  1. Option A (Recommended): Use auggie login to create ~/.augment/session.json
  2. Option B: Convert to AUGMENT_SESSION_AUTH:
    bash
    export AUGMENT_SESSION_AUTH='{"accessToken":"YOUR_ACE_API_TOKEN","tenantURL":"YOUR_ACE_API_URL"}'
  3. Remove old variables (optional, they'll be ignored if new format exists)

Legacy variables continue to work for backward compatibility but are not recommended for new setups.

Endpoint Configuration

VariableDescription
PROMPT_ENHANCER_ENDPOINTEndpoint override: new, old, claude, openai, gemini, codex
ACE_ENHANCER_ENDPOINTLegacy endpoint override (fallback if PROMPT_ENHANCER_ENDPOINT not set)
PROMPT_ENHANCER_BASE_URLThird-party API base URL (for claude/openai/gemini/codex endpoints)
PROMPT_ENHANCER_TOKENThird-party API token
PROMPT_ENHANCER_MODELOverride default model for third-party endpoints
PROMPT_ENHANCER_INCLUDE_SEARCH_CONTEXTEnable search context injection for third-party endpoints (1, true, yes, on)
ACE_UPLOAD_READ_TIMEOUT_SECONDSUpload response read inactivity timeout in seconds (default: 300)
ACE_UPLOAD_BATCH_COUNTMaximum blobs per batch (default/maximum: 30)
ACE_UPLOAD_BATCH_BYTESMaximum UTF-8 content bytes per batch (default/maximum: 1048576)

Settings are positive and finite. The byte budget counts content only, excluding JSON/HTTP overhead, and each blob must fit within it. Read/write and other uncertain transport errors, or HTTP 408, 429, and 5xx responses, trigger /agents/blob-status polling before retransmission. Previously uncertain blobs receive a 5-second grace period when status is unknown; pending blobs are polled up to 180 seconds. These are not strict wall-clock limits because HTTPX read timeouts measure inactivity. When status remains uncertain or unavailable, unresolved blobs are retried automatically up to three potentially sent attempts per blob across process restarts. The server may still be processing an earlier request, so this does not guarantee exactly-once server work. Exhausted attempts, authentication failures, and unsafe recovery state produce explicit errors.

A per-project OS lock serializes cooperating processes through index publication. .ace-tool/upload-journal.json stores blob hashes, hashed service origins and API path prefixes, and attempt state, not file contents or tokens. URL paths must contain only non-secret API prefixes; configure credentials separately. Configured tokens in paths are rejected, but arbitrary path secrets cannot be detected automatically. Blobs are checked with current credentials before upload and ready blobs are reused. Acknowledged entries are compacted; uncertain entries and their attempt counts are retained. Uploads fail explicitly if unresolved entries exceed the 64 MiB journal limit. The persistent .ace-tool.lock marker rejects mixed Windows and POSIX/WSL access to the same project root; use a separate root for each platform.

Search Context Injection

When PROMPT_ENHANCER_INCLUDE_SEARCH_CONTEXT is enabled and a third-party endpoint is used, the system automatically:

  1. Performs a remote codebase search via ACE API using the original prompt as query
  2. Normalizes the result (placeholder if empty, truncate at 12000 chars if too long)
  3. Wraps the search results in <codebase_context> XML tags
  4. Wraps the original prompt in <original_request> XML tags
  5. Sends the combined prompt to the third-party LLM

Requires --project-root and valid ACE_API_URL/ACE_API_TOKEN. Raises ValueError if project_root is missing when injection is enabled.

.aceignore

Project-root and nested .gitignore files apply with Git's directory-relative pattern precedence. A project-root .aceignore uses the same glob syntax as an independent, additional exclusion filter: its negations can override earlier .aceignore rules but cannot re-include files excluded by .gitignore. Both filters also apply to local fallback; an ignored parent directory cannot be re-included by a child pattern.

# .aceignore example
test_fixtures/
*.generated.ts
large_data/
node_modules/
.*/
logs/
tests/

Workflow

Phase 0: Index Project (once or after major changes)

bash
index -p .                                            # Upload code blobs to ACE

Phase 1: Semantic Search

bash
search_context -p . -q "database connection pooling"  # Remote retrieval or local fallback

Phase 2: Prompt Enhancement

bash
enhance_prompt -p "optimize query performance" --project-root .  # With cloud context
# Review and refine enhanced prompt
# Use Regenerate/Refine as needed
# Send Enhanced to confirm

Error Handling

json
{"error": "error message", "status_code": 401}
ErrorRecovery
No API configuredUses local fallback for search_context; returns original for enhance
Token invalid (401)Check API token (logged at ERROR level)
Access denied (403)Token may be disabled (logged at ERROR level)
Upload failureReport an error; keep the previous cache on disk without returning its stale blobs
Connection timeoutRetries up to 3 times with exponential backoff
No resultsBroaden search query
Third-party not configuredValueError raised immediately (no silent fallback)
Search context missing project_rootValueError raised when injection enabled without --project-root

Anti-Patterns

ProhibitedCorrect
Grep before semantic searchUse search_context first
Skip prompt enhancementUse enhance_prompt for complex tasks
Ignore conversation historyInclude history in enhance_prompt
Use exact match for conceptual searchUse natural language query
Always use non-interactive modeUse interactive mode for review
Skip --project-root for enhanceInclude it for cloud-based code context

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ace Tool AI skill do?

Semantic 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 operations for better accuracy, (5) Complex requirements clarification, (6) Large codebase navigation. Triggers: "search context", "enhance prompt", "find code that", "index project", "clarify requirements". IMPORTANT: Always use ace-tool BEFORE grep/find/glob for semantic-level code location.

Why use Ace Tool on TypingMind?

Because you install it once and use it with any model. Ace Tool is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ace Tool in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Dianel555/DSkills/tree/main/skills/ace-tool. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ace Tool?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ace Tool?

As many as you like. As long as a model supports skills, you can use Ace Tool with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ace Tool AI skill free?

Yes. It is published on GitHub by Dianel555 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇