@the-bearded-bear/claude-craft 9.2.1-next.a35f60d → 9.2.1-next.e80512a

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 (134) hide show
  1. package/Dev/i18n/base/Common/hooks/scripts/block-dangerous-commands.sh +1 -1
  2. package/Dev/i18n/base/Common/hooks/scripts/guard-network.sh +1 -1
  3. package/Dev/i18n/base/Common/hooks/scripts/notify-slack.sh +1 -1
  4. package/Dev/i18n/base/Common/hooks/scripts/output-filter.sh +2 -2
  5. package/Dev/i18n/base/Common/hooks/scripts/output-size-hint.sh +3 -3
  6. package/Dev/i18n/base/Common/hooks/scripts/post-edit-lint.sh +3 -3
  7. package/Dev/i18n/base/Common/hooks/scripts/post-tool-failure.sh +2 -2
  8. package/Dev/i18n/base/Common/hooks/scripts/pre-commit-check.sh +7 -7
  9. package/Dev/i18n/base/Common/hooks/scripts/pre-compact.sh +8 -8
  10. package/Dev/i18n/base/Common/hooks/scripts/protect-sensitive-files.sh +2 -2
  11. package/Dev/i18n/base/Common/hooks/scripts/quality-gate.sh +10 -10
  12. package/Dev/i18n/base/Common/hooks/scripts/session-end.sh +3 -3
  13. package/Dev/i18n/base/Common/hooks/scripts/session-init.sh +8 -8
  14. package/Dev/i18n/de/Workflow/commands/start.md +1 -1
  15. package/Dev/i18n/en/Workflow/commands/start.md +1 -1
  16. package/Dev/i18n/es/Workflow/commands/start.md +1 -1
  17. package/Dev/i18n/fr/Workflow/commands/start.md +1 -1
  18. package/Dev/i18n/pt/Workflow/commands/start.md +1 -1
  19. package/Dev/scripts/lib/install-tech-common.sh +39 -39
  20. package/Dev/scripts/tcl-common.sh +23 -23
  21. package/Infra/install-ansible-rules.sh +26 -26
  22. package/Infra/install-coolify-rules.sh +26 -26
  23. package/Infra/install-docker-rules.sh +26 -26
  24. package/Infra/install-frankenphp-rules.sh +26 -26
  25. package/Infra/install-hcloud-rules.sh +26 -26
  26. package/Infra/install-kubernetes-rules.sh +26 -26
  27. package/Infra/install-opentofu-rules.sh +26 -26
  28. package/Infra/install-pgbouncer-rules.sh +26 -26
  29. package/Project/i18n/de/templates/sprint-status.md +4 -0
  30. package/Project/i18n/en/templates/sprint-status.md +4 -0
  31. package/Project/i18n/es/templates/sprint-status.md +4 -0
  32. package/Project/i18n/fr/templates/sprint-status.md +4 -0
  33. package/Project/i18n/pt/templates/sprint-status.md +4 -0
  34. package/Project/install-project-commands.sh +9 -9
  35. package/Project/templates/sprint-status.yaml.template +4 -0
  36. package/README.md +1 -1
  37. package/Tools/ProjectConfig/claude-projects.sh +2 -2
  38. package/Tools/Ralph/hooks/lib/ralph-common.sh +3 -3
  39. package/Tools/Ralph/hooks/pre-tool-context.sh +2 -2
  40. package/Tools/Ralph/hooks/session-restore.sh +8 -8
  41. package/Tools/Ralph/hooks/stop-dod-gate.sh +6 -6
  42. package/Tools/Ralph/lib/metrics-exporter.sh +3 -3
  43. package/Tools/Ralph/lib/parallel-manager.sh +1 -1
  44. package/Tools/Ralph/lib/sprint-conductor.sh +20 -7
  45. package/cli/kanban/client/dist/assets/BurndownView-Dk1mfbJc.js +3 -0
  46. package/cli/kanban/client/dist/assets/DepsView-76dCn6dU.js +1 -0
  47. package/cli/kanban/client/dist/assets/DocsView-DhqiPmYN.js +1 -0
  48. package/cli/kanban/client/dist/assets/SprintsView-B4toxGc4.css +1 -0
  49. package/cli/kanban/client/dist/assets/SprintsView-D0cZZhvI.js +1 -0
  50. package/cli/kanban/client/dist/assets/actions-CnvXl3Kr.js +2 -0
  51. package/cli/kanban/client/dist/assets/de-CpCArOVg.js +1 -0
  52. package/cli/kanban/client/dist/assets/es-CnARpMvm.js +1 -0
  53. package/cli/kanban/client/dist/assets/fr-CIeAvktE.js +1 -0
  54. package/cli/kanban/client/dist/assets/index-BimcLpOz.css +1 -0
  55. package/cli/kanban/client/dist/assets/index-CheCLe3m.js +2 -0
  56. package/cli/kanban/client/dist/assets/palette.svelte-BjYi22Ct.js +1 -0
  57. package/cli/kanban/client/dist/assets/pt-Cs89lHuV.js +1 -0
  58. package/cli/kanban/client/dist/assets/router.svelte-Dj-4eOGr.js +1 -0
  59. package/cli/kanban/client/dist/index.html +4 -3
  60. package/cli/kanban/client/src/app.css +36 -11
  61. package/cli/kanban/client/src/components/CapacityBar.svelte +57 -0
  62. package/cli/kanban/client/src/components/CloseSprintDialog.svelte +114 -0
  63. package/cli/kanban/client/src/components/ConfirmDialog.svelte +15 -6
  64. package/cli/kanban/client/src/components/FilterBar.svelte +14 -3
  65. package/cli/kanban/client/src/components/PromptDialog.svelte +33 -11
  66. package/cli/kanban/client/src/components/SprintForm.svelte +189 -0
  67. package/cli/kanban/client/src/components/StoryCreateDialog.svelte +133 -0
  68. package/cli/kanban/client/src/components/StoryDetail.svelte +633 -22
  69. package/cli/kanban/client/src/components/StoryForm.svelte +340 -0
  70. package/cli/kanban/client/src/components/StoryRow.svelte +21 -3
  71. package/cli/kanban/client/src/components/Toasts.svelte +14 -21
  72. package/cli/kanban/client/src/components/TweaksPanel.svelte +19 -9
  73. package/cli/kanban/client/src/components/WipSettings.svelte +130 -0
  74. package/cli/kanban/client/src/lib/actions.js +30 -0
  75. package/cli/kanban/client/src/lib/api.js +15 -9
  76. package/cli/kanban/client/src/lib/deps-style.js +5 -2
  77. package/cli/kanban/client/src/lib/detail.svelte.js +2 -1
  78. package/cli/kanban/client/src/lib/events.js +29 -0
  79. package/cli/kanban/client/src/lib/i18n/locales/de.js +179 -124
  80. package/cli/kanban/client/src/lib/i18n/locales/en.js +97 -46
  81. package/cli/kanban/client/src/lib/i18n/locales/es.js +139 -85
  82. package/cli/kanban/client/src/lib/i18n/locales/fr.js +101 -47
  83. package/cli/kanban/client/src/lib/i18n/locales/pt.js +129 -75
  84. package/cli/kanban/client/src/lib/icons.js +0 -4
  85. package/cli/kanban/client/src/lib/leave-guard.js +29 -0
  86. package/cli/kanban/client/src/lib/opener.js +12 -0
  87. package/cli/kanban/client/src/lib/optimistic.js +20 -0
  88. package/cli/kanban/client/src/lib/palette.svelte.js +10 -0
  89. package/cli/kanban/client/src/lib/router.svelte.js +51 -4
  90. package/cli/kanban/client/src/lib/sprint-actions.svelte.js +151 -0
  91. package/cli/kanban/client/src/lib/sprint-plan.js +141 -0
  92. package/cli/kanban/client/src/lib/store.svelte.js +110 -22
  93. package/cli/kanban/client/src/lib/story-actions.svelte.js +236 -0
  94. package/cli/kanban/client/src/lib/story-form.js +202 -0
  95. package/cli/kanban/client/src/lib/toasts.js +32 -6
  96. package/cli/kanban/client/src/lib/velocity.js +35 -0
  97. package/cli/kanban/client/src/lib/wip.js +17 -0
  98. package/cli/kanban/client/src/views/BacklogView.svelte +142 -6
  99. package/cli/kanban/client/src/views/BurndownView.svelte +133 -3
  100. package/cli/kanban/client/src/views/DepsView.svelte +4 -1
  101. package/cli/kanban/client/src/views/DocsView.svelte +9 -19
  102. package/cli/kanban/client/src/views/KanbanView.svelte +52 -24
  103. package/cli/kanban/client/src/views/SprintsView.svelte +125 -29
  104. package/cli/kanban/client/src/views.css +591 -0
  105. package/cli/kanban/server/app.js +17 -249
  106. package/cli/kanban/server/routes/http-errors.js +55 -0
  107. package/cli/kanban/server/routes/settings.js +24 -0
  108. package/cli/kanban/server/routes/sprints.js +364 -0
  109. package/cli/kanban/server/routes/stories.js +565 -0
  110. package/cli/kanban/server/services/event-bus.js +3 -2
  111. package/cli/kanban/server/services/frontmatter.js +24 -1
  112. package/cli/kanban/server/services/idempotency.js +77 -0
  113. package/cli/kanban/server/services/kanban-config.js +122 -0
  114. package/cli/kanban/server/services/lock.js +65 -14
  115. package/cli/kanban/server/services/markdown-metadata.js +27 -13
  116. package/cli/kanban/server/services/repository.js +53 -16
  117. package/cli/kanban/server/services/sprint-cache.js +19 -129
  118. package/cli/kanban/server/services/sprint-ops.js +201 -0
  119. package/cli/kanban/server/services/status-store.js +384 -0
  120. package/cli/kanban/server/services/story-files.js +267 -0
  121. package/cli/kanban/shared/schemas.js +92 -2
  122. package/package.json +2 -1
  123. package/cli/kanban/client/dist/assets/BurndownView-D_k6Z3kl.js +0 -3
  124. package/cli/kanban/client/dist/assets/DepsView-CJts6FC-.js +0 -1
  125. package/cli/kanban/client/dist/assets/DocsView-B_jWElbY.js +0 -1
  126. package/cli/kanban/client/dist/assets/Icon-CMFfOlyx.js +0 -2
  127. package/cli/kanban/client/dist/assets/SprintsView-CBPNR29v.js +0 -1
  128. package/cli/kanban/client/dist/assets/actions-Cad4Tfv-.js +0 -1
  129. package/cli/kanban/client/dist/assets/de-C1ALfMxO.js +0 -1
  130. package/cli/kanban/client/dist/assets/es-BTzEI6VS.js +0 -1
  131. package/cli/kanban/client/dist/assets/fr-DCtbjojf.js +0 -1
  132. package/cli/kanban/client/dist/assets/index-DJOJzRwr.js +0 -2
  133. package/cli/kanban/client/dist/assets/index-Dj-Zhhkw.css +0 -1
  134. package/cli/kanban/client/dist/assets/pt-C93_juUa.js +0 -1
@@ -16,7 +16,7 @@ set -u
16
16
  hook_require_parser
17
17
  hook_input
18
18
  CMD=$(hook_get tool_input.command)
19
- [ -n "$CMD" ] || exit 0
19
+ [[ -n "$CMD" ]] || exit 0
20
20
 
21
21
  MODE=${BLOCK_RM_RF:-dangerous}
22
22
  TEXT=$(printf '%s\n' "$CMD" | hook_strip_heredocs | hook_shell_segments)
@@ -13,7 +13,7 @@ set -u
13
13
  hook_require_parser
14
14
  hook_input
15
15
  CMD=$(hook_get tool_input.command)
16
- [ -n "$CMD" ] || exit 0
16
+ [[ -n "$CMD" ]] || exit 0
17
17
 
18
18
  # Corps de heredoc retirés, puis un segment par ligne (hook_shell_segments) : le texte
19
19
  # cité est une donnée, sauf après sh -c / eval et dans $(…) / `…`. Un segment "|"
@@ -7,7 +7,7 @@ set -u
7
7
  # shellcheck source=lib/hook-io.sh
8
8
  . "$(dirname "${BASH_SOURCE[0]}")/lib/hook-io.sh"
9
9
 
10
- [ -n "${SLACK_WEBHOOK_URL:-}" ] || exit 0
10
+ [[ -n "${SLACK_WEBHOOK_URL:-}" ]] || exit 0
11
11
  hook_has_parser || exit 0
12
12
  hook_input
13
13
  MESSAGE=$(hook_get message)
@@ -11,10 +11,10 @@ hook_has_parser || exit 0
11
11
  hook_input
12
12
  OUT=$(hook_get tool_response.stdout)
13
13
  LEN=${#OUT}
14
- [ "$LEN" -gt 50000 ] || exit 0
14
+ [[ "$LEN" -gt 50000 ]] || exit 0
15
15
 
16
16
  INTERRUPTED=false
17
- [ "$(hook_get tool_response.interrupted)" != true ] || INTERRUPTED=true
17
+ [[ "$(hook_get tool_response.interrupted)" != true ]] || INTERRUPTED=true
18
18
  HEAD=$(printf '%s' "$OUT" | head -c 8000)
19
19
  hook_replace_bash_output \
20
20
  "[output truncated by the output-filter hook: ${LEN} chars total, first 8000 shown. Re-run with a narrower command (grep/head/tail) to see more.]
@@ -8,12 +8,12 @@ set -u
8
8
  hook_has_parser || exit 0
9
9
  hook_input
10
10
  OUT=$(hook_get tool_response.stdout)
11
- [ -n "$OUT" ] || OUT=$(hook_get tool_response)
11
+ [[ -n "$OUT" ]] || OUT=$(hook_get tool_response)
12
12
  LEN=${#OUT}
13
13
 
14
- if [ "$LEN" -gt 50000 ]; then
14
+ if [[ "$LEN" -gt 50000 ]]; then
15
15
  hook_context PostToolUse "Output very large (${LEN} chars). Summarize key findings only; do not repeat output verbatim."
16
- elif [ "$(hook_get tool_name)" = "Bash" ] && [ "$LEN" -gt 10000 ]; then
16
+ elif [[ "$(hook_get tool_name)" = "Bash" ]] && [[ "$LEN" -gt 10000 ]]; then
17
17
  hook_context PostToolUse "Output: $(printf '%s\n' "$OUT" | wc -l | tr -d ' ') lines. Extract only relevant information."
18
18
  fi
19
19
  exit 0
@@ -8,18 +8,18 @@ set -u
8
8
  hook_has_parser || exit 0
9
9
  hook_input
10
10
  FILE_PATH=$(hook_get tool_input.file_path)
11
- [ -n "$FILE_PATH" ] || exit 0
11
+ [[ -n "$FILE_PATH" ]] || exit 0
12
12
 
13
13
  have() { command -v "$1" >/dev/null 2>&1; }
14
14
 
15
15
  case "${FILE_PATH##*.}" in
16
16
  js | jsx | ts | tsx)
17
- if have npx && [ -f package.json ]; then npx --no-install eslint --fix "$FILE_PATH" >/dev/null 2>&1 || true; fi
17
+ if have npx && [[ -f package.json ]]; then npx --no-install eslint --fix "$FILE_PATH" >/dev/null 2>&1 || true; fi
18
18
  ;;
19
19
  php)
20
20
  if have php-cs-fixer; then
21
21
  php-cs-fixer fix "$FILE_PATH" --quiet >/dev/null 2>&1 || true
22
- elif [ -x vendor/bin/php-cs-fixer ]; then
22
+ elif [[ -x vendor/bin/php-cs-fixer ]]; then
23
23
  vendor/bin/php-cs-fixer fix "$FILE_PATH" --quiet >/dev/null 2>&1 || true
24
24
  fi
25
25
  ;;
@@ -12,7 +12,7 @@ hook_input
12
12
  TOOL=$(hook_get tool_name)
13
13
  ERROR=$(hook_get error)
14
14
  CWD=$(hook_get cwd)
15
- [ -z "$CWD" ] || cd "$CWD" 2>/dev/null || true
15
+ [[ -z "$CWD" ]] || cd "$CWD" 2>/dev/null || true
16
16
 
17
17
  has() { printf '%s' "$ERROR" | grep -qiE -e "$1"; }
18
18
 
@@ -46,5 +46,5 @@ printf '[%s] [%s] [%s] %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$severity" "$TOOL
46
46
  "$(printf '%s' "$ERROR" | tr '\n' ' ' | cut -c1-300)" >>.claude/logs/tool-failures.log 2>/dev/null
47
47
 
48
48
  HINT=$(recovery_hint)
49
- [ -z "$HINT" ] || hook_context PostToolUseFailure "$HINT"
49
+ [[ -z "$HINT" ]] || hook_context PostToolUseFailure "$HINT"
50
50
  exit 0
@@ -12,9 +12,9 @@ set -u
12
12
  hook_require_parser
13
13
  hook_input
14
14
  CMD=$(hook_get tool_input.command)
15
- [ -n "$CMD" ] || exit 0
15
+ [[ -n "$CMD" ]] || exit 0
16
16
  cwd=$(hook_get cwd)
17
- [ -z "$cwd" ] || cd "$cwd" 2>/dev/null || exit 0
17
+ [[ -z "$cwd" ]] || cd "$cwd" 2>/dev/null || exit 0
18
18
 
19
19
  # Lignes émises : `commit`, `all` (commit -a), `add` (git add), `dir <chemin>` (git -C).
20
20
  facts=$(printf '%s\n' "$CMD" | hook_strip_heredocs | tr "'\"" ' ' | awk '
@@ -41,7 +41,7 @@ facts=$(printf '%s\n' "$CMD" | hook_strip_heredocs | tr "'\"" ' ' | awk '
41
41
  case "$facts" in *commit*) ;; *) exit 0 ;; esac
42
42
 
43
43
  dir=$(printf '%s\n' "$facts" | sed -n 's/^dir //p' | head -n 1)
44
- [ -z "$dir" ] || cd "$dir" 2>/dev/null || exit 0
44
+ [[ -z "$dir" ]] || cd "$dir" 2>/dev/null || exit 0
45
45
  top=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0
46
46
  cd "$top" || exit 0
47
47
 
@@ -50,19 +50,19 @@ if printf '%s\n' "$facts" | grep -qxE 'add|all'; then
50
50
  files=$(printf '%s\n%s\n%s\n' "$files" "$(git diff --name-only HEAD 2>/dev/null)" "$(git ls-files -o --exclude-standard 2>/dev/null)")
51
51
  fi
52
52
  files=$(printf '%s\n' "$files" | sed '/^$/d' | sort -u)
53
- [ -n "$files" ] || exit 0
53
+ [[ -n "$files" ]] || exit 0
54
54
 
55
55
  existing=()
56
56
  while IFS= read -r f; do
57
57
  if is_sensitive_path "$f"; then hook_block "Attempting to commit a sensitive file: $f"; fi
58
- [ -f "$f" ] && existing+=("$f")
58
+ [[ -f "$f" ]] && existing+=("$f")
59
59
  done <<EOF
60
60
  $files
61
61
  EOF
62
- [ ${#existing[@]} -gt 0 ] || exit 0
62
+ [[ ${#existing[@]} -gt 0 ]] || exit 0
63
63
 
64
64
  for p in '-----BEGIN [A-Z ]*PRIVATE KEY-----' 'AKIA[0-9A-Z]{16}' 'ghp_[A-Za-z0-9]{36}' 'xox[baprs]-[A-Za-z0-9-]{10,}'; do
65
65
  hit=$(grep -lIE -e "$p" -- "${existing[@]}" 2>/dev/null | head -n 1)
66
- [ -z "$hit" ] || hook_block "Potential secret detected in $hit"
66
+ [[ -z "$hit" ]] || hook_block "Potential secret detected in $hit"
67
67
  done
68
68
  exit 0
@@ -11,7 +11,7 @@ set -u
11
11
  hook_has_parser || exit 0
12
12
  hook_input
13
13
  CWD=$(hook_get cwd)
14
- [ -z "$CWD" ] || cd "$CWD" 2>/dev/null || true
14
+ [[ -z "$CWD" ]] || cd "$CWD" 2>/dev/null || true
15
15
  SESSION_ID=$(hook_get session_id)
16
16
  NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
17
17
  STAMP=$(date -u +%Y%m%d%H%M%S)
@@ -28,25 +28,25 @@ prune() {
28
28
  local f i=0
29
29
  while IFS= read -r f; do
30
30
  i=$((i + 1))
31
- [ "$i" -le 10 ] || rm -f "$f"
31
+ [[ "$i" -le 10 ]] || rm -f "$f"
32
32
  done < <(ls -t "$1"/*.yaml 2>/dev/null)
33
33
  }
34
34
 
35
35
  log "Context compaction triggered (session: ${SESSION_ID:-unknown})"
36
36
  SAVED=""
37
- if [ -f .bmad/sprint-status.yaml ]; then
37
+ if [[ -f .bmad/sprint-status.yaml ]]; then
38
38
  backup .bmad/sprint-status.yaml .bmad/backups sprint-status && SAVED="$SAVED .bmad/sprint-status.yaml"
39
39
  fi
40
- if [ -f .bmad/current-story.yaml ]; then
40
+ if [[ -f .bmad/current-story.yaml ]]; then
41
41
  backup .bmad/current-story.yaml .bmad/backups current-story && SAVED="$SAVED .bmad/current-story.yaml"
42
42
  fi
43
- if [ -d .recette/sessions ]; then
43
+ if [[ -d .recette/sessions ]]; then
44
44
  ACTIVE=$(find .recette/sessions -name '*.yaml' -mmin -60 2>/dev/null | head -n 1)
45
- [ -z "$ACTIVE" ] || backup "$ACTIVE" .recette/backups "$(basename "$ACTIVE" .yaml)"
45
+ [[ -z "$ACTIVE" ]] || backup "$ACTIVE" .recette/backups "$(basename "$ACTIVE" .yaml)"
46
46
  fi
47
47
  for d in .bmad/backups .recette/backups; do
48
- [ ! -d "$d" ] || prune "$d"
48
+ [[ ! -d "$d" ]] || prune "$d"
49
49
  done
50
50
 
51
- [ -z "$SAVED" ] || printf 'When compacting, keep the current BMAD sprint and story context (backed up:%s).\n' "$SAVED"
51
+ [[ -z "$SAVED" ]] || printf 'When compacting, keep the current BMAD sprint and story context (backed up:%s).\n' "$SAVED"
52
52
  exit 0
@@ -8,9 +8,9 @@ set -u
8
8
  hook_require_parser
9
9
  hook_input
10
10
  FILE=$(hook_get tool_input.file_path)
11
- [ -n "$FILE" ] || FILE=$(hook_get tool_input.notebook_path)
11
+ [[ -n "$FILE" ]] || FILE=$(hook_get tool_input.notebook_path)
12
12
 
13
- if [ -n "$FILE" ] && is_sensitive_path "$FILE"; then
13
+ if [[ -n "$FILE" ]] && is_sensitive_path "$FILE"; then
14
14
  hook_block "Cannot modify sensitive file: $FILE"
15
15
  fi
16
16
  exit 0
@@ -11,29 +11,29 @@ set -u
11
11
 
12
12
  hook_has_parser || exit 0
13
13
  hook_input
14
- [ "$(hook_get stop_hook_active)" = "true" ] && exit 0
14
+ [[ "$(hook_get stop_hook_active)" = "true" ]] && exit 0
15
15
  cwd=$(hook_get cwd)
16
- [ -z "$cwd" ] || cd "$cwd" 2>/dev/null || exit 0
16
+ [[ -z "$cwd" ]] || cd "$cwd" 2>/dev/null || exit 0
17
17
 
18
18
  # Commande de test du projet (vide si aucun framework détecté).
19
19
  detect_cmd() {
20
- if [ -n "${QUALITY_GATE_CMD:-}" ]; then printf '%s' "$QUALITY_GATE_CMD"; return; fi
21
- if [ -f package.json ]; then
20
+ if [[ -n "${QUALITY_GATE_CMD:-}" ]]; then printf '%s' "$QUALITY_GATE_CMD"; return; fi
21
+ if [[ -f package.json ]]; then
22
22
  local saved=$HOOK_INPUT script
23
23
  HOOK_INPUT=$(cat package.json)
24
24
  script=$(hook_get scripts.test)
25
25
  HOOK_INPUT=$saved
26
26
  case "$script" in "" | *"no test specified"*) ;; *) printf 'npm test'; return ;; esac
27
27
  fi
28
- if [ -f composer.json ] && [ -x vendor/bin/phpunit ]; then printf 'vendor/bin/phpunit'
29
- elif { [ -f pyproject.toml ] || [ -f setup.py ]; } && command -v pytest >/dev/null 2>&1; then printf 'pytest -q'
30
- elif [ -f pubspec.yaml ] && command -v flutter >/dev/null 2>&1; then printf 'flutter test'
31
- elif [ -f go.mod ] && command -v go >/dev/null 2>&1; then printf 'go test ./...'
28
+ if [[ -f composer.json ]] && [[ -x vendor/bin/phpunit ]]; then printf 'vendor/bin/phpunit'
29
+ elif { [[ -f pyproject.toml ]] || [[ -f setup.py ]]; } && command -v pytest >/dev/null 2>&1; then printf 'pytest -q'
30
+ elif [[ -f pubspec.yaml ]] && command -v flutter >/dev/null 2>&1; then printf 'flutter test'
31
+ elif [[ -f go.mod ]] && command -v go >/dev/null 2>&1; then printf 'go test ./...'
32
32
  fi
33
33
  }
34
34
 
35
35
  cmd=$(detect_cmd)
36
- [ -n "$cmd" ] || exit 0
36
+ [[ -n "$cmd" ]] || exit 0
37
37
 
38
38
  # Empreinte de l'arbre de travail (hors journaux) : vide hors dépôt git => pas de cache.
39
39
  fingerprint=""
@@ -41,7 +41,7 @@ if git rev-parse --git-dir >/dev/null 2>&1; then
41
41
  fingerprint=$({ git status --porcelain -- . ':!.claude/logs'; git diff HEAD -- . ':!.claude/logs'; } 2>/dev/null | cksum)
42
42
  fi
43
43
  ok_file=.claude/logs/quality-gate.ok
44
- if [ -n "$fingerprint" ] && [ -f "$ok_file" ] && [ "$(cat "$ok_file")" = "$fingerprint" ]; then
44
+ if [[ -n "$fingerprint" ]] && [[ -f "$ok_file" ]] && [[ "$(cat "$ok_file")" = "$fingerprint" ]]; then
45
45
  exit 0
46
46
  fi
47
47
 
@@ -9,7 +9,7 @@ set -u
9
9
  hook_has_parser || exit 0
10
10
  hook_input
11
11
  CWD=$(hook_get cwd)
12
- [ -z "$CWD" ] || cd "$CWD" 2>/dev/null || true
12
+ [[ -z "$CWD" ]] || cd "$CWD" 2>/dev/null || true
13
13
  SESSION_ID=$(hook_get session_id)
14
14
  REASON=$(hook_get reason)
15
15
  NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
@@ -24,13 +24,13 @@ FILES=$(git status --porcelain -- . ':!.claude' 2>/dev/null | wc -l | tr -d ' ')
24
24
 
25
25
  # Échecs d'outils du jour ; `|| true` : grep -c affiche déjà 0 et sort en 1 sans correspondance.
26
26
  FAILURES=0
27
- if [ -f .claude/logs/tool-failures.log ]; then
27
+ if [[ -f .claude/logs/tool-failures.log ]]; then
28
28
  FAILURES=$(grep -c "^\[$(date -u +%Y-%m-%d)" .claude/logs/tool-failures.log) || true
29
29
  fi
30
30
 
31
31
  STORY=none
32
32
  STATUS=unknown
33
- if [ -f .bmad/current-story.yaml ]; then
33
+ if [[ -f .bmad/current-story.yaml ]]; then
34
34
  STORY=$(grep '^id:' .bmad/current-story.yaml | head -n 1 | cut -d' ' -f2) || true
35
35
  STATUS=$(grep '^status:' .bmad/current-story.yaml | head -n 1 | cut -d' ' -f2) || true
36
36
  fi
@@ -9,12 +9,12 @@ set -u
9
9
  hook_has_parser || exit 0
10
10
  hook_input
11
11
  CWD=$(hook_get cwd)
12
- [ -z "$CWD" ] || cd "$CWD" 2>/dev/null || true
12
+ [[ -z "$CWD" ]] || cd "$CWD" 2>/dev/null || true
13
13
 
14
14
  # Variables sûres de .env.local, au format `export NAME=valeur`. Valeurs limitées à
15
15
  # [A-Za-z0-9_.:/-] : CLAUDE_ENV_FILE est sourcé par le shell, pas de métacaractères.
16
16
  # DATABASE_URL est exclue (identifiants possibles) ; commentaires et lignes vides ignorés.
17
- if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -f .env.local ]; then
17
+ if [[ -n "${CLAUDE_ENV_FILE:-}" ]] && [[ -f .env.local ]]; then
18
18
  sed -n -E 's#^(NODE_ENV|APP_ENV|APP_DEBUG|DATABASE_HOST|DATABASE_PORT|LOG_LEVEL|PORT|HOST)=([A-Za-z0-9_.:/-]*)$#export \1=\2#p' \
19
19
  .env.local >>"$CLAUDE_ENV_FILE" 2>/dev/null
20
20
  fi
@@ -29,18 +29,18 @@ json_field() {
29
29
  }
30
30
 
31
31
  CONTEXT=""
32
- add() { [ -z "$2" ] || CONTEXT="$CONTEXT$1 $2, "; }
32
+ add() { [[ -z "$2" ]] || CONTEXT="$CONTEXT$1 $2, "; }
33
33
 
34
- if [ -f composer.json ]; then
34
+ if [[ -f composer.json ]]; then
35
35
  add Symfony "$(json_field composer.json 'require.symfony/framework-bundle')"
36
36
  add PHP "$(json_field composer.json require.php)"
37
37
  fi
38
- if [ -f package.json ]; then
38
+ if [[ -f package.json ]]; then
39
39
  add React "$(json_field package.json dependencies.react)"
40
40
  add Next.js "$(json_field package.json dependencies.next)"
41
41
  fi
42
- [ ! -f pubspec.yaml ] || CONTEXT="${CONTEXT}Flutter/Dart, "
43
- [ ! -f pyproject.toml ] || CONTEXT="${CONTEXT}Python, "
42
+ [[ ! -f pubspec.yaml ]] || CONTEXT="${CONTEXT}Flutter/Dart, "
43
+ [[ ! -f pyproject.toml ]] || CONTEXT="${CONTEXT}Python, "
44
44
 
45
45
  # Services déclarés dans les fichiers Compose (noms canoniques et historiques).
46
46
  COMPOSE=$(cat compose.yaml compose.yml docker-compose.yaml docker-compose.yml 2>/dev/null)
@@ -49,5 +49,5 @@ for svc in postgres:PostgreSQL mysql:MySQL redis:Redis; do
49
49
  done
50
50
 
51
51
  CONTEXT=${CONTEXT%, }
52
- [ -z "$CONTEXT" ] || hook_context SessionStart "Project stack: $CONTEXT"
52
+ [[ -z "$CONTEXT" ]] || hook_context SessionStart "Project stack: $CONTEXT"
53
53
  exit 0
@@ -248,7 +248,7 @@ Punkte |
248
248
  2. `metadata`: `sprint_id` (`sprint-{N}`), `name`, `start_date`, `end_date`, `goal`, `capacity_points`, aus `sprint-goal.md` übernommen.
249
249
  3. `stories`: ein Eintrag pro ausgewählter US: `title`, `status: ready-for-dev`, `story_points`, `epic_id`, `priority` (MoSCoW), `dependencies`, `tasks`, `history: []`.
250
250
  4. Datei für **dieselbe** `sprint_id` bereits vorhanden: bestehende Status beibehalten (eine Story nie zurücksetzen) und nur neue US ergänzen.
251
- 5. Datei für einen **anderen** Sprint vorhanden: zuerst deren Stories nach `archived_sprints.<alte sprint_id>` (`status`, `points`) verschieben, dann den neuen Sprint schreiben.
251
+ 5. Datei für einen **anderen** Sprint vorhanden: zuerst nur die **abgeschlossenen (`done`) Stories dieses vorherigen Sprints** nach `archived_sprints.<alte sprint_id>` (`status`, `points`) verschieben — nie die von `/workflow:plan` erfassten Backlog-Stories —, dann den neuen Sprint schreiben. Nicht abgeschlossene Stories bleiben in `stories` (mit aktualisierter `sprint_id`, falls dieser Schlüssel verwendet wird).
252
252
 
253
253
  ```yaml
254
254
  # .bmad/sprint-status.yaml
@@ -248,7 +248,7 @@ Points |
248
248
  2. `metadata`: `sprint_id` (`sprint-{N}`), `name`, `start_date`, `end_date`, `goal`, `capacity_points`, taken from `sprint-goal.md`.
249
249
  3. `stories`: one entry per selected US: `title`, `status: ready-for-dev`, `story_points`, `epic_id`, `priority` (MoSCoW), `dependencies`, `tasks`, `history: []`.
250
250
  4. File already present for the **same** `sprint_id`: keep the existing statuses (never move a story back) and only add the new US.
251
- 5. File present for **another** sprint: first move its stories under `archived_sprints.<old sprint_id>` (`status`, `points`), then write the new sprint.
251
+ 5. File present for **another** sprint: first move under `archived_sprints.<old sprint_id>` (`status`, `points`) only the **finished (`done`) stories of that previous sprint** — never the backlog stories recorded by `/workflow:plan` — then write the new sprint. Unfinished stories stay in `stories` (with `sprint_id` updated if that key is used).
252
252
 
253
253
  ```yaml
254
254
  # .bmad/sprint-status.yaml
@@ -248,7 +248,7 @@ Puntos |
248
248
  2. `metadata`: `sprint_id` (`sprint-{N}`), `name`, `start_date`, `end_date`, `goal`, `capacity_points`, tomados de `sprint-goal.md`.
249
249
  3. `stories`: una entrada por US seleccionada: `title`, `status: ready-for-dev`, `story_points`, `epic_id`, `priority` (MoSCoW), `dependencies`, `tasks`, `history: []`.
250
250
  4. Archivo ya presente para el **mismo** `sprint_id`: conservar los estados existentes (nunca hacer retroceder una story) y añadir solo las nuevas US.
251
- 5. Archivo presente para **otro** sprint: mover primero sus stories a `archived_sprints.<sprint_id anterior>` (`status`, `points`) y luego escribir el nuevo sprint.
251
+ 5. Archivo presente para **otro** sprint: mover primero a `archived_sprints.<sprint_id anterior>` (`status`, `points`) únicamente las stories **terminadas (`done`) de ese sprint anterior** —nunca las stories de backlog registradas por `/workflow:plan`— y luego escribir el nuevo sprint. Las stories no terminadas permanecen en `stories` (con `sprint_id` actualizado si se usa esa clave).
252
252
 
253
253
  ```yaml
254
254
  # .bmad/sprint-status.yaml
@@ -248,7 +248,7 @@ Points |
248
248
  2. `metadata` : `sprint_id` (`sprint-{N}`), `name`, `start_date`, `end_date`, `goal`, `capacity_points`, repris de `sprint-goal.md`.
249
249
  3. `stories` : une entrée par US sélectionnée : `title`, `status: ready-for-dev`, `story_points`, `epic_id`, `priority` (MoSCoW), `dependencies`, `tasks`, `history: []`.
250
250
  4. Fichier déjà présent pour le **même** `sprint_id` : conserver les statuts existants (ne jamais faire reculer une story) et n'ajouter que les nouvelles US.
251
- 5. Fichier présent pour un **autre** sprint : déplacer d'abord ses stories sous `archived_sprints.<ancien sprint_id>` (`status`, `points`), puis écrire le nouveau sprint.
251
+ 5. Fichier présent pour un **autre** sprint : déplacer d'abord sous `archived_sprints.<ancien sprint_id>` (`status`, `points`) uniquement les stories **terminées (`done`) de ce sprint précédent** — jamais les stories de backlog enregistrées par `/workflow:plan` —, puis écrire le nouveau sprint. Les stories non terminées restent dans `stories` (avec `sprint_id` mis à jour si cette clé est utilisée).
252
252
 
253
253
  ```yaml
254
254
  # .bmad/sprint-status.yaml
@@ -248,7 +248,7 @@ Pontos |
248
248
  2. `metadata`: `sprint_id` (`sprint-{N}`), `name`, `start_date`, `end_date`, `goal`, `capacity_points`, retirados de `sprint-goal.md`.
249
249
  3. `stories`: uma entrada por US selecionada: `title`, `status: ready-for-dev`, `story_points`, `epic_id`, `priority` (MoSCoW), `dependencies`, `tasks`, `history: []`.
250
250
  4. Arquivo já presente para o **mesmo** `sprint_id`: manter os status existentes (nunca fazer uma story retroceder) e adicionar apenas as novas US.
251
- 5. Arquivo presente para **outro** sprint: mover primeiro as suas stories para `archived_sprints.<sprint_id anterior>` (`status`, `points`) e depois escrever o novo sprint.
251
+ 5. Arquivo presente para **outro** sprint: mover primeiro para `archived_sprints.<sprint_id anterior>` (`status`, `points`) apenas as stories **concluídas (`done`) desse sprint anterior** — nunca as stories de backlog registradas por `/workflow:plan` — e depois escrever o novo sprint. As stories não concluídas permanecem em `stories` (com `sprint_id` atualizado se essa chave for usada).
252
252
 
253
253
  ```yaml
254
254
  # .bmad/sprint-status.yaml