Persona-as-code
Sync personas to a Git repository as YAML+markdown files. Pull, push, or bidirectional, scoped to a base path, with last-write-wins conflict detection via Git blob SHA. Team tier and up.
The problem
For teams that already manage prompts, brand voice, or character bibles as code, Moonborn's UI is the wrong source of truth. Designers iterate in the product; engineers want diffs in pull requests; release managers want every change to flow through the same review pipeline as code.
Persona-as-code closes the loop: the persona definition lives in your Git repository, the Moonborn workspace stays synced, and changes from either side converge.
What sync looks like
Each persona becomes a single YAML file under a configurable base path (default
personas/):
---
id: p-mert-001
name: Mert Aksoy
version: 4
layer: Soul
desire: to build something the world can't ignore
fear: being seen as ordinary
wound: a parent who measured love in achievement
growth_arc: from approval-seeking to self-trusting
---
Mert spent his twenties in the Istanbul tech scene. His first company sold
to a Turkish telco — a quiet exit that he still describes as "fine." …The YAML frontmatter carries the structured layers (Soul, Self, Mask, Surface); the markdown body is the narrative grounding. The serializer emits the exact shape on push, and the parser reads it back on pull. Each file carries a Git blob SHA — that's the basis for conflict detection.
Sync modes
Configure via integrations.git.sync_direction:
pull— Git → Moonborn. Useful when the repo is the canonical source.push— Moonborn → Git. Useful when product is the canonical source and Git is the audit trail.bidirectional— both directions, with conflict resolution.
The commit strategy (integrations.git.commit_strategy) controls granularity:
per_change— one commit per persona changed.batched— one commit per sync run.manual— emit a draft batch; commit is operator-driven.
Conflict resolution
Moonborn uses last-write-wins with explicit rejection — no three-way merge,
no CRDT. The strategy is set by integrations.git.conflict_resolution:
remote_wins— pulls overwrite local changes on conflict.local_wins— pushes overwrite remote changes on conflict.error— surface the conflict, halt the sync, hand it back to the operator.
Conflicts are detected by Git blob SHA mismatch between the file Moonborn last
saw and what's in the repo today. On error, the sync raises a
PersonaFileSyncConflictError carrying the affected persona IDs.
Supported hosts
- GitHub
- GitLab
- Bitbucket
Each provider is independently tier-gated (integrations.git.providers.github,
.gitlab, .bitbucket), all Team+.
Status — preview
The domain and application layers are implemented; the HTTP API and operator UI are landing in a follow-up release. If you want to wire up persona-as-code now, reach out — we'll bring you into the preview cohort and walk you through the direct-integration path.
What's already in:
PullPersonasFromGitUseCaseandPushPersonasToGitUseCase— the two core operations.- The YAML+markdown file format with Git blob SHA conflict detection.
- The
IGitProviderGatewayabstraction over GitHub / GitLab / Bitbucket. - Tier-gated config items under
integrations.git.*.
What's still on the roadmap:
- A REST endpoint surface under
/v1/integrations/git/*(no public API yet). - A setup flow in the product UI (OAuth onboarding to GitHub / GitLab / Bitbucket).
- A webhook trigger that runs sync on
git pushevents. - A conflict-resolution UI for the
errorstrategy. - Automatic audit-log integration — Git history is the de-facto change log today; that should layer onto the immutable Moonborn audit log.
Honest scope
Persona-as-code is the sync surface. Adjacent ideas that are not in scope:
- A Moonborn CLI for local Git workflows.
- Generated pull requests from Moonborn → GitHub for review.
- CI hooks that fail your build when a persona's audit score drops below a threshold (the quality pipeline runs as a runtime gate — see Quality pipeline).
Tier
Team and up. Each Git provider is independently toggleable, so you can pin to the host your engineering org already runs on.
Next
- Concept primer: Soul, Self, Mask, Surface.
- Companion runtime gate: Quality pipeline.