Skip to content

feat: redesign empty-queue behavior — stay in repo, audit, present, stop#9

Merged
fyodoriv merged 1 commit into
mainfrom
feat/next-task-stay-in-repo
Apr 8, 2026
Merged

feat: redesign empty-queue behavior — stay in repo, audit, present, stop#9
fyodoriv merged 1 commit into
mainfrom
feat/next-task-stay-in-repo

Conversation

@fyodoriv
Copy link
Copy Markdown
Collaborator

@fyodoriv fyodoriv commented Apr 8, 2026

Summary

  • Removed find ~/apps cross-repo search from all next-task command variants
  • When queue is empty, agents now: clean up current repo, run project audit, present findings to user, stop and wait
  • Agents never auto-implement audit findings or switch to other repos
  • Updated canonical source (commands/next-task.md) and regenerated all 6 agent variants
  • Updated README step list to reflect new behavior

Test plan

  • grep -r "find ~/apps" commands/ README.md returns no results
  • All 6 command variants contain "audit and stop" section
  • README step 13 describes present-and-stop behavior
  • Constraints updated: "Do not switch repos" replaces "Do not switch repos silently"

Generated with Devin

When the task queue is empty, agents now:
1. Clean up the current repo (merge PRs, prune worktrees)
2. Run a project audit (lint, tests, security, dead code, etc.)
3. Present findings to the user as candidate tasks
4. Stop and wait for direction

Removed the `find ~/apps` cross-repo search that caused agents to
drift into unrelated codebases. Updated all 6 command variants via
generate-commands and the README step list.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@fyodoriv fyodoriv merged commit 1ac7706 into main Apr 8, 2026
3 checks passed
@fyodoriv fyodoriv deleted the feat/next-task-stay-in-repo branch April 8, 2026 13:19
fyodoriv added a commit that referenced this pull request May 4, 2026
…ess/Pivot/Measurement/Anchor + Estimate/Verification/Risk) (#78)

Promote 8 fields Minsky has been treating as "custom" to first-class
metadata and add a dedicated **Rule-#9 pre-registration block** section
to spec.md so non-trivial changes can declare their predicted observable
*before* the code is written — preventing post-hoc fishing for flattering
metrics (Munafò et al. 2017) and pre-registering the give-up criterion
(Ries 2011, pivot-or-persevere). Updates README, the canonical
`commands/next-task.md`, and regenerates the 6 variant SKILL files.

Co-authored-by: Your Name <your@email.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fyodoriv added a commit that referenced this pull request May 21, 2026
Replaces the "Plan (complex tasks only)" section in `commands/next-task.md`
with a 5-step "Plan and validate" workflow:

1. Check for an existing validated plan at `docs/plans/<task-id>.md`
2. Write the plan from `examples/plan-template.md`
3. Validate with a reviewer subagent (`reviewer` profile, fallback chain
   `qa-engineer` → `researcher`); the subagent appends a `## Reviewer
   verdict` block — only `approved` lets work proceed; `needs-revision`
   triggers up to 3 revision cycles; `reject` halts and reports
4. Pre-register the rule-#9 metric in the task block
5. Implement

Trivial tasks (single file, <30 minutes, obvious fix) keep skipping the
plan step. The legacy `**Plan**:` inline-checklist field in TASKS.md is
superseded for the canonical workflow; the linter still accepts it for
backwards compat.

Why: today the same agent both writes and executes the plan. No second
opinion. A separate plan file + reviewer-subagent validation makes
deliberation external, diffable, and re-runnable. See the plan in
`docs/plans/next-task-plan-first-workflow.md` for the full motivation
and risk analysis.

This commit also:
- Updates `commands/lint-tasks.md` with a prose-only convention paragraph
  (no linter binary change; hard CI gate deferred to follow-up task
  `lint-tasks-md-plan-required-gate`).
- Updates `AGENTS.md` "Task Queue Policy" section to point at the new
  workflow instead of the legacy `**Plan**:` checklist.
- Updates `README.md` "What it does" step 12 to mention the new flow.
- Regenerates all 12 agent variants via `npx tasks generate-commands`
  so `commands-drift` CI stays green.

Verification: `npm run build`, `npm test` (238 tests across 6 packages,
all green), `npm run lint`, `npx -y @tasks-md/lint TASKS.md` all green.
fyodoriv added a commit that referenced this pull request May 21, 2026
Replaces the "Plan (complex tasks only)" section in `commands/next-task.md`
with a 5-step "Plan and validate" workflow:

1. Check for an existing validated plan at `docs/plans/<task-id>.md`
2. Write the plan from `examples/plan-template.md`
3. Validate with a reviewer subagent (`reviewer` profile, fallback chain
   `qa-engineer` → `researcher`); the subagent appends a `## Reviewer
   verdict` block — only `approved` lets work proceed; `needs-revision`
   triggers up to 3 revision cycles; `reject` halts and reports
4. Pre-register the rule-#9 metric in the task block
5. Implement

Trivial tasks (single file, <30 minutes, obvious fix) keep skipping the
plan step. The legacy `**Plan**:` inline-checklist field in TASKS.md is
superseded for the canonical workflow; the linter still accepts it for
backwards compat.

Why: today the same agent both writes and executes the plan. No second
opinion. A separate plan file + reviewer-subagent validation makes
deliberation external, diffable, and re-runnable. See the plan in
`docs/plans/next-task-plan-first-workflow.md` for the full motivation
and risk analysis.

This commit also:
- Updates `commands/lint-tasks.md` with a prose-only convention paragraph
  (no linter binary change; hard CI gate deferred to follow-up task
  `lint-tasks-md-plan-required-gate`).
- Updates `AGENTS.md` "Task Queue Policy" section to point at the new
  workflow instead of the legacy `**Plan**:` checklist.
- Updates `README.md` "What it does" step 12 to mention the new flow.
- Regenerates all 12 agent variants via `npx tasks generate-commands`
  so `commands-drift` CI stays green.

Verification: `npm run build`, `npm test` (238 tests across 6 packages,
all green), `npm run lint`, `npx -y @tasks-md/lint TASKS.md` all green.
fyodoriv added a commit that referenced this pull request May 21, 2026
* docs(plans): add plan-first workflow plan + examples/plan-template.md

Establishes the `docs/plans/` convention and ships the canonical template
that the new `/next-task` "Plan and validate" step references. The plan
file at `docs/plans/next-task-plan-first-workflow.md` documents the
workflow change itself (meta-bootstrap) and was validated by a reviewer
subagent in two passes (first pass: needs-revision with 6 concerns;
second pass: approved after the revisions addressed each concern).

Why: the existing "Plan (complex tasks only)" rule lets the same agent
both write and execute the plan — no second opinion. Plans-in-TASKS.md
are write-only. A separate plan file + reviewer-subagent validation
makes deliberation external, diffable, and re-runnable, while preserving
the "trivial fixes skip planning" exemption.

Acceptance criterion 8 of the plan (gate: `**Verdict**: approved` must
appear in the plan file before any code-commit lands) is satisfied:

  awk '/^## Reviewer verdict\$/,0' docs/plans/next-task-plan-first-workflow.md \
    | grep '^- \*\*Verdict\*\*:' | tail -1
  → - **Verdict**: approved

* feat(commands): add plan-and-validate workflow to /next-task

Replaces the "Plan (complex tasks only)" section in `commands/next-task.md`
with a 5-step "Plan and validate" workflow:

1. Check for an existing validated plan at `docs/plans/<task-id>.md`
2. Write the plan from `examples/plan-template.md`
3. Validate with a reviewer subagent (`reviewer` profile, fallback chain
   `qa-engineer` → `researcher`); the subagent appends a `## Reviewer
   verdict` block — only `approved` lets work proceed; `needs-revision`
   triggers up to 3 revision cycles; `reject` halts and reports
4. Pre-register the rule-#9 metric in the task block
5. Implement

Trivial tasks (single file, <30 minutes, obvious fix) keep skipping the
plan step. The legacy `**Plan**:` inline-checklist field in TASKS.md is
superseded for the canonical workflow; the linter still accepts it for
backwards compat.

Why: today the same agent both writes and executes the plan. No second
opinion. A separate plan file + reviewer-subagent validation makes
deliberation external, diffable, and re-runnable. See the plan in
`docs/plans/next-task-plan-first-workflow.md` for the full motivation
and risk analysis.

This commit also:
- Updates `commands/lint-tasks.md` with a prose-only convention paragraph
  (no linter binary change; hard CI gate deferred to follow-up task
  `lint-tasks-md-plan-required-gate`).
- Updates `AGENTS.md` "Task Queue Policy" section to point at the new
  workflow instead of the legacy `**Plan**:` checklist.
- Updates `README.md` "What it does" step 12 to mention the new flow.
- Regenerates all 12 agent variants via `npx tasks generate-commands`
  so `commands-drift` CI stays green.

Verification: `npm run build`, `npm test` (238 tests across 6 packages,
all green), `npm run lint`, `npx -y @tasks-md/lint TASKS.md` all green.
fyodoriv added a commit that referenced this pull request May 21, 2026
Lift the rule-#9 pre-registration check (Hypothesis, Success/Acceptance,
Pivot, Measurement, Anchor) from Minsky's repo-local
scripts/check-rule-9-tasksmd-fields.mjs into @tasks-md/lint as a
first-class opt-in rule.

The pattern prevents post-hoc fishing for flattering metrics (Munafò
et al. 2017) and pre-registers the give-up criterion (Ries 2011,
pivot-or-persevere) by forcing the team to declare what observable a
non-trivial change is expected to move *before* the code is written.
spec.md § rule-9-pre-registration-block already documents the fields
(PR #78); this PR ships the deterministic gate.

Why it's opt-in:
- Most TASKS.md files won't want every task pre-registered. Teams that
  want machine-enforced rule-#9 discipline pass `--require-prereg`.
- Adopting on an existing repo is a two-step ratchet:
  `--prereg-allowlist=<file>` grandfathers legacy IDs while preventing
  *new* tasks from regressing. Allowlisted blocks still surface in the
  count so the operator sees remaining backfill debt.

Surface:
- `tasks-lint --require-prereg TASKS.md` — enforce the five fields
- `tasks-lint --require-prereg --prereg-allowlist=.prereg-allowlist TASKS.md` — ratchet adoption
- `import { parseRule9Blocks, classifyRule9Blocks, parseAllowlistFile, lintRule9Content } from "@tasks-md/lint"` — programmatic API

Tests: 16 new tests (62 total in @tasks-md/lint); parser/MCP unaffected.

---
_🤖 Written by an agent, not Fyodor. Ping me if this looks off._
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