@atlashub/smartstack-cli 2.9.0 → 3.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.
Files changed (90) hide show
  1. package/.documentation/agents.html +1 -371
  2. package/.documentation/business-analyse.html +81 -17
  3. package/.documentation/cli-commands.html +1 -1
  4. package/.documentation/commands.html +1 -1
  5. package/.documentation/efcore.html +1 -1
  6. package/.documentation/gitflow.html +1 -1
  7. package/.documentation/hooks.html +27 -66
  8. package/.documentation/index.html +166 -166
  9. package/.documentation/init.html +6 -7
  10. package/.documentation/installation.html +1 -1
  11. package/.documentation/ralph-loop.html +1 -9
  12. package/.documentation/test-web.html +15 -39
  13. package/dist/index.js +23 -16
  14. package/dist/index.js.map +1 -1
  15. package/dist/mcp-entry.mjs +1302 -223
  16. package/dist/mcp-entry.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/templates/agents/efcore/db-deploy.md +1 -1
  19. package/templates/agents/efcore/migration.md +26 -10
  20. package/templates/agents/efcore/rebase-snapshot.md +24 -7
  21. package/templates/agents/efcore/squash.md +73 -57
  22. package/templates/agents/gitflow/commit.md +138 -18
  23. package/templates/agents/gitflow/exec.md +1 -1
  24. package/templates/agents/gitflow/finish.md +79 -62
  25. package/templates/agents/gitflow/init-clone.md +186 -0
  26. package/templates/agents/gitflow/init-detect.md +137 -0
  27. package/templates/agents/gitflow/init-validate.md +210 -0
  28. package/templates/agents/gitflow/init.md +231 -74
  29. package/templates/agents/gitflow/merge.md +115 -33
  30. package/templates/agents/gitflow/pr.md +151 -46
  31. package/templates/agents/gitflow/start.md +76 -33
  32. package/templates/agents/gitflow/status.md +41 -71
  33. package/templates/hooks/appsettings-guard.sh +76 -0
  34. package/templates/hooks/ef-migration-check.md +1 -1
  35. package/templates/hooks/hooks.json +9 -0
  36. package/templates/project/appsettings.json.template +8 -2
  37. package/templates/project/test-frontend/msw/handlers.ts +58 -0
  38. package/templates/project/test-frontend/msw/server.ts +25 -0
  39. package/templates/project/test-frontend/setup.ts +16 -0
  40. package/templates/project/test-frontend/test-utils.tsx +59 -0
  41. package/templates/project/test-frontend/vitest.config.ts +31 -0
  42. package/templates/skills/_resources/config-safety.md +61 -0
  43. package/templates/skills/_resources/formatting-guide.md +2 -2
  44. package/templates/skills/application/SKILL.md +12 -3
  45. package/templates/skills/application/steps/step-04-backend.md +21 -0
  46. package/templates/skills/application/steps/step-07-tests.md +259 -120
  47. package/templates/skills/business-analyse/SKILL.md +57 -28
  48. package/templates/skills/business-analyse/_shared.md +70 -39
  49. package/templates/skills/business-analyse/html/ba-interactive.html +2596 -0
  50. package/templates/skills/business-analyse/questionnaire/00-application.md +123 -131
  51. package/templates/skills/business-analyse/questionnaire/01-context.md +173 -24
  52. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +170 -50
  53. package/templates/skills/business-analyse/questionnaire/03-scope.md +154 -48
  54. package/templates/skills/business-analyse/questionnaire/10-documentation.md +1 -1
  55. package/templates/skills/business-analyse/questionnaire/14-risk-assumptions.md +135 -0
  56. package/templates/skills/business-analyse/questionnaire/15-success-metrics.md +136 -0
  57. package/templates/skills/business-analyse/questionnaire.md +55 -46
  58. package/templates/skills/business-analyse/steps/step-00-init.md +24 -2
  59. package/templates/skills/business-analyse/steps/step-01-cadrage.md +31 -20
  60. package/templates/skills/business-analyse/steps/step-03-specify.md +58 -0
  61. package/templates/skills/business-analyse/steps/step-05-handoff.md +301 -1
  62. package/templates/skills/business-analyse/steps/step-06-extract.md +518 -0
  63. package/templates/skills/check-version/SKILL.md +1 -1
  64. package/templates/skills/efcore/steps/db/step-deploy.md +22 -3
  65. package/templates/skills/efcore/steps/db/step-reset.md +27 -4
  66. package/templates/skills/efcore/steps/db/step-seed.md +46 -2
  67. package/templates/skills/efcore/steps/db/step-status.md +14 -0
  68. package/templates/skills/efcore/steps/migration/step-01-check.md +31 -5
  69. package/templates/skills/efcore/steps/migration/step-02-create.md +20 -4
  70. package/templates/skills/efcore/steps/rebase-snapshot/step-03-create.md +60 -0
  71. package/templates/skills/efcore/steps/shared/step-00-init.md +47 -8
  72. package/templates/skills/efcore/steps/squash/step-03-create.md +27 -5
  73. package/templates/skills/gitflow/SKILL.md +91 -29
  74. package/templates/skills/gitflow/_shared.md +144 -2
  75. package/templates/skills/gitflow/phases/status.md +11 -1
  76. package/templates/skills/gitflow/steps/step-commit.md +1 -1
  77. package/templates/skills/gitflow/steps/step-init.md +202 -39
  78. package/templates/skills/gitflow/steps/step-pr.md +17 -5
  79. package/templates/skills/gitflow/templates/config.json +10 -1
  80. package/templates/skills/ralph-loop/SKILL.md +22 -15
  81. package/templates/skills/ralph-loop/steps/step-01-task.md +89 -4
  82. package/templates/skills/ralph-loop/steps/step-02-execute.md +408 -23
  83. package/templates/skills/ralph-loop/steps/step-03-commit.md +84 -2
  84. package/templates/skills/ralph-loop/steps/step-04-check.md +235 -6
  85. package/templates/skills/ralph-loop/steps/step-05-report.md +115 -0
  86. package/templates/skills/validate-feature/SKILL.md +83 -0
  87. package/templates/skills/validate-feature/steps/step-01-compile.md +38 -0
  88. package/templates/skills/validate-feature/steps/step-02-unit-tests.md +45 -0
  89. package/templates/skills/validate-feature/steps/step-03-integration-tests.md +53 -0
  90. package/templates/skills/validate-feature/steps/step-04-api-smoke.md +157 -0
