relay-workflow 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/.claude/skills/relay-analyze/SKILL.md +6 -0
  2. package/.claude/skills/relay-analyze/workflow.md +108 -0
  3. package/.claude/skills/relay-brainstorm/SKILL.md +6 -0
  4. package/.claude/skills/relay-brainstorm/workflow.md +114 -0
  5. package/.claude/skills/relay-cleanup/SKILL.md +6 -0
  6. package/.claude/skills/relay-cleanup/workflow.md +53 -0
  7. package/.claude/skills/relay-design/SKILL.md +6 -0
  8. package/.claude/skills/relay-design/workflow.md +108 -0
  9. package/.claude/skills/relay-discover/SKILL.md +6 -0
  10. package/.claude/skills/relay-discover/workflow.md +56 -0
  11. package/.claude/skills/relay-help/SKILL.md +6 -0
  12. package/.claude/skills/relay-help/workflow.md +165 -0
  13. package/.claude/skills/relay-new-issue/SKILL.md +6 -0
  14. package/.claude/skills/relay-new-issue/workflow.md +90 -0
  15. package/.claude/skills/relay-notebook/SKILL.md +6 -0
  16. package/.claude/skills/relay-notebook/workflow.md +264 -0
  17. package/.claude/skills/relay-order/SKILL.md +6 -0
  18. package/.claude/skills/relay-order/workflow.md +51 -0
  19. package/.claude/skills/relay-plan/SKILL.md +6 -0
  20. package/.claude/skills/relay-plan/workflow.md +133 -0
  21. package/.claude/skills/relay-resolve/SKILL.md +6 -0
  22. package/.claude/skills/relay-resolve/workflow.md +135 -0
  23. package/.claude/skills/relay-review/SKILL.md +6 -0
  24. package/.claude/skills/relay-review/workflow.md +163 -0
  25. package/.claude/skills/relay-scan/SKILL.md +6 -0
  26. package/.claude/skills/relay-scan/workflow.md +103 -0
  27. package/.claude/skills/relay-setup/SKILL.md +6 -0
  28. package/.claude/skills/relay-setup/workflow.md +296 -0
  29. package/.claude/skills/relay-verify/SKILL.md +6 -0
  30. package/.claude/skills/relay-verify/workflow.md +100 -0
  31. package/LICENSE +21 -0
  32. package/README.md +374 -0
  33. package/package.json +43 -0
  34. package/tools/cli.js +186 -0
