@hassangameryt/freeflow 0.6.0 → 0.7.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 (122) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/.codex-plugin/plugin.json +4 -5
  4. package/README.md +39 -55
  5. package/capabilities/cognitive-routing/SKILL.md +288 -130
  6. package/command-surface.json +0 -24
  7. package/hooks/freeflow-runtime-context.mjs +42 -477
  8. package/hooks/hooks.json +1 -26
  9. package/hooks/tests/check-runtime-context-hook.sh +108 -319
  10. package/package.json +4 -2
  11. package/pi-extension/dist/cognitive-routing/commands.js +3 -3
  12. package/pi-extension/dist/cognitive-routing/config.js +16 -20
  13. package/pi-extension/dist/cognitive-routing/controller.js +478 -48
  14. package/pi-extension/dist/cognitive-routing/history.js +12 -0
  15. package/pi-extension/dist/cognitive-routing/host.js +74 -12
  16. package/pi-extension/dist/cognitive-routing/pi-routing-session.js +414 -0
  17. package/pi-extension/dist/cognitive-routing/pi-session-control.js +320 -0
  18. package/pi-extension/dist/cognitive-routing/tool.js +1 -0
  19. package/pi-extension/dist/cognitive-routing/types.js +1 -1
  20. package/pi-extension/dist/index.js +236 -219
  21. package/pi-extension/dist/runtime/runtime-context.js +126 -286
  22. package/pi-extension/dist/settings/settings-ui.js +52 -336
  23. package/pi-extension/src/cognitive-routing/commands.ts +15 -5
  24. package/pi-extension/src/cognitive-routing/config.ts +16 -20
  25. package/pi-extension/src/cognitive-routing/controller.ts +561 -51
  26. package/pi-extension/src/cognitive-routing/history.ts +12 -0
  27. package/pi-extension/src/cognitive-routing/host.ts +110 -16
  28. package/pi-extension/src/cognitive-routing/pi-routing-session.ts +538 -0
  29. package/pi-extension/src/cognitive-routing/pi-session-control.ts +444 -0
  30. package/pi-extension/src/cognitive-routing/tool.ts +1 -0
  31. package/pi-extension/src/cognitive-routing/types.ts +1 -1
  32. package/pi-extension/src/index.ts +249 -239
  33. package/pi-extension/src/runtime/runtime-context.ts +129 -305
  34. package/pi-extension/src/settings/settings-ui.ts +53 -371
  35. package/pi-extension/tests/cognitive-routing/commands.test.js +1 -1
  36. package/pi-extension/tests/cognitive-routing/controller.test.js +69 -40
  37. package/pi-extension/tests/cognitive-routing/extension-lifecycle.test.js +128 -57
  38. package/pi-extension/tests/cognitive-routing/pi-normal-lifecycle.test.js +434 -0
  39. package/pi-extension/tests/cognitive-routing/pi-session-control.test.js +174 -0
  40. package/pi-extension/tests/cognitive-routing/pi-session-history.test.js +91 -0
  41. package/pi-extension/tests/cognitive-routing/profile-resolution.test.js +47 -4
  42. package/pi-extension/tests/integration/mode-free-core.test.js +218 -0
  43. package/pi-extension/tests/integration/pi-extension.test.js +430 -2478
  44. package/pi-extension/tests/integration/prompt-architecture.test.js +124 -79
  45. package/pi-extension/tests/integration/unaffected-regressions.test.js +411 -0
  46. package/runtime/prompts/cognitive-routing.md +5 -4
  47. package/runtime/prompts/conversation-history.md +1 -1
  48. package/runtime/prompts/core.md +77 -6
  49. package/runtime/prompts/interaction-contract.md +6 -2
  50. package/skills/action-selection/SKILL.md +93 -44
  51. package/skills/action-selection/references/trajectory-stalls.md +71 -0
  52. package/skills/bypass/SKILL.md +109 -39
  53. package/skills/commit-work/SKILL.md +94 -55
  54. package/skills/commit-work/references/git-state-edges.md +94 -0
  55. package/skills/commit-work/references/simple-push.md +92 -0
  56. package/skills/commit-work/references/staging-decisions.md +79 -46
  57. package/skills/decision-gate/SKILL.md +80 -22
  58. package/skills/design-for-depth/SKILL.md +208 -43
  59. package/skills/design-for-depth/references/design-pressure-signals.md +108 -240
  60. package/skills/design-for-depth/references/interface-design-loop.md +77 -97
  61. package/skills/design-for-depth/references/module-and-dependency-design.md +147 -0
  62. package/skills/design-for-depth/references/software-design-philosophy.md +127 -173
  63. package/skills/design-for-depth/references/state-and-failure-boundaries.md +136 -0
  64. package/skills/diagnose-failure/SKILL.md +198 -52
  65. package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +19 -5
  66. package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +13 -5
  67. package/skills/discuss/SKILL.md +118 -76
  68. package/skills/discuss/references/discussion-continuity.md +84 -32
  69. package/skills/evaluate-skill/SKILL.md +166 -52
  70. package/skills/evaluate-skill/references/evaluation-definition-schema.md +2 -2
  71. package/skills/evaluate-skill/references/evaluation-design.md +56 -30
  72. package/skills/evaluate-skill/references/execution-and-evidence.md +1 -1
  73. package/skills/evaluate-skill/references/review-and-revision.md +62 -21
  74. package/skills/execute-work/SKILL.md +98 -59
  75. package/skills/execute-work/references/code-practices.md +4 -4
  76. package/skills/execute-work/references/execute-work-edges.md +42 -22
  77. package/skills/review-artifact/SKILL.md +132 -71
  78. package/skills/review-artifact/references/adjudicate-artifact-review.md +101 -0
  79. package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +52 -41
  80. package/skills/review-work/SKILL.md +115 -72
  81. package/skills/review-work/references/adjudicate-work-review.md +97 -0
  82. package/skills/review-work/references/independent-work-reviewer-contract.md +40 -35
  83. package/skills/review-work/references/security-risk-lens.md +17 -15
  84. package/skills/setup-freeflow/SKILL.md +14 -17
  85. package/skills/setup-freeflow/references/activation-contract.md +24 -30
  86. package/skills/setup-freeflow/references/host-setup.md +6 -7
  87. package/skills/simplify-code/SKILL.md +97 -39
  88. package/skills/simplify-code/references/simplification-patterns.md +1 -1
  89. package/skills/tdd/SKILL.md +108 -41
  90. package/skills/tdd/references/test-design.md +1 -1
  91. package/skills/track-work/SKILL.md +133 -300
  92. package/skills/track-work/references/working-record-format.md +515 -0
  93. package/skills/track-work/scripts/lib/document.mjs +713 -0
  94. package/skills/track-work/scripts/lib/format.mjs +166 -0
  95. package/skills/track-work/scripts/lib/store.mjs +233 -0
  96. package/skills/track-work/scripts/lib/transitions.mjs +790 -0
  97. package/skills/track-work/scripts/lib/views.mjs +27 -430
  98. package/skills/track-work/scripts/working-record.mjs +292 -98
  99. package/skills/verify-work/SKILL.md +46 -20
  100. package/skills/verify-work/references/browser-runtime-evidence.md +1 -1
  101. package/skills/verify-work/references/integration-evidence.md +1 -7
  102. package/skills/verify-work/references/performance-evidence.md +1 -1
  103. package/skills/workflow/SKILL.md +110 -80
  104. package/skills/workflow/references/domain-skill-composition.md +24 -18
  105. package/skills/write-skill/SKILL.md +218 -62
  106. package/skills/write-skill/references/activation-boundaries.md +63 -21
  107. package/skills/write-skill/references/agent-first-instructions.md +61 -27
  108. package/skills/write-skill/references/progressive-disclosure.md +91 -41
  109. package/skills/write-skill/references/skill-dependency-graphs.md +190 -0
  110. package/runtime/prompts/skills.md +0 -65
  111. package/skills/mode-contract/SKILL.md +0 -104
  112. package/skills/track-work/scripts/lib/codec.mjs +0 -570
  113. package/skills/track-work/scripts/lib/commands.mjs +0 -568
  114. package/skills/track-work/scripts/lib/contract.mjs +0 -303
  115. package/skills/track-work/scripts/lib/model.mjs +0 -506
  116. package/skills/track-work/scripts/lib/operations.mjs +0 -965
  117. package/skills/track-work/scripts/lib/record-store.mjs +0 -264
  118. package/skills/track-work/scripts/lib/result.mjs +0 -37
  119. package/skills/track-work/scripts/lib/rewrites.mjs +0 -740
  120. package/skills/track-work/scripts/lib/schema.mjs +0 -277
  121. package/skills/track-work/scripts/lib/source-inventory.mjs +0 -162
  122. package/skills/track-work/scripts/lib/workspace.mjs +0 -134
