Skip to content

Commit 686d4b6

Browse files
committed
docs: setup instructions match what a render contains
The post-generation message pointed at NEW_LIBRARY_CHECKLIST.md, which 7509b31 had moved out of template/, so no render contained it. README.md and .claude/LIBRARY_CREATION.md told the reader to git rm scripts/setup_repo.py and .claude/LIBRARY_CREATION.md from the new library, and neither file is in a render. The checklist's manual publish route pushed a tag and created a GitHub Release, and nothing listens to either. The checklist is rendered again (copier update leaves it deleted once a library deletes it). The delete instructions are gone, and what remains says to run setup_repo.py from the template repository. The manual route is the Publish workflow's dispatch from master, which is how every successful manual publish in the org has been done. Closes #15
1 parent 8ebf45d commit 686d4b6

4 files changed

Lines changed: 31 additions & 38 deletions

File tree

‎.claude/LIBRARY_CREATION.md‎

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,24 @@ Comprehensive library for X with Y features.
2222

2323
**Why:** AI co-authorship appears in GitHub contributors and cannot be easily removed.
2424

25-
## 2. Files to Exclude from New Library Repositories
25+
## 2. What Lives Where
2626

27-
The following files are **only for the template** and must NOT be committed to new library repositories:
28-
29-
### Must Delete Before First Commit:
30-
- `scripts/setup_repo.py` - Repository setup script (run once, then delete)
31-
- `.claude/LIBRARY_CREATION.md` - This file (agent instructions for template)
32-
33-
### Keep in Template Only:
34-
- Template configuration files
35-
- Copier/Cookiecutter files
36-
- Template-specific documentation
27+
`scripts/setup_repo.py` and this file belong to the template repository. A render
28+
contains neither, so there is nothing of the kind to delete from a new library. The
29+
render does contain `NEW_LIBRARY_CHECKLIST.md`, the operator's checklist; it is deleted
30+
once its steps are done.
3731

3832
## 3. Repository Creation Workflow
3933

4034
When creating a new library repository:
4135

42-
1. **Generate from template** (copier, cookiecutter, or manual)
43-
2. **Run setup script** (if needed):
44-
```bash
45-
python scripts/setup_repo.py org/repo-name
46-
```
47-
3. **Delete setup script**:
36+
1. **Generate from template**:
4837
```bash
49-
git rm scripts/setup_repo.py
38+
uvx --with jinja2-time copier copy --trust gh:bedrock-python/python-library-template my-library
5039
```
51-
4. **Delete template-specific files**:
52-
```bash
53-
git rm .claude/LIBRARY_CREATION.md
54-
```
55-
5. **Make initial commit WITHOUT Co-Authored-By**:
40+
2. **Make initial commit WITHOUT Co-Authored-By**:
5641
```bash
42+
git init -b master
5743
git add .
5844
git commit -m "feat: initial release
5945
@@ -62,9 +48,13 @@ When creating a new library repository:
6248
- Feature B
6349
- Full documentation and tests"
6450
```
65-
6. **Push to GitHub**:
51+
3. **Create the GitHub repository and push**:
52+
```bash
53+
gh repo create org/repo-name --public --source . --push
54+
```
55+
4. **After the first CI pass, run the setup script from the template repository**:
6656
```bash
67-
git push -u origin master
57+
python /path/to/python-library-template/scripts/setup_repo.py org/repo-name
6858
```
6959

7060
## 4. Initial Release Version
@@ -99,8 +89,6 @@ Keep the `<!-- ... -->` guidance comment out of the committed page.
9989
Before pushing the initial commit, verify:
10090

10191
- [ ] No `Co-Authored-By:` in commit messages
102-
- [ ] `scripts/setup_repo.py` deleted
103-
- [ ] `.claude/LIBRARY_CREATION.md` deleted
10492
- [ ] No backup files (e.g., `.coverage (копия...)`, `file (copy).py`)
10593
- [ ] No cache files (`.mypy_cache`, `.ruff_cache`, `__pycache__`) - should be in `.gitignore`
10694
- [ ] `.release-please-manifest.json` contains `"0.0.0"`
@@ -122,7 +110,6 @@ Before merging the Release Please PR:
122110
## 8. Common Mistakes to Avoid
123111

