jonah-fleet 1.0.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/CHANGELOG.md +17 -0
- package/README.md +133 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +454 -0
- package/package.json +47 -0
- package/schema.json +49 -0
- package/templates/docs/AGENTS.template.md +54 -0
- package/templates/prompts/ORCHESTRATION.md +97 -0
- package/templates/prompts/_prompt-template.md +43 -0
- package/templates/prompts/autowork.md +125 -0
- package/templates/prompts/dependency-update-security-check.md +44 -0
- package/templates/prompts/issues-housekeeping.md +55 -0
- package/templates/prompts/optimizer.md +72 -0
- package/templates/prompts/peer-review.md +112 -0
- package/templates/prompts/product-planning.md +67 -0
- package/templates/skills/code-review/SKILL.md +87 -0
- package/templates/skills/code-review/agents/openai.yaml +3 -0
- package/templates/skills/codebase-design/DEEPENING.md +37 -0
- package/templates/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/templates/skills/codebase-design/SKILL.md +114 -0
- package/templates/skills/codebase-design/agents/openai.yaml +3 -0
- package/templates/skills/diagnosing-bugs/SKILL.md +138 -0
- package/templates/skills/diagnosing-bugs/agents/openai.yaml +3 -0
- package/templates/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
- package/templates/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/templates/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/templates/skills/domain-modeling/SKILL.md +74 -0
- package/templates/skills/domain-modeling/agents/openai.yaml +3 -0
- package/templates/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/templates/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/templates/skills/tdd/SKILL.md +38 -0
- package/templates/skills/tdd/agents/openai.yaml +3 -0
- package/templates/skills/tdd/mocking.md +59 -0
- package/templates/skills/tdd/tests.md +77 -0
- package/templates/skills/to-spec/SKILL.md +75 -0
- package/templates/skills/to-spec/agents/openai.yaml +5 -0
- package/templates/skills/to-tickets/SKILL.md +105 -0
- package/templates/skills/to-tickets/agents/openai.yaml +5 -0
- package/templates/skills/triage/AGENT-BRIEF.md +207 -0
- package/templates/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/templates/skills/triage/SKILL.md +112 -0
- package/templates/skills/triage/agents/openai.yaml +5 -0
- package/templates/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/templates/skills/writing-for-agents/SKILL.md +81 -0
- package/templates/skills/writing-for-agents/agents/openai.yaml +3 -0
- package/templates/workflows/autowork-cron.yml +154 -0
- package/templates/workflows/dependency-check-cron.yml +85 -0
- package/templates/workflows/issues-housekeeping-cron.yml +85 -0
- package/templates/workflows/prompt-optimizer-cron.yml +85 -0
- package/templates/workflows/sync-fleet.yml +63 -0
- package/templates/workflows/trigger-autowork-on-bug.yml +101 -0
- package/templates/workflows/trigger-autowork-on-merge.yml +130 -0
- package/templates/workflows/trigger-review-routine.yml +141 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
name: Trigger Autowork on Merge
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [closed]
|
|
6
|
+
|
|
7
|
+
concurrency:
|
|
8
|
+
group: autowork-merge-pr-${{ github.event.pull_request.number }}
|
|
9
|
+
cancel-in-progress: true
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
fire-autowork:
|
|
13
|
+
if: >-
|
|
14
|
+
github.event.pull_request.merged == true &&
|
|
15
|
+
github.event.pull_request.base.ref == 'main' &&
|
|
16
|
+
github.event.pull_request.head.repo.full_name == github.repository
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
timeout-minutes: 65
|
|
19
|
+
permissions:
|
|
20
|
+
contents: write
|
|
21
|
+
issues: write
|
|
22
|
+
pull-requests: write
|
|
23
|
+
statuses: write
|
|
24
|
+
actions: read
|
|
25
|
+
steps:
|
|
26
|
+
- name: Compute unblocked issue
|
|
27
|
+
id: pick
|
|
28
|
+
env:
|
|
29
|
+
GH_TOKEN: ${{ github.token }}
|
|
30
|
+
OWNER: ${{ github.repository_owner }}
|
|
31
|
+
REPO: ${{ github.event.repository.name }}
|
|
32
|
+
PR: ${{ github.event.pull_request.number }}
|
|
33
|
+
run: |
|
|
34
|
+
set -euo pipefail
|
|
35
|
+
# Check changed files to skip pure log PR merges
|
|
36
|
+
files=$(gh api "repos/$OWNER/$REPO/pulls/$PR/files" --paginate --jq '.[].filename' 2>/dev/null || echo "")
|
|
37
|
+
if [ -n "$files" ]; then
|
|
38
|
+
non_log_count=$(echo "$files" | grep -v '^\.github/prompts/logs/' | wc -l)
|
|
39
|
+
if [ "$non_log_count" -eq 0 ]; then
|
|
40
|
+
echo "Log-only PR merged — skipping autowork fire."
|
|
41
|
+
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
42
|
+
exit 0
|
|
43
|
+
fi
|
|
44
|
+
fi
|
|
45
|
+
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
46
|
+
|
|
47
|
+
- name: Checkout repository
|
|
48
|
+
if: steps.pick.outputs.skip != 'true'
|
|
49
|
+
uses: actions/checkout@v4
|
|
50
|
+
with:
|
|
51
|
+
fetch-depth: 0
|
|
52
|
+
|
|
53
|
+
- name: Setup Node.js
|
|
54
|
+
if: steps.pick.outputs.skip != 'true'
|
|
55
|
+
uses: actions/setup-node@v4
|
|
56
|
+
with:
|
|
57
|
+
node-version: 22
|
|
58
|
+
|
|
59
|
+
- name: Configure Git author identity
|
|
60
|
+
if: steps.pick.outputs.skip != 'true'
|
|
61
|
+
run: |
|
|
62
|
+
git config --global user.name "github-actions[bot]"
|
|
63
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
64
|
+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
65
|
+
|
|
66
|
+
- name: Cache Antigravity CLI
|
|
67
|
+
if: steps.pick.outputs.skip != 'true'
|
|
68
|
+
id: cache-agy
|
|
69
|
+
uses: actions/cache@v4
|
|
70
|
+
with:
|
|
71
|
+
path: ~/.local/bin/agy
|
|
72
|
+
key: agy-cli-linux-amd64-v1
|
|
73
|
+
|
|
74
|
+
- name: Install Antigravity CLI
|
|
75
|
+
if: steps.pick.outputs.skip != 'true' && steps.cache-agy.outputs.cache-hit != 'true'
|
|
76
|
+
run: |
|
|
77
|
+
curl -fsSL https://antigravity.google/cli/install.sh | bash
|
|
78
|
+
|
|
79
|
+
- name: Add Antigravity CLI to PATH
|
|
80
|
+
if: steps.pick.outputs.skip != 'true'
|
|
81
|
+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
82
|
+
|
|
83
|
+
- name: Write Antigravity OAuth Token
|
|
84
|
+
if: steps.pick.outputs.skip != 'true'
|
|
85
|
+
env:
|
|
86
|
+
ANTIGRAVITY_OAUTH_TOKEN: ${{ secrets.ANTIGRAVITY_OAUTH_TOKEN || secrets.GEMINI_API_KEY }}
|
|
87
|
+
run: |
|
|
88
|
+
if [ -z "$ANTIGRAVITY_OAUTH_TOKEN" ]; then
|
|
89
|
+
echo "::error::Neither ANTIGRAVITY_OAUTH_TOKEN nor GEMINI_API_KEY secret is set; cannot authenticate Antigravity CLI." >&2
|
|
90
|
+
exit 1
|
|
91
|
+
fi
|
|
92
|
+
mkdir -p "$HOME/.gemini/antigravity-cli"
|
|
93
|
+
chmod 700 "$HOME/.gemini/antigravity-cli"
|
|
94
|
+
printf '%s' "$ANTIGRAVITY_OAUTH_TOKEN" > "$HOME/.gemini/antigravity-cli/antigravity-oauth-token"
|
|
95
|
+
chmod 600 "$HOME/.gemini/antigravity-cli/antigravity-oauth-token"
|
|
96
|
+
|
|
97
|
+
- name: Discover domain skills
|
|
98
|
+
if: steps.pick.outputs.skip != 'true'
|
|
99
|
+
id: skills
|
|
100
|
+
run: |
|
|
101
|
+
SKILLS_PROMPT=""
|
|
102
|
+
if [ -d ".agents/skills" ]; then
|
|
103
|
+
for skill_path in .agents/skills/*/SKILL.md; do
|
|
104
|
+
if [ -f "$skill_path" ]; then
|
|
105
|
+
SKILLS_PROMPT="${SKILLS_PROMPT}Read and follow ${skill_path}. "
|
|
106
|
+
fi
|
|
107
|
+
done
|
|
108
|
+
fi
|
|
109
|
+
echo "skills_prompt=$SKILLS_PROMPT" >> "$GITHUB_OUTPUT"
|
|
110
|
+
|
|
111
|
+
- name: Run Autowork
|
|
112
|
+
if: steps.pick.outputs.skip != 'true'
|
|
113
|
+
timeout-minutes: 60
|
|
114
|
+
env:
|
|
115
|
+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
116
|
+
GOOGLE_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
117
|
+
ANTIGRAVITY_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
118
|
+
GH_TOKEN: ${{ secrets.GH_PAT || github.token }}
|
|
119
|
+
SKILLS_PROMPT: ${{ steps.skills.outputs.skills_prompt }}
|
|
120
|
+
GITHUB_SERVER_URL: ${{ github.server_url }}
|
|
121
|
+
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
122
|
+
GITHUB_RUN_ID: ${{ github.run_id }}
|
|
123
|
+
run: |
|
|
124
|
+
PROMPT="You are the Autowork routine for this repository. A PR was recently merged. Read and follow .github/prompts/autowork.md. ${SKILLS_PROMPT} You are in Scan mode: converge on open PRs, close merged issues, and pick the next unblocked priority issue."
|
|
125
|
+
|
|
126
|
+
agy -p "$PROMPT" \
|
|
127
|
+
--model gemini-3.7-flash-high \
|
|
128
|
+
--output-format text \
|
|
129
|
+
--print-timeout 60m \
|
|
130
|
+
--dangerously-skip-permissions
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
name: Trigger Review Routine
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [ready_for_review, opened, reopened, synchronize]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- '.github/prompts/logs/**'
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: review-routine-pr-${{ github.event.pull_request.number }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
trigger-routine:
|
|
15
|
+
if: >-
|
|
16
|
+
github.event.pull_request.draft == false &&
|
|
17
|
+
github.event.pull_request.head.repo.full_name == github.repository
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 60
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
actions: read
|
|
23
|
+
issues: write
|
|
24
|
+
pull-requests: write
|
|
25
|
+
statuses: write
|
|
26
|
+
steps:
|
|
27
|
+
- name: Skip if PR already merged or closed
|
|
28
|
+
id: guard
|
|
29
|
+
env:
|
|
30
|
+
GH_TOKEN: ${{ github.token }}
|
|
31
|
+
run: |
|
|
32
|
+
gh_api_retry() {
|
|
33
|
+
local endpoint="$1"
|
|
34
|
+
shift
|
|
35
|
+
local out="" err_file
|
|
36
|
+
err_file="$(mktemp)"
|
|
37
|
+
for attempt in 1 2 3 4 5; do
|
|
38
|
+
if out=$(gh api "$endpoint" "$@" 2>"$err_file"); then
|
|
39
|
+
printf '%s' "$out"
|
|
40
|
+
rm -f "$err_file"
|
|
41
|
+
return 0
|
|
42
|
+
fi
|
|
43
|
+
sleep $((attempt * 2))
|
|
44
|
+
done
|
|
45
|
+
rm -f "$err_file"
|
|
46
|
+
return 1
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if ! pr=$(gh_api_retry "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}"); then
|
|
50
|
+
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
51
|
+
exit 0
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
state=$(echo "$pr" | jq -r '.state')
|
|
55
|
+
merged=$(echo "$pr" | jq -r '.merged')
|
|
56
|
+
if [ "$state" = "closed" ] || [ "$merged" = "true" ]; then
|
|
57
|
+
echo "PR is already $state/merged=$merged — skipping review."
|
|
58
|
+
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
59
|
+
exit 0
|
|
60
|
+
fi
|
|
61
|
+
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
62
|
+
|
|
63
|
+
- name: Checkout repository
|
|
64
|
+
if: steps.guard.outputs.skip != 'true'
|
|
65
|
+
uses: actions/checkout@v4
|
|
66
|
+
with:
|
|
67
|
+
fetch-depth: 0
|
|
68
|
+
|
|
69
|
+
- name: Setup Node.js
|
|
70
|
+
if: steps.guard.outputs.skip != 'true'
|
|
71
|
+
uses: actions/setup-node@v4
|
|
72
|
+
with:
|
|
73
|
+
node-version: 22
|
|
74
|
+
|
|
75
|
+
- name: Configure Git author identity
|
|
76
|
+
if: steps.guard.outputs.skip != 'true'
|
|
77
|
+
run: |
|
|
78
|
+
git config --global user.name "github-actions[bot]"
|
|
79
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
80
|
+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
81
|
+
|
|
82
|
+
- name: Cache Antigravity CLI
|
|
83
|
+
if: steps.guard.outputs.skip != 'true'
|
|
84
|
+
id: cache-agy
|
|
85
|
+
uses: actions/cache@v4
|
|
86
|
+
with:
|
|
87
|
+
path: ~/.local/bin/agy
|
|
88
|
+
key: agy-cli-linux-amd64-v1
|
|
89
|
+
|
|
90
|
+
- name: Install Antigravity CLI
|
|
91
|
+
if: steps.guard.outputs.skip != 'true' && steps.cache-agy.outputs.cache-hit != 'true'
|
|
92
|
+
run: |
|
|
93
|
+
curl -fsSL https://antigravity.google/cli/install.sh | bash
|
|
94
|
+
|
|
95
|
+
- name: Add Antigravity CLI to PATH
|
|
96
|
+
if: steps.guard.outputs.skip != 'true'
|
|
97
|
+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
98
|
+
|
|
99
|
+
- name: Write Antigravity OAuth Token
|
|
100
|
+
if: steps.guard.outputs.skip != 'true'
|
|
101
|
+
env:
|
|
102
|
+
ANTIGRAVITY_OAUTH_TOKEN: ${{ secrets.ANTIGRAVITY_OAUTH_TOKEN || secrets.GEMINI_API_KEY }}
|
|
103
|
+
run: |
|
|
104
|
+
if [ -z "$ANTIGRAVITY_OAUTH_TOKEN" ]; then
|
|
105
|
+
echo "::error::Neither ANTIGRAVITY_OAUTH_TOKEN nor GEMINI_API_KEY secret is set; cannot authenticate Antigravity CLI." >&2
|
|
106
|
+
exit 1
|
|
107
|
+
fi
|
|
108
|
+
mkdir -p "$HOME/.gemini/antigravity-cli"
|
|
109
|
+
chmod 700 "$HOME/.gemini/antigravity-cli"
|
|
110
|
+
printf '%s' "$ANTIGRAVITY_OAUTH_TOKEN" > "$HOME/.gemini/antigravity-cli/antigravity-oauth-token"
|
|
111
|
+
chmod 600 "$HOME/.gemini/antigravity-cli/antigravity-oauth-token"
|
|
112
|
+
|
|
113
|
+
- name: Run Peer Review
|
|
114
|
+
if: steps.guard.outputs.skip != 'true'
|
|
115
|
+
timeout-minutes: 55
|
|
116
|
+
env:
|
|
117
|
+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
118
|
+
GOOGLE_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
119
|
+
ANTIGRAVITY_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
120
|
+
GH_TOKEN: ${{ secrets.GH_PAT || github.token }}
|
|
121
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
122
|
+
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
123
|
+
GITHUB_SERVER_URL: ${{ github.server_url }}
|
|
124
|
+
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
125
|
+
GITHUB_RUN_ID: ${{ github.run_id }}
|
|
126
|
+
run: |
|
|
127
|
+
PROMPT="You are the Peer Review routine for this repository. Read and follow the instructions in .github/prompts/peer-review.md exactly. Your target is pull request #${PR_NUMBER} (${PR_URL}). You are in Targeted mode: review PR #${PR_NUMBER} directly."
|
|
128
|
+
|
|
129
|
+
agy -p "$PROMPT" \
|
|
130
|
+
--model gemini-3.7-flash-high \
|
|
131
|
+
--output-format text \
|
|
132
|
+
--print-timeout 55m \
|
|
133
|
+
--dangerously-skip-permissions
|
|
134
|
+
|
|
135
|
+
- name: Emit run summary
|
|
136
|
+
if: always() && steps.guard.outputs.skip != 'true'
|
|
137
|
+
run: |
|
|
138
|
+
LATEST_LOG=$(ls -t .github/prompts/logs/peer-review/*.md 2>/dev/null | head -n 1)
|
|
139
|
+
if [ -n "$LATEST_LOG" ] && [ -n "$GITHUB_STEP_SUMMARY" ]; then
|
|
140
|
+
cat "$LATEST_LOG" >> "$GITHUB_STEP_SUMMARY"
|
|
141
|
+
fi
|