Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions prpm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agent-workforce-skills",
"version": "1.0.2",
"version": "1.0.3",
"description": "Skills for multi-agent coordination - swarm patterns, workflow building, relay usage, and headless orchestration",
"author": "khaliqgant",
"organization": "agent-relay",
Expand Down Expand Up @@ -28,7 +28,7 @@
},
{
"name": "writing-agent-relay-workflows",
"version": "1.6.3",
"version": "1.6.4",
"description": "Use when building multi-agent workflows with the relay broker-sdk - covers conversation-shape vs pipeline-shape coordination, WorkflowBuilder API, DAG step dependencies, agent definitions, output chaining via {{steps.X.output}}, verification gates, evidence-based completion, channels, swarm patterns, chat-native coordination recipes (Q/A, broadcast-ack, peer review, standup, hand-off), error handling, event listeners, step sizing, lead+workers team pattern, and parallel wave planning",
"format": "claude",
"subtype": "skill",
Expand Down Expand Up @@ -107,7 +107,7 @@
},
{
"name": "relay-80-100-workflow",
"version": "1.0.1",
"version": "1.0.2",
"description": "Use when writing agent-relay workflows that must fully validate features end-to-end before merging - covers the 80-to-100 pattern with PGlite in-memory Postgres testing, mock sandbox patterns, test-fix-rerun loops, verify gates, and full lifecycle from implementation through passing tests to commit",
"format": "claude",
"subtype": "skill",
Expand Down
55 changes: 54 additions & 1 deletion skills/relay-80-100-workflow/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,63 @@ grep "my_new_table" packages/web/lib/db/schema.ts >/dev/null && echo "OK" || (ec
- File was actually modified (`git diff --quiet` returns non-zero)
- Key content exists (grep for table names, function names, imports)
- For new files: `file_exists` verification type
- For new directories, package trees, generated files, or mixed tracked/untracked
edits: use `git status --short -- <paths>`, because `git diff --quiet`
ignores untracked files

**What NOT to verify:**
- Exact content (too brittle — agents format differently)
- Line counts or byte sizes (meaningless)

### Edit Gates That Include New Files

When an agent may create new files or package directories, do not use
`git diff --quiet -- <paths>` as the only edit gate. It only sees tracked
changes, so a valid new package can be misclassified as "no changes."

Use `git status --short -- <paths>` and keep the first gate repairable:

```typescript
.step('edit-gate-capture', {
type: 'deterministic',
dependsOn: ['implement'],
command: `if [ -z "$(git status --short -- packages/new-adapter tests docs)" ]; then
echo "NO_CHANGES"
exit 1
fi
echo "EDIT_GATE_OK"`,
captureOutput: true,
failOnError: false,
})
.step('fix-edit-gate', {
agent: 'impl',
dependsOn: ['edit-gate-capture'],
task: `If the edit gate reported NO_CHANGES, inspect the acceptance contract
and current git status, then add the missing source/test/artifacts.

Gate output:
{{steps.edit-gate-capture.output}}

If it already passed, do nothing.`,
verification: { type: 'exit_code' },
})
.step('edit-gate-final', {
type: 'deterministic',
dependsOn: ['fix-edit-gate'],
command: `if [ -z "$(git status --short -- packages/new-adapter tests docs)" ]; then
echo "NO_CHANGES"
exit 1
fi
echo "EDIT_GATE_FINAL_OK"`,
captureOutput: true,
failOnError: true,
})
```

Rule of thumb: `git diff --quiet` is fine for tracked-only edits to known
files. Use `git status --short -- <paths>` for materialization gates that may
include new tests, docs, generated artifacts, or package directories.

## Mock Sandbox Pattern

When testing code that interacts with Daytona sandboxes, use inline mock objects matching the existing test conventions:
Expand Down Expand Up @@ -453,7 +505,7 @@ Output:
| Final test run is repairable | Deterministic rerun captures output, then a repair owner gets one more pass |
| Build passes | `npx tsc --noEmit` deterministic step |
| No regressions | Existing test suite runs after changes |
| Every edit is verified and repairable | `git diff --quiet` + grep after each agent edit, followed by a fix step |
| Every edit is verified and repairable | `git diff --quiet` + grep for tracked-only edits; `git status --short -- <paths>` when new files/packages may appear; then a fix step |
| Commit only happens after green evidence | Final commit step reruns acceptance checks and commits only on zero exit codes |

## Common Anti-Patterns
Expand All @@ -468,4 +520,5 @@ Output:
| Final test output not handed to an agent | Broken tests can stop the run or get ignored | Add a final repair owner before commit |
| Testing only happy path | Edge cases break in prod | Specify edge case tests in the task prompt |
| No verify gate after agent edits | Agent exits 0 without writing anything | Add `git diff --quiet` check after every edit, then route failures to a repair step |
| `git diff --quiet` for new package/test directories | Untracked files are invisible, so valid new artifacts can look like "no changes" | Use `git status --short -- <paths>` and a repairable capture → fix → final gate pattern |
| Committing after `failOnError: false` without checking exits | Broken work can be committed because the shell step returned successfully | In `commit-if-green`, record each exit code and skip commit unless all are zero |
52 changes: 51 additions & 1 deletion skills/writing-agent-relay-workflows/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,8 @@ steps:
**Key rules:**
- Read the file in a deterministic step right before the edit (not all files upfront)
- Tell the agent "Only edit this one file" to prevent it touching other files
- Verify with `git diff --quiet` after each edit, hand failures back to an agent to repair, then rerun the deterministic check as proof
- Verify tracked-only edits with `git diff --quiet`, hand failures back to an agent to repair, then rerun the deterministic check as proof
- If the edit may create new files/packages, verify with `git status --short -- <paths>` because `git diff --quiet` ignores untracked files
- Always commit with a deterministic step, never an agent step; rerun acceptance checks in that step, let an agent repair commit blockers, and prove the commit exists

## File Materialization: Verify Before Proceeding
Expand Down Expand Up @@ -1320,6 +1321,54 @@ After any step that creates files, add a deterministic `file_exists` check befor
3. Use `file_exists` verification for creation steps (not just `exit_code`)
4. Gate all downstream steps on the final deterministic proof step that follows the repair step

### Edit Gates Must See Untracked Files

For gates that validate new files, generated artifacts, tests, or package
directories, do not use only `git diff --quiet -- <paths>`. `git diff` ignores
untracked files, so a valid new package can be misclassified as `NO_CHANGES`.

Use `git status --short -- <paths>` for materialization/edit gates, and keep
the first gate repairable:

```yaml
- name: provider-edit-gate-capture
type: deterministic
dependsOn: [implement-providers]
command: |
if [ -z "$(git status --short -- packages/new-provider .workflow-artifacts/my-flow)" ]; then
echo "NO_PROVIDER_CHANGES"
exit 1
fi
echo "PROVIDER_EDIT_GATE_OK"
captureOutput: true
failOnError: false

- name: repair-edit-gate
agent: provider-worker
dependsOn: [provider-edit-gate-capture]
task: |
If provider-edit-gate-capture reported NO_PROVIDER_CHANGES, inspect git
status including untracked files and add the missing provider artifacts.
If it already passed, do nothing.
verification:
type: exit_code

- name: provider-edit-gate-final
type: deterministic
dependsOn: [repair-edit-gate]
command: |
if [ -z "$(git status --short -- packages/new-provider .workflow-artifacts/my-flow)" ]; then
echo "NO_PROVIDER_CHANGES"
exit 1
fi
echo "PROVIDER_EDIT_GATE_FINAL_OK"
captureOutput: true
failOnError: true
```

The first gate captures evidence and gives an agent a chance to fix. The final
gate is the hard stop.

## DAG Deadlock Anti-Pattern

```yaml
Expand Down Expand Up @@ -1437,6 +1486,7 @@ When you set `.pattern('supervisor')` (or `hub-spoke`, `fan-out`), the runner au
| Single step editing 4+ files | Agents modify 1-2 then exit. Split to one file per step with verify gates |
| Relying on agents to `git commit` | Agents emit markers without running git. Use deterministic commit step |
| File-writing steps without `file_exists` verification | `exit_code` auto-passes even if no file written |
| Edit gate uses `git diff --quiet` for new files/packages | `git diff` ignores untracked files and can fail a valid implementation with `NO_CHANGES` | Use `git status --short -- <paths>` for materialization gates |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix malformed table row (extra column) at Line 1489.

The Common Mistakes table is 2-column, but this row currently has 3 cells, which triggers MD056 and can truncate rendered content.

Proposed fix
-| Edit gate uses `git diff --quiet` for new files/packages | `git diff` ignores untracked files and can fail a valid implementation with `NO_CHANGES` | Use `git status --short -- <paths>` for materialization gates |
+| Edit gate uses `git diff --quiet` for new files/packages | `git diff` ignores untracked files and can fail a valid implementation with `NO_CHANGES`; use `git status --short -- <paths>` for materialization gates |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| Edit gate uses `git diff --quiet` for new files/packages | `git diff` ignores untracked files and can fail a valid implementation with `NO_CHANGES` | Use `git status --short -- <paths>` for materialization gates |
| Edit gate uses `git diff --quiet` for new files/packages | `git diff` ignores untracked files and can fail a valid implementation with `NO_CHANGES`; use `git status --short -- <paths>` for materialization gates |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 1489-1489: Table column count
Expected: 2; Actual: 3; Too many cells, extra data will be missing

(MD056, table-column-count)

🤖 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` at line 1489, The table row in
the "Common Mistakes" table is malformed: it has three cells (extra column)
causing MD056; update the row so it has exactly two columns by merging or
removing the extra cell — e.g., make the first cell "Edit gate uses `git diff
--quiet` for new files/packages" and the second cell "Use `git status --short --
<paths>` for materialization gates" (remove the standalone "`git diff` ignores
untracked files and can fail a valid implementation with `NO_CHANGES`" cell or
fold its wording into the second column) so the row matches the table's
two-column format.

| Hard-stop validation gates in product workflows | A red check stops the agent team at the exact moment it should fix the problem. Capture gate output with `failOnError: false`, add a repair agent step, rerun, and reserve hard failure for exhausted repair budget or external blockers |
| Final acceptance before repair | Broken work can stop or commit without giving the team a final chance to fix it. Run final acceptance, hand output to a repair owner, rerun, then commit/open PR only after green deterministic evidence |
| Treating optional notification credentials as fatal | Workflow progress gets blocked by a non-core side effect. Prefer primitive/runtime fallbacks such as the Slack primitive's `cloud-relay` or `noop` shape from AgentWorkforce/relay#823 when notification is not the product contract |
Expand Down