AGENT SKILL

do-flow

Run the doflow feature chain end to end, from idea to reviewed code. Use when the user wants the whole lifecycle run, says 'build this feature end-to-end', 'run the doflow chain' or 'take this from idea to implementation', or /do classified the request as a feature. A plain change request that names no /do-* skill goes to /do first, which decides whether it needs this flow. Skip it for one phase on its own (that phase's /do-* skill), single-file fixes, questions and reviews.

License 许可
MIT
所属仓库
khoavu882/do-flow
最近更新
2026-11-10
Stars
★ 0
Forks
0

01 前言 Front Matter

name
do-flow
effort
high
description
Run the doflow feature chain end to end, from idea to reviewed code. Use when the user wants the whole lifecycle run, says 'build this feature end-to-end', 'run the doflow chain' or 'take this from idea to implementation', or /do classified the request as a feature. A plain change request that names no /do-* skill goes to /do first, which decides whether it needs this flow. Skip it for one phase on its own (that phase's /do-* skill), single-file fixes, questions and reviews.
argument-hint
[feature description] [--from brainstorm|design|plan|implement|test|review]

02 资源文件 1

03 SKILL.md 正文

do-flow

Runs a DoFlow workflow end-to-end without a manual /do-X at every stage. The task's class selects the workflow; the resolved workflow's stages name which existing skills run, in what order, and where the run stops. do-flow does not replace or modify those skills — it invokes their own Behavioral Flows in sequence. do-constitution belongs to no class; invoke it directly when you need to set or amend repo-level rules.

You propose the class; the runtime validates it. Never the reverse. A class you assumed, or one the runtime rejected and you replaced with the familiar default, runs a confident workflow for the wrong task.

Invocation

/do-flow [feature description] [--from brainstorm|design|plan|implement|test|review]

Behavioral Flow

  1. Resolve state — run the resolver. Every DoFlow runtime call in this skill goes through the runtime seam. Resolve it once here and reuse $DOFLOW for every later call in this skill:
# Resolve the DoFlow runtime: nearest project install wins, then the global one.
D=$PWD; while [ "$D" != / ] && [ ! -x "$D/.doflow/scripts/doflow/bin/doflow-run" ]; do D=$(dirname "$D"); done
DOFLOW="$D/.doflow/scripts/doflow/bin/doflow-run"
[ -x "$DOFLOW" ] || DOFLOW="$HOME/.doflow/scripts/doflow/bin/doflow-run"
[ -x "$DOFLOW" ] || { echo "doflow: no runtime found in any .doflow/ above $PWD, nor at $HOME/.doflow. Run: npx @khoavu882/doflow install -t <harness>" >&2; exit 2; }

Run every command below from the project root — the walk-up starts at $PWD. On exit 2, print the message verbatim and stop; it names every path searched.

"$DOFLOW" paths --json

feature_slug null with a non-empty candidate_slugs is an unresolved choice, not "no active feature": ask one option per entry, re-resolve with "$DOFLOW" paths --json --slug="<chosen>", and use that slug for the rest of this flow. /do-flow passing --slug already resolves it — no prompt then.

  1. Propose one class — read the request and name exactly one class id, using the cues and the confusable pairs in this skill's own references/task_classes.md. State the class and the signal it rests on in one line. If two classes fit equally, do not take the longer one: show what each would run — "$DOFLOW" workflow --task-class "<candidate>" --json, quote its stageIds — and ask via the question tool, one option per candidate.

  2. Validate the class through the runtime — a proposal is not a selection until this returns:

"$DOFLOW" classify --task-class "<proposed>" --calling-skill do-flow --json

Branch on the returned outcome field, not the exit code.

  • ACCEPTED — the returned workflow is this run's plan of record; read stages, gates and handoff off it rather than from memory.
  • REJECTED — stop. Print message verbatim (it already names validClasses and any suggestions), ask the user to choose from validClasses, then re-validate. Never substitute feature. A rejection may be about you rather than the class (reason: caller-not-a-stage). Then the fix is to propose one of the classes in fit.hostingClasses, or to hand the work to the skill this class names for the stage you meant — not to re-propose the same class.
  • Exit 2 — surface the message verbatim and stop.

Every stage this run enters comes from the accepted workflow's stages; a phase the workflow does not declare is not run here, however familiar it is from the feature chain.

  1. Announce the selection — one line before anything runs: <taskClass> → <workflow.name>: <stageIds joined by →>, plus the gate ids if gates is non-empty. This is the user's chance to correct a misclassification cheaply.

  2. Pick the starting stage.

    • feature: resume from the first missing chain artifact — !has_requirement → the discovery stage; has_requirement && !has_design → design; has_design && !has_plan → planning; all three present → go straight to the pre-implementation gate in step 7.
    • Every other class: start at the first entry in stages.
    • --from <phase> overrides the above to deliberately re-run a stage. Match the phase to the stage whose skill is that phase's skill (brainstorm → do-brainstorm, design → do-design, plan → do-plan, implement → the stage with mutatesSource: true, test → do-test, review → do-code-review). No stage matches in this workflow → stop and list the stage ids it does have. Two stages match — bug and refactor each run do-test twice — → ask which one.
  3. Run the stages in order, invoking each stage's skill Behavioral Flow directly.

    • optional: true — decide from that stage's own purpose, then say which way you went and why. Never drop an optional stage silently.
    • readinessTemplate is non-null — consult readiness before entering the stage: "$DOFLOW" readiness --task-class "<taskClass>" --task-id "<task id>" --mode workflow --json. Both --task-class and --task-id are required; omitting either exits 2 and names the valid set. Act on the returned stageEntry.decision — the entry policy is the runtime's, not this page's: ENTER → enter the stage; GATHER_FIRST → report the missing items and gather them first, do not enter; ASK_USER → ask the owed decision and wait; STOP → stop and surface the conflicted claim.
    • readinessTemplate is null — enter the stage. Do not consult readiness "to be safe": a workflow whose requiresImplementationReadiness is false has no implementation to be ready for and declares no template by design (references/task_classes.md). Calling it anyway invents a gate the registry does not declare.
    • After each stage, report one line: stage id, skill, and the artifact path or result it produced — so the user can follow without intervening.
  4. Stop at the gates the resolved workflow declares — read them from workflow.gates, each attached to a stage by afterStage. trigger: always stops every time; any other trigger stops only when that named condition actually holds. Ask with the gate's own prompt via the question tool. For the feature workflow's three, which behave as they always have:

    • gate-0 (after discovery, trigger unresolved-clarifications) — a safety net, not the normal path: do-brainstorm resolves ambiguities to zero via its own loop, so this fires only if a [NEEDS CLARIFICATION] marker survived an aborted session. Ask one question per marker (grouped if closely related), patch the answers into requirement.md directly, and do not re-run do-brainstorm. Then follow steps 1-4 of the decision step in the guidance tree's references/WORKFLOW_HANDOFF.md (stage discovery, channel question) so the answers are registered and cited; do-brainstorm already recorded discovery's handoff, so record none.
    • gate-a (after planning) — the conversational checkpoint on top of the already-existing advisory hook (pre-implement-gate.sh; its scope is in references/DOFLOW_CHAIN.md), which still reports a missing artifact. Options: Proceed / Let me review the artifacts first / Stop here.
    • gate-b (after review) — no enforcement hook exists for this today; /do-git is a separate, always-manually-invoked skill. Frame the question by the review's own approval status: on CHANGES REQUESTED, foreground addressing the findings rather than offering a bare proceed. A workflow with an empty gates array stops at none of these. It still stops on a readiness block, on an ambiguous answer, and on any stage skill's own stopping rule.

    Record every answer that is a decision. Asking is not recording: a gate this skill asked but never wrote back stays open in the run, so the stage skill that owns it asks the same question again — the user answers twice for one decision. Immediately after the user answers, write it:

    "$DOFLOW" orchestrate --action decide-gate --task-id "<slug>" --gate "<gate id>" --decision approve|reject --note "<the user's own answer, one line>" --json
    

    Map each gate's own option set onto the two decisions the runtime accepts, and never onto a third:

    • gate-a — Proceed is approve; Stop here is reject. Let me review the artifacts first is neither: it is a pause, not a decision, so call nothing and actually pause — hold the run at this gate and re-ask once the user comes back, exactly as step 8's ambiguous-answer rule already requires.
    • gate-b — an actual "proceed to commit/merge" answer is approve; an explicit stop is reject. Anything that is not a real decision — "let me address the findings first" on a CHANGES REQUESTED review, most often — is neither, and gets no decide-gate call. reject terminates the run outright, which is a different answer from "not now".
    • gate-0 — only in the aborted-session branch above, where this skill patched requirement.md itself: once every surviving marker is resolved, approve. If any marker is still open, leave the gate alone. This call is advisory to the trail, not to the chain: if it fails for a reason outside this flow's control (an unwritable local state directory, say), report the failure plainly and carry the user's answer forward anyway — the answer is what governs whether the next stage runs, and the record of it is what keeps the next stage from asking again.

    When the answer also carries a choice beyond approve or reject and paths --json reports has_decisions: true, register it too, once decision --action list shows no live decision with that statement; the receiving stage's batch then leaves it out:

    "$DOFLOW" decision --action add --topic "<key>" --statement "<text>" --channel gate --stage "<stage the gate follows>" --rationale "<text>" --json
    
  5. Never skip a gate on an ambiguous answer — an unanswered or unclear response to the question tool means stop and ask again, per RULE_04 in rules/RULES.md. When the terminal stage completes, state workflow.handoff as the next step rather than continuing into it.

Conditional research within a feature

Before a feature stage relies on an external fact that local or user evidence cannot establish, or when the developer explicitly asks a research question, let that stage follow ../do-document/references/embedded-research.md. The stage opens a same-task research-request, records a source-linked finding or gap, then resumes itself without adding a seventh workflow stage. On resume, read request status and context pack. A blocking unanswered question prevents stage completion; neither research nor a retrieved page approves any existing gate. Feature discovery and design run the ideation pass; otherwise search only for a gap or an explicit request.

Boundaries

Will:

  • Propose a task class, validate it through the runtime, and run the resolved workflow's stages in order without a manual re-invocation at each boundary.
  • Stop only where the resolved workflow says to: its declared gates, a readiness block, or an ambiguous answer.
  • Record each gate answer it collects through orchestrate --action decide-gate, so the stage skill that owns that gate finds it already resolved instead of asking the user the same question twice.
  • Compose with the existing pre-implement-gate.sh advisory hook rather than bypass or duplicate it. That hook keys on branch and artifact state, not on class, so it can advise against a bug or trivial-edit workflow's edits on a branch that already holds an incomplete feature dir — surface its message as written.

Will Not:

  • Run any workflow for a class the runtime rejected, or replace a rejected class with feature.
  • Infer a class silently when two fit, or read a class the user stated as a suggestion.
  • Consult implementation readiness for a stage that declares no readiness template, or invent a readiness template for a class that has none.
  • Modify any stage skill, or invoke do-constitution — it is standalone and in no class.
  • Add a hook-level enforcement gate for commit/merge — gate-b is conversational only. A hook-level version would be a separate, future proposal.
  • Silently proceed past a gate on an ambiguous or missing answer.
  • Record a pause or a deferral as a gate decision — Let me review the artifacts first and "let me address the findings first" are neither approve nor reject, and forcing them into one writes a decision the user did not make.

Next Step: whatever the resolved workflow.handoff names — for every class that ends in a change, /do-git to commit/merge once the last gate is cleared.

04 同仓库更多 Skills

khoavu882
khoavu882/do-flow

beta

暂无简介

★ 0
khoavu882
khoavu882/do-flow

alpha

暂无简介

★ 0
khoavu882
khoavu882/do-flow

do

DoFlow universal dispatcher and the entry point for a plain code-change request: it classifies the task, routes it to the matching /do-* workflow and applies that workflow's gates. Use whenever the user asks to add, fix, change or build something in code without naming a /do-* skill, a request bundles several unrelated asks, or needs a tool recommendation or effort estimate first (e.g., 'add a retry to the upload client in src/upload.js', 'give me a rough estimate for this change', 'first do X, then document Y'). Skip it for questions about how existing code behaves, explanations, reviews, and work already inside a /do-* skill.

★ 0
khoavu882
khoavu882/do-flow

do-test

Execute project builds, automated test suites, and coverage verification with intelligent error reporting across whatever toolchain the repo already uses. Use whenever the user wants to run existing tests, execute test suites, verify builds, check test coverage, or check compile status (e.g., 'run the tests', 'execute test suite', 'check coverage', 'verify build', 'does this still build'). Always activate this skill when verifying test suites or running builds without writing new application code.

★ 0
khoavu882
khoavu882/do-flow

do-plan

Generate the implementation plan (HOW) and dependency-ordered task checklist from requirement.md + design.md (plus design/specs.md's IC-### interface contracts when the feature has one), with a Constitution Check gate, as Phase 3 of the doflow chain. Use whenever requirement.md and design.md exist and the next step is creating an actionable, owner-and-file-scoped task breakdown before implementation, or when the user says 'create an implementation plan', 'break this down into tasks', 'plan the work', or 'plan Phase 3'. Always activate this skill before executing feature implementation.

★ 0
khoavu882
khoavu882/do-flow

do-implement

Direct, standalone code implementation from a description, /do-code-review findings, or an existing task — no DoFlow chain artifacts required. Use when the user names /do-implement, says 'now implement that', 'fix what the review found' or 'address these comments', or /do routed a bug, refactor, dependency change or small edit here. A plain change request that names no /do-* skill goes to /do first, which classifies it and routes it back here when it fits. Skip it for questions, reviews, and new features that need the full chain.

★ 0