Version: 1.0.0
Author: IT-Journey Team
Created: 2025-10-08
The Quest Validator is a comprehensive testing framework designed to validate IT-Journey quest files against established standards. It ensures quest quality, consistency, and adherence to the gamified learning experience guidelines.
Each quest receives a quality score based on:
The quest validator is now containerized and runs within Docker. No local Python installation is required.
# Navigate to the project root
cd /path/to/it-journey
# Build the Docker image with quest validation support
docker-compose build quest-validator
# Verify the setup
docker-compose run --rm quest-validator python3 --version
docker-compose run --rm quest-validator \
/opt/venv/bin/python /app/test/quest-validator/quest_validator.py \
/app/pages/_quests/your-quest.md
docker-compose run --rm quest-validator \
/opt/venv/bin/python /app/test/quest-validator/quest_validator.py \
-d /app/pages/_quests/
docker-compose run --rm quest-validator \
/opt/venv/bin/python /app/test/quest-validator/quest_validator.py \
-d /app/pages/_quests/ -v
docker-compose run --rm quest-validator \
/opt/venv/bin/python /app/test/quest-validator/quest_validator.py \
-d /app/pages/_quests/ \
--report /app/test/quest-validator/quest_report.json
docker-compose run --rm quest-validator \
/opt/venv/bin/python /app/test/quest-validator/quest_validator.py \
-d /app/pages/_quests/ \
--pattern "*recursive*.md"
# Navigate to the project root
cd /path/to/it-journey
# Run the comprehensive test suite
./test/quest-validator/test-validator.sh
============================================================
Validating: recursive-realms-testing.md
============================================================
ℹ️ Validating required frontmatter fields...
ℹ️ Validating quest hierarchy fields...
ℹ️ Level 0010 (decimal: 2) valid
ℹ️ Difficulty 🟡 Medium valid
✅ Found: Quest Objectives section
✅ All 5 code blocks have language specification
✅ Found 15 interactive checkboxes for learner engagement
✅ Strong fantasy theme integration (score: 5/6)
============================================================
Quest: recursive-realms-testing.md
============================================================
✅ PASSED - Excellent quest quality!
📊 Quality Score: 95/100 (95.0%)
⚠️ Warnings (2):
• Missing enhanced field: quest_dependencies
• No citations/references section found
============================================================
VALIDATION SUMMARY
============================================================
Total Quests: 1
Passed: 1 ✅
Failed: 0 ❌
Total Errors: 0
Total Warnings: 2
Average Score: 95.0%
============================================================
These fields MUST be present:
title
- Quest title (preferably under 60 chars for SEO)description
- Complete description (150-300 chars)date
- Publication date (ISO 8601 format)level
- Binary level indicator (4 digits, e.g., “0010”)difficulty
- One of: 🟢 Easy, 🟡 Medium, 🔴 Hard, ⚔️ Epicestimated_time
- Format: “XX-XX minutes” or “X-X hours”primary_technology
- Main technology focusquest_type
- Type: tool-mastery, language-learning, etc.skill_focus
- Primary skill categorylearning_style
- Teaching approach: hands-on, conceptual, etc.quest_series
- Series or standaloneauthor
- Quest creatorlayout
- Jekyll layout (usually “journals”)keywords
- Primary and secondary keywordspermalink
- URL path (must start with /quests/)fmContentType
- Should be “quest”Recommended for better organization:
quest_line
- Campaign/storyline namequest_arc
- Story arc or thematic groupingprerequisites
- Knowledge, system, and skill requirementsquest_dependencies
- Required, recommended, and unlocked questsquest_relationships
- Parent, child, parallel, and sequel questslearning_paths
- Primary paths and character classesrewards
- Badges, skills, progression pointsvalidation_criteria
- Completion requirementsRecommended sections:
0000
(0) - Tutorial/Introduction0001
(1) - Beginner0010
(2) - Novice/Apprentice0101
(5) - Intermediate1000
(8) - Advanced1111
(15) - Master/Expert/quests/
/quests/level-0010-descriptive-name/
Create .github/workflows/validate-quests.yml
:
name: Validate Quests
on:
push:
paths:
- 'pages/_quests/**/*.md'
pull_request:
paths:
- 'pages/_quests/**/*.md'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
cd test/quest-validator
pip install -r requirements.txt
- name: Validate quests
run: |
python test/quest-validator/quest_validator.py \
-d pages/_quests/ \
--report quest-validation-report.json
- name: Upload report
if: always()
uses: actions/upload-artifact@v3
with:
name: quest-validation-report
path: quest-validation-report.json
Create .git/hooks/pre-commit
:
#!/bin/bash
# Validate quests before committing
echo "🔍 Validating quest files..."
# Find changed quest files
QUEST_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep 'pages/_quests/.*\.md$')
if [ -n "$QUEST_FILES" ]; then
for file in $QUEST_FILES; do
python test/quest-validator/quest_validator.py "$file"
if [ $? -ne 0 ]; then
echo "❌ Quest validation failed for: $file"
echo " Fix errors before committing"
exit 1
fi
done
echo "✅ All quests validated successfully"
fi
exit 0
QuestValidator
class:def validate_custom_rule(self, fm: Dict, body: str, result: ValidationResult):
"""Validate custom requirement"""
self.log_info("Validating custom rule...")
# Your validation logic
if some_condition:
result.score += points
result.info.append("Custom validation passed")
else:
result.warnings.append("Custom validation warning")
result.max_score += points
validate_quest_file
method:self.validate_custom_rule(frontmatter, body, result)
# Test with the sample quest
python quest_validator.py pages/_quests/testing-quests-with-recurrisive-questing.md -v
# Test with all quests
python quest_validator.py -d pages/_quests/ -v
# Generate test report
python quest_validator.py -d pages/_quests/ --report test-report.json
Issue: “YAML parsing error: …”
Solution: Check frontmatter syntax:
Issue: “Import ‘yaml’ could not be resolved”
Solution: Install requirements:
pip install -r requirements.txt
Issue: “❌ File not found: …”
Solution: Use correct path:
# Absolute path
python quest_validator.py /full/path/to/quest.md
# Relative path from project root
python quest_validator.py pages/_quests/quest-name.md
Contributions are welcome! To contribute:
This project is part of the IT-Journey open-source initiative. See the main repository LICENSE file for details.
For questions or issues:
“Testing quests recursively to ensure quality through self-validating patterns.” 🧙♂️✨