@@ -1,106 +1,123 @@
1
1
  ---
2
2
  name: gitflow-finish
3
- description: GitFlow finish - finalize branch with tag and cleanup (OPTIMISE)
3
+ description: GitFlow finish - finalize branch with tag and cleanup
4
4
  color: magenta
5
5
  model: sonnet
6
6
  tools: Bash, Read, Glob, Write
7
7
  ---
8
8
 
9
- # GitFlow Finish Agent (OPTIMISE)
9
+ # GitFlow Finish Agent
10
10
 
11
- Finalisation rapide de branche GitFlow.
11
+ Finalize GitFlow branch: tag, merge-back, worktree cleanup. Supports GitHub and Azure DevOps.
12
12
 
13
- > **OPTIMISATION:** Model haiku (actions predefinies), tools reduits, workflow simplifie.
13
+ ## MODE D'EXECUTION
14
14
 
15
- ## MODE D'EXÉCUTION
15
+ **CRITIQUE:** Execute each command via Bash tool. Display ONLY the final summary.
16
16
 
17
- **CRITIQUE:** Tu dois EXECUTER chaque commande git avec l'outil Bash.
17
+ ## EXECUTION SEQUENCE
18
18
 
19
- - **NE PAS** afficher les commandes a l'utilisateur
20
- - **EXECUTER** directement via l'outil Bash
21
- - **AFFICHER** uniquement le resume final
22
-
23
- ## Workflow
24
-
25
- 1. **Detecter contexte**: Aller au repo principal si dans un worktree
26
- 2. **Verifier PR**: Confirmer que la PR est mergee (via GitHub ou `gh pr list --state merged`)
27
- 3. **Executer selon type**: Feature/Release/Hotfix ont des workflows differents
28
- 4. **Cleanup**: Supprimer branche + worktree
29
- 5. **Resume**: Afficher le resultat final
30
-
31
- ## Detection PR Mergee
19
+ ### 1. Detect Context
32
20
 
