Skip to content

docs(workflows): teach repairable gate patterns#32

Merged
khaliqgant merged 2 commits into
mainfrom
codex/repairable-workflow-gates
May 9, 2026
Merged

docs(workflows): teach repairable gate patterns#32
khaliqgant merged 2 commits into
mainfrom
codex/repairable-workflow-gates

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

Test plan

  • git diff --check
  • node frontmatter sanity check for the two edited SKILL.md files
  • rg stale hard-gate/import guidance

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Review Change Stack

Warning

Rate limit exceeded

@khaliqgant has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minute and 42 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 36d76d0a-ee9a-4625-a092-5efdbfc9bc11

📥 Commits

Reviewing files that changed from the base of the PR and between 14d8f1d and 65deb13.

📒 Files selected for processing (3)
  • prpm.json
  • skills/relay-80-100-workflow/SKILL.md
  • skills/writing-agent-relay-workflows/SKILL.md
📝 Walkthrough

Walkthrough

Two workflow documentation files are updated to introduce and exemplify a "repair before fail" pattern. Verification gates now capture output with failOnError: false, followed by explicit agent-driven repair steps that consume that output. The relay-80-100-workflow template enables .repairable() mode and adjusts dependencies to gate downstream steps on successful repair. Guidance for multi-agent and conversation workflows is expanded with the same pattern, including explicit PR creation failure routing. Checklists and anti-patterns are revised to reflect the new repairable approach.

Changes

Repair-Before-Fail Workflow Pattern

Layer / File(s) Summary
Foundational Principle
skills/relay-80-100-workflow/SKILL.md, skills/writing-agent-relay-workflows/SKILL.md
New "Repair Before Failure" and "Default Principle: Workflows Repair Before They Fail" sections define gates that capture output with failOnError: false, route failures to repair steps with access to that output, and reserve hard workflow failure for unrecoverable conditions.
Relay Template Core Changes
skills/relay-80-100-workflow/SKILL.md
Workflow builder adds .repairable() call; Test-Fix-Rerun pattern is split into non-hard-failing run-tests-final (capture output) followed by fix-tests-final repair step; verification steps for target and schema edits gain corresponding fix-*-verification repair steps; build-check dependency rewired to gate on repair completion; commit step changed to failOnError: false with multi-command shell execution.
Test Finalization and Verification
skills/relay-80-100-workflow/SKILL.md
Verify-target gate captures output and does not hard-fail; downstream test creation depends on the verification-fix step rather than the original verify step; final test rerun captures output and is followed by repair step before build-check proceeds.
Multi-Agent and Conversation Patterns
skills/writing-agent-relay-workflows/SKILL.md
Conversation-shape TypeScript quick reference adds .repairable() call; deterministic verification stage captures output without hard failure and is followed by lead-owned repair step consuming verification output; multi-file edit and file materialization examples include non-hard-failing verify steps and dedicated fix-*-verification/fix-missing-files repair steps before deterministic commits; delivery/PR boundary flow explicitly routes PR creation failures to repair.
PR Creation and Error Handling
skills/writing-agent-relay-workflows/SKILL.md
Import for PR creation changed from @agent-relay/sdk/github to @agent-relay/sdk; new rule requires PR creation failures to be routed to repair; agent-team error-handling guidance prefers retry over fail-fast and leverages .repairable()/.reliable() where available.
Reference Updates and Anti-Patterns
skills/relay-80-100-workflow/SKILL.md, skills/writing-agent-relay-workflows/SKILL.md
Relay checklist updated to reference repairable verification and test gates; anti-pattern table removes outdated hard-gating advice and emphasizes repairable final reruns and verification; skill description clarified to remove outdated PGlite mention; common mistakes table gains entries on product-contract hard-stop behavior, final acceptance sequencing, and optional notification fallbacks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • AgentWorkforce/skills#26: Both PRs update guidance for PR creation in workflows and specify how PR-creation failures should be handled via repair routing rather than silent continuation.
  • AgentWorkforce/skills#29: Both PRs modify the writing-agent-relay-workflows SKILL.md with overlapping updates to commit/PR boundary definitions and createGitHubStep usage.

Poem

🐰 A workflow that's wise doesn't break when things fail,
It captures the evidence, tells a repair tale,
Each gate flows to fix, then deterministic green,
No silence, no hardstops—just clarity clean,
Repair first, then merge! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: introducing documentation about repairable gate patterns in workflows, which directly aligns with both file updates.
Description check ✅ Passed The description is directly related to the changeset, outlining the specific guidance additions and example updates made to the workflow documentation files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/repairable-workflow-gates

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
skills/writing-agent-relay-workflows/SKILL.md (1)

931-937: ⚡ Quick win

Show a final deterministic check after repair-files in this example.

This example currently repairs from {{steps.verify-files.output}} but does not show a post-repair deterministic rerun. Adding one keeps the guidance consistent with “repair before fail, then verify deterministically.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/writing-agent-relay-workflows/SKILL.md` around lines 931 - 937, Add a
deterministic post-repair verification step after step('repair-files') that
reruns the original verification logic and fails the workflow if issues remain;
specifically, introduce a new step (e.g., step('verify-files-final') or reuse
step('verify-files') by making it depend on 'repair-files') that invokes the
same check used by verify-files and uses its output to deterministically confirm
repair (and propagate a clear failure if the check still reports
missing/incorrect files).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/relay-80-100-workflow/SKILL.md`:
- Around line 412-423: The .step('commit') uses failOnError: false which can let
the workflow continue without a real commit; add a deterministic follow-up step
(e.g., .step('verify-commit')) that dependsOn: ['commit'] and explicitly
verifies the commit (for example by checking git status/that HEAD changed or
reading the commit message via git rev-parse/ git log) and fails the workflow if
the commit is missing, or routes to a repair step; update workflow transitions
so successful completion requires the new verify-commit step and include a
repair path if verification fails.

In `@skills/writing-agent-relay-workflows/SKILL.md`:
- Around line 164-170: The workflow needs a deterministic final verification
step after the repair loop: add a new step named 'verify-final' that dependsOn
'repair-verify' and re-runs the original verification logic deterministically
(same checks as 'verify') so the workflow only completes when 'verify-final'
reports success; reference the existing step names 'repair-verify' and 'verify'
when wiring dependencies and ensure 'verify-final' produces the final pass/fail
evidence used for completion.

---

Nitpick comments:
In `@skills/writing-agent-relay-workflows/SKILL.md`:
- Around line 931-937: Add a deterministic post-repair verification step after
step('repair-files') that reruns the original verification logic and fails the
workflow if issues remain; specifically, introduce a new step (e.g.,
step('verify-files-final') or reuse step('verify-files') by making it depend on
'repair-files') that invokes the same check used by verify-files and uses its
output to deterministically confirm repair (and propagate a clear failure if the
check still reports missing/incorrect files).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d0b705e6-9604-43ac-bb15-031e9a19a40a

📥 Commits

Reviewing files that changed from the base of the PR and between c1bc425 and 14d8f1d.

📒 Files selected for processing (2)
  • skills/relay-80-100-workflow/SKILL.md
  • skills/writing-agent-relay-workflows/SKILL.md

Comment thread skills/relay-80-100-workflow/SKILL.md
Comment thread skills/writing-agent-relay-workflows/SKILL.md
@khaliqgant khaliqgant force-pushed the codex/repairable-workflow-gates branch from 14d8f1d to f9cee4f Compare May 9, 2026 09:34
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment on lines +83 to 91
// Step 4: Repair again if the rerun is still red
.step('fix-tests-final', {
agent: 'tester',
dependsOn: ['run-tests-final'],
task: `If the final test rerun passed, record the green evidence.
If it failed, fix the remaining issue and rerun until green:
{{steps.run-tests-final.output}}`,
verification: { type: 'exit_code' },
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 "Three-step pattern" text not updated after adding a fourth step

The PR adds a new Step 4 (fix-tests-final) at lines 83-91, making the pattern a 4-step pattern. However, the introductory text at skills/relay-80-100-workflow/SKILL.md:44 still says "follow this three-step pattern" and the summary at line 94 still says "Why three steps instead of one?" This is a documentation inconsistency introduced by this PR — readers will be confused when the code shows 4 clearly-numbered steps but the surrounding text describes 3.

Prompt for agents
The PR adds a Step 4 (fix-tests-final) to the Test-Fix-Rerun Pattern, making it a 4-step pattern. But the text around the code block still says "three-step pattern" (line 44) and "Why three steps instead of one?" (line 94). Both of these text references need to be updated to say "four" instead of "three". Additionally, the summary section after the code block currently lists 3 bullet points explaining the 3 steps — a 4th bullet should be added explaining the role of the new repair step.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

dependsOn: [fix-service-verification]
command: git add src/types.ts src/service.ts && git commit -m "feat: add pending status"
failOnError: true
failOnError: false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 YAML commit step contradicts new "rerun acceptance checks" guidance

The PR adds new guidance at skills/writing-agent-relay-workflows/SKILL.md:1220 stating "Always commit with a deterministic step, never an agent step; rerun acceptance checks in that step and skip commit unless green." However, the YAML Multi-File Edit Pattern's commit step at line 1212 just runs git add && git commit without re-running any acceptance checks. Combined with the change at line 1213 from failOnError: true to failOnError: false (and all upstream verification steps also changed to failOnError: false), this example teaches a pattern where broken code could be committed — the repair agent steps have no verification field, so they complete on any exit 0, and the commit proceeds without verifying the repairs worked.

Prompt for agents
In the Multi-File Edit Pattern YAML example (around line 1209-1213), the commit step needs to be updated to match the PR's own stated guidance at line 1220: rerun acceptance checks before committing. Currently the commit step just does `git add && git commit` with `failOnError: false`. It should follow the same pattern as the TypeScript Full Workflow Template in relay-80-100-workflow/SKILL.md, which chains test commands before `git add && git commit` using `&&`. For example, the command could become something like: `npm run typecheck && npm test && git add src/types.ts src/service.ts && git commit -m "feat: add pending status"`. Also consider adding `verification` fields (e.g. `type: exit_code`) to the YAML repair steps (`fix-types-verification`, `fix-service-verification`, `fix-missing-files`) to match the TypeScript examples which consistently include verification on repair steps.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@khaliqgant
Copy link
Copy Markdown
Member Author

Addressed the visible review comments in the repair-first spirit:\n\n- Added deterministic proof steps after repair steps, so gates produce evidence instead of silently passing.\n- Kept initial gates repairable/permissive, with agents owning failures before terminal proof.\n- Added commit repair + commit proof so a failed commit cannot be ignored.\n- Fixed the stale three-step wording in the 80-to-100 skill.\n\nI treated the feedback as a request for proof-after-repair, not a return to hard-stop gates before agents get a chance to fix.

@khaliqgant khaliqgant merged commit 7465c7c into main May 9, 2026
1 check passed
@khaliqgant khaliqgant deleted the codex/repairable-workflow-gates branch May 9, 2026 09:48
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.

1 participant