diff --git a/.claude/skills/forge/SKILL.md b/.claude/skills/forge/SKILL.md index be2c2062f..f24b4ae37 100644 --- a/.claude/skills/forge/SKILL.md +++ b/.claude/skills/forge/SKILL.md @@ -16,6 +16,7 @@ Forge concept commands decouple codev from direct `gh` CLI calls. Each GitHub op | `user-identity` | — | Get current user's handle (plain text) | | `team-activity` | `CODEV_GRAPHQL_QUERY` | Run a batched GraphQL query | | `on-it-timestamps` | `CODEV_ISSUE_NUMBERS`, `CODEV_GRAPHQL_QUERY`, `CODEV_REPO_OWNER`, `CODEV_REPO_NAME` | Get "on it" comment timestamps | +| `pr-create` | `CODEV_PR_TITLE`, `CODEV_PR_BODY`, `CODEV_PR_BASE` (optional), `CODEV_PR_HEAD` (optional), `CODEV_PR_REPO` (optional), `CODEV_PR_DRAFT` (optional) | Open a PR; prints `{"number", "url"}` | | `pr-merge` | `CODEV_PR_NUMBER` | Merge a PR | | `pr-search` | `CODEV_SEARCH_QUERY` | Search PRs (JSON array) | | `pr-view` | `CODEV_PR_NUMBER`, `CODEV_INCLUDE_COMMENTS` (optional) | View PR details (JSON or text) | diff --git a/.codex/skills/forge/SKILL.md b/.codex/skills/forge/SKILL.md index be2c2062f..f24b4ae37 100644 --- a/.codex/skills/forge/SKILL.md +++ b/.codex/skills/forge/SKILL.md @@ -16,6 +16,7 @@ Forge concept commands decouple codev from direct `gh` CLI calls. Each GitHub op | `user-identity` | — | Get current user's handle (plain text) | | `team-activity` | `CODEV_GRAPHQL_QUERY` | Run a batched GraphQL query | | `on-it-timestamps` | `CODEV_ISSUE_NUMBERS`, `CODEV_GRAPHQL_QUERY`, `CODEV_REPO_OWNER`, `CODEV_REPO_NAME` | Get "on it" comment timestamps | +| `pr-create` | `CODEV_PR_TITLE`, `CODEV_PR_BODY`, `CODEV_PR_BASE` (optional), `CODEV_PR_HEAD` (optional), `CODEV_PR_REPO` (optional), `CODEV_PR_DRAFT` (optional) | Open a PR; prints `{"number", "url"}` | | `pr-merge` | `CODEV_PR_NUMBER` | Merge a PR | | `pr-search` | `CODEV_SEARCH_QUERY` | Search PRs (JSON array) | | `pr-view` | `CODEV_PR_NUMBER`, `CODEV_INCLUDE_COMMENTS` (optional) | View PR details (JSON or text) | diff --git a/codev-skeleton/protocols/air/prompts/pr.md b/codev-skeleton/protocols/air/prompts/pr.md index f9e4f7abe..7967db825 100644 --- a/codev-skeleton/protocols/air/prompts/pr.md +++ b/codev-skeleton/protocols/air/prompts/pr.md @@ -18,7 +18,8 @@ Open the PR with the review embedded in its body, optionally run CMAP, and notif The body must carry `Closes #` for the driving issue — one per issue if several — so GitHub auto-closes it on merge. **Exception:** a partial fix uses `Refs #` or `Part of #` instead. Substitute the real number for ``; leave no `{{...}}` tag or `` placeholder in the committed body. ```bash -gh pr create --title "[Air #] feat: " --body "$(cat <<'EOF' +export CODEV_PR_TITLE="[Air #] feat: " +export CODEV_PR_BODY="$(cat <<'EOF' ## Summary <1-2 sentence description of the feature> @@ -44,8 +45,12 @@ Closes # EOF )" + +{{pr_create_command}} ``` +The command above is your forge's `pr-create` concept, substituted by porch (`gh pr create` by default). It takes `CODEV_PR_TITLE` / `CODEV_PR_BODY` — optionally `CODEV_PR_BASE`, `CODEV_PR_HEAD`, `CODEV_PR_REPO` — from the environment, which is why they are exported rather than prefixed onto the command line: an inline override that spells `--title "$CODEV_PR_TITLE"` needs them set in the calling shell too. It prints `{"number": , "url": ""}`. + ## Optional CMAP review CMAP is your judgement call for AIR. Skip it for simple changes (config, small UI); run it for features touching core logic or several modules: diff --git a/codev-skeleton/protocols/aspir/prompts/review.md b/codev-skeleton/protocols/aspir/prompts/review.md index fa2112549..a3bd72903 100644 --- a/codev-skeleton/protocols/aspir/prompts/review.md +++ b/codev-skeleton/protocols/aspir/prompts/review.md @@ -44,7 +44,8 @@ The review's `## Architecture Updates` and `## Lessons Learned Updates` sections The PR body must carry `Closes #` (feature) or `Fixes #` (bug) for the driving issue — one keyword per issue if several — so GitHub auto-closes on merge. **Exception:** a PR that only partially addresses its issue uses `Refs #` or `Part of #` instead, leaving the issue open for the follow-up. ```bash -gh pr create --title "[Spec {{project_id}}] {{title}}" --body "$(cat <<'EOF' +export CODEV_PR_TITLE="[Spec {{project_id}}] {{title}}" +export CODEV_PR_BODY="$(cat <<'EOF' ## Summary [what was implemented] @@ -63,8 +64,12 @@ codev/specs/{{artifact_name}}.md codev/reviews/{{artifact_name}}.md EOF )" + +{{pr_create_command}} ``` +The command above is your forge's `pr-create` concept, substituted by porch (`gh pr create` by default). It takes `CODEV_PR_TITLE` / `CODEV_PR_BODY` — optionally `CODEV_PR_BASE`, `CODEV_PR_HEAD`, `CODEV_PR_REPO` — from the environment, which is why they are exported rather than prefixed onto the command line: an inline override that spells `--title "$CODEV_PR_TITLE"` needs them set in the calling shell too. It prints `{"number": , "url": ""}`. + ## Signals - Review document complete: diff --git a/codev-skeleton/protocols/bugfix/prompts/pr.md b/codev-skeleton/protocols/bugfix/prompts/pr.md index 4dd89ff5c..a45a2f87f 100644 --- a/codev-skeleton/protocols/bugfix/prompts/pr.md +++ b/codev-skeleton/protocols/bugfix/prompts/pr.md @@ -16,7 +16,8 @@ Open the PR, run CMAP review on it, address feedback, and hand off to the archit The PR body must carry `Fixes #` for the driving issue — one per issue if several — so GitHub auto-closes it on merge. **Exception:** a PR that only partially addresses the issue uses `Refs #` or `Part of #` instead, leaving it open for the follow-up. Substitute the real number for ``; leave no `{{...}}` tag or `` placeholder in the committed body. ```bash -gh pr create --title "Fix #: " --body "$(cat <<'EOF' +export CODEV_PR_TITLE="Fix #: " +export CODEV_PR_BODY="$(cat <<'EOF' ## Summary <1-2 sentence description of the bug and fix> @@ -38,8 +39,12 @@ Fixes # - [ ] All tests pass EOF )" + +{{pr_create_command}} ``` +The command above is your forge's `pr-create` concept, substituted by porch (`gh pr create` by default). It takes `CODEV_PR_TITLE` / `CODEV_PR_BODY` — optionally `CODEV_PR_BASE`, `CODEV_PR_HEAD`, `CODEV_PR_REPO` — from the environment, which is why they are exported rather than prefixed onto the command line: an inline override that spells `--title "$CODEV_PR_TITLE"` needs them set in the calling shell too. It prints `{"number": , "url": ""}`. + ## Run CMAP review BUGFIX runs its own 3-way consultation on the PR (porch does not do it for you). Dispatch all three in the background: diff --git a/codev-skeleton/protocols/bugfix/protocol.md b/codev-skeleton/protocols/bugfix/protocol.md index 5854a9434..c1462e87a 100644 --- a/codev-skeleton/protocols/bugfix/protocol.md +++ b/codev-skeleton/protocols/bugfix/protocol.md @@ -27,7 +27,8 @@ refactor surrounding code, fix unrelated bugs (file separate issues), or add fea [Bugfix #42] Test: regression for unencoded username ``` -**PR** — open with `gh pr create`, body carrying Summary, Root Cause, Fix and Test Plan plus +**PR** — open with the `pr-create` forge concept command the PR-phase prompt hands you (`gh +pr create` on GitHub), body carrying Summary, Root Cause, Fix and Test Plan plus `Fixes #` so the issue closes on merge. Run one CMAP pass (Gemini, Codex, Claude), record each verdict, and address or rebut every `REQUEST_CHANGES`. Notify the architect with the verdicts, then `porch done ` and wait. diff --git a/codev-skeleton/protocols/maintain/prompts/review.md b/codev-skeleton/protocols/maintain/prompts/review.md index c61e05fd5..ecdcd4d68 100644 --- a/codev-skeleton/protocols/maintain/prompts/review.md +++ b/codev-skeleton/protocols/maintain/prompts/review.md @@ -46,7 +46,8 @@ If the run was not tied to any issue, the `Closes` line can be omitted. ```bash git push origin HEAD -gh pr create --title "[Maintain] Codebase maintenance run NNNN" --body "$(cat <<'PREOF' +export CODEV_PR_TITLE="[Maintain] Codebase maintenance run NNNN" +export CODEV_PR_BODY="$(cat <<'PREOF' ## Summary <2-3 bullet points of what was done> @@ -67,8 +68,12 @@ Closes # EOF )" + +{{pr_create_command}} ``` +The command above is your forge's `pr-create` concept, substituted by porch (`gh pr create` by default). It takes `CODEV_PR_TITLE` / `CODEV_PR_BODY` — optionally `CODEV_PR_BASE`, `CODEV_PR_HEAD`, `CODEV_PR_REPO` — from the environment, which is why they are exported rather than prefixed onto the command line: an inline override that spells `--title "$CODEV_PR_TITLE"` needs them set in the calling shell too. It prints `{"number": , "url": ""}`. + ## Optional CMAP review CMAP is your judgement call for AIR. Skip it for simple changes (config, small UI); run it for features touching core logic or several modules: diff --git a/codev/protocols/aspir/prompts/review.md b/codev/protocols/aspir/prompts/review.md index fa2112549..a3bd72903 100644 --- a/codev/protocols/aspir/prompts/review.md +++ b/codev/protocols/aspir/prompts/review.md @@ -44,7 +44,8 @@ The review's `## Architecture Updates` and `## Lessons Learned Updates` sections The PR body must carry `Closes #` (feature) or `Fixes #` (bug) for the driving issue — one keyword per issue if several — so GitHub auto-closes on merge. **Exception:** a PR that only partially addresses its issue uses `Refs #` or `Part of #` instead, leaving the issue open for the follow-up. ```bash -gh pr create --title "[Spec {{project_id}}] {{title}}" --body "$(cat <<'EOF' +export CODEV_PR_TITLE="[Spec {{project_id}}] {{title}}" +export CODEV_PR_BODY="$(cat <<'EOF' ## Summary [what was implemented] @@ -63,8 +64,12 @@ codev/specs/{{artifact_name}}.md codev/reviews/{{artifact_name}}.md EOF )" + +{{pr_create_command}} ``` +The command above is your forge's `pr-create` concept, substituted by porch (`gh pr create` by default). It takes `CODEV_PR_TITLE` / `CODEV_PR_BODY` — optionally `CODEV_PR_BASE`, `CODEV_PR_HEAD`, `CODEV_PR_REPO` — from the environment, which is why they are exported rather than prefixed onto the command line: an inline override that spells `--title "$CODEV_PR_TITLE"` needs them set in the calling shell too. It prints `{"number": , "url": ""}`. + ## Signals - Review document complete: diff --git a/codev/protocols/bugfix/prompts/pr.md b/codev/protocols/bugfix/prompts/pr.md index 4dd89ff5c..a45a2f87f 100644 --- a/codev/protocols/bugfix/prompts/pr.md +++ b/codev/protocols/bugfix/prompts/pr.md @@ -16,7 +16,8 @@ Open the PR, run CMAP review on it, address feedback, and hand off to the archit The PR body must carry `Fixes #` for the driving issue — one per issue if several — so GitHub auto-closes it on merge. **Exception:** a PR that only partially addresses the issue uses `Refs #` or `Part of #` instead, leaving it open for the follow-up. Substitute the real number for ``; leave no `{{...}}` tag or `` placeholder in the committed body. ```bash -gh pr create --title "Fix #: " --body "$(cat <<'EOF' +export CODEV_PR_TITLE="Fix #: " +export CODEV_PR_BODY="$(cat <<'EOF' ## Summary <1-2 sentence description of the bug and fix> @@ -38,8 +39,12 @@ Fixes # - [ ] All tests pass EOF )" + +{{pr_create_command}} ``` +The command above is your forge's `pr-create` concept, substituted by porch (`gh pr create` by default). It takes `CODEV_PR_TITLE` / `CODEV_PR_BODY` — optionally `CODEV_PR_BASE`, `CODEV_PR_HEAD`, `CODEV_PR_REPO` — from the environment, which is why they are exported rather than prefixed onto the command line: an inline override that spells `--title "$CODEV_PR_TITLE"` needs them set in the calling shell too. It prints `{"number": , "url": ""}`. + ## Run CMAP review BUGFIX runs its own 3-way consultation on the PR (porch does not do it for you). Dispatch all three in the background: diff --git a/codev/protocols/bugfix/protocol.md b/codev/protocols/bugfix/protocol.md index 5854a9434..c1462e87a 100644 --- a/codev/protocols/bugfix/protocol.md +++ b/codev/protocols/bugfix/protocol.md @@ -27,7 +27,8 @@ refactor surrounding code, fix unrelated bugs (file separate issues), or add fea [Bugfix #42] Test: regression for unencoded username ``` -**PR** — open with `gh pr create`, body carrying Summary, Root Cause, Fix and Test Plan plus +**PR** — open with the `pr-create` forge concept command the PR-phase prompt hands you (`gh +pr create` on GitHub), body carrying Summary, Root Cause, Fix and Test Plan plus `Fixes #` so the issue closes on merge. Run one CMAP pass (Gemini, Codex, Claude), record each verdict, and address or rebut every `REQUEST_CHANGES`. Notify the architect with the verdicts, then `porch done ` and wait. diff --git a/codev/protocols/maintain/prompts/review.md b/codev/protocols/maintain/prompts/review.md index c61e05fd5..ecdcd4d68 100644 --- a/codev/protocols/maintain/prompts/review.md +++ b/codev/protocols/maintain/prompts/review.md @@ -46,7 +46,8 @@ If the run was not tied to any issue, the `Closes` line can be omitted. ```bash git push origin HEAD -gh pr create --title "[Maintain] Codebase maintenance run NNNN" --body "$(cat <<'PREOF' +export CODEV_PR_TITLE="[Maintain] Codebase maintenance run NNNN" +export CODEV_PR_BODY="$(cat <<'PREOF' ## Summary <2-3 bullet points of what was done> @@ -67,8 +68,12 @@ Closes #