Research file storage conventions and templates for dokhak agents. Use when: (1) saving research results from research-collector or researcher agents, (2) reading cached research files, (3) checking if research exists for a section. Provides directory structure, file format templates, and naming conventions.
Research file storage conventions and templates for dokhak agents. Use when: (1) saving research results from research-collector or researcher agents, (2) reading cached research files, (3) checking if research exists for a section. Provides directory structure, file format templates, and naming conventions.
allowed-tools
Read, Write, Glob
Research Storage Skill
This skill defines conventions for storing and retrieving research data collected by dokhak agents. Research files are cached to enable reuse and reduce redundant web searches.
<directory_resolution><input><chapter>{original_chapter}</chapter><section>{original_section}</section><title>{original_title}</title></input><canonical><chapter>{normalized_chapter}</chapter><section>{normalized_section}</section><slug>{normalized_slug}</slug><path>{canonical_path}</path></canonical><resolution><resolved_path>{matched_path OR canonical_path}</resolved_path><existing>{true|false}</existing><match_tier>{1|2|3|4|new}</match_tier></resolution></directory_resolution>
Resolution Logic Summary
function resolveResearchDirectory(chapter, section, title):
# Normalize inputs
c = normalizeChapter(chapter)
s = normalizeSection(section)
slug = generateSlug(title)
canonical = ".research/sections/{c}-{s}-{slug}/"
# Tier 1: Exact canonical
result = Glob("{canonical}research.md")
if result: return { path: canonical, existing: true, tier: 1 }
# Tier 2: Canonical chapter-section, any slug
result = Glob(".research/sections/{c}-{s}-*/research.md")
if result: return { path: parent(result[0]), existing: true, tier: 2 }
# Tier 3: Non-padded chapter
raw_c = String(parseInt(chapter, 10))
result = Glob(".research/sections/{raw_c}-{s}-*/research.md")
if result: return { path: parent(result[0]), existing: true, tier: 3 }
# Tier 4: Flexible pattern
keyword = slug.split('-')[0]
result = Glob(".research/sections/*-{s}-*{keyword}*/research.md")
if result: return { path: parent(result[0]), existing: true, tier: 4 }
# No match - use canonical for new directory
return { path: canonical, existing: false, tier: "new" }
Usage Patterns
Checking Existing Research (UPDATED)
IMPORTANT: Do NOT use simple Glob. Use the multi-tier resolution strategy above.
# OLD (may miss existing research due to naming inconsistency)
Glob(".research/sections/{chapter}-{section}-{slug}/research.md")
# NEW (handles all variations)
resolution = resolveResearchDirectory(chapter, section, title)
existing_research = resolution.existing
research_dir = resolution.resolved_path
Returns resolved directory path and existence status.
Reading Research Files
When consuming research, read files directly in agent context:
<directory_resolution><input><chapter>{original_chapter}</chapter><section>{original_section}</section><title>{original_title}</title></input><canonical><chapter>{normalized_chapter}</chapter><section>{normalized_section}</section><slug>{normalized_slug}</slug><path>{canonical_path}</path></canonical><resolutionstatus="FOUND|NEW"><resolved_path>{matched_path OR canonical_path}</resolved_path><existing>{true|false}</existing><match_tier>{1|2|3|4|new}</match_tier></resolution></directory_resolution>
Subtopic Coverage Schema
Used within research files to track coverage:
<subtopic_coverage><subtopicname="{name}"status="Complete|Partial|Missing"><source>{url or "pending"}</source></subtopic></subtopic_coverage>
Status Values Reference
Status
Context
Meaning
OK
research_result
All subtopics covered, sufficient sources
PARTIAL
research_result
Some subtopics missing or incomplete
ERROR
research_result
Critical failure (e.g., no sources found)
FOUND
directory_resolution
Existing research directory located
NEW
directory_resolution
No existing research, use canonical path
Error Handling
Scenario
Action
.research/ directory missing
Auto-create on first write
Research file not found
Conduct fresh research
Read failure
Log warning, conduct fresh research
Write failure
Report error, do not update task.md
.gitignore Recommendation
Research files are regenerable and should typically be ignored: