@hassangameryt/freeflow 0.7.1 → 0.7.2
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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/README.md +28 -23
- package/capabilities/cognitive-routing/SKILL.md +94 -311
- package/command-surface.json +7 -1
- package/gemini-extension.json +1 -1
- package/package.json +4 -4
- package/pi-extension/dist/cognitive-routing-v2/budget.js +42 -0
- package/pi-extension/dist/cognitive-routing-v2/config.js +120 -0
- package/pi-extension/dist/cognitive-routing-v2/projection.js +321 -0
- package/pi-extension/dist/cognitive-routing-v2/render.js +231 -0
- package/pi-extension/dist/cognitive-routing-v2/runtime.js +1585 -0
- package/pi-extension/dist/cognitive-routing-v2/schemas.js +107 -0
- package/pi-extension/dist/cognitive-routing-v2/state.js +612 -0
- package/pi-extension/dist/cognitive-routing-v2/tools.js +91 -0
- package/pi-extension/dist/cognitive-routing-v2/types.js +44 -0
- package/pi-extension/dist/freeflow-context/tool.js +5 -0
- package/pi-extension/dist/index.js +279 -624
- package/pi-extension/dist/runtime/runtime-context.js +63 -13
- package/pi-extension/dist/session-sources/events.js +195 -0
- package/pi-extension/dist/session-sources/read-only-session.js +148 -0
- package/pi-extension/dist/session-sources/sources.js +233 -0
- package/pi-extension/dist/settings/settings-ui.js +44 -117
- package/pi-extension/src/cognitive-routing-v2/budget.ts +42 -0
- package/pi-extension/src/cognitive-routing-v2/config.ts +143 -0
- package/pi-extension/src/cognitive-routing-v2/projection.ts +365 -0
- package/pi-extension/src/cognitive-routing-v2/render.ts +256 -0
- package/pi-extension/src/cognitive-routing-v2/runtime.ts +1634 -0
- package/pi-extension/src/cognitive-routing-v2/schemas.ts +109 -0
- package/pi-extension/src/cognitive-routing-v2/state.ts +622 -0
- package/pi-extension/src/cognitive-routing-v2/tools.ts +93 -0
- package/pi-extension/src/cognitive-routing-v2/types.ts +222 -0
- package/pi-extension/src/freeflow-context/tool.ts +5 -0
- package/pi-extension/src/index.ts +285 -674
- package/pi-extension/src/runtime/runtime-context.ts +75 -14
- package/pi-extension/src/session-sources/events.ts +208 -0
- package/pi-extension/src/session-sources/read-only-session.ts +170 -0
- package/pi-extension/src/session-sources/sources.ts +263 -0
- package/pi-extension/src/settings/settings-ui.ts +54 -131
- package/pi-extension/tests/cognitive-routing-v2/communication.test.js +484 -0
- package/pi-extension/tests/cognitive-routing-v2/compaction-input.test.js +183 -0
- package/pi-extension/tests/cognitive-routing-v2/native.test.js +441 -0
- package/pi-extension/tests/cognitive-routing-v2/performance.test.js +87 -0
- package/pi-extension/tests/cognitive-routing-v2/persistence.test.js +245 -0
- package/pi-extension/tests/cognitive-routing-v2/projection.test.js +241 -0
- package/pi-extension/tests/cognitive-routing-v2/recovery.test.js +236 -0
- package/pi-extension/tests/cognitive-routing-v2/render.test.js +230 -0
- package/pi-extension/tests/cognitive-routing-v2/runtime.test.js +153 -0
- package/pi-extension/tests/cognitive-routing-v2/stabilization.test.js +521 -0
- package/pi-extension/tests/cognitive-routing-v2/state.test.js +275 -0
- package/pi-extension/tests/context-virtualization/extension.test.js +16 -0
- package/pi-extension/tests/fixtures/routing-native.js +188 -0
- package/pi-extension/tests/integration/mode-free-core.test.js +3 -2
- package/pi-extension/tests/integration/pi-extension.test.js +154 -37
- package/pi-extension/tests/integration/prompt-architecture.test.js +87 -6
- package/pi-extension/tests/integration/unaffected-regressions.test.js +77 -10
- package/plugin.json +1 -1
- package/runtime/prompts/cognitive-routing.md +4 -5
- package/runtime/prompts/core.md +51 -45
- package/runtime/prompts/interaction-contract.md +5 -5
- package/skills/action-selection/SKILL.md +57 -97
- package/skills/design-for-depth/SKILL.md +58 -193
- package/skills/design-for-depth/references/implementation-decisions.md +76 -0
- package/skills/diagnose-failure/SKILL.md +64 -196
- package/skills/discuss/SKILL.md +64 -123
- package/skills/discuss/references/discussion-continuity.md +7 -3
- package/skills/execute-work/SKILL.md +69 -88
- package/skills/execute-work/references/execute-work-edges.md +9 -3
- package/skills/handoff/SKILL.md +44 -54
- package/skills/handoff/references/handoff-templates.md +15 -6
- package/skills/review-artifact/SKILL.md +80 -127
- package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +1 -1
- package/skills/review-work/SKILL.md +65 -115
- package/skills/review-work/references/independent-work-reviewer-contract.md +1 -1
- package/skills/simplify-code/SKILL.md +47 -100
- package/skills/track-work/SKILL.md +128 -119
- package/skills/track-work/references/working-record-format.md +14 -2
- package/skills/verify-work/SKILL.md +58 -62
- package/skills/verify-work/references/integration-evidence.md +4 -2
- package/skills/verify-work/references/test-design.md +89 -0
- package/skills/workflow/SKILL.md +73 -119
- package/skills/write-plan/SKILL.md +46 -77
- package/skills/write-plan/references/plan-shapes.md +5 -5
- package/skills/write-spec/SKILL.md +51 -63
- package/skills/write-spec/references/artifact-standards.md +2 -2
- package/skills/write-spec/references/decision-records.md +3 -2
- package/skills/write-spec/references/spec-shapes.md +15 -0
- package/pi-extension/dist/cognitive-routing/commands.js +0 -96
- package/pi-extension/dist/cognitive-routing/config.js +0 -232
- package/pi-extension/dist/cognitive-routing/controller.js +0 -1292
- package/pi-extension/dist/cognitive-routing/history.js +0 -451
- package/pi-extension/dist/cognitive-routing/host.js +0 -188
- package/pi-extension/dist/cognitive-routing/pi-routing-session.js +0 -414
- package/pi-extension/dist/cognitive-routing/pi-session-control.js +0 -320
- package/pi-extension/dist/cognitive-routing/runtime.js +0 -43
- package/pi-extension/dist/cognitive-routing/tool.js +0 -212
- package/pi-extension/dist/cognitive-routing/types.js +0 -6
- package/pi-extension/src/cognitive-routing/commands.ts +0 -129
- package/pi-extension/src/cognitive-routing/config.ts +0 -303
- package/pi-extension/src/cognitive-routing/controller.ts +0 -1628
- package/pi-extension/src/cognitive-routing/history.ts +0 -650
- package/pi-extension/src/cognitive-routing/host.ts +0 -266
- package/pi-extension/src/cognitive-routing/pi-routing-session.ts +0 -538
- package/pi-extension/src/cognitive-routing/pi-session-control.ts +0 -444
- package/pi-extension/src/cognitive-routing/runtime.ts +0 -57
- package/pi-extension/src/cognitive-routing/tool.ts +0 -273
- package/pi-extension/src/cognitive-routing/types.ts +0 -89
- package/pi-extension/tests/cognitive-routing/commands.test.js +0 -134
- package/pi-extension/tests/cognitive-routing/controller.test.js +0 -1128
- package/pi-extension/tests/cognitive-routing/extension-lifecycle.test.js +0 -1142
- package/pi-extension/tests/cognitive-routing/history.test.js +0 -274
- package/pi-extension/tests/cognitive-routing/host-identity.test.js +0 -63
- package/pi-extension/tests/cognitive-routing/pi-normal-lifecycle.test.js +0 -434
- package/pi-extension/tests/cognitive-routing/pi-session-control.test.js +0 -174
- package/pi-extension/tests/cognitive-routing/pi-session-history.test.js +0 -91
- package/pi-extension/tests/cognitive-routing/profile-resolution.test.js +0 -279
- package/pi-extension/tests/cognitive-routing/tool.test.js +0 -230
- package/skills/tdd/SKILL.md +0 -143
- package/skills/tdd/references/test-design.md +0 -96
- /package/pi-extension/tests/{cognitive-routing/host-fixture.js → fixtures/pi-host.js} +0 -0
|
@@ -1,123 +1,92 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: write-plan
|
|
3
|
-
description: Use when writing or revising an implementation plan, execution plan, remediation plan, migration plan, or similar ordered plan.
|
|
3
|
+
description: "Use when writing or revising an implementation plan, execution plan, remediation plan, migration plan, or similar ordered plan."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Write Plan
|
|
7
7
|
|
|
8
|
-
Write
|
|
8
|
+
Write a supported ordered strategy for an agreed outcome. Make its dependencies, actions, checks, and invalidation conditions clear without inventing requirements or pretending unknown later work is settled.
|
|
9
9
|
|
|
10
|
-
A Plan
|
|
10
|
+
A Plan describes intended execution. The Working Record preserves actual work, evolving state, and the next useful action. Neither creates authority by existing.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Plan Only What Is Understood Enough To Order
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Use a durable Plan when the intended outcome and material decisions are settled, the approach and dependencies can be ordered without guessing, and the strategy needs to survive independently.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- material user decisions and source conflicts are resolved;
|
|
18
|
-
- the execution approach is understood well enough to order;
|
|
19
|
-
- phases, slices, and dependencies can be stated without guessing;
|
|
20
|
-
- expected checks are known or obtainable;
|
|
21
|
-
- substantial branching or discovery is not expected.
|
|
16
|
+
Not every task needs one. A small correction can proceed from its request and supported approach. An evolving route with substantial branching belongs in [Track Work](../track-work/SKILL.md) as provisional Slices, not a confident long-form Plan.
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
Use [Discuss](../discuss/SKILL.md) for unresolved direction or material alternatives, [Decision Gate](../decision-gate/SKILL.md) for a blocking owner choice or source conflict, and [Diagnose Failure](../diagnose-failure/SKILL.md) for a fix whose cause is unsupported. Do not encode the hoped-for answer as a planning assumption.
|
|
24
19
|
|
|
25
|
-
|
|
20
|
+
If the user asks about a Plan, answer rather than write one. If execution of the task is already authorized and a Plan is useful preparation, writing it need not create another approval stop. Preserve any review or user-return boundary actually selected.
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
## Establish The Current Basis
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
A separate Spec is not required when the request and accepted understanding are sufficiently clear. Otherwise consume the relevant Spec, issue, design, diagnosis, decision, or requirements, together with current code, tests, policies, ADRs, and external constraints where needed.
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
Identify which accepted source version or amendment the Plan implements. A Working Record can locate those sources but cannot override them. Do not use an older experimental or design baseline merely because a prior Plan was reviewed.
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
Separate:
|
|
34
29
|
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
30
|
+
- the required outcome and non-goals;
|
|
31
|
+
- accepted design choices and constraints;
|
|
32
|
+
- the supported implementation approach;
|
|
33
|
+
- assumptions whose failure would invalidate dependent work;
|
|
34
|
+
- unresolved or intentionally deferred work outside this Plan's promise.
|
|
39
35
|
|
|
40
|
-
|
|
36
|
+
An experiment produces evidence, not an automatic requirement. Include its consequences only where selected for this outcome; do not omit consequences the user subsequently accepted.
|
|
41
37
|
|
|
42
|
-
## Write The
|
|
38
|
+
## Write The Smallest Useful Strategy
|
|
43
39
|
|
|
44
|
-
Read [
|
|
40
|
+
Read [Plan Shapes](references/plan-shapes.md) before choosing the artifact shape.
|
|
45
41
|
|
|
46
|
-
Include, when
|
|
42
|
+
Include relevant goal, sources, scope, decisions, assumptions, dependencies, ordered coherent outcomes, focused checks, integration, completion conditions, and what would invalidate the strategy. Use exact paths and commands when known and useful; do not invent them to make the Plan look executable.
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
- accepted decisions, assumptions, dependencies, and required order;
|
|
50
|
-
- phases and slices with coherent, bounded results;
|
|
51
|
-
- checks, integration, and final acceptance;
|
|
52
|
-
- conditions that would invalidate the Plan.
|
|
44
|
+
Size outcomes for manageable working context, dependencies, uncertainty, and checking. Do not divide mechanically by file, bug count, test, or method. The complete task may require several Slices, but each should have a coherent result and a clear dependency on earlier work where one exists.
|
|
53
45
|
|
|
54
|
-
|
|
46
|
+
A validation step may stop the Plan if a bounded assumption fails. If its result is expected to select among materially different strategies, keep dependent work provisional in the Working Record rather than presenting the later sequence as decided.
|
|
55
47
|
|
|
56
|
-
|
|
48
|
+
The Plan is not a context inventory. Specify only the sources and relationships needed to explain or execute its steps, leaving ordinary local choices to the executing agent.
|
|
57
49
|
|
|
58
|
-
##
|
|
50
|
+
## Preserve Acceptance And Return Conditions
|
|
59
51
|
|
|
60
|
-
|
|
52
|
+
Tie each material outcome and final check to the accepted behavior it serves. Do not let available tests redefine acceptance or claim whole-system completion from a narrow observer.
|
|
61
53
|
|
|
62
|
-
|
|
54
|
+
Keep the agreed user-facing return condition visible: return a proposed strategy, implement one Slice, finish the described task, or stop at a specified boundary. Internal delegation handbacks and context cycles are not automatic user checkpoints.
|
|
63
55
|
|
|
64
|
-
Plan
|
|
56
|
+
A Plan must not invent product behavior, compatibility, public interfaces, failure semantics, sensitive policy, migration, scale, retries, recovery, or extension machinery. Do not replace agreed scope with an unapproved MVP or later-version split.
|
|
65
57
|
|
|
66
|
-
|
|
58
|
+
Before a new prerequisite becomes a planned obligation, determine whether it serves an accepted requirement or only preserves a particular approach. Resolve consequential alternatives instead of hiding them in confident steps.
|
|
67
59
|
|
|
68
|
-
|
|
60
|
+
## Select Checkpoints Without Making A Schedule Of Ceremonies
|
|
69
61
|
|
|
70
|
-
|
|
62
|
+
Ordinary verification and silent self-review belong to producing each supported result. Do not restate them as independent gates unless a particular evidence boundary needs explanation.
|
|
71
63
|
|
|
72
|
-
|
|
64
|
+
Include independent review, a local commit, a user decision, or continuity transfer only when selected to protect a concrete dependency, risk, rollback, or delivery boundary. A Slice ending or a fixed count is insufficient.
|
|
73
65
|
|
|
74
|
-
|
|
66
|
+
Accepting a Plan as a strategy is not permission to execute it. Explicit approval to execute the Plan may cover its listed work, checks, selected reviews, record maintenance, and local commits. It does not imply push, integration, migration, deprecation, release, or launch. Planned commits remain conditional on fresh evidence and [Commit Work](../commit-work/SKILL.md) inspection.
|
|
75
67
|
|
|
76
|
-
|
|
68
|
+
When an existing agreement already covers the work, preserve that source instead of asking the user to approve the same scope again because it is now written down.
|
|
77
69
|
|
|
78
|
-
|
|
79
|
-
- hide unresolved strategy, architecture, dependencies, or owner choices inside confident steps;
|
|
80
|
-
- plan a production fix from a guessed cause;
|
|
81
|
-
- rewrite tests, docs, policies, or acceptance merely to make the proposed path succeed;
|
|
82
|
-
- add speculative abstractions, migration machinery, retries, recovery, scale, or extension points;
|
|
83
|
-
- replace agreed scope with an unapproved MVP, v1/v2, roadmap, or later-version split.
|
|
70
|
+
## Revise Only The Affected Strategy
|
|
84
71
|
|
|
85
|
-
|
|
72
|
+
Do not update a Plan for completed steps, ordinary local choices, test counts, or routine status. Record material actual state through Track Work when present.
|
|
86
73
|
|
|
87
|
-
|
|
74
|
+
Revise or supersede the affected strategy when accepted intent or supported evidence changes its scope, design, ordering, dependencies, checks, or mechanism. Preserve valid earlier work and rationale. A clerical correction does not reopen the strategy, and reaching a review cap is not evidence that the Plan needs rewriting.
|
|
88
75
|
|
|
89
|
-
|
|
76
|
+
Identify affected upstream and downstream artifacts. Revise only content whose owned meaning changed and whose mutation is authorized. If an upstream contract remains unresolved, mark dependent steps contingent before they are used. Do not repair consistency by silently changing the required outcome.
|
|
90
77
|
|
|
91
|
-
|
|
78
|
+
## Self-Review Before Treating The Plan As Usable
|
|
92
79
|
|
|
93
|
-
|
|
80
|
+
After factual source checks, use [Review Artifact](../review-artifact/SKILL.md) for one silent author self-review of the complete Plan, accepted sources, and intended execution boundary.
|
|
94
81
|
|
|
95
|
-
|
|
82
|
+
Check whether the ordered work can achieve the accepted outcome, dependencies are supported, later uncertainty is honest, final checks match acceptance, and selected checkpoints are proportionate. Correct clear covered defects and recheck affected facts and lenses.
|
|
96
83
|
|
|
97
|
-
|
|
84
|
+
Do not automatically dispatch an independent reviewer after writing or revising a Plan. Use Review Artifact's independent route only when separately selected and authorized to protect a concrete boundary. Supply complete sources, dependencies, and limits; adjudicate the returned report before acting on its findings.
|
|
98
85
|
|
|
99
|
-
|
|
86
|
+
Neither self-review nor independent review grants user acceptance or execution authority. Conversely, an already-covered execution agreement does not need another approval turn solely because planning produced an artifact.
|
|
100
87
|
|
|
101
|
-
|
|
102
|
-
- Can coherent, checkable slices proceed in the stated order?
|
|
103
|
-
- Are dependencies, integration, final checks, and invalidation conditions represented?
|
|
104
|
-
- Are selected checkpoints useful and proportionate rather than automatic ceremony?
|
|
105
|
-
- Did the Plan invent intent, disguise material uncertainty, or absorb rolling task state?
|
|
88
|
+
## Report And Return
|
|
106
89
|
|
|
107
|
-
|
|
90
|
+
Report the Plan path and intended use, source basis, material assumptions or contingent work, invalidation conditions, selected checkpoints, and actual review/acceptance/execution-authority status.
|
|
108
91
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
After writing or materially revising the Plan, route it to [Review Artifact](../review-artifact/SKILL.md) before treating it as ready for approval and execution.
|
|
112
|
-
|
|
113
|
-
Provide the reviewer with the complete Plan, intended use, source truth, linked artifacts, dependencies, selected checkpoints, and known evidence gaps. Review Artifact owns dependency ordering, review items, judgment, adjudication, and the review cycle. Artifact review establishes fitness; the user separately accepts the Plan and grants any scoped execution authority.
|
|
114
|
-
|
|
115
|
-
## Report
|
|
116
|
-
|
|
117
|
-
State:
|
|
118
|
-
|
|
119
|
-
- Plan path and intended use;
|
|
120
|
-
- source context and linked artifacts;
|
|
121
|
-
- material assumptions, blockers, or invalidation conditions;
|
|
122
|
-
- selected review, commit, user, or continuity checkpoints;
|
|
123
|
-
- artifact-review, Plan-acceptance, and execution-authorization status.
|
|
92
|
+
Return the supported strategy to the requesting activity. If the agreement covers implementation, the agent can continue through the normal execution route; if it asks for a Plan first, stop there. Do not begin work outside that agreement or claim an unresolved strategy is ready.
|
|
@@ -20,7 +20,7 @@ When no convention exists and future readers need durable identity, begin with a
|
|
|
20
20
|
> **Source:** <spec, issue, Working Record, diagnosis, or accepted context>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Use one current status. Follow the repository or owner's vocabulary; useful states may include `Draft`, `Reviewed`, `Ready`, `Superseded`, and `Abandoned`. Writing or reviewing a Plan does not by itself make it `Ready`.
|
|
23
|
+
Use one current status. Follow the repository or owner's vocabulary; useful states may include `Draft`, `Reviewed`, `Ready`, `Superseded`, and `Abandoned`. Writing or reviewing a Plan does not by itself make it `Ready`. State whether any recorded review was author self-review or selected independent review; neither implies user acceptance or execution authority.
|
|
24
24
|
|
|
25
25
|
Add dates, supersession links, or approvers only when useful and reliable.
|
|
26
26
|
|
|
@@ -39,7 +39,7 @@ Dependencies:
|
|
|
39
39
|
Required order:
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Link accepted behavior, architecture, and decisions instead of copying their rationale. Do not hide unsettled design or owner choices as assumptions. If an assumption could choose among materially different strategies, resolve it before treating the Plan as executable.
|
|
42
|
+
Link accepted behavior, architecture, and decisions instead of copying their rationale. Identify the governing source version and relevant accepted amendments when they affect execution. Do not hide unsettled design or owner choices as assumptions. If an assumption could choose among materially different strategies, resolve it before treating the Plan as executable. Experimental findings become planned obligations only when selected for the accepted outcome; a previously reviewed baseline does not excuse omitting a later accepted change.
|
|
43
43
|
|
|
44
44
|
## Choose The Execution Shape
|
|
45
45
|
|
|
@@ -106,7 +106,7 @@ A slice is a coherent result, not a file list. Mention files, modules, or system
|
|
|
106
106
|
|
|
107
107
|
Consider checkpoints at meaningful slice, phase, integration, risk, and continuity boundaries. Record only useful additions; normal verification and silent self-review need no repeated fields.
|
|
108
108
|
|
|
109
|
-
A selected local commit names its coherent outcome and conditions, not merely “commit after this slice.” Plan
|
|
109
|
+
A selected local commit names its coherent outcome and conditions, not merely “commit after this slice.” Approval to execute the Plan may authorize listed local commits subject to live evidence and Commit Work inspection; approval of its strategy alone does not. Neither implies push, integration, migration, deprecation, release, or launch. Record actual results and commit identities in the Working Record.
|
|
110
110
|
|
|
111
111
|
## Adapt For The Work Type
|
|
112
112
|
|
|
@@ -151,6 +151,6 @@ These conditions stop or revise the affected Plan. They are not alternate branch
|
|
|
151
151
|
|
|
152
152
|
A local implementation detail, expected result, or completed slice does not revise the Plan.
|
|
153
153
|
|
|
154
|
-
For a founded material change, update only the affected strategy and dependencies, record why it changed, preserve prior rationale
|
|
154
|
+
For a founded material change, update only the affected strategy and dependencies, record why it changed, and preserve prior rationale. Update linked artifacts only when their owned content changed and revision is authorized; otherwise mark dependent work contingent and return the missing decision or revision.
|
|
155
155
|
|
|
156
|
-
Use a superseding Plan when editing in place would obscure
|
|
156
|
+
Use a superseding Plan when editing in place would obscure the earlier accepted strategy or reviewed state. Apply author self-review through Review Artifact to a materially revised or superseding Plan. Independent review is separately selected and authorized when it protects a concrete boundary, not required merely because the Plan changed.
|
|
@@ -1,104 +1,92 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: write-spec
|
|
3
|
-
description: Use when writing or revising a spec, PRD, issue, API contract, technical design, migration contract, decision artifact, or similar durable document.
|
|
3
|
+
description: "Use when writing or revising a spec, PRD, issue, API contract, technical design, migration contract, decision artifact, or similar durable document."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Write Spec
|
|
7
7
|
|
|
8
|
-
Turn
|
|
8
|
+
Turn accepted intent and source evidence into a durable artifact that later work can use without inheriting invented requirements or losing accepted changes.
|
|
9
9
|
|
|
10
|
-
A
|
|
10
|
+
A Spec describes content, behavior, constraints, and uncertainty for its intended use. It is not an implementation sequence, Working Record, transcript, or permission grant. Useful technical depth is welcome; hypothetical completeness is not required.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Establish The Artifact's Job
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Identify the artifact type, intended reader or future action, accepted scope, destination, and unresolved questions it must preserve.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- audience or future action it must support;
|
|
18
|
-
- accepted intent, scope, and source context;
|
|
19
|
-
- destination and repository convention;
|
|
20
|
-
- unresolved questions that belong in the artifact.
|
|
16
|
+
Answer questions about a Spec without editing it unless revision is requested. Use [Discuss](../discuss/SKILL.md) when direction or alternatives remain materially open, and [Decision Gate](../decision-gate/SKILL.md) for one blocking owner choice or source conflict. Do not repeat discussion that already settled the artifact's purpose.
|
|
21
17
|
|
|
22
|
-
|
|
18
|
+
An agreement to draft a proposal permits proposed design, clearly labelled. It does not make that design accepted behavior. An agreement to implement accepted work may include documenting its supported contract; do not manufacture another user approval merely because a document was produced.
|
|
23
19
|
|
|
24
|
-
|
|
20
|
+
## Establish The Current Source Basis
|
|
25
21
|
|
|
26
|
-
|
|
22
|
+
Use the sources that actually determine the artifact:
|
|
27
23
|
|
|
28
|
-
|
|
24
|
+
- current user direction and accepted discussion, including later amendments;
|
|
25
|
+
- existing Specs, issues, decisions, and contracts being revised or consumed;
|
|
26
|
+
- relevant live code, tests, policy, ADRs, and established behavior;
|
|
27
|
+
- current primary sources when an external version or interface constrains the result;
|
|
28
|
+
- [Track Work](../track-work/SKILL.md) for task memory when a record exists.
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
- [Track Work](../track-work/SKILL.md), which owns the living Working Record for current state, slices, task-local decisions, and evidence, when one exists;
|
|
32
|
-
- relevant code, tests, requirements, policies, ADRs, and established behavior;
|
|
33
|
-
- existing artifacts that this one revises or depends on;
|
|
34
|
-
- current primary sources when an external contract or version matters.
|
|
30
|
+
A record or implementation summary cannot override contradictory current intent or accepted source truth. Distinguish what was requested, what was proposed, what was accepted, and what an observation actually established.
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
Preserve enough source identity to recover the basis of a consequential statement. For an approval such as "proceed," retain the proposal and response together when their scope matters. Authorization to investigate or draft an option is not acceptance of undisclosed production consequences.
|
|
37
33
|
|
|
38
|
-
Do not infer
|
|
34
|
+
Do not infer requirements from nearby code, existing tests, or available machinery merely because those sources exist. A test can faithfully protect an unnecessary mechanism.
|
|
39
35
|
|
|
40
|
-
##
|
|
36
|
+
## Write Only What The Intended Use Needs
|
|
41
37
|
|
|
42
|
-
Read [
|
|
38
|
+
Read [Spec Shapes](references/spec-shapes.md) before choosing the structure. Read [Artifact Standards](references/artifact-standards.md) when choosing destination, identity, status, source trail, or revision shape. Read [Decision Records](references/decision-records.md) when the artifact primarily preserves a decision and rationale.
|
|
43
39
|
|
|
44
|
-
Include,
|
|
40
|
+
Include relevant purpose, scope, non-goals, accepted behavior, constraints, interfaces, consequential failure semantics, acceptance, and evidence. Explain architecture and ownership deeply where the intended use requires it; do not remove necessary detail just to shorten the document.
|
|
45
41
|
|
|
46
|
-
-
|
|
47
|
-
- behavior, design, interfaces, constraints, and consequential failure semantics required by the artifact;
|
|
48
|
-
- acceptance and suitable evidence;
|
|
49
|
-
- accepted decisions, clearly marked uncertainty, and source references.
|
|
42
|
+
When writing an implementation-guiding design whose unresolved representation, identity, ownership, algorithm, or failure choices could invalidate significant dependent work, read [Design for Depth](../design-for-depth/SKILL.md) and use its Implementation Decisions method. Preserve the selected choices and rationale, distinguishing fixed constraints from illustrative sketches and local freedom. Existing supported decisions need no fresh design exercise; open choices must remain visible rather than being filled with invented mechanics.
|
|
50
43
|
|
|
51
|
-
|
|
44
|
+
Keep distinguishable:
|
|
52
45
|
|
|
53
|
-
|
|
46
|
+
- required behavior and accepted decisions;
|
|
47
|
+
- supported facts and their evidence limits;
|
|
48
|
+
- proposed implementation mechanisms;
|
|
49
|
+
- tentative assumptions and open questions;
|
|
50
|
+
- intentional deferrals and superseded direction.
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
Use the repository's vocabulary rather than inventing a new status schema. Place a consequential uncertainty where the reader makes the affected decision, not in a distant caveat after confident requirements.
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
Keep ordered execution in a Plan and live progress in the Working Record. Link shared rationale rather than copying it into several independently maintained sources.
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
- override code, tests, docs, policies, ADRs, or established behavior without resolving the conflict;
|
|
61
|
-
- present a tentative proposal or assumption as accepted;
|
|
62
|
-
- hide an owner decision behind `TBD`, polished prose, or an unmarked open question;
|
|
63
|
-
- reduce agreed scope into MVP, v1/v2, roadmap, or later-version framing without approval;
|
|
64
|
-
- create a destination or artifact convention whose authority or durability matters without resolving it.
|
|
56
|
+
## Do Not Promote An Approach Into A Requirement
|
|
65
57
|
|
|
66
|
-
|
|
58
|
+
Before adding an obligation, identify its accepted source or why it is necessary for the stated outcome. A limitation of one implementation technique does not establish a need for stronger guarantees, host changes, new persistence, retries, or a subsystem.
|
|
67
59
|
|
|
68
|
-
|
|
60
|
+
When a consequential choice remains, present its concrete effect and supported alternatives through its owner. Do not settle it through normative prose, an unexplained assumption, or a polished placeholder.
|
|
69
61
|
|
|
70
|
-
|
|
62
|
+
Stop the affected writing when it would silently change behavior, scope, public interfaces, compatibility, sensitive policy, failure semantics, or hard-to-reverse design. Do not rewrite source truth to suit implementation, or reduce agreed scope into an unapproved MVP, roadmap, or later-version split.
|
|
71
63
|
|
|
72
|
-
|
|
73
|
-
- update only what new intent or evidence changed;
|
|
74
|
-
- keep superseded decisions and material rationale recoverable through the owning decision record, change history, or version control.
|
|
64
|
+
Open questions need not stop unrelated content. A proposal can be fit for discussion while remaining unfit to authorize or guide production implementation; state that boundary clearly.
|
|
75
65
|
|
|
76
|
-
|
|
66
|
+
## Reconcile Material Changes
|
|
77
67
|
|
|
78
|
-
|
|
68
|
+
Preserve accepted content that still holds. Change only what new intent or evidence affects, and keep consequential prior rationale recoverable through the owning decision record, change history, or version control.
|
|
79
69
|
|
|
80
|
-
|
|
70
|
+
When an accepted amendment or learning result changes the contract, identify the affected downstream Plan, acceptance check, or implementation assumption. Reconcile those dependencies when authorized; otherwise mark them contingent and return the needed revision before dependent use. Do not synchronize unrelated artifacts.
|
|
81
71
|
|
|
82
|
-
|
|
83
|
-
- Does it agree with accepted intent and source evidence?
|
|
84
|
-
- Can a future reader distinguish required, tentative, open, deferred, and superseded information?
|
|
85
|
-
- Is it broad and deep enough for its intended use without taking over another artifact's job?
|
|
86
|
-
- Are consequential claims, failure behavior, and acceptance supported or explicitly unresolved?
|
|
87
|
-
- Did writing introduce any decision the user did not make?
|
|
72
|
+
Experimental learning does not automatically enter the production contract. Distinguish findings deliberately selected for implementation from observations retained as evidence or deferred possibilities. Conversely, do not keep using an older baseline after the user accepted a relevant change.
|
|
88
73
|
|
|
89
|
-
|
|
74
|
+
Do not rewrite historical decisions as though they always contained the new choice. Follow repository policy for historical records and supersession.
|
|
90
75
|
|
|
91
|
-
## Review
|
|
76
|
+
## Self-Review Once Before Use
|
|
92
77
|
|
|
93
|
-
After
|
|
78
|
+
After checking source-backed factual claims, use [Review Artifact](../review-artifact/SKILL.md) for silent author self-review of the complete resulting artifact and its intended use.
|
|
94
79
|
|
|
95
|
-
|
|
80
|
+
Check that it preserves accepted intent and amendments, separates requirements from proposals, has sufficient evidence and acceptance conditions, and keeps affected dependencies coherent. Correct clear covered defects, then recheck affected facts and review lenses. Return unresolved owner decisions instead of making the document internally consistent by inventing an answer.
|
|
96
81
|
|
|
97
|
-
|
|
82
|
+
This is the author's ordinary self-review, not another mandatory review cycle. Do not dispatch an independent reviewer merely because a Spec was written or materially revised.
|
|
98
83
|
|
|
99
|
-
|
|
84
|
+
Independent review applies only when selected and authorized to protect a concrete boundary. Supply the complete artifact, source basis, dependencies, and evidence limits through Review Artifact's independent route. Its report ends the review; findings require adjudication before revision or use.
|
|
100
85
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
86
|
+
Review establishes fitness, not user acceptance or execution authority. Respect an explicitly selected approval checkpoint, but do not create one for every artifact by default.
|
|
87
|
+
|
|
88
|
+
## Report And Stop
|
|
89
|
+
|
|
90
|
+
Report the artifact path, type, intended use, source basis, material unresolved or contingent content, and actual review/acceptance status. Do not label author self-review as independent review or use an approval status without its source.
|
|
91
|
+
|
|
92
|
+
Stop when the authorized artifact is fit for its stated use or its blocking decision/evidence limit is explicit. Return to the requesting activity; writing a Spec does not begin implementation or authorize another outcome.
|
|
@@ -49,7 +49,7 @@ Draft | Reviewed | Approved | Rejected | Superseded
|
|
|
49
49
|
|
|
50
50
|
The appropriate statuses depend on the artifact type. An issue, policy, ADR, and API contract need not share one lifecycle.
|
|
51
51
|
|
|
52
|
-
Status communicates artifact state; it does not replace review evidence or user authority.
|
|
52
|
+
Status communicates artifact state; it does not replace review evidence or user authority. Distinguish author self-review from selected independent review when reporting review status. Writing a Spec or Plan does not automatically select an independent reviewer.
|
|
53
53
|
|
|
54
54
|
## Preserve Sources Without Copying Them
|
|
55
55
|
|
|
@@ -66,7 +66,7 @@ session:<session-id>/turn:<turn-id>
|
|
|
66
66
|
|
|
67
67
|
Use identifiers that actually exist. Prefer links and concise quotations over copied inventories, logs, diffs, or transcripts.
|
|
68
68
|
|
|
69
|
-
A source trail should let a future reader recover why the artifact says what it says.
|
|
69
|
+
A source trail should let a future reader recover why the artifact says what it says. For consequential choices, preserve the relevant proposal, disclosed consequences, and acceptance source rather than an isolated “proceed” or an agent's approval summary. Distinguish accepted amendments from unselected experimental findings. This does not require preserving every conversation turn.
|
|
70
70
|
|
|
71
71
|
## Revise Without Rewriting History
|
|
72
72
|
|
|
@@ -56,7 +56,7 @@ Use the repository's ADR or decision format when one exists. Otherwise adapt thi
|
|
|
56
56
|
<Evidence, conditions, or later decision that would reopen or replace it.>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
State proposals as proposals. Do not write an assumption, reviewer suggestion, or agent preference as an accepted decision.
|
|
59
|
+
State proposals as proposals. Do not write an assumption, reviewer suggestion, or agent preference as an accepted decision. For a consequential choice, identify the presented option, disclosed consequences, and acceptance source. Approval to investigate or draft an option does not establish acceptance of its eventual production requirements.
|
|
60
60
|
|
|
61
61
|
## Preserve Authority And History
|
|
62
62
|
|
|
@@ -67,7 +67,8 @@ When a decision changes:
|
|
|
67
67
|
- preserve the old record as `Superseded` rather than rewriting it to match the present;
|
|
68
68
|
- create or identify the replacement decision;
|
|
69
69
|
- link both directions;
|
|
70
|
-
-
|
|
70
|
+
- identify owning specs, plans, or policies whose current content depends on it and revise them when authorized;
|
|
71
|
+
- mark dependent work contingent when a required decision or source revision remains unresolved;
|
|
71
72
|
- preserve the evidence that justified the change.
|
|
72
73
|
|
|
73
74
|
Live evidence may show that implementation violates a decision or that the decision is no longer viable. Use Decision Gate when resolving that conflict requires user authority.
|
|
@@ -73,6 +73,21 @@ Possible sections:
|
|
|
73
73
|
|
|
74
74
|
A technical design may contain implementation detail when that detail defines the accepted design. Ordered phases and execution slices still belong in a Plan.
|
|
75
75
|
|
|
76
|
+
### Implementation Decisions
|
|
77
|
+
|
|
78
|
+
Include this subsection when consequential engineering choices must survive implementation handoffs or context loss. For selecting those choices, use [Design for Depth](../../design-for-depth/SKILL.md); this shape preserves their result rather than duplicating the design method.
|
|
79
|
+
|
|
80
|
+
Capture only what the intended implementation needs:
|
|
81
|
+
|
|
82
|
+
- selected representation, identity, state owners, and module responsibilities;
|
|
83
|
+
- essential algorithm, effect ordering, update/invalidation, and failure behavior;
|
|
84
|
+
- source basis, rationale, and invariants;
|
|
85
|
+
- a plausible wrong implementation and the observer that distinguishes it;
|
|
86
|
+
- required constraints, suggested mechanics, and implementer freedom;
|
|
87
|
+
- unresolved assumptions and conditions requiring reconsideration.
|
|
88
|
+
|
|
89
|
+
A compact type or control-flow sketch is useful when it removes consequential ambiguity. Mark illustrative code as such; it is not the behavioral oracle. Keep the applicable revision recoverable and update only decisions affected by new evidence. Do not require this subsection for a product-only artifact or an already clear local change.
|
|
90
|
+
|
|
76
91
|
## API, Protocol, Or Interface Contract
|
|
77
92
|
|
|
78
93
|
Use for a public or internal interface that callers will depend on.
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
const PROFILE_VALUES = ["standard", "reasoning", "auto"];
|
|
2
|
-
const HISTORY_VALUES = ["history", "history active", "history anomalies"];
|
|
3
|
-
export function cognitiveRoutingProfileCompletions(prefix) {
|
|
4
|
-
const query = prefix ?? "";
|
|
5
|
-
return [...PROFILE_VALUES, ...HISTORY_VALUES]
|
|
6
|
-
.filter((value) => value.startsWith(query))
|
|
7
|
-
.map((value) => ({
|
|
8
|
-
value,
|
|
9
|
-
label: value,
|
|
10
|
-
description:
|
|
11
|
-
value === "auto"
|
|
12
|
-
? "Release the manual hold and use the Reasoning profile"
|
|
13
|
-
: value === "history"
|
|
14
|
-
? "Show Cognitive Routing transition history"
|
|
15
|
-
: value === "history active"
|
|
16
|
-
? "Show current-branch Cognitive Routing history"
|
|
17
|
-
: value === "history anomalies"
|
|
18
|
-
? "Show Cognitive Routing history anomalies"
|
|
19
|
-
: `Hold ${value} profile manually`,
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
function historyOptions(value) {
|
|
23
|
-
if (value === "history") return {};
|
|
24
|
-
if (value === "history active") return { scope: "active-branch" };
|
|
25
|
-
if (value === "history anomalies") return { anomaliesOnly: true };
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
function formatHistory(result) {
|
|
29
|
-
const lines = [
|
|
30
|
-
`Cognitive Routing history: ${result.current.profile} · ${result.current.control}`,
|
|
31
|
-
`Events: ${result.events.length}; unresolved=${result.summary.unresolvedCount}; anomalies=${result.summary.anomalyCount}`,
|
|
32
|
-
];
|
|
33
|
-
if (result.summary.latestSemanticEventId) lines.push(`Latest semantic: ${result.summary.latestSemanticEventId}`);
|
|
34
|
-
if (result.summary.latestCompletedEventId) lines.push(`Latest completed: ${result.summary.latestCompletedEventId}`);
|
|
35
|
-
for (const event of result.events) {
|
|
36
|
-
const transition = event.from && event.to ? ` ${event.from} → ${event.to}` : "";
|
|
37
|
-
lines.push(
|
|
38
|
-
`${event.jsonlPosition}: ${event.outcome} · ${event.classification}${transition} · changed=${event.changed} · ${event.id}`,
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
return lines.join("\n");
|
|
42
|
-
}
|
|
43
|
-
export async function handleCognitiveRoutingProfileCommand(args, ctx, controller) {
|
|
44
|
-
const input = (args ?? "").trim().toLowerCase();
|
|
45
|
-
const [action, ...rest] = input.split(/\s+/);
|
|
46
|
-
if (action !== "profile") return false;
|
|
47
|
-
const value = rest.join(" ");
|
|
48
|
-
const historyView = historyOptions(value);
|
|
49
|
-
if (historyView) {
|
|
50
|
-
const result = ctx.history
|
|
51
|
-
? await ctx.history(historyView)
|
|
52
|
-
: controller?.history
|
|
53
|
-
? await controller.history(historyView)
|
|
54
|
-
: undefined;
|
|
55
|
-
if (result) {
|
|
56
|
-
ctx.ui?.notify?.(formatHistory(result), "info");
|
|
57
|
-
} else {
|
|
58
|
-
ctx.ui?.notify?.("Cognitive Routing history is unavailable for this session.", "warning");
|
|
59
|
-
}
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
if (!PROFILE_VALUES.includes(value)) {
|
|
63
|
-
ctx.ui?.notify?.(
|
|
64
|
-
"Usage: /freeflow profile standard, /freeflow profile reasoning, /freeflow profile auto, or /freeflow profile history [active|anomalies]",
|
|
65
|
-
"warning",
|
|
66
|
-
);
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
if (typeof ctx.isIdle === "function" && !ctx.isIdle()) {
|
|
70
|
-
ctx.ui?.notify?.("Freeflow settings and profile changes are available only while Pi is idle.", "warning");
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
if (!controller) {
|
|
74
|
-
ctx.ui?.notify?.(
|
|
75
|
-
"Cognitive Routing is unavailable for this session. It may be disabled, unsupported by the Pi host, or suppressed by an explicit startup model selection.",
|
|
76
|
-
"warning",
|
|
77
|
-
);
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
if (value === "auto") {
|
|
81
|
-
const result = await controller.setAutomaticControl();
|
|
82
|
-
if (result.status === "automatic") {
|
|
83
|
-
ctx.ui?.notify?.("Cognitive Routing manual hold released; automatic Reasoning control is active.", "info");
|
|
84
|
-
} else {
|
|
85
|
-
ctx.ui?.notify?.(`Cognitive Routing could not release the manual hold: ${result.reason}.`, "warning");
|
|
86
|
-
}
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
const result = await controller.setManualProfile(value);
|
|
90
|
-
if (result.status === "active") {
|
|
91
|
-
ctx.ui?.notify?.(`Cognitive Routing manual hold set to ${result.profile}.`, "info");
|
|
92
|
-
} else {
|
|
93
|
-
ctx.ui?.notify?.(`Cognitive Routing could not set the manual profile: ${result.reason}.`, "warning");
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
}
|