best-practice-core

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Best Practice Core

最佳实践核心

Extracts core best practices for a topic and formats them as a minimal, keyword-focused tree.
提取指定主题的核心最佳实践,并将其格式化为以关键词为核心的最小化树状结构。

Purpose

用途

Extract essential best practices for implementation tasks and format them as ultra-concise tree structures for quick reference during development.
提取实施任务的关键最佳实践,并将其格式化为超简洁的树状结构,以便在开发过程中快速参考。

When to Use

使用时机

Invocation Timing:
  • During task planning phase (before implementation)
  • When writing subtasks in
    Docs/{name}_Task.md
    documents
  • BEFORE Worker agents start implementation
Output Location:
  • Written directly under each subtask in Task document
  • Acts as quick reference for developers/agents
调用时机:
  • 任务规划阶段(实施前)
  • 编写
    Docs/{name}_Task.md
    文档中的子任务时
  • 在Worker Agent开始实施之前
输出位置:
  • 直接写入任务文档的每个子任务下方
  • 作为开发人员/Agent的快速参考

Output Rules (STRICT ENFORCEMENT)

输出规则(严格执行)

Format Constraints

格式约束

RuleConstraint
Max depth3 levels
Max children per node5 items
Leaf node max length12 words OR 60 characters
Node formatNoun phrases/keywords ONLY
DuplicatesMerge into single item
Tree formatMarkdown tree ONLY (no mixing)
规则约束
最大深度3层
每个节点的最大子节点数5个
叶子节点最大长度12个单词或60个字符
节点格式仅使用名词短语/关键词
重复项合并为单个条目
树状格式仅使用Markdown树状结构(不混合其他格式)

Zero Tolerance Items

零容忍项

FORBIDDEN:
  • Intro paragraphs, conclusions, or commentary
  • Full sentences in leaf nodes
  • Explanatory text outside the tree
  • Mixed tree formats (ASCII + Markdown)
  • Depth > 3 or children > 5
  • Duplicate items
REQUIRED:
  • ONLY output the tree structure
  • Use noun phrases: "Error boundary setup", "State validation logic"
  • Keep leaf nodes concise: max 12 words
  • Merge similar concepts
  • Single tree format (Markdown bullets)
禁止:
  • 介绍性段落、结论或评论
  • 叶子节点使用完整句子
  • 树状结构外的解释性文本
  • 混合树状格式(ASCII + Markdown)
  • 深度超过3层或子节点数超过5个
  • 重复条目
要求:
  • 仅输出树状结构
  • 使用名词短语:例如"Error boundary setup", "State validation logic"
  • 叶子节点保持简洁:最多12个单词
  • 合并相似概念
  • 使用单一树状格式(Markdown项目符号)

Example Output

示例输出

Topic: Implementing User Authentication
markdown
- User Authentication
  - Security
    - Password hashing (bcrypt/argon2)
    - JWT token management
    - HTTPS-only cookies
  - Validation
    - Input sanitization
    - Email format check
    - Rate limiting
  - Error Handling
    - Failed login attempts tracking
    - Account lockout mechanism
    - Clear error messages (no data leaks)
主题:实现用户认证
markdown
- User Authentication
  - Security
    - Password hashing (bcrypt/argon2)
    - JWT token management
    - HTTPS-only cookies
  - Validation
    - Input sanitization
    - Email format check
    - Rate limiting
  - Error Handling
    - Failed login attempts tracking
    - Account lockout mechanism
    - Clear error messages (no data leaks)

Workflow

工作流程

When invoked with a topic:
  1. Identify Core Areas: Extract 2-5 main categories for the topic
  2. Extract Best Practices: For each category, list 2-5 key practices
  3. Format as Keywords: Convert to noun phrases (no full sentences)
  4. Verify Constraints: Check depth ≤ 3, children ≤ 5, length ≤ 12 words
  5. Merge Duplicates: Combine similar/overlapping items
  6. Output Tree ONLY: No intro, no conclusion, just the tree
当传入主题时:
  1. 识别核心领域:提取主题的2-5个主要类别
  2. 提取最佳实践:为每个类别列出2-5个关键实践
  3. 格式化为关键词:转换为名词短语(不使用完整句子)
  4. 验证约束:检查深度≤3、子节点≤5、长度≤12个单词
  5. 合并重复项:合并相似/重叠的条目
  6. 仅输出树状结构:无介绍、无结论,仅输出树

Integration with Task Documents

与任务文档的集成

Example Task Document Integration:
markdown
undefined
任务文档集成示例:
markdown
undefined

Worker1

Worker1

  • Implement user authentication #auth !high Deadline(2025:01:15)
    • Design login UI layout <!-- Best Practice Tree -->
      • Login UI
        • Layout
          • Mobile-first responsive design
          • Focus management (accessibility)
          • Password visibility toggle
        • Validation
          • Real-time feedback
          • Clear error states
        • Security
          • No password in URL params
          • Auto-logout on idle
    • Create API integration <!-- Best Practice Tree -->
      • Auth API Integration
        • Request Handling
          • Token refresh logic
          • Retry with exponential backoff
        • Error Handling
          • Network failure graceful degradation
          • 401/403 redirect to login
        • Security
          • Secure token storage
          • XSS/CSRF protection
undefined
  • Implement user authentication #auth !high Deadline(2025:01:15)
    • Design login UI layout <!-- Best Practice Tree -->
      • Login UI
        • Layout
          • Mobile-first responsive design
          • Focus management (accessibility)
          • Password visibility toggle
        • Validation
          • Real-time feedback
          • Clear error states
        • Security
          • No password in URL params
          • Auto-logout on idle
    • Create API integration <!-- Best Practice Tree -->
      • Auth API Integration
        • Request Handling
          • Token refresh logic
          • Retry with exponential backoff
        • Error Handling
          • Network failure graceful degradation
          • 401/403 redirect to login
        • Security
          • Secure token storage
          • XSS/CSRF protection
undefined

Usage Notes

使用注意事项

  • Concise over Complete: Focus on critical practices, not exhaustive lists
  • Actionable Keywords: Use phrases developers can immediately act on
  • Context-Aware: Tailor to the specific subtask context (UI vs API vs DB)
  • No Duplication: If practice applies to multiple subtasks, mention once in parent
  • 简洁优先于完整:聚焦关键实践,而非详尽列表
  • 可执行关键词:使用开发人员可直接采取行动的短语
  • 上下文感知:根据特定子任务上下文调整(UI vs API vs 数据库)
  • 避免重复:如果某实践适用于多个子任务,仅在父任务中提及一次

Common Topics

常见主题

Topic TypeCore Areas to Cover
UI ComponentsLayout, Accessibility, State, Events, Performance
API IntegrationRequest/Response, Error Handling, Caching, Security
Database OperationsSchema Design, Query Optimization, Transactions, Validation
State ManagementData Flow, Mutations, Side Effects, Persistence
TestingCoverage, Edge Cases, Mocking, Performance

Remember: Output ONLY the tree. No explanations.
主题类型需覆盖的核心领域
UI Components布局、可访问性、状态、事件、性能
API Integration请求/响应、错误处理、缓存、安全
Database Operations架构设计、查询优化、事务、验证
State Management数据流、变更、副作用、持久化
Testing覆盖率、边缘案例、Mocking、性能

记住:仅输出树状结构。不要添加任何解释。