Term Generation & Update Tutorial Guide

This guide explains how to use AI prompts and the registered term-generator skill to efficiently create, update, or audit knowledge base term documents without wasting context tokens.


1. How It Works (Token Savings)

The knowledge base uses a Base + Override architecture:

  • Base: Rules defined in universal_generation_prompt.md and packaged into the term-generator skill (.gemini/skills/term-generator/SKILL.md).
  • Override: Technology-specific context found in _meta/technology_context.md (e.g. 15-rust/_meta/technology_context.md).

Because the term-generator skill is registered, you do not need to attach or paste universal_generation_prompt.md into chat turns. Simply reference term-generator or ask to update a term file, and the AI will activate the skill automatically.


Scenario A: Updating a Single Term File (Simplest)

Use this prompt when updating an existing term document to match the latest 7-section standard:

Update @knowledge-base/15-rust/terms/level_01/variable.md using the term-generator skill.

Scenario B: Updating Multiple Term Files (Batch Mode)

Use this prompt when upgrading multiple specific term files at once:

Update these term files using the term-generator skill:
- @knowledge-base/15-rust/terms/level_01/fn.md
- @knowledge-base/15-rust/terms/level_01/match.md
- @knowledge-base/15-rust/terms/level_01/enum.md

Scenario C: Auditing and Updating an Entire Level / Directory

Use this prompt when doing a pass over an entire level or module directory:

Audit and update all term files under @knowledge-base/15-rust/terms/level_01/ using the term-generator skill.

Scenario D: Creating a New Term Document from Scratch

Use this prompt when generating a new term file that does not exist yet:

Create a new term file for `Option<T>` at `knowledge-base/15-rust/terms/level_02/option_t.md` using the term-generator skill.

Scenario E: Auditing a Term File for Quality & Standards

Use this prompt when checking if a term file complies with the 7-section standard:

Audit @knowledge-base/15-rust/terms/level_01/array_and_slice.md against the term-generator skill checklist and fix any missing elements.

Scenario F: Only Updating Practice Exercises in an Entire Level / Directory

Use this prompt when targeting and upgrading strictly the practice exercises section (§5) across all term files in a level or directory to match the standard (**Scenario:**, **Requirements:**, > [!check]- Answer callouts containing > #### Implementation with unit tests and > #### Technical Explanation with 3–5 numbered points):

Audit and update ONLY the practice exercises section (§5) in all term files under @knowledge-base/15-rust/terms/level_01/ using the term-generator skill. Ensure each file has exactly 3 exercises with scenario descriptions, implementation code blocks, and 3–5 numbered technical explanation points without altering sections 1–4, 6, or 7.

3. Quick Reference: The 7-Section Document Standard

Every term document must strictly adhere to this layout:

SectionHeadingKey Requirements
Header# Term NameH1 name + Blockquote Level & description
§1## 1. PrerequisitesCross-linked prerequisite terms with 1-line reminders
§2## 2. Term CategoryBold Category (parenthetical qualifier): + 1–2 paragraphs
§3## 3. ExplanationDesign Motivation + Reality Metaphor + ### (3) {Tech} Code Examples
§4## 4. Common Mistakes & PitfallsExactly 3 mistakes (Title, Mistake, Why, Incorrect code, Fix code)
§5## 5. Practice ExercisesExactly 3 exercises (Scenario + Requirements + Implementation + Technical Explanation)
§6## 6. Related Terms3–5 cross-linked terms with relationship descriptions
§7## 7. Key Takeaways3–5 actionable bullet points (no trailing ---)

4. Post-Generation Verification Commands

After generating or updating any term file, run these commands to sync relationships and verify graph acyclicity:

# 1. Sync markdown relationship edges back to relationships.json
node knowledge-base/sync_relationships.js --from-files --module 15-rust

# 2. Validate DAG non-cyclicity and bidirectional links across all 14 modules
node knowledge-base/validate_relationships.js
Built with LogoFlowershow