@hassangameryt/freeflow 0.1.0 → 0.2.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 (89) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +8 -4
  3. package/package.json +15 -2
  4. package/plugins/freeflow/.claude-plugin/plugin.json +1 -1
  5. package/plugins/freeflow/.codex-plugin/plugin.json +1 -1
  6. package/plugins/freeflow/command-surface.json +2 -10
  7. package/plugins/freeflow/docs/README.md +3 -2
  8. package/plugins/freeflow/docs/adr/0002-evals-before-hooks.md +1 -1
  9. package/plugins/freeflow/docs/adr/0003-release-boundary.md +1 -1
  10. package/plugins/freeflow/docs/adr/0004-research-replaces-shallow-discovery-skills.md +26 -0
  11. package/plugins/freeflow/docs/adr/README.md +2 -1
  12. package/plugins/freeflow/docs/architecture.md +3 -3
  13. package/plugins/freeflow/docs/output-router.md +212 -0
  14. package/plugins/freeflow/docs/release-evidence.md +25 -5
  15. package/plugins/freeflow/docs/skills.md +6 -7
  16. package/plugins/freeflow/docs/workflow.md +1 -1
  17. package/plugins/freeflow/hooks/freeflow-runtime-context.mjs +23 -6
  18. package/plugins/freeflow/pi-extension/index.js +941 -15
  19. package/plugins/freeflow/router/dist/benchmark-harness.d.ts +32 -0
  20. package/plugins/freeflow/router/dist/benchmark-harness.js +92 -0
  21. package/plugins/freeflow/router/dist/benchmarks.d.ts +102 -0
  22. package/plugins/freeflow/router/dist/benchmarks.js +880 -0
  23. package/plugins/freeflow/router/dist/bounded-evidence.d.ts +40 -0
  24. package/plugins/freeflow/router/dist/bounded-evidence.js +310 -0
  25. package/plugins/freeflow/router/dist/codex-qa-benchmarks.d.ts +91 -0
  26. package/plugins/freeflow/router/dist/codex-qa-benchmarks.js +461 -0
  27. package/plugins/freeflow/router/dist/command-benchmarks.d.ts +128 -0
  28. package/plugins/freeflow/router/dist/command-benchmarks.js +652 -0
  29. package/plugins/freeflow/router/dist/config.d.ts +22 -0
  30. package/plugins/freeflow/router/dist/config.js +114 -0
  31. package/plugins/freeflow/router/dist/evidence-range-selector.d.ts +22 -0
  32. package/plugins/freeflow/router/dist/evidence-range-selector.js +180 -0
  33. package/plugins/freeflow/router/dist/evidence-search.d.ts +25 -0
  34. package/plugins/freeflow/router/dist/evidence-search.js +450 -0
  35. package/plugins/freeflow/router/dist/evidence.d.ts +38 -0
  36. package/plugins/freeflow/router/dist/evidence.js +196 -0
  37. package/plugins/freeflow/router/dist/experimental-local-index.d.ts +1 -0
  38. package/plugins/freeflow/router/dist/experimental-local-index.js +1 -0
  39. package/plugins/freeflow/router/dist/experiments/local-index.d.ts +58 -0
  40. package/plugins/freeflow/router/dist/experiments/local-index.js +562 -0
  41. package/plugins/freeflow/router/dist/index-benchmarks.d.ts +84 -0
  42. package/plugins/freeflow/router/dist/index-benchmarks.js +458 -0
  43. package/plugins/freeflow/router/dist/index.d.ts +12 -0
  44. package/plugins/freeflow/router/dist/index.js +12 -0
  45. package/plugins/freeflow/router/dist/line-ranges.d.ts +22 -0
  46. package/plugins/freeflow/router/dist/line-ranges.js +22 -0
  47. package/plugins/freeflow/router/dist/parsers.d.ts +16 -0
  48. package/plugins/freeflow/router/dist/parsers.js +473 -0
  49. package/plugins/freeflow/router/dist/repo-traversal.d.ts +18 -0
  50. package/plugins/freeflow/router/dist/repo-traversal.js +242 -0
  51. package/plugins/freeflow/router/dist/retrieve.d.ts +33 -0
  52. package/plugins/freeflow/router/dist/retrieve.js +855 -0
  53. package/plugins/freeflow/router/dist/router-contract.d.ts +10 -0
  54. package/plugins/freeflow/router/dist/router-contract.js +54 -0
  55. package/plugins/freeflow/router/dist/run.d.ts +26 -0
  56. package/plugins/freeflow/router/dist/run.js +356 -0
  57. package/plugins/freeflow/router/dist/schema.d.ts +18 -0
  58. package/plugins/freeflow/router/dist/schema.js +354 -0
  59. package/plugins/freeflow/router/dist/types.d.ts +234 -0
  60. package/plugins/freeflow/router/dist/types.js +9 -0
  61. package/plugins/freeflow/router/dist/vault.d.ts +80 -0
  62. package/plugins/freeflow/router/dist/vault.js +484 -0
  63. package/plugins/freeflow/skills/commit-work/SKILL.md +17 -16
  64. package/plugins/freeflow/skills/commit-work/references/staging-decisions.md +3 -3
  65. package/plugins/freeflow/skills/execute-plan/SKILL.md +70 -5
  66. package/plugins/freeflow/skills/execute-plan/references/execution-map.md +122 -0
  67. package/plugins/freeflow/skills/mode-contract/SKILL.md +1 -1
  68. package/plugins/freeflow/skills/output-router/SKILL.md +69 -0
  69. package/plugins/freeflow/skills/output-router/references/safety-policy.md +33 -0
  70. package/plugins/freeflow/skills/research/ARTIFACT-DESTINATIONS.md +58 -0
  71. package/plugins/freeflow/skills/research/CHECKPOINTS.md +74 -0
  72. package/plugins/freeflow/skills/research/LANGUAGE.md +61 -0
  73. package/plugins/freeflow/skills/research/SKILL.md +128 -0
  74. package/plugins/freeflow/skills/review-artifact/SKILL.md +34 -1
  75. package/plugins/freeflow/skills/review-artifact/references/reviewer-prompt.md +12 -1
  76. package/plugins/freeflow/skills/review-work/SKILL.md +25 -2
  77. package/plugins/freeflow/skills/review-work/references/reviewer-prompt.md +8 -0
  78. package/plugins/freeflow/skills/setup-freeflow/SKILL.md +14 -4
  79. package/plugins/freeflow/skills/setup-freeflow/references/activation-contract.md +8 -3
  80. package/plugins/freeflow/skills/setup-freeflow/references/host-setup.md +3 -1
  81. package/plugins/freeflow/skills/setup-freeflow/references/output-router-setup.md +52 -0
  82. package/plugins/freeflow/skills/workflow/SKILL.md +11 -3
  83. package/plugins/freeflow/skills/workflow/references/workflow-map.md +10 -11
  84. package/plugins/freeflow/skills/write-skill/SKILL.md +1 -1
  85. package/plugins/freeflow/skills/capture-decisions/SKILL.md +0 -95
  86. package/plugins/freeflow/skills/capture-decisions/references/destination-guide.md +0 -65
  87. package/plugins/freeflow/skills/grill-context/SKILL.md +0 -79
  88. package/plugins/freeflow/skills/grill-context/references/approach-framing.md +0 -52
  89. package/plugins/freeflow/skills/research-brief/SKILL.md +0 -69
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: research
3
+ description: Use when shaping an idea, feature, architecture direction, vague task, or consequential question before spec, plan, build, or durable memory. Use when evidence, brainstorming, targeted questions, and decision checkpointing need to interleave.
4
+ ---
5
+
6
+ # Research
7
+
8
+ Research is the discovery loop before action: evidence-guided back-and-forth that finds high-leverage decisions and ends in a checkpoint.
9
+
10
+ For short-lived work, the checkpoint can stay in chat. When it must guide later work, save it in the narrowest owning artifact: spec, plan, handoff, decision note, ADR, or domain memory.
11
+
12
+ Goal: enough evidence and shared understanding to checkpoint the current direction and route to spec, plan, more research, durable memory, build, or stop without inventing product, domain, scope, public API, security, privacy, billing, data-loss, compatibility, or architecture decisions.
13
+
14
+ ## Language
15
+
16
+ Use the same architecture language when shaping work. Read `LANGUAGE.md` when the research needs deeper language mapping or the checkpoint will shape architecture:
17
+
18
+ - **Module** — the thing being understood, built, or reshaped; it has an **interface** and an **implementation**.
19
+ - **Interface** — what users, callers, or future agents must know to use or continue the work correctly.
20
+ - **Implementation** — the details that can stay hidden behind the interface.
21
+ - **Depth** — leverage at the interface. **Deep** means a small interface carries a lot of useful behavior. **Shallow** means the user, caller, or future agent must coordinate too many details.
22
+ - **Seam** — where behavior, ownership, or variation can change without rewriting the surrounding work.
23
+ - **Adapter** — a concrete thing satisfying an interface at a seam.
24
+ - **Leverage** — how much future work one question, decision, or interface unlocks.
25
+ - **Locality** — keeping evidence, decisions, tests, and changes where future work can find them.
26
+
27
+ Use the **deletion test** on questions, decisions, and proposed modules: if skipping it makes complexity spread downstream, it matters. If skipping it makes complexity vanish, it was ceremony.
28
+
29
+ ## Loop
30
+
31
+ 1. Identify the target: repo area, artifact, URL, product, model, package, paper, issue, or idea. If multiple plausible targets would change research, ask for the source.
32
+ 2. Inspect the smallest evidence that can answer the current question: code, tests, docs, ADRs, specs, logs, issues, provided context, or current external sources.
33
+ 3. Explain the current understanding in plain language.
34
+ 4. Ask one path-changing question when the answer would change the next route.
35
+ 5. Let the user challenge, counter-question, or go deeper. Treat that as research input, not interruption.
36
+ 6. Refresh evidence when new claims, conflicts, or branches appear.
37
+ 7. Track decisions as settled, tentative, or open.
38
+ 8. Stop when remaining ambiguity would not change the next artifact or action.
39
+
40
+ Research may move through evidence, brainstorming, targeted questioning, and checkpointing in any order. Do not force a fixed sequence when the evidence or conversation needs a loop.
41
+
42
+ ## Question Discipline
43
+
44
+ Prefer deeper questions over more questions. Ask as many as the situation needs, but each question should earn its place: a good question collapses branches; a shallow question collects approvals.
45
+
46
+ Before asking, run the question deletion test:
47
+
48
+ ```text
49
+ If I do not ask this, does downstream complexity spread?
50
+ ```
51
+
52
+ If no, skip it.
53
+
54
+ Bad question:
55
+
56
+ ```text
57
+ Should the button be blue or green?
58
+ ```
59
+
60
+ when the feature purpose is still unclear.
61
+
62
+ Good question:
63
+
64
+ ```text
65
+ Is this for one workflow or many workflows?
66
+ ```
67
+
68
+ because it changes the module interface, spec shape, and test surface.
69
+
70
+ Long question chains are a failure mode, not diligence. Do not answer pressure for "every question" or "25-50 questions" by dumping a long questionnaire. That creates shallow approvals.
71
+
72
+ Do not turn recommendations into an approval script. Recommendations should clarify tradeoffs, not make it easy to rubber-stamp many decisions. Give the recommendation when useful, then wait when the choice is user-owned.
73
+
74
+ Instead of a long questionnaire: inspect evidence, name the decision tree, group lower-level unknowns, and ask the first high-leverage question that changes the next route. Continue in later turns as needed.
75
+
76
+ After a few path-changing questions, or whenever the user introduces a new claim, inspect evidence, summarize, or checkpoint before asking more.
77
+
78
+ ## Decision Discipline
79
+
80
+ Read `ARTIFACT-DESTINATIONS.md` when a checkpoint or decision must survive beyond chat and the owning destination is not obvious.
81
+
82
+ Not every answer is durable. Keep a lightweight ledger:
83
+
84
+ - **Settled** — explicit user decision or evidence-backed fact.
85
+ - **Tentative** — useful working assumption, not authority.
86
+ - **Open** — unresolved question that can change the next route.
87
+
88
+ Persist a decision only when absence would make future work rediscover or contradict it.
89
+
90
+ Put durable decisions where they belong:
91
+
92
+ - Domain term or meaning -> existing glossary, `CONTEXT.md`, or domain doc.
93
+ - Feature behavior, scope, or acceptance -> spec.
94
+ - Future implementation path -> plan.
95
+ - Immediate continuation state -> handoff.
96
+ - Hard-to-reverse, surprising tradeoff chosen from alternatives -> ADR.
97
+ - No durable value -> leave it in chat.
98
+
99
+ If the destination is missing or ambiguous, ask before writing.
100
+
101
+ ## Stop Conditions
102
+
103
+ Stop and ask the user when research reveals a user-owned decision, source-of-truth conflict, path conflict, material method substitution, or ambiguous artifact destination.
104
+
105
+ Do not write implementation files from research.
106
+
107
+ Write specs, plans, ADRs, handoffs, or decision notes only when the user asks or the checkpoint must guide later work.
108
+
109
+ Do not leave research by silently jumping to spec, plan, or build. Close with a checkpoint when consequential direction changed.
110
+
111
+ ## Checkpoint Shape
112
+
113
+ Read `CHECKPOINTS.md` when saving a checkpoint or choosing chat versus artifact.
114
+
115
+ Use this shape when ending a research pass or routing forward. Save it in the owning artifact when it must survive beyond chat. Omit sections that do not apply.
116
+
117
+ ```text
118
+ Question / goal: ...
119
+ Evidence: ...
120
+ Current understanding: ...
121
+ Settled: ...
122
+ Tentative: ...
123
+ Open: ...
124
+ Recommendation: ...
125
+ Next: Forward | Backward | Branch | Stop — ...
126
+ ```
127
+
128
+ `Next:` is routing, not permission to create the next artifact.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: review-artifact
3
- description: Use when asked to review whether a spec, plan, decision note, research brief, handoff, or other durable artifact is fit to guide future work.
3
+ description: Use when asked to review whether a spec, plan, decision note, research checkpoint, handoff, or other durable artifact is fit to guide future work; also use when adjudicating artifact-review findings or repeated review loops.
4
4
  ---
