Add /flow-card: author a card's completion contract before triage - #9
Open
dinershtein wants to merge 3 commits into
Open
Add /flow-card: author a card's completion contract before triage#9dinershtein wants to merge 3 commits into
dinershtein wants to merge 3 commits into
Conversation
A rough card is underspecified in exactly the ways triage detects and cannot fix alone, so it pays a three-command round-trip: /flow-check → [meta] QUESTIONS → Human Questions → /flow-questions → Backlog → /flow-check again. The human answers hours later, without the context that made the intention obvious when they typed it. /flow-card <rough intention> moves that Q&A to authoring time: ground the sentence in the repo, sort the eight card-eval gap categories through the same auto-answer policy triage uses ([meta] ASSUMED for the safe ones), ask at most three AskUserQuestion turns for the gaps that genuinely need a human, then create one Backlog card carrying a completion contract (Goal / Why / Done when / Out of scope / Stop if / Context). Deliberately not a second planner: no approach, no file manifest, no test commands — the WHAT/HOW split and the plan-approval gate are untouched. Exactly one card per invocation; an intention worth several PRs is narrowed to its first slice and the rest parked in Icebox, so /flow-check's SPLIT path stays the single tested splitter. No new config keys, no new states, no changes to any existing prompt — the artifact is an ordinary Backlog card and every downstream stage is unchanged. A hand-written card behaves exactly as before. Verification: kit-invariants 154/154, kit-bin 49/49. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdu4p6jdzNSQd7P71iBw8G
Three corrections from reading MoonshotAI/kimi-code's goal mode (its write-goal skill plus the runtime spec in its GOAL.md): - Show before you create. The command wrote the card and then printed it, so the human first read the contract on the board — where every wording fix costs a round-trip through the tracker UI. Now the full title and body are shown with the choices behind them, and a final Create/Revise/Discard gesture gates create_item. The approval turn is explicitly outside the three-question budget, which is for gaps. - Done when = proof, not effort. The bullet asked for observable behavior and warned off commands, which reads as "don't name the test suite". It should name an existing verification when the repo has one — a suite, a lint rule, a zero-hit search, a metric — while still not prescribing the approach that reaches it. - A first failing attempt is not a stop condition. `## Stop if` invited escalation at the first snag; kimi's blocked audit (a blocker must survive repeated turns, and "large / slow / unclear / would benefit from clarification" never qualifies) is the right bar for a card that meta and the worker both read. Verification: kit-invariants 154/154 (flow-card.md 236 lines, budget 270). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdu4p6jdzNSQd7P71iBw8G
Self-review found the step-7 approval gate contradicted two exits added before it. The Escapes branch (Park in Icebox, cancelled prompt) and the Too big branch both said "create in icebox" from step 5 — skipping compose and approval, and contradicting the contract line one screen above that forbids exactly that. Both now change the destination, not the route: still composed, still shown, created in step 8. A parked card is one the human reads months later, so it earns the same review as any other. Also: `## Done when` was told to name an existing verification without being told to go find one. Step 2 now reads the target's test_cmd / lint_cmd from tracker.json and notes what the repo already uses to prove this kind of change — the card cannot ask for proof the author never looked for. Verification: kit-invariants 154/154 (flow-card.md 246 lines, budget 270). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdu4p6jdzNSQd7P71iBw8G
Contributor
Author
|
Self-review before asking for a second pair of eyes — two defects found and fixed in 443fe46:
Not covered by anything here: this command has never created a card. The kit's tier-2 (behavioral) checks are deliberately out of CI, so everything green above is static. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What failure mode this closes
A rough card is underspecified in exactly the ways triage detects and cannot fix alone, so it pays a three-command round-trip:
/flow-check→[meta] QUESTIONS→Human Questions→/flow-questions→Backlog→/flow-checkagain. The questions are the same either way; the human just answers them hours later, without the context that made the intention obvious when they typed it./flow-card <rough intention>moves that Q&A to authoring time:learnings.jsonlpitfalls are read).card-eval.mdgap categories through the same auto-answer policy triage uses — safe defaults become[meta] ASSUMEDcomments, onlyWhat/Why/Dependencies/ split-implyingSizereach the human.AskUserQuestionturns, each with aPark in Iceboxescape.create_itembehind aCreate it/Revise/Discardapproval.## Goal,## Why,## Done when,## Out of scope,## Stop if,## Context.Deliberate limits
Icebox./flow-check's SPLIT path stays the single tested splitter.## Stop ifbullet and the existingQUESTIONSroute handles it.No new config keys (
config-contract.txtuntouched), no new states, no changes to any existing prompt.create_item/update_titleare already required provider ops, so Trello and GitHub both work;native_ids: yessuppresses the[PREFIX-N]title prefix automatically.Prior art
The contract shape (end state / proof / boundaries / loop / stop rule), "define proof, not effort", show-the-exact-text-before-starting, and the "a prose menu of options is a defect — use AskUserQuestion" rule are adapted from MoonshotAI/kimi-code's builtin
write-goalskill (MIT). Re-implemented against this kit's card/PLAN architecture — nothing copied verbatim, and goal mode's runtime half has no analogue here (agent-flow's driver is/flow-run).Verification
kit/commands/flow-card.mdis 236 lines against a new 270-line budget intests/kit-invariants.sh.Contract lines that moved
None. This PR adds a command and its budget;
card-eval.md,plan-format.md,flow-check.md,flow-run.mdand every worker prompt are unchanged.docs/design-notes.mdrecords problem → mechanism → limit.🤖 Generated with Claude Code
https://claude.ai/code/session_01Tdu4p6jdzNSQd7P71iBw8G