Two Modes
| PR Workflow [beta] | Commit Workflow | |
|---|---|---|
| Trigger | GitHub Action on PR open/update | Post-commit hook with [docs] tag |
| Runs where | GitHub Actions runner (CI) | Your local machine |
| Best for | Team-wide docs on every PR | Individual devs documenting as they go |
| Branch strategy | KB branch matches PR branch name | main → staging, feature branch → same name |
| Blocking | No — runs async in CI | No — spawns Claude in background |
How It Works
Both modes follow the same core flow:- A code change happens (PR opened or commit made)
- The diff and changed file list are collected
- Your integration config is fetched from Moxn — this tells the system which database to target, which trigger rules to apply, and which prompt template to use
- Trigger rules are evaluated (always run, match file paths, match labels, or match keywords)
- A prompt template (a Moxn document you can edit) tells Claude how to write docs for your project
- Claude Code reviews the diff using your prompt template and creates or updates KB documents on a branch
- A changeset groups the changes for review and merge
Prerequisites
- A Moxn account with an API key (Settings > API Keys)
- The
@moxn/context-cliinstalled (npm install -g @moxn/context-cli) - An integration configured for your repository (Settings > Integrations)
The integration config — trigger rules, prompt template, target database — is managed in the Moxn web app. Both the PR and commit workflows read this config at runtime, so you configure once and both modes use it.
Integration Config
Each integration specifies:| Setting | Description |
|---|---|
| Repository pattern | Which repo this applies to (e.g., org/repo or org/*) |
| Trigger mode | always, path_match, label, or keyword |
| Prompt template | A KB document containing instructions for the AI |
| Target database | Which KB database new docs are added to |
| Target path | Path prefix for new documents (e.g., /engineering/auto-docs) |
Prompt Templates
The prompt template is a regular Moxn document that you edit in the web app. It controls how the AI writes documentation for your project — what to focus on, what to skip, style guidelines, etc. When you create an integration, a default template is generated. Customize it to match your team’s documentation standards.Next Steps
PR Workflow [beta]
Set up a GitHub Action to auto-generate docs on every pull request
Commit Workflow
Add a post-commit hook to generate docs from local commits