cc-devflow 4.1.4 → 4.1.6
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/.claude/CLAUDE.md +87 -1183
- package/.claude/commands/core/architecture.md +2 -2
- package/.claude/commands/core/guidelines.md +2 -2
- package/.claude/commands/core/roadmap.md +4 -4
- package/.claude/commands/core/style.md +40 -268
- package/.claude/commands/flow/CLAUDE.md +28 -0
- package/.claude/commands/flow/archive.md +2 -2
- package/.claude/commands/flow/checklist.md +9 -251
- package/.claude/commands/flow/clarify.md +9 -127
- package/.claude/commands/flow/constitution.md +1 -1
- package/.claude/commands/flow/context.md +1 -1
- package/.claude/commands/flow/dev.md +19 -395
- package/.claude/commands/flow/fix.md +1 -6
- package/.claude/commands/flow/ideate.md +13 -13
- package/.claude/commands/flow/init.md +19 -41
- package/.claude/commands/flow/new.md +12 -268
- package/.claude/commands/flow/quality.md +10 -153
- package/.claude/commands/flow/release.md +18 -131
- package/.claude/commands/flow/restart.md +15 -16
- package/.claude/commands/flow/spec.md +14 -164
- package/.claude/commands/flow/status.md +12 -12
- package/.claude/commands/flow/update.md +4 -4
- package/.claude/commands/flow/upgrade.md +6 -6
- package/.claude/commands/flow/verify.md +19 -78
- package/.claude/commands/flow/workspace.md +3 -20
- package/.claude/docs/guides/INIT_TROUBLESHOOTING.md +7 -7
- package/.claude/docs/guides/NEW_TROUBLESHOOTING.md +44 -96
- package/.claude/docs/guides/ROADMAP_TROUBLESHOOTING.md +1 -1
- package/.claude/docs/guides/TASK_COMPLETION_MARKING.md +5 -5
- package/.claude/docs/guides/TEAM_MODE_GUIDE.md +0 -1
- package/.claude/docs/templates/ATTEMPT_TEMPLATE.md +1 -1
- package/.claude/docs/templates/BACKLOG_TEMPLATE.md +3 -3
- package/.claude/docs/templates/CLARIFICATION_REPORT_TEMPLATE.md +5 -5
- package/.claude/docs/templates/ERROR_LOG_TEMPLATE.md +2 -2
- package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +3 -3
- package/.claude/docs/templates/NEW_ORCHESTRATION_TEMPLATE.md +33 -64
- package/.claude/docs/templates/RESEARCH_TEMPLATE.md +3 -3
- package/.claude/docs/templates/ROADMAP_DIALOGUE_TEMPLATE.md +2 -2
- package/.claude/docs/templates/ROADMAP_TEMPLATE.md +2 -2
- package/.claude/docs/templates/STYLE_TEMPLATE.md +3 -3
- package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +8 -9
- package/.claude/guides/workflow-guides/flow-orchestrator.md +31 -265
- package/.claude/hooks/CLAUDE.md +1 -1
- package/.claude/hooks/checklist-gate.js +4 -4
- package/.claude/hooks/inject-agent-context.ts +2 -2
- package/.claude/hooks/teammate-idle-hook.ts +1 -1
- package/.claude/rules/devflow-conventions.md +2 -93
- package/.claude/scripts/CLAUDE.md +1 -4
- package/.claude/scripts/calculate-checklist-completion.sh +2 -2
- package/.claude/scripts/check-prerequisites.sh +2 -2
- package/.claude/scripts/checklist-errors.sh +4 -4
- package/.claude/scripts/common.sh +12 -147
- package/.claude/scripts/flow-quality-full.sh +5 -5
- package/.claude/scripts/flow-quality-quick.sh +4 -4
- package/.claude/scripts/flow-workspace-init.sh +2 -2
- package/.claude/scripts/generate-clarification-report.sh +4 -4
- package/.claude/scripts/recover-workflow.sh +70 -73
- package/.claude/scripts/run-quality-gates.sh +1 -1
- package/.claude/scripts/setup-epic.sh +2 -2
- package/.claude/scripts/setup-ralph-loop.sh +2 -2
- package/.claude/scripts/validate-research.sh +1 -1
- package/.claude/scripts/verify-setup.sh +1 -1
- package/.claude/skills/cc-devflow-orchestrator/SKILL.md +88 -108
- package/.claude/skills/workflow/CLAUDE.md +24 -0
- package/.claude/skills/workflow/flow-dev/CLAUDE.md +14 -76
- package/.claude/skills/workflow/flow-dev/SKILL.md +29 -67
- package/.claude/skills/workflow/flow-dev/context.jsonl +4 -8
- package/.claude/skills/workflow/flow-init/SKILL.md +23 -186
- package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +1 -1
- package/.claude/skills/workflow/flow-init/context.jsonl +3 -3
- package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +1 -1
- package/.claude/skills/workflow/flow-init/scripts/create-requirement.sh +15 -134
- package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +1 -1
- package/.claude/skills/workflow/flow-release/SKILL.md +20 -110
- package/.claude/skills/workflow/flow-release/context.jsonl +5 -7
- package/.claude/skills/workflow/flow-spec/CLAUDE.md +15 -101
- package/.claude/skills/workflow/flow-spec/SKILL.md +15 -518
- package/.claude/skills/workflow/flow-spec/context.jsonl +5 -7
- package/.claude/skills/workflow/flow-verify/CLAUDE.md +10 -0
- package/.claude/skills/workflow/flow-verify/SKILL.md +53 -0
- package/.claude/skills/workflow/flow-verify/context.jsonl +5 -0
- package/.claude/skills/workflow.yaml +72 -270
- package/CHANGELOG.md +72 -0
- package/README.md +91 -69
- package/README.zh-CN.md +90 -67
- package/bin/harness.js +22 -0
- package/docs/commands/README.md +34 -38
- package/docs/commands/README.zh-CN.md +34 -36
- package/docs/commands/core-roadmap.md +2 -2
- package/docs/commands/core-roadmap.zh-CN.md +2 -2
- package/docs/commands/core-style.md +29 -381
- package/docs/commands/core-style.zh-CN.md +29 -381
- package/docs/commands/flow-init.md +10 -10
- package/docs/commands/flow-init.zh-CN.md +11 -11
- package/docs/commands/flow-new.md +25 -260
- package/docs/commands/flow-new.zh-CN.md +26 -257
- package/docs/guides/getting-started.md +16 -15
- package/docs/guides/getting-started.zh-CN.md +10 -12
- package/lib/compiler/__tests__/manifest.test.js +156 -0
- package/lib/compiler/__tests__/parser.test.js +21 -0
- package/lib/compiler/index.js +17 -1
- package/lib/compiler/manifest.js +68 -6
- package/lib/compiler/parser.js +5 -0
- package/lib/harness/CLAUDE.md +21 -0
- package/lib/harness/cli.js +208 -0
- package/lib/harness/index.js +16 -0
- package/lib/harness/operations/dispatch.js +285 -0
- package/lib/harness/operations/init.js +48 -0
- package/lib/harness/operations/janitor.js +74 -0
- package/lib/harness/operations/pack.js +100 -0
- package/lib/harness/operations/plan.js +29 -0
- package/lib/harness/operations/release.js +83 -0
- package/lib/harness/operations/resume.js +44 -0
- package/lib/harness/operations/verify.js +163 -0
- package/lib/harness/planner.js +141 -0
- package/lib/harness/schemas.js +108 -0
- package/lib/harness/store.js +240 -0
- package/package.json +9 -1
- package/.claude/scripts/flow-workspace-start.sh +0 -217
- package/.claude/scripts/flow-workspace-switch.sh +0 -234
- package/.claude/skills/domain/using-git-worktrees/SKILL.md +0 -252
- package/.claude/skills/domain/using-git-worktrees/assets/SHELL_ALIASES.md +0 -133
- package/.claude/skills/domain/using-git-worktrees/context.jsonl +0 -4
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-cleanup.sh +0 -218
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-create.sh +0 -232
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-list.sh +0 -130
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-status.sh +0 -140
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-switch.sh +0 -70
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# =============================================================================
|
|
3
|
-
# worktree-list.sh - List all git worktrees
|
|
4
|
-
# =============================================================================
|
|
5
|
-
#
|
|
6
|
-
# Usage: worktree-list.sh [OPTIONS]
|
|
7
|
-
#
|
|
8
|
-
# OPTIONS:
|
|
9
|
-
# --json Output in JSON format
|
|
10
|
-
# --verbose, -v Show detailed information
|
|
11
|
-
# --help, -h Show help message
|
|
12
|
-
#
|
|
13
|
-
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
14
|
-
|
|
15
|
-
set -e
|
|
16
|
-
|
|
17
|
-
JSON_MODE=false
|
|
18
|
-
VERBOSE=false
|
|
19
|
-
|
|
20
|
-
while [[ $# -gt 0 ]]; do
|
|
21
|
-
case "$1" in
|
|
22
|
-
--json)
|
|
23
|
-
JSON_MODE=true
|
|
24
|
-
shift
|
|
25
|
-
;;
|
|
26
|
-
--verbose|-v)
|
|
27
|
-
VERBOSE=true
|
|
28
|
-
shift
|
|
29
|
-
;;
|
|
30
|
-
--help|-h)
|
|
31
|
-
cat << 'EOF'
|
|
32
|
-
Usage: worktree-list.sh [OPTIONS]
|
|
33
|
-
|
|
34
|
-
List all git worktrees.
|
|
35
|
-
|
|
36
|
-
OPTIONS:
|
|
37
|
-
--json Output in JSON format
|
|
38
|
-
--verbose, -v Show detailed information
|
|
39
|
-
--help, -h Show help message
|
|
40
|
-
EOF
|
|
41
|
-
exit 0
|
|
42
|
-
;;
|
|
43
|
-
*)
|
|
44
|
-
echo "ERROR: Unknown option '$1'. Use --help for usage." >&2
|
|
45
|
-
exit 1
|
|
46
|
-
;;
|
|
47
|
-
esac
|
|
48
|
-
done
|
|
49
|
-
|
|
50
|
-
# =============================================================================
|
|
51
|
-
# Source Common Functions
|
|
52
|
-
# =============================================================================
|
|
53
|
-
|
|
54
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
55
|
-
COMMON_SH="$SCRIPT_DIR/../../../scripts/common.sh"
|
|
56
|
-
|
|
57
|
-
if [[ -f "$COMMON_SH" ]]; then
|
|
58
|
-
source "$COMMON_SH"
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
# =============================================================================
|
|
62
|
-
# Get Main Repo
|
|
63
|
-
# =============================================================================
|
|
64
|
-
|
|
65
|
-
MAIN_REPO=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
66
|
-
if [[ -z "$MAIN_REPO" ]]; then
|
|
67
|
-
echo "ERROR: Not in a git repository" >&2
|
|
68
|
-
exit 1
|
|
69
|
-
fi
|
|
70
|
-
|
|
71
|
-
# =============================================================================
|
|
72
|
-
# List Worktrees
|
|
73
|
-
# =============================================================================
|
|
74
|
-
|
|
75
|
-
if $JSON_MODE; then
|
|
76
|
-
echo "["
|
|
77
|
-
first=true
|
|
78
|
-
while IFS= read -r line; do
|
|
79
|
-
if [[ "$line" =~ ^worktree ]]; then
|
|
80
|
-
if ! $first; then
|
|
81
|
-
echo ","
|
|
82
|
-
fi
|
|
83
|
-
first=false
|
|
84
|
-
path="${line#worktree }"
|
|
85
|
-
elif [[ "$line" =~ ^HEAD ]]; then
|
|
86
|
-
head="${line#HEAD }"
|
|
87
|
-
elif [[ "$line" =~ ^branch ]]; then
|
|
88
|
-
branch="${line#branch refs/heads/}"
|
|
89
|
-
# Extract REQ_ID from path
|
|
90
|
-
req_id=""
|
|
91
|
-
if [[ "$path" =~ -([A-Z]+-[0-9]+)$ ]]; then
|
|
92
|
-
req_id="${BASH_REMATCH[1]}"
|
|
93
|
-
fi
|
|
94
|
-
printf '{"path":"%s","branch":"%s","head":"%s","req_id":"%s"}' \
|
|
95
|
-
"$path" "$branch" "$head" "$req_id"
|
|
96
|
-
elif [[ "$line" =~ ^detached ]]; then
|
|
97
|
-
branch="(detached)"
|
|
98
|
-
req_id=""
|
|
99
|
-
if [[ "$path" =~ -([A-Z]+-[0-9]+)$ ]]; then
|
|
100
|
-
req_id="${BASH_REMATCH[1]}"
|
|
101
|
-
fi
|
|
102
|
-
printf '{"path":"%s","branch":"%s","head":"%s","req_id":"%s"}' \
|
|
103
|
-
"$path" "$branch" "$head" "$req_id"
|
|
104
|
-
fi
|
|
105
|
-
done < <(git worktree list --porcelain)
|
|
106
|
-
echo ""
|
|
107
|
-
echo "]"
|
|
108
|
-
else
|
|
109
|
-
echo "Git Worktrees:"
|
|
110
|
-
echo ""
|
|
111
|
-
|
|
112
|
-
if $VERBOSE; then
|
|
113
|
-
git worktree list --porcelain | while IFS= read -r line; do
|
|
114
|
-
if [[ "$line" =~ ^worktree ]]; then
|
|
115
|
-
path="${line#worktree }"
|
|
116
|
-
echo "Path: $path"
|
|
117
|
-
elif [[ "$line" =~ ^HEAD ]]; then
|
|
118
|
-
echo "HEAD: ${line#HEAD }"
|
|
119
|
-
elif [[ "$line" =~ ^branch ]]; then
|
|
120
|
-
echo "Branch: ${line#branch refs/heads/}"
|
|
121
|
-
echo ""
|
|
122
|
-
elif [[ "$line" =~ ^detached ]]; then
|
|
123
|
-
echo "Branch: (detached)"
|
|
124
|
-
echo ""
|
|
125
|
-
fi
|
|
126
|
-
done
|
|
127
|
-
else
|
|
128
|
-
git worktree list
|
|
129
|
-
fi
|
|
130
|
-
fi
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# =============================================================================
|
|
3
|
-
# worktree-status.sh - Check current worktree status
|
|
4
|
-
# =============================================================================
|
|
5
|
-
#
|
|
6
|
-
# Usage: worktree-status.sh [OPTIONS]
|
|
7
|
-
#
|
|
8
|
-
# OPTIONS:
|
|
9
|
-
# --json Output in JSON format
|
|
10
|
-
# --help, -h Show help message
|
|
11
|
-
#
|
|
12
|
-
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
13
|
-
|
|
14
|
-
set -e
|
|
15
|
-
|
|
16
|
-
JSON_MODE=false
|
|
17
|
-
|
|
18
|
-
while [[ $# -gt 0 ]]; do
|
|
19
|
-
case "$1" in
|
|
20
|
-
--json)
|
|
21
|
-
JSON_MODE=true
|
|
22
|
-
shift
|
|
23
|
-
;;
|
|
24
|
-
--help|-h)
|
|
25
|
-
cat << 'EOF'
|
|
26
|
-
Usage: worktree-status.sh [OPTIONS]
|
|
27
|
-
|
|
28
|
-
Check current worktree status.
|
|
29
|
-
|
|
30
|
-
OPTIONS:
|
|
31
|
-
--json Output in JSON format
|
|
32
|
-
--help, -h Show help message
|
|
33
|
-
EOF
|
|
34
|
-
exit 0
|
|
35
|
-
;;
|
|
36
|
-
*)
|
|
37
|
-
echo "ERROR: Unknown option '$1'. Use --help for usage." >&2
|
|
38
|
-
exit 1
|
|
39
|
-
;;
|
|
40
|
-
esac
|
|
41
|
-
done
|
|
42
|
-
|
|
43
|
-
# =============================================================================
|
|
44
|
-
# Source Common Functions
|
|
45
|
-
# =============================================================================
|
|
46
|
-
|
|
47
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
48
|
-
COMMON_SH="$SCRIPT_DIR/../../../scripts/common.sh"
|
|
49
|
-
|
|
50
|
-
if [[ -f "$COMMON_SH" ]]; then
|
|
51
|
-
source "$COMMON_SH"
|
|
52
|
-
fi
|
|
53
|
-
|
|
54
|
-
# =============================================================================
|
|
55
|
-
# Gather Information
|
|
56
|
-
# =============================================================================
|
|
57
|
-
|
|
58
|
-
CURRENT_DIR=$(pwd)
|
|
59
|
-
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "")
|
|
60
|
-
|
|
61
|
-
if [[ -z "$GIT_ROOT" ]]; then
|
|
62
|
-
if $JSON_MODE; then
|
|
63
|
-
printf '{"error":"not_git_repo"}\n'
|
|
64
|
-
else
|
|
65
|
-
echo "ERROR: Not in a git repository" >&2
|
|
66
|
-
fi
|
|
67
|
-
exit 1
|
|
68
|
-
fi
|
|
69
|
-
|
|
70
|
-
# Check if in worktree
|
|
71
|
-
IS_WORKTREE=false
|
|
72
|
-
MAIN_REPO=""
|
|
73
|
-
WORKTREE_COUNT=0
|
|
74
|
-
|
|
75
|
-
# Get worktree info
|
|
76
|
-
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
|
|
77
|
-
if [[ "$GIT_DIR" == *".git/worktrees/"* ]]; then
|
|
78
|
-
IS_WORKTREE=true
|
|
79
|
-
# Extract main repo path from gitdir file
|
|
80
|
-
MAIN_REPO=$(cat "$GIT_ROOT/.git" 2>/dev/null | sed 's/gitdir: //' | sed 's|/.git/worktrees/.*||')
|
|
81
|
-
else
|
|
82
|
-
MAIN_REPO="$GIT_ROOT"
|
|
83
|
-
fi
|
|
84
|
-
|
|
85
|
-
# Count worktrees
|
|
86
|
-
WORKTREE_COUNT=$(git worktree list | wc -l | tr -d ' ')
|
|
87
|
-
|
|
88
|
-
# Get current branch
|
|
89
|
-
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
|
|
90
|
-
|
|
91
|
-
# Extract REQ_ID from path or branch
|
|
92
|
-
REQ_ID=""
|
|
93
|
-
if [[ "$GIT_ROOT" =~ -([A-Z]+-[0-9]+)$ ]]; then
|
|
94
|
-
REQ_ID="${BASH_REMATCH[1]}"
|
|
95
|
-
elif [[ "$BRANCH" =~ (REQ-[0-9]+|BUG-[0-9]+) ]]; then
|
|
96
|
-
REQ_ID="${BASH_REMATCH[1]}"
|
|
97
|
-
fi
|
|
98
|
-
|
|
99
|
-
# Check git status
|
|
100
|
-
HAS_CHANGES=false
|
|
101
|
-
if [[ -n $(git status --porcelain 2>/dev/null) ]]; then
|
|
102
|
-
HAS_CHANGES=true
|
|
103
|
-
fi
|
|
104
|
-
|
|
105
|
-
# =============================================================================
|
|
106
|
-
# Output
|
|
107
|
-
# =============================================================================
|
|
108
|
-
|
|
109
|
-
if $JSON_MODE; then
|
|
110
|
-
printf '{"current_dir":"%s","git_root":"%s","is_worktree":%s,"main_repo":"%s","branch":"%s","req_id":"%s","worktree_count":%d,"has_changes":%s}\n' \
|
|
111
|
-
"$CURRENT_DIR" \
|
|
112
|
-
"$GIT_ROOT" \
|
|
113
|
-
"$IS_WORKTREE" \
|
|
114
|
-
"$MAIN_REPO" \
|
|
115
|
-
"$BRANCH" \
|
|
116
|
-
"$REQ_ID" \
|
|
117
|
-
"$WORKTREE_COUNT" \
|
|
118
|
-
"$HAS_CHANGES"
|
|
119
|
-
else
|
|
120
|
-
echo "Worktree Status"
|
|
121
|
-
echo "==============="
|
|
122
|
-
echo ""
|
|
123
|
-
echo "Current Directory: $CURRENT_DIR"
|
|
124
|
-
echo "Git Root: $GIT_ROOT"
|
|
125
|
-
echo "Is Worktree: $IS_WORKTREE"
|
|
126
|
-
echo "Main Repo: $MAIN_REPO"
|
|
127
|
-
echo "Branch: $BRANCH"
|
|
128
|
-
if [[ -n "$REQ_ID" ]]; then
|
|
129
|
-
echo "Requirement ID: $REQ_ID"
|
|
130
|
-
fi
|
|
131
|
-
echo "Total Worktrees: $WORKTREE_COUNT"
|
|
132
|
-
echo "Has Changes: $HAS_CHANGES"
|
|
133
|
-
echo ""
|
|
134
|
-
|
|
135
|
-
if $IS_WORKTREE; then
|
|
136
|
-
echo "You are in a worktree. Main repo is at: $MAIN_REPO"
|
|
137
|
-
else
|
|
138
|
-
echo "You are in the main repository."
|
|
139
|
-
fi
|
|
140
|
-
fi
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# =============================================================================
|
|
3
|
-
# worktree-switch.sh - Switch to a worktree by REQ_ID
|
|
4
|
-
# =============================================================================
|
|
5
|
-
#
|
|
6
|
-
# Usage: worktree-switch.sh REQ_ID
|
|
7
|
-
#
|
|
8
|
-
# This script outputs the path to switch to. Use with:
|
|
9
|
-
# cd $(worktree-switch.sh REQ-123)
|
|
10
|
-
#
|
|
11
|
-
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
12
|
-
|
|
13
|
-
set -e
|
|
14
|
-
|
|
15
|
-
REQ_ID=""
|
|
16
|
-
|
|
17
|
-
while [[ $# -gt 0 ]]; do
|
|
18
|
-
case "$1" in
|
|
19
|
-
--help|-h)
|
|
20
|
-
cat << 'EOF'
|
|
21
|
-
Usage: worktree-switch.sh REQ_ID
|
|
22
|
-
|
|
23
|
-
Switch to a worktree by REQ_ID.
|
|
24
|
-
|
|
25
|
-
This script outputs the path to switch to. Use with:
|
|
26
|
-
cd $(worktree-switch.sh REQ-123)
|
|
27
|
-
|
|
28
|
-
Or use the zw shell function:
|
|
29
|
-
zw REQ-123
|
|
30
|
-
EOF
|
|
31
|
-
exit 0
|
|
32
|
-
;;
|
|
33
|
-
-*)
|
|
34
|
-
echo "ERROR: Unknown option '$1'. Use --help for usage." >&2
|
|
35
|
-
exit 1
|
|
36
|
-
;;
|
|
37
|
-
*)
|
|
38
|
-
REQ_ID="$1"
|
|
39
|
-
shift
|
|
40
|
-
;;
|
|
41
|
-
esac
|
|
42
|
-
done
|
|
43
|
-
|
|
44
|
-
if [[ -z "$REQ_ID" ]]; then
|
|
45
|
-
echo "ERROR: REQ_ID is required. Use --help for usage." >&2
|
|
46
|
-
exit 1
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
# Normalize to uppercase
|
|
50
|
-
REQ_ID=$(echo "$REQ_ID" | tr '[:lower:]' '[:upper:]')
|
|
51
|
-
|
|
52
|
-
# =============================================================================
|
|
53
|
-
# Find Worktree
|
|
54
|
-
# =============================================================================
|
|
55
|
-
|
|
56
|
-
MAIN_REPO=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
57
|
-
if [[ -z "$MAIN_REPO" ]]; then
|
|
58
|
-
echo "ERROR: Not in a git repository" >&2
|
|
59
|
-
exit 1
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
REPO_NAME=$(basename "$MAIN_REPO")
|
|
63
|
-
WORKTREE_DIR="$(dirname "$MAIN_REPO")/${REPO_NAME}-${REQ_ID}"
|
|
64
|
-
|
|
65
|
-
if [[ -d "$WORKTREE_DIR" ]]; then
|
|
66
|
-
echo "$WORKTREE_DIR"
|
|
67
|
-
else
|
|
68
|
-
echo "ERROR: Worktree not found: $WORKTREE_DIR" >&2
|
|
69
|
-
exit 1
|
|
70
|
-
fi
|