@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,106 +1,145 @@
1
1
  ---
2
- name: commit-work
3
- description: Use when committing work, including selecting and staging the intended changes, creating and verifying the commit, or explicitly pushing committed work.
2
+ name: "commit-work"
3
+ description: "Use when creating an explicitly requested or selected local Git commit, including staging its exact contents, verifying the resulting checkpoint, or performing a separately authorized simple push."
4
4
  ---
5
5
 
6
6
  # Commit Work
7
7
 
8
- Commit an intended, coherent checkpoint. A commit preserves rollback and provenance; it does not prove correctness or approve the next route.
8
+ Preserve one supported repository state as a coherent local Git checkpoint.
9
9
 
10
- This skill covers commits and simple pushes, not branch integration, release, or deployment orchestration. Use [Finish Branch](../finish-branch/SKILL.md), [Release Work](../release-work/SKILL.md), or [Launch Work](../launch-work/SKILL.md) for those later jobs.
10
+ Commit Work normally follows execution, verification, self-review, and any selected independent review. It preserves that supported state; it does not establish correctness, close the Slice, authorize another Slice, or imply push, integration, release, or launch.
11
11
 
12
- A local commit is authorized by an explicit user request, a checkpoint whose local-commit authority was explicitly granted through a user-approved Plan, or a checkpoint explicitly approved during discussion. A Working Record may preserve that authorization but cannot create it. Plan acceptance does not authorize push, integration, migration, deprecation, release, or launch.
12
+ A commit is not mandatory merely because work finished. Enter only when the user explicitly requests a local commit or [Workflow](../workflow/SKILL.md) selects an authorized Local commit checkpoint.
13
13
 
14
- A planned checkpoint remains conditional on live state. Do not force it when its intended outcome, evidence, review status, or change boundary no longer holds; return the deviation to [Workflow](../workflow/SKILL.md).
14
+ An explicitly requested preservation checkpoint may capture incomplete, failing, or inconclusive work. Describe that state honestly and do not treat the commit as permission to cross the unresolved boundary.
15
15
 
16
- A commit does not select or trigger independent review. Complete only review selected by Workflow, an approved Plan, or repository policy. Commit Work does not adjudicate findings or authorize corrections or follow-up review. Fresh verification is required for the claim the commit represents.
17
-
18
- Read [staging decisions](references/staging-decisions.md) when changes or staged state are mixed, generated files or durable docs appear, existing staged ownership is unclear, broad commit/push language conflicts with diff evidence, or producing a narrow checkpoint may touch user-owned work.
19
-
20
- ## Route Check
16
+ ## Enter At The Commit Boundary
21
17
 
22
18
  Before staging, confirm:
23
19
 
24
- - the slice or work package has one coherent outcome;
25
- - source truth and owner decisions still support it;
26
- - fresh evidence supports the claim represented by the commit, or an explicitly requested preservation checkpoint names its incomplete claim honestly;
27
- - any selected review has ended, its adjudicated status is known, and Workflow supports the checkpoint route;
28
- - no unresolved blocker, required evidence gap, or route-changing assumption is hidden by the checkpoint claim;
29
- - the checkpoint remains authorized and useful for rollback, integration, handoff, or repository workflow.
20
+ - local commit authority is explicit and still valid;
21
+ - the checkpoint has one coherent claim;
22
+ - the request, accepted decisions, and live changes still describe the same outcome;
23
+ - fresh evidence supports the exact state being preserved, or this is an explicitly requested preservation checkpoint;
24
+ - any selected independent review is complete and its material findings are adjudicated;
25
+ - no unresolved decision, source conflict, or required evidence gap is hidden by the checkpoint claim.
26
+
27
+ A Working Record may preserve checkpoint selection and authority but cannot create them. Approval to implement does not imply approval to commit.
30
28
 
31
- When review or evidence leaves unresolved work, return it to Workflow rather than deciding readiness here. If the user explicitly requests a preservation checkpoint of incomplete, unverified, blocked, or inconclusive work, label that state honestly and include only what is safe and useful to preserve. The commit does not authorize crossing the unresolved boundary.
29
+ Commit Work verifies fidelity between the supported state and the Git checkpoint. It does not dispatch missing review, repair implementation, or generate missing behavioral evidence. Return those needs to Workflow.
32
30
 
33
- ## Inspect
31
+ ## Inspect The Candidate State
34
32
 
35
- Inspect before staging or committing:
33
+ Inspect before changing the index:
36
34
 
37
35
  ```bash
38
- git status --short
36
+ git status --short --branch
37
+ git status
39
38
  git diff
40
39
  git diff --cached
41
40
  git ls-files --others --exclude-standard
42
41
  ```
43
42
 
44
- Diff evidence beats “staged,” “commit everything,” “push all,” “exactly as-is,” or “do not leave leftovers.” Treat unrelated changes as user-owned until proven otherwise.
43
+ Inspect submodule state when status reports a changed submodule.
45
44
 
46
- ## Stage Narrowly
45
+ Read [Staging Decisions](references/staging-decisions.md) when:
47
46
 
48
- Stage explicit paths or hunks that implement the coherent checkpoint.
47
+ - staged, unstaged, or untracked changes have mixed ownership or concerns;
48
+ - a path contains both intended and excluded changes;
49
+ - existing staged ownership is uncertain;
50
+ - generated, durable, sensitive, or suspicious files appear;
51
+ - narrowing the checkpoint may require changing existing staged state.
49
52
 
50
- Avoid `git add .` and `git add -A` when unrelated, unreviewed, generated, sensitive, or user-owned changes are present.
53
+ Read [Git State Edges](references/git-state-edges.md) when Git reports an in-progress operation, unmerged paths, detached `HEAD`, submodule ambiguity, or an empty candidate; a requested commit would amend, be empty, or bypass hooks; or any commit or hook fails.
51
54
 
52
- Verify existing staged changes rather than inheriting them blindly. Do not unstage, rearrange, discard, or overwrite user-owned changes merely to manufacture a clean commit without permission.
55
+ Treat staged state as evidence of index contents, not evidence of ownership, intent, verification, or readiness.
53
56
 
54
- ## Stop
57
+ ## Build The Exact Checkpoint
58
+
59
+ Stage only paths or hunks required to make the checkpoint claim true.
55
60
 
56
- Stop before commit or push when:
61
+ Broad staging commands are acceptable only when every changed path has been inspected and belongs to the same checkpoint. Otherwise stage explicit paths or hunks.
57
62
 
58
- - included changes are unrelated, unreviewed when review is required, or outside the accepted outcome;
59
- - staged and unstaged edits make commit ownership ambiguous;
60
- - logs, debug output, secrets, generated artifacts, lockfiles, or formatter churn lack evidence they belong;
61
- - durable docs and implementation describe different behavior or authority;
62
- - verification failed or proves less than the commit message would claim;
63
- - the commit mixes separable concerns in a way that harms review, diagnosis, or rollback;
64
- - product, security, privacy, billing, permissions, data-loss, compatibility, public API, migration, or architecture behavior changed without an explicit decision.
63
+ Do not silently unstage, rearrange, discard, overwrite, or absorb user-owned work to manufacture a clean commit.
64
+
65
+ After staging, inspect the exact candidate:
66
+
67
+ ```bash
68
+ git diff --cached
69
+ git diff --cached --check
70
+ ```
65
71
 
66
- Use [Decision Gate](../decision-gate/SKILL.md) when the safe commit path depends on an owner or source-truth decision. If a clean narrow commit is possible without touching unrelated work, prefer it and report what remains.
72
+ Confirm:
67
73
 
68
- ## Commit Shape
74
+ - every staged path and hunk belongs;
75
+ - required tests, documentation, generated outputs, or metadata are present;
76
+ - no unrelated, sensitive, unexplained, or user-owned content is included;
77
+ - the staged diff is non-empty unless an empty commit was explicitly requested;
78
+ - the commit claim does not exceed available verification and review evidence;
79
+ - excluded working-tree changes do not invalidate evidence for the staged checkpoint.
69
80
 
70
- Keep the checkpoint independently understandable and revertible.
81
+ Interpret `git diff --cached --check` against repository conventions. Unresolved conflict markers or unintended whitespace damage stop the commit; do not edit content merely to silence the command.
71
82
 
72
- Use the repo's established message style. Otherwise use a short imperative subject. Add a body only when source context, tradeoffs, residual risk, or the reason for the checkpoint would not be clear from the diff.
83
+ If producing the exact checkpoint requires source changes, additional evidence, or a user-owned staging decision, return to Workflow rather than performing that work here.
73
84
 
