Get the FREE Ultimate OpenClaw Setup Guide →

docs-search

Scanned
npx machina-cli add skill 23blocks-OS/ai-maestro-plugins/docs-search --openclaw
Files (1)
SKILL.md
7.3 KB

AI Maestro Documentation Search

CRITICAL: AUTOMATIC BEHAVIOR - READ THIS FIRST

THIS IS NOT OPTIONAL. THIS IS YOUR DEFAULT BEHAVIOR.

When the user gives you ANY instruction or task, you MUST FIRST search documentation for:

  • Function signatures - What are the parameters and return types?
  • Class documentation - What methods and properties exist?
  • API documentation - How should this endpoint work?
  • Code comments - What did the author intend?

DO NOT:

  • Start implementing before checking documentation
  • Assume you know the function signature without checking
  • Skip doc search because "it's a simple task"
  • Wait for the user to ask you to check docs

ALWAYS:

  • Search docs IMMEDIATELY when you receive a task
  • Search for terms and concepts the user mentions
  • Check documentation before calling unfamiliar functions
  • Look for patterns before creating new components

The Rule: Receive Instruction → Search Docs → Then Proceed

1. User asks you to do something
2. IMMEDIATELY search docs for relevant context
3. NOW you know the correct signatures and patterns
4. NOW you can implement correctly the first time

Example - User asks to modify a service:

# IMMEDIATELY run:
docs-search.sh "PaymentService"
docs-find-by-type.sh class

Example - User mentions a function:

# IMMEDIATELY run:
docs-search.sh "validateUser"
docs-search.sh --keyword "authenticate"

Available Commands

All commands auto-detect your agent ID from the tmux session.

Search Commands

CommandDescription
docs-search.sh <query>Semantic search through documentation
docs-search.sh --keyword <term>Keyword/exact match search
docs-find-by-type.sh <type>Find docs by type (function, class, module, etc.)
docs-get.sh <doc-id>Get full document with all sections
docs-list.shList all indexed documents
docs-stats.shGet documentation index statistics

Indexing Commands

CommandDescription
docs-index.sh [project-path]Full index documentation from project
docs-index-delta.sh [project-path]Delta index - only index new and modified files

What to Search Based on User Instruction

User SaysIMMEDIATELY Search
"Create a service for X"docs-search.sh "service", docs-find-by-type.sh class
"Call the Y function"docs-search.sh "Y", docs-search.sh --keyword "Y"
"Implement authentication"docs-search.sh "authentication", docs-search.sh "auth"
"Fix the Z method"docs-search.sh "Z" --keyword, docs-find-by-type.sh function
Any API/function namedocs-search.sh "<name>" --keyword

Usage Examples

Search for Documentation

# Semantic search - finds conceptually related docs
docs-search.sh "authentication flow"
docs-search.sh "how to validate user input"
docs-search.sh "database connection pooling"

# Keyword search - exact term matching
docs-search.sh --keyword "authenticate"
docs-search.sh --keyword "UserController"

Find by Document Type

# Find all function documentation
docs-find-by-type.sh function

# Find all class documentation
docs-find-by-type.sh class

# Find all module/concern documentation
docs-find-by-type.sh module

# Find all interface documentation
docs-find-by-type.sh interface

Get Full Document

# After finding a doc ID from search results
docs-get.sh doc-abc123

# Shows full content including all sections

List and Stats

# List all indexed documents
docs-list.sh

# Get index statistics
docs-stats.sh

Index Documentation

# Index current project (auto-detected from agent config)
docs-index.sh

# Index specific project
docs-index.sh /path/to/project

Delta Index Documentation

# Delta index - only process new and modified files (much faster)
docs-index-delta.sh

# Delta index a specific project
docs-index-delta.sh /path/to/project

Use delta indexing for incremental updates after code changes. Use full docs-index.sh for a complete re-index.

Document Types

The following document types are recognized:

TypeDescriptionSources
functionFunction/method documentationJSDoc, RDoc, docstrings
classClass documentationClass-level comments
moduleModule/namespace documentationModule comments
interfaceInterface/type documentationTypeScript interfaces
componentReact/Vue component documentationComponent comments
constantDocumented constantsConstant comments
readmeREADME filesREADME.md, README.txt
guideGuide/tutorial documentationdocs/ folder