5
5
 
6
6
  # Review Artifact
@@ -9,6 +9,14 @@ Review whether the artifact is fit to guide work.
9
9
 
10
10
  Review first. Edit second.
11
11
 
12
+ Reviewer findings are evidence, not commands. The parent agent owns adjudication.
13
+
14
+ A non-passing artifact review is a phase exit, not an autonomous patch loop. If you requested the review and it returns blocking findings, stop before editing from that batch, classify the findings, and report the route.
15
+
16
+ The turn that receives a non-passing review ends with adjudication and route only. Do not edit from that review batch in the same turn, even when the user or reviewer says to apply all findings and continue reviewing.
17
+
18
+ Hard stop: if the artifact has already had three review passes, do not edit any files or request another review. Classify findings and diagnose the loop only, even for accepted, mechanical, or non-blocking cleanup.
19
+
12
20
  ## Source-Truth Guard
13
21
 
14
22
  Artifact feedback is not approval to change source of truth.
@@ -23,6 +31,31 @@ Do not rewrite docs, tests, policies, specs, ADRs, or handoffs to make the artif
23
31
 
24
32
  For source-truth conflicts, the final line must be a direct choice question.
25
33
 
34
+ ## Parent Adjudication
35
+
36
+ Before editing from reviewer findings, classify each material finding:
37
+
38
+ - Accepted: valid and safe to apply without changing settled intent.
39
+ - Rejected: stale, unsupported, already resolved, equivalent, or not important.
40
+ - Question: needs owner decision.
41
+ - Needs evidence: inspect more before deciding.
42
+
43
+ Non-blocking findings and reviewer questions do not fail the artifact by default. Classify them, then defer, ask, gather evidence, or accept.
44
+
45
+ Ask before applying any finding that changes artifact intent, scope, source truth, workflow policy, sensitive behavior, or a settled decision.
46
+
47
+ For second and later review iterations, update the reviewer prompt with prior findings, owner clarifications, accepted/rejected findings, changed sections, and remaining risk. Do not rerun the same broad prompt after the situation narrows.
48
+
49
+ Do not apply a non-pass review batch and request another review in the same autonomous loop. Return the adjudication and next route first. A later explicit apply-fixes request can start a bounded fix pass for accepted, in-scope findings.
50
+
51
+ ## Review Loop Budget
52
+
53
+ Aim to finish by the second review pass: first review, adjudicate/fix, one confirmation.
54
+
55
+ Three review passes is the hard cap for the same artifact and scope. Do not request a fourth review to chase a clean pass.
56
+
57
+ At the third review, adjudicate before treating it as failure. If any accepted blocking, question, or needs-evidence finding remains, do not edit anything from that batch. Stop, report the adjudication, and zoom out to diagnose whether research, spec, plan, policies, source truth, artifact scope, or reviewer context is wrong or too thin.
58
+
26
59
  ## Review Setup