@@ -1,133 +1,175 @@
1
1
  ---
2
2
  name: discuss
3
- description: Use when discussing, exploring, shaping, challenging, or revisiting an idea, request, artifact, design, or implementation direction, or when an open-ended request or new evidence makes the next approach uncertain.
3
+ description: "Use when the user is exploring, challenging, or revisiting what to build or how to proceed, or when assumptions, alternatives, or new evidence leave the next sound action materially uncertain."
4
4
  ---
5
5
 
6
6
  # Discuss
7
7
 
8
8
  Build enough shared understanding to choose the next sound action.
9
9
 
10
- Discussion may shape understanding, recommendations, proposed work, and checkpoints. It inherits the current authority envelope: selecting Discuss does not authorize active evidence generation, mutation or delivery, settle a user-owned choice implicitly, or turn exploratory output into production behavior.
10
+ Discuss owns exploration, alternatives, assumptions, and direction. It may shape recommendations, proposed work, and checkpoints. It does not authorize active evidence generation, mutation, delivery, or a user-owned decision.
11
11
 
12
- ## Follow The Discussion Route
12
+ ## Enter Or Exit Cleanly
13
13
 
14
- Use this as a directed map, not a checklist:
14
+ Use Discuss when:
15
15
 
16
- ```text
17
- [Entry or re-entry]
18
- -> [Orient from accepted context and live evidence]
19
- -> [Focus the highest uncertainty that could change the route]
20
- -> [Inspect facts / ask / compare meaningful paths]
21
- -> [Route from what is now supported]
22
- -> enough understanding
23
- -> decide continuity
24
- -> no record -> return direction to Workflow
25
- -> record needed and mutation covered -> Track Work -> Discuss -> Workflow
26
- -> record needed but mutation uncovered -> propose exact mutation -> wait
27
- -> one user-owned choice or source conflict -> Decision Gate
28
- -> evidence needed -> propose a bounded learning action
29
- -> apply the continuity decision before returning the proposal
30
- -> Workflow confirms authority and routes
31
- -> Track Work when needed -> Workflow -> Execute Work or wait
32
- -> no record needed -> Execute Work or wait
33
- -> re-enter Discuss with evidence
34
- -> unexplained or repeated failure -> Diagnose Failure
35
- -> stable accepted content or strategy -> Write Spec / Write Plan
36
- ```
16
+ - the outcome, boundary, approach, or acceptance remains materially open;
17
+ - several meaningful paths remain viable;
18
+ - an assumption or earlier direction needs reconsideration;
19
+ - new evidence makes the next route uncertain.
37
20
 
38
- Preserve decisions, evidence, artifacts, and work that still hold whenever discussion re-enters from implementation, verification, review, failure, or another conversation.
21
+ Do not turn every interaction into a discussion phase. If the user asks a direct factual question, provides a clear bounded request, or gives feedback that does not reopen direction, answer or return the request to Workflow.
39
22
 
40
- ## Enter Or Exit Cleanly
23
+ When one known user-owned choice or source conflict blocks progress, use [Decision Gate](../decision-gate/SKILL.md). When a failure lacks a supported cause or keeps recurring, use [Diagnose Failure](../diagnose-failure/SKILL.md).
41
24
 
42
- Use Discuss when:
25
+ ## Discuss Like A Collaborator
26
+
27
+ Respond to the user’s substance before steering the conversation.
28
+
29
+ Carry your share of the thinking:
43
30
 
44
- - the user is exploring what to build or how to approach it;
45
- - important outcomes, boundaries, alternatives, or tradeoffs remain open;
46
- - an artifact, design, implementation direction, or earlier assumption needs reconsideration;
47
- - new evidence makes the next approach uncertain.
31
+ - interpret what the current evidence and intent imply;
32
+ - expose consequential assumptions and tradeoffs;
33
+ - challenge claims when evidence or engineering judgment warrants it;
34
+ - recommend a direction when one is better supported;
35
+ - revise your position plainly when new reasoning or evidence changes it.
48
36
 
49
- Do not force discussion for a direct factual question or clear bounded action whose intended result is understood. Feedback alone does not require discussion. Re-enter only when it reopens assumptions, options, or direction.
37
+ Ask only questions whose answers could materially change the route and which available evidence cannot answer. Ask the user about intent, priorities, constraints, and tradeoffs they own. Do not make the user answer factual questions that existing sources can resolve.
50
38
 
51
- When one known choice or source conflict blocks progress, use [Decision Gate](../decision-gate/SKILL.md). When a failure lacks a supported cause or keeps recurring, use [Diagnose Failure](../diagnose-failure/SKILL.md) before treating it as a design problem.
39
+ Keep one consequential uncertainty in focus. Do not conduct a questionnaire, manufacture alternatives, repeat accepted context, or continue arguing for a rejected path without new evidence.
40
+
41
+ ## Follow The Discussion Loop
42
+
43
+ ```text
44
+ Orient from what remains true
45
+ -> respond to the current substance
46
+ -> focus the uncertainty that could change the route
47
+ -> inspect facts, ask about intent, or compare meaningful paths
48
+ -> determine what is now supported
49
+ -> continue discussion
50
+ -> learn through bounded action
51
+ -> decide continuity
52
+ -> route the supported result
53
+ ```
54
+
55
+ Use this as a feedback loop, not a user-facing checklist.
52
56
 
53
57
  ## Orient Without Restarting
54
58
 
55
59
  Identify only what the next decision needs:
56
60
 
57
- - goal and current direction;
58
- - settled facts and explicit decisions;
61
+ - the goal and current direction;
62
+ - supported facts and explicit decisions;
59
63
  - tentative assumptions or viable alternatives;
60
- - evidence and uncertainty that could change the route.
64
+ - open questions capable of changing the route;
65
+ - evidence that still matters.
61
66
 
62
- When a Working Record exists, orient from its current context and check important claims against live evidence. Read older history only when the present direction or rationale is unclear. Update only what new evidence affects. When a material record update is needed, use Track Work's replacement summaries and one-owner storage rather than appending discussion prose. Apply the update only when the authority envelope covers its mutation. If the mutation is uncovered, return it to Workflow and wait. After any covered update, return to Discuss—a record update does not start execution or change the owning route.
67
+ Keep these distinctions available:
63
68
 
64
- ## Focus The Discussion
69
+ - **Settled:** supported fact or explicit decision.
70
+ - **Tentative:** live hypothesis or provisional direction.
71
+ - **Open:** unresolved and capable of changing the next action.
65
72
 
66
- Stay with the highest unresolved question that could change the outcome, boundary, approach, or acceptance. Leave dependent details until that question is sufficiently understood.
73
+ Use those labels in the response only when they make a transition or summary clearer. Do not turn every discussion turn into a status report.
67
74
 
68
- Inspect code, tests, docs, policies, artifacts, repository state, supplied material, or current primary sources when they can answer factual questions. Ask the user about intent, priorities, constraints, and tradeoffs that evidence cannot decide.
75
+ When discussion reopens after implementation, feedback, verification, review, or failure, preserve what still holds and revisit only the affected assumption, decision, or direction.
69
76
 
70
- When several inspections, searches, or other observers could answer the same factual question, or the likely probe is broad, use [Action Selection](../action-selection/SKILL.md) to choose and bound one environment interaction. Discuss keeps ownership of the question and interpretation; Action Selection returns the observation. Skip it for an obvious focused read.
77
+ When a Working Record exists, read [Track Work](../track-work/SKILL.md) before any record operation. Recover the relevant current state, reconcile it with current user direction and live evidence, and return to the question that actually changed. Memory does not override contradictory evidence or current intent.
78
+
79
+ ## Resolve What Conversation Can Resolve
80
+
81
+ Inspect existing code, tests, documentation, policies, artifacts, repository state, supplied material, or current primary sources when they can answer a factual question without exercising target behavior or changing state.
82
+
83
+ When several observations could answer the same question, or the likely inspection is broad, use [Action Selection](../action-selection/SKILL.md) to choose the smallest discriminating observation.
71
84
 
72
85
  When materially different paths remain viable:
73
86
 
74
- 1. compare only the few that matter, including the current path or waiting when real;
75
- 2. state what each optimizes, its main assumptions and tradeoffs, and evidence that could rule it out;
76
- 3. recommend a direction when evidence supports one and say what could change that recommendation;
77
- 4. leave user-owned choices with the user and do not keep arguing for a rejected path without new evidence.
87
+ 1. compare only the paths that could realistically be chosen;
88
+ 2. state what each optimizes and what it sacrifices;
89
+ 3. identify the assumptions on which each path depends;
90
+ 4. recommend the best-supported direction;
91
+ 5. state what evidence or changed priority would alter that recommendation.
78
92
 
79
- Ask in natural prose, usually about one main topic at a time. Use a menu only for genuinely closed choices. Do not manufacture alternatives for an obvious local decision.
93
+ When architecture, interfaces, ownership, state, or failure behavior shapes the direction, use [Design for Depth](../design-for-depth/SKILL.md) as a lens.
80
94
 
81
- When architecture, interfaces, ownership, state, failure contracts, or spreading complexity shape the direction, use [Design for Depth](../design-for-depth/SKILL.md) as a lens and retain it while the boundary remains design-bearing.
95
+ Converge when the next sound action no longer depends on unresolved direction. Do not continue discussion merely because more detail could be explored.
82
96
 
83
- ## Preserve Only Useful State
97
+ ## Learn Through Bounded Action
84
98
 
85
- Keep discussion legible as:
99
+ Do not keep reasoning about an empirical uncertainty when a small, reversible experiment can discriminate between the remaining hypotheses.
86
100
 
87
- - **Settled:** supported fact or explicit decision.
88
- - **Tentative:** current hypothesis or provisional direction.
89
- - **Open:** unresolved and capable of changing the next action.
101
+ Use a Learning action when:
90
102
 
91
- Before routing to Track Work, ask: **Would losing current task state risk later misalignment?** Use a Working Record when:
103
+ - accepted evidence and passive inspection cannot answer a material question;
104
+ - exercising behavior, building a prototype, testing an assumption, or writing disposable code can answer it;
105
+ - the expected information can change the direction;
106
+ - the action can be bounded by evidence and a stop condition.
92
107
 
93
- - the task must survive compaction, pause, session navigation, or ownership transfer;
94
- - decisions, evidence, blockers, authority, or the next action need durable recovery;
95
- - one outcome is likely to span several implementation, verification, review, or correction iterations;
96
- - proposed outcomes must remain ordered and visible without becoming authorized work.
108
+ Propose:
97
109
 
98
- Keep state in conversation when context is sufficient and the discussion or next action is short and disposable. Use [Write Spec](../write-spec/SKILL.md) for stable accepted content and [Write Plan](../write-plan/SKILL.md) for a stable ordered strategy. Do not create an artifact merely because discussion occurred.
110
+ ```text
111
+ Question or hypothesis:
112
+ Smallest discriminating action:
113
+ Reversible effects and production boundary:
114
+ Expected evidence:
115
+ Stop and return when:
116
+ Discard, revise, or propose promotion when:
117
+ ```
99
118
 
100
- Recommend independent review, local commit, user decision, or continuity checkpoints only when they protect dependent work or reduce material risk. Discussion may shape and preserve an approved checkpoint, but does not execute it. Normal verification and silent self-review provide the ordinary self-check; Workflow establishes the slice outcome.
119
+ A learning proposal does not authorize execution. Before returning it to Workflow, decide whether its context needs durable preservation. Workflow confirms authority and routes covered work through [Track Work](../track-work/SKILL.md) when needed and then [Execute Work](../execute-work/SKILL.md).
101
120
 
102
- Read [Discussion Continuity](references/discussion-continuity.md) when preserving a compact discussion state or re-entry summary, or when carrying a selected checkpoint from discussion.
121
+ Return the result to Discuss. Treat prototypes, tests, benchmarks, sketches, and working behavior as evidence—not automatic approval of their design or promotion into production.
103
122
 
104
- ## Learn Through Bounded Action
123
+ If the work remains valuable as an accepted outcome regardless of what it teaches, propose a Delivery or Deepening result instead of disguising it as Learning.
124
+
125
+ ## Decide Continuity Before Leaving
126
+
127
+ Before discussion hands off a supported direction, ask:
128
+
129
+ > Would losing the current understanding, decisions, evidence, proposals, or next action risk later misalignment?
105
130
 
106
- When discussion alone cannot answer a material question, propose the smallest useful learning or delivery action:
131
+ If no, keep the state in conversation.
132
+
133
+ If yes, read [Discussion Continuity](references/discussion-continuity.md) before choosing or preserving the durable destination. When a Working Record is appropriate:
107
134
 
108
135
  ```text
109
- Type: Learning | Delivery | Deepening
110
- Question or outcome:
111
- Smallest bounded action:
112
- Expected evidence:
113
- Useful checkpoint, if any:
114
- Stop, discard, revise, or promote when:
136
+ Discuss
137
+ -> material supported state
138
+ -> Track Work update
139
+ -> Discuss
140
+ -> Workflow
115
141
  ```
116
142
 
117
- Classifying an action as Learning, Delivery, or Deepening does not authorize it. Before returning an uncovered proposal to Workflow, apply the continuity decision above and include any required [Track Work](../track-work/SKILL.md) mutation. Once Workflow confirms that the authority envelope covers the action and any record mutation, use Track Work when needed, return to Workflow, then route to [Execute Work](../execute-work/SKILL.md) or wait.
143
+ Discuss decides what the state means and whether it needs continuity. Track Work owns the Working Record and its lifecycle. A record update does not end discussion, authorize work, select a proposal, or change the owning route.
118
144
 
119
- Return with the observed result. Treat prototypes, tests, benchmarks, sketches, and working behavior as evidence, not automatic approval of their design or promotion. Preserve what still holds and re-enter only the affected question.
145
+ Do not create a Working Record for a short disposable exchange or one clear direct result merely because discussion occurred. Reconsider the decision if a small task develops durable decisions, several outcomes, repeated feedback, checkpoints, or context-loss risk.
120
146
 
121
- ## Return Supported Direction
147
+ ## Shape Checkpoints Sparingly
122
148
 
123
- Converge when the next sound action no longer depends on unresolved direction, not when every future question is answered.
149
+ Recommend a user decision, independent review, local commit, or continuity checkpoint only when crossing that boundary unresolved could materially endanger dependent work.
124
150
 
125
- Return to [Workflow](../workflow/SKILL.md) with:
151
+ Discussion may propose a checkpoint. Workflow selects it. Track Work preserves it when durable memory is needed. A recommendation or recorded checkpoint does not authorize the action it describes.
152
+
153
+ ## Return Supported Direction
154
+
155
+ Return to [Workflow](../workflow/SKILL.md) with the concepts the next route needs:
126
156
 
127
157
  - current shared understanding;
128
158
  - settled and tentative direction;
129
159
  - open questions that still change the route;
130
160
  - recommended next action or bounded proposal;
131
- - its authority state and any selected checkpoint.
161
+ - continuity decision;
162
+ - authority state and selected checkpoint, when any.
163
+
164
+ Use natural prose unless structured state materially improves continuity.
165
+
166
+ Route narrowly:
167
+
168
+ - one user-owned choice or source conflict -> Decision Gate;
169
+ - unexplained or repeated failure -> Diagnose Failure;
170
+ - stable accepted content -> [Write Spec](../write-spec/SKILL.md);
171
+ - stable ordered strategy -> [Write Plan](../write-plan/SKILL.md);
172
+ - covered bounded work -> Workflow and Execute Work;
173
+ - no action needed -> answer or stop.
132
174
 
133
- If no action is needed, answer or stop. If work is proposed but unapproved, recommend the exact action and wait for the user's response.
175
+ If work is recommended but not authorized, state the exact proposal and wait.
@@ -1,12 +1,14 @@
1
1
  # Discussion Continuity
2
2
 
3
- Read this when preserving a compact discussion state or re-entry summary, or when carrying a selected checkpoint from discussion.
3
+ Read this before preserving discussion across context loss, creating or updating durable task memory from discussion, or carrying a proposed or selected checkpoint beyond the current conversational context.
4
4
 
5
- A **discussion state summary** records enough shared understanding to continue or choose the next action. It is not a Checkpoint unless Workflow deliberately selects a boundary that dependent work must not cross unresolved.
5
+ Discussion state is not automatically a Working Record, Spec, Plan, checkpoint, or authority.
6
6
 
7
- ## Keep It In Chat When Possible
7
+ ## Keep It In Conversation When Possible
8
8
 
9
- Keep the summary in conversation when the current context can safely continue. Use only fields that help:
9
+ Keep state in chat when the current context can safely reach the next decision or action.
10
+
11
+ Summarize only what helps:
10
12
 
11
13
  ```text
12
14
  Goal or question:
@@ -15,18 +17,68 @@ Settled:
15
17
  Tentative:
16
18
  Open:
17
19
  Evidence or alternatives that matter:
18
- Selected checkpoints, if any:
19
20
  Recommended or accepted next action:
20
- Authority source or approval needed:
21
+ Authority or decision still needed:
21
22
  ```
22
23
 
23
- Do not turn a summary into a transcript, questionnaire, frozen architecture, automatic Spec, Plan, Working Record, or checkpoint.
24
+ Prefer natural prose. Use structured fields only when they prevent ambiguity or support a transition. Never emit empty or irrelevant fields.
25
+
26
+ Do not preserve a transcript, repeated rationale, rejected alternatives that no longer matter, or every discussion turn.
27
+
28
+ ## Choose Durable Memory By Purpose
29
+
30
+ Use a durable destination only when losing the state could cause later misalignment:
31
+
32
+ - **Working Record:** evolving task state, current work, proposed outcomes, decisions, evidence pointers, checkpoints, blockers, and the next useful action.
33
+ - **Spec:** stable accepted behavior, boundaries, or content needs a tracked source.
34
+ - **Plan:** an accepted ordered execution strategy must survive independently.
35
+ - **ADR:** a surprising and hard-to-reverse repository decision needs durable rationale.
36
+ - **Handoff:** a point-in-time continuation package must transfer to another context or owner.
37
+ - **Domain documentation:** stable terminology or domain meaning belongs in an existing repository source.
38
+
39
+ Do not create an artifact merely because discussion occurred. Prefer an existing repository convention. Ask before inventing a tracked destination whose authority or ownership matters.
40
+
41
+ ## Preserve Through Track Work
42
+
43
+ Discuss owns exploration and meaning. [Track Work](../../track-work/SKILL.md) owns the Working Record and its lifecycle.
44
+
45
+ ```text
46
+ Discuss
47
+ -> supported state worth preserving
48
+ -> Track Work performs one atomic update
49
+ -> Discuss confirms the preserved meaning
50
+ -> continue discussion or return to Workflow
51
+ ```
52
+
53
+ A Working Record is appropriate when:
54
+
55
+ - the task must survive compaction, pause, navigation, or transfer;
56
+ - decisions, evidence, blockers, authority, or the next action need reconstruction;
57
+ - one outcome may span implementation, verification, feedback, review, or correction;
58
+ - several proposed outcomes or dependencies must remain ordered without becoming authorized;
59
+ - a selected checkpoint must survive until its boundary is resolved.
60
+
61
+ Preserve only supported state that could affect later interpretation or action. Give each detailed fact one canonical owner. Track Work should store current meaning rather than append discussion chronology.
62
+
63
+ When the initial record need arises from discussion, preserve the state that justified the record in the first authorized atomic update. Do not create an empty shell and lose the decisions, proposals, or uncertainty that made continuity necessary.
24
64
 
