feat: bundle version-matched docs into app-tools and generate AGENTS.md in @modern-js/create#8774
Open
keepview wants to merge 2 commits into
Open
feat: bundle version-matched docs into app-tools and generate AGENTS.md in @modern-js/create#8774keepview wants to merge 2 commits into
keepview wants to merge 2 commits into
Conversation
…md in create Part of AI governance M1 (agent knowledge supply): - app-tools: prepublishOnly copies packages/document/docs/en into the tarball as main-doc/docs/en (mirrors @modern-js/main-doc layout), so every project gets offline docs that exactly match the installed version; .npmignore re-includes the bundle; scripts/check-doc-bundle.mjs validates file count, alias-import resolvability and size - create: template ships AGENTS.md (managed marker block pointing agents at the bundled docs, falling back to llms.txt and skills) and CLAUDE.md; --no-agents-md opts out; both files are skipped in --sub mode - create: positional-argument parsing refactored — only --lang/-l consumes a value; fixes boolean flags swallowing the following argument (previously `create --sub my-app` ignored my-app) - create: add rstest test infra with 6 integration tests - docs: ai-coding-agents guide documents the bundled docs and AGENTS.md
🦋 Changeset detectedLatest commit: cfa5452 The changes in this PR will be included in the next version bump. This PR includes changesets to release 118 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for modernjs-byted ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Exclude community/, tutorials/ and plugin/ from the bundled docs — agents rarely need them while coding and llms.txt covers them online. Bundle: 356 -> 323 files, 0.79MB -> 0.67MB unpacked (~205KB gzipped transfer). Size limit tightened to 2MB.
Contributor
Author
|
Trimmed the bundle per size review: excluded |
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
Implements the agent knowledge supply design (AI governance M1, items #1+#2, design doc) — the Next.js-style bundled-docs + AGENTS.md approach (their eval: 100% vs 79% for knowledge skills).
Part A: docs bundled into the app-tools tarball
prepublishOnlyrunsscripts/copy-main-doc.mjs: copiespackages/document/docs/eninto the package asmain-doc/docs/en(356 files, ~0.79MB). Ships only in published tarballs — the directory is gitignored, no Nx graph edge, no pnpm transitive-dep path issue (docs live inside the package every project depends on directly)..npmignorere-includesmain-doc/**(genericsrc//output/patterns were swallowing 39 doc files).scripts/check-doc-bundle.mjsvalidates: tarball file count == source, every@site-docs-en/*alias import resolves inside the bundle (code fences stripped; csr-auth sandbox refs whitelisted), size < 3MB.Part B: agent files in @modern-js/create
AGENTS.md(managedBEGIN/END:modernjs-agent-rulesmarker block: read bundled docs → llms.txt fallback → skills, plus 4 key facts) andCLAUDE.md(@AGENTS.md).--no-agents-mdopts out; both files skipped in--submode (agent files belong to the monorepo root).--lang/-lconsumes a value now; boolean flags no longer swallow the following positional (previouslycreate --sub my-appignoredmy-app).Docs
ai-coding-agentsguide (zh+en): new "Bundled docs & AGENTS.md" section.Verification
node scripts/check-doc-bundle.mjs→ 356 files, 0.79MB, all imports resolvablepnpm testin packages/toolkit/create → 6/6 passRelated
modern new/upgradedocs cleanup) for bundled-docs correctness