Skip to content

Instantly share code, notes, and snippets.

@levino
Last active January 23, 2026 12:14
Show Gist options
  • Select an option

  • Save levino/4a61cae151a72dda48c4610e5f19d3fb to your computer and use it in GitHub Desktop.

Select an option

Save levino/4a61cae151a72dda48c4610e5f19d3fb to your computer and use it in GitHub Desktop.

GitHub as a Backend for Collaborative Work

Architecture & Implementation Specification (Discussion + AI Contract)


1. Motivation & Background

Many organizations – NGOs, associations, initiatives, editorial teams, political organizations, as well as companies – produce large amounts of structured digital content: internal documentation, policies, protocols, resolutions, position papers, as well as external artifacts such as letters, invitations, or documents following a strict corporate design (for example via Typst or Markdown templates).

From a technical perspective, Git, Markdown, CI/CD, and AI are well suited to manage this content in a versioned, auditable, and highly automated way. In practice, however, these workflows often fail due to accessibility: GitHub is powerful, but for many contributors it is too complex, English-only, and cognitively overwhelming.

The result is a familiar split: a small technical core works “in the system”, while most of the organization is excluded and falls back to email, Word documents, and manual coordination.

This document describes an architecture intended to close that gap without weakening technical workflows.


2. Goal of This Concept

  • Use GitHub as the single source of truth
  • Avoid parallel systems or shadow state
  • Enable participation by non-technical stakeholders
  • Preserve existing technical workflows
  • Integrate AI-supported document creation and maintenance

3. Core Design Principles

  • GitHub is the single source of truth
  • No independent persistent business state
  • The frontend is a pure UX abstraction
  • Read ≠ write (strict token separation)
  • Webhooks instead of polling
  • Pull requests are implementation details, not UX objects

4. Roles & Audiences

4.1 Stakeholders (non-technical)

  • domain experts, decision makers, contributors
  • little or no English proficiency
  • want to read, comment, and initiate work
  • need guidance rather than feature density

4.2 Technical Staff

  • work directly in GitHub
  • use issues, pull requests, actions, and AI workflows
  • accept Git as the working model and source of truth

5. User Stories (Selection)

Stakeholders

US-S1: Read and comment on discussions
As a stakeholder, I want to read a discussion and post a comment without having to understand GitHub.

US-S2: Formulate a task
As a stakeholder, I want to formulate a task (e.g. “Please draft an invitation letter”) and know that it enters the system in a structured way.

US-S3: See results
As a stakeholder, I want to see outcomes (preview links, documents, status updates) without dealing with pull requests or commits.

Technical Staff

US-T1: Preserve technical freedom
As technical staff, I want to continue working directly with issues, pull requests, and commits.

US-T2: Clean separation of concerns
As a maintainer, I want domain discussion to stay in issues and technical detail in pull requests.


6. Architecture Overview

Astro Frontend (localized, simplified)
        ↓
Aggregation / UX Layer
        ↓
GitHub API
  - Issues
  - Discussions
  - Comments
  - Pull Requests
  - Actions / Bots

7. Authentication & Tokens

Reading

  • GitHub App (installation token)
  • high rate limits
  • no user context

Writing

  • GitHub OAuth App (user token)
  • used only for comments and issue creation
  • tokens stored server-side only

8. Synchronization & Webhooks

  • no polling
  • delta sync via webhooks
  • relevant events:
    • issues.*
    • issue_comment.*
    • discussion.*
    • pull_request.*

9. AI Integration (Conceptual)

  • no standalone or persistent AI agents
  • AI reacts only to GitHub events
  • triggers via comments (e.g. @claude)
  • AI produces commits, pull requests, and comments back to GitHub

10. Pull Requests (UX Abstraction)

  • pull requests are invisible in the frontend
  • results are mirrored via bot comments in issues
  • selective preview links, including monorepo setups

11. Rate Limit Strategy

  • read operations via app tokens
  • write operations minimized via user tokens
  • GraphQL + batching
  • aggressive caching
  • webhooks instead of polling

12. Automated Testing

Unit Tests

  • mapping logic (issue → task)
  • comment parsing
  • diff analysis

Contract Tests

  • mocked GitHub API
  • pagination and error handling

End-to-End Tests

  • dedicated GitHub test organization
  • test repository
  • test OAuth app
  • test GitHub app

13. Explicit Non-Goals

  • not a classic forum
  • not a CMS
  • not a Jira replacement
  • no custom IAM
  • no separate user database

14. AI Implementation Contract (collapsible)

⚠️ Complete AI implementation contract (copy verbatim)
You are an implementation AI.

Your task is to build a GitHub-backed collaboration platform.

