Skill站外收录 @skilllib/skill-2014279382435573761
docs-search
主动检索自动生成的代码文档,覆盖函数签名、类定义、API说明和源码注释,在执行任何用户指令前优先获取准确上下文,确保实现符合既有规范与设计意图。
文档处理 AI 技能
Skills.MD
# 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:**
```bash
# IMMEDIATELY run:
docs-search.sh "PaymentService"
docs-find-by-type.sh class
```
**Example - User mentions a function:**
```bash
# 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
| Command | Description |
|---------|-------------|
| `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.sh` | List all indexed documents |
| `docs-stats.sh` | Get documentation index statistics |
### Indexing Commands
| Command | Description |
|---------|-------------|
| `docs-index.sh [project-path]` | Index documentation from project |
## What to Search Based on User Instruction
| User Says | IMMEDIATELY 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 name | `docs-search.sh "<name>" --keyword` |
## Usage Examples
### Search for Documentation
```bash
# 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
```bash
# 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
```bash
# After finding a doc ID from search results
docs-get.sh doc-abc123
# Shows full content including all sections
```
### List and Stats
```bash
# List all indexed documents
docs-list.sh
# Get index statistics
docs-stats.sh
```
### Index Documentation
```bash
# Index current project (auto-detected from agent config)
docs-index.sh
# Index specific project
docs-index.sh /path/to/project
```
## Document Types
The following document types are recognized:
| Type | Description | Sources |
|------|-------------|---------|
| `function` | Function/method documentation | JSDoc, RDoc, docstrings |
| `class` | Class documentation | Class-level comments |
| `module` | Module/namespace documentation | Module comments |
| `interface` | Interface/type documentation | TypeScript interfaces |
| `component` | React/Vue component documentation | Component comments |
| `constant` | Documented constants | Constant comments |
| `readme` | README files | README.md, README.txt |
| `guide` | Guide/tutorial documentation | docs/ folder |
## Integration with Other Skills
Docs-search works best when combined with other skills:
### Combined Search Pattern (RECOMMENDED)
When you receive ANY user instruction:
```bash
# 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.**
## 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-docs-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:
```bash
./install-docs-tools.sh
```
This installs scripts to `~/.local/bin/`.
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「docs-search」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次