Integration with Other Skills

Docs-search works best when combined with other skills:

Combined Search Pattern (RECOMMENDED)

When you receive ANY user instruction:

# 1. Search your memory first
memory-search.sh "topic"

# 2. Search documentation
docs-search.sh "topic"

# 3. Check code structure
graph-describe.sh ComponentName

This gives you complete context:

  • Memory: What was discussed before?
  • Docs: What does the documentation say?
  • Graph: What is the code structure?

Why This Matters

Without searching docs first, you will:

  • Use wrong function signatures (then get runtime errors)
  • Miss existing implementations (then duplicate code)
  • Violate documented patterns (then create inconsistency)
  • Misunderstand APIs (then build the wrong thing)

Doc search takes 1 second. Redoing work takes hours.

Helper Scripts

This skill relies on an internal helper script that provides shared utility functions:

  • docs-helper.sh - Sourced by the docs-*.sh tool scripts. Provides documentation-specific API functions (docs_query, docs_index) and initialization logic. Located alongside the tool scripts in ~/.local/bin/ (installed) or plugin/src/scripts/ (source). If tool scripts fail with "common.sh not found", re-run the installer (./install-doc-tools.sh).

Error Handling

Script not found:

  • Check PATH: which docs-search.sh
  • Verify scripts installed: ls -la ~/.local/bin/docs-*.sh
  • Scripts are installed to ~/.local/bin/ which should be in your PATH
  • If not found, run: ./install-doc-tools.sh

API connection fails:

  • Ensure AI Maestro is running: curl http://127.0.0.1:23000/api/hosts/identity
  • Ensure documentation has been indexed: docs-stats.sh
  • If no docs indexed, run: docs-index.sh

Documentation is empty:

  • Check project has documented code (JSDoc, docstrings, comments)
  • Verify project path is correct
  • Re-index with: docs-index.sh /path/to/project

No results found:

  • Inform the user: "No documentation found for X - proceeding with code analysis, but documentation may need to be generated."

Installation

If commands are not found:

./install-doc-tools.sh

This installs scripts to ~/.local/bin/.

Source

git clone https://github.com/23blocks-OS/ai-maestro-plugins/blob/main/src/skills/docs-search/SKILL.mdView on GitHub

Overview

docs-search automatically searches auto-generated project docs when you receive any instruction. It looks for function signatures, class docs, API documentation, and code comments to guide implementation. This ensures accuracy, reduces guesswork, and preserves codebase consistency by relying on existing documentation.

How This Skill Works

Upon receiving a task, the skill immediately runs docs-search.sh with relevant terms and then uses docs-find-by-type.sh to identify functions or classes. It fetches full details with docs-get.sh and cross checks API docs and code comments before you implement. This workflow minimizes surprises and aligns changes with the codebase documentation.

When to Use It

  • When you need to create or modify a service or module, and you want to verify interfaces before coding.
  • When you must call or wrap a specific function or API endpoint and need exact signatures.
  • When implementing authentication or input validation and you want to confirm usage patterns.
  • When fixing a specific method or function and you require precise usage details from docs.
  • When you hear about an API or function name and want to pull the official docs first.

Quick Start

  1. Step 1: Run docs-search.sh with the task keyword or function name.
  2. Step 2: Run docs-find-by-type.sh and docs-get.sh to inspect results.
  3. Step 3: Implement using the verified signatures and documented examples.

Best Practices

  • Always start with a docs-search upon task receipt.
  • Use docs-find-by-type to locate the relevant function or class before coding.
  • Fetch full context with docs-get to review signatures and examples.
  • Keep the docs index fresh with docs-index.sh or docs-index-delta.sh when needed.
  • Cross check API docs and code comments to validate edge cases and constraints.

Example Use Cases

  • Designing a new REST endpoint by validating its signature and docs before implementation.
  • Wrapping an existing function after confirming its contract via documentation.
  • Refactoring a class to align with documented methods and properties.
  • Debugging an integration by inspecting API docs and code comments for expected behavior.
  • Auditing a module to ensure all methods are covered by documented usage.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers