Skip to content

docs(Agents): clarify review and Windows workflows - #1548

Merged
Paul-AUB merged 6 commits into
developfrom
tech/agent-workflow-windows
Oct 2, 2026
Merged

Paul-AUB merged 6 commits into
developfrom
tech/agent-workflow-windows

Conversation

@Paul-AUB

@Paul-AUB Paul-AUB commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

docs(Agents): clarify review and Windows workflows

🤔 What

  • Document the Windows yarn.cmd, sandbox EPERM, and Vitest timeout recovery steps in AGENTS.md.
  • Update the GitHub workflow skill to retry authentication checks with escalated permissions on Windows, avoid printing remote URLs that may contain tokens, and honor an explicit request to publish a PR.
  • Request reviews from ClemRz and urien and self-assign PRs in the GitHub workflow.
  • Make fix-review handle all actionable inline review threads as well as review summaries and general comments, with replies in each relevant thread.
  • Make code-review attach code-specific findings to diff lines or ranges, with a concise overall review body.
  • Keep argument-hint as harmless skill metadata in both review skills, consistent with create-icon and translate.

🤷‍♂️ Why

Preparing PR #1547 exposed environment-specific failures and an embedded credential in a remote URL. The review skills also assumed a single summary comment was enough and placed code findings in a general PR review, making individual code discussions easy to miss. The PR workflow now records the expected reviewers and assignee.

🔍 How

Keep project-wide test guidance in AGENTS.md and GitHub-specific guidance in the skills. fix-review now tracks every outstanding ask and answers inline comments in their original threads. code-review submits one GitHub review containing line-anchored comments and an overall summary. github-workflow identifies the account before proceeding, creates and assigns the PR, then requests each eligible reviewer separately and verifies the result. Application code is unchanged.

🔗 Related API PR

None.

🧪 Testing

  • yarn.cmd lint — completed with exit code 0.

  • quick_validate.py .agents/skills/github-workflow — skill is valid.

  • quick_validate.py .agents/skills/fix-review — skill is valid.

  • quick_validate.py .agents/skills/code-review — skill is valid.

  • git diff --check — no whitespace errors.

  • Verified that PR docs(Agents): clarify review and Windows workflows #1548 requests reviews from ClemRz and urien and assigns Paul-AUB.

  • Application tests not run (documentation-only change).

📸 Previews

Not applicable to documentation changes.

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1548.westeurope.azurestaticapps.net

@Paul-AUB Paul-AUB changed the title docs(Agents): document Windows workflow safeguards docs(Agents): clarify review and Windows workflows Sep 30, 2026
@Paul-AUB
Paul-AUB requested a review from ClemRz September 30, 2026 19:01
@Paul-AUB Paul-AUB self-assigned this Sep 30, 2026
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1548.westeurope.azurestaticapps.net

@Paul-AUB
Paul-AUB requested a review from urien September 30, 2026 19:05
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1548.westeurope.azurestaticapps.net

@Paul-AUB
Paul-AUB removed the request for review from urien September 30, 2026 19:10

@ClemRz ClemRz 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.

Documentation-only change, and the direction is right: inline-anchored findings are genuinely better than a flat list, and fix-review no longer drops older inline threads. Two verifications worth recording:

  • The AGENTS.md Vitest guidance is correct. --run, --maxWorkers, and --testTimeout are all valid on the vitest run subcommand in the installed Vitest 4.1.10, and they forward through yarn test -> yarn workspace @grotto-front/web-app test.
  • Deferring commit types to AGENTS.md fixes a real divergence. The removed inline list contained ci, which commitlint.config.js type-enum rejects, and omitted tech, improvement, and revert, which it allows. AGENTS.md:341 matches the config.

Findings are inline. Nothing blocking; the --reviewer and APPROVE ones will fail in practice for some authors, so they are worth fixing before this becomes the documented path.

Comment thread .agents/skills/code-review/SKILL.md Outdated
### 9. Submit the review with inline comments

### Suggestions (Should Consider)
Build `pr_review_payload.json` with a JSON serializer so multi-line text is escaped correctly. Set `body` to the review body, `event` to `REQUEST_CHANGES` if any Must Fix finding exists or `APPROVE` otherwise, and `comments` to the code-specific findings. Each comment needs `path`, `line`, `side` (`RIGHT` for the new side or `LEFT` for the old side), and `body`. Add `start_line` and `start_side` for a multi-line range. Use one review submission so the body and inline comments are posted together:

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.

Should Consider — two failure modes in this submission step.

  1. APPROVE is rejected on your own PR. GitHub returns 422 Can not approve your own pull request. Since github-workflow now sets --assignee "@me" and the same authenticated account opens the PRs, self-review is a likely path, and it will fail with no review posted at all. .kiro/steering/workflow.md also prescribes gh pr review <number> --comment for this repo. Consider selecting the event based on authorship:
