claude-code-arcane 2.13.0 → 2.14.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 +8 -0
- package/README.md +1 -1
- package/agents/visualnovel/vn-producer.md +2 -2
- package/dist/cli.js +10 -1
- package/docs/USER-GUIDE.md +2 -2
- package/docs/collaborative-design.md +1 -1
- package/docs/context-management.md +5 -22
- package/docs/coordination-rules.md +1 -1
- package/docs/directory-structure.md +3 -3
- package/docs/gates/README.md +2 -2
- package/hooks/detect-division.sh +1 -1
- package/hooks/log-agent-stop.sh +1 -1
- package/hooks/log-agent.sh +1 -1
- package/hooks/notify.sh +1 -1
- package/hooks/post-compact.sh +1 -1
- package/hooks/pre-compact.sh +1 -1
- package/hooks/session-start.sh +41 -5
- package/hooks/session-stop.sh +5 -1
- package/hooks/worktree-stop.sh +48 -0
- package/package.json +1 -1
- package/profiles/core.yaml +1 -0
- package/rules/implementation-workflow.md +24 -0
- package/skills/help/SKILL.md +2 -2
- package/skills/start/SKILL.md +2 -2
- package/skills/story-done/SKILL.md +2 -2
- package/skills/ux-design/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# [2.14.0](https://github.com/SebastianLuser/claude-code-arcane/compare/v2.13.0...v2.14.0) (2026-10-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **hooks:** leave finished worktrees and tell a session where it is ([df0531f](https://github.com/SebastianLuser/claude-code-arcane/commit/df0531feef6801649682f8f21dfcf36de006851b))
|
|
7
|
+
* **session:** keep the progress file in .claude/session-state ([0615ce5](https://github.com/SebastianLuser/claude-code-arcane/commit/0615ce5289751044a749a034b1ef99bcbfd7e058))
|
|
8
|
+
|
|
1
9
|
# [2.13.0](https://github.com/SebastianLuser/claude-code-arcane/compare/v2.12.0...v2.13.0) (2026-10-16)
|
|
2
10
|
|
|
3
11
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Claude Code Arcane
|
|
2
2
|
|
|
3
|
-
> **437 skills, 115 agents,
|
|
3
|
+
> **437 skills, 115 agents, 17 hooks and 36 rules for Claude Code — selective deploy by profile.**
|
|
4
4
|
|
|
5
5
|
A configuration harness installable via `npx`. Pick a **profile** that matches your stack and only the relevant tools get installed into your project's `.claude/` directory.
|
|
6
6
|
|
|
@@ -81,7 +81,7 @@ Know who to call for what:
|
|
|
81
81
|
|
|
82
82
|
#### Progress Tracking
|
|
83
83
|
|
|
84
|
-
Maintain
|
|
84
|
+
Maintain `.claude/session-state/active.md` with:
|
|
85
85
|
|
|
86
86
|
```markdown
|
|
87
87
|
## VN Production State
|
|
@@ -122,7 +122,7 @@ Maintain `production/session-state/active.md` with:
|
|
|
122
122
|
| Audio asset gaps | Medium | Medium | Placeholder tracks, generate late |
|
|
123
123
|
|
|
124
124
|
### File Ownership
|
|
125
|
-
-
|
|
125
|
+
- `.claude/session-state/active.md` — session state
|
|
126
126
|
- `production/milestones/` — milestone definitions and status
|
|
127
127
|
- `design/assets/asset-manifest.md` — asset pipeline tracking (shared with vn-asset-pipeline)
|
|
128
128
|
|
package/dist/cli.js
CHANGED
|
@@ -926,7 +926,9 @@ function defaultHooks(target) {
|
|
|
926
926
|
Notification: one("notify.sh", 10),
|
|
927
927
|
PreCompact: one("pre-compact.sh", 10),
|
|
928
928
|
PostCompact: one("post-compact.sh", 10),
|
|
929
|
-
Stop:
|
|
929
|
+
Stop: [
|
|
930
|
+
{ matcher: "", hooks: [hook(target, "session-stop.sh", 10), hook(target, "worktree-stop.sh", 10)] }
|
|
931
|
+
],
|
|
930
932
|
SubagentStart: one("log-agent.sh", 5),
|
|
931
933
|
SubagentStop: one("log-agent-stop.sh", 5)
|
|
932
934
|
};
|
|
@@ -973,6 +975,13 @@ function healHooks(hooks, target) {
|
|
|
973
975
|
pre.push({ matcher: FILE_TOOLS_MATCHER, hooks: [hook(target, "guard.sh", 10)] });
|
|
974
976
|
changes.push("guard for file edits");
|
|
975
977
|
}
|
|
978
|
+
const stop = hooks.Stop ??= [];
|
|
979
|
+
if (!stop.some((g) => g.hooks?.some((h) => h.command?.includes("worktree-stop.sh")))) {
|
|
980
|
+
const group = stop.find((g) => !g.matcher);
|
|
981
|
+
if (group) group.hooks = [...group.hooks ?? [], hook(target, "worktree-stop.sh", 10)];
|
|
982
|
+
else stop.push({ matcher: "", hooks: [hook(target, "worktree-stop.sh", 10)] });
|
|
983
|
+
changes.push("worktree exit on stop");
|
|
984
|
+
}
|
|
976
985
|
return changes;
|
|
977
986
|
}
|
|
978
987
|
|
package/docs/USER-GUIDE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What is Arcane?
|
|
4
4
|
|
|
5
|
-
Arcane is a configuration harness for [Claude Code](https://docs.anthropic.com/en/docs/claude-code). It provides a curated library of **437 skills**, **115 agents**, **
|
|
5
|
+
Arcane is a configuration harness for [Claude Code](https://docs.anthropic.com/en/docs/claude-code). It provides a curated library of **437 skills**, **115 agents**, **17 hooks**, and **36 rules** that you selectively deploy into any project. Instead of shipping everything to every project (wasting tokens and degrading performance), you pick a **profile** that matches your stack and only the relevant tools get installed.
|
|
6
6
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
@@ -239,7 +239,7 @@ Every installation automatically loads `core.yaml` first:
|
|
|
239
239
|
|----------|----------|
|
|
240
240
|
| **Skills (21)** | commit, create-pr, changelog, check, code-review, context-prime, help, start, fix-issue, hotfix, brainstorm, scope-check, reverse-document, skill-improve, skill-test, tech-debt, arcane-status, arcane-list, arcane-add, arcane-remove, arcane-clean |
|
|
241
241
|
| **Rules (8)** | data-files, prototype-code, test-standards, implementation-workflow, code-comments, verification, agent-delegation, git-worktrees |
|
|
242
|
-
| **Hooks (
|
|
242
|
+
| **Hooks (16)** | session-start, detect-division, detect-unreal, detect-gaps, check-update, guard, validate-commit, validate-assets, validate-skill-change, notify, pre-compact, post-compact, session-stop, worktree-stop, log-agent, log-agent-stop |
|
|
243
243
|
| **Agents (1 dir)** | quality |
|
|
244
244
|
| **Permissions** | 15 allow (git, ls, gh pr/issue/run and read-only gh, curl) + 13 deny (force push, reset --hard, clean -f, sudo, .env, etc.) |
|
|
245
245
|
|
|
@@ -311,7 +311,7 @@ Para documentos largos (ADRs, PRDs, GDDs, RFCs) escribí sección por sección a
|
|
|
311
311
|
- Review con el usuario
|
|
312
312
|
- Iterar hasta aprobación
|
|
313
313
|
- Escribir ESA sección al archivo
|
|
314
|
-
- Update
|
|
314
|
+
- Update .claude/session-state/active.md
|
|
315
315
|
- La conversación de esa sección puede compactarse — la decisión ya está en disco
|
|
316
316
|
|
|
317
317
|
3. Si la sesión crashea mid-document:
|
|
@@ -16,7 +16,7 @@ Claude Code tiene una ventana de contexto limitada. Sesiones largas llegan al l
|
|
|
16
16
|
|
|
17
17
|
### Session State File
|
|
18
18
|
|
|
19
|
-
Mantené
|
|
19
|
+
Mantené `.claude/session-state/active.md` como checkpoint vivo. Update después de cada milestone significativo:
|
|
20
20
|
|
|
21
21
|
- Sección de diseño / ADR aprobada y escrita
|
|
22
22
|
- Decisión arquitectónica tomada
|
|
@@ -25,23 +25,6 @@ Mantené `production/session-state/active.md` como checkpoint vivo. Update despu
|
|
|
25
25
|
|
|
26
26
|
El state file debe contener: tarea actual, checklist de progreso, decisiones clave tomadas, archivos en trabajo, preguntas abiertas.
|
|
27
27
|
|
|
28
|
-
### Status Line Block (opcional, para proyectos activos)
|
|
29
|
-
|
|
30
|
-
Para proyectos en fase de ejecución, incluir en `active.md` un bloque estructurado que el status line script puede parsear:
|
|
31
|
-
|
|
32
|
-
```markdown
|
|
33
|
-
<!-- STATUS -->
|
|
34
|
-
Epic: Auth refactor
|
|
35
|
-
Feature: JWT rotation
|
|
36
|
-
Task: Implementar refresh endpoint
|
|
37
|
-
<!-- /STATUS -->
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
- Los tres campos (Epic, Feature, Task) son opcionales — incluí solo lo aplicable
|
|
41
|
-
- Update cuando cambiás de foco
|
|
42
|
-
- El status line lo muestra como breadcrumb: `Auth refactor > JWT rotation > Refresh endpoint`
|
|
43
|
-
- Remove o vaciá cuando no hay work focus activo
|
|
44
|
-
|
|
45
28
|
Después de cualquier disrupción (compaction, crash, `/clear`), leé el state file primero.
|
|
46
29
|
|
|
47
30
|
---
|
|
@@ -71,8 +54,8 @@ Esto mantiene el context window con ~3-5k tokens (solo la sección actual) en ve
|
|
|
71
54
|
|
|
72
55
|
### Compaction Hooks
|
|
73
56
|
|
|
74
|
-
- `pre-compact.sh
|
|
75
|
-
- `
|
|
57
|
+
- `pre-compact.sh` y `post-compact.sh` solo anotan la hora en `.claude/session-state/sessions.log`. No guardan ni cargan estado.
|
|
58
|
+
- Lo que sobrevive a la compactación es el archivo: `session-start.sh` corre también después de cada compactación (SessionStart con matcher vacío) y muestra el inicio de `active.md`. Por eso `active.md` tiene que estar al día **antes** de compactar.
|
|
76
59
|
|
|
77
60
|
---
|
|
78
61
|
|
|
@@ -111,7 +94,7 @@ Los subagents no heredan historia de conversación — dales contexto completo e
|
|
|
111
94
|
|
|
112
95
|
Cuando el contexto se compacta, preservá en el summary:
|
|
113
96
|
|
|
114
|
-
- Referencia a
|
|
97
|
+
- Referencia a `.claude/session-state/active.md` (leer para recover state)
|
|
115
98
|
- Lista de archivos modificados en la sesión y su propósito
|
|
116
99
|
- Decisiones arquitectónicas hechas y su rationale
|
|
117
100
|
- Tasks activas del sprint y estado actual
|
|
@@ -163,7 +146,7 @@ Cuando el status line muestra >= 70%:
|
|
|
163
146
|
```
|
|
164
147
|
Tarea: "Implementá auth JWT completo"
|
|
165
148
|
|
|
166
|
-
1. Crear
|
|
149
|
+
1. Crear .claude/session-state/active.md con:
|
|
167
150
|
- Feature: JWT auth
|
|
168
151
|
- Files to create: src/auth/{tokens.ts, middleware.ts, login.ts}
|
|
169
152
|
- Tests: tests/auth.test.ts
|
|
@@ -71,7 +71,7 @@ Ningún agente hace commits sin instrucción explícita del user. Ni siquiera el
|
|
|
71
71
|
|
|
72
72
|
## Regla #9 — Session State
|
|
73
73
|
|
|
74
|
-
Actualizar
|
|
74
|
+
Actualizar `.claude/session-state/active.md` cuando:
|
|
75
75
|
- Se completa un section/phase
|
|
76
76
|
- Se toma una decisión significativa
|
|
77
77
|
- Se cambia de división/agente
|
|
@@ -97,9 +97,9 @@ claude-code-arcane/
|
|
|
97
97
|
│ ├── statusline.sh # Solo con el profile statusline
|
|
98
98
|
│ ├── output-styles/ # Solo si algún profile declara output_styles
|
|
99
99
|
│ ├── docs/ # Copia de docs/; arcane update la mantiene al día
|
|
100
|
+
│ ├── session-state/ # active.md y logs de sesión; se ignora solo (.gitignore con *)
|
|
100
101
|
│ └── .arcane-trash/ # Lo que arcane update saca; nunca se borra con rm
|
|
101
|
-
|
|
102
|
-
└── production/session-state/ # Estado de sesión que escriben los hooks
|
|
102
|
+
└── .claude.bak/ # Backup de .claude/ antes de instalar
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
Fuera del proyecto, `~/.arcane/` guarda el registro de instalaciones (`installations.json`) y el contenido descargado de GitHub (`cache/<version>/`). `ARCANE_HOME` lo desvía.
|
|
@@ -127,7 +127,7 @@ Los eventos los define `src/installer.ts` al generar `settings.json`, no los pro
|
|
|
127
127
|
| PostToolUse (`Write\|Edit`) | `validate-assets.sh`, `validate-skill-change.sh` |
|
|
128
128
|
| Notification | `notify.sh` |
|
|
129
129
|
| PreCompact / PostCompact | `pre-compact.sh` / `post-compact.sh` |
|
|
130
|
-
| Stop | `session-stop.sh` |
|
|
130
|
+
| Stop | `session-stop.sh`, `worktree-stop.sh` |
|
|
131
131
|
| SubagentStart / SubagentStop | `log-agent.sh` / `log-agent-stop.sh` |
|
|
132
132
|
|
|
133
133
|
Cada comando es `bash "$CLAUDE_PROJECT_DIR/.claude/hooks/<script>"`: dentro de un worktree los hooks corren parados en el worktree, que puede no tener `.claude/hooks/` commiteado, y la variable siempre apunta al proyecto donde arrancó la sesión. `arcane update` migra las instalaciones que tenían la ruta relativa.
|
package/docs/gates/README.md
CHANGED
|
@@ -123,8 +123,8 @@ Después de que un gate resuelve, registrar el verdict en el header de status de
|
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
Para phase gates, registrar en:
|
|
126
|
-
- Software: `docs/architecture/architecture.md` o
|
|
127
|
-
- Gamedev: `docs/architecture/architecture.md` o
|
|
126
|
+
- Software: `docs/architecture/architecture.md` o `.claude/session-state/active.md`
|
|
127
|
+
- Gamedev: `docs/architecture/architecture.md` o `.claude/session-state/active.md`
|
|
128
128
|
|
|
129
129
|
---
|
|
130
130
|
|
package/hooks/detect-division.sh
CHANGED
|
@@ -22,7 +22,7 @@ main() {
|
|
|
22
22
|
DIVISION="engineering (Python)"
|
|
23
23
|
fi
|
|
24
24
|
|
|
25
|
-
[[ -d "
|
|
25
|
+
[[ -d ".claude/session-state" ]] && echo "Division: $DIVISION" > .claude/session-state/division.txt
|
|
26
26
|
}
|
|
27
27
|
main 2>/dev/null
|
|
28
28
|
exit 0
|
package/hooks/log-agent-stop.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set +e
|
|
3
3
|
main() {
|
|
4
|
-
[[ -d
|
|
4
|
+
[[ -d .claude/session-state ]] && echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] subagent_stop" >> .claude/session-state/agents.log
|
|
5
5
|
}
|
|
6
6
|
main 2>/dev/null
|
|
7
7
|
exit 0
|
package/hooks/log-agent.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set +e
|
|
3
3
|
main() {
|
|
4
|
-
[[ -d
|
|
4
|
+
[[ -d .claude/session-state ]] && echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] subagent_start" >> .claude/session-state/agents.log
|
|
5
5
|
}
|
|
6
6
|
main 2>/dev/null
|
|
7
7
|
exit 0
|
package/hooks/notify.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set +e
|
|
3
3
|
main() {
|
|
4
|
-
[[ -d
|
|
4
|
+
[[ -d .claude/session-state ]] && echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] notification" >> .claude/session-state/notifications.log
|
|
5
5
|
}
|
|
6
6
|
main 2>/dev/null
|
|
7
7
|
exit 0
|
package/hooks/post-compact.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set +e
|
|
3
3
|
main() {
|
|
4
|
-
[[ -d
|
|
4
|
+
[[ -d .claude/session-state ]] && echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] post-compact" >> .claude/session-state/sessions.log
|
|
5
5
|
}
|
|
6
6
|
main 2>/dev/null
|
|
7
7
|
exit 0
|
package/hooks/pre-compact.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set +e
|
|
3
3
|
main() {
|
|
4
|
-
[[ -d
|
|
4
|
+
[[ -d .claude/session-state ]] && echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] pre-compact" >> .claude/session-state/sessions.log
|
|
5
5
|
}
|
|
6
6
|
main 2>/dev/null
|
|
7
7
|
exit 0
|
package/hooks/session-start.sh
CHANGED
|
@@ -3,13 +3,49 @@
|
|
|
3
3
|
# Graceful: wraps in main(), never blocks session
|
|
4
4
|
set +e
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
STATE_DIR=".claude/session-state"
|
|
7
|
+
LEGACY_STATE_DIR="production/session-state"
|
|
8
|
+
|
|
9
|
+
# The folder holds session notes, never project files: a .gitignore with `*` keeps it
|
|
10
|
+
# out of every commit without touching the project's own .gitignore.
|
|
11
|
+
ensure_state_dir() {
|
|
12
|
+
mkdir -p "$STATE_DIR" 2>/dev/null
|
|
13
|
+
[ -f "$STATE_DIR/.gitignore" ] || echo '*' > "$STATE_DIR/.gitignore" 2>/dev/null
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
# active.md used to live in production/session-state/. Move it once, so a task left
|
|
17
|
+
# half done before the update still shows up here.
|
|
18
|
+
migrate_legacy_state() {
|
|
19
|
+
[ -f "$LEGACY_STATE_DIR/active.md" ] || return 0
|
|
20
|
+
[ -f "$STATE_DIR/active.md" ] && return 0
|
|
21
|
+
ensure_state_dir
|
|
22
|
+
mv "$LEGACY_STATE_DIR/active.md" "$STATE_DIR/active.md" 2>/dev/null &&
|
|
23
|
+
echo "Moved $LEGACY_STATE_DIR/active.md to $STATE_DIR/active.md"
|
|
24
|
+
}
|
|
8
25
|
|
|
9
|
-
|
|
10
|
-
|
|
26
|
+
# A session started inside a worktree should know it, and where the main checkout is.
|
|
27
|
+
worktree_notice() {
|
|
28
|
+
local DIRS GIT_DIR COMMON_DIR TOP BRANCH MAIN MAIN_BRANCH
|
|
29
|
+
DIRS=$(git rev-parse --path-format=absolute --git-dir --git-common-dir 2>/dev/null) || return 0
|
|
30
|
+
GIT_DIR=$(echo "$DIRS" | sed -n 1p)
|
|
31
|
+
COMMON_DIR=$(echo "$DIRS" | sed -n 2p)
|
|
32
|
+
[ -z "$COMMON_DIR" ] || [ "$GIT_DIR" = "$COMMON_DIR" ] && return 0
|
|
33
|
+
TOP=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
34
|
+
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
35
|
+
MAIN=$(dirname "$COMMON_DIR")
|
|
36
|
+
MAIN_BRANCH=$(git -C "$MAIN" rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
37
|
+
echo "Worktree: you are in $TOP on branch $BRANCH."
|
|
38
|
+
echo "Main checkout: $MAIN on branch $MAIN_BRANCH. See the git-worktrees rule before pulling or switching branches."
|
|
39
|
+
echo ""
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
main() {
|
|
43
|
+
migrate_legacy_state
|
|
44
|
+
[ -d "$STATE_DIR" ] && ensure_state_dir
|
|
45
|
+
[ -d "$STATE_DIR" ] && echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] Session started" >> "$STATE_DIR/sessions.log" 2>/dev/null
|
|
11
46
|
|
|
12
47
|
echo "=== Claude Code Arcane — Session Context ==="
|
|
48
|
+
worktree_notice
|
|
13
49
|
|
|
14
50
|
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
15
51
|
if [ -n "$BRANCH" ]; then
|
|
@@ -55,7 +91,7 @@ main() {
|
|
|
55
91
|
fi
|
|
56
92
|
fi
|
|
57
93
|
|
|
58
|
-
STATE_FILE="
|
|
94
|
+
STATE_FILE="$STATE_DIR/active.md"
|
|
59
95
|
if [ -f "$STATE_FILE" ]; then
|
|
60
96
|
echo ""
|
|
61
97
|
echo "=== ACTIVE SESSION STATE DETECTED ==="
|
package/hooks/session-stop.sh
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set +e
|
|
3
3
|
main() {
|
|
4
|
-
[[ -d
|
|
4
|
+
[[ -d .claude/session-state ]] || return 0
|
|
5
|
+
# Claude creates the folder the first time it writes active.md; keep it out of
|
|
6
|
+
# commits from that same turn on.
|
|
7
|
+
[[ -f .claude/session-state/.gitignore ]] || echo '*' > .claude/session-state/.gitignore
|
|
8
|
+
echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] Session stopped" >> .claude/session-state/sessions.log
|
|
5
9
|
}
|
|
6
10
|
main 2>/dev/null
|
|
7
11
|
exit 0
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Hook: worktree-stop.sh — Stop
|
|
3
|
+
#
|
|
4
|
+
# A session that enters a worktree with EnterWorktree tends to stay there after the
|
|
5
|
+
# task is done, and the next pull or branch switch fails inside it. When the turn
|
|
6
|
+
# ends inside such a worktree with everything committed, block the stop once and ask
|
|
7
|
+
# Claude to leave with ExitWorktree (keep), or to say the task continues.
|
|
8
|
+
#
|
|
9
|
+
# Fires once per commit: a new commit means new progress, so it may ask again.
|
|
10
|
+
# Never fires when the session itself started inside the worktree (ExitWorktree
|
|
11
|
+
# could not leave it) or while there are uncommitted changes (work in progress).
|
|
12
|
+
set +e
|
|
13
|
+
|
|
14
|
+
main() {
|
|
15
|
+
local INPUT PROJECT TOP BRANCH HEAD MARKER_DIR MARKER REASON
|
|
16
|
+
INPUT=$(cat 2>/dev/null)
|
|
17
|
+
# Second stop of the same turn: Claude already answered the block.
|
|
18
|
+
echo "$INPUT" | grep -qE '"stop_hook_active"[[:space:]]*:[[:space:]]*true' && return 0
|
|
19
|
+
|
|
20
|
+
PROJECT="${CLAUDE_PROJECT_DIR:-}"
|
|
21
|
+
[ -n "$PROJECT" ] || return 0
|
|
22
|
+
TOP=$(git rev-parse --show-toplevel 2>/dev/null) || return 0
|
|
23
|
+
|
|
24
|
+
# Only worktrees EnterWorktree creates: under the project the session started in.
|
|
25
|
+
case "$TOP" in
|
|
26
|
+
"$PROJECT"/.claude/worktrees/*) ;;
|
|
27
|
+
*) return 0 ;;
|
|
28
|
+
esac
|
|
29
|
+
|
|
30
|
+
[ -z "$(git status --porcelain 2>/dev/null)" ] || return 0
|
|
31
|
+
|
|
32
|
+
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
33
|
+
HEAD=$(git rev-parse HEAD 2>/dev/null)
|
|
34
|
+
MARKER_DIR="$PROJECT/.claude/session-state"
|
|
35
|
+
MARKER="$MARKER_DIR/.worktree-stop"
|
|
36
|
+
[ "$(cat "$MARKER" 2>/dev/null)" = "$TOP $HEAD" ] && return 0
|
|
37
|
+
mkdir -p "$MARKER_DIR" 2>/dev/null
|
|
38
|
+
[ -f "$MARKER_DIR/.gitignore" ] || echo '*' > "$MARKER_DIR/.gitignore"
|
|
39
|
+
echo "$TOP $HEAD" > "$MARKER"
|
|
40
|
+
|
|
41
|
+
REASON="You are still inside the worktree $TOP (branch $BRANCH) and its changes are committed. If the task is finished, push the branch if the task included pushing, then leave with ExitWorktree (action: keep) and tell the user the worktree path and branch. If the task continues, say so in one line and stop."
|
|
42
|
+
REASON=${REASON//\\/\/}
|
|
43
|
+
REASON=${REASON//\"/\'}
|
|
44
|
+
printf '{"decision": "block", "reason": "%s"}\n' "$REASON"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
main
|
|
48
|
+
exit 0
|
package/package.json
CHANGED
package/profiles/core.yaml
CHANGED
|
@@ -39,6 +39,30 @@ Use AskUserQuestion exactly like this:
|
|
|
39
39
|
- **Goal-driven:** Help the user define a verifiable goal statement and 2-4 checkpoints, create tasks, implement toward each checkpoint. No formal plan.
|
|
40
40
|
- **Directo:** Proceed immediately without ceremony.
|
|
41
41
|
|
|
42
|
+
## Progress file
|
|
43
|
+
|
|
44
|
+
In **Plan + Goal** and **Goal-driven** mode, keep `.claude/session-state/active.md` up to date. A compaction or a new session loses the conversation, not this file: `session-start.sh` shows its first lines when a session starts and after every compaction.
|
|
45
|
+
|
|
46
|
+
- **Create it** when the goal is set. If `.claude/session-state/` does not exist yet, create it with a `.gitignore` containing `*`, so the file never lands in a commit.
|
|
47
|
+
- **Update it** at every checkpoint, and always before a compaction.
|
|
48
|
+
- **Close it** when the task ends: set `Status: closed` and record the final verification result.
|
|
49
|
+
- Keep it under 30 lines:
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
# <task>
|
|
53
|
+
Status: in progress | closed
|
|
54
|
+
Goal: <verifiable outcome>
|
|
55
|
+
Criteria: <how we know it is done>
|
|
56
|
+
Plan:
|
|
57
|
+
- [x] <step done>
|
|
58
|
+
- [ ] <step pending>
|
|
59
|
+
Decisions: <decision> — <why>
|
|
60
|
+
Next: <the next concrete step>
|
|
61
|
+
Not verified: <what has not been checked yet>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Directo and Action Plan tasks do not need it.
|
|
65
|
+
|
|
42
66
|
## Before writing new code
|
|
43
67
|
|
|
44
68
|
In every mode, search in this order and take the first option that fully works:
|
package/skills/help/SKILL.md
CHANGED
|
@@ -14,7 +14,7 @@ model: haiku
|
|
|
14
14
|
|
|
15
15
|
- Stage: !`cat production/stage.txt 2>/dev/null | tr -d '[:space:]' || echo 'not set'`
|
|
16
16
|
- Latest sprint: !`ls -t production/sprints/*.md 2>/dev/null | head -1 || echo 'none'`
|
|
17
|
-
- Session state: !`head -5
|
|
17
|
+
- Session state: !`head -5 .claude/session-state/active.md 2>/dev/null || echo 'none'`
|
|
18
18
|
|
|
19
19
|
Read-only skill — reports findings, writes no files. Lightweight orientation; for a formal readiness check use `/gate-check`.
|
|
20
20
|
|
|
@@ -29,7 +29,7 @@ Read `.claude/docs/workflow-catalog.yaml` (authoritative phases/steps). Glob `.c
|
|
|
29
29
|
|
|
30
30
|
## Step 3: Read Session Context
|
|
31
31
|
|
|
32
|
-
Read
|
|
32
|
+
Read `.claude/session-state/active.md` — what was most recently worked on, in-progress tasks, open questions.
|
|
33
33
|
|
|
34
34
|
## Step 4: Check Step Completion
|
|
35
35
|
|
package/skills/start/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ Entry point para sesiones nuevas. Detecta contexto, hace preguntas clave, rutea
|
|
|
12
12
|
|
|
13
13
|
## Paso 1: Detectar contexto
|
|
14
14
|
|
|
15
|
-
Escanear en paralelo: Unity (`ProjectSettings/ProjectVersion.txt`), Unreal (`*.uproject`), Web/Node (`package.json`), Go (`go.mod`), Python (`pyproject.toml`/`requirements.txt`), Flutter (`pubspec.yaml`), Rust (`Cargo.toml`), docs (`README.md`, `CLAUDE.md`, `design/`, `docs/`), session state (
|
|
15
|
+
Escanear en paralelo: Unity (`ProjectSettings/ProjectVersion.txt`), Unreal (`*.uproject`), Web/Node (`package.json`), Go (`go.mod`), Python (`pyproject.toml`/`requirements.txt`), Flutter (`pubspec.yaml`), Rust (`Cargo.toml`), docs (`README.md`, `CLAUDE.md`, `design/`, `docs/`), session state (`.claude/session-state/active.md`).
|
|
16
16
|
|
|
17
17
|
## Paso 2: Determinar etapa
|
|
18
18
|
|
|
@@ -45,7 +45,7 @@ AskUserQuestion multi-tab:
|
|
|
45
45
|
|
|
46
46
|
## Paso 5: Set session state
|
|
47
47
|
|
|
48
|
-
Crear
|
|
48
|
+
Crear `.claude/session-state/active.md`: project name, division, stage, user role, next action, stack detected, existing artifacts, recommended flow (3 commands).
|
|
49
49
|
|
|
50
50
|
## Paso 6: First action
|
|
51
51
|
|
|
@@ -12,7 +12,7 @@ Closes loop between design and implementation. Verifies acceptance criteria, che
|
|
|
12
12
|
|
|
13
13
|
## Phase 1: Find Story
|
|
14
14
|
|
|
15
|
-
Resolve review mode: `--review` arg → `production/review-mode.txt` → default `lean`. Story source: arg path →
|
|
15
|
+
Resolve review mode: `--review` arg → `production/review-mode.txt` → default `lean`. Story source: arg path → `.claude/session-state/active.md` → most recent sprint file (IN PROGRESS stories) → AskUserQuestion.
|
|
16
16
|
|
|
17
17
|
## Phase 2: Read Story
|
|
18
18
|
|
|
@@ -55,7 +55,7 @@ BLOCKED → do not proceed, list fixes, offer help.
|
|
|
55
55
|
|
|
56
56
|
## Phase 7: Update Story
|
|
57
57
|
|
|
58
|
-
Ask approval → edit story: `Status: Complete` + `## Completion Notes` (date, criteria, deviations, test evidence, code review status). Advisory deviations → offer to log in `docs/tech-debt-register.md`. Update `production/sprint-status.yaml` if exists. Append to
|
|
58
|
+
Ask approval → edit story: `Status: Complete` + `## Completion Notes` (date, criteria, deviations, test evidence, code review status). Advisory deviations → offer to log in `docs/tech-debt-register.md`. Update `production/sprint-status.yaml` if exists. Append to `.claude/session-state/active.md`.
|
|
59
59
|
|
|
60
60
|
## Phase 8: Surface Next Story
|
|
61
61
|
|
|
@@ -38,7 +38,7 @@ If output file exists → read it, show section status table (Complete/Empty/Pla
|
|
|
38
38
|
|
|
39
39
|
## Skeleton Creation
|
|
40
40
|
|
|
41
|
-
Create output file with `[To be designed]` placeholders for all sections. Update
|
|
41
|
+
Create output file with `[To be designed]` placeholders for all sections. Update `.claude/session-state/active.md`.
|
|
42
42
|
|
|
43
43
|
> → Read references/spec-sections.md for [section inventories for UX spec, HUD, pattern library, and key section guidance]
|
|
44
44
|
|