33
21
  ```bash
34
- # Verifier si PR mergee
35
- PR_INFO=$(gh pr list --head "$BRANCH" --state merged --json number --jq '.[0]')
36
-
37
- # Si pas trouve, verifier si main a ete mis a jour (merge manuel via GitHub)
38
- if [ -z "$PR_INFO" ]; then
39
- git checkout main && git pull origin main
40
- # Continuer si les commits sont presents
22
+ # Provider detection
23
+ REMOTE_URL=$(git remote get-url origin 2>/dev/null)
24
+ if [[ "$REMOTE_URL" == *"dev.azure.com"* ]]; then
25
+ GIT_PROVIDER="azuredevops"
26
+ else
27
+ GIT_PROVIDER="github"
41
28
  fi
42
- ```
43
29
 
44
- ## Actions par Type
30
+ # Branch detection (argument or current)
31
+ BRANCH=${1:-$(git rev-parse --abbrev-ref HEAD)}
32
+ BRANCH_TYPE=$(echo $BRANCH | cut -d'/' -f1)
45
33
 
46
- | Type | Version | Tag | Merge to | Cleanup |
47
- |------|---------|-----|----------|---------|
48
- | Feature | - | - | develop (via PR) | branche + worktree |
49
- | Release | bump MINOR sur develop | vX.Y.Z | main + develop | branche + worktree |
50
- | Hotfix | AUTO PATCH | vX.Y.Z | main + develop | branche + worktree |
34
+ # Worktree detection: if in a worktree, navigate to main repo
35
+ WORKTREE_PATH=$(git worktree list --porcelain | grep -B2 "branch refs/heads/$BRANCH" | grep "^worktree " | sed 's/^worktree //')
36
+ ```
51
37
 
52
- ### Feature Workflow
38
+ ### 2. Verify PR Merged
53
39
 
54
40
  ```bash
55
- git checkout develop && git pull origin develop
56
- git branch -d feature/xxx
57
- git push origin --delete feature/xxx
58
- git worktree remove ../features/xxx --force
41
+ git fetch origin --quiet
42
+
43
+ case "$BRANCH_TYPE" in
44
+ feature) TARGET="develop" ;;
45
+ release|hotfix) TARGET="main" ;;
46
+ esac
47
+
48
+ # Check if branch commits are in target
49
+ MERGED=$(git branch -r --merged origin/$TARGET | grep "$BRANCH" | wc -l)
50
+ [ "$MERGED" -eq 0 ] && echo "WARNING: Branch not merged to $TARGET"
59
51
  ```
60
52
 
61
- ### Release Workflow
53
+ ### 3. Actions by Type
54
+
55
+ | Type | Tag | Merge back | Version bump |
56
+ |------|-----|------------|--------------|
57
+ | Feature | - | - (via PR) | - |
58
+ | Release | vX.Y.Z | main -> develop | bump MINOR on develop |
59
+ | Hotfix | vX.Y.Z | main -> develop | bump PATCH on develop |
60
+
61
+ ### Release/Hotfix Workflow
62
62
 
63
63
  ```bash
64
+ # 1. Tag on main
64
65
  git checkout main && git pull origin main
65
66
  git tag -a "v$VERSION" -m "Release v$VERSION"
66
67
  git push origin "v$VERSION"
68
+
69
+ # 2. Merge back to develop
67
70
  git checkout develop && git pull origin develop
68
- git merge main --no-ff -m "chore: merge release back to develop"
69
- # Bump MINOR version
70
- npm version X.Y+1.0 --no-git-tag-version
71
- git commit -m "chore: bump develop to vX.Y+1.0"
71
+ git merge main --no-ff -m "Merge v$VERSION back to develop"
72
72
  git push origin develop
73
- # Cleanup
73
+
74
+ # 3. Force-verify push
75
+ git fetch origin develop:refs/remotes/origin/develop --force --quiet
74
76
  ```
75
77
 
76
- ### Hotfix Workflow
78
+ ### 4. Version Bump (Release/Hotfix)
77
79
 
80
+ For npm projects:
78
81
  ```bash