27
60
 
28
61
  Use a fresh reviewer when the artifact will guide future work and subagents are available. Use [references/reviewer-prompt.md](references/reviewer-prompt.md).
@@ -1,6 +1,6 @@
1
1
  # Artifact Reviewer Prompt
2
2
 
3
- Use this when dispatching a fresh reviewer subagent.
3
+ Use this when dispatching a reviewer subagent. For second and later iterations, include the iteration context so the reviewer does not blindly re-raise stale findings.
4
4
 
5
5
  ```text
6
6
  You are an artifact reviewer. Review whether this artifact is fit to guide future work.
@@ -14,6 +14,14 @@ Artifact type:
14
14
  Source context to inspect:
15
15
  [DOCS_TESTS_POLICIES_ADRS_CODE_PATHS]
16
16
 
17
+ Iteration context, if this is not the first review:
18
+ - Review pass number: [2 | 3]
19
+ - Prior findings: [SUMMARY]
20
+ - Parent adjudication: [ACCEPTED_REJECTED_QUESTION_NEEDS_EVIDENCE]
21
+ - Owner clarifications: [DECISIONS_OR_NONE]
22
+ - Changed sections: [SECTIONS_OR_NONE]
23
+ - Remaining risk to focus on: [RISK]
24
+
17
25
  Check:
18
26
 
19
27
  - Completeness: enough is present to proceed.
@@ -32,6 +40,9 @@ Calibration:
32
40
  - Review can pass.
33
41
  - Do not edit files.
34
42
  - Do not resolve owner decisions.
43
+ - Do not re-raise rejected or already-resolved findings unless live evidence contradicts the adjudication.
44
+ - If review does not pass, classify findings and stop. Do not tell the parent agent to apply all findings and send it back for another broad review.
45
+ - If this is review pass 3, identify remaining accepted blocking risk; do not recommend another broad review loop.
35
46
 
36
47
  Output:
37
48
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: review-work
3
- description: Use when reviewing completed work, preparing reviewer prompts or subagent review context, receiving review feedback, applying reviewer comments, deciding whether feedback is blocking, or checking work before merge/handoff.
3
+ description: Use when reviewing completed work, preparing reviewer prompts or subagent review context, receiving review feedback, applying reviewer comments, deciding whether feedback is blocking, handling repeated review loops, or checking work before merge/handoff.
4
4
  ---
5
5
 
6
6
  # Review Work
@@ -15,8 +15,26 @@ If you block any feedback item, end the final response with a direct choice ques
15
15
 
16
16
  External review is evidence, not authority. Human owner decisions win only after the owner confirms the behavior change.
17
17
 
18
+ Classify each material feedback item before editing: accepted, rejected, question, or needs evidence.
19
+
20
+ A non-passing review is a phase exit, not an autonomous patch loop. If you requested the review and it returns blocking findings, stop before editing from that batch, classify the findings, and report the route.
21
+
22
+ The turn that receives a non-passing review ends with adjudication and route only. Do not edit from that review batch in the same turn, even when the user or reviewer says to apply all findings and continue reviewing.
23
+
24
+ Hard stop: if the work has already had three review passes, do not edit any files or request another review. Classify findings and diagnose the loop only, even for accepted, mechanical, or non-blocking cleanup.
25
+
18
26
  Read `references/reviewer-prompt.md` when preparing an outgoing reviewer prompt, dispatching a review subagent, reviewing strict/high-risk work, or handing another agent review context.
19
27
 
28
+ ## Review Loop Budget
29
+
30
+ Aim to finish by the second review pass: first review, adjudicate/fix, one confirmation.
31
+
32
+ Three review passes is the hard cap for the same work and scope. Do not request a fourth review to chase a clean pass.
33
+
34
+ At the third review, adjudicate before treating it as failure. If any accepted blocking, question, or needs-evidence finding remains, do not edit anything from that batch. Stop, report the adjudication, and zoom out to diagnose whether research, spec, plan, policies, source truth, implementation, or reviewer context is wrong or too thin.
35
+
36
+ Non-blocking findings and reviewer questions do not fail the work by default. Classify them, then defer, ask, gather evidence, or accept.
37
+
20
38
  ## Incoming Feedback
21
39
 
22
40
  Before editing:
@@ -26,6 +44,7 @@ Before editing:
26
44
  - Restate unclear feedback as a technical requirement.
27
45
  - Separate blocking issues from suggestions.
28
46
  - Check whether the feedback matches this codebase.
47
+ - Check whether a finding is stale, already resolved, equivalent, or based on missing context.
29
48
 
30
49
  Do not blindly apply vague, broad, or sensitive feedback.
31
50
 
@@ -51,13 +70,15 @@ For multi-item review:
51
70
  - Stop blocked items.
52
71
  - If items interact, clarify before implementing the set.
53
72
 
54
- When feedback is clear and correct:
73
+ When feedback is clear and correct and the current route is an apply-fixes pass:
55
74
 
56
75
  - Apply one item at a time.
57
76
  - Keep the diff scoped to the review item.
58
77
  - Verify each fix.
59
78
  - Push back on incorrect feedback with code, tests, or docs.
60
79
 
80
+ Do not apply a non-pass review batch and request another review in the same autonomous loop. Return the adjudication and next route first. A later explicit apply-fixes request can start a bounded fix pass for accepted, in-scope findings.
81
+
61
82
  ## Outgoing Review
62
83
 
63
84
  When reviewing work, lead with bugs, regressions, missing tests, and requirement gaps.
@@ -71,3 +92,5 @@ Classify findings:
71
92
  Review can pass. Do not invent issues to justify the review.
72
93
 
73
94
  When asking another agent to review, give it source truth, changed files, risk lenses, and pass/fail criteria. Do not hand it only the previous agent's summary or your chat history.
95
+
96
+ For second and later review iterations, update the prompt with prior findings, owner clarifications, accepted/rejected findings, changed files, and remaining risk. Do not rerun the same broad prompt after the situation narrows.
@@ -13,9 +13,12 @@ The reviewer should get the work product and source truth, not your session memo
13
13
  - Risk lenses relevant to the work.
14
14
  - Required output shape and severity labels.
15
15
  - Clear instruction not to edit files unless the review task explicitly includes fixes.
16
+ - For review pass 2 or 3: prior findings, accepted/rejected/question/needs-evidence adjudication, owner clarifications, changed files, and narrowed remaining risk.
16
17
 
17
18
  Do not forward only a previous-agent summary. Summaries are useful context, not authority.
18
19
 
20
+ For second and later review iterations, include prior findings, parent adjudication, owner clarifications, changed files, and the remaining risk. Do not rerun the same broad prompt after the situation narrows.
21
+
19
22
  ## Risk Lenses
20
23
 
21
24
  Pick the lenses that fit the work:
@@ -58,8 +61,12 @@ Reasoning: ...
58
61
 
59
62
  If review passes, the reviewer should say that clearly and name any residual test gaps or assumptions.
60
63
 
64
+ If review does not pass, the reviewer should classify findings and stop. Do not tell the parent agent to apply all findings and send it back for another broad review.
65
+
61
66
  Do not ask reviewers to invent issues. A clean pass is valid.
62
67
 
68
+ If this is review pass 3, ask for remaining accepted blocking risk only. Do not recommend a fourth broad review loop.
69
+
63
70
  ## Minimal Template
64
71
 
65
72
  ```md
