teach

GitHub

通过读取代码库示例文件,提取并保存可复用的结构、命名及逻辑模式。经用户确认后,将提炼的规范清单存入项目知识库,实现团队级最佳实践沉淀与共享。

.opencode/skills/teach/SKILL.md AltimateAI/altimate-code

Trigger Scenarios

用户提供代码文件要求总结规范 需要建立或更新项目编码标准

Install

npx skills add AltimateAI/altimate-code --skill teach -g -y
More Options

Non-standard path

npx skills add https://github.com/AltimateAI/altimate-code/tree/main/.opencode/skills/teach -g -y

Use without installing

npx skills use AltimateAI/altimate-code@teach

指定 Agent (Claude Code)

npx skills add AltimateAI/altimate-code --skill teach -a claude-code -g -y

安装 repo 全部 skill

npx skills add AltimateAI/altimate-code --all -g -y

预览 repo 内 skill

npx skills add AltimateAI/altimate-code --list

SKILL.md

Frontmatter
{
    "name": "teach",
    "description": "Teach your AI teammate a pattern by showing it an example file from your codebase"
}

Teach

Purpose

Learn a reusable pattern from an example file. The user shows you a well-written artifact (model, query, config), and you extract the patterns worth following.

Workflow

  1. Identify the file: The user provides a file reference (e.g., @models/staging/stg_orders.sql). Read the file.

  2. Analyze patterns: Extract the structural patterns, NOT the specific content. Focus on:

    • File structure and organization (sections, ordering)
    • Naming conventions (prefixes, suffixes, casing)
    • SQL patterns (CTE vs subquery, join style, column ordering)
    • dbt conventions (materialization, tests, config blocks)
    • Common boilerplate (headers, comments, imports)
    • Data type choices
    • Error handling patterns
  3. Present findings: Show the user what you learned in a structured list. Be specific:

    • Good: "Column order: keys first, then dimensions, then measures, then timestamps"
    • Bad: "Good column ordering"
  4. Ask for confirmation: Let the user confirm, modify, or reject your findings before saving.

  5. Save via training_save: Use the training_save tool with:

    • kind: "pattern"
    • name: A descriptive slug (e.g., "staging-model", "incremental-config")
    • content: The extracted patterns as a concise, actionable checklist
    • scope: "project" (default — shared with team via git)
    • source: The file path you learned from
    • citations: Reference to the source file

Important Guidelines

  • Extract PATTERNS, not content. "Use {{ source() }} macro" is a pattern. "Query the orders table" is content.
  • Keep it concise — max 10 bullet points per pattern. If more are needed, split into multiple patterns.
  • Use the file's actual conventions, don't impose your own preferences.
  • If the file doesn't have clear patterns worth learning, say so honestly.
  • Do NOT make any LLM calls beyond the normal conversation flow — pattern extraction happens in your analysis, not via separate API calls.

Usage Examples

/teach @models/staging/stg_orders.sql
/teach staging-model @models/staging/stg_customers.sql
/teach @dbt_project.yml

If the user provides a name (first argument before the @file), use that as the pattern name. Otherwise, infer a name from the file type and purpose.

Version History

  • 8c9a9a8 Current 2026-07-25 06:35

Same Skill Collection

.opencode/skills/altimate-setup/SKILL.md
.opencode/skills/cost-report/SKILL.md
.opencode/skills/data-parity/SKILL.md
.opencode/skills/dbt-analyze/SKILL.md
.opencode/skills/dbt-docs/SKILL.md
.opencode/skills/dbt-pr-review/SKILL.md
.opencode/skills/dbt-test/SKILL.md
.opencode/skills/dbt-troubleshoot/SKILL.md
.opencode/skills/dbt-unit-tests/SKILL.md
.opencode/skills/lineage-diff/SKILL.md
.opencode/skills/pii-audit/SKILL.md
.opencode/skills/query-optimize/SKILL.md
.opencode/skills/schema-migration/SKILL.md
.opencode/skills/sql-review/SKILL.md
.opencode/skills/sql-translate/SKILL.md
.opencode/skills/train/SKILL.md
.opencode/skills/training-status/SKILL.md
.opencode/skills/data-viz/SKILL.md
.opencode/skills/dbt-develop/SKILL.md
.opencode/skills/dbt-schema-verify/SKILL.md

Metadata

Files
0
Version
e27aeac
Hash
aedde6cb
Indexed
2026-07-25 06:35

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 09:32
浙ICP备14020137号-1 $Гость$