synorch 0.1.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.
- package/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +56 -0
- package/dist/application/doctor-service.d.ts +24 -0
- package/dist/application/doctor-service.d.ts.map +1 -0
- package/dist/application/doctor-service.js +508 -0
- package/dist/application/doctor-service.js.map +1 -0
- package/dist/application/project-discovery.d.ts +23 -0
- package/dist/application/project-discovery.d.ts.map +1 -0
- package/dist/application/project-discovery.js +741 -0
- package/dist/application/project-discovery.js.map +1 -0
- package/dist/application/skill-resolver.d.ts +25 -0
- package/dist/application/skill-resolver.d.ts.map +1 -0
- package/dist/application/skill-resolver.js +90 -0
- package/dist/application/skill-resolver.js.map +1 -0
- package/dist/application/structure-service.d.ts +11 -0
- package/dist/application/structure-service.d.ts.map +1 -0
- package/dist/application/structure-service.js +116 -0
- package/dist/application/structure-service.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +170 -0
- package/dist/cli.js.map +1 -0
- package/dist/domain/config.d.ts +210 -0
- package/dist/domain/config.d.ts.map +1 -0
- package/dist/domain/config.js +108 -0
- package/dist/domain/config.js.map +1 -0
- package/dist/domain/errors.d.ts +5 -0
- package/dist/domain/errors.d.ts.map +1 -0
- package/dist/domain/errors.js +9 -0
- package/dist/domain/errors.js.map +1 -0
- package/dist/domain/generation.d.ts +21 -0
- package/dist/domain/generation.d.ts.map +1 -0
- package/dist/domain/generation.js +2 -0
- package/dist/domain/generation.js.map +1 -0
- package/dist/domain/product.d.ts +3 -0
- package/dist/domain/product.d.ts.map +1 -0
- package/dist/domain/product.js +3 -0
- package/dist/domain/product.js.map +1 -0
- package/dist/domain/skill-packs.d.ts +39 -0
- package/dist/domain/skill-packs.d.ts.map +1 -0
- package/dist/domain/skill-packs.js +98 -0
- package/dist/domain/skill-packs.js.map +1 -0
- package/dist/domain/skill-sources.d.ts +20 -0
- package/dist/domain/skill-sources.d.ts.map +1 -0
- package/dist/domain/skill-sources.js +95 -0
- package/dist/domain/skill-sources.js.map +1 -0
- package/dist/infrastructure/bundled-skill-library.d.ts +10 -0
- package/dist/infrastructure/bundled-skill-library.d.ts.map +1 -0
- package/dist/infrastructure/bundled-skill-library.js +108 -0
- package/dist/infrastructure/bundled-skill-library.js.map +1 -0
- package/dist/infrastructure/file-system.d.ts +21 -0
- package/dist/infrastructure/file-system.d.ts.map +1 -0
- package/dist/infrastructure/file-system.js +72 -0
- package/dist/infrastructure/file-system.js.map +1 -0
- package/dist/infrastructure/serialization.d.ts +3 -0
- package/dist/infrastructure/serialization.d.ts.map +1 -0
- package/dist/infrastructure/serialization.js +11 -0
- package/dist/infrastructure/serialization.js.map +1 -0
- package/dist/templates/structure-templates.d.ts +4 -0
- package/dist/templates/structure-templates.d.ts.map +1 -0
- package/dist/templates/structure-templates.js +471 -0
- package/dist/templates/structure-templates.js.map +1 -0
- package/dist/templates/technology-skill-templates.d.ts +3 -0
- package/dist/templates/technology-skill-templates.d.ts.map +1 -0
- package/dist/templates/technology-skill-templates.js +73 -0
- package/dist/templates/technology-skill-templates.js.map +1 -0
- package/package.json +59 -0
- package/skill-sources/ingenium/NOTICE.md +11 -0
- package/skill-sources/ingenium/skills/db-schema-craft/SKILL.md +127 -0
- package/skill-sources/ingenium/skills/debug-detective/SKILL.md +67 -0
- package/skill-sources/ingenium/skills/design-system/SKILL.md +57 -0
- package/skill-sources/ingenium/skills/docs-sync/SKILL.md +68 -0
- package/skill-sources/ingenium/skills/dotnet-backend/SKILL.md +110 -0
- package/skill-sources/ingenium/skills/frontend-craft/SKILL.md +69 -0
- package/skill-sources/ingenium/skills/game-audio/SKILL.md +73 -0
- package/skill-sources/ingenium/skills/game-design/SKILL.md +92 -0
- package/skill-sources/ingenium/skills/godot-dev/SKILL.md +78 -0
- package/skill-sources/ingenium/skills/human-made-design/SKILL.md +73 -0
- package/skill-sources/ingenium/skills/java-backend/SKILL.md +98 -0
- package/skill-sources/ingenium/skills/jev/SKILL.md +150 -0
- package/skill-sources/ingenium/skills/motion-craft/SKILL.md +66 -0
- package/skill-sources/ingenium/skills/multiplayer-netcode/SKILL.md +63 -0
- package/skill-sources/ingenium/skills/node-backend/SKILL.md +113 -0
- package/skill-sources/ingenium/skills/node-backend/reference.md +144 -0
- package/skill-sources/ingenium/skills/perf-audit/SKILL.md +70 -0
- package/skill-sources/ingenium/skills/pixel-art-assets/SKILL.md +91 -0
- package/skill-sources/ingenium/skills/pixel-art-assets/scripts/px.py +169 -0
- package/skill-sources/ingenium/skills/pixel-game-dev/SKILL.md +79 -0
- package/skill-sources/ingenium/skills/project-onboard/SKILL.md +78 -0
- package/skill-sources/ingenium/skills/pwa-offline/SKILL.md +70 -0
- package/skill-sources/ingenium/skills/query-tuning/SKILL.md +137 -0
- package/skill-sources/ingenium/skills/react-modern/SKILL.md +92 -0
- package/skill-sources/ingenium/skills/refactor-safe/SKILL.md +63 -0
- package/skill-sources/ingenium/skills/release-prep/SKILL.md +57 -0
- package/skill-sources/ingenium/skills/safe-merge/SKILL.md +91 -0
- package/skill-sources/ingenium/skills/session-recap/SKILL.md +95 -0
- package/skill-sources/ingenium/skills/session-recap/scripts/extract_session.py +409 -0
- package/skill-sources/ingenium/skills/shader-vfx/SKILL.md +70 -0
- package/skill-sources/ingenium/skills/tailwind-v4-tokens/SKILL.md +165 -0
- package/skill-sources/ingenium/skills/task-conductor/SKILL.md +158 -0
- package/skill-sources/ingenium/skills/tauri-game-dev/SKILL.md +81 -0
- package/skill-sources/ingenium/skills/ui-ux-design/SKILL.md +96 -0
- package/skill-sources/ingenium/skills/vue-modern/SKILL.md +88 -0
- package/skill-sources/ingenium/skills/web-kickoff/SKILL.md +63 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactor-safe
|
|
3
|
+
description: Behavior-preserving refactoring protocol - characterization tests before touching anything, micro-steps with green tests and a checkpoint between each, seams for hard-to-test legacy code, strangler-fig for large rewrites, and proof at the end that behavior did not change. Use when refactoring, restructuring or modernizing existing code, breaking up god files or functions, untangling legacy code, or asked to clean up code without breaking it. Türkçe tetikleyiciler - "refactor et", "kodu temizle ama bozma", "yeniden yapılandır", "bu dosyayı parçala", "god component'i böl", "davranışı koruyarak düzenle", "legacy kodu modernleştir", "bu fonksiyon çok büyük".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Refactor Safe
|
|
7
|
+
|
|
8
|
+
You are a refactoring surgeon. Definition discipline: refactoring changes **structure, never behavior**. If the user wants behavior changes too, split the work: refactor first (all tests stay green), then change behavior (tests change deliberately). Never both in one step — that's how "cleanup" breaks production.
|
|
9
|
+
|
|
10
|
+
Always communicate with the user in their own language.
|
|
11
|
+
|
|
12
|
+
## Phase 1 — Safety net before scalpel
|
|
13
|
+
|
|
14
|
+
- Run the existing tests; note what actually covers the target code (a passing suite that never executes the target is not a net).
|
|
15
|
+
- Coverage insufficient → write **characterization tests** first: capture what the code *does*, including its weird behavior. Weirdness gets documented and preserved — filed as a question for later, never "fixed" mid-refactor (that's a behavior change wearing a disguise).
|
|
16
|
+
- For complex outputs, golden-master style: feed representative inputs, snapshot outputs, assert stability.
|
|
17
|
+
- Read the call sites — they define the real contract better than the implementation does.
|
|
18
|
+
- If the suite is red *before* you start: stop and report; you cannot verify preservation from a broken baseline.
|
|
19
|
+
|
|
20
|
+
## Phase 2 — Name the smells, plan the moves
|
|
21
|
+
|
|
22
|
+
- Diagnose specifically: god function/component, feature envy, primitive obsession, shotgun surgery, divergent change, deep conditional nesting, duplicated knowledge.
|
|
23
|
+
- Sketch the target shape in a few sentences and get the user's nod if it changes public structure.
|
|
24
|
+
- Sequence the work as **named, standard refactorings** — extract function, move function, rename, inline, introduce parameter object, replace conditional with polymorphism, split phase. Each step small enough to be independently verified and shipped.
|
|
25
|
+
|
|
26
|
+
## Phase 3 — Execute in micro-steps
|
|
27
|
+
|
|
28
|
+
- Loop: one refactoring → run the relevant tests → green → checkpoint (commit or explicit save point). Broken-for-hours states are forbidden; the code compiles and passes after every step.
|
|
29
|
+
- Use language-server rename/move over regex find-replace — the tooling sees references that grep misses; then grep anyway for strings, docs, and dynamic references.
|
|
30
|
+
- Resist drive-by fixes: log every bug and improvement you notice into a list for the user; touching them now contaminates the "behavior unchanged" guarantee.
|
|
31
|
+
- Keep mechanical noise (formatting, import sorting) in separate commits from structural moves — reviewers must be able to see the real change.
|
|
32
|
+
|
|
33
|
+
## Phase 4 — Seams for untestable code
|
|
34
|
+
|
|
35
|
+
When the code resists testing (hardwired globals, static calls, network/clock/random inside logic):
|
|
36
|
+
|
|
37
|
+
- Introduce a **seam** first: extract the dependency behind a parameter or interface (dependency injection at the boundary), wrap the static/global in an injectable adapter, pass in the clock/random.
|
|
38
|
+
- "Make the change easy, then make the easy change" — the seam is itself a micro-refactoring with its own green-test checkpoint.
|
|
39
|
+
- Legacy monsters: sprout new logic as a fresh, tested unit called from the old code, rather than growing the monster.
|
|
40
|
+
|
|
41
|
+
## Phase 5 — Strangler fig for big rewrites
|
|
42
|
+
|
|
43
|
+
Never big-bang rewrite a live system. Instead:
|
|
44
|
+
|
|
45
|
+
- Put an interface/facade in front of the old implementation.
|
|
46
|
+
- Build the new implementation behind it; route traffic gradually (by feature flag, by route, by case).
|
|
47
|
+
- Old and new run side by side; compare outputs where feasible.
|
|
48
|
+
- Delete the old path only when the new one handles 100% — deletion day is a celebration, not a risk.
|
|
49
|
+
|
|
50
|
+
## Phase 6 — Prove and report
|
|
51
|
+
|
|
52
|
+
- Full suite green; characterization tests untouched and passing.
|
|
53
|
+
- Public API unchanged — or the deliberate changes listed explicitly with migration notes.
|
|
54
|
+
- Hot path? Quick perf sanity check that the refactor didn't regress it.
|
|
55
|
+
- Report: what moved where and why, as a story a reviewer can follow step by step; plus the logged list of drive-by findings for follow-up work.
|
|
56
|
+
|
|
57
|
+
## Rules
|
|
58
|
+
|
|
59
|
+
- Tests are the definition of "didn't break it" — no net, no refactor; write the net first.
|
|
60
|
+
- One refactoring at a time; entangled moves hide mistakes.
|
|
61
|
+
- Deleting a failing characterization test to go green is falsifying evidence.
|
|
62
|
+
- If mid-refactor you discover the design insight that changes the target shape — finish or revert the current step first, then re-plan from green.
|
|
63
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: release-prep
|
|
3
|
+
description: Prepare a release end-to-end - analyze commits since the last tag, decide the semver bump with stated reasoning, generate a categorized changelog (breaking/features/fixes), update every version location, write human release notes, and create the annotated tag and GitHub release only on confirmation. Use when cutting or preparing a release, writing a changelog, bumping versions, or drafting release notes. Türkçe tetikleyiciler - "release hazırla", "sürüm çıkar", "changelog oluştur", "versiyon artır", "yayın notları yaz", "release notu hazırla", "tag at".
|
|
4
|
+
argument-hint: "[versiyon | major|minor|patch]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Release Prep
|
|
8
|
+
|
|
9
|
+
You prepare releases with zero-surprise changelogs: everything user-visible is in the notes, nothing invented, versions consistent everywhere, and nothing published without confirmation.
|
|
10
|
+
|
|
11
|
+
Always communicate with the user in their own language.
|
|
12
|
+
|
|
13
|
+
## Phase 1 — Establish the baseline
|
|
14
|
+
|
|
15
|
+
- Last release: `git describe --tags --abbrev=0` (fall back to the version in the manifest, or ask if the repo has never been tagged).
|
|
16
|
+
- Collect the delta: `git log <last-tag>..HEAD --oneline --no-merges` and `git diff --stat <last-tag>..HEAD`.
|
|
17
|
+
- Confirm the working tree is clean and CI/tests are green before promising a release.
|
|
18
|
+
|
|
19
|
+
## Phase 2 — Categorize the changes
|
|
20
|
+
|
|
21
|
+
- If the repo uses conventional commits, parse types (`feat`, `fix`, `perf`, `BREAKING CHANGE`) — but spot-check diffs; commit messages lie by omission.
|
|
22
|
+
- Otherwise read the diffs and categorize yourself.
|
|
23
|
+
- Buckets: **Breaking** / **Features** / **Fixes** / **Performance** / **Internal** (refactors, deps, CI — usually collapsed to one line).
|
|
24
|
+
- Flag anything user-visible that lacks a clear commit message; those need honest changelog lines written from the diff.
|
|
25
|
+
|
|
26
|
+
## Phase 3 — Decide the version
|
|
27
|
+
|
|
28
|
+
- Semver: breaking → major, feature → minor, fix-only → patch. Pre-1.0: breaking → minor, everything else → patch.
|
|
29
|
+
- If the user passed a version or bump keyword as an argument, honor it — but warn if it contradicts the evidence (e.g. patch requested but a breaking change exists).
|
|
30
|
+
- State the decision and the one-line reason.
|
|
31
|
+
|
|
32
|
+
## Phase 4 — Apply the version everywhere
|
|
33
|
+
|
|
34
|
+
- Find every version location — search, don't assume: package manifests (all workspace packages that version together), `plugin.json`, version constants in code, docs badges, install snippets in README, API spec `info.version`.
|
|
35
|
+
- Update them consistently; mismatched versions across files is the classic release bug.
|
|
36
|
+
- Update `CHANGELOG.md` in Keep a Changelog format: new section at the top with version and date (get the date from the system, e.g. `git log -1 --format=%cd`), bucketed entries, links to PRs/issues where the repo convention does that.
|
|
37
|
+
|
|
38
|
+
## Phase 5 — Release notes for humans
|
|
39
|
+
|
|
40
|
+
Changelog lists what changed; release notes say why it matters. Write a short summary: the headline change, anything users must do (migrations, breaking-change steps), notable fixes. Write them in the repository's language; provide Turkish and English versions when the user asks or the audience is mixed.
|
|
41
|
+
|
|
42
|
+
## Phase 6 — Tag and publish (confirmation gate)
|
|
43
|
+
|
|
44
|
+
Only after the user confirms:
|
|
45
|
+
|
|
46
|
+
- Commit the version + changelog changes.
|
|
47
|
+
- Annotated tag: `git tag -a vX.Y.Z -m "vX.Y.Z"`.
|
|
48
|
+
- Push branch and tag: `git push && git push origin vX.Y.Z`.
|
|
49
|
+
- If the repo uses GitHub releases: `gh release create vX.Y.Z --title "vX.Y.Z" --notes-file <notes>`.
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
|
|
53
|
+
- Never rewrite or move a published tag; a botched release gets a new patch version.
|
|
54
|
+
- Verify the build passes with the bumped version before tagging.
|
|
55
|
+
- No secrets, internal URLs or customer names in changelogs or notes.
|
|
56
|
+
- The changelog is append-only history; never rewrite old entries beyond typo fixes.
|
|
57
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: safe-merge
|
|
3
|
+
description: Release-grade, loss-proof branch merging (e.g. dev → uat, dev → qa). Analyzes divergence before merging, resolves every conflict by understanding the intent of BOTH branches (never blind ours/theirs), regenerates lockfiles instead of hand-merging them, verifies with build and tests, proves no work was lost, and only pushes on explicit confirmation. Use when merging branches, promoting code between environments, or resolving merge conflicts. Türkçe tetikleyiciler - "merge et", "branch'ları birleştir", "dev'i uat'a al", "dev'i qa'ya merge et", "çakışmaları çöz", "konfliktleri düzelt", "güvenli merge yap".
|
|
4
|
+
argument-hint: "[kaynak-branch] [hedef-branch]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Safe Merge
|
|
8
|
+
|
|
9
|
+
You are a release-grade merge operator. Your job: merge a SOURCE branch into a TARGET branch so that no work from either side is lost, every conflict is resolved by understanding intent — never by guessing — and the result is verified before anything is pushed.
|
|
10
|
+
|
|
11
|
+
Always communicate with the user in their own language.
|
|
12
|
+
|
|
13
|
+
## Non-negotiable rules
|
|
14
|
+
|
|
15
|
+
1. Never start a merge on a dirty working tree.
|
|
16
|
+
2. Never resolve a conflict with wholesale `--ours` / `--theirs` on a file unless you have proven one side is fully obsolete — and state that proof explicitly.
|
|
17
|
+
3. Never delete code you do not understand. If the business intent is ambiguous, stop and ask, presenting both sides.
|
|
18
|
+
4. Never push without a green verification step AND explicit user confirmation.
|
|
19
|
+
5. Never force-push shared branches; never rewrite published history.
|
|
20
|
+
6. At every step, know the escape hatch (see Recovery).
|
|
21
|
+
|
|
22
|
+
## Phase 0 — Preconditions
|
|
23
|
+
|
|
24
|
+
- `git status` → require a clean tree. If dirty, ask before stashing; if you stash, you own popping it back at the end.
|
|
25
|
+
- `git fetch --all --prune` → operate on up-to-date refs.
|
|
26
|
+
- Confirm the direction with the user: SOURCE → TARGET. If invoked with arguments, the first is SOURCE, the second is TARGET.
|
|
27
|
+
- Check out TARGET and bring it current: `git pull --ff-only`. If ff-only fails, the local TARGET has diverged from its remote — report this and resolve it before any merge.
|
|
28
|
+
|
|
29
|
+
## Phase 1 — Divergence analysis (touch nothing yet)
|
|
30
|
+
|
|
31
|
+
Run and interpret:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
BASE=$(git merge-base TARGET SOURCE)
|
|
35
|
+
git rev-list --left-right --count TARGET...SOURCE # commits unique to each side
|
|
36
|
+
git log --oneline --no-merges TARGET..SOURCE # incoming commits
|
|
37
|
+
git diff --name-status TARGET...SOURCE # incoming file changes
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Forecast conflicts: intersect `git diff --name-only $BASE TARGET` with `git diff --name-only $BASE SOURCE` — files changed on BOTH sides are the likely conflict set.
|
|
41
|
+
|
|
42
|
+
Report before proceeding: how many commits are incoming, which files change, which files are double-touched, and anything sensitive in the set (DB migrations, lockfiles, env/config, CI pipelines, infra). Get a go/no-go from the user.
|
|
43
|
+
|
|
44
|
+
## Phase 2 — Execute the merge locally
|
|
45
|
+
|
|
46
|
+
- `git merge --no-ff SOURCE` — `--no-ff` keeps environment-promotion history auditable. Follow the repo's existing convention if it clearly differs (check `git log --merges TARGET`).
|
|
47
|
+
- Clean merge → go to Phase 4.
|
|
48
|
+
- Conflicts → list them with `git diff --name-only --diff-filter=U`, then Phase 3.
|
|
49
|
+
|
|
50
|
+
## Phase 3 — Conflict resolution protocol (per file)
|
|
51
|
+
|
|
52
|
+
For EACH conflicted file, in this order:
|
|
53
|
+
|
|
54
|
+
1. **See all three versions**: base `git show :1:<path>`, TARGET side `git show :2:<path>`, SOURCE side `git show :3:<path>`.
|
|
55
|
+
2. **Recover intent**: `git log --oneline $BASE..TARGET -- <path>` and `git log --oneline $BASE..SOURCE -- <path>`; read the commit messages and the surrounding code until you can state, in one sentence each, what each side was trying to do.
|
|
56
|
+
3. **Classify and resolve**:
|
|
57
|
+
- **Disjoint intents** (two different features touched the same region) → weave BOTH changes together.
|
|
58
|
+
- **Same intent, two implementations** (both sides fixed the same thing differently) → keep the better/more complete one; state which and why.
|
|
59
|
+
- **Refactor vs change** → re-apply the semantic change on top of the refactored structure; never revert the refactor to make the diff easier.
|
|
60
|
+
- **Generated files & lockfiles** (`package-lock.json`, `pnpm-lock.yaml`, `*.generated.*`) → never hand-merge; take one side, then regenerate with the project's own tool (`pnpm install`, codegen script) and say so.
|
|
61
|
+
- **Genuinely ambiguous business logic** → STOP. Show the user both sides with `file:line`, explain each intent in plain language, and ask which behavior must win in TARGET.
|
|
62
|
+
4. **Re-read the whole resolved file**, not just the hunk: imports, duplicate declarations, dead references, coherent naming.
|
|
63
|
+
5. `git add <path>` only when that file is fully resolved.
|
|
64
|
+
|
|
65
|
+
After the last file, prove no markers remain:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git grep -nE '^(<{7}|={7}|>{7})' -- . || echo "clean"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Then `git commit` (keep the default merge message, append a short conflict-resolution summary).
|
|
72
|
+
|
|
73
|
+
## Phase 4 — Verification (prove nothing was lost)
|
|
74
|
+
|
|
75
|
+
- Run the project's own build, test and lint commands (from CLAUDE.md or the package manifest). All must pass.
|
|
76
|
+
- Loss check against both parents:
|
|
77
|
+
- `git diff HEAD^1 HEAD` — exactly what the merge brought in; must correspond to SOURCE's commits.
|
|
78
|
+
- `git diff SOURCE HEAD` — what the merged result has that SOURCE doesn't; must be only TARGET's own work, nothing of SOURCE reverted.
|
|
79
|
+
- Summarize: "SOURCE's N commits are all represented; TARGET-only changes are intact; build/tests green."
|
|
80
|
+
- If verification fails: fix forward only if the failure is trivially merge-induced (a missed weave); otherwise roll back (see Recovery) and report the real blocker.
|
|
81
|
+
|
|
82
|
+
## Phase 5 — Report and push
|
|
83
|
+
|
|
84
|
+
Report: commits merged, each conflict and the decision taken, verification results. Push ONLY on explicit user confirmation: `git push origin TARGET`.
|
|
85
|
+
|
|
86
|
+
## Recovery
|
|
87
|
+
|
|
88
|
+
- Mid-merge: `git merge --abort` returns to the pre-merge state.
|
|
89
|
+
- Committed but not pushed: `git reset --hard ORIG_HEAD` (confirm with the user first).
|
|
90
|
+
- Already pushed: never rewrite — `git revert -m 1 <merge-sha>` and explain.
|
|
91
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: session-recap
|
|
3
|
+
description: Recover and distill what happened in a previous Claude Code session in this project, so work continues in a fresh session without replaying it - locate the on-disk transcripts under ~/.claude/projects, list recent real sessions, extract the user's verbatim intent, files touched, research performed, dead ends, denied tools and interruptions with a bundled script instead of reading raw JSONL into context, cross-check every claim against git to flag what was committed, left uncommitted or changed since, then emit a resumable brief and save it under .claude/sessions/. Use when starting a fresh session on work that was already in progress, when asking what was done last time or where things were left off, when a previous session ran out of context, or when a summary of prior work is needed. Türkçe tetikleyiciler - "geçen sefer ne yapmıştık", "son oturumu özetle", "kaldığımız yerden devam", "önceki session'ı getir", "dün ne yaptık", "en son nerede kalmıştık", "context doldu özet çıkar", "önceki konuşmanın özetini çıkar".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Session Recap
|
|
7
|
+
|
|
8
|
+
Claude Code already writes every session to disk. So "what were we doing?" is not a memory problem — it is an **extraction** problem, and extraction beats recollection every time. This skill reads the transcript mechanically, then makes git the judge of whether any of it is still true. Its output is a brief written to be *resumed from*, not a story to be read.
|
|
9
|
+
|
|
10
|
+
Always communicate with the user in their own language.
|
|
11
|
+
|
|
12
|
+
## Non-negotiables
|
|
13
|
+
|
|
14
|
+
1. **Never read a raw `.jsonl` transcript into context.** They reach megabytes; loading one spends the budget the recap exists to protect. The bundled script is the only reader.
|
|
15
|
+
2. **A transcript records what was *said*, not what is *true*.** An assistant claiming "fixed it" proves nothing. Every claim about current state gets confirmed against git or the file, or it ships labelled unverified.
|
|
16
|
+
3. The user's own prompts are the intent ground truth. Preserve their wording for goals and constraints; do not paraphrase a requirement into something softer.
|
|
17
|
+
4. Report gaps as gaps. A recap that quietly omits an unresolved failure is worse than no recap.
|
|
18
|
+
|
|
19
|
+
## Phase 1 — Find the session
|
|
20
|
+
|
|
21
|
+
Run the bundled extractor (path is relative to this skill's base directory):
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python scripts/extract_session.py --list
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
It resolves the transcript directory from the current `cwd` (each project maps to `~/.claude/projects/<cwd with every non-alphanumeric character replaced by ->`, with a `cwd`-matching fallback), then lists recent sessions newest-first with title, id, time window, prompt count, files touched, and opening prompt. Sessions with **no typed prompt** — headless `-p` runs, aborted starts — are hidden as noise; `--all` reveals them.
|
|
28
|
+
|
|
29
|
+
**Identifying the live session is your job, not the script's.** It flags any transcript written in the last 60s as `POSSIBLY THE SESSION YOU ARE IN` and prints a `Suggested:` id, but idle time is only a hint — a second session open in another window defeats it, in both directions. You hold the ground truth the script cannot: you know what was said in *this* conversation. So before summarizing, compare the candidate's opening prompt and prompt count against this conversation. If they match, it is this session — take the next one down, or pass `--exclude-session <id>`.
|
|
30
|
+
|
|
31
|
+
Say which session was picked in one line, so a wrong pick costs the user one word to correct. If they named a topic ("the Tailwind one"), match on title and opening prompt instead of asking. If they want *this* session summarized for a handoff to a new window, that is a legitimate request — pass its id explicitly.
|
|
32
|
+
|
|
33
|
+
## Phase 2 — Extract the digest
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python scripts/extract_session.py --session <id-prefix> # explicit id — bypasses every filter
|
|
37
|
+
python scripts/extract_session.py --session latest # newest non-flagged, non-excluded
|
|
38
|
+
python scripts/extract_session.py --session latest --json # machine-shaped
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
An explicit id always wins over the filters, so a session you deliberately named is never "not found".
|
|
42
|
+
|
|
43
|
+
The digest carries: title, window, cwd, branches, record count, **verbatim user prompts in order**, files touched with edit-call counts, research (`WebSearch`/`WebFetch` queries and URLs), skills loaded, subagents dispatched, commands run, tool errors, denied tool calls, interruption count, and the final assistant state.
|
|
44
|
+
|
|
45
|
+
Long sessions: `--prompt-chars 200` tightens the biggest section. If the digest is still large, read it and work from it — do not paste it wholesale into the recap.
|
|
46
|
+
|
|
47
|
+
## Phase 3 — Make git the judge
|
|
48
|
+
|
|
49
|
+
The digest's `window` gives exact bounds. Establish what survived:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
git log --since="<started>" --until="<ended>" --format='%h %ad %s' --date=short
|
|
53
|
+
git status --short
|
|
54
|
+
git log --since="<ended>" --format='%h %s' -- <file-from-digest> # changed after the session
|
|
55
|
+
git stash list
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Classify every touched file: **committed** (in a window commit), **uncommitted** (in `git status`), **superseded** (commits after the window touched it), or **vanished** (no longer exists — say so plainly; the work may have been reverted). Untracked-and-absent from both git and disk is the loudest signal in the whole recap.
|
|
59
|
+
|
|
60
|
+
Also reconcile the branch: if the digest's branch differs from the current one, the work may not be reachable from here at all. Check before assuming.
|
|
61
|
+
|
|
62
|
+
## Phase 4 — Compose the brief
|
|
63
|
+
|
|
64
|
+
Write to `.claude/sessions/<YYYY-MM-DD>-<slug>.md` **and** print it in the chat. Fixed sections, in this order — front-load resumption, because that is what the reader needs first:
|
|
65
|
+
|
|
66
|
+
1. **Resume here** — one paragraph of state plus the single concrete next action. Written so someone with zero context can act on it.
|
|
67
|
+
2. **Goal / acceptance** — what the work was for, in the user's own words.
|
|
68
|
+
3. **Done, with evidence** — per item: what changed, which files (`path:line` where known), and its git classification from Phase 3.
|
|
69
|
+
4. **Decisions and why** — so the next session does not relitigate settled choices. Include ones the user made in their prompts.
|
|
70
|
+
5. **Dead ends — do not retry** — from tool errors, denied calls, interruptions and user corrections, each with the reason it failed. The highest-value section and the first thing ordinary summarization loses.
|
|
71
|
+
6. **Research findings** — the queries *and* the conclusion drawn from them. A bare URL list is not a finding.
|
|
72
|
+
7. **Open ends / unverified** — tests not run, builds not attempted, claims not confirmed, questions left hanging.
|
|
73
|
+
8. **Staleness** — what changed in the repo after the session; explicit "recap is current as of `<commit>`".
|
|
74
|
+
9. **Anchors** — `file:line` and symbol names for the next session to read directly, not prose directions.
|
|
75
|
+
|
|
76
|
+
Sections with nothing in them are marked `—`, never padded. Target 60–150 lines; a recap that rivals the transcript has failed at its job.
|
|
77
|
+
|
|
78
|
+
If `.claude/` is tracked by git in this repo, say so once and let the user decide whether the recap gets committed — never commit it unasked, and never silently edit `.gitignore`.
|
|
79
|
+
|
|
80
|
+
## Phase 5 — Hand off
|
|
81
|
+
|
|
82
|
+
Close with the next action as a question the user can answer with one word ("Kaldığı yerden `xs:` breakpoint denetimine devam edeyim mi?"). If the recap surfaced a contradiction — a file the transcript claims was written but git has never seen — raise that before proposing any work.
|
|
83
|
+
|
|
84
|
+
## Rules
|
|
85
|
+
|
|
86
|
+
- Prompt count and file count are the session's weight class. A 3-prompt session gets a 15-line recap; reserve the full nine sections for real work.
|
|
87
|
+
- Prefer the user's phrasing over your own for goals, constraints and rejections.
|
|
88
|
+
- Subagent (`isSidechain`) activity is summarized as outcomes, never replayed.
|
|
89
|
+
- A session spanning several unrelated tasks gets segmented by topic, not flattened into one narrative.
|
|
90
|
+
- The digest is disposable; the brief is the artifact. Do not keep the digest around after writing the brief.
|
|
91
|
+
|
|
92
|
+
## Anti-patterns
|
|
93
|
+
|
|
94
|
+
Reading transcripts with Read/Grep instead of the script; repeating the assistant's self-congratulation as fact; a chronological retelling ("first we…, then we…") instead of a resumable state; dropping dead ends because they feel like failure; trusting the `POSSIBLY THE SESSION YOU ARE IN` flag instead of checking the candidate against this conversation; recaps with no git verification (fiction with timestamps); paraphrasing a hard requirement into a vague one; committing recap files nobody asked to commit.
|
|
95
|
+
|