Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/add-docs-gen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crewcircle/docs-gen": minor
---

Initial release: generic OpenWiki-based documentation generation shared across CrewCircle repos, defaulting to the cheapest tool-calling-capable model available via the org's OpenRouter key.
36 changes: 31 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
run: npm ci

- name: TypeCheck
run: npm run typecheck --workspace=@crewcircle/knowledge
run: |
npm run typecheck --workspace=@crewcircle/knowledge
npm run typecheck --workspace=@crewcircle/docs-gen

lint:
name: Lint
Expand All @@ -45,7 +47,9 @@ jobs:
run: npm ci

- name: Lint
run: npm run lint --workspace=@crewcircle/knowledge
run: |
npm run lint --workspace=@crewcircle/knowledge
npm run lint --workspace=@crewcircle/docs-gen

test:
name: Test
Expand All @@ -65,7 +69,9 @@ jobs:
run: npm ci

- name: Run Tests
run: npm test --workspace=@crewcircle/knowledge
run: |
npm test --workspace=@crewcircle/knowledge
npm test --workspace=@crewcircle/docs-gen

build:
name: Build
Expand All @@ -86,15 +92,35 @@ jobs:
run: npm ci

- name: Build
run: npm run build --workspace=@crewcircle/knowledge
run: |
npm run build --workspace=@crewcircle/knowledge
npm run build --workspace=@crewcircle/docs-gen

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: packages/knowledge/dist
path: |
packages/knowledge/dist
packages/docs-gen/dist
retention-days: 7

docs:
name: Generate Docs
needs: [build]
# Opt-in only: unset by default, so this job is skipped on every normal
# push/PR until a maintainer sets the OPENWIKI_DOCS_ENABLED repository
# (or org) variable to "true". Never runs on pull_request — an LLM pass
# on every contributor's PR would be wasteful and noisy.
if: github.event_name == 'push' && vars.OPENWIKI_DOCS_ENABLED == 'true'
permissions:
contents: write
pull-requests: write
uses: ./.github/workflows/docs-generate.yml
with:
mode: engineering
secrets: inherit

changeset:
name: Changeset
runs-on: ubuntu-latest
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/docs-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Generate Docs (reusable)

# Generic OpenWiki-based documentation generation, shared across CrewCircle
# repos via @crewcircle/docs-gen. Called by this repo's own ci.yml (gated,
# default off) and by other CrewCircle repos as:
# uses: crewcircle/crewcircle-website/.github/workflows/docs-generate.yml@main
#
# Requires the calling workflow to pass `secrets: inherit` (or explicitly
# forward OPENROUTER_API_KEY) so the shared org-wide OpenRouter key reaches
# this job.

on:
workflow_call:
inputs:
mode:
description: "Documentation audience: engineering (default) or client"
type: string
default: engineering
workflow_dispatch:
inputs:
mode:
description: "Documentation audience: engineering (default) or client"
type: string
default: engineering

jobs:
generate:
name: Generate Docs
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: true

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Run OpenWiki via @crewcircle/docs-gen
run: npx --yes @crewcircle/docs-gen generate --mode=${{ inputs.mode }}
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}

- name: Create documentation update pull request
uses: peter-evans/create-pull-request@v7
with:
add-paths: |
openwiki
AGENTS.md
CLAUDE.md
branch: docs/update
commit-message: "docs: update generated documentation"
title: "docs: update generated documentation"
body: |
Automated documentation update via `@crewcircle/docs-gen` (OpenWiki, mode: ${{ inputs.mode }}).
42 changes: 36 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main]
tags:
- 'knowledge-v*'
- 'docs-gen-v*'
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -77,8 +78,8 @@ jobs:
automated
draft: false

publish:
name: Publish to npm
publish-knowledge:
name: Publish knowledge to npm
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/knowledge-v')
steps:
Expand All @@ -101,11 +102,40 @@ jobs:
run: npm run build --workspace=@crewcircle/knowledge

- name: Verify package
run: |
cd packages/knowledge/dist
npm pack --dry-run
run: npm pack --dry-run --workspace=@crewcircle/knowledge

- name: Publish to npm
run: npm publish --workspace=@crewcircle/knowledge --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-docs-gen:
name: Publish docs-gen to npm
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/docs-gen-v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Build docs-gen package
run: npm run build --workspace=@crewcircle/docs-gen

- name: Verify package
run: npm pack --dry-run --workspace=@crewcircle/docs-gen

- name: Publish to npm
run: npm publish packages/knowledge/dist --access public --provenance
run: npm publish --workspace=@crewcircle/docs-gen --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading
Loading