@@ -82,6 +89,7 @@ Review the completed work. Do not edit files.
82
89
  ## Check
83
90
 
84
91
  - [risk lenses and concrete requirements]
92
+ - [if pass 2 or 3: prior findings, adjudication, owner clarifications, changed files, and narrowed remaining risk]
85
93
 
86
94
  ## Output
87
95
 
@@ -9,6 +9,8 @@ Use `references/activation-contract.md` before rendering activation text, config
9
9
 
10
10
  Use `references/host-setup.md` when the request mentions Codex, Claude, both hosts, team setup, solo setup, strict defaults, hooks, CLI, or setup profiles.
11
11
 
12
+ Use `references/output-router-setup.md` when setup explicitly asks for output-router repo config, generated-path hints, native safety-net routing, vault settings, or output thresholds.
13
+
12
14
  ## Stop Before Editing
13
15
 
14
16
  Do not create config, add activation blocks, imports, or rule files until setup has a clear host target and no unresolved repo-rule conflict.
@@ -46,11 +48,17 @@ Update an existing `## Freeflow` block in place. Otherwise place the block near
46
48
 
47
49
  Create or update `.freeflow/config.json` using the config adapter in `references/activation-contract.md`.
48
50
 
49
- Use `workflow` unless the user explicitly asks to persist a valid repo default: `conversation`, `workflow`, or `strict-workflow`.
51
+ Minimal setup writes only `defaultMode`. Use `workflow` unless the user explicitly asks to persist a valid repo default: `conversation`, `workflow`, or `strict-workflow`.
52
+
53
+ Optional `outputRouter` config belongs here only when explicitly requested. Read `references/output-router-setup.md` first. Do not add an empty `outputRouter`, dump router defaults, or ask every setup user about router config.
54
+
55
+ If the user asks for router setup but gives no config knobs, say the router works with built-in defaults and ask which optional config they want persisted. Recommend no repo config unless they need a repo-specific hint or native safety-net behavior.
56
+
57
+ Never enable native safety-net routing by default. `postToolRouting: "safety-net"` requires an explicit request; `strict` is reserved and needs a separate confirmation before writing.
50
58
 