74
- Reference specs, plans, ADRs, issues, or decisions only when they materially explain the change. Do not invent metadata conventions.
85
+ ## Create The Commit
75
86
 
76
- A learning-slice commit must distinguish diagnostic or exploratory output from production behavior. A deepening commit should not silently change behavior. A delivery commit should name the behavior it adds or changes.
87
+ Use the repository's established commit-message style. Otherwise use a short imperative subject describing the actual checkpoint, not the wider task ambition.
77
88
 
78
- ## Push
89
+ Add a body only when the diff does not adequately explain material context, tradeoffs, residual risk, or why incomplete state is being preserved. Reference existing issues, Specs, Plans, or decisions only when they materially explain the checkpoint. Do not invent trailers or metadata conventions.
79
90
 
80
- Push only inspected commits when the user request and branch state make the route clear.
91
+ Create an ordinary local commit from the inspected index.
81
92
 
82
- Before pushing, inspect branch, upstream, remote, and ahead/behind state. Stop before protected/shared branches, upstream changes, force pushes, remote-history rewrites, divergence, or release/PR decisions that were not explicitly requested.
93
+ Do not use `--amend`, `--allow-empty`, or `--no-verify` by implication. Read Git State Edges when one is explicitly requested or becomes relevant.
83
94
 
84
- Use `--force-with-lease` only for an intended rewrite of the user's own branch with explicit approval and supporting branch evidence.
95
+ If a hook fails, changes files or the index, or makes prior evidence stale, do not bypass or blindly retry it. Inspect the resulting state through Git State Edges.
85
96
 
86
97
  ## Verify The Checkpoint
87
98
 
88
- After commit or push, inspect:
99
+ After Git reports a successful commit, inspect:
89
100
 
90
101
  ```bash
91
- git show --stat --oneline --name-only HEAD
92
- git status --branch --short
102
+ git show --stat --oneline --decorate HEAD
103
+ git show --format= --name-status HEAD
104
+ git status --short --branch
93
105
  ```
94
106
 
107
+ Confirm that:
108
+
109
+ - the intended commit was created;
110
+ - its subject and contents represent the checkpoint claim;
111
+ - no unexpected staged, unstaged, or untracked state resulted;
112
+ - remaining changes are known and were not silently absorbed.
113
+
95
114
  Report:
96
115
 
97
116
  - commit SHA and subject;
98
- - what the checkpoint contains;
99
- - verification and review evidence;
100
- - push result when applicable;
101
- - remaining staged, unstaged, untracked, unpushed, or unverified work;
102
- - recommended next route.
117
+ - the checkpoint claim and included scope;
118
+ - verification and selected-review evidence;
119
+ - whether the commit is complete or an honest preservation checkpoint;
120
+ - remaining staged, unstaged, untracked, unverified, or unpushed work;
121
+ - any hook, signing, identity, or repository limitation;
122
+ - the route returned to Workflow.
123
+
124
+ Return the checkpoint result to Workflow. When a Working Record exists, Workflow may route [Track Work](../track-work/SKILL.md) to record `commit:<sha>`, settle the selected checkpoint, and reconcile the Current Slice.
125
+
126
+ Do not stage leftovers, begin another Slice, push, integrate, release, or clean up merely because the commit succeeded.
127
+
128
+ ## Push Only When Separately Authorized
129
+
130
+ A local commit does not authorize push.
131
+
132
+ Before any push, read [Simple Push](references/simple-push.md). Use [Finish Branch](../finish-branch/SKILL.md) instead when the request involves integration, pull-request strategy, branch cleanup, history rewriting, or choosing among branch-closeout routes.
133
+
134
+ ## Stop
103
135
 
104
- When a Working Record exists, use [Track Work](../track-work/SKILL.md) to record the commit SHA, checkpoint result, remaining state, and next useful action.
136
+ Stop and return the smallest blocking fact when:
105
137
 