124112
❌ Including AI agents in commits
125-
❌ Committing `scripts/setup_repo.py` to the library repo
126113
❌ Starting with version `0.1.0` instead of `0.0.0`
127114
❌ Committing backup/cache files
128115
❌ Creating multiple commits before initial push (messy history)
@@ -136,6 +123,6 @@ Before merging the Release Please PR:
136123
- No AI co-authors
137124
- No template-specific files
138125
- Start from version 0.0.0
139-
- Run setup script, then delete it
126+
- Run the setup script from the template repository
140127

141128
Following these rules ensures a clean, professional repository from day one.

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ existing ones. Treat it like library code.
1111
- `scripts/setup_repo.py` configures a freshly created GitHub repository to the org
1212
standard (ruleset on `master`, security settings, merge settings, topics). It is run
1313
once per new library and is also what keeps the existing repositories aligned.
14-
- `NEW_LIBRARY_CHECKLIST.md.jinja` and `.claude/LIBRARY_CREATION.md` are the operator
15-
and agent instructions. Keep them in step with what the template actually does.
14+
- `template/NEW_LIBRARY_CHECKLIST.md.jinja` (rendered into every new library, deleted
15+
there once set up) and `.claude/LIBRARY_CREATION.md` are the operator and agent
16+
instructions. Keep them in step with what the template actually does.
1617

1718
## Checking a change
1819

‎README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ make check
4242

4343
Then:
4444
1. Create a GitHub repo: `gh repo create bedrock-python/my-library --public`
45-
2. **Configure repo** (after the first CI pass, then delete the script):
45+
2. **Configure repo** (after the first CI pass), from a checkout of this template
46+
repository — the script lives here, not in the library:
4647
```bash
4748
python scripts/setup_repo.py bedrock-python/my-library
48-
git rm scripts/setup_repo.py .claude/LIBRARY_CREATION.md
4949
```
5050
Idempotent. Sets the org standard: `pypi`/`github-pages` environments and Pages,
5151
read-only workflow tokens, squash/merge-commit only with branches deleted on merge,
@@ -63,7 +63,8 @@ Then:
6363

6464
See [`.claude/LIBRARY_CREATION.md`](.claude/LIBRARY_CREATION.md) for important rules:
6565
- **Never** add AI agents as co-authors in commits
66-
- Delete `scripts/setup_repo.py` before initial commit
66+
- Run `scripts/setup_repo.py` from this repository; a render contains neither it nor
67+
`.claude/LIBRARY_CREATION.md`
6768
- Start with version `0.0.0` (Release Please creates `0.1.0`)
6869

6970
## What's included
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,16 @@ it bumps all three: `CHANGELOG.md`, `.release-please-manifest.json` **and**
8181

8282
Merge the PR → tag `{{ project_slug }}-v0.1.0` is created → PyPI publish triggers.
8383

84-
Or to publish manually:
84+
To publish a release tag that already exists by hand (when its publish failed, say),
85+
run the Publish workflow from `master`:
86+
8587
```bash
86-
git tag {{ project_slug }}-v0.1.0
87-
git push origin {{ project_slug }}-v0.1.0
88-
# Then create a GitHub Release from that tag
88+
gh workflow run publish.yml --ref master -f tag={{ project_slug }}-v0.1.0
8989
```
9090

91+
Pushing a tag or creating a GitHub Release yourself publishes nothing. The Publish
92+
workflow runs after Release Please and on this dispatch, and on nothing else.
93+
9194
## Done ✓
9295

9396
- [ ] `make check` passes
@@ -96,3 +99,4 @@ git push origin {{ project_slug }}-v0.1.0
9699
- [ ] PyPI Trusted Publisher configured
97100
- [ ] `CODECOV_TOKEN` secret added
98101
- [ ] First release published to PyPI
102+
- [ ] This file deleted

0 commit comments

Comments
 (0)