How to Create and Use TourGuide Files
- Quick Start
- Creating Your First Guide
- Guide Structure
- Best Practices
- Common Patterns
- Troubleshooting
5-Minute Setup:
- Copy
templates/minimal.jsonto your project root - Rename it to
tourguide.json - Update file paths to match your project
- Show it to your AI assistant
Example:
{
"guide_name": "My Project Guide",
"version": "0.0.1",
"description": "Navigate my awesome project",
"ai_instructions": {
"role": "You are exploring this project",
"task": "Read the specified files in order",
"rules": ["Follow the sequence exactly"]
},
"navigation": {
"start_here": "phase_1",
"phases": [
{
"id": "phase_1",
"name": "Overview",
"sequence": [
{
"step": 1,
"action": "read_file",
"path": "README.md"
}
]
}
]
}
}- Minimal: Single-phase guide (2-5 files)
- Standard: Multi-phase guide (5-15 files)
- Codebase: Comprehensive guide (15+ files, sub-guides)
When to use which:
- Small project / quick intro → Minimal
- Medium project / typical codebase → Standard
- Large/legacy project / deep exploration → Codebase
Before writing the guide, list:
- Essential files (must-read for understanding)
- Nice-to-have files (useful but not critical)
- Ignorable files (build artifacts, vendor code)
Example mapping:
Essential:
- README.md (overview)
- docs/ARCHITECTURE.md (design)
- src/main.py (entry point)
Nice-to-have:
- CHANGELOG.md (history)
- docs/API.md (reference)
Ignore:
- node_modules/
- __pycache__/
Group files into logical phases:
- Context (what is this project?)
- Structure (how is it organized?)
- Implementation (how does it work?)
- Configuration (how to set it up?)
Example phases:
"phases": [
{
"id": "phase_1",
"name": "Project Context",
"description": "Understand purpose and scope"
},
{
"id": "phase_2",
"name": "Core Implementation",
"description": "Learn how it works"
}
]After each phase, add verification questions:
{
"action": "checkpoint",
"verify": [
"What does this project do?",
"What are the main components?"
],
"next": "If understood, proceed to phase_2"
}Show your guide to an AI and observe:
- Does it follow the sequence?
- Does it skip steps or files?
- Does it complete checkpoints?
- Does it understand the project afterward?
Iterate based on results.
{
"guide_name": "string (required)",
"version": "semver (required)",
"description": "string (required)",
"ai_instructions": {
"role": "string (required)",
"task": "string (required)",
"rules": ["array (required)"]
},
"navigation": {
"start_here": "phase_id (required)",
"phases": ["array (required)"]
}
}{
"ignorance_zones": [
{
"path": "string",
"reason": "why to ignore"
}
],
"completion_criteria": {
"key": "what AI should understand"
}
}{
"id": "unique_phase_id",
"name": "Human-readable phase name",
"description": "What this phase covers",
"sequence": [
{
"step": 1,
"action": "read_file | follow_guide | checkpoint",
"path": "file/path (for read_file, follow_guide)",
"focus": ["what to pay attention to"],
"verify": ["questions (for checkpoint)"],
"next": "instructions for next step"
}
]
}❌ Don't:
{
"phases": [
{ "name": "Phase 1", "sequence": [ /* 20 steps */ ] },
{ "name": "Phase 2", "sequence": [ /* 15 steps */ ] },
{ "name": "Phase 3", "sequence": [ /* 25 steps */ ] }
]
}✅ Do:
{
"phases": [
{ "name": "Overview", "sequence": [ /* 3 steps */ ] },
{ "name": "Deep Dive", "sequence": [ /* 5 steps */ ] }
]
}Start with 2-3 phases, expand later.
❌ Don't:
{
"sequence": [
{ "step": 1, "action": "read_file", "path": "file1.py" },
{ "step": 2, "action": "read_file", "path": "file2.py" },
{ "step": 3, "action": "read_file", "path": "file3.py" }
]
}✅ Do:
{
"sequence": [
{ "step": 1, "action": "read_file", "path": "file1.py" },
{ "step": 2, "action": "checkpoint", "verify": ["Understood file1?"] },
{ "step": 3, "action": "read_file", "path": "file2.py" }
]
}Checkpoint every 3-5 files.
❌ Don't:
{
"action": "read_file",
"path": "src/main.py"
}✅ Do:
{
"action": "read_file",
"path": "src/main.py",
"focus": [
"Entry point function",
"Initialization sequence",
"Main execution loop"
]
}Tell the AI what to look for.
❌ Don't:
{
"sequence": [
{ "action": "read_file", "path": "README.md" },
// No mention of what to skip
]
}✅ Do:
{
"ignorance_zones": [
{ "path": "node_modules/", "reason": "External deps" },
{ "path": "__pycache__/", "reason": "Build artifacts" }
]
}Explicitly list what not to read.
❌ Don't:
{
"sequence": [
{ "step": 1, "action": "read_file", "path": "src/module1/file1.py" },
{ "step": 2, "action": "read_file", "path": "src/module1/file2.py" },
{ "step": 3, "action": "read_file", "path": "src/module1/file3.py" },
// 20 more files from module1...
]
}✅ Do:
{
"sequence": [
{
"step": 1,
"action": "follow_guide",
"path": "src/module1/tourguide.json",
"notes": "Deep dive into module1"
}
]
}Create sub-guides for complex modules.
Use case: New contributor onboarding
{
"phases": [
{
"id": "context",
"name": "Project Context",
"sequence": [
{ "action": "read_file", "path": "README.md" },
{ "action": "read_file", "path": "docs/ARCHITECTURE.md" }
]
},
{
"id": "implementation",
"name": "Code Exploration",
"sequence": [
{ "action": "read_file", "path": "src/main.py" },
{ "action": "follow_guide", "path": "src/tourguide.json" }
]
}
]
}Use case: Understanding architecture layers
{
"phases": [
{ "id": "api_layer", "name": "API Layer" },
{ "id": "service_layer", "name": "Service Layer" },
{ "id": "data_layer", "name": "Data Layer" }
]
}Use case: Understanding specific features
{
"phases": [
{ "id": "auth", "name": "Authentication System" },
{ "id": "payments", "name": "Payment Processing" },
{ "id": "notifications", "name": "Notification System" }
]
}Use case: Understanding design decisions
{
"sequence": [
{
"action": "read_file",
"path": "docs/PROBLEM.md",
"focus": ["What problem are we solving?"]
},
{
"action": "read_file",
"path": "docs/SOLUTION.md",
"focus": ["How did we solve it?"]
},
{
"action": "read_file",
"path": "src/implementation.py",
"focus": ["See the solution in code"]
}
]
}Symptom: AI jumps ahead or reads files out of order
Fix:
- Make rules more explicit:
"rules": [ "Read files in EXACT order specified", "Do NOT skip ahead", "Do NOT summarize until instructed" ]
- Add more checkpoints to enforce sequence
Symptom: AI says "too much information" or gives shallow answers
Fix:
- Break into smaller phases
- Use sub-guides for deep dives
- Add more ignorance zones
- Reduce files per phase (max 5-7)
Symptom: AI doesn't verify understanding before moving on
Fix:
- Make checkpoint questions more specific:
"verify": [ "What are the 3 main components?", "How does authentication work?", "What database is used?" ]
- Add "next" instruction explicitly:
"next": "Do NOT proceed until you can answer all questions"
Symptom: AI explores files in ignorance zones
Fix:
- Make ignorance zones more explicit
- Repeat rules in ai_instructions:
"rules": [ "Respect ignorance zones - do NOT read excluded files" ]
Create a guide hierarchy:
project/
├── tourguide.json (root guide)
├── src/
│ ├── tourguide.json (code guide)
│ ├── api/
│ │ └── tourguide.json (API guide)
│ └── services/
│ └── tourguide.json (services guide)
Root guide references sub-guides:
{
"sequence": [
{
"action": "follow_guide",
"path": "src/tourguide.json"
}
]
}Use "next" field for branching:
{
"action": "checkpoint",
"verify": ["Do you need to understand API details?"],
"next": "If YES, follow src/api/tourguide.json. If NO, proceed to phase_3"
}Define what "complete understanding" means:
{
"completion_criteria": {
"architecture": "AI can draw system diagram",
"workflows": "AI can explain main user flows",
"dependencies": "AI knows all external services",
"ready": "AI can implement features independently"
}
}See examples/ directory for real-world guides:
- python-app: Standard Python application
- docs-site: Documentation site navigation
Need more help? Check the JSON Schema Reference for technical details.