event = "COMMENT" if pr_author == $(gh api user --jq .login) else ("REQUEST_CHANGES" if must_fix else "APPROVE")
  1. POST /pulls/{number}/reviews is atomic. If a single entry in comments has an anchor outside the diff, the whole request 422s and neither the inline comments nor the body are posted. Step 8 says to verify each anchor but gives no method. Consider naming the source of truth and a fallback here:
gh api repos/{owner}/{repo}/pulls/{number}/files --jq '.[] | "\(.filename)\n\(.patch)"'

Anchors must fall inside a hunk's new-side range (context lines included). And if the submission still 422s, resubmit body-only rather than losing the review.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed both submission failure modes. Reviews on the author's own PR now use COMMENT instead of APPROVE/REQUEST_CHANGES. The workflow checks anchors against the PR files' diff hunks, and a 422 invalid-anchor response triggers a body-only retry containing every unposted finding rather than silently losing the review.

Comment thread .agents/skills/code-review/SKILL.md Outdated
Comment on lines 164 to 169
- **Write all review content in English** — `pr_review_body.md` must be in English regardless of the conversation language.
- **NEVER** present the review as chat text. The review MUST be submitted to GitHub.
- **ALWAYS** use temporary files for multi-line CLI content (the `--body-file` pattern). Never pass review content inline.
- **ALWAYS** use temporary files for multi-line review text and JSON payloads. Never pass review content inline on the command line.
- **ALWAYS** clean up temporary files after submission, even if it failed.
- **Be thorough but respectful.** Critique the code, not the author. Use phrases like "Consider..." or "This might..." rather than "You should..." or "This is wrong."
- **Reference specific files and line numbers** whenever possible so the author can locate issues quickly.

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.

Should Consider — these two rules did not follow step 8 through.

  • Line 169 tells the reviewer to reference specific files and line numbers, which step 8 now explicitly forbids in the body ("not a list of file and line references in the review body"). As written, a reader can satisfy line 169 by doing exactly what step 8 rules out. Consider rewording to something like "anchor each finding to its diff line rather than naming the location in prose".
  • Line 164 scopes the English rule to pr_review_body.md, but inline comment bodies now carry most of the review content. Extend it to the inline comments, otherwise the rule no longer covers the majority of what gets posted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed both wording inconsistencies: the English-language requirement explicitly includes inline comments, and the location guidance now says to anchor findings to diff lines instead of listing file/line references in the review body.

Comment thread .agents/skills/github-workflow/SKILL.md Outdated
```bash
git push origin <branch-name>
gh pr create --title "<type(scope): description>" --body-file pr_body.md --base develop --repo <repo>
gh pr create --title "<type(scope): description>" --body-file pr_body.md --base develop --repo <repo> --reviewer ClemRz,urien --assignee "@me"

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.

Should Consider — this fails whenever ClemRz or urien is the author.

GitHub rejects a review request from the PR author (422 Review cannot be requested from pull request author). gh pr create creates the PR first and requests reviewers in a follow-up call, so the outcome is the worst one: the PR exists, the command exits non-zero, and neither the reviewers nor the assignee are set. .kiro/steering/workflow.md has the agent authenticate as ClemRz by default, so this is not a rare case.

Both logins are confirmed collaborators, so the list itself is fine — it just needs the author removed:

me=$(gh api user --jq .login)
reviewers=$(printf '%s\n' ClemRz urien | grep -vx "$me" | paste -sd, -)
gh pr create ... ${reviewers:+--reviewer "$reviewers"} --assignee "@me"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: the PR creation example now gets the authenticated login and excludes it from ClemRz/urien case-insensitively before passing --reviewer; guidance for existing PRs likewise excludes the PR author.

Comment thread .agents/skills/github-workflow/SKILL.md Outdated
Comment on lines +23 to +25
- On Windows, credentials may be hidden inside the sandbox. Run authenticated
`gh` commands and Git network operations with escalated permissions. If a
sandboxed auth check fails, retry with escalated permissions before asking.

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.

Should Consider — the second and third sentences give opposite instructions.

"Run authenticated gh commands and Git network operations with escalated permissions" is unconditional: always escalate. The next sentence says escalate only after a sandboxed check fails. An agent reading this will take the first one and escalate every gh and git network call on Windows, which drops the sandbox default for the common case where it was working fine.

Consider keeping only the failure-triggered form: run sandboxed first, and escalate the specific command that failed with an auth or credential error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: the Windows guidance now runs commands sandboxed first and escalates only the specific gh or Git network command that failed with an authentication or credential error.

```

