hatch3r 1.7.0 → 1.7.1
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.md +2 -2
- package/agents/hatch3r-architect.md +1 -1
- package/agents/hatch3r-fixer.md +1 -1
- package/agents/hatch3r-implementer.md +1 -1
- package/agents/hatch3r-researcher.md +1 -1
- package/agents/modes/requirements-elicitation.md +1 -0
- package/agents/shared/quality-charter.md +1 -0
- package/agents/shared/user-question-protocol.md +95 -0
- package/commands/board/shared-azure-devops.md +2 -0
- package/commands/board/shared-github.md +17 -0
- package/commands/board/shared-gitlab.md +4 -0
- package/commands/hatch3r-board-fill.md +1 -1
- package/commands/hatch3r-board-pickup.md +1 -1
- package/commands/hatch3r-board-shared.md +21 -0
- package/commands/hatch3r-pr-resolve.md +668 -0
- package/commands/hatch3r-quick-change.md +1 -1
- package/commands/hatch3r-report.md +167 -0
- package/commands/hatch3r-revision.md +1 -1
- package/commands/hatch3r-workflow.md +1 -1
- package/dist/cli/index.js +951 -647
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
- package/rules/hatch3r-agent-orchestration.md +23 -0
- package/rules/hatch3r-agent-orchestration.mdc +23 -0
- package/rules/hatch3r-deep-context.md +1 -1
- package/rules/hatch3r-deep-context.mdc +1 -1
- package/rules/hatch3r-iteration-summary.md +2 -0
- package/rules/hatch3r-iteration-summary.mdc +2 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Crack the egg. Hatch better agents.**
|
|
6
6
|
|
|
7
|
-
hatch3r is an open-source CLI and Cursor plugin that installs a battle-tested, tool-agnostic agentic coding setup into any repository. Ship Ready as of Cycle 8 (audit score 83.74/100, 0 Critical findings, 15 platform adapters wired, 20-domain governance audit cycle operational). One command gives you up to 17 agents, 26 skills, 28 rules,
|
|
7
|
+
hatch3r is an open-source CLI and Cursor plugin that installs a battle-tested, tool-agnostic agentic coding setup into any repository. Ship Ready as of Cycle 8 (audit score 83.74/100, 0 Critical findings, 15 platform adapters wired, 20-domain governance audit cycle operational). One command gives you up to 17 agents, 26 skills, 28 rules, 37 commands, and MCP integrations -- optimized for your coding tool of choice. Selective init installs only what you need based on your project type and team size. (Authoritative counts: [`governance/inventory.json`](governance/inventory.json), regenerated by `npm run inventory`.)
|
|
8
8
|
|
|
9
9
|
## Quick Start
|
|
10
10
|
|
|
@@ -23,7 +23,7 @@ That's it. hatch3r detects your repo, asks about your project context (greenfiel
|
|
|
23
23
|
| **Agents** | 17 | Code reviewer, test writer, security auditor, implementer (sub-agentic), fixer, researcher, architect, DevOps, and more |
|
|
24
24
|
| **Skills** | 26 | Bug fix, feature implementation, issue workflow, release, incident response, context health, cost tracking, recipes, API spec, CI pipeline, migration, customization, and more |
|
|
25
25
|
| **Rules** | 28 | Code standards, testing, API design, observability, theming, i18n, security patterns, agent orchestration, deep context analysis, and more |
|
|
26
|
-
| **Commands** |
|
|
26
|
+
| **Commands** | 37 | Board management, planning (feature, bug, refactor, test), workflow, quick-change, revision, debug, healthcheck, security-audit, cost-tracking, onboard, benchmark, customization, and more |
|
|
27
27
|
| **MCP Servers** | 10 (3 default + 7 opt-in) | Playwright, Context7, Filesystem (default); GitHub, Brave Search, Sentry, Postgres, Linear, Azure DevOps, GitLab (opt-in) |
|
|
28
28
|
| **Platforms** | 3 | GitHub, Azure DevOps, GitLab -- auto-detected from git remote |
|
|
29
29
|
|
|
@@ -159,7 +159,7 @@ When designing architecture for new modules or services, include error handling
|
|
|
159
159
|
## Boundaries
|
|
160
160
|
|
|
161
161
|
- **Always:** Document decisions in ADRs, evaluate at least 2 alternatives, align with existing patterns, consider migration paths, include error handling in architectural designs
|
|
162
|
-
- **Ask first:** Before proposing architecture that diverges significantly from existing patterns, before introducing new infrastructure dependencies
|
|
162
|
+
- **Ask first:** Before proposing architecture that diverges significantly from existing patterns, before introducing new infrastructure dependencies. When surfacing a question to the user, follow `agents/shared/user-question-protocol.md` (native tool preferred; structured plain-text fallback).
|
|
163
163
|
- **Never:** Make implementation changes (architecture only), skip trade-off analysis, propose solutions without migration paths from current state
|
|
164
164
|
|
|
165
165
|
## Example
|
package/agents/hatch3r-fixer.md
CHANGED
|
@@ -185,7 +185,7 @@ When producing fix results, be aware that a PARTIAL status with unresolved findi
|
|
|
185
185
|
## Boundaries
|
|
186
186
|
|
|
187
187
|
- **Always:** Fix only Critical and Warning findings, verify quality gates pass, keep changes minimal and targeted, follow the tooling hierarchy (platform CLI > platform MCP, Context7 for libraries, web research for current info)
|
|
188
|
-
- **Ask first:** If a finding is ambiguous or the suggested fix would conflict with acceptance criteria, report BLOCKED with details
|
|
188
|
+
- **Ask first:** If a finding is ambiguous or the suggested fix would conflict with acceptance criteria, report BLOCKED with details. When surfacing a question to the user, follow `agents/shared/user-question-protocol.md` (native tool preferred; structured plain-text fallback).
|
|
189
189
|
- **Never:** Create branches, commits, or PRs. Modify board status. Expand scope beyond reviewer findings. Auto-fix Suggestion items. Skip verification.
|
|
190
190
|
|
|
191
191
|
</rules>
|
|
@@ -229,7 +229,7 @@ When encountering errors during implementation, follow these protocols:
|
|
|
229
229
|
## Boundaries
|
|
230
230
|
|
|
231
231
|
- **Always:** Stay within acceptance criteria, write tests, verify quality gates, use stable IDs, follow the tooling hierarchy (platform CLI > platform MCP, Context7 for libraries, web research for current info)
|
|
232
|
-
- **Ask first:** If acceptance criteria are contradictory or unclear, report BLOCKED with details
|
|
232
|
+
- **Ask first:** If acceptance criteria are contradictory or unclear, report BLOCKED with details. When surfacing a question to the user, follow `agents/shared/user-question-protocol.md` (native tool preferred; structured plain-text fallback).
|
|
233
233
|
- **Never:** Create branches, commits, or PRs. Modify board status. Expand scope beyond the issue. Skip tests. Weaken security rules.
|
|
234
234
|
|
|
235
235
|
</rules>
|
|
@@ -170,7 +170,7 @@ Every finding must include:
|
|
|
170
170
|
## Boundaries
|
|
171
171
|
|
|
172
172
|
- **Always:** Follow the tooling hierarchy (project docs -> codebase -> Context7 -> web research). Use the platform CLI (check `platform` in `.agents/hatch.json`). Stay within the research brief's scope. Produce structured output matching the mode's specification. Report BLOCKED if the brief is ambiguous or contradictory.
|
|
173
|
-
- **Ask first:** If the brief's scope is unclear, if contradictions are found between sources, or if critical context is missing.
|
|
173
|
+
- **Ask first:** If the brief's scope is unclear, if contradictions are found between sources, or if critical context is missing. When surfacing a question to the user, follow `agents/shared/user-question-protocol.md` (native tool preferred; structured plain-text fallback).
|
|
174
174
|
- **Never:** Create files. Modify code. Create branches, commits, or PRs. Modify board status. Expand scope beyond the research brief. Invent findings not supported by evidence.
|
|
175
175
|
|
|
176
176
|
</rules>
|
|
@@ -15,6 +15,7 @@ Analyze the task description against the codebase to detect ambiguities, unstate
|
|
|
15
15
|
|
|
16
16
|
**Protocol:**
|
|
17
17
|
|
|
18
|
+
0. Render each elicited question per the format in `agents/shared/user-question-protocol.md` (native tool preferred; structured plain-text fallback otherwise).
|
|
18
19
|
1. Parse the task description for vague language ("improve", "better", "proper", "handle", "support", "clean up", "fix", "update") and flag each instance.
|
|
19
20
|
2. Identify unstated assumptions by comparing the task against the codebase structure — what does the task imply but not state explicitly?
|
|
20
21
|
3. For each of the 10 dimensions below, determine if the task description addresses it. If not, generate a targeted question.
|
|
@@ -38,6 +38,7 @@ Before building anything, verify that the requirements are clear and well-founde
|
|
|
38
38
|
- If a requirement is ambiguous, ask for clarification rather than guessing.
|
|
39
39
|
- If a requirement seems misguided (solving the wrong problem, using an inappropriate pattern), raise the concern before implementing. Building the wrong thing well is worse than asking a clarifying question.
|
|
40
40
|
- Frame challenges constructively: "Before I implement this, I want to confirm the approach because [specific concern]."
|
|
41
|
+
- When asking, use the platform-native question tool documented in `agents/shared/user-question-protocol.md` rather than free-form prose.
|
|
41
42
|
|
|
42
43
|
### 4. Report Root Causes
|
|
43
44
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: shared-user-question-protocol
|
|
3
|
+
type: reference
|
|
4
|
+
description: Protocol for how hatch3r agents and commands ask the user clarifying questions — when to ask, native-tool preference, and a plain-text fallback shape.
|
|
5
|
+
tags: [shared, ux, p1, p4]
|
|
6
|
+
cache_friendly: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
This protocol defines how hatch3r agents and commands surface clarifying or triage questions to the user across the 15 supported AI coding platforms. It is the single source of truth for the *how* of asking; the *whether* is governed by [quality-charter §3 "Question Unclear Requirements"](./quality-charter.md) and §8 "Escalate Ambiguity Early". Files that reference this protocol: the requirements-elicitation mode (`agents/modes/requirements-elicitation.md`), the five ASK-checkpoint commands, and the four ask-prone agents — researcher, fixer, architect, implementer.
|
|
12
|
+
|
|
13
|
+
## When To Ask
|
|
14
|
+
|
|
15
|
+
- **Ambiguous requirement** — the request maps to two or more reasonable interpretations that produce different code.
|
|
16
|
+
- **Irreversible decision** — deleting data, renaming a public API, dropping a column, force-pushing a branch.
|
|
17
|
+
- **Branching path** — two or more viable approaches with materially different cost, scope, or risk.
|
|
18
|
+
- **Conflicting constraints** — requirements that cannot all hold (e.g., "no new dependencies" and "use library X").
|
|
19
|
+
- **Missing acceptance criteria** — no testable definition of done for the requested change.
|
|
20
|
+
|
|
21
|
+
## When NOT To Ask
|
|
22
|
+
|
|
23
|
+
- The user already decided scope in this turn or an earlier turn of the same session.
|
|
24
|
+
- You are in free-text discussion, planning, or a status update — questions belong inside actionable workflows.
|
|
25
|
+
- The answer is verifiable by reading code, running a test, or grepping the repo — verify first, ask only if verification fails.
|
|
26
|
+
- The choice is reversible, low-stakes, and the safer default is obvious — pick the default and note it.
|
|
27
|
+
|
|
28
|
+
## How To Ask
|
|
29
|
+
|
|
30
|
+
1. Check whether your target platform exposes a native question or triage tool (see Platform-Native Tool below).
|
|
31
|
+
2. If yes, use the native tool — it produces better UX than free-text replies and is structured for the host runtime.
|
|
32
|
+
3. If no native tool exists on this platform, use the Plain-Text Fallback Template.
|
|
33
|
+
4. Ask at most one question per turn. Bundle related sub-questions into a single multiple-choice prompt rather than firing multiple turns.
|
|
34
|
+
|
|
35
|
+
## Platform-Native Tool
|
|
36
|
+
|
|
37
|
+
The marker below is replaced at canonical-write time with the enumeration table generated from `src/pipeline/adapterToolTranslator.ts::ASK_USER_TOOLS`. Look up your runtime platform and follow its row. If your platform's row reads "No documented native tool", use the Plain-Text Fallback Template defined in the next section.
|
|
38
|
+
|
|
39
|
+
<!-- HATCH3R:PLATFORM-TOOL -->
|
|
40
|
+
|
|
41
|
+
When viewing this file in the source repo (pre-generation), the marker is unsubstituted — refer to the adapter map in `src/pipeline/adapterToolTranslator.ts` for the same mappings.
|
|
42
|
+
|
|
43
|
+
## Plain-Text Fallback Template
|
|
44
|
+
|
|
45
|
+
Use this exact shape when no native tool is available:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
**Question:** <one-sentence question stating the choice>
|
|
49
|
+
|
|
50
|
+
1. <Option A> — <one-line rationale or trade-off>
|
|
51
|
+
2. <Option B> — <one-line rationale or trade-off>
|
|
52
|
+
3. <Option C> — <one-line rationale or trade-off>
|
|
53
|
+
|
|
54
|
+
Default if no response: <option number, e.g., 2>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Rules for the template:
|
|
58
|
+
|
|
59
|
+
- Two to four numbered options. One option is too few; five or more signals you have not narrowed the design.
|
|
60
|
+
- Each option carries a one-line trade-off so the user can pick without re-deriving the problem.
|
|
61
|
+
- The default-if-no-response line is mandatory — it removes the deadlock when the user is away or replies "you decide".
|
|
62
|
+
- The default option is the safest reversible choice, not the most ambitious one.
|
|
63
|
+
|
|
64
|
+
## Examples
|
|
65
|
+
|
|
66
|
+
**Example 1 — Ambiguous requirement.** Request: "Add caching to the user profile endpoint."
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
**Question:** Which cache scope matches your needs for the profile endpoint?
|
|
70
|
+
|
|
71
|
+
1. Per-user, 60s TTL — fastest response, stale data tolerated up to 60s.
|
|
72
|
+
2. Per-user, write-through invalidation — fresh data, +1 cache write per profile update.
|
|
73
|
+
3. Edge cache only — no app changes, but TTL is fixed by the CDN config.
|
|
74
|
+
|
|
75
|
+
Default if no response: 2
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Example 2 — Branching path.** Request: "Migrate the build to Vite."
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
**Question:** Should the Vite migration land in one PR or staged behind a feature flag?
|
|
82
|
+
|
|
83
|
+
1. Single PR — shorter total time, larger blast radius if a regression ships.
|
|
84
|
+
2. Staged with VITE_BUILD flag — two PRs, lets you A/B locally before flipping.
|
|
85
|
+
|
|
86
|
+
Default if no response: 2
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Anti-Patterns
|
|
90
|
+
|
|
91
|
+
- **Multi-question barrage** — asking five questions in one turn. Ask the highest-leverage one first; the answer often collapses the rest.
|
|
92
|
+
- **Options-free questions** — "What should I do?" forces the user to design the prompt. Always supply 2–4 candidate options with trade-offs.
|
|
93
|
+
- **Silent assumption** — proceeding when ambiguity is real. Apply quality-charter §8: log the ambiguity in structured output even if you decide to proceed under a default.
|
|
94
|
+
- **Echo-as-question** — restating the user's request back as a question ("So you want me to add caching?"). Confirm only when you have a specific decision point with options to offer.
|
|
95
|
+
- **Inflated default** — choosing the most disruptive option as the no-response default. Defaults must be the reversible, lowest-blast-radius choice.
|
|
@@ -156,6 +156,8 @@ After linking, verify via `az boards work-item relation list --id {epic}` and ch
|
|
|
156
156
|
| Add comments | `az boards work-item update --id N --discussion "..."` | N/A |
|
|
157
157
|
| Create PRs | `az repos pr create --title "..." --source-branch "..." --target-branch "..."` | `create_pull_request` |
|
|
158
158
|
| Read PR details | `az repos pr show --id N` | N/A |
|
|
159
|
+
| Read PR comment threads | `az rest -m GET --url 'https://dev.azure.com/{org}/{project}/_apis/git/repositories/{repo}/pullRequests/{N}/threads?api-version=7.1-preview.1'` | N/A |
|
|
160
|
+
| Reply to PR thread | `az rest -m POST --url '.../pullRequests/{N}/threads/{threadId}/comments?api-version=7.1-preview.1' --body '{"parentCommentId":1,"content":"...","commentType":"text"}'` | N/A |
|
|
159
161
|
| Manage tags | `az boards work-item update --id N --fields "System.Tags=tag1; tag2"` | N/A |
|
|
160
162
|
| Board sync | Work Item State updates (automatic board placement) | N/A |
|
|
161
163
|
| CI/Pipelines | `az pipelines run list` / `az pipelines run show` | N/A |
|
|
@@ -166,9 +166,26 @@ After linking, verify via `issue_read` with `method: get_sub_issues` on the pare
|
|
|
166
166
|
| Add comments | `gh issue comment` | `add_issue_comment` |
|
|
167
167
|
| Create PRs | `gh pr create` | `create_pull_request` |
|
|
168
168
|
| Read PR details | `gh pr view` | `pull_request_read` |
|
|
169
|
+
| Read PR inline comments | `gh api repos/{owner}/{repo}/pulls/{N}/comments --paginate` | `pull_request_read` |
|
|
170
|
+
| Read PR review summaries | `gh api repos/{owner}/{repo}/pulls/{N}/reviews --paginate` | `pull_request_read` |
|
|
171
|
+
| Read PR discussion | `gh api repos/{owner}/{repo}/issues/{N}/comments --paginate` | `pull_request_read` |
|
|
172
|
+
| Read PR thread resolution | `gh api graphql -f query='{repository(owner:"o",name:"r"){pullRequest(number:N){reviewThreads(first:100){nodes{id,isResolved}}}}}'` | N/A |
|
|
173
|
+
| Reply to inline comment | `gh api repos/{owner}/{repo}/pulls/{N}/comments -X POST -F in_reply_to={comment_id} -f body=@{file}` | N/A |
|
|
174
|
+
| Comment on PR thread | `gh api repos/{owner}/{repo}/issues/{N}/comments -X POST -f body=@{file}` | `add_issue_comment` |
|
|
169
175
|
| Manage labels | `gh label create` / `gh label list` | `issue_write` (with labels) |
|
|
170
176
|
| Projects v2 | `gh project item-add`, `gh project item-edit`, `gh project item-list`, `gh project field-list`, `gh project view` | `projects_write` / `projects_get` / `projects_list` |
|
|
171
177
|
| CI/Actions | `gh run list` / `gh run view` | N/A |
|
|
172
178
|
| Releases | `gh release create` | N/A |
|
|
173
179
|
|
|
174
180
|
Fallback to MCP only for operations the `gh` CLI cannot handle: sub-issue management (`sub_issue_write`).
|
|
181
|
+
|
|
182
|
+
### GitHub CLI Field-Typing Notes
|
|
183
|
+
|
|
184
|
+
`gh api` field flags differ by type. Pass the wrong one and the GitHub REST API returns `HTTP 422: not of type {integer|boolean}`.
|
|
185
|
+
|
|
186
|
+
| Flag | Type sent | Use for |
|
|
187
|
+
|------|-----------|---------|
|
|
188
|
+
| `-f key=value` | string (URL-encoded form) | `body`, `title`, `commit_message`, `query`, `state`, `event` |
|
|
189
|
+
| `-F key=value` | integer / boolean (auto-typed) — also `@file` for file contents | numeric IDs: `sub_issue_id`, `in_reply_to`, `parent_issue_id`, `issue_number`, `pull_number`, `team_id`, `user_id`, `milestone_number`; booleans: `draft`, `merged`, `auto_merge` |
|
|
190
|
+
|
|
191
|
+
Sub-issue linking via `POST /repos/{owner}/{repo}/issues/{N}/sub_issues` requires `-F sub_issue_id={child_numeric_id}` — `-f` returns 422. When the `sub_issue_write` MCP is unavailable, write the hand-rolled `gh api` call with `-F`, never `-f`. The same rule applies to PR review-reply (`in_reply_to`), milestone assignment (`milestone_number`), and team membership (`team_id` / `user_id`).
|
|
@@ -146,6 +146,10 @@ After linking, verify via `glab api projects/{project_id}/issues/{epic_iid}/link
|
|
|
146
146
|
| Add comments | `glab issue note N -R {namespace}/{project}` | N/A |
|
|
147
147
|
| Create MRs | `glab mr create -R {namespace}/{project}` | N/A |
|
|
148
148
|
| Read MR details | `glab mr view N -R {namespace}/{project}` | N/A |
|
|
149
|
+
| Read MR discussions | `glab api '/projects/{project_id}/merge_requests/{iid}/discussions?per_page=100' --paginate` | N/A |
|
|
150
|
+
| Read MR notes | `glab api '/projects/{project_id}/merge_requests/{iid}/notes?per_page=100' --paginate` | N/A |
|
|
151
|
+
| Reply to discussion | `glab api '/projects/{project_id}/merge_requests/{iid}/discussions/{discussion_id}/notes' -X POST -f body=@{file}` | N/A |
|
|
152
|
+
| Add MR note | `glab api '/projects/{project_id}/merge_requests/{iid}/notes' -X POST -f body=@{file}` | N/A |
|
|
149
153
|
| Manage labels | `glab label create` / `glab label list` | N/A |
|
|
150
154
|
| Board sync | Label updates (automatic board list placement) | N/A |
|
|
151
155
|
| CI/Pipelines | `glab ci list` / `glab ci view` | N/A |
|
|
@@ -55,7 +55,7 @@ Follow the **Token-Saving Directives** in `hatch3r-board-shared`.
|
|
|
55
55
|
|
|
56
56
|
## Workflow
|
|
57
57
|
|
|
58
|
-
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
|
|
58
|
+
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK. For every ASK checkpoint, use the platform-native question tool per `agents/shared/user-question-protocol.md`.
|
|
59
59
|
|
|
60
60
|
## Step 0: Triage
|
|
61
61
|
|
|
@@ -73,7 +73,7 @@ Downstream propagation: every ASK checkpoint that reports verification quality,
|
|
|
73
73
|
|
|
74
74
|
## Workflow
|
|
75
75
|
|
|
76
|
-
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
|
|
76
|
+
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK. When asking the user how to proceed, use the platform-native question tool per `agents/shared/user-question-protocol.md`.
|
|
77
77
|
|
|
78
78
|
## Step 0: Triage
|
|
79
79
|
|
|
@@ -273,6 +273,27 @@ During **board-fill Step 4c** (external research) and **board-pickup Step 6** (i
|
|
|
273
273
|
2. Use **web research** for novel technical challenges, current best practices, security advisories, or breaking changes not covered by Context7 or local docs.
|
|
274
274
|
3. Follow the project's tooling hierarchy for knowledge augmentation priority.
|
|
275
275
|
|
|
276
|
+
### Agent-Synthesized Wrapper Scripts
|
|
277
|
+
|
|
278
|
+
Board commands instruct the agent to invoke individual CLI / MCP calls; the agent harness already batches them. If the agent synthesises a wrapper shell script anyway, the script MUST be portable across the user's installed shells. macOS ships `bash 3.2` as `/bin/bash` and many users default to `zsh` — bash-4-only features fail loudly on both.
|
|
279
|
+
|
|
280
|
+
1. **Default to individual tool calls.** Do not wrap `gh issue create`, `gh issue edit`, `gh project item-add`, `az boards work-item create`, or `glab issue create` loops in a synthesised bash script unless the user explicitly asks for a script artifact. The harness's parallel tool dispatch is cheaper than spawning a sub-shell and avoids the portability problem entirely.
|
|
281
|
+
2. **If a wrapper is required, target `bash 3.2` (macOS system default).** Banned constructs: `declare -A` (associative arrays), `${!ARR[@]}` (associative-array key expansion), `mapfile`, `readarray`. Use parallel indexed arrays (`KEYS=()`, `VALUES=()`) with integer indices, or rewrite the batching logic in Python / Node. `zsh` is not a drop-in substitute — `${!ARR[@]}` semantics differ; `bad substitution` is the symptom.
|
|
282
|
+
3. **Pin the shell explicitly.** Start every synthesised script with `#!/usr/bin/env bash` and guard any bash-4+ feature behind `[[ ${BASH_VERSINFO[0]} -ge 4 ]] || { echo "bash 4+ required, found ${BASH_VERSION}"; exit 64; }` so the failure mode is loud, not silent.
|
|
283
|
+
|
|
284
|
+
### Pager-Bypass Directive
|
|
285
|
+
|
|
286
|
+
Every `gh api`, `gh pr view`, `gh issue view`, `gh project item-list`, `az pipelines run`, and `glab api` invocation from an agent-driven terminal MUST run with `GH_PAGER=cat` and `PAGER=cat` set. The default GitHub CLI pager (`less`) opens the alternate screen buffer, which returns empty captured output in non-TTY contexts — the call appears to succeed but its `--jq` output is lost. Piping to `| cat` does not bypass the alternate-buffer behaviour; the environment variables are the only reliable workaround.
|
|
287
|
+
|
|
288
|
+
Set once at the start of every board / PR command run, before the first CLI invocation:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
export GH_PAGER=cat
|
|
292
|
+
export PAGER=cat
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
The export is idempotent and safe to re-set. `GH_PAGER` is scoped to `gh`; `PAGER` covers downstream `git`, `az`, or `glab` invocations. This directive applies to every command in this directory tree.
|
|
296
|
+
|
|
276
297
|
---
|
|
277
298
|
|
|
278
299
|
## Formatting Rules
|