51
59
  Do not infer `strict-workflow` from "team", "strict gates", "careful", or high-risk examples. Recommend or ask unless the user explicitly says to make a mode the repo default.
52
60
 
53
- Do not add current mode, task, phase, file inventory, active plans, version metadata, or activation file path.
61
+ Do not add current mode, task, phase, file inventory, active plans, version metadata, activation file path, or unrequested router keys.
54
62
  Mode switches are task/conversation scoped unless the user explicitly asks to persist a different default mode.
55
63
 
56
64
  ## Activation
@@ -65,7 +73,7 @@ Do not list the whole workflow, every mode, or full `interview-gate` skill in al
65
73
 
66
74
  ## Do Not Create
67
75
 
68
- Setup must not create empty `CONTEXT.md`, docs pages, repo-local hooks, state files, handoffs, skill inventories, or `.codex/rules` behavior files.
76
+ Setup must not create empty `CONTEXT.md`, docs pages, repo-local hooks, state files, handoffs, skill inventories, `setup-output-router` skills, or `.codex/rules` behavior files.
69
77
  `CONTEXT.md` is domain language memory, not plugin state.
70
78
  Plugin-bundled context hooks are installed with Freeflow, not created by repo setup.
71
79
 
@@ -73,7 +81,9 @@ Plugin-bundled context hooks are installed with Freeflow, not created by repo se
73
81
 
