Bug Description
The user guide (docs/user-guide.md, line 101) states that bootstrap is "Safe by Design" and "Never overwrites existing files." However, only CONTRIBUTING.md and CODE_OF_CONDUCT.md have existence guards. All other generated files are silently overwritten if they already exist:
.github/workflows/agentready-assessment.yml
.github/workflows/tests.yml
.github/workflows/security.yml
.github/workflows/repomix-update.yml
.github/ISSUE_TEMPLATE/bug_report.md
.github/ISSUE_TEMPLATE/feature_request.md
.github/PULL_REQUEST_TEMPLATE.md
.github/CODEOWNERS
.pre-commit-config.yaml
.github/dependabot.yml
Steps to Reproduce
- Create a repo with a customized
.pre-commit-config.yaml or CODEOWNERS
- Run
agentready bootstrap .
- Observe that the existing file is replaced with the template version
Expected Behavior
Bootstrap should skip any file that already exists, matching the documented guarantee. Ideally it should log a message like "Skipping .pre-commit-config.yaml (already exists)" so the user knows.
Relevant Code
src/agentready/services/bootstrap.py lines 180-189: _write_file() unconditionally opens the file with "w" mode. Only _generate_docs() (lines 166, 173) checks for existing files before writing.
Acceptance Criteria
_write_file() or each caller checks for file existence before writing
- Existing files are never overwritten
- Skipped files are reported in the output (e.g., "Skipping .pre-commit-config.yaml (already exists)")
--dry-run output distinguishes between "would create" and "would skip (exists)"
- Unit tests verify that existing files are preserved
Submitted by Bill Murdock with assistance from Claude Code.
Bug Description
The user guide (
docs/user-guide.md, line 101) states that bootstrap is "Safe by Design" and "Never overwrites existing files." However, onlyCONTRIBUTING.mdandCODE_OF_CONDUCT.mdhave existence guards. All other generated files are silently overwritten if they already exist:.github/workflows/agentready-assessment.yml.github/workflows/tests.yml.github/workflows/security.yml.github/workflows/repomix-update.yml.github/ISSUE_TEMPLATE/bug_report.md.github/ISSUE_TEMPLATE/feature_request.md.github/PULL_REQUEST_TEMPLATE.md.github/CODEOWNERS.pre-commit-config.yaml.github/dependabot.ymlSteps to Reproduce
.pre-commit-config.yamlorCODEOWNERSagentready bootstrap .Expected Behavior
Bootstrap should skip any file that already exists, matching the documented guarantee. Ideally it should log a message like "Skipping .pre-commit-config.yaml (already exists)" so the user knows.
Relevant Code
src/agentready/services/bootstrap.pylines 180-189:_write_file()unconditionally opens the file with"w"mode. Only_generate_docs()(lines 166, 173) checks for existing files before writing.Acceptance Criteria
_write_file()or each caller checks for file existence before writing--dry-runoutput distinguishes between "would create" and "would skip (exists)"Submitted by Bill Murdock with assistance from Claude Code.