@groupby/ai-dev 0.5.8 → 0.5.9
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/package.json +1 -1
- package/teams/agentic-checkout/prompts/AGENTS.md +103 -0
- package/teams/agentic-checkout/prompts/create-plan.md +103 -0
- package/teams/agentic-checkout/prompts/create-pull-request.md +157 -0
- package/teams/agentic-checkout/prompts/fix-pr-comments.md +170 -0
- package/teams/agentic-checkout/prompts/fix-review-findings.md +1 -12
- package/teams/agentic-checkout/prompts/implement-task.md +62 -0
- package/teams/agentic-checkout/prompts/new-workspace.md +12 -0
- package/teams/agentic-checkout/prompts/orchestrate-component-change.md +25 -0
- package/teams/agentic-checkout/prompts/review-change.md +8 -2
- package/teams/agentic-checkout/scripts/check-secrets +51 -0
- package/teams/agentic-checkout/scripts/install-git-hooks +15 -0
- package/teams/agentic-checkout/scripts/local-fast-report +5 -0
- package/teams/agentic-checkout/scripts/local-report +205 -0
- package/teams/agentic-checkout/scripts/local-summarize +47 -0
- package/teams/agentic-checkout/scripts/logs-deps +9 -0
- package/teams/agentic-checkout/scripts/setup-local-fast-model +20 -0
- package/teams/agentic-checkout/scripts/start-deps +15 -0
- package/teams/agentic-checkout/scripts/status-deps +9 -0
- package/teams/agentic-checkout/scripts/stop-deps +9 -0
- package/teams/agentic-checkout/scripts/sync-components +110 -0
- package/teams/agentic-checkout/skills/approval-gated-task-execution/SKILL.md +57 -0
- package/teams/agentic-checkout/skills/component-verification/SKILL.md +34 -0
- package/teams/agentic-checkout/skills/grill-me/SKILL.md +23 -0
- package/teams/agentic-checkout/skills/karpathy-guidelines/SKILL.md +67 -0
- package/teams/agentic-checkout/skills/secret-safety/SKILL.md +41 -0
- package/teams/agentic-checkout/skills/sync-components/SKILL.md +23 -60
- package/teams/agentic-checkout/skills/tdd/SKILL.md +48 -0
package/package.json
CHANGED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# AGENTS.md - Brain Checkout Component Instructions
|
|
2
|
+
|
|
3
|
+
These instructions apply to Brain Checkout component repositories under `components/`.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
In scope: `bc-agent`, `bc-mcp`, `bc-api`, `bc-pay`, `bc-pay-stripe`, `bc-magento`, `bc-salesforce`, `bc-shopify`,
|
|
8
|
+
`bc-webhooks`, and `bc-lens`. Files outside `components/` are out of component scope unless explicitly requested.
|
|
9
|
+
|
|
10
|
+
Platform flow: user/assistant -> `bc-lens` -> `bc-agent` -> `bc-mcp` -> `bc-api` -> RabbitMQ -> platform integrations
|
|
11
|
+
and webhook/payment components. See `README.md` for component descriptions and `docs/dependencies.md` for local service
|
|
12
|
+
details.
|
|
13
|
+
|
|
14
|
+
## Working Rules
|
|
15
|
+
|
|
16
|
+
- Start with the target component's `.github/copilot-instructions.md` when present.
|
|
17
|
+
- Use only the framework repository-local `tmp/` directory for scratch files, generated temporary files, PR/comment body
|
|
18
|
+
files, command captures, and other temporary artifacts. Never use `/tmp`, `/var/tmp`, or temp directories outside this
|
|
19
|
+
framework checkout for project work.
|
|
20
|
+
- Avoid generated/dependency/cache outputs when reading/searching: `tmp/`, `node_modules/`, `.next/`, `out/`, `dist/`,
|
|
21
|
+
`coverage/`, `build/`, `.gradle/`, `target/`, `_build/`, `deps/`, virtualenv/cache directories, and `__pycache__/`.
|
|
22
|
+
- Let Copilot CLI ask for the user's approval before shell commands. Do not enable `/allow-all` or auto-approve command
|
|
23
|
+
prompts.
|
|
24
|
+
- Keep secrets out of git. Use `secret-safety` before commits/pushes/PRs/config/log changes and run
|
|
25
|
+
`scripts/check-secrets <repo-path>`.
|
|
26
|
+
- Do not add infrastructure/dependencies unless required and already consistent with the component.
|
|
27
|
+
- Keep changes incremental, behavior-preserving, and scoped to affected components.
|
|
28
|
+
|
|
29
|
+
## Deterministic Workflow Routing
|
|
30
|
+
|
|
31
|
+
- For component sync, use the `sync-components` skill, which runs `scripts/sync-components`; do not manually orchestrate
|
|
32
|
+
clone/fetch/checkout/rebase unless the script fails and the user approves recovery.
|
|
33
|
+
- Sync must preserve dirty component repos. Ask before destructive cleanup.
|
|
34
|
+
- For routine summaries of sync, dependency start/status/log/stop, secret scan, hook install, git status, diff stat, or
|
|
35
|
+
workspace inventory, prefer deterministic output or `scripts/local-report <kind>` over hosted-model summarization.
|
|
36
|
+
- Local fast model usage is controlled by `BC_FORGE_LOCAL_FAST_MODEL_MODE=auto|always|off`, normally exported by
|
|
37
|
+
`bin/bc-forge --local-fast-model=<mode>`. In `always`, local setup is required and should not fall back to hosted.
|
|
38
|
+
- If local fast model setup/reporting says it is unavailable, tell the user local summarization is unavailable and the
|
|
39
|
+
hosted model is being used for that summary.
|
|
40
|
+
- Never use the local fast model for planning, implementation, code/spec/contract review, debugging, PR review, failure
|
|
41
|
+
analysis, or raw secret/log output that may contain credentials.
|
|
42
|
+
|
|
43
|
+
## Model Policy
|
|
44
|
+
|
|
45
|
+
- Planning workflows: use the current Copilot session model unless the user requests another model.
|
|
46
|
+
- Implementation workflows: use the current Copilot session/default model unless the user requests another model.
|
|
47
|
+
- Review workflows: Claude Sonnet 4.6 (`claude-sonnet-4.6`).
|
|
48
|
+
- Implementation/check sub-agents: use the current session/default model unless the user requests another model.
|
|
49
|
+
- Do not hard-code planning or implementation model IDs in framework workflows.
|
|
50
|
+
|
|
51
|
+
## Jira and Plans
|
|
52
|
+
|
|
53
|
+
- For Jira-driven component work, identify the Jira ID before editing and use/create that branch in each affected
|
|
54
|
+
component.
|
|
55
|
+
- Save AI implementation plans at `<component>/.stories/<JIRA-ID>/plan.md` and include them in component commits.
|
|
56
|
+
- Plans are spec-first: review affected specs/contracts before runtime code and list required contract changes.
|
|
57
|
+
- Follow approved plans exactly; update and re-approve plans before scope changes.
|
|
58
|
+
|
|
59
|
+
## Contracts
|
|
60
|
+
|
|
61
|
+
Specs/contracts are source of truth:
|
|
62
|
+
|
|
63
|
+
- `bc-agent/specs/*.yaml`
|
|
64
|
+
- `bc-mcp/specs/*.json`
|
|
65
|
+
- `bc-api/doc/api.doc.yaml`, `bc-api/specs/*.json`
|
|
66
|
+
- `bc-pay/specs/*.json`, `bc-pay-core/src/main/java/com/rezolve/bc/pay/core/messaging/event`
|
|
67
|
+
- `bc-pay-stripe/specs/*.json`
|
|
68
|
+
- Java event/model classes under `src/main/java/com/rezolve/bc/rabbitmq/event`
|
|
69
|
+
|
|
70
|
+
When APIs/events/config/payment/webhook payloads change, update specs and check producers/consumers before finishing.
|
|
71
|
+
Preserve backward compatibility unless the user requests a breaking change.
|
|
72
|
+
|
|
73
|
+
## Verification Matrix
|
|
74
|
+
|
|
75
|
+
Run checks from the affected component directory. Use `component-verification` to choose the narrowest sufficient checks.
|
|
76
|
+
|
|
77
|
+
| Component | Install/Sync | Test | Build/Lint |
|
|
78
|
+
|---|---|---|---|
|
|
79
|
+
| `bc-agent` | `uv sync` | `uv run pytest test/ -v` | `uv run python -m compileall app` |
|
|
80
|
+
| `bc-lens` | `cd web && npm install` | `cd web && npm run type-check` | `cd web && npm run lint && npm run build` |
|
|
81
|
+
| `bc-mcp` | `uv sync` | `uv run pytest test/ -v` | `uv run python -m compileall mcp` |
|
|
82
|
+
| `bc-api` | `mix deps.get` | `mix test` | `mix format --check-formatted` |
|
|
83
|
+
| `bc-pay` | `./gradlew dependencies` | `./gradlew :bc-pay-core:test` | `./gradlew :bc-pay-api:build :bc-pay-core:build && ./gradlew spotlessCheck` |
|
|
84
|
+
| `bc-pay-stripe` | `./gradlew dependencies` | `./gradlew test --no-daemon` | `./gradlew shadowJar --no-daemon && ./gradlew spotlessCheck --no-daemon` |
|
|
85
|
+
| Java integrations | `./gradlew dependencies` | `./gradlew test` | `./gradlew shadowJar` |
|
|
86
|
+
|
|
87
|
+
Java integrations are `bc-magento`, `bc-salesforce`, `bc-shopify`, and `bc-webhooks`.
|
|
88
|
+
|
|
89
|
+
`bc-pay` is a library: after changing `bc-pay-api` or `bc-pay-core`, publish updated artifacts and bump matching
|
|
90
|
+
`bc-pay-stripe/gradle.properties` versions before downstream tests.
|
|
91
|
+
|
|
92
|
+
## Local Dependencies
|
|
93
|
+
|
|
94
|
+
Use `scripts/start-deps`, `scripts/status-deps`, `scripts/logs-deps`, and `scripts/stop-deps`. See
|
|
95
|
+
`docs/dependencies.md` for endpoints and component startup details.
|
|
96
|
+
|
|
97
|
+
## Cross-Component Checklist
|
|
98
|
+
|
|
99
|
+
- Event payload/routing/type changed: check `bc-api`, Java services, `bc-agent`, `bc-mcp`.
|
|
100
|
+
- Cart API changed: check `bc-api`, `bc-mcp`, specs, tests.
|
|
101
|
+
- MCP/A2A behavior changed: update specs, models, handlers/tools, tests.
|
|
102
|
+
- Payment event/config/PSP behavior changed: check `bc-pay`, `bc-pay-stripe`, `bc-api`, specs, fixtures.
|
|
103
|
+
- Webhook behavior changed: update handler/mapper specs and tests.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Create Component Implementation Plan
|
|
2
|
+
|
|
3
|
+
Create an implementation plan for a Brain Checkout component task.
|
|
4
|
+
|
|
5
|
+
## Inputs
|
|
6
|
+
|
|
7
|
+
Use the user's task description and inspect the repository as needed.
|
|
8
|
+
|
|
9
|
+
Planning is spec-first: before proposing tasks, identify the affected component specs/contracts and determine required
|
|
10
|
+
additions, changes, or removals so the plan preserves spec/code synchronization.
|
|
11
|
+
|
|
12
|
+
Always take the `tdd` skill into account while planning. Read and apply the skill when the task asks for TDD, test-first development, regression-test-first bug fixing, or behavior that should be proven by tests. If TDD is not appropriate for the task, say so briefly in the plan's test strategy and provide the focused verification approach instead.
|
|
13
|
+
|
|
14
|
+
Always use the `grill-me` skill before creating the plan. Run the full stress-test question flow first, resolve every open decision branch with the user, and only then draft and save `plan.md`.
|
|
15
|
+
|
|
16
|
+
Hard gate: do not create, update, or save any plan file until the `grill-me` flow is complete and all questions are answered.
|
|
17
|
+
|
|
18
|
+
## Plan Location
|
|
19
|
+
|
|
20
|
+
For Jira or ticket-driven work, identify the Jira ID before writing the plan.
|
|
21
|
+
|
|
22
|
+
If one or more Brain Checkout components are affected, save the plan inside each affected component repository under `.stories/`, with a folder named exactly after the Jira ID:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
<component>/.stories/<JIRA-ID>/plan.md
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This folder and plan file are part of the component change and must be included in that component's commit as evidence that the work was developed using AI.
|
|
29
|
+
|
|
30
|
+
If the Jira task does not require changes in any component repository, save the plan in the current session folder using the session plan path (`<session-folder>/plan.md`) provided in session context.
|
|
31
|
+
|
|
32
|
+
If the task is Jira-driven but no Jira ID can be determined, stop and ask for it before writing the plan.
|
|
33
|
+
|
|
34
|
+
## Plan Format
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
# Plan: {short title}
|
|
38
|
+
|
|
39
|
+
## Plan Metadata
|
|
40
|
+
- Model used: `{model-name}`
|
|
41
|
+
- Git commit SHA: `{current-git-sha}`
|
|
42
|
+
|
|
43
|
+
## Summary
|
|
44
|
+
{2-3 sentences}
|
|
45
|
+
|
|
46
|
+
## Affected Components
|
|
47
|
+
- `{component}` - {why}
|
|
48
|
+
|
|
49
|
+
## Contract Impact
|
|
50
|
+
{none | describe schema/event/API changes and consumers}
|
|
51
|
+
|
|
52
|
+
## Test Strategy
|
|
53
|
+
{TDD red/green approach, or why TDD is not applicable and the focused verification approach}
|
|
54
|
+
|
|
55
|
+
## Tasks
|
|
56
|
+
|
|
57
|
+
### Task 1: {title}
|
|
58
|
+
Goal:
|
|
59
|
+
- {single, testable outcome for this task}
|
|
60
|
+
Files:
|
|
61
|
+
- `{path}` - {change}
|
|
62
|
+
Tests:
|
|
63
|
+
- {failing test to add/update first when using TDD, plus test command}
|
|
64
|
+
Dependencies:
|
|
65
|
+
- {None | Task N}
|
|
66
|
+
|
|
67
|
+
### Task 2: {title}
|
|
68
|
+
...
|
|
69
|
+
|
|
70
|
+
## Verification
|
|
71
|
+
- `{command}`
|
|
72
|
+
|
|
73
|
+
## Risks
|
|
74
|
+
- {risk or "None identified"}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Rules
|
|
78
|
+
|
|
79
|
+
- Keep plans to 3-7 tasks.
|
|
80
|
+
- Break work into small, isolated tasks that can be implemented and verified independently.
|
|
81
|
+
- Each task should have one clear outcome and a narrow file scope; avoid mixing unrelated changes in a single task.
|
|
82
|
+
- Prefer an execution order with minimal dependencies between tasks; declare explicit task dependencies when unavoidable.
|
|
83
|
+
- Start from specs/contracts first, then derive implementation tasks from those required contract updates.
|
|
84
|
+
- Backend/API/event contracts before callers.
|
|
85
|
+
- Use the `grill-me` skill before creating every plan.
|
|
86
|
+
- Do not create, update, or save `plan.md` until all `grill-me` questions are answered and every decision branch is resolved.
|
|
87
|
+
- If `grill-me` is still in progress, continue asking the next single question and do not produce plan content yet.
|
|
88
|
+
- Always consider the `tdd` skill while planning and reflect that decision in `Test Strategy`.
|
|
89
|
+
- When the user asks for TDD, test-first development, or regression-test-first bug fixing, use the `tdd` skill while planning.
|
|
90
|
+
- For TDD plans, include the first failing test or test file in each implementation task before production-code changes.
|
|
91
|
+
- Add a `Plan Metadata` section that records the model used to create or update the plan.
|
|
92
|
+
- Add the current git commit SHA to `Plan Metadata` (for component plans, use that component repository SHA; for session-folder plans, use the harness checkout SHA).
|
|
93
|
+
- Keep the plan limited to the affected Brain Checkout components.
|
|
94
|
+
- When no component repository is affected, store the Jira plan in the session plan file (`<session-folder>/plan.md`) instead of component paths.
|
|
95
|
+
- Do not store Jira implementation plans only in the harness checkout; use component `.stories/<JIRA-ID>/plan.md` paths when components are affected.
|
|
96
|
+
## Response Output (Required)
|
|
97
|
+
|
|
98
|
+
After saving or updating `plan.md`, respond with:
|
|
99
|
+
|
|
100
|
+
1. A brief summary paragraph (2-3 sentences) covering affected components, contract impact, and test strategy.
|
|
101
|
+
2. The saved file path(s) for each affected component.
|
|
102
|
+
|
|
103
|
+
Do not render the full plan in the chat response; the saved file is the authoritative source.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Create Pull Request to Main
|
|
2
|
+
|
|
3
|
+
Create a GitHub pull request from the current branch to `main`.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
Inspect the current branch, summarize the change, push the branch if needed, and create a pull request targeting `main`.
|
|
8
|
+
|
|
9
|
+
## Required Checks
|
|
10
|
+
|
|
11
|
+
Run these checks before creating the PR:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git status --short
|
|
15
|
+
git branch --show-current
|
|
16
|
+
git remote -v
|
|
17
|
+
gh --version
|
|
18
|
+
gh auth status
|
|
19
|
+
git fetch origin main
|
|
20
|
+
git log --oneline origin/main..HEAD
|
|
21
|
+
git diff --stat origin/main...HEAD
|
|
22
|
+
git diff --name-only origin/main...HEAD
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Use the `secret-safety` skill and run the harness scanner for the repository being pushed:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
if [ -x scripts/check-secrets ]; then
|
|
29
|
+
scripts/check-secrets .
|
|
30
|
+
else
|
|
31
|
+
../../scripts/check-secrets .
|
|
32
|
+
fi
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Stop and ask the user before continuing if:
|
|
36
|
+
|
|
37
|
+
- The current branch is `main`.
|
|
38
|
+
- There are uncommitted changes.
|
|
39
|
+
- There are no commits ahead of `origin/main`.
|
|
40
|
+
- The repository has no GitHub remote.
|
|
41
|
+
- `gh` is not installed or the user is not authenticated.
|
|
42
|
+
- The secret scan reports potential credentials or secret-bearing files.
|
|
43
|
+
|
|
44
|
+
## Review Before PR
|
|
45
|
+
|
|
46
|
+
Inspect the changed files and identify:
|
|
47
|
+
|
|
48
|
+
- Components affected
|
|
49
|
+
- Contract or schema changes
|
|
50
|
+
- Secret/config/logging risk
|
|
51
|
+
- Tests or verification commands already run
|
|
52
|
+
- Reasonable remaining risk
|
|
53
|
+
|
|
54
|
+
If no verification was run in the current session, say that in the PR body.
|
|
55
|
+
|
|
56
|
+
## Rebase Against Main (Required)
|
|
57
|
+
|
|
58
|
+
Before creating the PR, update `main` and rebase the current branch on top of it.
|
|
59
|
+
|
|
60
|
+
If multiple component repositories are affected, do this in **each affected component repository** before creating its
|
|
61
|
+
PR.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
CURRENT_BRANCH="$(git branch --show-current)"
|
|
65
|
+
git checkout main
|
|
66
|
+
git pull --ff-only origin main
|
|
67
|
+
git checkout "$CURRENT_BRANCH"
|
|
68
|
+
git rebase main
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
If rebase conflicts occur, stop and ask the user how to proceed.
|
|
72
|
+
|
|
73
|
+
After a successful rebase, recompute the ahead/diff checks against `origin/main`.
|
|
74
|
+
|
|
75
|
+
## Push Branch
|
|
76
|
+
|
|
77
|
+
If the current branch has no upstream, push it:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
git push -u origin HEAD
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
If it already has an upstream, push normally:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
git push
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## PR Title
|
|
90
|
+
|
|
91
|
+
Use this priority order:
|
|
92
|
+
|
|
93
|
+
1. Existing ticket key in branch name plus concise summary.
|
|
94
|
+
2. Conventional commit-style title inferred from commits.
|
|
95
|
+
3. Concise imperative summary of the diff.
|
|
96
|
+
|
|
97
|
+
Examples:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
BC-123 Add Shopify cart quantity handling
|
|
101
|
+
Update Brain Checkout dependency startup docs
|
|
102
|
+
Fix webhook mapper payload validation
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## PR Body
|
|
106
|
+
|
|
107
|
+
Delegate drafting to a Haiku sub-agent (see `AGENTS.md` model policy). Pass it `git diff --stat origin/main...HEAD`, `git log --oneline origin/main..HEAD`, and any verification commands run in the session. Have it fill this template:
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
## Summary
|
|
111
|
+
|
|
112
|
+
- {high-level change}
|
|
113
|
+
- {important implementation detail}
|
|
114
|
+
|
|
115
|
+
## Affected Components
|
|
116
|
+
|
|
117
|
+
- `{component}` - {reason}
|
|
118
|
+
|
|
119
|
+
## Verification
|
|
120
|
+
|
|
121
|
+
- `{command}` - {result}
|
|
122
|
+
|
|
123
|
+
## Notes
|
|
124
|
+
|
|
125
|
+
- {contract impact, deployment note, or "None"}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Keep the body factual. Do not include generic boilerplate.
|
|
129
|
+
|
|
130
|
+
## Create PR
|
|
131
|
+
|
|
132
|
+
Create the PR targeting `main`:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
gh pr create --base main --head "$(git branch --show-current)" --title "{title}" --body-file "{body-file}"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Use a temporary body file under the harness repository-local `tmp/` directory and remove it after PR creation.
|
|
139
|
+
|
|
140
|
+
## Request Copilot Review
|
|
141
|
+
|
|
142
|
+
After creating the PR, request a GitHub Copilot review:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
gh pr edit "$(gh pr view --json number --jq .number)" --add-reviewer "@copilot"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Final Response
|
|
149
|
+
|
|
150
|
+
Report:
|
|
151
|
+
|
|
152
|
+
- PR URL
|
|
153
|
+
- Source branch
|
|
154
|
+
- Target branch: `main`
|
|
155
|
+
- Title
|
|
156
|
+
- Verification included in the PR body
|
|
157
|
+
- Copilot review requested
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Fix Pull Request Comments
|
|
2
|
+
|
|
3
|
+
Automatically process review feedback on the current GitHub pull request: collect unresolved comments, implement fixes, verify changes, push updates, and post a completion note.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
For the branch currently checked out, find its PR, read unresolved review feedback, apply concrete code fixes, run relevant verification, and push a commit that addresses the comments.
|
|
8
|
+
|
|
9
|
+
## Required Checks
|
|
10
|
+
|
|
11
|
+
Run these checks before making any changes:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git status --short
|
|
15
|
+
git branch --show-current
|
|
16
|
+
git remote -v
|
|
17
|
+
gh --version
|
|
18
|
+
gh auth status
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Stop and ask the user before continuing if:
|
|
22
|
+
|
|
23
|
+
- The current branch is `main`.
|
|
24
|
+
- There are uncommitted changes.
|
|
25
|
+
- The repository has no GitHub remote.
|
|
26
|
+
- `gh` is not installed or the user is not authenticated.
|
|
27
|
+
|
|
28
|
+
## Discover PR
|
|
29
|
+
|
|
30
|
+
Resolve the PR for the current branch:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
gh pr view --json number,title,url,headRefName,baseRefName
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Stop and ask the user if no PR is found for the current branch.
|
|
37
|
+
|
|
38
|
+
## Collect Review Feedback
|
|
39
|
+
|
|
40
|
+
Delegate the fetch + parse to a Haiku sub-agent (see `AGENTS.md` model policy). The sub-agent should run the GraphQL query, filter to **unresolved, in-scope** comments only, and return a compact JSON list of `{path, line, body, url}` for the session model to act on.
|
|
41
|
+
|
|
42
|
+
Query template:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
gh api graphql -f query='
|
|
46
|
+
query($owner:String!, $repo:String!, $number:Int!) {
|
|
47
|
+
repository(owner:$owner, name:$repo) {
|
|
48
|
+
pullRequest(number:$number) {
|
|
49
|
+
comments(first:100) {
|
|
50
|
+
nodes {
|
|
51
|
+
author { login }
|
|
52
|
+
body
|
|
53
|
+
url
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
reviewThreads(first:100) {
|
|
57
|
+
nodes {
|
|
58
|
+
isResolved
|
|
59
|
+
comments(first:100) {
|
|
60
|
+
nodes {
|
|
61
|
+
author { login }
|
|
62
|
+
body
|
|
63
|
+
path
|
|
64
|
+
outdated
|
|
65
|
+
url
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}' -F owner=<owner> -F repo=<repo> -F number=<number>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Prioritization Rules
|
|
76
|
+
|
|
77
|
+
Process in this order:
|
|
78
|
+
|
|
79
|
+
1. Functional bugs and regressions
|
|
80
|
+
2. Contract/schema/API mismatches
|
|
81
|
+
3. Test reliability and missing coverage
|
|
82
|
+
4. Maintainability and readability issues
|
|
83
|
+
5. Style-only comments
|
|
84
|
+
|
|
85
|
+
Mark for clarification instead of guessing when comments are conflicting or ambiguous.
|
|
86
|
+
|
|
87
|
+
## Implementation Rules
|
|
88
|
+
|
|
89
|
+
- Apply minimal, targeted changes per comment.
|
|
90
|
+
- Keep changes scoped to the PR intent.
|
|
91
|
+
- Do not perform unrelated refactors.
|
|
92
|
+
- If behavior changes, update or add tests.
|
|
93
|
+
- If contract/schema changes, update corresponding docs/specs.
|
|
94
|
+
- Use the `secret-safety` skill and do not commit or push secrets from review feedback, logs, config, or examples.
|
|
95
|
+
|
|
96
|
+
## Verification
|
|
97
|
+
|
|
98
|
+
Run relevant checks for modified components.
|
|
99
|
+
|
|
100
|
+
Examples (run only what applies):
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pytest -q
|
|
104
|
+
mix test
|
|
105
|
+
./gradlew test
|
|
106
|
+
npm test
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
If full verification is too expensive, run focused checks for touched areas and state this explicitly.
|
|
110
|
+
|
|
111
|
+
## Commit And Push
|
|
112
|
+
|
|
113
|
+
After fixes and verification:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
git status --short
|
|
117
|
+
git diff --stat
|
|
118
|
+
git add -- <files modified for the review fix>
|
|
119
|
+
if [ -x scripts/check-secrets ]; then
|
|
120
|
+
scripts/check-secrets .
|
|
121
|
+
else
|
|
122
|
+
../../scripts/check-secrets .
|
|
123
|
+
fi
|
|
124
|
+
git commit -m "Address PR review comments"
|
|
125
|
+
git push
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Stage only the files modified for the review fix. Do not use `git add -A` or `git add .` — these can accidentally stage untracked secrets or generated files. If new files were created as part of the fix, list them explicitly in the `git add` command.
|
|
129
|
+
|
|
130
|
+
If there are no code changes after analysis, do not create an empty commit; report that no actionable fixes were found.
|
|
131
|
+
|
|
132
|
+
## Post PR Update
|
|
133
|
+
|
|
134
|
+
Post a concise PR comment summarizing:
|
|
135
|
+
|
|
136
|
+
- Fixed items
|
|
137
|
+
- Any items needing clarification (with reason)
|
|
138
|
+
- Verification commands and results
|
|
139
|
+
|
|
140
|
+
Example structure:
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
Addressed review feedback:
|
|
144
|
+
|
|
145
|
+
- Fixed: {item 1}
|
|
146
|
+
- Fixed: {item 2}
|
|
147
|
+
- Needs clarification: {item 3}
|
|
148
|
+
|
|
149
|
+
Verification:
|
|
150
|
+
- `{command}` - {result}
|
|
151
|
+
- `{command}` - {result}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Use:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
gh pr comment <number> --body-file <body-file>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Use a temporary file under the harness repository-local `tmp/` directory and remove it after posting.
|
|
161
|
+
|
|
162
|
+
## Final Response
|
|
163
|
+
|
|
164
|
+
Report to the user:
|
|
165
|
+
|
|
166
|
+
- PR URL
|
|
167
|
+
- Number of comments reviewed
|
|
168
|
+
- Number of comments fixed
|
|
169
|
+
- Clarifications needed
|
|
170
|
+
- Commands executed for verification and their outcomes
|
|
@@ -35,18 +35,7 @@ Process findings in this order:
|
|
|
35
35
|
|
|
36
36
|
## Verification
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
uv run pytest test/ -v # bc-agent, bc-mcp
|
|
42
|
-
mix test # bc-api
|
|
43
|
-
mix format --check-formatted # bc-api
|
|
44
|
-
./gradlew :bc-pay-core:test # bc-pay
|
|
45
|
-
./gradlew spotlessCheck # bc-pay
|
|
46
|
-
./gradlew test --no-daemon # bc-pay-stripe
|
|
47
|
-
./gradlew spotlessCheck --no-daemon # bc-pay-stripe
|
|
48
|
-
./gradlew test # bc-magento, bc-salesforce, bc-shopify, bc-webhooks
|
|
49
|
-
```
|
|
38
|
+
Use the `component-verification` skill to run relevant checks for touched components using the canonical verification matrix in `AGENTS.md`.
|
|
50
39
|
|
|
51
40
|
If full verification is too expensive, run focused checks for touched areas and state what was not run.
|
|
52
41
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Implement Component Plan
|
|
2
|
+
|
|
3
|
+
Implement the full set of tasks from a Brain Checkout component plan in one workflow. Do not start implementation until
|
|
4
|
+
the plan exists in the affected component repository.
|
|
5
|
+
|
|
6
|
+
## Required Context
|
|
7
|
+
|
|
8
|
+
Read:
|
|
9
|
+
|
|
10
|
+
- affected component README (`components/<name>/README.md`)
|
|
11
|
+
- affected component `.github/copilot-instructions.md` if present (`components/<name>/.github/copilot-instructions.md`)
|
|
12
|
+
- relevant specs and tests
|
|
13
|
+
|
|
14
|
+
## Branch Preparation
|
|
15
|
+
|
|
16
|
+
Before editing, identify the Jira ID for the task. In each affected component repository, make sure a branch exists for
|
|
17
|
+
that Jira ID and check it out:
|
|
18
|
+
|
|
19
|
+
- Use the existing local branch when present.
|
|
20
|
+
- If the branch exists on the remote, check it out with tracking.
|
|
21
|
+
- Otherwise create it from the component's default branch.
|
|
22
|
+
- Stop and ask for the Jira ID if the task is ticket-driven but no Jira ID can be determined.
|
|
23
|
+
|
|
24
|
+
## Plan Preparation
|
|
25
|
+
|
|
26
|
+
Before editing implementation files, create or verify the plan:
|
|
27
|
+
|
|
28
|
+
- If `.stories/<JIRA-ID>/plan.md` does not exist in an affected component repository, execute the plan creation workflow from
|
|
29
|
+
`prompts/create-plan.md` first.
|
|
30
|
+
- Save the plan at `.stories/<JIRA-ID>/plan.md` inside each affected component repository.
|
|
31
|
+
- Read the plan before implementation and use it as the source for the task scope.
|
|
32
|
+
- Treat any model note or `Plan Metadata` entry in the plan as informational only; it must not change task scope, implementation choices, or verification.
|
|
33
|
+
- Include the plan file in the component commit as AI-development evidence.
|
|
34
|
+
- Do not proceed with implementation until the plan exists.
|
|
35
|
+
- If the plan has a TDD test strategy, use the `tdd` skill and follow the planned failing-test step before editing
|
|
36
|
+
production code.
|
|
37
|
+
- Use the `approval-gated-task-execution` skill for the implementation workflow.
|
|
38
|
+
|
|
39
|
+
## Implementation Rules
|
|
40
|
+
|
|
41
|
+
- Follow the approved plan exactly and execute every planned task using the `approval-gated-task-execution` skill.
|
|
42
|
+
- Make only the changes needed for the plan scope.
|
|
43
|
+
- Update schemas/contracts before runtime models.
|
|
44
|
+
- Keep specs/contracts in sync with code at all times; never skip required spec updates.
|
|
45
|
+
- Do not finish implementation while any known spec/code drift remains.
|
|
46
|
+
- Add or update focused tests.
|
|
47
|
+
- Preserve existing formatting and component patterns.
|
|
48
|
+
- Do not add unrelated dependencies.
|
|
49
|
+
- Do not edit out-of-scope folders.
|
|
50
|
+
|
|
51
|
+
## Verification
|
|
52
|
+
|
|
53
|
+
Use the `component-verification` skill to run relevant checks from the affected component using the canonical verification matrix in `AGENTS.md`.
|
|
54
|
+
|
|
55
|
+
If `bc-pay-api` or `bc-pay-core` source changed, also publish the updated library so `bc-pay-stripe` and other consumers
|
|
56
|
+
can resolve it:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
GITHUB_ACTOR=<user> GITHUB_TOKEN=<pat> ./gradlew publish
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Report checks run, failures fixed, and any checks skipped.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# New Workspace
|
|
2
|
+
|
|
3
|
+
Use for a fresh Brain Checkout workspace.
|
|
4
|
+
|
|
5
|
+
1. If this is a resumed session (`--resume` was used at startup), skip `/clear` and go to step 2. Otherwise, run `/clear` first.
|
|
6
|
+
2. Ask whether to attach a Jira task ID. If provided, load key Jira details; if loading fails, keep the ID and continue.
|
|
7
|
+
3. Forget previous task context unless the new Jira ID was provided.
|
|
8
|
+
4. Sync with exactly one command: use `scripts/local-fast-report sync` when a summary is useful, otherwise use
|
|
9
|
+
`scripts/sync-components` for raw output. Label the local summary run as using the local fast model. Do not run both or
|
|
10
|
+
reimplement sync. Ask before destructive cleanup for each `skipped-dirty` component.
|
|
11
|
+
5. Keep setup lightweight: no dependency install, source inspection, tests/builds/formatters/linters, branches, or plans.
|
|
12
|
+
6. Report Jira context, sync results, skipped-dirty components, and failures. Then wait for the next task or confirmation.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Orchestrate Brain Checkout Component Change
|
|
2
|
+
|
|
3
|
+
Use this prompt with Copilot CLI from the repository root to coordinate an end-to-end component change by delegating to the canonical planning, implementation, verification, review, and PR workflows.
|
|
4
|
+
|
|
5
|
+
## Approval Gates
|
|
6
|
+
|
|
7
|
+
This is an approval-gated workflow. After each numbered step, summarize what was done or discovered, ask the user whether to continue, and wait for approval. If the user stops, report current state, files changed, and what remains.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. Identify affected components from `components.txt` and `AGENTS.md`. Keep scope to those components unless a shared API/event/config/payment contract crosses boundaries. Mapping changed paths to components is a good candidate for a Haiku sub-agent (see `AGENTS.md` model policy).
|
|
12
|
+
2. Prepare the task branch in each affected component per the Jira/branch rules in `AGENTS.md`. Stop and ask for the Jira ID if it cannot be determined.
|
|
13
|
+
3. Load component context: README and `.github/copilot-instructions.md` (when present). Defer spec/contract reading to step 4.
|
|
14
|
+
4. Create or update the implementation plan via `prompts/create-plan.md`.
|
|
15
|
+
5. Implement the approved plan via `prompts/implement-task.md` (uses the `approval-gated-task-execution` skill).
|
|
16
|
+
6. Verify with the `component-verification` skill. For contract changes, also apply the cross-component checklist in `AGENTS.md`.
|
|
17
|
+
7. Review via `prompts/review-change.md`. If actionable findings need code changes, run `prompts/fix-review-findings.md`.
|
|
18
|
+
8. Create the PR via `prompts/create-pull-request.md` when requested.
|
|
19
|
+
9. Report: Jira branch per component, plan file paths, files changed, checks run and skipped (with reasons), remaining risks.
|
|
20
|
+
|
|
21
|
+
## Constraints
|
|
22
|
+
|
|
23
|
+
- Do not introduce unrelated dependencies or services.
|
|
24
|
+
- Keep edits limited to affected components unless the task expands scope.
|
|
25
|
+
- Do not duplicate detailed rules from delegated workflows; the referenced prompt or skill is the source of truth.
|