25
- ## Preserve Selected Checkpoints Separately
65
+ After preservation, return to Discuss unless Workflow established another route. Record mutation does not transfer ownership or authorize execution.
26
66
 
27
- When discussion proposes a possible checkpoint, record it as proposed rather than selected. Workflow selects it only when its additional boundary materially protects dependent work and its authority is covered.
67
+ ## Carry Proposed And Selected Checkpoints
28
68
 
29
- For a selected checkpoint preserve only what later action needs:
69
+ A possible checkpoint remains proposed in the current discussion until Workflow selects it.
70
+
71
+ For a proposed checkpoint, preserve only:
72
+
73
+ ```text
74
+ Status: Proposed
75
+ Type:
76
+ Purpose:
77
+ Boundary it could protect:
78
+ Authority or selection still needed:
79
+ ```
80
+
81
+ For a selected checkpoint, preserve:
30
82
 
31
83
  ```text
32
84
  Status: Selected
@@ -38,34 +90,34 @@ Selection source:
38
90
  Authority scope:
39
91
  ```
40
92
 
41
- Do not infer authorization from a recommendation. Keep local commit authority separate from push or integration, and keep migration, deprecation, release, and launch separately controlled.
93
+ Persist checkpoint state through Track Work only when durable memory is needed. Keep local commit authority separate from push or integration, and keep migration, release, and launch separately controlled.
42
94
 
43
- When durable task memory is needed, [Track Work](../../track-work/SKILL.md) owns the pending checkpoint and terminal result. The discussion summary remains conversational state rather than duplicate checkpoint history.
95
+ ## Preserve Re-entry State
44
96
 
45
- ## Preserve A Durable Artifact Only When Needed
97
+ When evidence, feedback, or failure reopens discussion, preserve only the affected change:
46
98
 
47
- Choose the artifact by the information that must survive:
99
+ ```text
100
+ New evidence:
101
+ Assumption or direction affected:
102
+ What remains valid:
103
+ Decision, proposal, Slice, or artifact affected:
104
+ Question or bounded learning action now needed:
105
+ Authority or user decision needed:
106
+ ```
48
107
 
49
- - **Working Record:** evolving task state, selected checkpoints, Slices, Decisions, evidence, History, and next action. Read [Track Work](../../track-work/SKILL.md).
50
- - **Spec:** stable accepted content needs a durable source. Read [Write Spec](../../write-spec/SKILL.md).
51
- - **Plan:** a stable ordered strategy and its selected checkpoints need an execution artifact. Read [Write Plan](../../write-plan/SKILL.md).
52
- - **ADR:** a surprising, hard-to-reverse repository decision needs durable rationale.
53
- - **Handoff:** one point-in-time continuation package must transfer to another context or owner.
54
- - **Domain documentation:** stable terminology or domain meaning belongs in an existing glossary or domain source.
108
+ Do not restart from zero, rewrite unaffected decisions, or narrate completed work.
55
109
 
56
- Do not create an artifact merely because discussion occurred. Prefer an existing repository convention; ask before inventing a destination whose authority, durability, or ownership matters.
110
+ After context loss, recover through Track Work’s prescribed view before relying on the record. Compare recovered memory with current user direction and live evidence. Reconcile only what current evidence changed.
57
111
 
58
- ## Preserve Re-Entry State
112
+ ## Stop
59
113
 
60
- When new evidence reopens discussion, preserve only the affected change:
114
+ Stop preserving when the current meaning and one next useful action can be reconstructed safely.
61
115
 
62
- ```text
63
- New evidence:
64
- Invalidated assumption:
65
- Still valid:
66
- Decision, Slice, or artifact affected:
67
- Question or learning action now needed:
68
- Authority or user decision needed:
69
- ```
116
+ Do not turn continuity into:
70
117
 
71
- Do not restart from zero or rewrite unaffected decisions, evidence, artifacts, or work.
118
+ - a transcript;
119
+ - a mandatory artifact;
120
+ - a second source of authority;
121
+ - a frozen architecture;
122
+ - an automatic checkpoint;
123
+ - a reason to begin execution.