Skip to content

Add @crewcircle/docs-gen: generic OpenWiki documentation generation, opt-in in CI - #29

Merged
crewcricle merged 1 commit into
mainfrom
feat/docs-gen
Jul 26, 2026
Merged

Add @crewcircle/docs-gen: generic OpenWiki documentation generation, opt-in in CI#29
crewcricle merged 1 commit into
mainfrom
feat/docs-gen

Conversation

@rprabhat

Copy link
Copy Markdown
Collaborator

Summary

Adds automated, AI-generated documentation via langchain-ai/openwiki as a generic, shared package@crewcircle/docs-gen — rather than a one-off CI script, so every CrewCircle repo can adopt the same mechanism.

  • Model: inclusionai/ling-2.6-flash via the org's existing OPENROUTER_API_KEY (already an org secret from Fix site-breaking import bugs, untrack knowledge node_modules, add org-wide OpenRouter key #27). Chosen by querying OpenRouter's live /api/v1/models pricing — it's the cheapest currently-listed model that both supports tool-calling (required, OpenWiki reads files via tool calls) and has enough context (262k) for real source files. Free-tier models share a ~20 req/day rate-limited pool, too flaky for CI, so documented as an override rather than the default.
  • Generic: npx @crewcircle/docs-gen generate --mode=engineering — one package, one place to bump the default model later, instead of copy-pasted YAML drifting across repos. Publishing follows the exact same changesets → tag → npm publish pipeline already proven for @crewcircle/knowledge.
  • CI wiring, default off: one new docs job in ci.yml, gated on the vars.OPENWIKI_DOCS_ENABLED repo/org variable (unset by default → skipped) and scoped to push only, never pull_request. The actual logic lives in a new docs-generate.yml reusable workflow (workflow_call) so other repos can call it by cross-repo reference instead of duplicating it.
  • Client-facing docs: the --mode engineering|client flag and both INSTRUCTIONS.*.md templates are scaffolded, but client mode is not wired into any workflow yet — OpenWiki's code mode has no documented output-path override, so running both modes in one repo needs that confirmed first (see packages/docs-gen/README.md for the open question and design plan).

Also fixed (found while extending release.yml)

The existing knowledge publish step ran npm publish packages/knowledge/dist, but dist/ has no package.json of its own — verified via npm publish --dry-run that this fails with ENOENT. It had never actually been exercised (no knowledge-v* tag has been pushed yet). Switched both publish jobs to npm publish --workspace=<name> from the repo root, with an explicit files field on each package.json so the tarball stays scoped to dist/ (+ templates/ for docs-gen).

Test plan

  • npm run typecheck / lint / test / build --workspace=@crewcircle/docs-gen — all pass
  • npm run build (full Next.js site) — unaffected, still builds cleanly
  • npm publish --workspace=@crewcircle/knowledge --dry-run and same for docs-gen — both now produce correctly-scoped tarballs (previously the knowledge one would have failed for real)
  • Manually exercised the CLI's INSTRUCTIONS-file-copy logic in an isolated directory
  • First real CI run on this PR (typecheck/lint/test/build jobs)
  • Manual workflow_dispatch run of docs-generate.yml against a real OPENROUTER_API_KEY (not done in this session — needs a maintainer to trigger it or flip OPENWIKI_DOCS_ENABLED on)

🤖 Generated with Claude Code

…opt-in in CI

Adds a shared package other CrewCircle repos can npm-install/npx rather than
copy-pasting a CI script, wrapping langchain-ai/openwiki with org defaults:

- OPENWIKI_PROVIDER=openrouter, OPENWIKI_MODEL_ID=inclusionai/ling-2.6-flash
  — picked by querying OpenRouter's live pricing API for the cheapest model
  that both supports tool-calling (required, since OpenWiki reads files via
  tool calls) and has enough context for real source files. Free-tier models
  share a fragile ~20 req/day rate-limited pool, too flaky for CI, so a cheap
  paid model was chosen as the default instead.
- A `--mode engineering|client` CLI flag and both INSTRUCTIONS templates are
  scaffolded now; `client` (end-user product docs) isn't wired into any
  workflow yet — OpenWiki's code mode has no documented output-path override,
  so running both modes in one repo needs that confirmed first (see the
  package README).

Wired into CI as a new `docs` job in ci.yml, gated on `vars.OPENWIKI_DOCS_ENABLED`
(unset by default, so it's a no-op until a maintainer opts in) and scoped to
`push` only, never `pull_request`. The actual generation logic lives in a new
`workflow_call` reusable workflow (docs-generate.yml) so other CrewCircle
repos can call it directly by reference instead of duplicating it.

Also fixes a latent bug in release.yml found while extending it: the existing
`knowledge` publish step ran `npm publish packages/knowledge/dist`, but dist/
has no package.json of its own — confirmed via dry-run this would fail with
ENOENT the first time a real `knowledge-v*` tag was pushed (never yet
exercised). Switched both publish jobs to `npm publish --workspace=<name>`
from the repo root, with an explicit `files` field on each package.json so
the published tarball is still scoped to just `dist/` (+ `templates/` for
docs-gen) instead of shipping source and tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crewcircle-website Ready Ready Preview, Comment Jul 26, 2026 3:07pm

@crewcricle
crewcricle merged commit 4c00382 into main Jul 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants