GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs: deepen research-workflow, request-intake and research-prepare skills by dezren39 · Pull Request #489 · developing-today/code

docs: deepen research-workflow, request-intake and research-prepare skills #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
dezren39 merged 4 commits into main from wf2/skills-1
Oct 22, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

docs: deepen research-workflow, request-intake and research-prepare skills #489

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
bee18af
docs: deepen research-workflow router skill
dezren39 Oct 21, 2026
466e2ba
docs: deepen request-intake skill (references in progress)
dezren39 Oct 21, 2026
45a9457
docs: add request-intake references
dezren39 Oct 21, 2026
b336151
docs: deepen research-prepare skill
dezren39 Oct 21, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

102 changes: 75 additions & 27 deletions 102 .agents/skills/research-workflow/SKILL.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,49 +1,97 @@
---
name: research-workflow
description: Discover the current stage of a research collection, inspect readiness, and dispatch the next lifecycle stage or worker. Use when resuming work on a request, finding what is unblocked, or checking package status.
description: Route a research package (doc/<UTC>_research_<slug>/) through the research-to-delivery workflow. Reads machine state with the workflow tool, finds each concept's stage, dispatches the stage skill to parallel worker subagents, verifies and merges their PRs, restarts stalled workers and stops where the user asked. Use when asked to run, resume, continue or check a research workflow or package, to find what is ready, running or blocked, to take a request from intake through research, design, planning or implementation, or to run the next stage for every ready concept. It never writes the content itself; for one stage's own work load that stage's skill (request-intake, research-prepare, concept-research, notes-reconcile, issue-handoff, design-orchestrate, feature-plan, implementation-orchestrate).
---

# Research Workflow Router
# Research workflow (router)

This skill inspects collection state and routes work to the appropriate lifecycle skill. Detailed contracts live in [/planning/workflow/README.md](/planning/workflow/README.md).
Moves a research package from S0 (intake) to S8 (implement). It reads machine state, decides what runs next, dispatches one stage skill per unit of work to parallel workers and lands their PRs. The stage contract is in [stages.md](/planning/workflow/stages.md), and the dispatch and merge rules are in [collaboration.md](/planning/workflow/collaboration.md) and [ordering.md](/planning/workflow/ordering.md). The router is an orchestrator. It writes only merge commits, the generated views, lease and log entries, and issue/PR bookkeeping. It never writes concept, research, design, plan or code content.

## Procedure
## Set up

1. **Locate Collection & Read Status**:
```sh
source /home/user/.local/share/plaza-tools/git-env.sh # the profile's git_env
rw() { python3 -I scripts/research_workflow.py "$@"; } # run from the repository root
PKG=doc/<UTC>_research_<slug> # the package folder
LOG="$(git rev-parse --git-common-dir)/agent-work/${PKG##*/}-router"; mkdir -p "$LOG"
```

Each log line is `router <UTC> <kind>: <text>` and is appended to `$LOG/router.md`. If a command below fails with `invalid choice` or an unknown flag, read [references/tool-fallbacks.md](references/tool-fallbacks.md).

## Steps

1. **Find the package and the stopping point.** `rw check --repo-root .` lists every package. If the user handed over new input and there is no package for it yet, the next stage is S0 (see the S0 rule in [references/routing.md](references/routing.md)). Take the stopping point from the user's words using the phrase list in `references/routing.md`. If the user didn't state one, finish the current stage for every ready concept, then stop.
Done when `$LOG/router.md` has a `start` line naming the package path and the stop stage.

2. **Read state.** Run:

```sh
python3 scripts/research_workflow.py status --package <package-dir>
rw status --package "$PKG" --live # per concept: stage, run status (derived from git and GitHub), issues, PRs
rw ready --package "$PKG" # ready set and waves; excludes running, leased and claimed concepts
rw check --package "$PKG" --remote-notes
```

Check the current stage (`intake`, `prepare`, `research`, `reconcile`, `handoff`, `design`, `plan`, `implement`).
Run status `pushed`, `pr-open` and `merged` come from `--live`. Never take them from a worker's own claim.
Done when you have, for every concept, its stage, its run status, its ready-or-blocked state with the blocking ids, and its pending notes.

3. **Choose one action per concept.** Map stage and run status to an action with the table in `references/routing.md`. The action is one of dispatch, verify-and-merge, monitor, restart, wait (name the blocker), ask the human (batched), or done. Concepts past the stop stage are left alone. Apply the barriers listed there: S3 waits for every S2 to merge, and `type: hint` concepts never go to S2. A conflict between concepts goes to the decision protocol in [decisions.md](/planning/workflow/decisions.md), not to you.
Done when every concept has exactly one action, written as one log line.

2. **Compute Ready Frontier**:
4. **Dispatch ready work in parallel.** Concepts are dispatched in `ready` order, and the number running at once never exceeds the profile's `max_parallel_writers` (5 by default). For each one:

```sh
python3 scripts/research_workflow.py ready --package <package-dir>
rw lease acquire --package "$PKG" --stage S1 --resource C003 --owner prepare-c003-7f2a --purpose "S1 research-prepare"
```

Inspect unblocked concepts and active concurrency constraints.
Then fill in [references/worker-brief.md](references/worker-brief.md) and launch every worker in the same turn as a background subagent. Pass paths and URLs, not summaries. Size each unit to one fresh session. If a unit won't fit, split it before dispatching.
Done when every dispatched concept has a lease, its brief is in `$LOG/<worker>.md`, and its subagent is running, with nothing over the cap.

5. **Verify and merge finished workers.** When a worker reports, run the triple check in [references/merge-and-restart.md](references/merge-and-restart.md). The remote branch, the PR head and the SHA the worker reported must all be equal. The worker must also have finished, and the PR must be mergeable and green. Then merge with `gh pr merge <n> --merge --match-head-commit <sha>` and confirm with `git merge-base --is-ancestor <sha> origin/main`. A PR that is behind or conflicting goes back to its worker. Never fix a worker's branch yourself.
Done when every reported PR is either merged and confirmed as an ancestor, or returned to its worker with the reason logged.

6. **Restart stalled workers and sweep orphans.** A stalled worker has no log line for 20 minutes, no live lease (`rw lease list --package "$PKG"`) and no open PR. Restart it on the same branch with its original brief: merge, never reset. A branch with commits ahead of main and no PR is an orphan. Use the commands in `references/merge-and-restart.md`.
Done when no stalled worker and no orphan branch is left without an action.

7. **Refresh the generated views.** After a wave merges, run `rw render --package "$PKG"` on a fresh router branch (`research/<slug>/router-<n>`) and run `rw check --package "$PKG"`. Open that PR and merge it the same way. Workers leave the shared run table to you, which keeps their PRs from conflicting.
Done when the run table in `design.md` on `main` matches `rw status --package "$PKG" --live`.

8. **Continue or stop.** If the stop stage is reached, or nothing is ready or running, stop and report. Otherwise go back to step 2. Wait for subagent completion notices instead of polling in a sleep loop.
Done when the turn report below lists every concept's stage and run status.

## Single-concept shortcut

A package with one concept keeps the full layout (no special case in [records.md](/planning/workflow/records.md)) but skips the ceremony:

- one worker runs S1 and then S2 in the same session if it fits;
- S3 is just the check `rw check --package "$PKG" --require-resolved`;
- no waves are planned, and the run table has one row.
Comment thread
Comment on lines +63 to +67

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 21, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Use the actual single-concept package layout

For a package containing exactly one concept, the current scaffold stores that concept in main.md and omits concepts/, design.md, and changes.md; check_package explicitly enforces that the concept path is main.md. Claiming that the package keeps the full layout causes the shortcut and worker-brief template to direct the worker to a nonexistent concepts/Cxxx-*.md, so ordinary single-concept runs can fail before S1 begins.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

Details are in `references/routing.md`.

## Parallelism and ownership

There is one worker per concept per stage, each in its own worktree and branch with a pushed empty branch, and up to the cap at once. Every file has one writer. Wide files (`main.md`, `design.md`, indexes, `AGENTS.md`) change only through PRs, and `changes.md` changes by appending a single line. Notes and receipts are new files. The full rules are in [collaboration.md](/planning/workflow/collaboration.md) (rules 1 to 10); this skill does not restate them. Questions for the human are batched, ranked by effect, and each one has a default ([decisions.md](/planning/workflow/decisions.md)). Work continues on the defaults.

