Add @crewcircle/docs-gen: generic OpenWiki documentation generation, opt-in in CI - #29
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.inclusionai/ling-2.6-flashvia the org's existingOPENROUTER_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/modelspricing — 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.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 publishpipeline already proven for@crewcircle/knowledge.docsjob inci.yml, gated on thevars.OPENWIKI_DOCS_ENABLEDrepo/org variable (unset by default → skipped) and scoped topushonly, neverpull_request. The actual logic lives in a newdocs-generate.ymlreusable workflow (workflow_call) so other repos can call it by cross-repo reference instead of duplicating it.--mode engineering|clientflag and bothINSTRUCTIONS.*.mdtemplates are scaffolded, butclientmode 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 (seepackages/docs-gen/README.mdfor the open question and design plan).Also fixed (found while extending release.yml)
The existing
knowledgepublish step rannpm publish packages/knowledge/dist, butdist/has nopackage.jsonof its own — verified vianpm publish --dry-runthat this fails withENOENT. It had never actually been exercised (noknowledge-v*tag has been pushed yet). Switched both publish jobs tonpm publish --workspace=<name>from the repo root, with an explicitfilesfield on eachpackage.jsonso the tarball stays scoped todist/(+templates/for docs-gen).Test plan
npm run typecheck / lint / test / build --workspace=@crewcircle/docs-gen— all passnpm run build(full Next.js site) — unaffected, still builds cleanlynpm publish --workspace=@crewcircle/knowledge --dry-runand same fordocs-gen— both now produce correctly-scoped tarballs (previously the knowledge one would have failed for real)workflow_dispatchrun ofdocs-generate.ymlagainst a realOPENROUTER_API_KEY(not done in this session — needs a maintainer to trigger it or flipOPENWIKI_DOCS_ENABLEDon)🤖 Generated with Claude Code