ai-project-boilerplate 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
unknown
|
|
@@ -14,11 +14,39 @@ Read `.ai-stage` for the current stage value.
|
|
|
14
14
|
## Always-Available
|
|
15
15
|
- `CHANGELOG.md` — append completed work after each session
|
|
16
16
|
|
|
17
|
+
## Workflow
|
|
18
|
+
`.ai-workflow` lists the active workflows for this project, one per line. Each entry maps to `docs/workflows/<name>.md`.
|
|
19
|
+
|
|
20
|
+
Example `.ai-workflow`:
|
|
21
|
+
```
|
|
22
|
+
github
|
|
23
|
+
npm-publish
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**If `.ai-workflow` is missing or every line is `unknown`:**
|
|
27
|
+
- Ask the user: *"Which workflows does this project use? (e.g. github, npm-publish, gitlab)"*
|
|
28
|
+
- Write the answers to `.ai-workflow`, one per line
|
|
29
|
+
- Do not proceed with any code management action until this is resolved
|
|
30
|
+
|
|
31
|
+
**When to read workflow files:**
|
|
32
|
+
- Do NOT read workflow files on session start or during normal coding
|
|
33
|
+
- ONLY read when you are about to perform a code management action
|
|
34
|
+
- Read only the workflow(s) relevant to the current action:
|
|
35
|
+
|
|
36
|
+
| Action | Read this workflow |
|
|
37
|
+
|--------|-------------------|
|
|
38
|
+
| commit / push / PR / branch | the VCS workflow (e.g. `github`, `gitlab`) |
|
|
39
|
+
| publish to a package registry | the publish workflow (e.g. `npm-publish`) |
|
|
40
|
+
| release (tag + publish) | both VCS and publish workflows |
|
|
41
|
+
|
|
42
|
+
If multiple workflows apply to the current action, read all of them.
|
|
43
|
+
|
|
17
44
|
## Instructions
|
|
18
45
|
1. Read ONLY the file for the current stage above.
|
|
19
46
|
2. Do not read other stage files unless explicitly asked.
|
|
20
47
|
3. After completing work, append a summary to `CHANGELOG.md`.
|
|
21
48
|
4. When the stage changes, update `.ai-stage` on the current branch.
|
|
49
|
+
5. Before any code management action: check `.ai-workflow`, read the relevant `docs/workflows/*.md`, and follow it exactly.
|
|
22
50
|
|
|
23
51
|
## First-Time Setup (AI tools other than Claude Code)
|
|
24
52
|
If your tool uses a dedicated instructions file (e.g. `.cursorrules` for Cursor,
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Git Workflow
|
|
12
|
-
-
|
|
12
|
+
- **All changes to `main` must go through a PR — no exceptions, including version bumps and chores**
|
|
13
|
+
- Every change must be developed on a dedicated branch — never commit directly to `main`
|
|
13
14
|
- Branch naming:
|
|
14
15
|
- `feature/<short-description>` — for new functionality
|
|
15
16
|
- `fix/<short-description>` — for bug fixes
|
|
17
|
+
- `chore/<short-description>` — for version bumps, dependency updates, config changes
|
|
16
18
|
### PR Flow
|
|
17
19
|
1. Create a feature or fix branch and push to remote
|
|
18
20
|
2. Open a pull request targeting `main` (e.g. via `gh pr create` or your Git host's UI)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# GitHub Workflow
|
|
2
|
+
|
|
3
|
+
## Branch Naming
|
|
4
|
+
- **All changes to `main` must go through a PR — no exceptions**
|
|
5
|
+
- Never commit directly to `main`
|
|
6
|
+
- `feature/<short-description>` — new functionality
|
|
7
|
+
- `fix/<short-description>` — bug fixes
|
|
8
|
+
- `chore/<short-description>` — version bumps, config changes, dependency updates
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## PR Flow
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# 1. Create and switch to a branch
|
|
16
|
+
git checkout -b feature/<short-description>
|
|
17
|
+
|
|
18
|
+
# 2. Make changes, commit, and push
|
|
19
|
+
git add <files>
|
|
20
|
+
git commit -m "feat: describe the change"
|
|
21
|
+
git push -u origin feature/<short-description>
|
|
22
|
+
|
|
23
|
+
# 3. Create a pull request
|
|
24
|
+
gh pr create \
|
|
25
|
+
--title "feat: describe the change" \
|
|
26
|
+
--body "$(cat <<'EOF'
|
|
27
|
+
## Summary
|
|
28
|
+
- <bullet points>
|
|
29
|
+
|
|
30
|
+
## Test plan
|
|
31
|
+
- [ ] <manual test steps>
|
|
32
|
+
EOF
|
|
33
|
+
)"
|
|
34
|
+
|
|
35
|
+
# 4. Check CI status
|
|
36
|
+
gh pr checks
|
|
37
|
+
|
|
38
|
+
# 5. Merge and delete branch after approval
|
|
39
|
+
gh pr merge --squash --delete-branch
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Release Flow
|
|
45
|
+
|
|
46
|
+
### Automated (Recommended)
|
|
47
|
+
If a `scripts/release.sh` exists in the project:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Bumps version via PR, tags commit, creates GitHub release
|
|
51
|
+
./scripts/release.sh <patch|minor|major>
|
|
52
|
+
|
|
53
|
+
# Then publish to registry if applicable (e.g. npm)
|
|
54
|
+
npm publish
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Manual
|
|
58
|
+
```bash
|
|
59
|
+
# 1. Ensure you are on main with a clean working tree
|
|
60
|
+
git checkout main && git pull origin main
|
|
61
|
+
|
|
62
|
+
# 2. Bump version (no commit yet)
|
|
63
|
+
npm version patch --no-git-tag-version # or minor / major
|
|
64
|
+
|
|
65
|
+
# 3. Create a release branch, commit, push, and open a PR
|
|
66
|
+
git checkout -b release/v<version>
|
|
67
|
+
git add package.json
|
|
68
|
+
git commit -m "chore: bump version to <version>"
|
|
69
|
+
git push -u origin release/v<version>
|
|
70
|
+
|
|
71
|
+
gh pr create \
|
|
72
|
+
--title "chore: release v<version>" \
|
|
73
|
+
--body "Version bump to v<version>." \
|
|
74
|
+
--base main
|
|
75
|
+
|
|
76
|
+
# 4. Merge the PR
|
|
77
|
+
gh pr merge release/v<version> --squash --delete-branch
|
|
78
|
+
|
|
79
|
+
# 5. Pull merged commit, tag it, and push the tag
|
|
80
|
+
git checkout main && git pull origin main
|
|
81
|
+
git tag v<version>
|
|
82
|
+
git push origin v<version>
|
|
83
|
+
|
|
84
|
+
# 6. Create a GitHub release
|
|
85
|
+
gh release create v<version> \
|
|
86
|
+
--title "v<version>" \
|
|
87
|
+
--generate-notes
|
|
88
|
+
|
|
89
|
+
# 7. Publish to registry if applicable
|
|
90
|
+
npm publish
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Quick Reference
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# List open PRs
|
|
99
|
+
gh pr list
|
|
100
|
+
|
|
101
|
+
# View PR status and checks
|
|
102
|
+
gh pr view
|
|
103
|
+
gh pr checks
|
|
104
|
+
|
|
105
|
+
# Merge current branch's PR
|
|
106
|
+
gh pr merge --squash --delete-branch
|
|
107
|
+
|
|
108
|
+
# List releases
|
|
109
|
+
gh release list
|
|
110
|
+
|
|
111
|
+
# View a release
|
|
112
|
+
gh release view v<version>
|
|
113
|
+
|
|
114
|
+
# Delete a release (e.g. to redo)
|
|
115
|
+
gh release delete v<version>
|
|
116
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# npm Publish Workflow
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
- Logged in to npm: `npm whoami` (if not, run `npm login`)
|
|
5
|
+
- `NODE_AUTH_TOKEN` set in CI environment for automated publishing
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
Read this file only when you are about to publish a new version to the npm registry.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Publish Flow
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# 1. Ensure you are on main with the correct version in package.json
|
|
16
|
+
git checkout main && git pull origin main
|
|
17
|
+
node -e "console.log(require('./package.json').version)"
|
|
18
|
+
|
|
19
|
+
# 2. Dry-run to verify package contents
|
|
20
|
+
npm publish --dry-run
|
|
21
|
+
|
|
22
|
+
# 3. Publish with the default 'latest' tag
|
|
23
|
+
npm publish
|
|
24
|
+
|
|
25
|
+
# 4. Verify the published version
|
|
26
|
+
npm view <package-name> version
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Publishing a Pre-release
|
|
30
|
+
```bash
|
|
31
|
+
# Publish under a dist-tag (e.g. beta, next) — does NOT affect 'latest'
|
|
32
|
+
npm publish --tag beta
|
|
33
|
+
|
|
34
|
+
# Verify
|
|
35
|
+
npm view <package-name> dist-tags
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Version Bump
|
|
41
|
+
Version bumps must happen before publishing, via the VCS workflow (e.g. a PR merging a `release/vX.Y.Z` branch). Do not bump the version manually outside of that flow.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Quick Reference
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Check who you are logged in as
|
|
49
|
+
npm whoami
|
|
50
|
+
|
|
51
|
+
# List all published versions
|
|
52
|
+
npm view <package-name> versions --json
|
|
53
|
+
|
|
54
|
+
# Deprecate a version
|
|
55
|
+
npm deprecate <package-name>@<version> "<reason>"
|
|
56
|
+
|
|
57
|
+
# Unpublish within 72 hours (use sparingly)
|
|
58
|
+
npm unpublish <package-name>@<version>
|
|
59
|
+
```
|