HARD CONSTRAINTS:
- GitHub is the only source of truth.
- No independent business state.
- No user database.
- No passwords.
- No polling.
- No reimplementation of the GitHub UI.

ARCHITECTURE:
- Frontend: Astro, server-side rendered, minimal client JS.
- Backend: aggregation layer with caching only (no state).
- GitHub App:
  - used for all read access
  - used for receiving webhooks
- GitHub OAuth App:
  - used only for writing comments and creating issues in the name of users

STATE MODEL:
- All visible state is derived from GitHub.
- Caches may exist but must be invalidated via webhooks.
- No mutation outside GitHub APIs.

UX RULES:
- UI language: English (localizable).
- Role-based views:
  - Stakeholders: discussions, tasks (issues), comments, results.
  - Technical staff: work directly in GitHub.
- Never expose:
  - Pull requests
  - Commits
  - Branches
  - Labels
  - Milestones

AI INTEGRATION:
- No standalone or long-lived agents.
- AI reacts only to GitHub events (e.g. issue comments).
- AI outputs:
  - commits
  - pull requests
  - comments
- All AI output must be written back to GitHub.

TESTING REQUIREMENTS:
- Unit tests:
  - mapping logic
  - comment parsing
  - diff analysis
- Contract tests:
  - mocked GitHub API
  - pagination
  - error handling
- End-to-end tests:
  - real GitHub test organization
  - real repositories
  - real GitHub App installation
  - real OAuth flow

RATE LIMIT STRATEGY:
- Prefer GitHub App tokens for reads.
- Use OAuth user tokens only for writes.
- Batch requests via GraphQL.
- Cache aggressively.
- Rely on webhooks instead of polling.

GOAL:
Enable non-technical stakeholders to participate in GitHub-backed collaboration
without weakening or abstracting away technical workflows.

GitHub als Backend für kollaborative Arbeit

Architektur- & Implementierungsspezifikation (Diskussion + AI-Contract)


1. Motivation & Ausgangslage

Viele Organisationen – Verbände, NGOs, Initiativen, Redaktionen, politische Organisationen, aber auch Unternehmen – produzieren große Mengen strukturierter digitaler Inhalte: interne Dokumentationen, Richtlinien, Protokolle, Beschlüsse, Positionspapiere sowie externe Artefakte wie Briefe, Einladungen oder Vorlagen im festen Corporate Design (z. B. über Typst- oder Markdown-Templates).

Technisch sind Git, Markdown, CI/CD und AI heute hervorragend geeignet, diese Inhalte versioniert, nachvollziehbar und automatisiert zu pflegen. In der Realität scheitert dieser Ansatz jedoch häufig an der Zugänglichkeit der Werkzeuge: GitHub ist mächtig, aber für viele Mitarbeitende zu komplex, englischsprachig und mental überfordernd.

Das Resultat ist eine Spaltung: Ein kleiner technischer Kern arbeitet direkt im System, während der Großteil der Organisation außen vor bleibt und auf E-Mail, Word-Dokumente und manuelle Abstimmungen zurückfällt.

Dieses Dokument beschreibt eine Architektur, die diese Lücke schließt, ohne technische Workflows zu verwässern.


2. Ziel dieses Konzepts

  • GitHub als einzige Quelle der Wahrheit
  • Keine parallelen Systeme oder Schatten-States
  • Beteiligung nicht-technischer Stakeholder ermöglichen
  • Technische Arbeitsweise vollständig beibehalten
  • AI-gestützte Dokumentenerstellung und -pflege integrieren

3. Zentrale Designprinzipien

  • GitHub ist Single Source of Truth
  • Kein eigener persistenter Business-State
  • Frontend ist reine UX-Abstraktion
  • Lesen ≠ Schreiben (Token-Trennung)
  • Webhooks statt Polling
  • Pull Requests sind Implementierungsdetails, keine UX-Objekte

4. Rollen & Zielgruppen

4.1 Stakeholder (nicht-technisch)

  • fachlich involviert, aber nicht tool-affin
  • wenig oder kein Englisch
  • wollen lesen, kommentieren, Arbeit anstoßen
  • benötigen Orientierung statt Funktionsvielfalt

4.2 Technical Staff

  • arbeiten direkt in GitHub
  • nutzen Issues, Pull Requests, Actions, AI-Workflows
  • akzeptieren Git als Arbeitsmodell und Source of Truth

5. User Stories (Auswahl)

Stakeholder

US-S1: Diskussion lesen und kommentieren
Als Stakeholder möchte ich eine Diskussion lesen und einen Kommentar verfassen können, ohne GitHub verstehen zu müssen.

US-S2: Aufgabe formulieren
Als Stakeholder möchte ich eine fachliche Aufgabe formulieren (z. B. „Bitte erstellt einen Einladungstext“), die strukturiert im System landet.

