@snappedly-tools/shipyard 0.5.0 → 0.6.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.
Files changed (58) hide show
  1. package/README.md +56 -8
  2. package/dist/index.js +27 -9
  3. package/dist/index.js.map +1 -1
  4. package/dist/main.js +51 -15
  5. package/dist/main.js.map +1 -1
  6. package/dist/templates/parallel-planner/block-scope.sh +160 -0
  7. package/dist/templates/parallel-planner/conflict-prompt.md +22 -0
  8. package/dist/templates/parallel-planner/handoff.sh +175 -0
  9. package/dist/templates/parallel-planner/implement-prompt.md +10 -56
  10. package/dist/templates/parallel-planner/main.mts +434 -188
  11. package/dist/templates/parallel-planner/merge-prompt.md +9 -21
  12. package/dist/templates/parallel-planner/plan-prompt.md +5 -31
  13. package/dist/templates/parallel-planner/select-issues.mjs +788 -0
  14. package/dist/templates/parallel-planner/setup.sh +51 -0
  15. package/dist/templates/parallel-planner/spec-wave-prompt.md +16 -0
  16. package/dist/templates/parallel-planner/template.json +1 -1
  17. package/dist/templates/parallel-planner/triage-prompt.md +5 -0
  18. package/dist/templates/parallel-planner/verify-triage.sh +19 -0
  19. package/dist/templates/parallel-planner-with-review/block-scope.sh +160 -0
  20. package/dist/templates/parallel-planner-with-review/conflict-prompt.md +22 -0
  21. package/dist/templates/parallel-planner-with-review/handoff.sh +175 -0
  22. package/dist/templates/parallel-planner-with-review/implement-prompt.md +10 -56
  23. package/dist/templates/parallel-planner-with-review/main.mts +473 -205
  24. package/dist/templates/parallel-planner-with-review/merge-prompt.md +9 -21
  25. package/dist/templates/parallel-planner-with-review/plan-prompt.md +5 -31
  26. package/dist/templates/parallel-planner-with-review/review-prompt.md +11 -49
  27. package/dist/templates/parallel-planner-with-review/select-issues.mjs +788 -0
  28. package/dist/templates/parallel-planner-with-review/setup.sh +51 -0
  29. package/dist/templates/parallel-planner-with-review/spec-wave-prompt.md +16 -0
  30. package/dist/templates/parallel-planner-with-review/template.json +1 -1
  31. package/dist/templates/parallel-planner-with-review/triage-prompt.md +5 -0
  32. package/dist/templates/parallel-planner-with-review/verify-triage.sh +19 -0
  33. package/dist/templates/sequential-reviewer/block-scope.sh +160 -0
  34. package/dist/templates/sequential-reviewer/handoff.sh +175 -0
  35. package/dist/templates/sequential-reviewer/implement-prompt.md +12 -46
  36. package/dist/templates/sequential-reviewer/main.mts +199 -103
  37. package/dist/templates/sequential-reviewer/review-prompt.md +11 -49
  38. package/dist/templates/sequential-reviewer/select-issues.mjs +788 -0
  39. package/dist/templates/sequential-reviewer/setup.sh +51 -0
  40. package/dist/templates/sequential-reviewer/template.json +1 -1
  41. package/dist/templates/sequential-reviewer/triage-prompt.md +5 -0
  42. package/dist/templates/sequential-reviewer/verify-triage.sh +19 -0
  43. package/dist/templates/shared/block-scope.sh +160 -0
  44. package/dist/templates/shared/handoff.sh +175 -0
  45. package/dist/templates/shared/select-issues.mjs +788 -0
  46. package/dist/templates/shared/setup.sh +51 -0
  47. package/dist/templates/shared/triage-prompt.md +5 -0
  48. package/dist/templates/shared/verify-triage.sh +19 -0
  49. package/dist/templates/simple-loop/block-scope.sh +160 -0
  50. package/dist/templates/simple-loop/handoff.sh +175 -0
  51. package/dist/templates/simple-loop/main.mts +190 -45
  52. package/dist/templates/simple-loop/prompt.md +12 -46
  53. package/dist/templates/simple-loop/select-issues.mjs +788 -0
  54. package/dist/templates/simple-loop/setup.sh +51 -0
  55. package/dist/templates/simple-loop/template.json +1 -1
  56. package/dist/templates/simple-loop/triage-prompt.md +5 -0
  57. package/dist/templates/simple-loop/verify-triage.sh +19 -0
  58. package/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ if [[ -n ${GH_REPO:-} ]]; then