74
82
  Before claiming setup is complete, check:
75
83
  - config JSON parses
76
- - config contains only `defaultMode` with the requested explicit default, or `workflow` when no explicit default was requested
84
+ - minimal config contains only `defaultMode` with the requested explicit default, or `workflow` when no explicit default was requested
85
+ - optional `outputRouter` config appears only when explicitly requested and contains only requested valid keys
86
+ - native safety-net routing is off unless explicitly requested
77
87
  - Codex setup has exactly one `## Freeflow` block in `AGENTS.md`
78
88
  - Claude setup has exactly one `CLAUDE.md` import and one `.claude/rules/freeflow-core.md` core file
79
89
  - `.codex/rules` was not created or changed for Freeflow behavior
@@ -10,6 +10,7 @@ Use this Markdown reference as the v0.1 contract module:
10
10
  getActivationContract(defaultMode) -> ActivationContract
11
11
  planActivation(contract, repoState, request) -> ActivationPlan | ActivationStop
12
12
  renderActivation(contract, target) -> rendered text or checks
13
+ planOptionalOutputRouterConfig(request) -> OutputRouterConfigPlan | ActivationStop
13
14
  ```
14
15
 
15
16
  Do not add a code module until setup behavior needs logic that cannot be kept clear in the skill and this reference.
@@ -17,7 +18,8 @@ Do not add a code module until setup behavior needs logic that cannot be kept cl
17
18
  ## Invariants
18
19
 
19
20
  - Activation text contains always-on invariants only, not the full workflow spine.
20
- - Config has exactly one field: `defaultMode`.
21
+ - Minimal config has exactly one field: `defaultMode`.
22
+ - Optional `outputRouter` config is allowed only when explicitly requested.
21
23
  - Valid defaults are exactly `conversation`, `workflow`, and `strict-workflow`.
22
24
  - Default mode is `workflow` unless the user explicitly persists another valid mode.
23
25
  - Codex activation writes `AGENTS.md`, not `.codex/rules`.
@@ -25,7 +27,7 @@ Do not add a code module until setup behavior needs logic that cannot be kept cl
25
27
  - Multi-agent setup updates both host surfaces only on explicit request and reports drift risk.
26
28
  - Existing repo instructions remain source truth.
27
29
  - Setup hard-stops before unresolved host ambiguity or repo-rule conflict.
28
- - Setup does not create repo-local hooks, docs inventories, state files, handoffs, empty `CONTEXT.md`, skill inventories, version metadata, activation path, current task, or current phase.
30
+ - Setup does not create repo-local hooks, docs inventories, state files, handoffs, empty `CONTEXT.md`, skill inventories, `setup-output-router` skills, version metadata, activation path, current task, or current phase.
29
31
  - Plugin-bundled context hooks may load workflow and interview-gate context at session start, but they are package runtime, not setup output.
30
32
  - After successful setup verification, setup reads the workflow skill, workflow map, and interview-gate skill before its final response so the current session is immediately usable.
31
33
 
@@ -46,8 +48,11 @@ Claude adapter:
46
48
  Config adapter:
47
49
 
48
50
  - Create or update `.freeflow/config.json`.
49
- - Write exactly `{ "defaultMode": "<mode>" }`.
51
+ - For minimal setup, write exactly `{ "defaultMode": "<mode>" }`.
50
52
  - Use `workflow` unless the user explicitly asks to persist `conversation` or `strict-workflow`.
53
+ - Add `outputRouter` only when explicitly requested, using `output-router-setup.md`.
54
+ - Missing `outputRouter` means built-in defaults, not a setup warning.
55
+ - Never enable native safety-net routing by default.
51
56
 
52
57
  ## Codex Core Block
53
58
 
@@ -16,6 +16,8 @@ Current runtime is not enough to choose a host when both `AGENTS.md` and `CLAUDE
16
16
 
17
17
  Solo setup is the default: one host target, compact activation, `defaultMode: "workflow"`, no extra docs.
18
18
 
19
+ Output-router setup is an opt-in config branch inside normal setup, not a separate host profile. Use `output-router-setup.md`; keep minimal setup config unchanged unless the user explicitly asks for router config.
20
+
19
21
  Team setup still uses compact activation. Add both hosts only if requested. Do not add team standards, onboarding docs, owners, approvers, repo-local hooks, or CLI checks as part of setup unless the user separately asks and the repo has a validated path for them.
20
22
 
21
23
  Strict setup changes `.freeflow/config.json` to `strict-workflow` only when the user explicitly asks to make that the repo default. Otherwise recommend strict-workflow for high-risk work without persisting it.