106
- Do not continue to the next slice, push, or integrate merely because the commit succeeded. Return the result to [Workflow](../workflow/SKILL.md), or use [Finish Branch](../finish-branch/SKILL.md) when branch closeout is selected.
138
+ - commit authority or the checkpoint claim is unclear;
139
+ - live changes no longer match the supported outcome;
140
+ - selected review or required evidence remains unresolved;
141
+ - the exact checkpoint cannot be staged without manipulating ambiguous user-owned state;
142
+ - sensitive or unexplained content may be included;
143
+ - Git is in a non-ordinary state whose intended outcome is unsettled;
144
+ - creating the commit would require implementation changes, evidence generation, hook bypass, amendment, or history rewriting outside explicit authority;
145
+ - push destination, upstream, or remote-history effect is unclear.
@@ -0,0 +1,94 @@
1
+ # Git State Edges
2
+
3
+ Read this when Git reports an in-progress operation, unmerged paths, detached `HEAD`, submodule ambiguity, or an empty candidate; a requested commit would amend, be empty, or bypass hooks; or any commit or hook fails.
4
+
5
+ These states can change the meaning or recoverability of a commit. Inspect before choosing a recovery action.
6
+
7
+ ## In-Progress Operations
8
+
9
+ A commit during merge, rebase, cherry-pick, or revert may complete or advance that operation rather than create an ordinary checkpoint.
10
+
11
+ Stop and establish:
12
+
13
+ - which operation is active;
14
+ - whether the current checkpoint is intended to conclude it;
15
+ - whether all conflicts and behavior decisions are settled;
16
+ - which owner should continue the operation;
17
+ - what verification is required on the resulting state.
18
+
19
+ Do not use Commit Work to finish an operation merely because Git currently permits `commit`.
20
+
21
+ Unmerged paths always stop an ordinary commit.
22
+
23
+ ## Detached HEAD
24
+
25
+ A detached-`HEAD` commit may be valid but can become difficult to recover or push.
26
+
27
+ Before committing, require an explicit preservation route naming how the resulting commit will remain reachable. Use [Finish Branch](../../finish-branch/SKILL.md) when branch creation, integration, or checkout ownership must be decided.
28
+
29
+ Do not silently create or switch branches.
30
+
31
+ ## Amend And Empty Commits
32
+
33
+ `git commit --amend` rewrites an existing checkpoint. Use it only when the user explicitly requests amendment and the exact target commit, included changes, authorship effects, and remote-history state are known.
34
+
35
+ If the target may already be shared or pushed, return to [Workflow](../../workflow/SKILL.md) or Finish Branch before rewriting it.
36
+
37
+ Use `--allow-empty` only for an explicitly requested empty checkpoint with a named repository purpose. An accidentally empty index is not authorization for an empty commit.
38
+
39
+ ## Hooks
40
+
41
+ Do not bypass hooks merely because they block the commit.
42
+
43
+ When a hook fails:
44
+
45
+ 1. preserve its complete result;
46
+ 2. inspect `HEAD`, the index, and working tree;
47
+ 3. determine whether a commit was created despite the reported failure;
48
+ 4. determine whether the hook changed files or staged content;
49
+ 5. return implementation, verification, policy, or environment failures to their owning route.
50
+
51
+ When a hook changes repository content, the previously supported state may no longer be the state being committed. Reinspect the complete diff and obtain affected verification before retrying.
52
+
53
+ Use `--no-verify` only when the user explicitly requests that exact bypass and repository policy permits it. Report which checks were skipped and which claims therefore remain unsupported.
54
+
55
+ ## Commit Command Failures
56
+
57
+ After any failed or interrupted commit attempt, inspect:
58
+
59
+ ```bash
60
+ git status
61
+ git diff
62
+ git diff --cached
63
+ git log -1 --oneline --decorate
64
+ ```
65
+
66
+ Do not assume failure means no commit was created or no state changed.
67
+
68
+ For identity, signing, credential-helper, editor, lock, filesystem, or permission failures:
69
+
70
+ - do not change global or repository Git configuration without authority;
71
+ - do not delete lock files while process ownership is unclear;
72
+ - do not retry through a materially different command without a supported cause;
73
+ - report the exact blocker and preserved state.
74
+
75
+ Use [Diagnose Failure](../../diagnose-failure/SKILL.md) when the cause remains unclear or a retry repeats the failure.
76
+
77
+ ## Submodules
78
+
79
+ A parent commit records a submodule pointer, not the submodule's uncommitted contents.
80
+
81
+ Inspect:
82
+
83
+ - the recorded pointer change;
84
+ - whether the nested worktree is dirty;
85
+ - whether the intended checkpoint includes the pointer update;
86
+ - whether nested changes have their own preservation route.
87
+
88
+ Do not claim nested changes are preserved by committing only the parent repository.
89
+
90
+ ## Return Safely
91
+
92
+ Return to Commit Work only when the repository has one supported, recoverable checkpoint candidate.
93
+
94
+ Otherwise preserve the exact Git state and return to Workflow, Finish Branch, Diagnose Failure, or the producing activity whose responsibility changed.
@@ -0,0 +1,92 @@
1
+ # Simple Push
2
+
3
+ Read this before performing any push through Commit Work.
4
+
5
+ A **simple push** sends inspected local commits from the current named branch to one explicit or established remote branch without force, deletion, tag publication, integration, pull-request creation, release, or deployment.
6
+
7
+ Use [Finish Branch](../../finish-branch/SKILL.md) when the route requires choosing how to integrate, share, preserve, rewrite, or clean up branch state.
8
+
9
+ ## Confirm Push Authority
10
+
11
+ Push requires authority separate from local commit.
12
+
13
+ Confirm:
14
+
15
+ - which commits are intended;
16
+ - the local branch;
17
+ - the destination remote and branch;
18
+ - whether setting a new upstream is included;
19
+ - that no force, deletion, tag, or history rewrite is implied.
20
+
21
+ Do not infer a remote, destination branch, pull-request target, or shared-branch policy when the wrong choice could affect collaborators.
22
+
23
+ ## Inspect The Route
24
+
25
+ Inspect:
26
+
27
+ ```bash
28
+ git branch --show-current
29
+ git status --short --branch
30
+ git branch -vv
31
+ git remote -v
32
+ git log -1 --oneline --decorate
33
+ ```
34
+
35
+ When an upstream exists, inspect:
36
+
37
+ ```bash
38
+ git rev-parse --abbrev-ref --symbolic-full-name @{upstream}
39
+ git rev-list --left-right --count @{upstream}...HEAD
40
+ ```
41
+
42
+ Ahead/behind state is only as fresh as the local remote-tracking reference. Do not claim current remote state unless it was freshly observed.
43
+
44
+ Stop before pushing when:
45
+
46
+ - `HEAD` is detached;
47
+ - destination or upstream is unclear;
48
+ - unexpected commits or dirty state change the route;
49
+ - protected or shared-branch policy disallows the push or leaves its route unclear;
50
+ - local and observed upstream history diverge;
51
+ - the push would require force, deletion, tag publication, or another separately controlled action.
52
+
53
+ ## Push The Exact Branch
54
+
55
+ Use the established upstream when it clearly matches the approved route.
56
+
57
+ When no upstream exists, set one only when the remote and branch destination are explicit and the configuration change is included in the accepted route.
58
+
59
+ Do not push additional branches or tags.
60
+
61
+ A force push is not a simple push. Return an explicitly requested history rewrite to Workflow or Finish Branch.
62
+
63
+ ## Handle Rejection Without Escalation
64
+
65
+ If the push is rejected or fails:
66
+
67
+ - preserve the complete result;
68
+ - do not automatically pull, merge, rebase, force, change remotes, or change destination;
69
+ - inspect whether any remote update occurred;
70
+ - return authentication, divergence, policy, or destination decisions to [Workflow](../../workflow/SKILL.md) or Finish Branch.
71
+
72
+ A failed push does not invalidate the local commit.
73
+
74
+ ## Verify And Report
75
+
76
+ After a successful push, inspect:
77
+
78
+ ```bash
79
+ git status --short --branch
80
+ git branch -vv
81
+ ```
82
+
83
+ Report:
84
+
85
+ - pushed commit range;
86
+ - remote and destination branch;
87
+ - whether an upstream was created or changed;
88
+ - command result and strongest observed remote-state evidence;
89
+ - remaining unpushed commits or dirty state;
90
+ - CI, review, integration, release, or deployment work not established by the push.
91
+
92
+ A successful push proves transfer to the observed destination. It does not prove pull-request creation, merge, release, deployment, or remote CI success.
@@ -1,73 +1,106 @@
1
1
  # Staging Decisions
2
2
 
3
- Read this when changes or staged state are mixed, generated files or durable docs appear, existing staged ownership is unclear, broad commit/push language conflicts with diff evidence, or producing a narrow checkpoint may touch user-owned work.
3
+ Read this when staged, unstaged, or untracked changes have mixed ownership or concerns; a path contains both included and excluded work; existing staged ownership is uncertain; generated, durable, sensitive, or suspicious files appear; or narrowing may require changing existing staged state.
4
4
 
5
- ## Evidence First
5
+ This reference determines what may enter the checkpoint. It does not establish commit authority, verification, review readiness, or permission to alter user-owned work.
6
6
 
7
- Inspect:
7
+ ## Classify The Changed Units
8
8
 
9
- - `git status --short`
10
- - `git diff --cached`
11
- - `git diff`
12
- - `git ls-files --others --exclude-standard`
9
+ Classify at the path level only when the whole path has one role. Otherwise classify individual hunks.
13
10
 
14
- Diff evidence beats “staged means ready,” “commit everything,” “push all changes,” and “include every leftover.”
11
+ - **Checkpoint content:** directly implements or proves the checkpoint claim.
12
+ - **Required companion:** tests, documentation, schema, metadata, or generated output required for that same claim.
13
+ - **Related but separable:** useful work that does not need to be preserved in this checkpoint.
14
+ - **Unrelated or user-owned:** work outside the accepted outcome or whose ownership is not established.
15
+ - **Sensitive or unsafe:** secrets, credentials, personal data, environment files, debug output, destructive state, or unexplained artifacts.
16
+ - **Unclear:** content whose purpose, generator, ownership, or evidence relationship is not yet supported.
15
17
 
