Compare commits

..
5 Commits
Author SHA1 Message Date
kiskaadee c17087ae5b docs(readme): reconcile git-workspace line count and canonical workflow
- Fix git-workspace documented line count from 52 to 50
- Add canonical flow 6 illustrating git-workspace branch lifecycle and checkpoint integration
- Reconcile line count discrepancies for document, reconcile-docs, and nix-devshell
2026-10-31 10:21:04 -05:00
kiskaadee 8a85365be9 feat(install): register git-workspace in portable core and update inventory
- Add git-workspace to ACTIVE_PORTABLE_SKILLS in install.sh
- Add git-workspace to Portable Core table in README.md
2026-10-31 09:31:58 -05:00
kiskaadee 501ec5cd3c feat(git-workspace): add workspace, worktree, integration, and recovery skill
- Add SKILL.md (50 lines) managing branch/worktree lifecycle, rebase/squash integration, and evidence-first recovery
- Add references/worktrees.md for worktree creation, locking, and clean removal
- Add references/history-editing.md with conflict halt and abort guardrails
- Add references/recovery.md for evidence-first reflog diagnosis and non-destructive branch restoration
2026-10-31 09:31:31 -05:00
kiskaadee a1cf7d3aaf refactor(git-commit): sharpen focus on checkpoint slicing and reference profile approval policy
- Hand off branch creation, worktrees, rebasing, and recovery to git-workspace
- Reference profile/AGENTS.md for structured batch approvals of commit slices
- Update post-commit actions and handoffs
2026-10-31 09:31:10 -05:00
kiskaadee 9e94be01ed docs(profile): codify canonical decision categorization and batch approval policy
- Distinguish independent architectural decisions (one-at-a-time) from homogeneous operational checkpoints (batchable)
- Define strict requirements for multi-choice batch approvals (action + consequence exposed, no blanket approve-all)
- Codify explicit-yes boundary for consequential and destructive operations
2026-10-31 09:30:53 -05:00
8 changed files with 206 additions and 13 deletions

No files matched your search

