Skip to content

feat(ai): /pull-request skill — open a PR + trigger Copilot review, hand merge to the user#259

Open
rbuergi wants to merge 2 commits into
mainfrom
feat/ai-pullrequest-skill
Open

feat(ai): /pull-request skill — open a PR + trigger Copilot review, hand merge to the user#259
rbuergi wants to merge 2 commits into
mainfrom
feat/ai-pullrequest-skill

Conversation

@rbuergi

@rbuergi rbuergi commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a /pull-request MeshWeaver.AI Skill node — the "ship a branch as a reviewed PR" step of the steer-development-from-MeshWeaver loop (thread → worktree → branch → PR).

It codifies the workflow this very PR follows:

  • Build green with CI flags first (sync with main, Release -warnaserror, affected tests) — never discover red on CI.
  • Commit + push, open the PR, request the GitHub Copilot review via the REST API (the only way).
  • Wait for CI green, triage the review.
  • STOP and hand the merge to the user — merging is the human approval gate, never the agent's.

Grounded in GitWorkingTreeService (per-agent worktrees) + the GitHub PR backend from #247, and the repo's git-workflow rules. SkillNodeTypeTest updated to include pull-request.

Testing

SkillNodeTypeTest + SkillAutocompleteTest green (10/10) — the skill embeds and parses.

🤖 Generated with Claude Code

…and merge to the user

A MeshWeaver.AI Skill node that codifies the ship-a-branch-as-a-PR workflow for a coding agent
working in a GitWorkingTree: build green with CI flags FIRST (sync with main, Release/-warnaserror,
affected tests), commit + push, open the PR, request the GitHub Copilot review via the REST API,
wait for CI green, triage the review — then STOP and hand the merge to the user (the human approval
gate). Mirrors the Claude Code pullrequest workflow + the repo's git-workflow rules; part of the
"steer development from the MeshWeaver instance" loop (thread → worktree → branch → PR).

Adds "pull-request" to SkillNodeTypeTest's expected skill set.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new built-in MeshWeaver.AI slash-skill, /pull-request, documenting the expected “ship work as a PR” workflow (build green locally, open PR, request Copilot review, wait for CI), and updates the skill catalog test to include the new skill ID.

Changes:

  • Added src/MeshWeaver.AI/Data/Skill/pull-request.md defining the /pull-request Skill node and its workflow guidance.
  • Updated SkillNodeTypeTest to assert the built-in skill catalog includes pull-request.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
test/MeshWeaver.AI.Test/SkillNodeTypeTest.cs Extends expected built-in skill IDs to include pull-request.
src/MeshWeaver.AI/Data/Skill/pull-request.md New /pull-request skill instructions describing the PR + Copilot-review workflow and merge boundary.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +34 to +36
3. **Run the affected tests** once (`dotnet test <project> --no-restore` — always restore a fresh
worktree first, or `--no-restore` silently runs zero tests). Never `Task.Delay` to wait; assert
on the condition. Read [Writing Tests](@/Doc/Architecture/WritingTests).
Comment on lines +44 to +51
Never commit or push on your own initiative — wait for the explicit "ship it" / "open a PR". Then
commit through the working tree: `GitWorkingTreeService.CommitAndPush(userId, repoSlug, message,
branch)` (or `git add -A && git commit` in the worktree). End the commit message with the required
trailer:

```
Co-Authored-By: <your agent identity>
```
Comment on lines +59 to +62
```bash
git push -u origin <branch>
gh pr create --base main --head <branch> --title "…" --body "…" # ends the body with the Generated-with trailer
```
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Test Results (shard 2)

1 106 tests  ±0   1 105 ✅ ±0   6m 18s ⏱️ -35s
   14 suites ±0       1 💤 ±0 
   14 files   ±0       0 ❌ ±0 

Results for commit 27bfaeb. ± Comparison against base commit 58e5b3c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Test Results (shard 1)

839 tests  +130   664 ✅ +129   3m 33s ⏱️ + 1m 27s
 13 suites ±  0   175 💤 +  1 
 13 files   ±  0     0 ❌ ±  0 

Results for commit 27bfaeb. ± Comparison against base commit 58e5b3c.