@@ -24,7 +26,7 @@ Valid persisted defaults are exactly `conversation`, `workflow`, and `strict-wor
24
26
 
25
27
  ## Not Setup
26
28
 
27
- Do not install repo-local hooks, CLI commands, lint rules, global standards, docs inventories, or state files during setup.
29
+ Do not install repo-local hooks, CLI commands, lint rules, global standards, docs inventories, setup-output-router skills, or state files during setup.
28
30
 
29
31
  Freeflow's plugin-bundled context hooks are package runtime. They load workflow and interview-gate context at session start, but setup should not copy hook files into the target repo.
30
32
 
@@ -0,0 +1,52 @@
1
+ # Output Router Setup
2
+
3
+ Use this only when setup explicitly asks for output-router repo config, generated-path hints, native safety-net routing, vault settings, or output thresholds.
4
+
5
+ ## Defaults
6
+
7
+ - The output router has built-in defaults. A repo does not need `outputRouter` config to use it.
8
+ - Minimal `/setup-freeflow` must still write only `defaultMode`.
9
+ - Do not ask every setup user about router config.
10
+ - Do not create a separate `setup-output-router` skill.
11
+
12
+ If the user says only “set up the output router” with no requested knobs, say the router works with built-in defaults and ask which optional config they want persisted. Recommend no repo config unless they need a repo-specific hint or safety-net behavior.
13
+
14
+ ## Config Keys
15
+
16
+ Write only keys the user explicitly requests. Do not dump all defaults and do not create an empty `outputRouter` object.
17
+
18
+ Supported repo config keys:
19
+
20
+ ```json
21
+ {
22
+ "defaultMode": "workflow",
23
+ "outputRouter": {
24
+ "postToolRouting": "off",
25
+ "largeOutputBytes": 64000,
26
+ "largeOutputLines": 1000,
27
+ "vaultRoot": "~/.cache/freeflow-router/vault",
28
+ "vaultRetentionDays": 7,
29
+ "generatedPaths": ["graphify-out/**"],
30
+ "noisyCommandHints": ["npm test"]
31
+ }
32
+ }
33
+ ```
34
+
35
+ Rules:
36
+
37
+ - `postToolRouting` defaults to `off`. Use `safety-net` only when explicitly requested. Treat `strict` as reserved; ask before writing it.
38
+ - `largeOutputBytes`, `largeOutputLines`, and `vaultRetentionDays` must be positive integers.
39
+ - `vaultRoot` must be a non-empty string.
40
+ - `generatedPaths` are broad-scan generated-path hints. Explicit file or directory retrieval must remain available.
41
+ - `noisyCommandHints` is parsed as hint config. Do not add it unless the user explicitly asks for command-pattern hints.
42
+
43
+ ## Verify
44
+
45
+ After writing optional router config:
46
+
47
+ - JSON parses.
48
+ - `defaultMode` is valid.
49
+ - `outputRouter` contains only requested keys.
50
+ - Invalid router values are not written.
51
+ - Native safety-net routing is not enabled unless explicitly requested.
52
+ - No repo-local hooks, skill files, setup-output-router skill, or docs inventories were created.
@@ -7,6 +7,8 @@ description: Use when doing consequential work such as implementation, bug fixin
7
7
 
8
8
  Follow a lightweight forward workflow. Scale process to task risk.
9
9
 
10
+ Move forward when context is sufficient. Re-enter clarification when new ambiguity would change the next action.
11
+
10
12
  Question means answer. Do not turn a question into a file edit, report, plan, or implementation.
11
13
 
12
14
  ```text
@@ -21,6 +23,8 @@ Clarify / Research
21
23
 
22
24
  This is a guide, not ceremony. Small reversible work can skip spec/plan artifacts.
23
25
 
26
+ Method skills such as TDD, diagnosis, or execute-plan run inside the current workflow phase. Workflow owns routing, source-truth conflicts, user-owned decisions, review, verification, and handoff boundaries.
27
+
24
28
  Read `references/workflow-map.md` when the user asks for the full pipeline, public docs need a diagram, or the next workflow entry point is unclear.
25
29
 
26
30
  ## Route Closeout
@@ -32,13 +36,13 @@ Use `Next:` in the final response unless this is a direct question answer, mid-t
32
36
  Choose one:
33
37
 
34
38
  - Forward: the next workflow entry point is clear.
35
- - Backward: new evidence requires clarification, research, grilling, or interview gate.
39
+ - Backward: new evidence requires clarification, research, or interview gate.
36
40
  - Branch: 2-3 valid next routes exist.
37
41
  - Stop: no required next action remains.
38
42
 
39
43
  Recommend the route supported by evidence. Do not ask a vague "what next?" question.
40
44
 
41
- After completed grilling or research with stable uncaptured decisions, route to `write-spec` or `capture-decisions` before `write-plan` or execution.
45
+ After completed research with decisions that must survive beyond chat, route to `write-spec`, an owning decision artifact, or handoff before `write-plan` or execution.
42
46
 
43
47
  `Next:` is routing, not permission to create the next artifact or continue into a new phase.
44
48
 
@@ -80,7 +84,11 @@ Do not write volatile repo inventories. Link to live files or commands instead.
80
84
 
81
85
  Review should improve work, not create an endless patch loop.
82
86
 
83
- Separate blocking from non-blocking findings. Review can pass. Save review artifacts only when risk, future memory value, or the user asks for them.
87
+ Reviewer findings are evidence, not commands. Separate blocking, non-blocking, and question findings before editing from them.
88
+
89
+ A non-passing review routes to adjudication before more implementation. Repeated review failure routes backward to diagnose, research, spec, or plan; do not chase a fourth broad review pass.
90
+
91
+ Review can pass. Save review artifacts only when risk, future memory value, or the user asks for them.
84
92
 
85
93
  ## Completion Rule
