-
Notifications
You must be signed in to change notification settings - Fork 13
Documentation for dev and copilot #4384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 61 commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
9db5e8b
feat(doc): add basic copilot-instructions.md and llms.txt
michaelmkraus ea41c1f
chore(): add typedoc to project
michaelmkraus fdfb88e
chore(): add basic adr for copilot documentation
michaelmkraus 006ca98
docs(): add some documentation for component to test generation with …
michaelmkraus 5b34e33
feat(): add postinstall script to copy copilot instruction to corresp…
michaelmkraus 93076c2
docs: document automated postinstall propagation of copilot-instructi…
michaelmkraus 314cd06
feat: add generate-copilot-instructions script with PascalCase folder…
michaelmkraus 730e839
docs: document automated generation of copilot-instructions.md by inc…
michaelmkraus c528673
docs: adapt jsdoc for button and its models
michaelmkraus 6133886
chore: add plugin to merge typedoc files
michaelmkraus c11b057
feat: append component doc to existing instructions instead of overwr…
michaelmkraus f2ad116
chore: add typedoc for doc generation
michaelmkraus 793a26f
chore: remove comment
michaelmkraus 1efbd0e
feat: merge component documentations into [MyComponent].md files and …
michaelmkraus 1bc0087
feat: restructure script and add comments
michaelmkraus a88ae59
chore: delete existing md files within button docs folder
michaelmkraus e3d2125
feat: add script to generate framework-specific code snippets
michaelmkraus 63d7dbd
feat: use mitosis plugin instead of script to generate examples
michaelmkraus fcea6f6
feat: append example snippets for react, angular and vue to [componen…
michaelmkraus 12367ed
feat: introduce sassdoc to generate md documentation for SCSS and int…
michaelmkraus 2c4f59b
feat: add script to extract sassdoc and save in md
michaelmkraus 1ccc328
chore: move scripts to documentation subfolder
michaelmkraus 14b7a17
chore: add readme describing how to generate copilot-instructions.md
michaelmkraus 25c54e7
chore: adapt readme describing how to generate copilot-instructions.md
michaelmkraus 8d1be02
feat: fix typos in readme
michaelmkraus cd80ca1
chore: adapt skript calls and readme
michaelmkraus e08e252
chore: moved script calls to scripts/package.json and adapt README
michaelmkraus ce1769d
chore: moved typedoc.json to scripts folder
michaelmkraus c83d172
feat: add sassdoc comments to variables for drawer
michaelmkraus 7444bb4
docs: add examples for SassDoc and JSDoc
michaelmkraus c0095d9
feat: only handle defined components and skip others
michaelmkraus 65e099a
docs: added open points to readme
michaelmkraus 5f254da
feat: also copy all component-md files to docs/copilot folder
michaelmkraus b4902f4
chore: add new cli tool to copy docs to project
nmerget c3a9402
Merge remote-tracking branch 'origin/main' into docs-copilot-document…
nmerget ef9f32b
fix: issues with bad docs folder
nmerget ea4977c
fix: linting issue
nmerget 9d3670a
fix: issues with extract-css-vars.ts
nmerget 9ff0ceb
chore: update button.docs.lite.tsx
nmerget ac63cfd
Merge remote-tracking branch 'origin/main' into docs-copilot-document…
nmerget 50e172a
feat: improve copilot
nmerget c2f622b
fix: issues with agent directories
nmerget 5d6e5d9
chore: add remaining component examples
nmerget 49d6300
Merge branch 'main' into docs-copilot-documentation
nmerget f88c409
chore: add agent-cli to build outputs
nmerget c692649
Merge remote-tracking branch 'origin/docs-copilot-documentation' into…
nmerget 66b0168
chore: add agent-cli to build outputs
nmerget 6170dde
fix: issue with agent-cli bin
nmerget e7bf98b
chore: improve some ai related stuff
nmerget 7cebac1
Merge branch 'main' into docs-copilot-documentation
mfranzke 79e02c1
Update README.md
mfranzke 9344550
Update packages/foundations/agent/_instructions.md
nmerget f58c777
Update packages/foundations/agent/_instructions.md
nmerget fcd1ba8
Update scripts/documentation/merge-component-docs.ts
nmerget ae8c6a4
Update packages/foundations/agent/_instructions.md
nmerget cb4f476
Update packages/agent-cli/package.json
nmerget c206bd5
Update packages/agent-cli/package.json
nmerget 952dba8
Update packages/agent-cli/README.md
mfranzke 9ba3aa7
Merge branch 'main' into docs-copilot-documentation
mfranzke 1616965
refactor: regenerated package lock file
mfranzke b0bc425
docs: copilot documentation documentation (#4651)
mfranzke 6025a84
docs: provide further information
mfranzke 262ae9f
docs: added sample prompt
mfranzke 7aee163
Merge branch 'main' into docs-copilot-documentation
mfranzke 74081b2
chore: update from main
nmerget f8c04a0
chore: update package-lock.json
nmerget b9c242c
Merge remote-tracking branch 'origin/main' into docs-copilot-document…
nmerget 605128e
fix: linting issues
nmerget a6b1f35
fix: linting issues
nmerget 8422eae
Update docs/adr/adr-05-copilot-developer-doc.md
nmerget a05de73
Update docs/adr/adr-05-copilot-developer-doc.md
nmerget 67da94c
Update packages/foundations/agent/css/Variables.md
nmerget 53b9a66
Update docs/adr/adr-05-copilot-developer-doc.md
nmerget 98f6462
Update packages/agent-cli/src/copilot/index.ts
nmerget 282a46f
Update packages/foundations/agent/_instructions.md
nmerget a714c69
Update packages/foundations/agent/_instructions.md
nmerget fd3e4d0
Update packages/foundations/agent/_instructions.md
nmerget cc717bc
Update packages/foundations/agent/_instructions.md
nmerget 83c80b9
Update packages/foundations/agent/scss/Variables.md
nmerget 81f935e
Apply suggestions from code review
mfranzke d9271e9
Apply suggestions from code review
mfranzke d29c073
Apply suggestions from code review
nmerget 8a284ff
chore: update package-lock.json
nmerget 0239bb7
Apply suggestions from code review
mfranzke a5c36c6
Update packages/agent-cli/package.json
nmerget 7cae3e2
Update packages/agent-cli/test/index.spec.ts
mfranzke 5bd84eb
Merge branch 'main' into docs-copilot-documentation
nmerget ac5bf7e
Apply suggestions from code review
mfranzke c558b9b
Update packages/foundations/package.json
mfranzke 188c3c9
Apply suggestions from code review
mfranzke 83f9098
Apply suggestions from code review
mfranzke a31e345
Apply suggestions from code review
mfranzke ecb5f0b
Apply suggestions from code review
mfranzke d897b26
Apply suggestions from code review
nmerget 07965af
Merge branch 'main' into docs-copilot-documentation
nmerget a3d28ec
chore: add changeset
nmerget 5cabdb2
Update .changeset/sour-brooms-tie.md
nmerget 92ccd3c
Merge branch 'main' into docs-copilot-documentation
nmerget File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ build-outputs/** | |
build-showcases/** | ||
showcases/**/public/** | ||
CODE-OF-CONDUCT.md | ||
**/agent/** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# ADR 2025-06-10: Documentation strategy for GitHub Copilot and developer docs | ||
|
||
## Context | ||
|
||
We need a consistent, maintainable documentation approach that serves both developers and AI-assisted coding | ||
tools (GitHub Copilot) without duplicating effort. The documentation must cover component usage, variants, props, | ||
examples, and allow Copilot to answer questions like "What variants does the Button support?" without manually | ||
opening multiple files. | ||
|
||
Key requirements: | ||
|
||
- Single source of truth for component documentation. | ||
- Automatic inclusion of context in Copilot Chat for both IDEs, VS Code and IntelliJ. | ||
- Developer-friendly Markdown for manual reading and static site generation. | ||
- Compatibility with LLM context conventions (llms.txt) and Copilot Custom Instructions (copilot-instructions.md). | ||
nmerget marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## Decision | ||
|
||
1. Documentation Format & Location | ||
|
||
- Use Markdown files per component, stored in packages/components/docs/ or packages/components/src/components/docs/. | ||
- Central table of contents in docs/llms.txt listing all component docs with relative paths. | ||
|
||
2. Copilot Custom Instructions | ||
nmerget marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
- Place copilot-instructions.md in the project root (under .github/) to provide global guidance. | ||
nmerget marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- Instruct Copilot Chat to load this file automatically; it will include links to llms.txt and recommended file paths. | ||
|
||
3. Automatic Context Loading | ||
|
||
- In VS Code and IntelliJ, Copilot Chat will automatically read .github/copilot-instructions.md on new chats. | ||
nmerget marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- To surface specific details, embed documentation (e.g., Button.md) directly in copilot-instructions.md. | ||
nmerget marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
4. Interactive Context Attachment | ||
|
||
- For deeper or ad-hoc queries, use the "Attach Context" feature in Copilot Chat to load component Markdown files during the session. | ||
|
||
5. Static Site & Developer Docs | ||
mfranzke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
- Integrate component docs via Astro as a package in the monorepo, referencing Markdown sources in packages/components/... . | ||
- Render pages dynamically under /components/[slug] and /api/[slug] for manual browsing. | ||
|
||
mfranzke marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
6. Automated Propagation of Copilot Instructions | ||
|
||
We add a `postinstall` hook to our component package that: | ||
|
||
- copies or appends the package-specific file `.github/copilot-instructions.md` to the target project, | ||
- uses unique markers to automatically replace outdated blocks during future installations, | ||
- handles missing or already existing files as well as idempotent updates cleanly, ensuring that every installation immediately provides the latest Copilot context for our package. | ||
|
||
7. Automate generation and propagation of Copilot instructions on package build. | ||
|
||
- Define `generate:copilot-instructions` in `package.json` and hook into `prepare`. | ||
nmerget marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- Only include `*.md` files whose filename matches the parent directory converted to PascalCase (e.g. `custom-select` → `CustomSelect.md`), ensuring no unrelated MDs are merged. | ||
|
||
## Alternatives Considered | ||
|
||
- Rely solely on Code Search: Let Copilot use workspace search to locate docs dynamically. Rejected due to inconsistency and limited to agent mode. | ||
- TypeDoc-only approach: Generate API docs from TypeScript. Provides type detail but lacks usage narratives and cross-framework examples. | ||
- Mitosis Metadata Model: Embed JSON metadata via useMetadata and generate docs. Promising, but requires custom plugins and not widely adopted yet. | ||
|
||
## Consequences | ||
|
||
- Pros: | ||
|
||
- Clear separation: manual design guidance (Markdown) vs. AI context (Instructions + llms.txt snippets). | ||
nmerget marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- Maintains single source (docs in packages/components/docs). | ||
- Enables Copilot to provide accurate, component-specific suggestions without manual file opening. | ||
- Developer site generation remains straightforward via Astro. | ||
- Consumers always receive the latest Copilot context without manual steps. | ||
- Guarantees that only the intended component documentation is merged into Copilot instructions. | ||
|
||
- Cons: | ||
- Requires maintaining excerpts in copilot-instructions.md when docs change. | ||
nmerget marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- Copilot cannot truly auto-load all linked docs; manual attachment or excerpt embedding needed for deep context. | ||
- Postinstall hooks may be disabled for security reasons, making it impossible to automate the copying of the copilot instructions. | ||
- Relies on strict naming conventions; any divergence between folder and file names will cause a component’s docs to be skipped. |
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
Empty file.
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
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
Empty file.
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
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
Empty file.
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
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
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
Empty file.
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.