feat: keep project CLAUDE.md pointing at the latest gstack design doc#1553
Open
karthikcsq wants to merge 1 commit into
Open
feat: keep project CLAUDE.md pointing at the latest gstack design doc#1553karthikcsq wants to merge 1 commit into
karthikcsq wants to merge 1 commit into
Conversation
Adds `bin/gstack-claude-md-update`, a generic helper that finds-or-appends a backtick-wrapped artifact pointer line in the project's CLAUDE.md. Wires it into /office-hours at the end of Phase 5, after the design doc is written. The helper is edit-tolerant: the user can move the pointer line into any section, under any heading, with any surrounding prose — it's matched by content pattern, not by line number. Deleting the pointer triggers a clean re-append at end of file under a `## Latest gstack artifacts` heading. Re-runs are idempotent; no duplicate sections accumulate. Silent no-op when CLAUDE.md doesn't exist — never created unilaterally. Opt-out: `gstack-config set claude_md_artifact_pointers false` (default true). Out of scope (deferred to follow-up PRs if maintainers want them): - Wiring into plan-ceo-review, plan-eng-review, plan-design-review, design-consultation - Claude Code hook templates (skill-side approach is cleaner) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Why
After running
/office-hours, the design doc lives in~/.gstack/projects/<slug>/. The project'sCLAUDE.mddoesn't know about it. The next session, a new Claude has to guess (or be told) which design is canonical. Multiply by every artifact-writing skill (CEO review, eng review, design review) and the "which file is current?" question becomes a tax on every session.What this PR does
Adds
bin/gstack-claude-md-update, a small helper that finds-or-appends a backtick-wrapped artifact pointer in the project'sCLAUDE.md. Wires it into/office-hoursat the end of Phase 5. Pattern is now available for other artifact-writing skills to adopt.Edit-tolerant: the user can move the pointer line into any section, under any heading, with any surrounding prose. The helper finds it by content pattern, not by line number. Deleting the pointer triggers a clean re-append at end of file under a
## Latest gstack artifactsheading. Re-runs are idempotent; no duplicate sections accumulate.Never creates
CLAUDE.mdunilaterally — silent no-op if absent. The helper is a citizen, not an installer.Opt-out
Default is
true. Config key documented in thegstack-configCONFIG_HEADER.Helper usage
Known artifact types (rendered label in CLAUDE.md):
design→ "design doc"ceo-plan→ "CEO plan"eng-plan→ "engineering plan"design-spec→ "design spec"checkpoint→ "checkpoint"Project root resolution order:
--project-rootflag →git rev-parse --show-toplevel→\$PWD.Test plan
bun run gen:skill-docs --host allto regenerateoffice-hours/SKILL.mdfrom the updated.tmpl.bun run skill:checkreports✅ office-hours/SKILL.md.tmpl → office-hours/SKILL.md(unrelated pre-existing failures onclaude/SKILL.mdand a couple host folders remain — independent of this PR; verified bygit stash+ re-running check).git statusshows only the 6 intended files (no spurious regen artifacts)./office-hourson a new repo, observed CLAUDE.md gained the pointer line and survived a manual move to a different section across a second invocation.Out of scope (deliberately deferred to keep this PR reviewable)
plan-ceo-review,plan-eng-review,plan-design-review,design-consultation. Happy to follow up in separate PRs if you accept the pattern.CLAUDE.mdsections that gstack already appends to (skill routing).Known cosmetic limitation
When inserting a second artifact bullet into an existing
## Latest gstack artifactssection that had a trailing blank before the next heading, the two bullets end up separated by a blank line instead of being adjacent. Markdown renders identically; not worth moreawkcomplexity in this PR. Easy follow-up if it bothers anyone.🤖 Generated with Claude Code