US-S3: Ergebnis nachvollziehen
Als Stakeholder möchte ich ein Ergebnis (Vorschau, Dokument-Link, Status) sehen, ohne mich mit Pull Requests oder Commits beschäftigen zu müssen.

Technical Staff

US-T1: Technische Freiheit behalten
Als Mitglied des Technical Staff möchte ich weiterhin direkt mit Issues, Pull Requests und Commits arbeiten.

US-T2: Saubere Trennung von Fachlichkeit und Technik
Als Maintainer möchte ich fachliche Diskussionen im Issue und technische Details im Pull Request halten.


6. Architekturüberblick

Astro Frontend (deutsch, reduziert)
        ↓
Aggregation / UX Layer
        ↓
GitHub API
  - Issues
  - Discussions
  - Comments
  - Pull Requests
  - Actions / Bots

7. Authentifizierung & Tokens

Lesen

  • GitHub App (Installation Token)
  • hohe Rate Limits
  • kein User-Kontext

Schreiben

  • GitHub OAuth App (User Token)
  • nur für Kommentare & Issue-Erstellung
  • Tokens ausschließlich serverseitig

8. Synchronisation & Webhooks

  • kein Polling
  • Delta-Sync über Webhooks
  • relevante Events:
    • issues.*
    • issue_comment.*
    • discussion.*
    • pull_request.*

9. AI-Integration (Konzeptuell)

  • keine eigenen, persistenten AI-Agents
  • AI reagiert ausschließlich auf GitHub-Events
  • Trigger z. B. via Kommentar (@claude)
  • AI erzeugt Commits, Pull Requests und Kommentare zurück nach GitHub

10. Pull Requests (UX-Abstraktion)

  • Pull Requests sind im Frontend unsichtbar
  • Ergebnisse werden über Bot-Kommentare in Issues gespiegelt
  • selektive Preview-Links, auch in Monorepos

11. Rate-Limit-Strategie

  • Lesen über App-Tokens
  • Schreiben minimal über User-Tokens
  • Nutzung der GraphQL API
  • Aggressives Caching
  • Webhooks statt Polling

12. Automatisierte Tests (Konzeptuell)

Unit Tests

  • Mapping (Issue → Aufgabe)
  • Parsing von Kommentaren
  • Diff-Analyse

Contract Tests

  • Mock GitHub API
  • Pagination & Error Handling

E2E Tests

  • dedizierte GitHub-Test-Organisation
  • Test-Repository
  • Test-OAuth App
  • Test-GitHub App

13. Nicht-Ziele

  • kein klassisches Forum
  • kein CMS
  • kein Jira-Ersatz
  • kein eigenes IAM
  • kein separater User-Store

14. AI-Implementierungsvertrag (collapsible)

⚠️ Vollständiger AI-Implementierungsvertrag (zum Kopieren)
You are an implementation AI.

Your task is to build a GitHub-backed collaboration platform.

HARD CONSTRAINTS:
- GitHub is the only source of truth.
- No independent business state.
- No user database.
- No passwords.
- No polling.
- No reimplementation of the GitHub UI.

ARCHITECTURE:
- Frontend: Astro, server-side rendered, minimal client JS.
- Backend: aggregation layer with caching only (no state).
- GitHub App:
  - Used for all read access.
  - Used for receiving webhooks.
- GitHub OAuth App:
  - Used only for writing comments and creating issues in the name of users.

STATE MODEL:
- All visible state is derived from GitHub.
- Caches may exist but must be invalidatable via webhooks.
- No mutation outside GitHub APIs.

UX RULES:
- UI language: German.
- Role-based views:
  - Stakeholders: discussions, tasks (issues), comments, results.
  - Technical staff: work directly in GitHub.
- Never expose:
  - Pull Requests
  - Commits
  - Branches
  - Labels
  - Milestones

AI INTEGRATION:
- No standalone or long-lived agents.
- AI reacts only to GitHub events (e.g. issue comments).
- AI outputs:
  - commits
  - pull requests
  - comments
- All AI output must be written back to GitHub.

TESTING REQUIREMENTS:
- Unit tests:
  - mapping logic
  - comment parsing
  - diff analysis
- Contract tests:
  - mocked GitHub API
  - pagination
  - error handling
- End-to-end tests:
  - real GitHub test organization
  - real repositories
  - real GitHub App installation
  - real OAuth flow

RATE LIMIT STRATEGY:
- Prefer GitHub App tokens for reads.
- Use OAuth user tokens only for writes.
- Batch requests via GraphQL.
- Cache aggressively.
- Rely on webhooks instead of polling.

GOAL:
Enable non-technical stakeholders to participate in GitHub-backed collaboration
without weakening or abstracting away technical workflows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment