@ob1-sg/horizon 0.1.10

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.
@@ -0,0 +1,300 @@
1
+ ## Merge Mode: `auto` (choose the safest path)
2
+
3
+ You must choose **exactly one** of the following options:
4
+
5
+ - **Option A: Merge directly to `main`**
6
+ - **Option B: Create a PR for review**
7
+
8
+ ### Decision Rubric (read first)
9
+
10
+ Prefer **Option B (PR)** when:
11
+ - The changes include **significant business logic updates**
12
+ - You are **unsure** about correctness, scope, or product intent
13
+ - You had to make assumptions, or you want review for safety
14
+ - There are potential edge cases, migrations, or higher-risk changes
15
+
16
+ Prefer **Option A (direct merge)** only when:
17
+ - The changes are **small, clearly safe**, and well-understood
18
+ - All checks pass and there are no open questions
19
+
20
+ ---
21
+
22
+ # Option A: Merge directly to `main`
23
+
24
+ ## A1: Get Repository URL
25
+
26
+ Before merging, get the repository URL for Agent 3:
27
+
28
+ ```bash
29
+ git remote get-url origin
30
+ ```
31
+
32
+ Include this as `repo_url` in WORK_RESULT.
33
+
34
+ ## A2: Merge to Main
35
+
36
+ After all checks pass, merge the feature branch to main:
37
+
38
+ ```bash
39
+ # Switch to main and update
40
+ git checkout main
41
+ git pull origin main
42
+
43
+ # Attempt merge with no-ff to preserve branch history
44
+ git merge horizon/{identifier} --no-ff -m "Merge horizon/{identifier}: {issue_title}"
45
+ ```
46
+
47
+ **Handle the merge result:**
48
+
49
+ 1. **Clean merge (no conflicts)**: Push to main, delete feature branch
50
+ ```bash
51
+ git push origin main
52
+ git branch -d horizon/{identifier}
53
+ git push origin --delete horizon/{identifier}
54
+ ```
55
+ Set `merge_status: success` in WORK_RESULT.
56
+
57
+ 2. **Simple conflicts** (imports, whitespace, non-overlapping): Resolve them if obvious
58
+ - Conflicts are purely mechanical (imports, formatting)
59
+ - Changes don't overlap in business logic
60
+ - Resolution is obvious and doesn't require product decisions
61
+
62
+ After resolving:
63
+ ```bash
64
+ git add .
65
+ git commit -m "Merge horizon/{identifier}: {issue_title}"
66
+ git push origin main
67
+ git branch -d horizon/{identifier}
68
+ git push origin --delete horizon/{identifier}
69
+ ```
70
+ Set `merge_status: success` in WORK_RESULT.
71
+
72
+ 3. **Complex conflicts** (business logic, requires judgment): Abort and mark blocked
73
+ - Conflicts touch core business logic
74
+ - Multiple approaches are possible
75
+ - Resolution requires broader context
76
+
77
+ ```bash
78
+ git merge --abort
79
+ git checkout horizon/{identifier}
80
+ ```
81
+ Set `merge_status: blocked` and `merge_conflict_files: [list of files]` in WORK_RESULT.
82
+
83
+ ### WORK_RESULT (Option A)
84
+
85
+ Use this output format when you chose **Option A (direct merge)**.
86
+
87
+ After completing your work and merge succeeds:
88
+
89
+ ```
90
+ WORK_RESULT:
91
+ success: true
92
+ stage_completed: {{STAGE}}
93
+ workflow: {{WORKFLOW}}
94
+ branch_name: horizon/{identifier}
95
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
96
+ artifact_path: horizon-docs/{{ARTIFACT_DIR}}/YYYY-MM-DD-{identifier}-{slug}.md
97
+ commit_hash: {merge commit hash on main}
98
+ merge_status: success
99
+ next_status: "∞ Done"
100
+ summary: |
101
+ {Brief description of what was done}
102
+ Files changed: {list}
103
+ All checks pass. Merged to main.
104
+ ```
105
+
106
+ If work completes but merge is blocked:
107
+
108
+ ```
109
+ WORK_RESULT:
110
+ success: true
111
+ stage_completed: {{STAGE}}
112
+ workflow: {{WORKFLOW}}
113
+ branch_name: horizon/{identifier}
114
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
115
+ artifact_path: horizon-docs/{{ARTIFACT_DIR}}/YYYY-MM-DD-{identifier}-{slug}.md
116
+ commit_hash: {short hash on feature branch}
117
+ merge_status: blocked
118
+ merge_conflict_files: [file1.ts, file2.ts]
119
+ next_status: "∞ Blocked"
120
+ summary: |
121
+ {Brief description of what was done}
122
+ Merge conflicts require human resolution.
123
+ Conflicts in: {list of files}
124
+ ```
125
+
126
+ If you encounter an error:
127
+
128
+ ```
129
+ WORK_RESULT:
130
+ success: false
131
+ stage_completed: {{STAGE}}
132
+ workflow: {{WORKFLOW}}
133
+ branch_name: horizon/{identifier}
134
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
135
+ error: |
136
+ {What went wrong and why it couldn't be fixed}
137
+ ```
138
+
139
+ ---
140
+
141
+ # Option B: Create PR for review
142
+
143
+ ## B1: Get Repository URL
144
+
145
+ Before creating the PR, get the repository URL:
146
+
147
+ ```bash
148
+ git remote get-url origin
149
+ ```
150
+
151
+ Include this as `repo_url` in WORK_RESULT.
152
+
153
+ ## B2: Create PR Description Document
154
+
155
+ Before creating the PR, write a comprehensive PR description document to `horizon-docs/prs/{identifier}.md`:
156
+
157
+ ```markdown
158
+ # PR: {issue_identifier} - {issue_title}
159
+
160
+ **Branch**: `horizon/{identifier}`
161
+ **Linear Issue**: {issue_identifier}
162
+ **Date**: {YYYY-MM-DD}
163
+
164
+ ## Summary
165
+
166
+ {2-3 sentence description of what this PR accomplishes and why}
167
+
168
+ ## Problem
169
+
170
+ {What problem does this solve? What was the user pain point or technical need?}
171
+
172
+ ## Solution
173
+
174
+ {How does this PR solve the problem? Describe the approach taken.}
175
+
176
+ ## Changes
177
+
178
+ {List the key changes made, organized by category if helpful}
179
+
180
+ ### Files Changed
181
+ - `path/to/file.ts` - {brief description of change}
182
+ - `path/to/other.ts` - {brief description of change}
183
+
184
+ ## Testing
185
+
186
+ {How were the changes verified?}
187
+
188
+ ### Automated
189
+ - [ ] Tests pass (`npm test`)
190
+ - [ ] TypeScript compiles (`npm run typecheck`)
191
+ - [ ] Lint passes (`npm run lint`)
192
+
193
+ ### Manual Verification
194
+ {Any manual testing performed or recommended}
195
+
196
+ ## Breaking Changes
197
+
198
+ {List any breaking changes, or "None" if backward compatible}
199
+
200
+ ## Migration Notes
201
+
202
+ {Any steps needed for users upgrading, or "None" if not applicable}
203
+
204
+ ## Screenshots
205
+
206
+ {If UI changes, include before/after screenshots, or "N/A" for non-UI changes}
207
+
208
+ ---
209
+ 🤖 Created by [Horizon](https://github.com/ob1-sg/horizon) with {{PROVIDER_LINK}}
210
+ ```
211
+
212
+ Commit and push this document:
213
+ ```bash
214
+ git add horizon-docs/prs/
215
+ git commit -m "docs({identifier}): add PR description"
216
+ git push origin horizon/{identifier}
217
+ ```
218
+
219
+ ## B3: Create Pull Request
220
+
221
+ Create the pull request using the description document:
222
+
223
+ ```bash
224
+ # Create the pull request with the description file
225
+ gh pr create \
226
+ --title "{issue_identifier}: {issue_title}" \
227
+ --body-file horizon-docs/prs/{identifier}.md \
228
+ --base main \
229
+ --head horizon/{identifier}
230
+ ```
231
+
232
+ Replace the placeholders:
233
+ - `{issue_identifier}`: The issue ID (e.g., RSK-123)
234
+ - `{issue_title}`: The issue title
235
+ - `{identifier}`: The issue identifier for branch naming
236
+
237
+ **Handle the PR creation result:**
238
+
239
+ 1. **PR created successfully**: Capture the PR URL from the output
240
+ Set `merge_status: pr_created` and `pr_url: {URL}` in WORK_RESULT.
241
+
242
+ 2. **PR creation failed**: Include the error
243
+ Set `merge_status: pr_failed` and include error details in WORK_RESULT.
244
+
245
+ ### WORK_RESULT (Option B)
246
+
247
+ Use this output format when you chose **Option B (PR)**.
248
+
249
+ After completing your work and PR is created:
250
+
251
+ ```
252
+ WORK_RESULT:
253
+ success: true
254
+ stage_completed: {{STAGE}}
255
+ workflow: {{WORKFLOW}}
256
+ branch_name: horizon/{identifier}
257
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
258
+ artifact_path: horizon-docs/{{ARTIFACT_DIR}}/YYYY-MM-DD-{identifier}-{slug}.md
259
+ pr_description_path: horizon-docs/prs/{identifier}.md
260
+ commit_hash: {short hash on feature branch}
261
+ merge_status: pr_created
262
+ pr_url: {GitHub PR URL}
263
+ next_status: "∞ Awaiting Merge"
264
+ summary: |
265
+ {Brief description of what was done}
266
+ Files changed: {list}
267
+ All checks pass. PR created for review.
268
+ PR: {pr_url}
269
+ ```
270
+
271
+ If PR creation fails:
272
+
273
+ ```
274
+ WORK_RESULT:
275
+ success: true
276
+ stage_completed: {{STAGE}}
277
+ workflow: {{WORKFLOW}}
278
+ branch_name: horizon/{identifier}
279
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
280
+ artifact_path: horizon-docs/{{ARTIFACT_DIR}}/YYYY-MM-DD-{identifier}-{slug}.md
281
+ commit_hash: {short hash on feature branch}
282
+ merge_status: pr_failed
283
+ next_status: "∞ Blocked"
284
+ summary: |
285
+ {Brief description of what was done}
286
+ PR creation failed: {error message}
287
+ ```
288
+
289
+ If you encounter an error during implementation:
290
+
291
+ ```
292
+ WORK_RESULT:
293
+ success: false
294
+ stage_completed: {{STAGE}}
295
+ workflow: {{WORKFLOW}}
296
+ branch_name: horizon/{identifier}
297
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
298
+ error: |
299
+ {What went wrong and why it couldn't be fixed}
300
+ ```
@@ -0,0 +1,112 @@
1
+ ### Step 7: Get Repository URL
2
+
3
+ Before merging, get the repository URL for Agent 3:
4
+
5
+ ```bash
6
+ git remote get-url origin
7
+ ```
8
+
9
+ Include this as `repo_url` in WORK_RESULT.
10
+
11
+ ### Step 8: Merge to Main
12
+
13
+ After all checks pass, merge the feature branch to main:
14
+
15
+ ```bash
16
+ # Switch to main and update
17
+ git checkout main
18
+ git pull origin main
19
+
20
+ # Attempt merge with no-ff to preserve branch history
21
+ git merge horizon/{identifier} --no-ff -m "Merge horizon/{identifier}: {issue_title}"
22
+ ```
23
+
24
+ **Handle the merge result:**
25
+
26
+ 1. **Clean merge (no conflicts)**: Push to main, delete feature branch
27
+ ```bash
28
+ git push origin main
29
+ git branch -d horizon/{identifier}
30
+ git push origin --delete horizon/{identifier}
31
+ ```
32
+ Set `merge_status: success` in WORK_RESULT.
33
+
34
+ 2. **Simple conflicts** (imports, whitespace, non-overlapping): Resolve them if obvious
35
+ - Conflicts are purely mechanical (imports, formatting)
36
+ - Changes don't overlap in business logic
37
+ - Resolution is obvious and doesn't require product decisions
38
+
39
+ After resolving:
40
+ ```bash
41
+ git add .
42
+ git commit -m "Merge horizon/{identifier}: {issue_title}"
43
+ git push origin main
44
+ git branch -d horizon/{identifier}
45
+ git push origin --delete horizon/{identifier}
46
+ ```
47
+ Set `merge_status: success` in WORK_RESULT.
48
+
49
+ 3. **Complex conflicts** (business logic, requires judgment): Abort and mark blocked
50
+ - Conflicts touch core business logic
51
+ - Multiple approaches are possible
52
+ - Resolution requires broader context
53
+
54
+ ```bash
55
+ git merge --abort
56
+ git checkout horizon/{identifier}
57
+ ```
58
+ Set `merge_status: blocked` and `merge_conflict_files: [list of files]` in WORK_RESULT.
59
+
60
+ ## Output Format
61
+
62
+ After completing your work and merge succeeds:
63
+
64
+ ```
65
+ WORK_RESULT:
66
+ success: true
67
+ stage_completed: {{STAGE}}
68
+ workflow: {{WORKFLOW}}
69
+ branch_name: horizon/{identifier}
70
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
71
+ artifact_path: horizon-docs/{{ARTIFACT_DIR}}/YYYY-MM-DD-{identifier}-{slug}.md
72
+ commit_hash: {merge commit hash on main}
73
+ merge_status: success
74
+ next_status: "∞ Done"
75
+ summary: |
76
+ {Brief description of what was done}
77
+ Files changed: {list}
78
+ All checks pass. Merged to main.
79
+ ```
80
+
81
+ If work completes but merge is blocked:
82
+
83
+ ```
84
+ WORK_RESULT:
85
+ success: true
86
+ stage_completed: {{STAGE}}
87
+ workflow: {{WORKFLOW}}
88
+ branch_name: horizon/{identifier}
89
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
90
+ artifact_path: horizon-docs/{{ARTIFACT_DIR}}/YYYY-MM-DD-{identifier}-{slug}.md
91
+ commit_hash: {short hash on feature branch}
92
+ merge_status: blocked
93
+ merge_conflict_files: [file1.ts, file2.ts]
94
+ next_status: "∞ Blocked"
95
+ summary: |
96
+ {Brief description of what was done}
97
+ Merge conflicts require human resolution.
98
+ Conflicts in: {list of files}
99
+ ```
100
+
101
+ If you encounter an error:
102
+
103
+ ```
104
+ WORK_RESULT:
105
+ success: false
106
+ stage_completed: {{STAGE}}
107
+ workflow: {{WORKFLOW}}
108
+ branch_name: horizon/{identifier}
109
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
110
+ error: |
111
+ {What went wrong and why it couldn't be fixed}
112
+ ```
@@ -0,0 +1,156 @@
1
+ ### Step 7: Get Repository URL
2
+
3
+ Before creating the PR, get the repository URL:
4
+
5
+ ```bash
6
+ git remote get-url origin
7
+ ```
8
+
9
+ Include this as `repo_url` in WORK_RESULT.
10
+
11
+ ### Step 8: Create PR Description Document
12
+
13
+ Before creating the PR, write a comprehensive PR description document to `horizon-docs/prs/{identifier}.md`:
14
+
15
+ ```markdown
16
+ # PR: {issue_identifier} - {issue_title}
17
+
18
+ **Branch**: `horizon/{identifier}`
19
+ **Linear Issue**: {issue_identifier}
20
+ **Date**: {YYYY-MM-DD}
21
+
22
+ ## Summary
23
+
24
+ {2-3 sentence description of what this PR accomplishes and why}
25
+
26
+ ## Problem
27
+
28
+ {What problem does this solve? What was the user pain point or technical need?}
29
+
30
+ ## Solution
31
+
32
+ {How does this PR solve the problem? Describe the approach taken.}
33
+
34
+ ## Changes
35
+
36
+ {List the key changes made, organized by category if helpful}
37
+
38
+ ### Files Changed
39
+ - `path/to/file.ts` - {brief description of change}
40
+ - `path/to/other.ts` - {brief description of change}
41
+
42
+ ## Testing
43
+
44
+ {How were the changes verified?}
45
+
46
+ ### Automated
47
+ - [ ] Tests pass (`npm test`)
48
+ - [ ] TypeScript compiles (`npm run typecheck`)
49
+ - [ ] Lint passes (`npm run lint`)
50
+
51
+ ### Manual Verification
52
+ {Any manual testing performed or recommended}
53
+
54
+ ## Breaking Changes
55
+
56
+ {List any breaking changes, or "None" if backward compatible}
57
+
58
+ ## Migration Notes
59
+
60
+ {Any steps needed for users upgrading, or "None" if not applicable}
61
+
62
+ ## Screenshots
63
+
64
+ {If UI changes, include before/after screenshots, or "N/A" for non-UI changes}
65
+
66
+ ---
67
+ 🤖 Created by [Horizon](https://github.com/ob1-sg/horizon) with {{PROVIDER_LINK}}
68
+ ```
69
+
70
+ Commit and push this document:
71
+ ```bash
72
+ git add horizon-docs/prs/
73
+ git commit -m "docs({identifier}): add PR description"
74
+ git push origin horizon/{identifier}
75
+ ```
76
+
77
+ ### Step 9: Create Pull Request
78
+
79
+ Create the pull request using the description document:
80
+
81
+ ```bash
82
+ # Create the pull request with the description file
83
+ gh pr create \
84
+ --title "{issue_identifier}: {issue_title}" \
85
+ --body-file horizon-docs/prs/{identifier}.md \
86
+ --base main \
87
+ --head horizon/{identifier}
88
+ ```
89
+
90
+ Replace the placeholders:
91
+ - `{issue_identifier}`: The issue ID (e.g., RSK-123)
92
+ - `{issue_title}`: The issue title
93
+ - `{identifier}`: The issue identifier for branch naming
94
+
95
+ **Handle the PR creation result:**
96
+
97
+ 1. **PR created successfully**: Capture the PR URL from the output
98
+ Set `merge_status: pr_created` and `pr_url: {URL}` in WORK_RESULT.
99
+
100
+ 2. **PR creation failed**: Include the error
101
+ Set `merge_status: pr_failed` and include error details in WORK_RESULT.
102
+
103
+ ## Output Format
104
+
105
+ After completing your work and PR is created:
106
+
107
+ ```
108
+ WORK_RESULT:
109
+ success: true
110
+ stage_completed: {{STAGE}}
111
+ workflow: {{WORKFLOW}}
112
+ branch_name: horizon/{identifier}
113
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
114
+ artifact_path: horizon-docs/{{ARTIFACT_DIR}}/YYYY-MM-DD-{identifier}-{slug}.md
115
+ pr_description_path: horizon-docs/prs/{identifier}.md
116
+ commit_hash: {short hash on feature branch}
117
+ merge_status: pr_created
118
+ pr_url: {GitHub PR URL}
119
+ next_status: "∞ Awaiting Merge"
120
+ summary: |
121
+ {Brief description of what was done}
122
+ Files changed: {list}
123
+ All checks pass. PR created for review.
124
+ PR: {pr_url}
125
+ ```
126
+
127
+ If PR creation fails:
128
+
129
+ ```
130
+ WORK_RESULT:
131
+ success: true
132
+ stage_completed: {{STAGE}}
133
+ workflow: {{WORKFLOW}}
134
+ branch_name: horizon/{identifier}
135
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
136
+ artifact_path: horizon-docs/{{ARTIFACT_DIR}}/YYYY-MM-DD-{identifier}-{slug}.md
137
+ commit_hash: {short hash on feature branch}
138
+ merge_status: pr_failed
139
+ next_status: "∞ Blocked"
140
+ summary: |
141
+ {Brief description of what was done}
142
+ PR creation failed: {error message}
143
+ ```
144
+
145
+ If you encounter an error during implementation:
146
+
147
+ ```
148
+ WORK_RESULT:
149
+ success: false
150
+ stage_completed: {{STAGE}}
151
+ workflow: {{WORKFLOW}}
152
+ branch_name: horizon/{identifier}
153
+ repo_url: {git remote URL, e.g., https://github.com/owner/repo.git}
154
+ error: |
155
+ {What went wrong and why it couldn't be fixed}
156
+ ```