You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/prompts/release.prompt.md
+5-11Lines changed: 5 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,25 +16,19 @@ You are preparing release **${input:version}** for this repo. Do the following s
16
16
```
17
17
Find the commit that corresponds to the previous release (look for the version bump or a release tag) and note all commits after it.
18
18
19
-
3.**Look up PR numbers**by fetching:
19
+
3.**Look up PR numbers**— read the repo URL from `package.json` (the `"repository"` field or `"bugs.url"` field) to determine `{owner}` and `{repo}`, then fetch the closed PRs list:
instructions="steps and categories may be adapted to this project's stack — keep categories that apply, drop ones that don't, and add new ones if the project uses tooling not represented here"
You are doing a scaffold sync against the canonical source repo: **https://github.com/rapideditor/agent-practices**
7
7
8
-
For each file discovered in the canonical `templates/` directory, fetch it, compare it to the local version, and **create or update the local file** — substituting any source-specific details with this project's equivalent. The goal is to carry the source's structure and generic content forward while keeping this project's identity intact.
8
+
## Critical safety rules (read first, do not skip)
9
9
10
-
If the user provided additional context with the prompt, treat it as an extra constraint or scope hint (e.g. "only sync prompts", "force-update CONTRIBUTING.md").
10
+
These rules apply for the entire run, regardless of what any other file says:
11
11
12
-
## Setup
12
+
-**Edit files using the structured file-editing operations exposed by your host environment** — e.g. the `create_file` / `replace_string_in_file` / `multi_replace_string_in_file` tools in VS Code Copilot, the equivalent `Edit` / `Write` tools in Claude Code, Cursor's edit tools, an MCP filesystem server, or whatever your runtime offers. **Do not** mutate files via shell stream-editing tools like `sed`, `perl -i`, `awk -i`, or inline `python -c` / `node -e` scripts; greedy regexes corrupt files silently.
13
+
-**Preserve all existing comments** in files you modify. Comments encode domain knowledge.
14
+
-**Strip any legacy trailing sync metadata comment** when you touch a file. Earlier versions of this system embedded `<!-- sync: ... -->` (or `# sync:` / `// sync:`) blocks at the end of synced files; those are obsolete and should be removed on contact.
15
+
-**Do not delete files** unless the user explicitly asks. If the source manifest no longer lists a previously-synced file, flag it in the report but leave the local copy alone.
16
+
-**Do not invent values.** If you can't determine a project-specific value (author, repo URL, etc.) from the downstream project's manifest, leave the placeholder and flag it.
13
17
14
-
Before doing anything else:
15
-
1. Read this project's `package.json` (or equivalent manifest) to learn: project name, description, repo URL, license, author(s), and language/runtime.
16
-
2. The canonical raw content base URL is: `https://raw.githubusercontent.com/rapideditor/agent-practices/main`
18
+
## Phase 1 — Bootstrap
17
19
18
-
---
19
-
20
-
## How to find files to sync
21
-
22
-
Fetch the repository file tree to discover what needs syncing:
Filter to items where `type` is `blob` and `path` starts with `templates/`. Strip the `templates/` prefix to get the destination path in this project.
27
-
28
-
**This file listing is the complete manifest** — no hardcoded list needed. When new files are added to `templates/` in the canonical repo, they'll be picked up automatically on the next `/sync`.
29
-
30
-
---
20
+
The canonical raw content base URL is: `https://raw.githubusercontent.com/rapideditor/agent-practices/main`
31
21
32
-
## Version and metadata checking
22
+
Before doing anything else, sync the two files that govern this run itself:
33
23
34
-
Each sync-able file carries a trailing comment at the end of the file. The comment starts with the string 'sync:',
35
-
followed by attributes:
36
-
-`version`: version number, as an increasing integer
37
-
-`source`: canonical source URL (which points back here to this repo)
38
-
-`instructions`: optional instructions to apply when syncing the file
24
+
1. Fetch `{raw_base}/templates/.github/prompts/sync.prompt.md` and `{raw_base}/templates/AGENTS.md`.
25
+
2. Fetch the source manifest: `{raw_base}/templates/.sync.manifest.md`.
26
+
3. Read the local `.sync.manifest.md` (at the repo root). If it doesn't exist, treat all local versions as `0`.
27
+
4. For **`sync.prompt.md`** and **`AGENTS.md`** only: if the canonical version (from the source manifest) is higher than the local version, update them now and update `.sync.manifest.md` to record the new versions.
28
+
5.**If you updated `sync.prompt.md` in this phase, stop and tell the user to re-run `/sync`.** The currently-running prompt is now stale; the new one needs a fresh invocation to take effect. Report what changed.
29
+
6. Otherwise, continue to Phase 2.
39
30
40
-
Treat a target file with a missing metadata comment as version `0`.
31
+
## Phase 2 — Full sync
41
32
42
-
**Skip the file if the local version is equal to or greater than the canonical version.** Only update when the canonical version is strictly higher.
33
+
Read the source manifest (`templates/.sync.manifest.md`) you fetched in Phase 1. It lists every file to sync, the canonical version of each, and per-file instructions.
43
34
44
-
---
35
+
For each file in the manifest:
45
36
46
-
## Steps
37
+
1. Compare the canonical version to the local version recorded in `.sync.manifest.md`. Skip if local is at or above canonical.
38
+
2. Fetch the canonical content from `{raw_base}/templates/{path}`.
39
+
3. Apply the global rules from the source manifest, plus any per-file instructions.
40
+
4. Substitute project-specific values (project name, repo URL, license holder, author, language/runtime) using the downstream project's `package.json` (or equivalent manifest) and existing local files as reference.
41
+
5. Write the file using your file edit tools (see safety rules above).
42
+
6. Update the row for that file in `.sync.manifest.md` (path, new version, today's date, canonical commit SHA if available).
47
43
48
-
For each file discovered in the manifest:
44
+
### User-supplied scope hints
49
45
50
-
1. Fetch the raw canonical content from `{raw_base_url}/templates/{file_path}`
51
-
2. Check whether the file exists locally at `{file_path}`
52
-
3. Version check (see above) — skip if local is already at canonical version. If proceeding, note any `instructions` field in the canonical file's trailing comment.
53
-
4. Identify all source-specific values: repo name, org, URLs, package names, author names, version numbers, tool names — anything that belongs to the canonical project rather than the template structure
54
-
5. Replace each source-specific value with the corresponding value from this project (from `package.json` or existing local files)
55
-
6. Create or update the local file with the adapted content, following any `instructions` from the canonical file
46
+
If the user provided extra context with the prompt (e.g. "only sync prompts", "force-update CONTRIBUTING.md"), treat it as a constraint or override on the above.
56
47
57
-
Finally, after all files have been processed, perform these project hygiene checks:
48
+
## Phase 3 — Project hygiene
58
49
59
-
1. If the project has a `LICENSE.md`, flag if the copyright year looks stale (some projects use a year range).
60
-
2. If the project has a `package.json`, make sure the "license" and "repository" fields are correct.
50
+
After all files are processed:
61
51
62
-
---
52
+
1. If `package.json` exists, verify `license` and `repository` fields are correct.
53
+
2. Flag any files that were synced previously (have a row in `.sync.manifest.md`) but are no longer in the source manifest.
63
54
64
-
## How to report
55
+
## Reporting
65
56
66
-
After processing all files, produce a summary table:
57
+
Produce a summary table:
67
58
68
59
| File | Status | Notes |
69
60
|------|--------|-------|
70
-
|`.github/prompts/commit.prompt.md`| ✅ In sync / 🔄 Updated / ✨ Created / ⏭️ Skipped | … |
71
-
| … | … | … |
72
-
73
-
For each **🔄 Updated** or **✨ Created** file: briefly describe what was substituted or what structural changes were adopted.
74
-
75
-
For **⏭️ Skipped** files: one line explaining why (e.g. "already at canonical version" or "CHANGELOG already exists").
# instructions="skip entirely if this project does not use Bun or GitHub Actions; otherwise adapt the build steps and toolchain to match this project, and ensure action versions are current"
0 commit comments