Merge all entries by `created_at`/`submitted_at`, drop anything authored by your own login (from step 0).
Merge entries by `created_at`/`submitted_at`. Group inline comments with their replies using `in_reply_to_id`, and check whether each thread is resolved (GitHub GraphQL exposes `reviewThreads.isResolved`). Keep your own replies as context, but do not treat them as reviewer asks. Paginate all sources; a newer summary does not replace inline threads.

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.

Should Consider — the resolved check has no command, unlike every other source in this step.

Step 3 depends on it ("Skip resolved, superseded, or already addressed asks"), but reviewThreads.isResolved is not reachable from the two REST calls above, and the parenthetical is the only pointer. Consider giving the query outright so the step is executable:

gh api graphql -f query='
  query($owner:String!,$repo:String!,$pr:Int!){
    repository(owner:$owner,name:$repo){
      pullRequest(number:$pr){
        reviewThreads(first:100){
          nodes{ isResolved isOutdated comments(first:1){ nodes{ databaseId } } }
        }
      }
    }
  }' -F owner=... -F repo=... -F pr=...

The first comment's databaseId is also the top-level comment ID that step 7 needs for /comments/{id}/replies, so one query covers both.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: fix-review now includes an executable GraphQL query returning isResolved, isOutdated, and each thread's top-level databaseId, with explicit cursor pagination guidance.

description: Given a PR number, address actionable reviewer feedback across review summaries, general comments, and inline threads; fix relevant asks, push, and reply in each thread or on the PR.
---

You are resolving reviewer feedback on an existing pull request. `$ARGUMENTS` is the PR number — if missing, ask the user for it before doing anything else.

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.

Optional — the argument-hint removal and this line are inconsistent.

argument-hint is slash-command frontmatter, so dropping it from a skill is reasonable. But $ARGUMENTS is the same slash-command-only mechanism, and this line still depends on it being interpolated. create-icon and translate also still carry argument-hint, so the repo now has both conventions.

Either it is unsupported here, in which case remove it from all four skills and reword this line to take the PR number from the user's request, or it is harmless metadata and the removal is churn. Right now the stated rationale only holds for half the files it applies to.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed the inconsistency by restoring argument-hint in code-review and fix-review. It is harmless skill metadata, and create-icon and translate already retain it alongside their $ARGUMENTS guidance, so no unrelated skill changes were needed.

@Paul-AUB
Paul-AUB requested a review from ClemRz October 1, 2026 07:59
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1548.westeurope.azurestaticapps.net

@urien

urien commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Je ne pense pas pouvoir donner un avis

@ClemRz ClemRz 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.

Re-reviewed against 10f24fe6. All six findings are genuinely addressed, verified in the head file rather than from the replies:

  • code-review:142 — COMMENT on your own PR, with the reason stated. Correct.
  • code-review:136,149 — anchors now checked against pulls/{number}/files, with the atomicity of POST /reviews spelled out and a body-only retry. This goes further than I suggested; the "do not guess an anchor on a truncated patch" clause is a good addition.
  • code-review:165,170 — both rules now match step 8.
  • github-workflow:23-26 — sandboxed first, escalating only the command that failed. Resolved.
  • fix-review:45-65 — executable query, and it returns the databaseId step 7 needs. Cursor pagination guidance and the isOutdated != isResolved caveat are both welcome.
  • argument-hint — restoring it in both skills is a fine resolution, and it leaves all four skills consistent.

Two leftovers, one inline and one on the description:

The ## 🤔 What section still says "Remove unsupported argument-hint frontmatter from the two review skills", which 10f24fe6 reverted. Since this squash-merges, that line becomes the commit message. Worth replacing with the reasoning from the thread — that it is harmless skill metadata kept for consistency with create-icon and translate.

Comment thread .agents/skills/github-workflow/SKILL.md Outdated
Comment on lines +73 to +77
me=$(gh api user --jq .login)
reviewers=$(printf '%s\n' ClemRz urien | grep -vix "$me" | paste -sd, -)
reviewer_args=()
if [ -n "$reviewers" ]; then reviewer_args=(--reviewer "$reviewers"); fi
gh pr create --title "<type(scope): description>" --body-file pr_body.md --base develop --repo <repo> "${reviewer_args[@]}" --assignee "@me"

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.

Should Consider — the exclusion logic is correct, but the shape it took has two problems.

  1. It is bash-only, in the skill that this PR is making Windows-aware. me=$(...), reviewer_args=(), and "${reviewer_args[@]}" all fail in PowerShell, and step 4 just below gives explicit bash and PowerShell variants for a one-line rm. So the Windows path now has a documented cleanup command and an undocumented create command.

  2. It fails open when gh api user fails. I checked the behaviour:

