Repository navigation
feat: project-local design artifacts (docs/plans/<slug>/) - #2
Merged
Merged
Conversation
…act paths Co-Authored-By: Claude <noreply@anthropic.com>
…ate guard Widens the orchestrator delegate-guard allowlist so promoted design docs, docs/research/, and .gitattributes stay orchestrator-editable while the /build sentinel is armed. Co-Authored-By: Claude <noreply@anthropic.com>
…ault-deny ignore Co-Authored-By: Claude <noreply@anthropic.com>
…docs folder Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ard allowlist Co-Authored-By: Claude <noreply@anthropic.com>
…t build start Co-Authored-By: Claude <noreply@anthropic.com>
…low rules Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…and merge tests Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…e guards Co-Authored-By: Claude <noreply@anthropic.com>
…oject copies Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…roject root The docs/plans/, docs/research/, and .gitattributes arms in both guards were bare */... globs, so they matched those path shapes in any repo on disk (e.g. another repo's docs/plans/ or $HOME/.gitattributes) during a guarded window. Anchor each arm to the session project root (git toplevel of the payload cwd, falling back to cwd), skipping the arm entirely when cwd is empty/non-absolute/ ../-tainted so it never collapses to a bare /... glob. .gitattributes is now limited to the project-root file, the only one skills/build writes. Co-Authored-By: Claude <noreply@anthropic.com>
Step 6's git -C "$ROOT" check-ignore probe didn't match the literal-prefix Bash(git check-ignore:*) grant; rewritten to git check-ignore -q "$ROOT/..." (absolute path is root-anchored either way). The partial-copy cleanup switched from rm -rf (uncovered) to git clean -fd + a new Bash(git clean:*) grant, since the partial copy is untracked at design time and git clean cannot touch tracked files. Co-Authored-By: Claude <noreply@anthropic.com>
The broad !docs/ + !docs/** pair un-ignored the entire docs/ tree, voiding the file's default-deny promise for any new content dropped under docs/ outside the design-artifact directories. Scope the un-ignore chain to only docs/plans/ and docs/research/, matching the explicit parent-then-children chaining already used for .claude/. Co-Authored-By: Claude <noreply@anthropic.com>
Reword build/SKILL.md's Phase 0 step 4 heading so it no longer asserts "leading docs commit" as an invariant (refreshes on continue can land later). Add the commit: none (verification-only) exception to WORKFLOW.md's and CLAUDE.md's unconditional one-atomic-commit-per-task language. Fix CLAUDE.md's mode-transitions bullet so the no-repo case is described as a user prompt (git init vs plans dir), not an automatic plans-dir outcome. Co-Authored-By: Claude <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.
Summary
/designnow writes the approved artifact set (design draft, research files, tasks) into the project'sdocs/plans/<slug>/folder, making the project copy canonical; plans-dir drafts are banner-stamped as non-canonical, and the plans dir remains the home for meta-tooling work (the no-repo case prompts togit initor stay in the plans dir).design-scope-guard.shhook confines/design-phase writes to artifact paths only; the orchestrator delegate guard allowlist is widened to permit project docs and.gitattributeswrites. Both guards reject..traversal, fail closed on malformed input, and anchor their project-relative allowances (docs/plans/,docs/research/,.gitattributes) to the session's project root — out-of-project writes are denied./buildconsumes the project design artifacts and commits the set as a scopeddocs(<slug>):commit on the feature branch (typically first on a fresh branch, but not guaranteed leading — refreshes oncontinuecan land later);/shipand/compoundreference the project copy..gitignoredefault-deny now lets exactlydocs/plans/**,docs/research/**, and.gitattributesthrough — the rest ofdocs/stays ignored. The guard is registered insettings.example.jsonand verified by the post-install doctor (check.sh)./design'sallowed-toolsgrants now cover every command its body instructs: the promote-routing probe uses the absolute-pathgit check-ignoreform, and the all-or-nothing partial-copy cleanup usesgit clean -fd(cannot touch tracked files) instead of an ungrantablerm -rf.commit: none(verification-only) task exception.Test Plan
bats tests/— 113/113 pass (includes 12 new guard-anchoring tests)shellcheck -xon all changed shell scripts — cleandocs/plans/write,$HOME/.gitattributeswrite, missing-cwdpayload) now exit 2 in both guards; in-project writes still exit 0docs/scratch-*/note.mdignored,docs/plans/**anddocs/research/**stageable/designon a sample feature and confirm the artifact set lands in<project>/docs/plans/<slug>/with the guard activeDesign Reference
~/.claude/plans/project-local-docs-design-draft.md(legacy plans-dir copy — this branch is the feature that introduces project-local design docs, so no project copy predates it)🤖 Generated with Claude Code
https://claude.ai/code/session_01JcxamSt8aYA4qLQuXADCby