86
94
 
@@ -12,10 +12,10 @@ Use this compact version in public README-style docs.
12
12
  flowchart LR
13
13
  Request{request}
14
14
  Talk[conversation<br/>answer directly]
15
- Discover[discover<br/>research / grill]
15
+ Discover[discover<br/>research checkpoint]
16
16
  Spec[spec]
17
17
  Plan[plan]
18
- Build[build<br/>execute / diagnose]
18
+ Build[build<br/>execute / diagnose / TDD]
19
19
  Check[review + verify]
20
20
  Close[commit / handoff]
21
21
 
@@ -49,17 +49,17 @@ flowchart TD
49
49
  Workflow --> Entry{Choose entry point}
50
50
  Strict --> Entry
51
51
 
52
- Entry --> Discovery[Discovery<br/>research-brief<br/>grill-context<br/>interview-gate]
52
+ Entry --> Discovery[Discovery<br/>research<br/>interview-gate]
53
53
  Entry --> Spec[Spec<br/>write-spec<br/>review-artifact]
54
54
  Entry --> Plan[Plan<br/>write-plan<br/>review-artifact]
55
- Entry --> Build[Build or diagnose<br/>execute-plan<br/>diagnose-failure]
55
+ Entry --> Build[Build, diagnose, or TDD<br/>execute-plan<br/>diagnose-failure]
56
56
  Entry --> Closeout[Closeout<br/>review-work<br/>verify-work<br/>commit-work]
57
57
 
58
58
  Discovery --> Spec
59
59
  Spec --> Plan
60
60
  Plan --> Build
61
61
  Build --> Closeout
62
- Closeout --> Handoff[handoff<br/>capture-decisions when durable]
62
+ Closeout --> Handoff[handoff<br/>durable checkpoint when needed]
63
63
  Handoff --> Done
64
64
 
65
65
  Reenter[Re-enter discovery<br/>new evidence, owner decision,<br/>source conflict, or failed check]
@@ -76,17 +76,16 @@ flowchart TD
76
76
  ## Common Entry Points
77
77
 
78
78
  - Use `conversation mode` when the user asks a question, wants critique, or is exploring.
79
- - Use `research-brief` when repo, domain, evidence, or current facts are unknown.
80
- - Use `grill-context` or `interview-gate` when direction is vague, source truth conflicts, or user-owned decisions are still open.
79
+ - Use `research` when repo, domain, evidence, current facts, brainstorming, targeted questions, or a decision checkpoint are needed before spec, plan, build, or durable memory.
80
+ - Use `interview-gate` when direction is vague, source truth conflicts, or user-owned decisions are still open.
81
81
  - Use `write-spec` when requirements are agreed but not durable.
82
82
  - Use `review-artifact` when a spec, plan, handoff, or decision note must guide future work.
83
83
  - Use `write-plan` when an approved spec or explicit task context exists.
84
- - Use `execute-plan` when an approved plan exists.
84
+ - Use `execute-plan` when an approved plan exists; method skills like TDD run inside that build phase when requested or appropriate.
85
85
  - Use `diagnose-failure` when behavior is broken, failing, flaky, slow, or unclear.
86
86
  - Use `review-work` and `verify-work` before claiming consequential work is ready.
87
87
  - Use `commit-work` only after the intended diff is reviewed and verification evidence exists.
88
88
  - Use `handoff` when pausing, compacting, or transferring context.
89
- - Use `capture-decisions` only for stable decisions, glossary terms, rejected approaches, or ADR-worthy tradeoffs.
90
89
  - Use `bypass` only to skip unnecessary ceremony. It cannot skip user-owned decisions, source-truth conflicts, risky checks, or verification claims.
91
90
 
92
91
  ## Phase Exits
@@ -94,10 +93,10 @@ flowchart TD
94
93
  End completed consequential phases with `Next:` unless this is a direct answer, mid-task status, or clarification-only turn.
95
94
 
96
95
  - Forward: name the next entry point, such as `write-spec`, `write-plan`, `execute-plan`, `review-work`, `verify-work`, `commit-work`, or `handoff`.
97
- - Backward: return to `interview-gate`, `research-brief`, or `grill-context` when evidence changes the path.
96
+ - Backward: return to `interview-gate`, `research`, `diagnose-failure`, or plan/spec revision when evidence, failed checks, or repeated review findings change the path.
98
97
  - Branch: show 2-3 valid next routes when more than one is reasonable.
99
98
  - Stop: say no required next action remains.
100
99
 
101
- After completed grilling or research with stable uncaptured decisions, prefer `write-spec` or `capture-decisions` before planning or execution.
100
+ After completed research with decisions that must survive beyond chat, prefer `write-spec`, an owning decision artifact, or handoff before planning or execution.
102
101
 
103
102
  Do not create the next artifact just because it is the next route.
@@ -21,7 +21,7 @@ Do not add references, examples, README files, changelogs, or metadata when a co
21
21
 
22
22
  Do not add helper scripts for commands the agent can run directly, such as `git log`, `git diff`, search, formatting, or line counts. Scripts are for repeated deterministic work that would be risky or wasteful to retype.
23
23
 
24
- Follow the repo's line budget. If none exists, keep `SKILL.md` under 100 lines unless the extra lines clearly earn their place.
24
+ Treat the repo's line budget as a best practice, not a hard cap. If none exists, aim to keep `SKILL.md` under 100 lines for normal skills. Let deep skills exceed it when the active rules, examples, or structure clearly earn their place.
25
25
 
26
26
  ## Description First
27
27