79
- git checkout main && git pull origin main
80
- # Auto-increment PATCH
81
- npm version X.Y.Z+1 --no-git-tag-version
82
- git commit -m "chore: bump version"
83
- git tag -a "v$NEW_VERSION" -m "Hotfix v$NEW_VERSION"
84
- git push origin main "v$NEW_VERSION"
85
- git checkout develop && git merge main --no-ff
82
+ npm version $NEXT_VERSION --no-git-tag-version
83
+ git add package.json package-lock.json
84
+ git commit -m "$(cat <<'EOF'
85
+ chore: bump version to $NEXT_VERSION for development
86
+
87
+ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
88
+ EOF
89
+ )"
86
90
  git push origin develop
87
- # Cleanup
88
91
  ```
89
92
 
90
- ## Output Format
93
+ ### 5. Cleanup Worktree + Branch
91
94
 
92
- A la fin, afficher UNIQUEMENT:
95
+ ```bash
96
+ # Remove worktree (if exists)
97
+ if [ -n "$WORKTREE_PATH" ] && [ -d "$WORKTREE_PATH" ]; then
98
+ git worktree remove "$WORKTREE_PATH" --force
99
+ git worktree prune
100
+ fi
101
+
102
+ # Delete remote branch (may already be deleted by PR)
103
+ git push origin --delete "$BRANCH" 2>/dev/null || true
93
104
 