me=""   ->  grep -vix ""  ->  ClemRz,urien

An empty $me matches nothing with -x, so -v keeps both logins and the original 422 comes back — silently, at the step this snippet exists to protect.

The exclusion does not need shell logic at all: the agent already knows which account it authenticated as, and the prose at lines 82-89 already describes the rule. Consider keeping the command declarative and letting the agent apply it:

gh pr create --title "<type(scope): description>" --body-file pr_body.md --base develop --repo <repo> --assignee "@me"
gh pr edit <pr-number> --add-reviewer ClemRz   # omit if ClemRz opened the PR
gh pr edit <pr-number> --add-reviewer urien    # omit if urien opened the PR

That runs identically in both shells, keeps one failing reviewer from taking the PR creation down with it, and makes a failed gh api user an explicit stop rather than a silent fallback. Case-insensitive matching was the right call either way — gh pr create --reviewer clemrz is accepted, so comparing raw logins would have missed it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a131a0c. The creation example now uses separate, shell-independent commands to create and assign the PR, then request each eligible reviewer. Reviewer logins are compared with the author case-insensitively, and author/pending-review requests are omitted. A failed or empty gh api user result explicitly stops the workflow after authentication recovery. A failed reviewer request is reported while the other eligible request and final verification can still proceed.

Validation: yarn.cmd lint, skill validation, and git diff --check passed.

@Paul-AUB

Paul-AUB commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the two remaining asks from the latest review:

  • Fixed the reviewer-request workflow in a131a0c; details are in the inline thread.
  • Updated the PR description to say that argument-hint is retained as harmless skill metadata, consistent with create-icon and translate.

I also re-read all seven unresolved inline threads and checked the current files. The six earlier findings are already addressed by 10f24fe, as confirmed in your latest review; no additional changes were needed for those points.

Validation: yarn.cmd lint completed with exit code 0, quick_validate.py .agents/skills/github-workflow passed, and git diff --check passed. Application tests were not run for this documentation-only change.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1548.westeurope.azurestaticapps.net

@Paul-AUB
Paul-AUB requested a review from ClemRz October 2, 2026 18:25

@ClemRz ClemRz 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.

Re-reviewed against a131a0c8. Both leftovers are resolved and I have nothing further to raise.

github-workflow:71-89 now does more than remove the bash dependency. The failed or empty gh api user case is explicitly fail-closed ("do not continue with an unknown author"), creation and reviewer requests are separated so one rejected reviewer cannot take the PR down with it, and the partial-failure behaviour is stated rather than left to the agent. The ## 🤔 What bullet and the ## 🔍 How paragraph both match the diff again.

One non-blocking observation, no action needed for this PR: lines 93-95 still say "Request reviews from ClemRz and urien, excluding the PR author, and assign the PR to the authenticated account", which is now fully covered by the new block at 71-82 and the commands at 84-89. The existing-PR guidance and the verification command in that paragraph are still the only place they appear, so it cannot just be deleted. Flagging only because the first round of this PR produced its contradiction between step 8 and the Important Rules from exactly this kind of duplication, so it may be worth trimming to the parts that are unique whenever this file is next touched.

All eight findings from the two earlier reviews are verified fixed in the head file. From my side this is ready; the remaining gate is the second approval.

@Paul-AUB

Paul-AUB commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the remaining documentation duplication in 28570be. Removed the repeated reviewer/assignee sentence after the creation commands. The existing-PR guidance, pending-review protection, verification command, and rejection reporting remain in place.

Validation: yarn.cmd lint completed with exit code 0, skill validation passed, and git diff --check passed. Application tests were not run for this documentation-only change.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1548.westeurope.azurestaticapps.net

@ClemRz ClemRz 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.

Re-reviewed against 28570be7. The trim is exactly scoped: only the duplicated reviewer/assignee sentence is gone, and the existing-PR guidance, the already-requested protection, the verification command, and the rejection reporting all survive. Both logins remain discoverable from the commands at lines 87-88, so nothing was lost with the removed profile links.

Nothing outstanding from my side. All nine findings across the three reviews are verified fixed in the head file, and I am raising nothing new — this reads as done.

@ClemRz
ClemRz self-requested a review October 2, 2026 20:21
@Paul-AUB
Paul-AUB force-pushed the tech/agent-workflow-windows branch from 28570be to 9aa6345 Compare October 2, 2026 20:22
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-rock-0d4f87503-1548.westeurope.azurestaticapps.net

@Paul-AUB
Paul-AUB merged commit 63dbf34 into develop Oct 2, 2026
14 checks passed
@Paul-AUB
Paul-AUB deleted the tech/agent-workflow-windows branch October 2, 2026 20:27
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.

3 participants