@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,138 +1,85 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: simplify-code
|
|
3
|
-
description: Use when working code should become easier to understand or change without altering accepted behavior, including removing duplication, indirection, dead abstractions, or confusing control flow.
|
|
3
|
+
description: "Use when working code should become easier to understand or change without altering accepted behavior, including removing duplication, indirection, dead abstractions, or confusing control flow."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Simplify Code
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Remove one named source of complexity while preserving accepted behavior. Judge simplicity by the concepts and coordination a reader must hold—not line, file, or abstraction count alone.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
This method supplies a behavior-preserving transformation under the current owner. It does not define behavior, authorize redesign, select or close a Slice, or turn nearby cleanup into accepted work.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Establish What Must Stay True
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Before editing, identify:
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
- the accepted behavior, relevant callers, and failure semantics;
|
|
17
|
+
- the reliable baseline capable of detecting change;
|
|
18
|
+
- the complexity or coordination to remove;
|
|
19
|
+
- why the current structure exists, including compatibility, platform, performance, migration, and recovery constraints.
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
If expected behavior is unclear or should change, return to [Workflow](../workflow/SKILL.md). If failure or current behavior is unexplained, use [Diagnose Failure](../diagnose-failure/SKILL.md). Do not characterize an invented expectation.
|
|
19
22
|
|
|
20
|
-
- the
|
|
21
|
-
- the callers and failure semantics capable of detecting drift;
|
|
22
|
-
- the smallest reliable behavior baseline;
|
|
23
|
-
- the named complexity or coordination to remove;
|
|
24
|
-
- why the current structure exists, including compatibility, performance, platform, migration, and recovery constraints.
|
|
23
|
+
Use existing adequate checks. When protection is missing, establish the smallest useful observation of behavior before transforming it; read [Test Design](../verify-work/references/test-design.md) before designing or materially changing the check. Characterization protects required stable behavior, not every accidental implementation detail. It is evidence for a refactor, not a mandatory test-first implementation method.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
Return changes to interfaces, ownership, public state, or failure behavior through Workflow with [Design for Depth](../design-for-depth/SKILL.md) as a lens. Do not disguise a material redesign as cleanup.
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
Read [Simplification Patterns](references/simplification-patterns.md) before selecting or materially changing the transformation. Read [Code Practices](../execute-work/references/code-practices.md) before changing code.
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
## Select One Coherent Transformation
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
Name the actual complexity:
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
- confusing expression, naming, branches, or temporary state;
|
|
34
|
+
- a pass-through wrapper that hides no useful decision;
|
|
35
|
+
- generalized machinery with no accepted variation;
|
|
36
|
+
- a scattered concept that can have one owner without changing its contract;
|
|
37
|
+
- an unused, superseded, unreachable, or impossible path;
|
|
38
|
+
- structural pressure requiring a separately selected boundary change.
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
Choose the smallest complete transformation that removes it. Keep related edits together even across files. Do not create another method activity for incidental local cleanup already contained in implementation; use Simplify Code when reducing complexity is itself the accepted result.
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
Fewer helpers are not better if their removal spreads lifecycle or error-handling knowledge into callers. Preserve useful information hiding and intentional constraints.
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
- **Pass-through indirection:** a wrapper, helper, adapter, or layer hides no useful decision.
|
|
42
|
-
- **Accidental abstraction:** generalized machinery has no accepted variation or information-hiding value.
|
|
43
|
-
- **Scattered concept:** one behavior or policy can move toward one owner without changing its contract.
|
|
44
|
-
- **Dead path:** evidence shows code is unused, unreachable, superseded, or impossible under current invariants.
|
|
45
|
-
- **Structural pressure:** simplification requires changing interfaces, ownership, state, or architecture; return it rather than editing.
|
|
44
|
+
## Apply And Observe
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
Within the existing agreement:
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
1. State which concepts or coordination will disappear.
|
|
49
|
+
2. Make the complete behavior-preserving change.
|
|
50
|
+
3. Run focused behavior and failure checks.
|
|
51
|
+
4. Inspect the real caller path and resulting code.
|
|
52
|
+
5. Compare the required coordination before and after.
|
|
53
|
+
6. Keep the supported result or return a failed transformation for correction or covered rollback.
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
Preserve inputs/outputs, side effects and ordering, errors/recovery, relevant timing and resource behavior, permissions, compatibility, and externally visible state. Follow repository conventions rather than personal style.
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
Do not combine feature work, bug fixes, new edge-case behavior, public contract changes, broad modernization, or unrelated cleanup with the transformation.
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
2. make the complete behavior-preserving change;
|
|
57
|
-
3. run the focused behavior and failure checks;
|
|
58
|
-
4. inspect the real caller path;
|
|
59
|
-
5. compare conceptual and coordination cost before and after;
|
|
60
|
-
6. keep or revert the action from evidence.
|
|
59
|
+
## Interpret Checks Without Protecting Accidental Machinery
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
Use [Verify Work](../verify-work/SKILL.md) to determine what the observations establish. A green suite cannot prove unchanged behavior it did not exercise. Do not rewrite a valid behavioral assertion merely to make the refactor pass.
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
If an implementation-detail check fails while caller behavior appears unchanged, establish whether the detail is contractual, the check is stale or over-coupled, the transformation changed relevant behavior, or the observer is inadequate. Do not infer the answer from the desired cleanup.
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
Test sequencing alone is not assurance. Retain or add independent checks where needed, and inspect the changed behavior rather than report only test counts.
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
- side effects and ordering;
|
|
70
|
-
- errors and recovery;
|
|
71
|
-
- timing and resource behavior;
|
|
72
|
-
- permissions and compatibility;
|
|
73
|
-
- failure units and externally visible state.
|
|
67
|
+
## Delete Only With Supported Absence
|
|
74
68
|
|
|
75
|
-
|
|
69
|
+
Before removing code, establish its purpose and current consumers through relevant source, runtime registration, configuration, generated callers, tests, history, and compatibility obligations. An empty local search does not establish the absence of external or dormant consumers.
|
|
76
70
|
|
|
77
|
-
|
|
71
|
+
Do not remove compatibility, fallback, platform, migration, audit, or recovery behavior merely because it looks redundant. Use [Migration Work](../migration-work/SKILL.md) when deletion carries consumer, state, or compatibility obligations.
|
|
78
72
|
|
|
79
|
-
|
|
73
|
+
Preserve historical evidence; do not delete it to make a reference search clean.
|
|
80
74
|
|
|
81
|
-
|
|
75
|
+
## Judge The Result And Stop
|
|
82
76
|
|
|
83
|
-
|
|
84
|
-
- the test may be stale or over-coupled;
|
|
85
|
-
- the simplification may have changed relevant behavior;
|
|
86
|
-
- the observing boundary may be insufficient.
|
|
77
|
+
Ask whether there are fewer concepts to coordinate, clearer ownership, fewer related edit locations, visible failure semantics, a smaller or unchanged public interface, and tests focused on behavior rather than internal choreography.
|
|
87
78
|
|
|
88
|
-
|
|
79
|
+
If the result is shorter but harder to understand, test, or change, complexity was relocated rather than reduced.
|
|
89
80
|
|
|
90
|
-
|
|
81
|
+
Stop and return the changed boundary when unchanged behavior is unsupported, public/failure semantics changed, a material resource tradeoff is unmeasured, source truth conflicts, or each correction exposes another ownership or edge-case problem. Do not extend cleanup to preserve a failing approach.
|
|
91
82
|
|
|
92
|
-
|
|
83
|
+
When the named complexity is removed and the behavior boundary is supported, return to the current owner for applicable self-review and acceptance. Report the protected behavior, concepts removed, before/after evidence and limits, caller/failure-path shape, relevant comment changes, and intentionally retained complexity.
|
|
93
84
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Removing an unnecessary layer should reduce coordination, not scatter its protocol into callers.
|
|
97
|
-
|
|
98
|
-
Do not delete compatibility, fallback, platform, migration, audit, or recovery behavior because it appears redundant. Use [Migration Work](../migration-work/SKILL.md) when removal carries consumer, state, or compatibility obligations.
|
|
99
|
-
|
|
100
|
-
## Determine Whether It Became Simpler
|
|
101
|
-
|
|
102
|
-
Ask:
|
|
103
|
-
|
|
104
|
-
- Are there fewer concepts and branches?
|
|
105
|
-
- Is ownership clearer?
|
|
106
|
-
- Can the behavior be understood through fewer coordinated locations?
|
|
107
|
-
- Did failure semantics remain visible?
|
|
108
|
-
- Is the public interface smaller or unchanged?
|
|
109
|
-
- Did tests become more behavior-focused rather than more coupled?
|
|
110
|
-
- Would the next likely change require fewer coordinated edits?
|
|
111
|
-
|
|
112
|
-
If the answers are mostly no, complexity was relocated rather than reduced.
|
|
113
|
-
|
|
114
|
-
Stop when:
|
|
115
|
-
|
|
116
|
-
- unchanged behavior cannot be supported;
|
|
117
|
-
- public or failure semantics changed;
|
|
118
|
-
- performance or resource tradeoffs became material and unmeasured;
|
|
119
|
-
- each change exposes another interface, ownership, or edge-case problem;
|
|
120
|
-
- the action broadens beyond its accepted boundary;
|
|
121
|
-
- source truth or user decisions conflict with the transformation;
|
|
122
|
-
- the result is shorter but harder to explain or test.
|
|
123
|
-
|
|
124
|
-
## Return The Method Result
|
|
125
|
-
|
|
126
|
-
Once evidence supports unchanged behavior and the named complexity has been removed, stop the simplification route and return to the current owner.
|
|
127
|
-
|
|
128
|
-
Return:
|
|
129
|
-
|
|
130
|
-
- the protected behavior boundary;
|
|
131
|
-
- concepts or coordination removed;
|
|
132
|
-
- before-and-after behavior evidence;
|
|
133
|
-
- resulting caller and failure-path shape;
|
|
134
|
-
- comments preserved, changed, or removed;
|
|
135
|
-
- intentionally retained complexity;
|
|
136
|
-
- what remains unverified.
|
|
137
|
-
|
|
138
|
-
Do not freeze or close the Slice. Do not continue into further cleanup, modernization, or possible improvements without another accepted bounded action.
|
|
85
|
+
Do not close the Slice, begin further cleanup, or claim broader modernization from this result. Continue only through another covered action serving the agreed outcome.
|