Over 180 lessons accumulated in the MisakaNet knowledge base with significant quality and consistency issues:
Over 180 lessons accumulated in the MisakaNet knowledge base with significant quality and consistency issues:
cc-connect-, ccswitch-, codewhale-, deepseek-tui-, hermes-, node_, st2-*)<REDACTED> specific usernames (<user>, <agent>), internal project names (mify, InternalGateway`) embedded in lesson body textproject:, node:, severity:*) in frontmatter that are meaningless to external contributorsThe lesson system grew organically with no upfront naming convention, content policy, or CI enforcement. Contributors wrote lessons from their own context without generalizing for external readers. Review relied entirely on manual checks.
Two-pass generalization script (scripts/generalize_lessons.py):
| Pass | Operation | Files affected |
|---|---|---|
| 1 | Remove project-specific prefixes + content sanitization | 12 renamed + content generalized |
| 2 | Chinese→English filenames (git mv preserves history) | 37 renamed, 13 deleted |
Files with Chinese names: 50 → 0 Files with project-specific tags: ~15 → 0
Three-layer enforcement:
Layer 1 — Pre-commit hook (.pre-commit-config.yaml):
- id: check-lesson-quality
name: check lesson quality
entry: python3 scripts/check_lesson_quality.py
files: ^lessons/.*\.md$Checks before allowing commit:
Layer 2 — CI gate (.github/workflows/lesson-quality.yml):
lessons/**check_lesson_quality.py on all lesson filesquality:needs-review label + detailed commentLayer 3 — One-click submission (scripts/submit_lesson.py):
Expected Output:
Python check passed
On branch main
OKgeneralize_lessons.py, rename_cn_files.py, update_index.py were deleted to keep repo clean)submit_lesson.py and check_lesson_quality.py are kept as permanent workflow toolsGnuTLS recv error with git push; workaround is push_via_api.py which uses GitHub API directly--dry-run flag allows testing without making changesSENSITIVE_PATTERNS list in submit_lesson.py as new internal project names emergelessons/TEMPLATE.md: Standard lesson templatescripts/submit_lesson.py: One-click submissionscripts/check_lesson_quality.py: Quality check script.github/workflows/lesson-quality.yml: CI gate