5
+ [[ "$GH_REPO" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]] || { echo "Invalid GH_REPO" >&2; exit 1; }
6
+ git remote set-url origin "https://github.com/$GH_REPO.git"
7
+ fi
8
+
9
+ # Install for this sandbox's checkout. Host node_modules can contain binaries
10
+ # for a different OS and cannot cover dependencies added by the agent later.
11
+ if [[ -f package.json ]]; then
12
+ manager=$(node -e 'try { const p = require("./package.json").packageManager; process.stdout.write(p ? p.split("@")[0] : "") } catch {}')
13
+ if [[ -z "$manager" ]]; then
14
+ if [[ -f bun.lock || -f bun.lockb ]]; then manager=bun
15
+ elif [[ -f pnpm-lock.yaml ]]; then manager=pnpm
16
+ elif [[ -f yarn.lock ]]; then manager=yarn
17
+ else manager=npm; fi
18
+ fi
19
+ case "$manager" in
20
+ npm) npm install ;;
21
+ pnpm) corepack pnpm install ;;
22
+ yarn) corepack yarn install ;;
23
+ bun)
24
+ if ! command -v bun >/dev/null; then curl -fsSL https://bun.com/install | bash; export PATH="$HOME/.bun/bin:$PATH"; fi
25
+ bun install ;;
26
+ *) echo "Unsupported package manager: $manager" >&2; exit 1 ;;
27
+ esac
28
+ fi
29
+
30
+ source_dir=$(mktemp -d)
31
+ trap 'rm -rf "$source_dir"' EXIT
32
+ if ! git clone --depth 1 https://github.com/snappedly/skills.git "$source_dir/repo"; then
33
+ echo "Could not install Snappedly skills; agent work has not started." >&2
34
+ exit 1
35
+ fi
36
+
37
+ mkdir -p "$HOME/.agents/skills" "$HOME/.claude/skills"
38
+ while IFS= read -r -d '' skill_file; do
39
+ skill_dir=${skill_file%/SKILL.md}
40
+ skill_name=${skill_dir##*/}
41
+ rm -rf "$HOME/.agents/skills/$skill_name" "$HOME/.claude/skills/$skill_name"
42
+ cp -R "$skill_dir" "$HOME/.agents/skills/$skill_name"
43
+ ln -sfn "$HOME/.agents/skills/$skill_name" "$HOME/.claude/skills/$skill_name"
44
+ done < <(find "$source_dir/repo/skills" -name SKILL.md -print0)
45
+
46
+ for skill in triage implement implement-spec code-cleanup code-review tdd; do
47
+ if [[ ! -s "$HOME/.agents/skills/$skill/SKILL.md" || -z $(find "$source_dir/repo/skills" -path "*/$skill/SKILL.md" -print -quit) ]]; then
48
+ echo "Snappedly skill installation incomplete: $skill" >&2
49
+ exit 1
50
+ fi
51
+ done
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "simple-loop",
3
- "description": "Picks issues one by one and closes them"
3
+ "description": "Implements standalone issues or whole specs sequentially and opens review PRs"
4
4
  }
@@ -0,0 +1,5 @@
1
+ Triage GitHub issue #{{TASK_ID}} before Shipyard implementation.
2
+
3
+ Follow `/triage` and the repository's `docs/agents/triage.md` label mapping. Read the full issue and comments, verify its claim against the codebase, then apply the appropriate category and state label and post the brief or triage notes required by the skill. The maintainer has authorized Shipyard to apply an evidence-based recommendation during this unattended intake. If a decision requires maintainer judgment, use `needs-triage` and record the question. Do not implement the issue or start a PR in this phase.
4
+
5
+ Report the applied state and evidence. Shipyard will independently re-read GitHub labels and implement only an open issue carrying both `shipyard` and the sole triage state `ready-for-agent`.
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ issue=${1:?issue number required}
5
+ repo=${2:?GitHub repository required}
6
+ [[ "$issue" =~ ^[0-9]+$ ]] || { echo "Invalid issue number" >&2; exit 1; }
7
+ [[ "$repo" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]] || { echo "Invalid GitHub repository" >&2; exit 1; }
8
+
9
+ gh issue view "$issue" --repo "$repo" --json state,labels |
10
+ node -e '
11
+ const issue = JSON.parse(require("node:fs").readFileSync(0, "utf8"));
12
+ const labels = new Set(issue.labels.map((label) => label.name));
13
+ const states = ["needs-triage", "needs-info", "ready-for-agent", "ready-for-human", "wontfix"];
14
+ if (issue.state !== "OPEN" || !labels.has("shipyard") ||
15
+ states.filter((state) => labels.has(state)).join() !== "ready-for-agent") {
16
+ console.error("Issue cannot be implemented: requires an open issue with shipyard and only ready-for-agent as its triage state");
17
+ process.exit(1);
18
+ }
19
+ '
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snappedly-tools/shipyard",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Run AI coding agents in isolated sandboxes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",