105
+ # Delete local branch
106
+ git branch -D "$BRANCH" 2>/dev/null || true
94
107
  ```
95
- {TYPE} FINALISÉ ✓
96
- - Branche: {branch}
97
- - Tag: v{version} (ou N/A)
98
- - Merge back: develop ✓ (ou N/A)
99
- - Worktree: nettoyé ✓
100
108
 
101
- Prochain: /gitflow:10-start feature {name}
109
+ ### 6. Summary
110
+
111
+ ```
112
+ {TYPE} FINALIZED
113
+ Branch: {branch}
114
+ Tag: v{version} (or N/A)
115
+ Merge back: develop (or N/A)
116
+ Version: bumped to {next} (or N/A)
117
+ Worktree: cleaned
118
+ NEXT: /gitflow start feature {name}
102
119
  ```
103
120
 
104
121
  ## Priority
105
122
 
106
- Safety > Correctness > Speed. Verification complete avant suppression.
123
+ Safety > Correctness > Speed. Verify merge status before any destructive cleanup.
@@ -0,0 +1,186 @@
1
+ ---
2
+ name: gitflow-init-clone
3
+ description: GitFlow init - robust bare clone with worktree creation and verification
4
+ color: blue
5
+ model: sonnet
6
+ tools: Bash, Read, Write
7
+ ---
8
+
9
+ # GitFlow Init Clone Agent
10
+
11
+ You create the GitFlow directory structure with bare repository and worktrees.
12
+
13
+ **CRITICAL RULE: NEVER use `cd`. Always use absolute paths, `git -C <path>`, or `GIT_DIR=<path>`.**
14
+
15
+ ## INPUT PARAMETERS
16
+
17
+ You receive these from the orchestrator:
18
+ - `{REPO_URL}` - Git remote URL
19
+ - `{PROJECT_BASE}` - Absolute path for project root (already platform-normalized)
20
+ - `{PROJECT_NAME}` - Project display name
21
+ - `{WORKTREE_MODE}` - "organized" or "simple"
22
+ - `{PLATFORM}` - Current platform (wsl/windows/macos/linux)
23
+
24
+ ## EXECUTION SEQUENCE
25
+
26
+ ### 1. Create Directory Structure
27
+
28
+ ```bash
29
+ PROJECT_BASE="{PROJECT_BASE}"
30
+
31
+ # Create all directories in one command
32
+ mkdir -p "$PROJECT_BASE/features" "$PROJECT_BASE/releases" "$PROJECT_BASE/hotfixes"
33
+ ```
34
+
35
+ ### 2. Clone Bare Repository
36
+
37
+ ```bash
38
+ PROJECT_BASE="{PROJECT_BASE}"
39
+
40
+ # Clone as bare repository (absolute path, no cd needed)
41
+ git clone --bare "{REPO_URL}" "$PROJECT_BASE/.bare" 2>&1
42
+
43
+ # Verify clone succeeded
44
+ if [ ! -f "$PROJECT_BASE/.bare/HEAD" ]; then
45
+ echo "FAIL: Bare clone failed - HEAD not found in $PROJECT_BASE/.bare/"
46
+ exit 1
47
+ fi
48
+
49
+ echo "OK: Bare repository cloned"
50
+ ```
51
+
52
+ ### 3. Configure Bare Repository
53
+
54
+ ```bash
55
+ PROJECT_BASE="{PROJECT_BASE}"
56
+
57
+ # Configure bare repo for worktree support (using git -C, no cd)
58
+ git -C "$PROJECT_BASE/.bare" config core.bare false
59
+ git -C "$PROJECT_BASE/.bare" config core.worktree ..
60
+ ```
61
+
62
+ ### 4. Create .git Pseudo-File
63
+
64
+ Use the Write tool to create `{PROJECT_BASE}/.git` with content:
65
+ ```
66
+ gitdir: ./.bare
67
+ ```
68
+
69
+ ### 5. Create Worktrees
70
+
71
+ **Organized mode:**
72
+ ```bash
73
+ PROJECT_BASE="{PROJECT_BASE}"
74
+
75
+ # Create main worktree using GIT_DIR (no cd needed)
76
+ if [ ! -d "$PROJECT_BASE/01-Main" ]; then
77
+ GIT_DIR="$PROJECT_BASE/.bare" git worktree add "$PROJECT_BASE/01-Main" main 2>&1
78
+ fi
79
+
80
+ # Create develop worktree
81
+ if [ ! -d "$PROJECT_BASE/02-Develop" ]; then
82
+ GIT_DIR="$PROJECT_BASE/.bare" git worktree add "$PROJECT_BASE/02-Develop" develop 2>&1
83
+ fi
84
+ ```
85
+
86
+ **Simple mode:**
87
+ ```bash
88
+ PROJECT_BASE="{PROJECT_BASE}"
89
+
90
+ if [ ! -d "$PROJECT_BASE/main" ]; then
91
+ GIT_DIR="$PROJECT_BASE/.bare" git worktree add "$PROJECT_BASE/main" main 2>&1
92
+ fi
93
+
94
+ if [ ! -d "$PROJECT_BASE/develop" ]; then
95
+ GIT_DIR="$PROJECT_BASE/.bare" git worktree add "$PROJECT_BASE/develop" develop 2>&1
96
+ fi
97
+ ```
98
+
99
+ ### 6. Create Config Directory
100
+
101
+ ```bash
102
+ PROJECT_BASE="{PROJECT_BASE}"
103
+ DEVELOP_DIR=$([ "{WORKTREE_MODE}" = "organized" ] && echo "02-Develop" || echo "develop")
104
+
105
+ mkdir -p "$PROJECT_BASE/$DEVELOP_DIR/.claude/gitflow/plans"
106
+ mkdir -p "$PROJECT_BASE/$DEVELOP_DIR/.claude/gitflow/logs"
107
+ mkdir -p "$PROJECT_BASE/$DEVELOP_DIR/.claude/gitflow/cache"
108
+ mkdir -p "$PROJECT_BASE/$DEVELOP_DIR/.claude/gitflow/backup"
109
+ ```
110
+
111
+ ### 7. Verify All Operations
112
+
113
+ ```bash
114
+ PROJECT_BASE="{PROJECT_BASE}"
115
+ DEVELOP_DIR=$([ "{WORKTREE_MODE}" = "organized" ] && echo "02-Develop" || echo "develop")
116
+ MAIN_DIR=$([ "{WORKTREE_MODE}" = "organized" ] && echo "01-Main" || echo "main")
117
+
118
+ ERRORS=0
119
+
120
+ # Verify bare repo
121
+ if [ -f "$PROJECT_BASE/.bare/HEAD" ]; then
122
+ echo "OK: .bare/HEAD exists"
123
+ else
124
+ echo "FAIL: .bare/HEAD missing"
125
+ ERRORS=$((ERRORS + 1))
126
+ fi
127
+
128
+ # Verify .git pseudo-file
129
+ if [ -f "$PROJECT_BASE/.git" ]; then
130
+ echo "OK: .git pseudo-file exists"
131
+ else
132
+ echo "FAIL: .git pseudo-file missing"
133
+ ERRORS=$((ERRORS + 1))
134
+ fi
135
+
136
+ # Verify main worktree
137
+ MAIN_BRANCH=$(git -C "$PROJECT_BASE/$MAIN_DIR" branch --show-current 2>/dev/null)
138
+ if [ "$MAIN_BRANCH" = "main" ]; then
139
+ echo "OK: $MAIN_DIR is on branch main"
140
+ else
141
+ echo "FAIL: $MAIN_DIR is on branch '$MAIN_BRANCH', expected 'main'"
142
+ ERRORS=$((ERRORS + 1))
143
+ fi
144
+
145
+ # Verify develop worktree
146
+ DEVELOP_BRANCH=$(git -C "$PROJECT_BASE/$DEVELOP_DIR" branch --show-current 2>/dev/null)
147
+ if [ "$DEVELOP_BRANCH" = "develop" ]; then
148
+ echo "OK: $DEVELOP_DIR is on branch develop"
149
+ else
150
+ echo "FAIL: $DEVELOP_DIR is on branch '$DEVELOP_BRANCH', expected 'develop'"
151
+ ERRORS=$((ERRORS + 1))
152
+ fi
153
+
154
+ # Verify subdirectories
155
+ for subdir in features releases hotfixes; do
156
+ if [ -d "$PROJECT_BASE/$subdir" ]; then
157
+ echo "OK: $subdir/ exists"
158
+ else
159
+ echo "FAIL: $subdir/ missing"
160
+ ERRORS=$((ERRORS + 1))
161
+ fi
162
+ done
163
+
164
+ # Verify config directory
165
+ if [ -d "$PROJECT_BASE/$DEVELOP_DIR/.claude/gitflow" ]; then
166
+ echo "OK: .claude/gitflow/ directory exists"
167
+ else
168
+ echo "FAIL: .claude/gitflow/ directory missing"
169
+ ERRORS=$((ERRORS + 1))
170
+ fi
171
+
172
+ echo ""
173
+ if [ "$ERRORS" -eq 0 ]; then
174
+ echo "RESULT: SUCCESS - All checks passed"
175
+ else
176
+ echo "RESULT: FAIL - $ERRORS error(s) detected"
177
+ fi
178
+ ```
179
+
180
+ ## OUTPUT
181
+
182
+ Return the verification results. The orchestrator will use these to decide if validation/repair is needed.
183
+
184
+ ## Priority
185
+
186
+ Correctness > Speed. Every operation must be verified.
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: gitflow-init-detect
3
+ description: GitFlow init - platform detection, workspace scanning, environment analysis
4
+ color: cyan
5
+ model: haiku
6
+ tools: Bash, Read
7
+ ---
8
+
9
+ # GitFlow Init Detect Agent
10
+
11
+ You detect the environment for GitFlow initialization. Return a structured report.
12
+
13
+ ## EXECUTION SEQUENCE
14
+
15
+ ### 1. Detect Platform
16
+
17
+ ```bash
18
+ # WSL detection (highest priority)
19
+ if [ -f /proc/version ] && grep -qi "microsoft\|wsl" /proc/version 2>/dev/null; then
20
+ PLATFORM="wsl"
21
+ SHELL_TYPE="bash"
22
+ elif [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "mingw"* ]] || [[ "$OSTYPE" == "cygwin" ]]; then
23
+ PLATFORM="windows"
24
+ SHELL_TYPE="gitbash"
25
+ elif [[ -n "$WINDIR" ]] || [[ -n "$SystemRoot" ]]; then
26
+ PLATFORM="windows"
27
+ SHELL_TYPE="powershell"
28
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
29
+ PLATFORM="macos"
30
+ SHELL_TYPE="zsh"
31
+ elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
32
+ PLATFORM="linux"
33
+ SHELL_TYPE="bash"
34
+ else
35
+ PLATFORM="unknown"
36
+ SHELL_TYPE="bash"
37
+ fi
38
+
39
+ echo "PLATFORM=$PLATFORM"
40
+ echo "SHELL_TYPE=$SHELL_TYPE"
41
+ echo "PWD=$(pwd)"
42
+ ```
43
+
44
+ ### 2. Detect Git State
45
+
46
+ ```bash
47
+ # Check if in a git repository
48
+ IS_GIT_REPO=$(git rev-parse --git-dir 2>/dev/null && echo "true" || echo "false")
49
+
50
+ # Auto-detect values
51
+ DETECTED_URL=$(git remote get-url origin 2>/dev/null || echo "")
52
+ DETECTED_NAME=$(basename -s .git "$DETECTED_URL" 2>/dev/null || basename "$(pwd)")
53
+ CURRENT_DIR=$(pwd)
54
+ PARENT_DIR=$(dirname "$CURRENT_DIR")
55
+
56
+ # Detect git provider
57
+ GIT_PROVIDER="unknown"
58
+ if [[ "$DETECTED_URL" == *"dev.azure.com"* ]] || [[ "$DETECTED_URL" == *"visualstudio.com"* ]]; then
59
+ GIT_PROVIDER="azuredevops"
60
+ elif [[ "$DETECTED_URL" == *"github.com"* ]]; then
61
+ GIT_PROVIDER="github"
62
+ fi
63
+
64
+ # Check branches
65
+ HAS_MAIN=$(git rev-parse --verify main 2>/dev/null && echo "true" || echo "false")
66
+ HAS_DEVELOP=$(git rev-parse --verify develop 2>/dev/null && echo "true" || echo "false")
67
+
68
+ # Check existing config
69
+ HAS_CONFIG=$([ -f ".claude/gitflow/config.json" ] && echo "true" || echo "false")
70
+
71
+ echo "IS_GIT_REPO=$IS_GIT_REPO"
72
+ echo "DETECTED_URL=$DETECTED_URL"
73
+ echo "DETECTED_NAME=$DETECTED_NAME"
74
+ echo "GIT_PROVIDER=$GIT_PROVIDER"
75
+ echo "HAS_MAIN=$HAS_MAIN"
76
+ echo "HAS_DEVELOP=$HAS_DEVELOP"
77
+ echo "HAS_CONFIG=$HAS_CONFIG"
78
+ ```
79
+
80
+ ### 3. Scan Workspace for Sibling Projects
81
+
82
+ ```bash
83
+ PARENT_DIR=$(dirname "$(pwd)")
84
+ SIBLINGS=""
85
+ SIBLING_COUNT=0
86
+
87
+ for dir in "$PARENT_DIR"/*/; do
88
+ [ ! -d "$dir" ] && continue
89
+ PROJECT=$(basename "$dir")
90
+ if [ -d "$dir/.bare" ] || [ -d "$dir/01-Main" ] || [ -d "$dir/02-Develop" ]; then
91
+ SIBLINGS="$SIBLINGS $PROJECT (gitflow)\n"
92
+ SIBLING_COUNT=$((SIBLING_COUNT + 1))
93
+ elif [ -d "$dir/.git" ]; then
94
+ SIBLINGS="$SIBLINGS $PROJECT (git)\n"
95
+ fi
96
+ done
97
+
98
+ # Check for workspace.json
99
+ HAS_WORKSPACE=$([ -f "$PARENT_DIR/.smartstack-workspace.json" ] && echo "true" || echo "false")
100
+
101
+ echo "PARENT_DIR=$PARENT_DIR"
102
+ echo "SIBLING_COUNT=$SIBLING_COUNT"
103
+ echo -e "SIBLINGS:\n$SIBLINGS"
104
+ echo "HAS_WORKSPACE=$HAS_WORKSPACE"
105
+ ```
106
+
107
+ ### 4. Output Structured Report
108
+
109
+ Return all detected values in a clear format:
110
+
111
+ ```
112
+ ENVIRONMENT REPORT
113
+ ==================
114
+ Platform: {PLATFORM} ({SHELL_TYPE})
115
+ Directory: {CURRENT_DIR}
116
+ Parent: {PARENT_DIR}
117
+
118
+ GIT STATE
119
+ =========
120
+ Git repo: {IS_GIT_REPO}
121
+ Remote URL: {DETECTED_URL}
122
+ Provider: {GIT_PROVIDER}
123
+ Project name: {DETECTED_NAME}
124
+ Has main: {HAS_MAIN}
125
+ Has develop: {HAS_DEVELOP}
126
+ Has config: {HAS_CONFIG}
127
+
128
+ WORKSPACE
129
+ =========
130
+ Workspace: {HAS_WORKSPACE}
131
+ Siblings: {SIBLING_COUNT} project(s)
132
+ {SIBLINGS list}
133
+ ```
134
+
135
+ ## Priority
136
+
137
+ Speed > Detail. Detection only, no modifications.