Added goose doc map md file for goose agent to find relevant doc easily.#6598
Added goose doc map md file for goose agent to find relevant doc easily.#6598lifeizhou-ap merged 7 commits intomainfrom
Conversation
| "write-heading-ids": "docusaurus write-heading-ids", | ||
| "test": "node --test scripts/*.test.js", | ||
| "typecheck": "tsc", | ||
| "generate-detail-pages": "node scripts/generate-detail-pages.js", |
There was a problem hiding this comment.
this js file is not referenced anywhere
There was a problem hiding this comment.
Pull request overview
This PR adds a documentation map generation system that creates a structured overview of goose documentation files. The system scans markdown files in the docs directory, extracts titles and headings, and generates a consolidated map file that can be used for navigation or context.
Changes:
- Added a Node.js script to generate a documentation map from markdown files
- Added unit tests for the map generation logic using Node's built-in test runner
- Added a bash verification script to ensure the docs map is generated during builds
- Integrated the generation into the npm build process and CI workflow
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| documentation/scripts/generate-docs-map.js | Main script that scans docs directory and generates markdown map |
| documentation/scripts/generate-docs-map.test.js | Unit tests for title and heading extraction functions |
| documentation/scripts/verify-build.sh | Bash script to verify docs map exists in build output |
| documentation/package.json | Added gray-matter dependency and test/build script updates |
| documentation/package-lock.json | Lock file updates for new dependency |
| documentation/.gitignore | Excludes generated docs map from version control |
| .github/workflows/deploy-docs-and-extensions.yml | Runs tests and verification during deployment |
Files not reviewed (1)
- documentation/package-lock.json: Language not supported
| { name: 'Guides', pattern: 'guides/**/*.{md,mdx}' }, | ||
| ]; | ||
|
|
||
| let output = `# Goose Documentation Map |
There was a problem hiding this comment.
The title uses "Goose" (uppercase) which violates the project naming convention. According to the project guidelines, in documentation files, the project should always be referred to as "goose" (lowercase), never "Goose" (even at the start of sentences). Change this to "# goose Documentation Map".
| continue; | ||
| } | ||
| const headings = getHeadings(content); | ||
| const urlPath = `docs/${file.replace('.mdx', '.md')}`; |
There was a problem hiding this comment.
The replacement logic only handles '.mdx' to '.md' conversion but doesn't handle files that are already '.md'. This could result in incorrect URLs for .md files. Use .replace(/\.mdx?$/, '.md') instead to handle both .md and .mdx extensions correctly.
| const urlPath = `docs/${file.replace('.mdx', '.md')}`; | |
| const urlPath = `docs/${file.replace(/\.mdx?$/, '.md')}`; |
There was a problem hiding this comment.
not sure why we need regex here? are they the same thing? @copilot
| "@docusaurus/tsconfig": "3.7.0", | ||
| "@docusaurus/types": "3.7.0", | ||
| "gray-matter": "^4.0.3", | ||
| "js-yaml": "^4.1.1", |
There was a problem hiding this comment.
The package 'globby' is used but not declared as a dependency in package.json. While it's currently available as a transitive dependency through other packages, this is fragile as it could break if those packages change their dependencies. Add 'globby' explicitly to devDependencies to ensure it remains available.
| "js-yaml": "^4.1.1", | |
| "js-yaml": "^4.1.1", | |
| "globby": "^13.2.2", |
|
| output += `### [${title}](${urlPath})\n\n`; | ||
| if (headings) output += `${headings}\n\n`; | ||
| } catch (err) { | ||
| console.warn(`[generate-docs-map] Warning: Could not process ${file}, skipping`); |
There was a problem hiding this comment.
The error is caught but the actual error details are not logged. Consider logging the error object to help with debugging, for example: console.warn([generate-docs-map] Warning: Could not process ${file}, skipping, err)
| console.warn(`[generate-docs-map] Warning: Could not process ${file}, skipping`); | |
| console.warn(`[generate-docs-map] Warning: Could not process ${file}, skipping`, err); |
|
|
||
| // Run main if executed directly | ||
| if (require.main === module) { | ||
| main(); |
There was a problem hiding this comment.
The async main function is called without error handling. If it fails, the process may not exit with an error code, causing CI to pass when it should fail. Consider using: main().catch(err => { console.error(err); process.exit(1); })
| main(); | |
| main().catch((err) => { | |
| console.error('[generate-docs-map] Error running main:', err); | |
| process.exit(1); | |
| }); |
There was a problem hiding this comment.
without the catch, it still exit with non zero error code
|
|
||
| // Run main if executed directly | ||
| if (require.main === module) { | ||
| main(); |
There was a problem hiding this comment.
The script lacks error handling for async main function. If main() throws an error, it will result in an unhandled promise rejection. Consider wrapping the main() call in a try-catch or adding .catch() to handle errors properly and exit with a non-zero status code on failure.
| main(); | |
| main().catch((err) => { | |
| console.error('[generate-docs-map] Failed to generate docs map:', err); | |
| process.exit(1); | |
| }); |
…ovider * 'main' of github.com:block/goose: increase worker threads for ci (#6614) docs: todo tutorial update (#6613) Added goose doc map md file for goose agent to find relevant doc easily. (#6598) add back goose branding to home (#6617) fix: actually set the working dir for extensions from session (#6612) Multi chat (#6428) Lifei/fixed accumulated token count (#6587) Dont show MCP UI/Apps until tool is approved (#6492) docs: max tokens config (#6596) User configurable templates (#6420) docs: http proxy environment variables (#6594) feat: exclude subagent tool from code_execution filtering (#6531)
* main: increase worker threads for ci (#6614) docs: todo tutorial update (#6613) Added goose doc map md file for goose agent to find relevant doc easily. (#6598) add back goose branding to home (#6617) fix: actually set the working dir for extensions from session (#6612) Multi chat (#6428) Lifei/fixed accumulated token count (#6587) Dont show MCP UI/Apps until tool is approved (#6492) docs: max tokens config (#6596) User configurable templates (#6420) docs: http proxy environment variables (#6594) feat: exclude subagent tool from code_execution filtering (#6531) Fix path for global agent skills (#6591) recipes: add mcp server (#6552) feat(gcp-vertex): add model list with org policy filtering (#6393) chore: encourage extension searching (#6582) blog: mobile apps consolidation and roadmap (#6580) chore: remove unused dependencies in cargo.toml (#6561) resolved all the extensions to load in cli (#6464)
* main: increase worker threads for ci (#6614) docs: todo tutorial update (#6613) Added goose doc map md file for goose agent to find relevant doc easily. (#6598) add back goose branding to home (#6617) fix: actually set the working dir for extensions from session (#6612) Multi chat (#6428) Lifei/fixed accumulated token count (#6587) Dont show MCP UI/Apps until tool is approved (#6492)
* main: increase worker threads for ci (#6614) docs: todo tutorial update (#6613) Added goose doc map md file for goose agent to find relevant doc easily. (#6598) add back goose branding to home (#6617) fix: actually set the working dir for extensions from session (#6612) Multi chat (#6428) Lifei/fixed accumulated token count (#6587) Dont show MCP UI/Apps until tool is approved (#6492)
* main: (41 commits) chore: tweak release docs (#6571) fix(goose): propagate session_id across providers and MCP (#6584) increase worker threads for ci (#6614) docs: todo tutorial update (#6613) Added goose doc map md file for goose agent to find relevant doc easily. (#6598) add back goose branding to home (#6617) fix: actually set the working dir for extensions from session (#6612) Multi chat (#6428) Lifei/fixed accumulated token count (#6587) Dont show MCP UI/Apps until tool is approved (#6492) docs: max tokens config (#6596) User configurable templates (#6420) docs: http proxy environment variables (#6594) feat: exclude subagent tool from code_execution filtering (#6531) Fix path for global agent skills (#6591) recipes: add mcp server (#6552) feat(gcp-vertex): add model list with org policy filtering (#6393) chore: encourage extension searching (#6582) blog: mobile apps consolidation and roadmap (#6580) chore: remove unused dependencies in cargo.toml (#6561) ...
* main: (68 commits) fix(docs): use dynamic import for globby ESM module (#6636) chore: trigger CI Document tab completion (#6635) Install goose-mcp crate dependencies (#6632) feat(goose): standardize agent-session-id for session correlation (#6626) chore: tweak release docs (#6571) fix(goose): propagate session_id across providers and MCP (#6584) increase worker threads for ci (#6614) docs: todo tutorial update (#6613) Added goose doc map md file for goose agent to find relevant doc easily. (#6598) add back goose branding to home (#6617) fix: actually set the working dir for extensions from session (#6612) Multi chat (#6428) Lifei/fixed accumulated token count (#6587) Dont show MCP UI/Apps until tool is approved (#6492) docs: max tokens config (#6596) User configurable templates (#6420) docs: http proxy environment variables (#6594) feat: exclude subagent tool from code_execution filtering (#6531) Fix path for global agent skills (#6591) ...
* main: (68 commits) fix(docs): use dynamic import for globby ESM module (#6636) chore: trigger CI Document tab completion (#6635) Install goose-mcp crate dependencies (#6632) feat(goose): standardize agent-session-id for session correlation (#6626) chore: tweak release docs (#6571) fix(goose): propagate session_id across providers and MCP (#6584) increase worker threads for ci (#6614) docs: todo tutorial update (#6613) Added goose doc map md file for goose agent to find relevant doc easily. (#6598) add back goose branding to home (#6617) fix: actually set the working dir for extensions from session (#6612) Multi chat (#6428) Lifei/fixed accumulated token count (#6587) Dont show MCP UI/Apps until tool is approved (#6492) docs: max tokens config (#6596) User configurable templates (#6420) docs: http proxy environment variables (#6594) feat: exclude subagent tool from code_execution filtering (#6531) Fix path for global agent skills (#6591) ...
* main: (68 commits) fix(docs): use dynamic import for globby ESM module (#6636) chore: trigger CI Document tab completion (#6635) Install goose-mcp crate dependencies (#6632) feat(goose): standardize agent-session-id for session correlation (#6626) chore: tweak release docs (#6571) fix(goose): propagate session_id across providers and MCP (#6584) increase worker threads for ci (#6614) docs: todo tutorial update (#6613) Added goose doc map md file for goose agent to find relevant doc easily. (#6598) add back goose branding to home (#6617) fix: actually set the working dir for extensions from session (#6612) Multi chat (#6428) Lifei/fixed accumulated token count (#6587) Dont show MCP UI/Apps until tool is approved (#6492) docs: max tokens config (#6596) User configurable templates (#6420) docs: http proxy environment variables (#6594) feat: exclude subagent tool from code_execution filtering (#6531) Fix path for global agent skills (#6591) ...
…ly. (block#6598) Signed-off-by: fbalicchia <fbalicchia@cuebiq.com>
Summary
Added goose doc map md file for goose agent to find relevant doc easily for user to understand how to use goose and goose features. The map md file only includes the "Get Started" and "Guides" Section.
This is the prerequisite change for this PR #6534
Type of Change
AI Assistance
Testing
Unit test and local testing