From benkyo
Edit the structure of a benkyo concept/problem graph — add or remove nodes and edges, adjust granularity, fix duplicates. Use this skill when the learner says 「これも追加して」「これとあれは関連してる」「これは別物」「これも勉強したい(新概念)」「これとこれ同じ」「これは分けるべき」, or when you (the tutor) notice during a session that a concept the learner just mentioned isn't in the graph yet, or that a relationship between existing nodes is missing/wrong. Also trigger when reviewing or refining the graph structurally — e.g., during project init when assessing the initial set of nodes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/benkyo:benkyo-graph-editThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill governs all structural changes to the global benkyo graph: adding concept and problem nodes, adding/removing edges, deciding granularity, handling duplicates. The rules apply during project init AND mid-session (when graph gaps surface).
This skill governs all structural changes to the global benkyo graph: adding concept and problem nodes, adding/removing edges, deciding granularity, handling duplicates. The rules apply during project init AND mid-session (when graph gaps surface).
Even when discussing graph edits with the learner, never use internal terms (node, edge, prereq, related, graph, granularity, merge, fork, event, log, record, schema, JSON, metadata) in learner-facing utterances. Translate:
Internal operation: benkyo edge add --from c1 --to c2 --type related
Spoken to learner: 「ラプラス変換とフーリエ変換, 混同しやすいから 『セットで覚えておく』マークしとくね」
Internal IDs are also forbidden: never write c1, c2, p1, prj1 etc. in learner-facing text. Especially in graph-edit, the temptation to say "c7 を追加して c1 に related で繋いだ" is high — translate to "『フーリエ変換』を追加して『ラプラス変換』とセットで覚える関係にしといた" instead.
See ../_benkyo-shared/references/nl-to-cli.md. Re-read before composing any learner-facing message that touches structural details.
The global graph is shared across projects. Adding a duplicate of an existing concept fragments the graph and undermines the cross-project reuse benefit.
Before any benkyo concept add:
benkyo concept find --content "<exact or near-exact name>"
If matches exist, evaluate:
related edge if the relationship is realconcept merge <source> --into <canonical> (see "Merge protocol" below)Granularity is the most consequential editing decision. The full rules are in ../_benkyo-shared/references/granularity-guide.md. Summary:
A concept node should satisfy these 5 criteria:
Violations:
Lazy refinement principle: start with section-level granularity. Split only when an actual use case demands finer treatment. Don't pre-split "just in case".
Cross-project rule: the global graph supports the FINEST granularity that any project needs. Coarser-use projects aggregate by marking groups of fine nodes as blackbox.
X → Y (in CLI: --from X --to Y --type prereq) means X depends on Y, Y is directly used to understand or solve X.
Add a prereq when:
Don't add prereq when:
Direction: from is dependent, to is depended-upon. To say "Laplace transform depends on definite integral":
benkyo edge add --from c_laplace --to c_definite_integral --type prereq
X ↔ Y (--type related) is used in two senses (both stored as the same edge type for now):
Sub-type isn't stored formally yet (lazy schema refinement). The interpretation is inferred from the contents and context.
Add a related edge when:
Don't add related when:
prereq instead)DON'T draw transitive edges. If A → B and B → C, don't also add A → C (unless A also directly uses C).
Three questions to decide prereq vs related:
When adding a node, the content (concept) or statement+answer (problem) follows these rules. See full discussion in ../_benkyo-shared/references/granularity-guide.md.
Purpose: identify and distinguish, not full explanation.
Format:
NOT:
Example:
ラプラス変換: 時間関数 f(t) (t≥0) を複素変数 s の関数 F(s) に写す積分変換。
F(s) = ∫₀^∞ f(t)e^(-st)dt と定義され、線型微分方程式を代数方程式に変換する用途で使われる。
Fourier 変換と類似だが、減衰因子 e^(-σt) により発散関数も扱える点が異なる。
Purpose: a self-contained problem the learner can attempt.
Include:
Don't include:
Example:
L = 0.1 H, C = 100 μF, R = 10 Ω の直列 RLC 回路に, t = 0 から振幅 1 V の
単位ステップ電圧を印加した時の電流 i(t) を求めよ。初期条件は i(0) = 0, di/dt(0) = 0。
Format: key intermediate results + final answer. Not a full step-by-step (that's for teaching loop).
Example:
特性方程式: s² + 100s + 10⁵ = 0
ζ = 0.5 (under-damped)
ω₀ ≈ 316.2 rad/s, ω_d ≈ 273.9 rad/s
i(t) = (1/Lω_d) e^(-ζω₀t) sin(ω_d t) ≈ 0.0365 e^(-50t) sin(273.9 t) [A]
See benkyo-treatment-shift skill for the standards. Tables, formulas, recipes — not exposition.
# Step 1: identity check
benkyo concept find --content "<intended name>"
# Step 2 (if no match):
benkyo concept add --content "<name>: <1-3 sentence definition>"
# Step 3: add prereq edges if any
benkyo edge add --from <new_id> --to <prereq_id> --type prereq
# Step 4: if treatment in current project is non-default (blackbox), set it
benkyo treatment set --project <prj_id> --concept <new_id> \
--treatment blackbox --reference "<content>"
# Identity check via content match
benkyo problem list --query "<key phrase from problem>"
# If new:
benkyo problem add --statement "<full statement>" --answer "<key results + final>"
# Connect to concepts via prereq:
benkyo edge add --from <problem_id> --to <concept_id> --type prereq
# (For each concept directly used to solve this problem)
# If this is a project goal:
benkyo project update <prj_id> --goals <p1,p2,...,new_problem_id>
benkyo edge delete --from <id1> --to <id2> --type <prereq|related>
Trigger: concept find / concept list --query surfaces two concepts that are clearly the same content with different wording, or the learner says 「これとこれ同じ」.
Atomic command (CLI handles edge + project_concepts redirection in one transaction):
benkyo concept merge <source_id> --into <canonical_id> \
[--on-conflict error|keep_canonical|keep_source]
Behavior:
source_id are redirected to canonical_id (self-loops and duplicates auto-skipped).project_concepts (treatment) rows on source_id are merged onto canonical_id.--on-conflict decides:
error (default): refuse the merge, surface both rows for human reviewkeep_canonical: drop source's treatment, keep canonical'skeep_source: replace canonical's treatment with source'ssource_id no longer exists in the DB.Pick canonical: prefer the older / better-named one. If unsure, ask the learner ("『微分の変換則』と『微分公式 (ラプラス)』、どっちの名前で残す?" — surface the content, not the IDs).
For problem duplicates, the same shape: benkyo problem merge <source_id> --into <canonical_id> (problems don't have treatments, so no --on-conflict flag).
Trigger: the granularity-5 criteria (above) indicate split is warranted, or the learner says 「これは細かく分けたい」/「これは別物として扱いたい」.
Atomic command (CLI copies edges but not treatments — see below for why):
benkyo concept fork <source_id> --content <new content for the split-off>
# or --content-file <path>
Behavior:
source_id are copied to the new concept (both directions).project_concepts (treatments) are NOT copied. The new node starts with default whitebox in every project.Why treatments are not copied: a split is exactly the moment to re-decide treatment per project — that's usually the reason to split in the first place. Copying would mask the decision the learner is implicitly inviting.
After fork, manually:
edge delete --from <source> --to <X> for each.treatment set.content of the source if its new scope no longer matches the old text: concept update <source> --content <text>.(The asymmetric "fork copies edges but you trim afterwards" design is intentional — it matches the natural workflow of "split, then decide what belongs where".)
Even when discussing graph edits with the learner, don't use internal terms:
| Internal | Learner-facing |
|---|---|
| concept node | "概念" / "項目" |
| problem node | "問題" |
| prereq edge | "前提" / "土台" |
| related edge | "関連" / "セット" |
| graph | "学習の地図" / "全体像" |
| project | "今やってる学習" |
Example:
❌ "ラプラス変換と Fourier 変換の間に related edge を貼ろう"
✓ "ラプラス変換と Fourier 変換、混同しやすいから 『セットで覚えておく』マークしとくね"
The learner might say:
related edge after checkingconcept fork then trim edges (see "Fork protocol" above)concept find to confirm duplication; if confirmed, concept merge <source> --into <canonical> (see "Merge protocol" above)Always confirm intent before executing. Sometimes the learner's structural intuition is correct; sometimes it's based on a misunderstanding.
../_benkyo-shared/references/cli-cheatsheet.md../_benkyo-shared/references/granularity-guide.md../_benkyo-shared/references/decision-tables.md../_benkyo-shared/references/nl-to-cli.md../_benkyo-shared/references/literature-pointers.mdCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub youseiushida/benkyo --plugin benkyo