Repository navigation
refactor(template): isolate sync-agent-ignore to template repository - #16
Conversation
There was a problem hiding this comment.
Code Review Summary
Needs Attention (1 issue)
- [Quality] README documentation inconsistency - template/README.md.jinja:63
The change from "generated .claude/settings.json" to "pre-configured .claude/settings.json" is misleading since the file is still generated from .agentignore patterns. Consider rewording to "pre-generated" or "automatically generated" to avoid confusion about whether manual updates to .agentignore are reflected.
Suggestions (2 items)
-
[Style] Complex test condition on single line - Justfile:43
The test command chains three conditions without grouping. While it works correctly, consider breaking it into separate test statements or adding a comment explaining why these three conditions are logically combined (all must be true). This would improve readability. -
[Quality] Script error handling improvement - scripts/sync-agent-ignore.sh:40-41
The handling of empty deny array (generating empty deny list instead of potential failure) is a good defensive improvement over the original template version. Consider documenting this edge case behavior in comments or ensure .agentignore always has at least one pattern in CI/documentation.
All Clear
- Pass 1: Correctness & Logic - No bugs or logical flaws detected
- Pass 2: Static Analysis & Types - Bash syntax and variable handling correct
- Pass 4: Security - No credentials, injection risks, or security issues
- Pass 6: Test Quality - New assertions are concrete and behavior-focused
- Pass 7: Performance - No performance concerns
- Pass 8: Dependencies & Breaking Changes - jq removal from template appropriate; proper compatibility maintained
- Pass 10: PII Detection - No sensitive information present
Verdict: Ready to Merge
The PR successfully migrates the sync-agent-ignore script from template to root with improved error handling and clearer architecture. The minor documentation wording could be improved but doesn't block merging.
8f4e996 to
b52eddb
Compare
Move sync-agent-ignore.sh out of template/scripts so created repositories do not inherit the sync script or its Justfile recipes. The template repository retains scripts/sync-agent-ignore.sh and its local Justfile recipes to keep .claude/settings.json in sync with .agentignore. AI-Reasoning: https://github.com/menil/project-template/blob/ai-reasoning/refactor-isolate-sync-agent-ignore.md
b52eddb to
49e5e7b
Compare
|
Addressed review feedback in commit 49e5e7b: updated README wording to 'pre-generated', split Justfile test assertions with an explanatory comment, and documented the empty deny list edge case in scripts/sync-agent-ignore.sh. |
Overview
Isolates
sync-agent-ignore.shto the rootproject-templaterepository as maintainer tooling, ensuring child repositories generated via Copier do not inherit the script or its task runner recipes.Changes
template/scripts/sync-agent-ignore.shand convertedscripts/sync-agent-ignore.shfrom a symlink into an executable regular file (100755) at the repository root.sync-agent-ignoreandcheck-agent-ignore-syncrecipes fromtemplate/Justfile.template/Justfile:formatnow runs without prerequisites, andvalidate: lint.case "${1:-}" in) supporting--check,-h|--help, and rejecting unexpected flags.denyarrays to prevent Bash 3.2 unbound variable crashes underset -uand generate valid empty JSON ("deny": []).^[[:space:]]*(#|$)) and whitespace trimming to safely ignore indented comments and blank lines.CDPATHlookups withCDPATH='' cd -- "$(dirname "${BASH_SOURCE[0]}")/..".template/README.md.jinjato clarify that.claude/settings.jsonis shipped pre-configured, and that downstream projects adding custom ignore rules should update.claude/settings.jsondirectly.Justfile(test-template), added assertions thatscripts/sync-agent-ignore.shis an executable regular file,test -f "$TMPDIR/rendered-default/.claude/settings.json"is preserved, andscripts/is not generated in rendered outputs.