Repository navigation
fix(scripts): generate-scenario-docs.sh reads its Markdown groups from the project file - #194
Merged
Merged
Conversation
…m the project file The script ran two hardcoded group names and cleaned and counted a hardcoded docs/generated, so a project whose Markdown groups had other names or destinations got a generator error or a summary of the wrong folder. It now: - runs every group with "language": "markdown" in <name>-project.json; - cleans and counts each group's destination, but never removes one outside the repo, the repo root, or a folder holding api/docs/flows or api/specs; - exits non-zero with a clear message when there is no Markdown group; - no longer dies on its summary when api/docs/flows does not exist. The project-file reader moves out of generate.sh into project-file.sh, which both scripts source, so there is one reader. api/docs/flows stays fixed until the layout work in #184. Closes #191 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clabonte
force-pushed
the
fix/scenario-docs-groups-from-project-file
branch
from
October 29, 2026 14:46
ca03770 to
8b664f3
Compare
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.
Closes #191
Problem.
generate-scenario-docs.shran two hardcoded group names (Documentation - Scenarios,Documentation - Technical References) and cleaned and counted a hardcodeddocs/generated. A project whose Markdown groups have other names or destinations, including the handbook's own singleDocumentationgroup example, got a generator error or a summary of the wrong folder.Changes
"language": "markdown"(same aliases asgenerate.sh --lang) from<name>-project.json, one generator call per group.--cleanremoves each Markdown group'sdestination, with one exception: it never removes a destination that is outside the repo, is the repo root, or holdsapi/docs/flows/orapi/specs/. Without that guard, a scenarios group writing to./api/docswould have wiped the hand-written docs and the flow specs. Scenario pages are still deleted file by file, as before.api/docs/flows/, because the scenario count already covers it.api/docs/flows/doesn't exist. Before this change,set -o pipefailplus a failingfindexited non-zero after a successful generation.generate.shinto a sourcedscripts/specfuse/project-file.sh(find_project_file,groups_tsv,config_value,canon_lang), and both scripts use it.api/docs/flowsstays fixed until Project-configurable paths: honour layout.yml paths: keys in skills, templates and scripts #184.generateskill (step 6) and the scripts README now describe what the script actually does. The handbook example (Documentation→./docs/generated) needed no change, because it now works as written.A note on the issue's first acceptance criterion. The project-init project file declares
"groups": [], so it never had the two groups the issue and the old skill text describe. Before this change, running the script on a fresh scaffold failed inside the generator. Now it stops early with "No Markdown group". To show that projects which did define the two old groups behave the same, CI uses a fixture with exactly those groups.Tests. A new CI step runs on a copy of the scaffold, with bundling stubbed and a fake
SPECFUSE_AUTHORINGthat records each generator call:--cleanremovesdocs/generatedand keepsapi/docs; scenario summary present;./docs/reference: exactly one call, that folder listed, counted and cleaned.Run locally against a scaffold built from source, by extracting the step's script from the YAML: passes. The
generate.shbehaviour #170's step checks (--list, empty selection, unknown group,--lang md --dry-run) is unchanged.shellcheck -xis clean on the new and changed lines, andcheck-shipped-docs.pyis OK.No
compatibility.mdrow; that's added at release time.🤖 Generated with Claude Code