+5 -3
View File
@@ -71,12 +71,13 @@ Every skill features an explicit **"Your call"** checkpoint where the agent paus
| **[`practice`](skills/practice/SKILL.md)** | `/practice [topic]`, `/practice review` | Socratic tutoring and delayed retrieval. Learner writes all code; uses graduated assistance, rubric calibration, and recall-before-reveal. | 50 lines | | **[`practice`](skills/practice/SKILL.md)** | `/practice [topic]`, `/practice review` | Socratic tutoring and delayed retrieval. Learner writes all code; uses graduated assistance, rubric calibration, and recall-before-reveal. | 50 lines |
| **[`diagnose`](skills/diagnose/SKILL.md)** | `/diagnose [symptom]` | Evidence-first troubleshooting. Progresses from raw logs to proven root cause and minimal, reversible fixes. | 49 lines | | **[`diagnose`](skills/diagnose/SKILL.md)** | `/diagnose [symptom]` | Evidence-first troubleshooting. Progresses from raw logs to proven root cause and minimal, reversible fixes. | 49 lines |
| **[`git-commit`](skills/git-commit/SKILL.md)** | `/git-commit` | Working-tree inspection, atomic slice decomposition, and author-driven message authoring in learning sessions. User approves every commit. | 60 lines | | **[`git-commit`](skills/git-commit/SKILL.md)** | `/git-commit` | Working-tree inspection, atomic slice decomposition, and author-driven message authoring in learning sessions. User approves every commit. | 60 lines |
| **[`document`](skills/document/SKILL.md)** | `/document` | Second-order knowledge classifier (Discussion, ADR, Plan, Debug Record, Knowledge, Journal). User confirms type and provides core insight. | 53 lines | | **[`git-workspace`](skills/git-workspace/SKILL.md)** | `/git-workspace` | Branch and worktree lifecycle, history integration (rebase/squash/cherry-pick), conflict halts, and evidence-first reflog recovery. | 50 lines |
| **[`document`](skills/document/SKILL.md)** | `/document` | Second-order knowledge classifier (Discussion, ADR, Plan, Debug Record, Knowledge, Journal). User confirms type and provides core insight. | 55 lines |
| **[`journal-builder`](skills/journal-builder/SKILL.md)** | `/journal-builder` or `/journal` | Two-phase daily engineering review: generates factual skeleton with question blanks, then reviews and calibrates user reasoning. | 58 lines | | **[`journal-builder`](skills/journal-builder/SKILL.md)** | `/journal-builder` or `/journal` | Two-phase daily engineering review: generates factual skeleton with question blanks, then reviews and calibrates user reasoning. | 58 lines |
| **[`reconcile-docs`](skills/reconcile-docs/SKILL.md)** | `/reconcile-docs [path]` | Reconciles historical evidence, present code reality, and future plans into canonical repo docs (README, ARCHITECTURE, ADR, ROADMAP). | 37 lines | | **[`reconcile-docs`](skills/reconcile-docs/SKILL.md)** | `/reconcile-docs [path]` | Reconciles historical evidence, present code reality, and future plans into canonical repo docs (README, ARCHITECTURE, ADR, ROADMAP). | 40 lines |
| **[`build-skill`](skills/build-skill/SKILL.md)** | `/build-skill [topic]` | Interactive design, sizing, authoring, and empirical dogfooding of agent skills. Enforces design review gate before file creation. | 49 lines | | **[`build-skill`](skills/build-skill/SKILL.md)** | `/build-skill [topic]` | Interactive design, sizing, authoring, and empirical dogfooding of agent skills. Enforces design review gate before file creation. | 49 lines |
| **[`inspect-flake-update`](skills/inspect-flake-update/SKILL.md)** | `/inspect-flake-update` | Inspects updated flake.lock inputs, reviews upstream revisions, runs nix flake check, and drafts commit messages. | 46 lines | | **[`inspect-flake-update`](skills/inspect-flake-update/SKILL.md)** | `/inspect-flake-update` | Inspects updated flake.lock inputs, reviews upstream revisions, runs nix flake check, and drafts commit messages. | 46 lines |
| **[`nix-devshell`](skills/nix-devshell/SKILL.md)** | `/nix-devshell` | Authors, extends, validates, and troubleshoots project Nix development shells from repository evidence. | 75 lines | | **[`nix-devshell`](skills/nix-devshell/SKILL.md)** | `/nix-devshell` | Authors, extends, validates, and troubleshoots project Nix development shells from repository evidence. | 76 lines |
| **[`verify-slice`](skills/verify-slice/SKILL.md)** | `/verify-slice` | Runs risk-proportional verification and PR review across behavioral, state, security, ergonomic, and regression perspectives using falsifiable assertions. | 37 lines | | **[`verify-slice`](skills/verify-slice/SKILL.md)** | `/verify-slice` | Runs risk-proportional verification and PR review across behavioral, state, security, ergonomic, and regression perspectives using falsifiable assertions. | 37 lines |
| **[`code-review`](skills/code-review/SKILL.md)** | `/code-review` | Inspects diffs across four isolated axes: Spec & Scope, Standards & Smells, Seam & Test Integrity, and Defensive Invariants. | 42 lines | | **[`code-review`](skills/code-review/SKILL.md)** | `/code-review` | Inspects diffs across four isolated axes: Spec & Scope, Standards & Smells, Seam & Test Integrity, and Defensive Invariants. | 42 lines |
| **[`tdd`](skills/tdd/SKILL.md)** | `/tdd` | Guides red-green test-driven development through public interface seams, boundary-only mocking, and non-tautological assertions. | 40 lines | | **[`tdd`](skills/tdd/SKILL.md)** | `/tdd` | Guides red-green test-driven development through public interface seams, boundary-only mocking, and non-tautological assertions. | 40 lines |
@@ -109,6 +110,7 @@ Every skill features an explicit **"Your call"** checkpoint where the agent paus
3. **Retrospective Scaffolding to Journal**: `journal-builder` (reconstruct facts & question blanks from repository history) -> user fills reasoning -> curation & calibration -> `draft-curation`. 3. **Retrospective Scaffolding to Journal**: `journal-builder` (reconstruct facts & question blanks from repository history) -> user fills reasoning -> curation & calibration -> `draft-curation`.
4. **Documentation Reconciliation**: `reconcile-docs` (audit history, code reality, roadmap) -> propose updates to README / ARCHITECTURE / ADRs -> user approves. 4. **Documentation Reconciliation**: `reconcile-docs` (audit history, code reality, roadmap) -> propose updates to README / ARCHITECTURE / ADRs -> user approves.
5. **Skill Design Loop**: `build-skill` (approve spec) -> dogfood run -> minimal mechanism refinement. 5. **Skill Design Loop**: `build-skill` (approve spec) -> dogfood run -> minimal mechanism refinement.
6. **Branch Lifecycle & Integration**: `git-workspace` (branch-before-edits or isolated worktree) -> implementation -> `git-commit` (atomic slice approval) -> `code-review` / `verify-slice` -> `git-workspace` (rebase or integration).
--- ---
+1 -1
View File
@@ -33,7 +33,7 @@ while [[ $# -gt 0 ]]; do
done done
# Active skills to install # Active skills to install
ACTIVE_PORTABLE_SKILLS=(build-skill code-review diagnose document git-commit inspect-flake-update journal-builder nix-devshell practice reconcile-docs tdd verify-slice) ACTIVE_PORTABLE_SKILLS=(build-skill code-review diagnose document git-commit git-workspace inspect-flake-update journal-builder nix-devshell practice reconcile-docs tdd verify-slice)
ACTIVE_EXTENSION_SKILLS=(draft-curation) ACTIVE_EXTENSION_SKILLS=(draft-curation)
# Legacy / deprecated skills to clean up or back up if found in target # Legacy / deprecated skills to clean up or back up if found in target
+12 -2
View File
@@ -12,8 +12,18 @@ whether I really understood something), don't make it for me:
- **Explain first**: Always provide a thorough explanation in your message prose covering - **Explain first**: Always provide a thorough explanation in your message prose covering
the context, architectural implications, concrete pros and cons, and your reasoning the context, architectural implications, concrete pros and cons, and your reasoning
*before* prompting for a choice. Never present a question modal in a vacuum. *before* prompting for a choice. Never present a question modal in a vacuum.
- **2-3 concrete options**: Frame the choice clearly with your recommendation listed - **Decision categorization**:
first and marked "(Recommended)", one decision at a time. - **Independent architectural decisions** (system boundaries, trade-offs, commit vs rework,
schema or model changes, doc destinations): Frame the choice clearly with 2-3 concrete options,
your recommendation listed first and marked "(Recommended)", one decision at a time.
- **Homogeneous operational checkpoints** (approving a sequence of reviewable commit slices,
batching independent routine task operations): Orchestrators may structure multi-choice
prompts for batch approval, provided each option exposes both the concrete action and its
consequence, consequential or destructive actions are never collapsed into a blanket
"approve all", and I can uncheck or revise individual items.
- **Consequential and destructive boundary**: Destructive operations (`reset --hard`,
`restore <file>`, `clean -fd`, force-push, deleting worktrees with uncommitted changes)
always require an explicit yes with impact described first.
- **Modal restraint**: Use the `ask-question` tool only when a structured interactive - **Modal restraint**: Use the `ask-question` tool only when a structured interactive
selection is truly helpful; otherwise present the options in clear markdown prose. selection is truly helpful; otherwise present the options in clear markdown prose.
+7 -6
View File
@@ -10,8 +10,8 @@ description: >-
## Use when ## Use when
- `/git-commit`, "commit this", "split these changes", "write the commit message". - `/git-commit`, "commit this", "split these changes", "write the commit message".
- Rebase, squash, cherry-pick, merge or reset: read - Reviewing staged content and packaging clean checkpoint commits.
[references/history-editing.md](references/history-editing.md) first. - Not for branch creation, worktrees, rebasing, or recovery: use `git-workspace`.
## Steps ## Steps
1. **Inspect.** Repo root, branch and upstream, `git status`, `git diff`, `git diff --cached`. 1. **Inspect.** Repo root, branch and upstream, `git status`, `git diff`, `git diff --cached`.
@@ -47,13 +47,14 @@ the repo allows it.
## Your call ## Your call
- **How to slice.** Offer 2-3 options, recommended first (draft messages only in delivery mode). - **How to slice.** Offer 2-3 options, recommended first (draft messages only in delivery mode).
Example: "1 commit" / "2 commits: refactor + feature" / "3 commits: refactor, feature, tests". Example: "1 commit" / "2 commits: refactor + feature" / "3 commits: refactor, feature, tests".
- **Integration strategy.** Only when a real merge/rebase/cherry-pick choice exists. In learning - **Approve commits.** Present options and batch approvals following the operational checkpoint
mode I pick a strategy and give my reason; you check the reason against the branch topology. rules in `profile/AGENTS.md`. Each slice must expose files, message, and consequence.
- **Approve each commit** before it is created. - **What next** after the last commit: offer 2-3 actions (push, open PR, switch to `git-workspace`
- **What next** after the last commit: offer 2-3 actions (push, open PR, keep working, run `document`). for integration or cleanup, keep working, run `document`).
## Done when ## Done when
- Every approved slice is committed, verified by SHA, and leftover changes are reported. - Every approved slice is committed, verified by SHA, and leftover changes are reported.
## Hands off to ## Hands off to
- `git-workspace`: for branch management, worktrees, rebasing, integration, or recovery.
- `document`: if a commit carries a decision or insight worth more than a commit message. - `document`: if a commit carries a decision or insight worth more than a commit message.
+50
View File
@@ -0,0 +1,50 @@
---
name: git-workspace
description: >-
Manage Git branches, worktrees, history integration (rebase, squash, cherry-pick),
conflict stops, and evidence-first reflog recovery. Use when creating branches or
worktrees, synchronizing branches, editing history, or recovering lost commits.
Not for slicing checkpoint commits: use git-commit.
---
# Git Workspace
## Use when
- Creating dedicated feature branches or isolated worktrees before making edits.
- Integrating branches (rebase, squash, merge, cherry-pick) or resolving conflicts.
- Recovering lost commits, dangling refs, or broken working-tree state via reflog.
- Not for slicing uncommitted diffs into checkpoint commits: use `git-commit`.
## Steps
1. **Inspect state.** Resolve target repository root (`git rev-parse --show-toplevel`), active branch,
upstream tracking, clean vs. dirty status (`git status --short`), and reflog head. All commands execute
strictly from the target repository root.
2. **Branch and worktree management.** Enforce the branch-before-edits invariant. Create dedicated feature
branches (`git switch -c <name>`). When working across parallel tasks or spikes without disturbing current
working-tree state, create an isolated worktree following [references/worktrees.md](references/worktrees.md).
Never remove a worktree containing uncommitted or unmerged work without explicit confirmation.
3. **Integration and history editing.** Rebase local unshared branches onto upstream base; collapse fixup
checkpoints via squash; cherry-pick with dependency checks. On any merge or rebase conflict: stop immediately,
report conflicting files and hunks in prose, never guess resolution, and offer clean abort (`git rebase --abort`).
Follow [references/history-editing.md](references/history-editing.md).
4. **Evidence-first recovery.** When a commit, branch, or working-tree state appears lost or corrupted, inspect
evidence first (`git reflog`, `git fsck`, `git branch -v`) to identify exact candidate SHAs and timestamps
before proposing any fix. Never run destructive resets (`git reset --hard`) as a speculative remedy. Restore
discovered state into a dedicated recovery branch. Follow [references/recovery.md](references/recovery.md).
5. **Verify post-operation state.** Confirm target ref, commit log (`git log -n 3 --oneline`), and clean working
tree before concluding.
## Your call
- **Branch and worktree naming and target paths**: choose names and locations for new branches or worktrees.
- **Integration strategy**: choose rebase vs. merge when an architectural choice exists.
- **Conflict resolution**: adjudicate conflicting hunks when git stops during integration.
- **Consequential and destructive actions**: require explicit confirmation with impact described first per
`profile/AGENTS.md` before running destructive commands (`git reset --hard`, force-push, worktree removal).
## Done when
- Target branch or worktree is created, integrated, or safely cleaned up; or lost ref is restored to a named
branch with observable verification evidence.
## Hands off to
- `git-commit`: when code changes are ready to be sliced, reviewed, and committed.
- `code-review`: when a branch or PR diff is ready for multi-axis static review before integration.
@@ -9,16 +9,18 @@ Rules for rewriting or combining history. Read before any of these operations.
## Rebase ## Rebase
- Fine on local, unshared branches, to keep history linear and tidy before integrating. - Fine on local, unshared branches, to keep history linear and tidy before integrating.
- Never rebase or force-push a branch others may have pulled without my explicit OK. - Never rebase or force-push a branch others may have pulled without my explicit OK.
- On conflicts: stop immediately. Inspect `git status --short` and conflicting hunks. Never guess resolution. Offer `git rebase --abort` to return cleanly to prior state if resolution is uncertain.
## Cherry-pick ## Cherry-pick
1. Inspect the source commit and what it depends on. 1. Inspect the source commit and what it depends on.
2. Confirm the target working tree is clean. 2. Confirm the target working tree is clean.
3. Cherry-pick, inspect the resulting diff, run validation. 3. Cherry-pick, inspect the resulting diff, run validation.
4. On conflicts or hidden dependencies: stop and report. 4. On conflicts or hidden dependencies: stop and report. Offer `git cherry-pick --abort`.
## Merge ## Merge
- Follow the repo's integration policy (merge commit vs fast-forward vs rebase). - Follow the repo's integration policy (merge commit vs fast-forward vs rebase).
- Keep merge commits when the branch shape tells a useful story (long-running feature work). - Keep merge commits when the branch shape tells a useful story (long-running feature work).
- On conflicts: stop and report. Offer `git merge --abort` before attempting resolution.
## Reset and restore ## Reset and restore
- **Safe** (keeps file contents): `git restore --staged <file>`, `git reset --soft <ref>`. - **Safe** (keeps file contents): `git restore --staged <file>`, `git reset --soft <ref>`.
@@ -0,0 +1,76 @@
# Evidence-First Git Recovery
Reference for `git-workspace`. Procedures for diagnosing and recovering lost commits, detached heads, botched rebases, or corrupted refs using observable evidence.
## Core Invariant
Never propose a destructive command (`git reset --hard`, `git checkout -f`, `git clean -fd`) as a speculative remedy. Destructive commands discard uncommitted files permanently. Always inspect evidence first, locate candidate commit SHAs, and restore state into a new named branch.
## 1. Inspect Current State Before Acting
Check working-tree and ref state:
```sh
git status --short
git branch -v
git log -n 5 --oneline
```
If working-tree changes exist, stash or commit them before attempting ref recovery:
```sh
git stash push -m "WIP before reflog recovery"
```
## 2. Reflog Inspection
The reflog records every update to local branch tips and `HEAD`.
- Inspect recent `HEAD` movements:
```sh
git reflog -n 20 --date=iso
```
- Look for state transitions:
- `rebase (finish)` / `rebase (start)`: find the commit immediately preceding `rebase (start)`.
- `reset: moving to ...`: find the SHA prior to the reset.
- `commit: ...`: locate orphaned commits from deleted or moved branches.
- Inspect branch-specific reflog:
```sh
git reflog show <branch-name>
```
## 3. Verify Candidate Commit
Inspect the candidate SHA before restoring:
```sh
git show <candidate-sha> --stat
git log -1 -p <candidate-sha>
```
Confirm that the commit contains the expected changes and history.
## 4. Non-Destructive Restoration
Never mutate current branch in place with `--hard` reset. Instead, point a dedicated recovery branch at the discovered SHA:
```sh
git branch recovery/<topic> <candidate-sha>
```
Verify the recovered branch:
```sh
git log -n 3 --oneline recovery/<topic>
```
Then switch to the recovery branch cleanly:
```sh
git switch recovery/<topic>
```
## 5. Dangling and Unreachable Objects (Last Resort)
If a commit was not captured in the reflog (e.g. reflog expired or repository corruption):
```sh
git fsck --lost-found
```
Dangling commits appear in `.git/lost-found/commit/`. Inspect each candidate:
```sh
git log -1 -p <dangling-sha>
```
Once found, create a branch off it:
```sh
git branch recovery/<topic> <dangling-sha>
```
@@ -0,0 +1,52 @@
# Git Worktrees
Reference for `git-workspace`. Manage isolated working trees linked to the same underlying Git repository without cloning or stashing.
## Use Cases
- Working on a quick fix or spike without stashing or switching branches in your main working tree.
- Running parallel test suites or builds in separate checkouts.
- Evaluating a PR branch while keeping current development intact.
## Path Conventions
- Place worktrees outside the primary repository directory (for example, `../<repo>-<feature>` or in a dedicated sibling directory), or under an ignored `.worktrees/` directory.
- Never nest a worktree inside a tracked source directory.
## Core Operations
### 1. Add Worktree
- For an existing branch:
```sh
git worktree add ../<repo>-<branch> <branch>
```
- For a new branch off current base:
```sh
git worktree add -b feat/<name> ../<repo>-<feature> <base-ref>
```
### 2. Inspect Worktrees
- List all active worktree paths and their checked-out branches/SHAs:
```sh
git worktree list
```
### 3. Pinning / Locking
- Prevent accidental pruning when a worktree sits on removable or shared storage:
```sh
git worktree lock <path> --reason "active long-running test build"
git worktree unlock <path>
```
### 4. Safe Removal
- Confirm working-tree status inside the worktree first:
```sh
git -C <path> status --short
```
- If clean, remove cleanly:
```sh
git worktree remove <path>
```
- If dirty, **never run `git worktree remove --force`** without explicit confirmation from the human owner describing what uncommitted edits will be discarded.
- If a worktree directory was deleted manually, clean up administrative metadata:
```sh
git worktree prune
```