## Should load / should not load

- Load for: resuming or continuing a package; "what's ready / blocked / running"; running the next stage across concepts; taking a request through to a named stage; merging worker PRs; restarting stalled workers.
- Don't load for these, which belong to the named skill: new raw input with no package yet (`request-intake`); one concept's preliminary research (`research-prepare`); one concept's full research (`concept-research`); notes and receipts (`notes-reconcile`); writing issues (`issue-handoff`); running a design or implementation wave (`design-orchestrate`, `implementation-orchestrate`); general web research with no package.

3. **Dispatch to Stage Skill**:
- Stage `intake` -> call `request-intake` if not yet prepared.
- Stage `prepare` -> call `research-prepare` per ready concept.
- Stage `research` -> call `concept-research` per ready concept.
- Stage `reconcile` -> call `notes-reconcile` per concept.
- Stage `handoff` -> call `issue-handoff` to create parent/fan-out issues.
- Stage `design` -> call `design-orchestrate` to coordinate research PRs and decisions.
- Stage `plan` -> call `feature-plan` to create granular implementation plans.
- Stage `implement` -> call `implementation-orchestrate` across ready frontiers.
## References

4. **Report Progress**:
Print the ready frontier, active leases, and next action.
- [references/routing.md](references/routing.md): read in steps 1 and 3 (stop phrases, stage-to-skill table, actions, barriers, hints, nesting).
- [references/worker-brief.md](references/worker-brief.md): read in step 4, before every dispatch.
- [references/merge-and-restart.md](references/merge-and-restart.md): read in steps 5 and 6.
- [references/tool-fallbacks.md](references/tool-fallbacks.md): read only when a command named here is missing.

## Turn Report
## Turn report

End every turn with:

- Done: <summary of inspection or dispatch>
- Verified: <command -> output>
- Remaining: <next stage or pending work>
- Questions (non-blocking): <question -> default>
- Blocked on user: <blocker or none>
```
Done: <stages run, PRs merged (number and SHA), workers dispatched or restarted>
Verified: <command -> result>, e.g. rw status --package ... --live -> C001..C014 at S1 merged
Remaining: <concepts not at the stop stage, with their next action>
Questions (non-blocking): <question -> default in use>, or none
Blocked on user: <only what nothing else can proceed without>, or none
```
90 changes: 90 additions & 0 deletions 90 .agents/skills/research-workflow/references/merge-and-restart.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Merging, restarting and sweeping

Read this in steps 5 and 6 of the router. The rule itself is collaboration rule 7 in [collaboration.md](../../../../planning/workflow/collaboration.md). This file has the commands.

## Merge a finished worker (SHA triple check)

Merge only after the worker's final message has arrived (its subagent finished and its log ends with `end`).

```sh
BRANCH=research/<slug>/s1-c003; PR=<number>; REPORTED=<sha from the worker's final message>
git fetch -q origin
REMOTE=$(git ls-remote origin "refs/heads/$BRANCH" | cut -f1)
HEAD_SHA=$(gh pr view "$PR" --json headRefOid --jq .headRefOid)
[ "$REMOTE" = "$HEAD_SHA" ] && [ "$HEAD_SHA" = "$REPORTED" ] && echo "triple match" || echo "MISMATCH"
gh pr view "$PR" --json mergeable,mergeStateStatus,isDraft,baseRefName
gh pr checks "$PR"
Comment thread

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 21, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Check only required PR status checks

When a PR has a failing optional or informational check but all branch-protection checks pass, this command still reports the red check and the instructions below send the worker back. gh pr checks --help documents --required as “Only show checks that are required”; without that flag, the merge gate is stricter than the stated requirement and can indefinitely block otherwise mergeable work.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
git diff --name-only "origin/main...$REPORTED" # only paths the brief let the worker write
```

Merge only when all of these hold:

- the line prints `triple match`;
- `mergeable` is `MERGEABLE`;
- `isDraft` is false;
- the base is the trunk;
- the required checks pass;
- the diff stays inside the worker's owned paths.

Then:

```sh
gh pr merge "$PR" --merge --match-head-commit "$REPORTED"
git fetch -q origin && git merge-base --is-ancestor "$REPORTED" origin/main && echo landed
Comment thread

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 21, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Verify merges against the configured trunk

When the workflow profile's trunk is not main, this ancestry check examines the wrong base ref and can fail even after the PR lands, or succeed against an unrelated branch. The worker brief already parameterizes the declared baseline as <trunk>; the merge diff and post-merge ancestry checks should resolve the same profile value rather than hard-code origin/main.

AGENTS.md reference: AGENTS.md:L42-L42

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
```

Afterwards, log `router <UTC> merge: #<PR> <sha>` and release the lease if the worker didn't: `rw lease release --package "$PKG" --stage <S> --resource <C>`.

When a check fails, act as follows. Never push to the worker's branch yourself.

- **Mismatch:** the worker pushed after reporting, or the report is wrong. Ask the worker (resume its session) for its current SHA.
- **`BEHIND` or `DIRTY`:** send it back with "merge origin/main, resolve conflicts in your own files, push, report the new SHA".
- **Red checks:** send it back with the failing check's name and log URL.

After a merge, the branch is deleted (auto-delete is on). Any follow-up for that concept and stage uses a new branch, such as `research/<slug>/s1-c003-2`.

## Detect a stalled worker

```sh
D="$(git rev-parse --git-common-dir)/agent-work/${PKG##*/}-<stage>"
tail -n 1 "$D/<name>.md" # last line and its UTC time
rw lease list --package "$PKG" # live leases and their expiry
gh pr list --head "$BRANCH" --state open --json number,url
```

A worker counts as stalled only when all three are true:

- its last log line is more than 20 minutes old;
- it holds no live lease;
- it has no open PR.

If it has an open PR but has stopped, treat it as finished and verify the PR. If it holds a live lease, it is still working.
Comment thread

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 21, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Restart stopped workers that have not submitted a report

If a worker crashes after opening its PR but before sending the final message or writing end, this rule treats it as finished and excludes it from restart because an open PR exists. The merge procedure above nevertheless requires that final report and its reported SHA for the triple match, leaving the PR permanently neither mergeable nor restartable. Resume or restart such a worker until it produces the required completion report before verification.

AGENTS.md reference: AGENTS.md:L46-L47

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

## Restart on the same branch

If the harness can resume the worker's session, resume it. Otherwise, dispatch a new subagent with the original brief (it is in `$LOG/<name>.md`) plus:

```
Resume: branch <BRANCH> already exists on origin and may have commits.
git fetch -q origin && git worktree add <worktree> <BRANCH> (or reuse the existing worktree)
git merge --no-edit origin/main (never reset, never rebase)
Read your log <D>/<name>.md to see what was done; continue from the first unfinished step.
```

Before dispatching, acquire the lease again under the new worker's name. Then log `router <UTC> restart: <old> -> <new> on <BRANCH>`.

## Sweep orphan branches

```sh
git fetch -q --prune origin
for ref in $(git for-each-ref --format='%(refname:strip=3)' "refs/remotes/origin/research/<slug>/"); do
ahead=$(git rev-list --count "origin/main..origin/$ref")
prs=$(gh pr list --head "$ref" --state all --json number --jq length)
[ "$ahead" -gt 0 ] && [ "$prs" -eq 0 ] && echo "orphan: $ref ($ahead commits ahead, no PR)"
Comment thread
Comment on lines +82 to +83

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 21, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Include branches whose prior PR was closed

If a worker's PR is closed without merging while its branch remains ahead of the trunk, this sweep never reports the branch as an orphan because --state all counts the closed PR. gh pr list --help confirms that all includes open, closed, and merged PRs, so prs remains nonzero even though there is no open PR capable of landing the work; such a unit is consequently never restarted. Query open PRs here, then separately decide whether a closed PR means the unit was superseded.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
done
```

Handle each orphan in one of two ways:

- If its unit is not done anywhere else, restart its worker on it (above), so it opens the PR.
- If the unit was redone on another branch, log `router <UTC> abandoned: <ref> superseded by <branch or PR>` and leave the branch in place. Never delete it.
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.