moai-workflow-jit-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQuick Reference (30 seconds)
快速参考(30秒)
Purpose: Load relevant documentation on-demand based on user intent and context.
Primary Tools:
- WebSearch: Find latest documentation and resources online
- WebFetch: Retrieve specific documentation pages
- Context7 MCP: Access official library documentation (when available)
- Read, Grep, Glob: Search local project documentation
Trigger Patterns:
- User asks specific technical questions
- Technology keywords detected in conversation
- Domain expertise required for task completion
- Implementation guidance needed
用途:根据用户意图和上下文按需加载相关文档。
核心工具:
- WebSearch:在线查找最新文档和资源
- WebFetch:获取特定文档页面
- Context7 MCP:访问官方库文档(如有可用)
- Read、Grep、Glob:搜索本地项目文档
触发场景:
- 用户提出特定技术问题
- 对话中检测到技术关键词
- 任务完成需要领域专业知识
- 需要实施指导
Implementation Guide
实施指南
Intent Detection
意图检测
The system recognizes documentation needs through several patterns:
Question-Based Triggers:
- When users ask specific implementation questions (e.g., "how do I implement JWT authentication?")
- When users seek best practices or optimization guidance
- When troubleshooting questions arise
Technology-Specific Triggers:
- Detection of framework names: FastAPI, React, PostgreSQL, Docker, Kubernetes
- Detection of library names: pytest, TypeScript, GraphQL, Redis
- Detection of tool names: npm, pip, cargo, maven
Domain-Specific Triggers:
- Authentication and authorization topics
- Database and data modeling discussions
- Performance optimization inquiries
- Security-related questions
Pattern-Based Triggers:
- Implementation requests: "implement", "create", "build"
- Architecture discussions: "design", "structure", "pattern"
- Troubleshooting: "debug", "fix", "error", "not working"
系统通过多种模式识别文档需求:
基于问题的触发:
- 用户询问具体实施问题(例如:“如何实现JWT authentication?”)
- 用户寻求最佳实践或优化指导
- 出现故障排查问题
基于技术的触发:
- 检测到框架名称:FastAPI、React、PostgreSQL、Docker、Kubernetes
- 检测到库名称:pytest、TypeScript、GraphQL、Redis
- 检测到工具名称:npm、pip、cargo、maven
基于领域的触发:
- 身份验证与授权相关话题
- 数据库与数据建模讨论
- 性能优化咨询
- 安全相关问题
基于模式的触发:
- 实施请求:“implement”、“create”、“build”
- 架构讨论:“design”、“structure”、“pattern”
- 故障排查:“debug”、“fix”、“error”、“not working”
Documentation Sources
文档来源
The system retrieves documentation from multiple sources in priority order:
Local Project Documentation (Highest Priority):
- Check .moai/docs/ for project-specific documentation
- Check .moai/specs/ for requirements and specifications
- Check README.md for project overview
- Check docs/ directory for comprehensive documentation
Official Documentation Sources:
- Use WebFetch to retrieve official framework documentation
- Use Context7 MCP tools when available for library documentation
- Access technology-specific official websites
Community Resources:
- Use WebSearch to find high-quality tutorials
- Search for Stack Overflow solutions with high vote counts
- Find GitHub discussions for specific issues
Real-Time Web Research:
- Use WebSearch with current year for latest information
- Search for recent best practices and updates
- Find new features and deprecation notices
系统按优先级从多个来源检索文档:
本地项目文档(最高优先级):
- 检查.moai/docs/获取项目特定文档
- 检查.moai/specs/获取需求与规格说明
- 检查README.md获取项目概述
- 检查docs/目录获取全面文档
官方文档来源:
- 使用WebFetch获取官方框架文档
- 如有可用,使用Context7 MCP工具获取库文档
- 访问技术特定的官方网站
社区资源:
- 使用WebSearch查找高质量教程
- 搜索Stack Overflow上高投票数的解决方案
- 查找GitHub上针对特定问题的讨论
实时网络研究:
- 使用WebSearch结合当前年份查找最新信息
- 搜索近期最佳实践与更新内容
- 查找新功能与弃用通知
Loading Strategies
加载策略
Intent Analysis Process:
- Identify technologies mentioned in user request
- Determine domain areas relevant to the question
- Classify question type (implementation, troubleshooting, conceptual)
- Assess complexity to determine documentation depth needed
Source Prioritization:
- If local documentation exists: Load project-specific docs first
- If official documentation available: Retrieve authoritative sources
- If implementation examples needed: Search community resources
- If latest information required: Perform web research
Context-Aware Caching:
- Cache retrieved documentation within session
- Maintain relevance based on current conversation context
- Remove outdated content when context shifts
- Prioritize frequently accessed documentation
意图分析流程:
- 识别用户请求中提及的技术
- 确定与问题相关的领域
- 对问题类型进行分类(实施、故障排查、概念性)
- 评估复杂度以确定所需文档深度
来源优先级:
- 若存在本地文档:优先加载项目特定文档
- 若有官方文档:获取权威来源
- 若需要实施示例:搜索社区资源
- 若需要最新信息:进行网络研究
上下文感知缓存:
- 在会话内缓存已检索的文档
- 根据当前对话上下文保持相关性
- 上下文切换时移除过时内容
- 优先处理频繁访问的文档
Quality Assessment
质量评估
Content Quality Evaluation:
- Authority: Official sources receive highest trust
- Recency: Content within 12 months preferred for fast-moving technologies
- Completeness: Documentation with examples ranked higher
- Relevance: Match between content and user intent
Relevance Ranking:
- Calculate match between documentation content and user question
- Weight authority (30%), recency (25%), completeness (25%), relevance (20%)
- Return highest-scoring documentation first
- Indicate confidence level in retrieved information
内容质量评估:
- 权威性:官方来源可信度最高
- 时效性:对于快速迭代的技术,优先选择12个月内的内容
- 完整性:包含示例的文档排名更高
- 相关性:内容与用户意图的匹配度
相关性排名:
- 计算文档内容与用户问题的匹配度
- 权重分配:权威性(30%)、时效性(25%)、完整性(25%)、相关性(20%)
- 优先返回得分最高的文档
- 标注检索信息的置信度
Practical Workflows
实际工作流
Authentication Implementation Workflow:
- When user asks about authentication: Detect technologies (e.g., FastAPI, JWT)
- Identify domains: authentication, security
- Load FastAPI security documentation via WebFetch
- Search for JWT best practices via WebSearch
- Provide comprehensive guidance with source attribution
Database Optimization Workflow:
- When user asks about query performance: Detect database technology
- Identify domain: performance, optimization
- Load official database documentation
- Search for optimization guides and tutorials
- Provide actionable recommendations with sources
New Technology Adoption Workflow:
- When user introduces unfamiliar technology: Detect technology name
- Load official getting started documentation
- Search for migration guides if applicable
- Find integration patterns with existing stack
- Provide strategic adoption guidance
身份验证实施工作流:
- 当用户询问身份验证相关问题时:检测技术(例如FastAPI、JWT)
- 识别领域:身份验证、安全
- 通过WebFetch加载FastAPI安全文档
- 通过WebSearch搜索JWT最佳实践
- 提供带有来源标注的全面指导
数据库优化工作流:
- 当用户询问查询性能相关问题时:检测数据库技术
- 识别领域:性能、优化
- 加载官方数据库文档
- 搜索优化指南与教程
- 提供带有来源的可操作建议
新技术采用工作流:
- 当用户引入不熟悉的技术时:检测技术名称
- 加载官方入门文档
- 如有需要,搜索迁移指南
- 查找与现有技术栈的集成模式
- 提供战略性采用指导
Error Handling
错误处理
Network Failures:
- If web search fails: Fall back to cached content
- If WebFetch fails: Use local documentation if available
- Indicate partial results when some sources unreachable
Content Quality Issues:
- If retrieved content seems outdated: Search for newer sources
- If relevance unclear: Ask user for clarification
- If conflicting information found: Present multiple sources with dates
Relevance Mismatches:
- If initial search yields poor results: Refine search query
- If user context unclear: Request clarification before loading
- If documentation gap exists: Acknowledge limitation
网络故障:
- 若网络搜索失败:回退到缓存内容
- 若WebFetch失败:如有可用则使用本地文档
- 当部分源无法访问时,标注结果为部分内容
内容质量问题:
- 若检索内容看起来过时:搜索更新的来源
- 若相关性不明确:请求用户澄清
- 若发现冲突信息:展示多个来源及其日期
相关性不匹配:
- 若初始搜索结果不佳:优化搜索查询
- 若用户上下文不明确:加载前请求澄清
- 若存在文档缺口:告知局限性
Performance Optimization
性能优化
Caching Strategy:
- Maintain session-level cache for frequently accessed docs
- Keep project-specific documentation in memory
- Evict stale content based on access time
Efficient Loading:
- Load documentation only when explicitly needed
- Avoid preloading all possible documentation
- Use targeted searches rather than broad queries
Batch Processing:
- Combine related searches when possible
- Group documentation requests by technology
- Process multiple sources in parallel when appropriate
缓存策略:
- 为频繁访问的文档维持会话级缓存
- 将项目特定文档保存在内存中
- 根据访问时间淘汰过期内容
高效加载:
- 仅在明确需要时加载文档
- 避免预加载所有可能的文档
- 使用针对性搜索而非宽泛查询
批量处理:
- 尽可能合并相关搜索
- 按技术分组文档请求
- 适当时并行处理多个来源
Advanced Patterns
高级模式
Multi-Source Aggregation:
- Combine official documentation with community examples
- Cross-reference multiple authoritative sources
- Synthesize comprehensive answers from diverse materials
Context Persistence:
- Remember documentation loaded earlier in conversation
- Avoid redundant loading of same documentation
- Build cumulative knowledge through session
Proactive Loading:
- Anticipate documentation needs based on conversation flow
- Pre-load related topics when discussing complex features
- Suggest relevant documentation before user asks
多源聚合:
- 将官方文档与社区示例结合
- 交叉引用多个权威来源
- 从多样化材料中综合出全面答案
上下文持久化:
- 记住会话中之前加载的文档
- 避免重复加载相同文档
- 通过会话积累知识
主动加载:
- 根据对话流程预判文档需求
- 讨论复杂功能时预加载相关主题
- 在用户提问前推荐相关文档
Works Well With
适配工具
Agents:
- workflow-docs: Documentation generation
- core-planner: Documentation planning
- workflow-spec: SPEC documentation
Skills:
- moai-docs-generation: Documentation generation
- moai-workflow-docs: Documentation validation
- moai-library-nextra: Nextra documentation
Commands:
- /moai:3-sync: Documentation synchronization
- /moai:9-feedback: Documentation improvements
Agents:
- workflow-docs:文档生成
- core-planner:文档规划
- workflow-spec:SPEC文档
Skills:
- moai-docs-generation:文档生成
- moai-workflow-docs:文档验证
- moai-library-nextra:Nextra文档
Commands:
- /moai:3-sync:文档同步
- /moai:9-feedback:文档改进