@@ -0,0 +1,135 @@
1
+ # Relay: Code — Resolve & Close
2
+
3
+ **Sequence**: `/relay-analyze` → `/relay-plan` → `/relay-review` → *implement* → `/relay-verify` → `/relay-notebook` → **`/relay-resolve`**
4
+
5
+ The work on [PHASE/ITEM from relay-ordering.md, e.g. "Phase 1A" or
6
+ individual item "store_communities_n_plus_1"] is complete and verified.
7
+ Close it out.
8
+
9
+ 0. Prerequisite check: Read the target item file(s) and verify
10
+ resolution readiness:
11
+ - If the full code pipeline was used: verify the most recent
12
+ ## Verification Report has verdict COMPLETE. A notebook in
13
+ .relay/notebooks/ matching this item is supplementary evidence
14
+ but does NOT substitute for a COMPLETE verification verdict.
15
+ - If the item was determined stale by /relay-analyze: verify the
16
+ ## Analysis section documents the staleness finding.
17
+ - If prerequisites are missing, WARN the user:
18
+ "This item does not appear fully verified. Run
19
+ **/relay-verify** (or **/relay-notebook**) first, or
20
+ confirm you want to resolve it as-is."
21
+ Wait for the user to confirm before proceeding.
22
+
23
+ 1. Identify all issue/feature files that were resolved in this phase:
24
+ - Read .relay/relay-ordering.md to find which item files are in the
25
+ specified phase/item
26
+ - If only some items in the phase were resolved, resolve only those
27
+ items. The remaining items stay in .relay/issues/ or .relay/features/
28
+ for the next ordering cycle. Specify individual items rather than
29
+ the whole phase (e.g., "store_communities_n_plus_1" instead of
30
+ "Phase 3B").
31
+ - For each item file, read it and confirm it was addressed by the
32
+ implementation:
33
+ - If a plan and verification exist in the item file (from the code
34
+ pipeline), cross-reference with the finalized plan and verification.
35
+ - If no plan/verification sections exist (resolved outside the
36
+ pipeline), scan the codebase directly to confirm the resolution —
37
+ identify the files changed and how the item was addressed.
38
+ - If the item was determined to be stale during /relay-analyze
39
+ (the bug/gap never existed or was already fixed before this item
40
+ was worked): do NOT create an implementation doc. Instead,
41
+ archive the item directly to .relay/archive/issues/ (or
42
+ .relay/archive/features/) with the banner:
43
+ > **ARCHIVED** — Closed as stale. [Reason]. No code changes made.
44
+ Skip steps 2-3 for this item (no implementation doc needed).
45
+
46
+ 2. For each resolved item (skip stale items — they were archived in step 1), create an implementation doc in .relay/implemented/:
47
+ - Filename: same as the item file (e.g., `delete_entity_not_atomic.md`
48
+ → implemented doc `delete_entity_not_atomic.md`)
49
+ - Content:
50
+
51
+ ## Summary
52
+
53
+ *Resolved: [YYYY-MM-DD]*
54
+
55
+ - What was the problem or goal (1-2 sentences)
56
+ - How it was resolved (approach taken)
57
+
58
+ ## Files Modified
59
+ - [list of files changed, with brief description of each change]
60
+
61
+ ## Verification
62
+ - Link to verification notebook (if created), include both paths:
63
+ - Active: `.relay/notebooks/[file].ipynb`
64
+ - Archived: `.relay/archive/notebooks/[file].ipynb`
65
+ - Test commands that confirm the change
66
+
67
+ ## Caveats
68
+ - Any follow-up items, edge cases deferred, or related issues/features affected
69
+
70
+ - For feature files: update the feature file's `*Status:*` line from
71
+ `DESIGNED` to `IMPLEMENTED` before archiving.
72
+
73
+ 3. If a resolved feature was part of a brainstorm, update the brainstorm
74
+ file BEFORE archiving:
75
+ - To find the parent brainstorm: check the `*Brainstorm:*` metadata line
76
+ in the feature file for the relative link to the brainstorm file.
77
+ - Mark the feature as complete in the Feature Breakdown table.
78
+ - If ALL features in the brainstorm are now resolved (check the table —
79
+ all rows marked complete, and no unarchived sibling feature files remain
80
+ in .relay/features/), set the brainstorm's status to COMPLETE and archive
81
+ the brainstorm:
82
+ - Move it from .relay/features/ to .relay/archive/features/
83
+ - Add banner: `> **ARCHIVED** — All features resolved.`
84
+
85
+ 4. Archive each resolved item and its notebook:
86
+ - Move item from .relay/issues/[file].md (or .relay/features/[file].md) to
87
+ .relay/archive/issues/[file].md (or .relay/archive/features/[file].md)
88
+ - Add banner at the top of the archived file:
89
+ > **ARCHIVED** — Resolved. See [implementation doc](../../implemented/FILENAME.md)
90
+ - Note: if this item later regresses, do NOT unarchive it. Instead,
91
+ run **/relay-new-issue** to file a new issue that references this
92
+ archived file. The /relay-scan regression detection step surfaces
93
+ these cases automatically.
94
+ - If a matching notebook exists in .relay/notebooks/[file].ipynb, move it
95
+ to .relay/archive/notebooks/[file].ipynb
96
+
97
+ 5. Check if ANY remaining items in .relay/issues/ or .relay/features/ were
98
+ partially addressed or affected by this change:
99
+ - If an item was partially addressed, update it to reflect the new state
100
+ - If an item's proposed approach needs adjustment because of this change,
101
+ update it
102
+
103
+ 6. Refresh .relay/relay-config.md:
104
+ Since the project code has changed, check if relay-config.md is still
105
+ accurate. For each section:
106
+ - **Edge Cases**: scan the files modified in this phase. If any new
107
+ optional services, config options, concurrency patterns, or external
108
+ API call sites were added or changed, update the Edge Cases section.
109
+ - **Test Commands**: verify the test paths and commands still work.
110
+ If new test files were added or directories restructured, update.
111
+ - **Notebook Setup**: if imports, fixture patterns, or async behavior
112
+ changed, update the relevant subsection.
113
+ Only update sections where the changes in this phase actually affect
114
+ them — do not re-scan the entire codebase.
115
+
116
+ 7. Update .relay/relay-ordering.md:
117
+ For each resolved item, find it in relay-ordering.md and strike it
118
+ through (wrap in ~~...~~). Add a link to the implementation doc.
119
+ If all items in a phase are now resolved, mark the phase heading
120
+ with "— COMPLETE" and add a **Resolved** date line below the heading.
121
+ Do NOT remove the phase or its items — the history provides context.
122
+
123
+ Output: Implementation docs in .relay/implemented/, archived items and
124
+ brainstorms
125
+
126
+ ## Navigation
127
+ When finished, tell the user:
128
+ - "This phase is complete. You should commit these changes before continuing. Run **/relay-scan** to update the project status, then **/relay-order** to reprioritize. Then pick the next phase from relay-ordering.md and run **/relay-analyze**. Or run **/relay-discover** to scan for new issues."
129
+
130
+ ## Notes
131
+
132
+ - This skill uses the same phase/item reference as /relay-analyze, so you can say "Phase 1A" consistently
133
+ - If the phase contained multiple item files, they are all resolved and archived in one pass
134
+ - Step 5 is important: resolving one item often changes the context for others — their proposed approaches may need updating
135
+ - This skill works for both full-pipeline items (with plan/review/verification) and items resolved outside the pipeline — step 1 adapts based on what exists in the item file
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: relay-review
3
+ description: 'Adversarial review of the implementation plan. Tries to break the plan by finding holes, edge cases, and regressions. Final gate before writing code. Use after relay-plan.'
4
+ ---
5
+
6
+ Follow the instructions in ./workflow.md.
@@ -0,0 +1,163 @@
1
+ # Relay: Code — Adversarial Review & Finalize
2
+
3
+ **Sequence**: `/relay-analyze` → `/relay-plan` → **`/relay-review`** → *implement* → `/relay-verify` → `/relay-notebook` → `/relay-resolve`
4
+
5
+ Review the implementation plan as an adversary. Your job is to find holes,
6
+ not to confirm it's good.
7
+
8
+ 0. Read the target item file(s) and verify an ## Implementation Plan
9
+ section exists (from /relay-plan). If no plan exists, STOP and tell
10
+ the user: "No implementation plan found. Run **/relay-plan** first."
11
+
12
+ 1. For each step in the plan, attempt to break it:
13
+ - What happens if this step partially fails (e.g., first query succeeds,
14
+ second throws)?
15
+ - What if the code being modified has changed since the analysis?
16
+ Re-read each target file NOW and confirm the plan still applies.
17
+ - What input would cause this change to produce wrong results?
18
+ - What concurrent operation could race with this change?
19
+ - What happens at the boundary: empty input, None, zero, max-length string,
20
+ unicode, special characters?
21
+
22
+ 2. Test the plan against edge cases specific to this codebase:
23
+ Read the "## Edge Cases" section of .relay/relay-config.md and apply
24
+ every scenario listed there to the plan. These are the project-specific
25
+ conditions that must be considered for every change.
26
+
27
+ 3. Check for regression in the wider project:
28
+ - Read .relay/issues/, .relay/features/, .relay/implemented/, .relay/archive/issues/,
29
+ and .relay/archive/features/. Does the plan accidentally re-introduce any
30
+ previously resolved item?
31
+ - Does the plan change any behavior that other known items depend on?
32
+ (e.g., if item X's proposed approach assumes the current behavior of the
33
+ code this plan modifies)
34
+ - Run through the test files for affected modules. Would any existing
35
+ test break? If so, is the breakage correct (test was wrong) or a
36
+ regression (plan is wrong)?
37
+
38
+ 4. Check completeness:
39
+ - Does the plan handle ALL the cases described in the issue/feature file?
40
+ - Are there cases the issue/feature file didn't mention that the plan should cover?
41
+ - Does every file in the blast radius get addressed?
42
+ - Is there cleanup needed? (dead code removal, comment updates, etc.)
43
+
44
+ 5. Persist the review by APPENDING it to each relevant issue/feature file in
45
+ .relay/issues/ or .relay/features/, after the Implementation Plan section. Add:
46
+
47
+ ---
48
+
49
+ ## Adversarial Review
50
+
51
+ *Reviewed: [YYYY-MM-DD]*
52
+
53
+ ### Issues Found
54
+ - [numbered list of problems, each with severity and suggested fix]
55
+
56
+ ### Edge Cases to Handle
57
+ - [cases the plan needs to address]
58
+
59
+ ### Regression Risk
60
+ - [specific regressions identified, with mitigation]
61
+
62
+ ### Verdict
63
+ - APPROVED: plan is ready for implementation
64
+ - APPROVED WITH CHANGES: plan needs specific modifications (list them)
65
+ - REJECTED: plan has fundamental problems (explain, suggest alternative)
66
+
67
+ If APPROVED WITH CHANGES: update ALL plan sections above to incorporate
68
+ the modifications — Implementation Plan, Test Changes, Post-Implementation
69
+ Checks, Risks & Mitigations, and Rollback Plan. Do not append a second
70
+ plan — replace the existing plan sections with the revised version.
71
+ This becomes the implementation spec.
72
+
73
+ ## Navigation
74
+ When finished, tell the user the next step based on the verdict:
75
+
76
+ - If APPROVED:
77
+ "The plan is approved and ready for implementation.
78
+ Say **'implement the plan'** to begin coding.
79
+ After implementation is complete, run **/relay-verify** to verify."
80
+
81
+ Before implementing, APPEND the following to the issue/feature file
82
+ after the Adversarial Review section:
83
+
84
+ ---
85
+
86
+ ## Implementation Guidelines
87
+
88
+ *Date: [YYYY-MM-DD]*
89
+
90
+ - Follow the finalized plan step by step, in order
91
+ - After each step, run its VERIFY command before moving to the next
92
+ - Commit after each logically complete step or group of related steps
93
+ - If a step cannot be implemented as planned, APPEND a deviation
94
+ section to this file before proceeding:
95
+
96
+ ## Implementation Deviations
97
+
98
+ ### Step [N]: [title]
99
+ - **Planned**: [what the plan said]
100
+ - **Actual**: [what was done instead]
101
+ - **Reason**: [why the deviation was necessary]
102
+ - Do NOT make changes beyond what the plan specifies
103
+
104
+ - If APPROVED WITH CHANGES (after updating the plan in-place):
105
+ Present a summary of the specific changes made to the plan.
106
+ Ask: "The plan has been updated with the changes above. Does this
107
+ look right before implementation begins?"
108
+ Wait for the user to confirm or request further adjustments. Once
109
+ confirmed, APPEND the Implementation Guidelines below to the
110
+ issue/feature file, then tell the user:
111
+ "The plan is confirmed. Say **'implement the plan'** to begin coding.
112
+ After implementation is complete, run **/relay-verify** to verify."
113
+
114
+ ---
115
+
116
+ ## Implementation Guidelines
117
+
118
+ *Date: [YYYY-MM-DD]*
119
+
120
+ - Follow the finalized plan step by step, in order
121
+ - After each step, run its VERIFY command before moving to the next
122
+ - Commit after each logically complete step or group of related steps
123
+ - If a step cannot be implemented as planned, APPEND a deviation
124
+ section to this file before proceeding:
125
+
126
+ ## Implementation Deviations
127
+
128
+ ### Step [N]: [title]
129
+ - **Planned**: [what the plan said]
130
+ - **Actual**: [what was done instead]
131
+ - **Reason**: [why the deviation was necessary]
132
+ - Do NOT make changes beyond what the plan specifies
133
+
134
+ - If REJECTED:
135
+ "The plan needs rework. Run **/relay-plan** to revise the plan
136
+ incorporating the rejection feedback from the Adversarial Review.
137
+ If this is the second or subsequent rejection, consider whether the
138
+ approach itself is flawed — run **/relay-analyze** to reconsider
139
+ the fundamental approach before re-planning."
140
+
141
+ - If the user disagrees with the verdict:
142
+ The user may override any verdict. To override, append to the
143
+ Adversarial Review section:
144
+ **User override**: [APPROVED/REJECTED] — [reason for override]
145
+ Then proceed according to the overridden verdict. The override
146
+ and its reasoning are preserved in the item file for audit.
147
+
148
+ - If reviewing a multi-item phase with split verdicts (some items
149
+ APPROVED, some REJECTED):
150
+ Items with no dependencies on rejected items may proceed to
151
+ implementation independently. Rejected items return to /relay-plan.
152
+ If cross-dependencies exist between approved and rejected items,
153
+ all dependent items must be re-planned together.
154
+
155
+ ## Notes
156
+
157
+ - This skill intentionally has an adversarial framing — it produces better results than "please review"
158
+ - The "re-read each target file NOW" instruction is critical: it catches drift between planning and review
159
+ - Edge cases in the edge cases section should be specific to this project — update them as the codebase evolves
160
+ - If the verdict is REJECTED, go back to /relay-plan with the feedback. If repeated rejections indicate a fundamental approach problem, escalate to /relay-analyze
161
+ - The plan is only finalized when this skill returns APPROVED, or when the user confirms an APPROVED WITH CHANGES revision
162
+ - When APPROVED WITH CHANGES, the issue/feature file's plan is updated in-place so there is always one source of truth
163
+ - The review is persisted in the issue/feature file so the full lifecycle (problem/requirement → plan → review → verification) lives in one place
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: relay-scan
3
+ description: 'Scan the project documentation and codebase to generate relay-status.md with current state of all tracked items. Use periodically or after creating/resolving issues and features.'
4
+ ---
5
+
6
+ Follow the instructions in ./workflow.md.
@@ -0,0 +1,103 @@
1
+ # Relay: Scan & Status
2
+
3
+ **Sequence**: **`/relay-scan`** → `/relay-order` → `/relay-analyze` → ...
4
+
5
+ Scan the project documentation and codebase to produce an updated .relay/relay-status.md:
6
+
7
+ 1. Read every .md file in .relay/issues/ and .relay/features/
8
+ - Exclude brainstorm files (*_brainstorm.md) entirely — these are
9
+ exploration files managed by the feature workflow, not actionable
10
+ work items. Only individual feature files (created by /relay-design
11
+ with status DESIGNED) are tracked here.
12
+ 2. For each file, extract the distinct issues or features described
13
+ 3. Identify duplicates — same issue/feature described in multiple files
14
+ - If duplicated: consolidate into a single file. Turn the duplicate into
15
+ a redirect: replace its content with a link to the consolidated file
16
+ (e.g., `> **Merged into**: [consolidated_file.md](consolidated_file.md)`)
17
+ so /relay-resolve can archive both. Note the merge in relay-status.md.
18
+ 4. For each distinct item, scan the codebase to determine current status:
19
+ - RESOLVED: the code fully addresses the issue or implements the feature
20
+ - PARTIAL: some aspects addressed, others remain
21
+ - OUTSTANDING: not yet addressed in code
22
+ - Include a brief explanation of what evidence you found
23
+ 5. Cross-reference with the full docs landscape:
24
+ - Check .relay/implemented/ for matching implementation docs
25
+ - Check .relay/archive/issues/ and .relay/archive/features/ for items that
26
+ were previously resolved — confirm they haven't regressed
27
+ - If a previously archived item has regressed, flag it prominently
28
+ 6. Write .relay/relay-status.md with appropriate columns for each section.
29
+ Update the `*Last generated:*` date header to today's date (YYYY-MM-DD).
30
+ 7. Flag any items in issues/ or features/ that are fully RESOLVED but haven't
31
+ been moved to implemented/ yet — these need resolution docs created
32
+ (use the process in /relay-resolve)
33
+
34
+ 8. Detect in-progress work:
35
+ For every issue file (.relay/issues/*.md) and feature file
36
+ (.relay/features/*.md), check which pipeline sections have been appended
37
+ to determine the current workflow stage:
38
+ - Has ## Analysis but no ## Implementation Plan → stage: /relay-plan
39
+ - Has ## Implementation Plan but no ## Adversarial Review → stage: /relay-review
40
+ - Has ## Adversarial Review (APPROVED/APPROVED WITH CHANGES) and
41
+ ## Implementation Guidelines but no ## Verification Report → stage: implement
42
+ - Has ## Verification Report (verdict COMPLETE) but no notebook in
43
+ .relay/notebooks/ → stage: /relay-notebook
44
+ - Has ## Verification Report (verdict INCOMPLETE or HAS ISSUES) → stage: re-verify
45
+ - Has ## Adversarial Review with verdict REJECTED → stage: /relay-plan (revision)
46
+ - If multiple ## Adversarial Review sections exist, use the verdict
47
+ from the LAST one to determine stage
48
+ Write these under a "## In-Progress Work" section in relay-status.md:
49
+
50
+ | Item | File | Stage Reached | Next Step |
51
+ |------|------|--------------|-----------|
52
+ | ... | ... | ... | Run /... |
53
+
54
+ This section helps orient anyone returning to the project mid-pipeline.
55
+
56
+ 9. Detect feature pipeline in-progress work:
57
+ For every brainstorm file (.relay/features/*_brainstorm.md), check
58
+ the *Status:* line to determine the current feature stage:
59
+ - Status: BRAINSTORMING → stage: /relay-brainstorm (incomplete)
60
+ - Status: READY FOR DESIGN → stage: /relay-design (pending)
61
+ - Status: DESIGN COMPLETE → stage: /relay-order (features designed, not yet in code pipeline)
62
+ For every non-brainstorm feature file (.relay/features/*.md, excluding
63
+ *_brainstorm.md), check if it has a ## Analysis section:
64
+ - Status: DESIGNED with no ## Analysis → stage: /relay-analyze
65
+ Write these under the same "## In-Progress Work" section, in a
66
+ separate table:
67
+
68
+ ### Feature Pipeline
69
+
70
+ | Item | File | Stage | Next Step |
71
+ |------|------|-------|-----------|
72
+ | ... | ... | ... | Run /... |
73
+
74
+ 10. Staleness detection:
75
+ For every in-progress item (from steps 8 and 9), compare the most
76
+ recent date in the item file (*Analyzed:*, *Generated:*, *Reviewed:*,
77
+ or *Verified:* — whichever is latest) to the current date. If the
78
+ item has been in-progress for more than 7 days:
79
+ - Flag it as STALE in the Next Step column:
80
+ "STALE (last activity [date]) — re-run /relay-analyze to
81
+ validate before continuing"
82
+ Items without any dated pipeline section are not flagged (they
83
+ haven't entered the pipeline yet).
84
+
85
+ Output: Updated .relay/relay-status.md
86
+
87
+ ## Navigation
88
+ When finished, tell the user the next step based on the outcome:
89
+ - If regressions were flagged in this scan:
90
+ "Regressions detected — run **/relay-new-issue** to file new issues for them. Then run **/relay-order** to prioritize the work."
91
+ - If items are PARTIAL:
92
+ "Some items are partially addressed. Update their issue/feature files to document what was already done and narrow the scope to what remains. Then run **/relay-order** to prioritize."
93
+ - Otherwise:
94
+ "Next: run **/relay-order** to prioritize the work."
95
+
96
+ ## Notes
97
+
98
+ - relay-status.md is a generated artifact — it should be regenerated, not manually edited
99
+ - Items that are RESOLVED should eventually be closed using /relay-resolve
100
+ - The scan should check actual code, not just documentation claims
101
+ - Brainstorm files (`*_brainstorm.md`) are excluded — they are managed by the feature workflow (/relay-brainstorm → /relay-design → /relay-cleanup) and are not actionable work items
102
+ - If a previously archived item has regressed, flag it prominently — the Navigation section will direct the user to file new issues for regressions via /relay-new-issue
103
+ - Step 8 reads issue and feature files (.relay/issues/*.md and .relay/features/*.md) to detect pipeline stage — it does not scan the codebase
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: relay-setup
3
+ description: 'Set up the Relay workflow system for a new project. Creates directory structure, status files, and runs project-specific configuration. Use once per project.'
4
+ ---
5
+
6
+ Follow the instructions in ./workflow.md.