This pull request removes 28 and adds 158 tests. Note that renamed tests count towards both.
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveAgents_FromHostedSubHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveAgents_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveModels_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.CompileSingleDriverConsistencyTest ‑ ConcurrentRequests_OnFreshNodeType_BothSucceedConsistently
MeshWeaver.Hosting.Monolith.Test.CompileSingleDriverConsistencyTest ‑ FreshCompile_TerminalStateIsComplete
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ ActivationEcho_MustNotDropUnknownContentMembers
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ CreateThenUpdate_PersistsWithoutRelyingOnActivationEcho
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ EditThroughNarrowerType_PersistsEditAndKeepsUnknownMembers
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ HubOptions_RoundTrip_PreservesUnknownContentMembers
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ PureActivation_DoesNotWriteStorageAtAll
…
MeshWeaver.Hosting.Monolith.Test.AgentChatClientNoSuitableAgentTest ‑ AgentChatClient_OnHostedSubHub_DoesNotReturn_NoSuitableAgent
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveAgents_FromHostedSubHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveAgents_FromMeshHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveAgents_SpaceAndUserSet_SurfacesSpaceAgent_UserAgent_AndPlatform
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveModels_FromHostedSubHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveModels_FromMeshHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.BrokenNodeTypeAccessTest ‑ AccessingInstance_OfNonCompilingNodeType_AnswersTerminalError_NotSilence
MeshWeaver.Hosting.Monolith.Test.CessionLayoutAreaTest ‑ BusinessRulesDoc_RelativeReference_ResolvesToMotorXL
MeshWeaver.Hosting.Monolith.Test.CessionLayoutAreaTest ‑ Cession_Trace_HubConfiguration
MeshWeaver.Hosting.Monolith.Test.CessionLayoutAreaTest ‑ MotorXL_LayoutArea_ReturnsContent
…

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Test Results (shard 0)

   15 files  ± 0     15 suites  ±0   4m 36s ⏱️ +21s
1 392 tests +44  1 391 ✅ +44  1 💤 ±0  0 ❌ ±0 
1 402 runs  +45  1 401 ✅ +45  1 💤 ±0  0 ❌ ±0 

Results for commit 27bfaeb. ± Comparison against base commit 58e5b3c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Test Results (shard 3)

1 739 tests  ±0   1 738 ✅ ±0   6m 16s ⏱️ -12s
   14 suites ±0       1 💤 ±0 
   14 files   ±0       0 ❌ ±0 

Results for commit 27bfaeb. ± Comparison against base commit 58e5b3c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Test Results

   56 files  ±  0     56 suites  ±0   20m 44s ⏱️ + 1m 0s
5 076 tests +174  4 898 ✅ +173  178 💤 +1  0 ❌ ±0 
5 086 runs  +175  4 908 ✅ +174  178 💤 +1  0 ❌ ±0 

Results for commit 27bfaeb. ± Comparison against base commit 58e5b3c.

This pull request removes 28 and adds 202 tests. Note that renamed tests count towards both.
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveAgents_FromHostedSubHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveAgents_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveModels_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.CompileSingleDriverConsistencyTest ‑ ConcurrentRequests_OnFreshNodeType_BothSucceedConsistently
MeshWeaver.Hosting.Monolith.Test.CompileSingleDriverConsistencyTest ‑ FreshCompile_TerminalStateIsComplete
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ ActivationEcho_MustNotDropUnknownContentMembers
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ CreateThenUpdate_PersistsWithoutRelyingOnActivationEcho
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ EditThroughNarrowerType_PersistsEditAndKeepsUnknownMembers
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ HubOptions_RoundTrip_PreservesUnknownContentMembers
MeshWeaver.Hosting.Monolith.Test.ContentNarrowingPersistenceTest ‑ PureActivation_DoesNotWriteStorageAtAll
…
MeshWeaver.Hosting.Monolith.Test.AgentChatClientNoSuitableAgentTest ‑ AgentChatClient_OnHostedSubHub_DoesNotReturn_NoSuitableAgent
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveAgents_FromHostedSubHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveAgents_FromMeshHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveAgents_SpaceAndUserSet_SurfacesSpaceAgent_UserAgent_AndPlatform
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveModels_FromHostedSubHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionTest ‑ ObserveModels_FromMeshHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.BrokenNodeTypeAccessTest ‑ AccessingInstance_OfNonCompilingNodeType_AnswersTerminalError_NotSilence
MeshWeaver.Hosting.Monolith.Test.CessionLayoutAreaTest ‑ BusinessRulesDoc_RelativeReference_ResolvesToMotorXL
MeshWeaver.Hosting.Monolith.Test.CessionLayoutAreaTest ‑ Cession_Trace_HubConfiguration
MeshWeaver.Hosting.Monolith.Test.CessionLayoutAreaTest ‑ MotorXL_LayoutArea_ReturnsContent
…

♻️ This comment has been updated with latest results.

…aver"

- pull-request skill: sharpen the --no-restore note (fresh-worktree zero-tests case), soften the
  commit-trailer wording to "the repo's convention", drop the undefined "Generated-with trailer".
- New Doc/Architecture/DevelopingFromMeshWeaver.md: the thread → worktree → /code → /pull-request →
  you-merge loop, the green-before-merge gate, and how the GitHub issues/PRs/webhooks integration
  fits. Links verified by DocumentationLinkIntegrityTest.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rbuergi

rbuergi commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @copilot — all three addressed in 27bfaeb:

  • --no-restore: reworded to the precise case — on a fresh worktree, --no-restore before any restore builds no test assemblies and exits 0 (zero tests).
  • Co-Authored-By: softened from "required" to "the repo's commit convention".
  • Generated-with trailer: removed the undefined reference; the comment now just names the body's contents (what · why · how tested).

Also added Doc/Architecture/DevelopingFromMeshWeaver.md documenting the full loop (DocumentationLinkIntegrityTest green).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants