# S02: Forgejo Knowledgebase Bootstrap

**Goal:** Populate Forgejo knowledgebase with architecture, stack, pipeline, data model, deployment, and development docs
**Demo:** After this: Forgejo wiki at forgejo.xpltd.co with comprehensive Chrysopedia architecture documentation

## Tasks
- [x] **T01: Created xpltdco/chrysopedia repo on Forgejo and bootstrapped wiki with Home page** — 1. Source .forgejo-token.env for FORGEJO_TOKEN
2. POST /api/v1/orgs/xpltdco/repos to create chrysopedia repo (auto_init: true, description, default_branch: main)
3. POST /repos/xpltdco/chrysopedia/wiki/new to create Home.md (initializes wiki git repo)
4. Verify repo at https://git.xpltd.co/xpltdco/chrysopedia and wiki at /wiki/
  - Estimate: 5min
  - Files: .forgejo-token.env
  - Verify: curl -s -H "Authorization: token $FORGEJO_TOKEN" https://git.xpltd.co/api/v1/repos/xpltdco/chrysopedia | python3 -c "import sys,json; d=json.load(sys.stdin); print('repo:', d.get('name')); assert d.get('has_wiki')" && curl -s -H "Authorization: token $FORGEJO_TOKEN" https://git.xpltd.co/api/v1/repos/xpltdco/chrysopedia/wiki/pages | python3 -c "import sys,json; d=json.load(sys.stdin); print('pages:', len(d)); assert len(d) >= 1"
- [x] **T02: Populated Forgejo wiki with 9 architecture documentation pages covering all major system aspects** — 1. Source .forgejo-token.env
2. Git clone wiki repo: https://{token}@git.xpltd.co/xpltdco/chrysopedia.wiki.git
3. Generate wiki pages from content sources:
   - Home.md — project overview from PROJECT.md
   - Architecture.md — system arch, Docker services, network (from Site Audit Report)
   - Data-Model.md — 13+ SQLAlchemy models and relationships (from audit + models.py)
   - API-Surface.md — all 41 endpoints grouped by domain (from audit)
   - Frontend.md — routes, components, hooks, CSS architecture (from audit)
   - Pipeline.md — 6-stage LLM pipeline, prompt system, debug mode (from PROJECT.md + KNOWLEDGE.md)
   - Deployment.md — Docker Compose setup, bind mounts, rebuild commands (from audit + CLAUDE.md)
   - Development-Guide.md — local dev, common gotchas, testing patterns (from KNOWLEDGE.md + CLAUDE.md)
   - Decisions.md — architectural decisions D001-D035 (from DECISIONS.md)
   - _Sidebar.md — navigation links to all pages
4. Git add, commit, push
5. Verify all pages render at https://git.xpltd.co/xpltdco/chrysopedia/wiki/
  - Estimate: 30min
  - Files: .forgejo-token.env, .gsd/milestones/M018/slices/S01/SITE-AUDIT-REPORT.md, .gsd/PROJECT.md, .gsd/DECISIONS.md, .gsd/KNOWLEDGE.md, backend/models.py, docker-compose.yml, CLAUDE.md
  - Verify: source .forgejo-token.env && curl -s -H "Authorization: token $FORGEJO_TOKEN" https://git.xpltd.co/api/v1/repos/xpltdco/chrysopedia/wiki/pages | python3 -c "import sys,json; pages=json.load(sys.stdin); names=[p['title'] for p in pages]; print(f'{len(pages)} pages:', names); assert len(pages) >= 9"