16
- ## Classify Paths
18
+ Only checkpoint content and required companions belong.
17
19
 
18
- For each changed path, classify:
20
+ A broad request such as "commit everything" may authorize broad inclusion, but it does not remove the obligation to inspect unsafe, unclear, or unexpectedly unrelated content.
19
21
 
20
- - **Checkpoint:** directly implements or proves the intended slice.
21
- - **Required generated output:** repo convention or task requires it and its generator is known.
22
- - **Durable artifact:** Spec, policy, ADR, or Plan that belongs to the same accepted checkpoint while retaining its own authority and lifecycle.
23
- - **Durable continuation memory:** Working Record or Handoff describing the same checkpoint without becoming authority over live evidence.
24
- - **Related but separable:** useful work that should remain outside this checkpoint.
25
- - **Unrelated or user-owned:** not part of the current outcome.
26
- - **Sensitive or unsafe:** secrets, private data, debug output, destructive state, or unclear generated content.
22
+ ## Protect Existing Staged State
27
23
 
28
- Do not infer ownership from staging state.
24
+ Existing staged changes may belong to another workflow.
29
25
 
30
- ## Narrow Checkpoint
26
+ Inspect them, but do not infer that they are intended merely because they are staged. Do not silently:
31
27
 
32
- A narrow commit is safe when:
28
+ - absorb them into the checkpoint;
29
+ - unstage or reset them;
30
+ - amend them into another commit;
31
+ - move them through a stash or temporary commit;
32
+ - replace the index or use index tricks to bypass ownership ambiguity.
33
33
 
34
- - an explicit request, user-approved Plan, or explicitly approved discussion authorizes the local checkpoint;
35
- - its outcome and source requirement are clear;
36
- - every included path belongs to that outcome;
37
- - verification supports the claim represented by the commit;
38
- - selected review status is known and [Workflow](../../workflow/SKILL.md) supports the checkpoint route;
39
- - excluded changes can remain untouched without loss;
40
- - the final report names remaining dirty state.
34
+ When intended and pre-existing staged work cannot be separated without manipulating ambiguous state, present the smallest safe options and ask which checkpoint the user wants.
41
35
 
42
- Plan approval does not prove that every current path belongs. Stage explicit paths or hunks. If narrowing requires unstaging, rearranging, regenerating, or modifying user-owned work, stop unless the user or repo workflow already authorized that operation.
36
+ ## Handle Partial Files Carefully
43
37
 
44
- ## Mixed Concerns
38
+ A file may contain both checkpoint and excluded hunks. Stage only the intended hunks when their behavior and evidence remain independently coherent.
45
39
 
46
- Separate changes when combining them harms review, diagnosis, or rollback, especially:
40
+ Stop when:
47
41
 
