@c-d-cc/reap 0.16.0 → 0.16.2
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/README.de.md +8 -8
- package/README.ja.md +8 -8
- package/README.ko.md +8 -8
- package/README.md +8 -9
- package/README.zh-CN.md +8 -8
- package/RELEASE_NOTICE.md +12 -0
- package/dist/cli/index.js +226 -108
- package/dist/templates/hooks/conditions/always.sh +3 -0
- package/dist/templates/hooks/conditions/has-code-changes.sh +13 -0
- package/dist/templates/hooks/conditions/version-bumped.sh +17 -0
- package/dist/templates/hooks/onCompleted.example-notify.sh.example +11 -0
- package/dist/templates/hooks/onCompleted.example-review.md.example +17 -0
- package/dist/templates/reap-guide.md +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# True if src/ files were changed in the most recent commit
|
|
3
|
+
# Exit 0 = condition met, Exit 1 = condition not met
|
|
4
|
+
last_commit=$(git log -1 --format="%H" 2>/dev/null)
|
|
5
|
+
if [ -z "$last_commit" ]; then
|
|
6
|
+
exit 1
|
|
7
|
+
fi
|
|
8
|
+
changes=$(git diff-tree --no-commit-id --name-only -r "$last_commit" -- src/ 2>/dev/null)
|
|
9
|
+
if [ -n "$changes" ]; then
|
|
10
|
+
exit 0
|
|
11
|
+
else
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# True if package.json version differs from the last git tag
|
|
3
|
+
# Exit 0 = version was bumped, Exit 1 = same version
|
|
4
|
+
last_tag=$(git describe --tags --abbrev=0 2>/dev/null)
|
|
5
|
+
if [ -z "$last_tag" ]; then
|
|
6
|
+
exit 1
|
|
7
|
+
fi
|
|
8
|
+
tag_version="${last_tag#v}"
|
|
9
|
+
pkg_version=$(node -e "console.log(require('./package.json').version)" 2>/dev/null)
|
|
10
|
+
if [ -z "$pkg_version" ]; then
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
if [ "$tag_version" != "$pkg_version" ]; then
|
|
14
|
+
exit 0
|
|
15
|
+
else
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# condition: always
|
|
3
|
+
# order: 90
|
|
4
|
+
#
|
|
5
|
+
# Example: Send a notification when a generation completes.
|
|
6
|
+
# Rename this file to remove .example suffix to activate.
|
|
7
|
+
#
|
|
8
|
+
# onCompleted.notify.sh
|
|
9
|
+
|
|
10
|
+
echo "Generation completed at $(date)"
|
|
11
|
+
# osascript -e 'display notification "Generation done" with title "REAP"'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
condition: has-code-changes
|
|
3
|
+
order: 50
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!--
|
|
7
|
+
Example: AI-driven code review after generation completes.
|
|
8
|
+
Rename this file to remove .example suffix to activate.
|
|
9
|
+
|
|
10
|
+
Filename: onCompleted.review.md
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
Review the changes made in this generation:
|
|
14
|
+
|
|
15
|
+
1. Check for any code quality issues
|
|
16
|
+
2. Verify test coverage for new code
|
|
17
|
+
3. Report findings to the user
|
|
@@ -212,6 +212,17 @@ Merge: `onMergeStarted`, `onMergeDetected`, `onMergeMated`, `onMergeMerged`, `on
|
|
|
212
212
|
|
|
213
213
|
Conditions are executable scripts in `.reap/hooks/conditions/`. Exit code 0 = condition met, non-zero = skip. If no condition is specified, the hook always runs (default: `always`).
|
|
214
214
|
|
|
215
|
+
Default conditions (installed by `reap init`):
|
|
216
|
+
- `always` — Always true
|
|
217
|
+
- `has-code-changes` — True if the last commit changed `src/`
|
|
218
|
+
- `version-bumped` — True if `package.json` version differs from the last git tag
|
|
219
|
+
|
|
220
|
+
### Creating Hooks
|
|
221
|
+
|
|
222
|
+
**Always use the CLI to create hooks**: `reap make hook --event <event> --name <name> [--type md|sh] [--condition <condition>] [--order <order>]`. Never create hook files directly — the CLI ensures correct filename convention and frontmatter format.
|
|
223
|
+
|
|
224
|
+
After creating a hook, fill in the TODO placeholder with your hook logic (for `.sh`) or prompt (for `.md`).
|
|
225
|
+
|
|
215
226
|
## Slash Commands
|
|
216
227
|
|
|
217
228
|
All REAP interactions go through `/reap.*` slash commands. These are the primary interface for both users and AI agents.
|
|
@@ -241,6 +252,7 @@ All REAP interactions go through `/reap.*` slash commands. These are the primary
|
|
|
241
252
|
|
|
242
253
|
## CLI Commands (no slash command equivalent)
|
|
243
254
|
- `reap make backlog --type <type> --title <title> [--body <body>] [--priority <priority>]` — Create backlog item (type: genome-change, environment-change, task)
|
|
255
|
+
- `reap make hook --event <event> --name <name> [--type md|sh] [--condition <condition>] [--order <order>]` — Create hook file with correct naming and frontmatter
|
|
244
256
|
- `reap cruise <count>` — Set cruise mode (pre-approve N generations for autonomous execution)
|
|
245
257
|
- `reap update` — Update project structure to match current REAP version (v0.15 migrate, v0.16 sync)
|
|
246
258
|
|