lore-creation-starting-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Transform technical work (code changes, documentation, events) into narrative lore entries that serve as persistent agent memory. This skill teaches the lore system's data model and generation patterns.
The lore system stores knowledge as mythology - not dry documentation, but stories that compress meaning and context into memorable narrative form. Every commit can become a chronicle entry, every bug fix a tale of battle.
</objective>
<essential_principles>
1. Three Atomic Units
All lore is composed of three JSON structures:
- Entry - Atomic narrative unit (the story itself)
- Book - Collection of entries (chronicles, themed collections)
- Persona - AI character who narrates (voice, traits, perspective)
2. Narrative Compression
Technical content becomes mythology:
- Bug fix → "vanquished the daemon"
- New feature → "discovered ancient spell"
- Refactor → "restructured the realm's foundations"
This isn't just aesthetics - compressed narrative loads more meaning per token.
3. Persona Voice Matters
Every entry should be narrated through a persona's perspective. The Village Elder tells stories differently than Amy Ravenwolf. Voice consistency creates coherent agent memory.
4. Linkage Is Structure
Entry → Book → Persona. Always complete the chain. An unlinked entry is orphaned knowledge.
</essential_principles>
<quick_start>
Create a lore entry manually:
bash
./tools/manage-lore.sh create-entry "The Dawn of Verification" "event"<objective>
将技术工作(代码变更、文档、事件)转化为叙事性知识条目,作为Agent的持久化记忆。本技能将讲解知识系统的数据模型和生成模式。
知识系统以神话形式存储知识——并非枯燥的文档,而是能将含义和上下文压缩成易于记忆的叙事故事。每一次提交都可以成为一则编年史条目,每一次bug修复都可以成为一场战斗传说。
</objective>
<essential_principles>
1. 三种原子单元
所有知识条目由三种JSON结构组成:
- Entry - 原子叙事单元(故事本身)
- Book - 条目集合(编年史、主题合集)
- Persona - 负责叙事的AI角色(语气、特质、视角)
2. 叙事压缩
技术内容转化为神话:
- Bug修复 → "击败了邪灵"
- 新功能 → "发现了古老咒语"
- 重构 → "重塑了领域的基石"
这不仅仅是美观——压缩后的叙事能在每个token中承载更多含义。
3. 角色语气至关重要
每个条目都应通过某个Persona的视角来叙述。村庄长老的讲故事方式与Amy Ravenwolf截然不同。语气的一致性能构建连贯的Agent记忆。
4. 关联即结构
Entry → Book → Persona。始终要完成这条链。未关联的条目就是孤立的知识。
</essential_principles>
<quick_start>
手动创建知识条目:
bash
./tools/manage-lore.sh create-entry "The Dawn of Verification" "event"Output: entry_1767630133_8719120e
Output: entry_1767630133_8719120e
**Generate lore from content (with LLM):**
```bash
LLM_PROVIDER=claude ./integration/lore-flow.sh manual "Fixed critical authentication bug"
**从内容生成知识条目(使用LLM):**
```bash
LLM_PROVIDER=claude ./integration/lore-flow.sh manual "Fixed critical authentication bug"Creates entry + links to persona's chronicle book
创建条目并关联到角色的编年史书籍
**View entry content:**
```bash
./tools/manage-lore.sh show-entry entry_1767630133_8719120e</quick_start>
<data_model>
Entry ():
knowledge/expanded/lore/entries/entry_<timestamp>.jsonjson
{
"id": "entry_1767630133_8719120e",
"title": "The Dawn of Verification",
"content": "In the great halls of the development realm...",
"category": "event",
"tags": ["verification", "testing"],
"book_id": "book_1764315530_3d900cdd"
}Book ():
knowledge/expanded/lore/books/book_<timestamp>.jsonjson
{
"id": "book_1764315530_3d900cdd",
"title": "Village Elder's Chronicles",
"entries": ["entry_1767630133_8719120e"],
"readers": ["persona_1763820091"]
}Persona ():
knowledge/expanded/personas/persona_<timestamp>.jsonjson
{
"id": "persona_1763820091",
"name": "The Village Elder",
"voice": { "tone": "wise and measured" },
"knowledge": { "lore_books": ["book_1764315530_3d900cdd"] }
}Categories: , , , , ,
</data_model>
<workflow>
characterplaceeventobjectconceptcustomCreating Quality Lore:
-
Choose or create persona - Who narrates this story?bash
./tools/create-persona.sh list ./tools/create-persona.sh create "Storm Keeper" "Guardian of volatile systems" "vigilant,precise" "urgent" -
Generate narrative content - Transform technical into mythologicalbash
# Automatic (uses LLM) LLM_PROVIDER=claude ./integration/lore-flow.sh git-diff HEAD # Manual (create then edit) ./tools/manage-lore.sh create-entry "Title" "category" # Edit content in the JSON file -
Link to chronicle book - Organize into collectionsbash
./tools/manage-lore.sh add-to-book entry_ID book_ID -
Verify linkage - Complete the chainbash
./tools/manage-lore.sh show-book book_ID ./tools/manage-lore.sh show-entry entry_ID
<narrative_patterns>
Event Entry (something happened):
"The green lights cascaded down the terminal as the ancient verification rites completed. Phase 1 stood proven, its foundations solid enough to bear the weight of all that would be built upon them."
Character Entry (agent/persona profile):
"The Village Elder watches from his weathered chair, staff planted firmly as he guides the younger agents through the treacherous paths of integration."
Place Entry (codebase location):
"Greenhaven sprawls across the repository, its directory trees sheltering countless modules. Here the builders gather to forge their artifacts."
Concept Entry (pattern/principle):
"The Principle of Early Verification teaches that testing at the threshold prevents cascading failures. The ancients learned this through suffering." </narrative_patterns>
<anti_patterns>
Empty content - Entry exists but content field is blank
→ Always verify:
jq '.content' entry_file.jsonOrphaned entries - Entry has no book_id
→ Always link:
./tools/manage-lore.sh add-to-book entry_ID book_IDVoice inconsistency - Entry doesn't match persona's voice
→ Re-read persona before writing:
./tools/create-persona.sh show persona_IDTechnical language - "Fixed bug #123 in auth.py"
→ Transform: "The authentication daemon fell silent, its corrupted routines purged by careful hands."
</anti_patterns>
<reference_guides>
Skill Assets:
- Narrative Transforms - Technical → Mythological conversion patterns
- Quick Lore Script - One-command lore generation
API Documentation:
- Entry API - Full entry schema and operations
- Book API - Book structure and linking
- Persona API - Persona creation and voice
Schemas:
- Entry:
knowledge/core/lore/schema.json - Book:
knowledge/core/book-schema.json - Persona:
knowledge/core/persona/schema.json
Tools Reference:
- Generation Tools - LLM-powered lore generation </reference_guides>
<success_criteria>
A well-created lore entry:
- Has non-empty field with narrative text
content - Uses mythological language (not technical jargon)
- Is linked to a book via
book_id - Book is linked to a persona via array
readers - Follows persona's voice tone
- Category matches content type (event/character/place/object/concept)
- Tags enable future discovery </success_criteria>
**查看条目内容:**
```bash
./tools/manage-lore.sh show-entry entry_1767630133_8719120e</quick_start>
<data_model>
Entry(存储路径:):
knowledge/expanded/lore/entries/entry_<timestamp>.jsonjson
{
"id": "entry_1767630133_8719120e",
"title": "The Dawn of Verification",
"content": "In the great halls of the development realm...",
"category": "event",
"tags": ["verification", "testing"],
"book_id": "book_1764315530_3d900cdd"
}Book(存储路径:):
knowledge/expanded/lore/books/book_<timestamp>.jsonjson
{
"id": "book_1764315530_3d900cdd",
"title": "Village Elder's Chronicles",
"entries": ["entry_1767630133_8719120e"],
"readers": ["persona_1763820091"]
}Persona(存储路径:):
knowledge/expanded/personas/persona_<timestamp>.jsonjson
{
"id": "persona_1763820091",
"name": "The Village Elder",
"voice": { "tone": "wise and measured" },
"knowledge": { "lore_books": ["book_1764315530_3d900cdd"] }
}分类选项: , , , , ,
</data_model>
<workflow>
characterplaceeventobjectconceptcustom创建高质量知识条目:
-
选择或创建Persona - 谁来讲述这个故事?bash
./tools/create-persona.sh list ./tools/create-persona.sh create "Storm Keeper" "Guardian of volatile systems" "vigilant,precise" "urgent" -
生成叙事内容 - 将技术内容转化为神话故事bash
# 自动生成(使用LLM) LLM_PROVIDER=claude ./integration/lore-flow.sh git-diff HEAD # 手动创建(先创建再编辑) ./tools/manage-lore.sh create-entry "Title" "category" # 在JSON文件中编辑内容 -
关联到编年史书籍 - 整理到合集中bash
./tools/manage-lore.sh add-to-book entry_ID book_ID -
验证关联关系 - 完成整条链bash
./tools/manage-lore.sh show-book book_ID ./tools/manage-lore.sh show-entry entry_ID
<narrative_patterns>
事件条目(记录已发生的事):
"终端上的绿灯倾泻而下,古老的验证仪式宣告完成。第一阶段已被验证通过,其基石足够坚固,足以承载未来将在其上构建的所有内容。"
角色条目(Agent/Persona档案):
"村庄长老坐在他那把饱经风霜的椅子上,拐杖稳稳地立在身旁,指引年轻的Agent们穿越充满挑战的集成之路。"
地点条目(代码库位置):
"Greenhaven在代码库中铺展开来,它的目录树庇护着无数模块。这里是开发者们聚集打造作品的地方。"
概念条目(模式/原则):
"早期验证原则教导我们,在入口处进行测试可以防止连锁故障。古人从惨痛的教训中学到了这一点。" </narrative_patterns>
<anti_patterns>
内容为空 - 条目存在但content字段为空
→ 务必验证:
jq '.content' entry_file.json孤立条目 - 条目没有book_id
→ 务必关联:
./tools/manage-lore.sh add-to-book entry_ID book_ID语气不一致 - 条目与Persona的语气不符
→ 写作前重新查看Persona:
./tools/create-persona.sh show persona_ID使用技术语言 - "修复了auth.py中的#123号bug"
→ 转化为:"认证邪灵终于沉寂,其被破坏的程序已被精心修复。"
</anti_patterns>
<reference_guides>
技能资源:
- 叙事转化规则 - 技术内容转神话内容的转化模式
- 快速知识脚本 - 一键生成知识条目
API文档:
- Entry API - 完整的条目schema和操作说明
- Book API - 书籍结构与关联方法
- Persona API - Persona创建与语气设置
Schema文件:
- Entry:
knowledge/core/lore/schema.json - Book:
knowledge/core/book-schema.json - Persona:
knowledge/core/persona/schema.json
工具参考:
- 生成工具 - 基于LLM的知识条目生成工具 </reference_guides>
<success_criteria>
一个优质的知识条目需满足:
- 拥有非空的字段,且内容为叙事性文本
content - 使用神话式语言(而非技术术语)
- 通过关联到某本书籍
book_id - 书籍通过数组关联到某个Persona
readers - 符合Persona的语气体质
- 分类与内容类型匹配(事件/角色/地点/物品/概念)
- 标签支持未来的检索需求 </success_criteria>