48
- - behavior plus unrelated refactoring;
49
- - source code plus local debug output;
50
- - generated artifacts plus unexplained hand edits;
51
- - durable source-truth changes plus implementation that has not been confirmed;
52
- - security, privacy, billing, permissions, migration, data-loss, compatibility, or public API behavior plus unrelated work;
53
- - learning-slice evidence plus production changes that have not passed promotion criteria.
42
+ - included and excluded hunks depend on each other;
43
+ - partial staging would produce an invalid intermediate state;
44
+ - verification ran against the combined working tree and excluded changes may have affected the result;
45
+ - the staged version differs materially from the state that was reviewed or verified.
54
46
 
55
- A single coherent behavior with its tests and matching docs may belong together.
47
+ Do not claim an isolated staged checkpoint is supported merely because the combined dirty worktree passed.
56
48
 
57
- ## Generated Files
49
+ ## Include Generated Files Deliberately
58
50
 
59
- Commit generated files, snapshots, lockfiles, build outputs, or formatter changes only when the task or repo convention makes them part of the checkpoint.
51
+ Include generated files, snapshots, lockfiles, formatter output, or build artifacts only when repository convention or the accepted outcome requires them.
60
52
 
61
- Name the generator or command that produced required output. Do not hand-edit generated files unless the repo explicitly expects it.
53
+ Establish:
62
54
 
63
- ## Durable Artifacts
55
+ - which command or generator produced them;
56
+ - whether their changes are expected from the accepted source change;
57
+ - whether they are deterministic enough to review;
58
+ - whether hand edits are prohibited;
59
+ - whether their verification belongs to the checkpoint evidence.
64
60
 
65
- Specs, policies, and ADRs may govern behavior. Plans preserve approved strategy; Working Records and Handoffs preserve memory. Include any of them with code only when they belong to the same coherent checkpoint and their own maintenance rules support the change.
61
+ Do not include generated output merely because it changed. Do not hand-edit it unless the repository explicitly expects that workflow.
66
62
 
67
- Do not revise a durable artifact merely to make the commit appear coherent. Return a material inconsistency to [Workflow](../../workflow/SKILL.md); use [Decision Gate](../../decision-gate/SKILL.md) when one user-owned choice or source conflict blocks the checkpoint.
63
+ ## Preserve Durable Artifacts Honestly
68
64
 
69
- ## Existing Staged State
65
+ A Spec, Plan, ADR, policy, public documentation file, or release artifact may have authority and maintenance rules independent of implementation.
70
66
 
71
- Existing staged changes may belong to another workflow. Inspect them, but do not silently unstage, amend, discard, or absorb them.
67
+ Include it only when:
72
68
 
73
- When ownership remains ambiguous, present the smallest safe staging options and ask which checkpoint the user wants.
69
+ - its change is explicitly covered;
70
+ - it belongs to the same coherent checkpoint;
71
+ - it describes the same accepted behavior;
72
+ - its own maintenance policy permits the update.
73
+
74
+ Do not edit a durable artifact merely to make implementation appear coherent. Return contradictions to [Workflow](../../workflow/SKILL.md).
75
+
76
+ Working Records under `.freeflow/tasks/**` are ignored local memory and must never be staged or committed.
77
+
78
+ ## Reject Sensitive Or Suspicious Content
79
+
80
+ Stop before staging:
81
+
82
+ - secrets, tokens, credentials, private keys, or local environment files;
83
+ - databases, dumps, recordings, or personal data;
84
+ - unexplained binaries or generated archives;
85
+ - logs, traces, screenshots, or debug output not explicitly required;
86
+ - destructive state or files whose inclusion could expose or lose user data.
87
+
88
+ Do not "clean up" suspicious files by deleting or discarding them. Preserve their state and report the exact paths.
89
+
90
+ ## Verify The Candidate
91
+
92
+ After staging, compare all three states:
93
+
94
+ ```bash
95
+ git diff --cached
96
+ git diff
97
+ git status --short --branch
98
+ ```
99
+
100
+ The checkpoint is narrow only when:
101
+
102
+ - the index contains exactly the intended checkpoint;
103
+ - excluded work remains untouched;
104
+ - remaining dirty state is understood;
105
+ - verification still supports the staged version rather than only the combined worktree;
106
+ - the final report can name everything left behind.