代码原理讲解
teach
通过探究代码、变更与子系统的工作原理及其设计原因来进行讲解,并按用户的节奏施教。适用于明确的教学请求(teach me this、help me understand this implementation、この実装を教えて、仕組みと設計背景を知りたい),以及评审或修改前的理解需求。不要对每个事实性问题或以实现为主的请求都触发。
- License 许可
- MIT
- 所属仓库
- toku345/dotfiles
- 最近更新
- 2026-11-14
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- teach
- description
- Explain code, changes, and subsystems by investigating how they work and why they were designed that way, then teach at the user's pace. Use for explicit teach requests, teach me this, help me understand this implementation, この実装を教えて, 仕組みと設計背景を知りたい, and understanding before review or modification. Do not trigger for every factual question or primarily implementation requests.
02 资源文件 5
- 参考文档agents/openai.yaml298 B
- 许可证LICENSE1.0 KB
- 参考文档references/how.md1.2 KB
- 参考文档references/source.md3.0 KB
- 参考文档references/why.md2.3 KB
03 SKILL.md 正文
<!-- Adapted from pstack teach/how/why by Lauren Tan (@poteto). Copyright (c) 2026 Lauren Tan. MIT License; see LICENSE. Sources, pinned upstream revision, and adaptation notes: references/source.md. -->
Teach
Explain what the thing is, how it works, and why it has this shape. Help the person understand; do not modify their code while teaching.
This is a self-contained adaptation of pstack's teach/how/why workflow, not an official pstack installation. Read source and attribution for provenance. The investigation tracks are bundled references; no separately installed how, why, or unslop skill is required.
Investigate
- Infer the target, existing knowledge, and purpose from the conversation: onboarding, debugging, review, or preparation for a change. Skip concepts the person knows. State a reasonable interpretation and proceed when ambiguity is minor; ask only when the missing target blocks useful work. Use the user's language, Japanese for Japanese requests.
- Orient yourself in the code, diff, or supplied material. Execute the how track for behavior and the why track for rationale. Use both for a subsystem. A narrow behavior-only question may need only how. Scope why to history plus one or two promising sources initially, widening when rationale is central or sources conflict.
- Use the tools actually available. Run independent searches concurrently when practical. If permitted and useful, delegate bounded read-only investigations, then verify and synthesize their evidence. Otherwise perform the tracks directly. Require no specific platform or model. Never imply access to unavailable repositories, documents, or telemetry.
- Combine the results into one account. Preserve observed facts, documented intent, supported inference, competing explanations, and unknowns. Do not remove uncertainty to make the prose smoother. Check material claims against original evidence.
Teach
- Start with a plain definition and connect it to the concrete case. Give the smallest complete answer in one or two sentences, then let the person respond. For a one-shot task or an explicit request for detail, provide the requested depth without artificial pauses.
- Explain the problem being solved and walk through one concrete operation. Follow runtime events when helpful. Avoid a tour of function names and constants.
- Deepen through the user's follow-up questions. Keep it conversational. Do not quiz, ask the user to repeat the answer, or announce theatrical pauses. Do not assume an explanation proves understanding.
- Use concise diagrams, diffs, or examples when they clarify the mechanism. Introduce complex flows a small part at a time across the conversation. Do not force diagrams for simple points or repeat nearly identical diagrams in a short response.
- Use edge cases or counterexamples when they test the explanation. Separate historical motivation from your assessment of whether the current design is appropriate. Do not assume every detail was intentional or optimal.
- Cite original code, PRs, or documents near material claims. Mention unavailable sources when they materially limit the conclusion. Keep research notes internal unless requested.
- Write natural, direct prose. Avoid stock framing labels, excessive headings, and walls of text. Return the explanation itself, not an activity report. Follow the person's lead about deepening or moving on.
Working with co-dev
- Use teach alone for explanation without code changes, quizzes, or implementation approval requests. Invoking teach does not activate co-dev; do not require co-dev to answer a question.
- When co-dev is explicitly active, use teach for investigation and explanation; co-dev owns the development checkpoints. Its single pre-implementation mini-quiz is the only exception to teach's no-quiz rule. Keep it at the transition into implementation, not inside the explanation or after every follow-up.
- Treat questions as requests for explanation, quiz answers as evidence to discuss, and approval as a separate decision. Neither a correct answer nor an explanation authorizes implementation. Follow co-dev's start/resume and handoff agreement rules; returning to teach within an agreed scope does not reset those checkpoints.
04 同仓库更多 Skills
PR 全面代码审查
pr-review
全面的 PR 前审查编排器。针对当前分支已提交的差异运行命名的专项子智能体,按需检查简化情况,并使用专门的发现项验证器逐一核验规范化后的 Critical/Important 候选发现项,随后结合内置的 `references/review-criteria.md` 门禁策略,综合生成 Critical / Important / Suggestions / Strengths。在创建拉取请求前作为重量级质量门禁使用。是旧版 bash `triple-review` 编排器的预期继任者。
PR 审查教练
pr-review-coach
仅支持日语的 PR 理解教练。当用户想要准备自己的审查、理解分支差异、梳理要提出的问题,或在执行合并门禁前建立审查判断力时使用。首轮需显式提供 --base <ref-or-commit>,后续回答轮次从本地状态恢复。每次最多提出一个问题,并将可恢复的本地状态存储在目标工作树之外。仅限单智能体;不派生专项审查员,不产生 Critical/Important/Suggestions 门禁发现项,也不决定是否可以合并。
日语文章校对
writing-proofreader
日语博客与技术文章的校对技能。基于 Fumitaka 的文体指南,检查表达、结构与语气,并提出改进建议。适用于「校对一下」「审查一下」「检查文章」「看看我写的文章」「能帮我看看博客吗」「有没有哪里不对」「发布前确认一下」「这篇文章你觉得怎么样?」等与文章或博客质量检查相关的各类请求。当用户要求对 Markdown 或纯文本文章进行校对时,务必参考此技能。文章中的「推敲」「修改」「批改」等表述同样会触发本技能。
PR 前评审质量闸门
pr-review
Claude 侧的 PR 前评审闸门。解析分支的 base ref(gh PR view 或显式 --base),固定一份权威的 diff 包,然后启动 pr-review 动态工作流(~/.claude/workflows/pr-review.js),该工作流最多分派 8 位评审专家(code-reviewer、security-reviewer、adversarial-reviewer、pr-test-analyzer、comment-analyzer、silent-failure-hunter、type-design-analyzer、code-simplifier),覆盖不足则失败关闭,并核验 Critical/Important 级别的发现。在创建拉取请求前用作大型变更的质量闸门——尤其适用于 Codex CLI 的 `$pr-review` 技能不可用的情况。触发词:「pre-PR review」「PR 前レビュー」「レビュー gate を回して」「run the pr-review gate」。
Codex CLI 计划评审指南
codex-usage
介绍使用 Codex CLI 进行实现计划评审的条件与步骤,以及 `/codex:adversarial-review` / `/codex:rescue` 的区分使用。在大型变更的计划完成时,或考虑调查委派、尝试其他方案、后台执行时参考。
苏格拉底式设计头脑风暴
brainstorming
通过苏格拉底式对话敲定需求与设计,再确定实现方针的头脑风暴技能。在「头脑风暴」「想考虑设计」「该怎么实现」「想咨询架构」「设计咨询」「实现前先梳理」「想确定方针」等请求时触发。在实现前通过苏格拉底式对话细化设计;提出 2~3 个方案,并将关键决策记录为 ADR。