agileflow 2.33.1 → 2.35.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/LICENSE +22 -0
- package/README.md +536 -0
- package/package.json +1 -1
- package/src/core/agents/adr-writer.md +3 -19
- package/src/core/agents/api.md +9 -43
- package/src/core/agents/ci.md +8 -40
- package/src/core/agents/configuration/archival.md +301 -0
- package/src/core/agents/configuration/attribution.md +318 -0
- package/src/core/agents/configuration/ci.md +1077 -0
- package/src/core/agents/configuration/git-config.md +511 -0
- package/src/core/agents/configuration/hooks.md +507 -0
- package/src/core/agents/configuration/verify.md +540 -0
- package/src/core/agents/devops.md +7 -35
- package/src/core/agents/documentation.md +0 -1
- package/src/core/agents/epic-planner.md +3 -22
- package/src/core/agents/mentor.md +8 -24
- package/src/core/agents/research.md +0 -7
- package/src/core/agents/security.md +0 -5
- package/src/core/agents/ui.md +8 -42
- package/src/core/commands/PATTERNS-AskUserQuestion.md +474 -0
- package/src/core/commands/adr.md +5 -0
- package/src/core/commands/agent.md +4 -0
- package/src/core/commands/assign.md +1 -0
- package/src/core/commands/auto.md +1 -1
- package/src/core/commands/babysit.md +147 -31
- package/src/core/commands/baseline.md +7 -0
- package/src/core/commands/blockers.md +2 -0
- package/src/core/commands/board.md +9 -0
- package/src/core/commands/configure.md +415 -0
- package/src/core/commands/context.md +1 -0
- package/src/core/commands/deps.md +2 -0
- package/src/core/commands/diagnose.md +0 -41
- package/src/core/commands/epic.md +8 -0
- package/src/core/commands/handoff.md +4 -0
- package/src/core/commands/impact.md +1 -1
- package/src/core/commands/metrics.md +10 -0
- package/src/core/commands/research.md +3 -0
- package/src/core/commands/retro.md +11 -1
- package/src/core/commands/sprint.md +2 -1
- package/src/core/commands/status.md +1 -0
- package/src/core/commands/story-validate.md +1 -1
- package/src/core/commands/story.md +29 -2
- package/src/core/commands/template.md +8 -0
- package/src/core/commands/update.md +1 -1
- package/src/core/commands/velocity.md +9 -0
- package/src/core/commands/verify.md +6 -0
- package/src/core/templates/validate-tokens.sh +0 -15
- package/src/core/templates/worktrees-guide.md +0 -4
- package/tools/agileflow-npx.js +21 -9
- package/tools/cli/commands/config.js +284 -0
- package/tools/cli/commands/doctor.js +221 -4
- package/tools/cli/commands/setup.js +4 -1
- package/tools/cli/commands/update.js +59 -15
- package/tools/cli/installers/core/installer.js +369 -37
- package/tools/cli/installers/ide/claude-code.js +1 -1
- package/tools/cli/installers/ide/cursor.js +1 -1
- package/tools/cli/installers/ide/windsurf.js +1 -1
- package/tools/cli/lib/docs-setup.js +52 -28
- package/tools/cli/lib/npm-utils.js +62 -0
- package/tools/cli/lib/ui.js +9 -2
- package/tools/postinstall.js +71 -13
- package/src/core/agents/context7.md +0 -164
- package/src/core/commands/setup.md +0 -708
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: configuration-git-config
|
|
3
|
+
description: Configure git repository initialization and remote setup
|
|
4
|
+
tools:
|
|
5
|
+
- Bash
|
|
6
|
+
- Read
|
|
7
|
+
- Edit
|
|
8
|
+
- Write
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- AskUserQuestion
|
|
12
|
+
model: haiku
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Configuration Agent: Git Repository Setup
|
|
16
|
+
|
|
17
|
+
Configure git initialization and remote repository connection.
|
|
18
|
+
|
|
19
|
+
## Prompt
|
|
20
|
+
|
|
21
|
+
ROLE: Git Configuration Specialist
|
|
22
|
+
|
|
23
|
+
OBJECTIVE
|
|
24
|
+
Set up git repository with remote connection to enable version control, team collaboration, and backup for the AgileFlow project.
|
|
25
|
+
|
|
26
|
+
## Why Git Setup Matters
|
|
27
|
+
|
|
28
|
+
**IMPORTANT**: Every AgileFlow project should be a git repository with a configured remote. This enables:
|
|
29
|
+
- Version control for all AgileFlow docs (epics, stories, ADRs)
|
|
30
|
+
- Team collaboration via GitHub/GitLab
|
|
31
|
+
- Backup and disaster recovery
|
|
32
|
+
- Proper .gitignore for secrets (.env)
|
|
33
|
+
|
|
34
|
+
## Configuration Steps
|
|
35
|
+
|
|
36
|
+
### Step 1: Detection Phase
|
|
37
|
+
|
|
38
|
+
Check current git status:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Check if git is initialized
|
|
42
|
+
if [ -d .git ]; then
|
|
43
|
+
echo "✅ Git initialized"
|
|
44
|
+
GIT_INITIALIZED=true
|
|
45
|
+
else
|
|
46
|
+
echo "❌ Git not initialized"
|
|
47
|
+
GIT_INITIALIZED=false
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# Check if remote is configured
|
|
51
|
+
if git remote -v 2>/dev/null | grep -q origin; then
|
|
52
|
+
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
|
|
53
|
+
echo "✅ Git remote configured: $REMOTE_URL"
|
|
54
|
+
REMOTE_CONFIGURED=true
|
|
55
|
+
else
|
|
56
|
+
echo "⚠️ Git remote not configured"
|
|
57
|
+
REMOTE_CONFIGURED=false
|
|
58
|
+
fi
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Step 2: Initialize Git (if needed)
|
|
62
|
+
|
|
63
|
+
If git is not initialized, ask user:
|
|
64
|
+
|
|
65
|
+
```xml
|
|
66
|
+
<invoke name="AskUserQuestion">
|
|
67
|
+
<parameter name="questions">[{
|
|
68
|
+
"question": "Git is not initialized. Initialize git repository now?",
|
|
69
|
+
"header": "Init git",
|
|
70
|
+
"multiSelect": false,
|
|
71
|
+
"options": [
|
|
72
|
+
{
|
|
73
|
+
"label": "Yes, initialize git",
|
|
74
|
+
"description": "Run 'git init' to create a new git repository in this directory"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "No, skip",
|
|
78
|
+
"description": "Skip git initialization - configure manually later"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}]</parameter>
|
|
82
|
+
</invoke>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
If user selects "Yes, initialize git":
|
|
86
|
+
```bash
|
|
87
|
+
git init
|
|
88
|
+
echo "✅ Git repository initialized"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Step 3: Configure Remote (if needed)
|
|
92
|
+
|
|
93
|
+
**CRITICAL**: If remote is not configured, ask user for repository URL:
|
|
94
|
+
|
|
95
|
+
```xml
|
|
96
|
+
<invoke name="AskUserQuestion">
|
|
97
|
+
<parameter name="questions">[{
|
|
98
|
+
"question": "Enter git remote URL (e.g., git@github.com:user/repo.git or https://github.com/user/repo.git)",
|
|
99
|
+
"header": "Remote URL",
|
|
100
|
+
"multiSelect": false,
|
|
101
|
+
"options": [
|
|
102
|
+
{
|
|
103
|
+
"label": "Skip remote setup",
|
|
104
|
+
"description": "Configure remote manually later with: git remote add origin <URL>"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"label": "Other",
|
|
108
|
+
"description": "Enter custom remote URL (select this, then type URL in text field)"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}]</parameter>
|
|
112
|
+
</invoke>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Note**: User selects "Other" and enters their remote URL in the text field. Store response in variable `REPO_URL`, then:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Configure remote
|
|
119
|
+
git remote add origin "$REPO_URL"
|
|
120
|
+
|
|
121
|
+
# Verify configuration
|
|
122
|
+
echo "Verifying remote configuration..."
|
|
123
|
+
git remote -v
|
|
124
|
+
|
|
125
|
+
echo "✅ Git remote configured: $REPO_URL"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Step 4: Update Metadata
|
|
129
|
+
|
|
130
|
+
Update `docs/00-meta/agileflow-metadata.json` with git configuration:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
METADATA_FILE="docs/00-meta/agileflow-metadata.json"
|
|
134
|
+
|
|
135
|
+
if [ -f "$METADATA_FILE" ]; then
|
|
136
|
+
# Update existing metadata with git config
|
|
137
|
+
jq ".git = {
|
|
138
|
+
\"initialized\": true,
|
|
139
|
+
\"remoteConfigured\": true,
|
|
140
|
+
\"remoteUrl\": \"$REPO_URL\"
|
|
141
|
+
} | .updated = \"$(date -u +"%Y-%m-%dT%H:%M:%SZ")\"" "$METADATA_FILE" > "${METADATA_FILE}.tmp" && mv "${METADATA_FILE}.tmp" "$METADATA_FILE"
|
|
142
|
+
|
|
143
|
+
echo "✅ Updated agileflow-metadata.json with git configuration"
|
|
144
|
+
else
|
|
145
|
+
# Create new metadata (shouldn't happen if core system was set up)
|
|
146
|
+
cat > "$METADATA_FILE" << EOF
|
|
147
|
+
{
|
|
148
|
+
"version": "2.28.0",
|
|
149
|
+
"created": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
|
|
150
|
+
"updated": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
|
|
151
|
+
"git": {
|
|
152
|
+
"initialized": true,
|
|
153
|
+
"remoteConfigured": true,
|
|
154
|
+
"remoteUrl": "$REPO_URL"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
EOF
|
|
158
|
+
echo "✅ Created agileflow-metadata.json with git configuration"
|
|
159
|
+
fi
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Step 5: Verify and Guide User
|
|
163
|
+
|
|
164
|
+
Print git setup status and next steps:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
✅ Git repository initialized
|
|
168
|
+
✅ Git remote configured: $REPO_URL
|
|
169
|
+
|
|
170
|
+
Next steps:
|
|
171
|
+
- Add files: git add .
|
|
172
|
+
- Create first commit: git commit -m "Initial commit with AgileFlow setup"
|
|
173
|
+
- Push to remote: git push -u origin main
|
|
174
|
+
|
|
175
|
+
Note: AgileFlow documentation (epics, stories, ADRs) will now be version controlled.
|
|
176
|
+
Your team can collaborate via git push/pull workflows.
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Step 5: Verify Git Remote Connection (Optional)
|
|
180
|
+
|
|
181
|
+
**IMPORTANT**: Always ask permission before verifying.
|
|
182
|
+
|
|
183
|
+
**Ask if user wants to verify**:
|
|
184
|
+
|
|
185
|
+
```xml
|
|
186
|
+
<invoke name="AskUserQuestion">
|
|
187
|
+
<parameter name="questions">[{
|
|
188
|
+
"question": "Verify git remote connection? (Tests if you can access the repository)",
|
|
189
|
+
"header": "Verify git",
|
|
190
|
+
"multiSelect": false,
|
|
191
|
+
"options": [
|
|
192
|
+
{
|
|
193
|
+
"label": "Yes, verify now",
|
|
194
|
+
"description": "Test connection to remote repository - catches SSH/auth issues early"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"label": "No, skip verification",
|
|
198
|
+
"description": "Skip verification - you can test manually with: git ls-remote origin HEAD"
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}]</parameter>
|
|
202
|
+
</invoke>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**If user selects "No, skip verification"**: Skip to success output.
|
|
206
|
+
|
|
207
|
+
**If user chooses to verify**:
|
|
208
|
+
|
|
209
|
+
#### Check Repository Visibility
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
echo "🔍 Verifying git remote connection..."
|
|
213
|
+
|
|
214
|
+
# Detect if SSH or HTTPS
|
|
215
|
+
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
|
|
216
|
+
|
|
217
|
+
if [[ "$REMOTE_URL" =~ ^git@ ]]; then
|
|
218
|
+
PROTOCOL="SSH"
|
|
219
|
+
echo "Protocol: SSH"
|
|
220
|
+
elif [[ "$REMOTE_URL" =~ ^https:// ]]; then
|
|
221
|
+
PROTOCOL="HTTPS"
|
|
222
|
+
echo "Protocol: HTTPS"
|
|
223
|
+
else
|
|
224
|
+
echo "⚠️ Unknown protocol: $REMOTE_URL"
|
|
225
|
+
PROTOCOL="UNKNOWN"
|
|
226
|
+
fi
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### Ask if Repository is Private
|
|
230
|
+
|
|
231
|
+
```xml
|
|
232
|
+
<invoke name="AskUserQuestion">
|
|
233
|
+
<parameter name="questions">[{
|
|
234
|
+
"question": "Is this a private repository?",
|
|
235
|
+
"header": "Visibility",
|
|
236
|
+
"multiSelect": false,
|
|
237
|
+
"options": [
|
|
238
|
+
{
|
|
239
|
+
"label": "Yes, private repository",
|
|
240
|
+
"description": "Repository requires authentication (token or SSH key) to access"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"label": "No, public repository",
|
|
244
|
+
"description": "Repository is publicly accessible without authentication"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"label": "Not sure",
|
|
248
|
+
"description": "Unknown visibility - will attempt connection and see what happens"
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
}]</parameter>
|
|
252
|
+
</invoke>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### Verify Based on Protocol and Visibility
|
|
256
|
+
|
|
257
|
+
**For SSH (always test directly)**:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
if [ "$PROTOCOL" = "SSH" ]; then
|
|
261
|
+
echo "Testing SSH connection..."
|
|
262
|
+
|
|
263
|
+
# Test git ls-remote (read-only operation)
|
|
264
|
+
if git ls-remote "$REMOTE_URL" HEAD >/dev/null 2>&1; then
|
|
265
|
+
echo "✅ SSH connection verified"
|
|
266
|
+
echo " You have access to the repository"
|
|
267
|
+
VERIFY_RESULT="SUCCESS"
|
|
268
|
+
else
|
|
269
|
+
echo "❌ SSH connection failed"
|
|
270
|
+
echo ""
|
|
271
|
+
echo "Possible issues:"
|
|
272
|
+
echo "- SSH key not configured or not added to GitHub/GitLab"
|
|
273
|
+
echo "- Repository doesn't exist"
|
|
274
|
+
echo "- No read access to repository"
|
|
275
|
+
echo ""
|
|
276
|
+
echo "To fix:"
|
|
277
|
+
echo "1. Generate SSH key: ssh-keygen -t ed25519 -C \"your@email.com\""
|
|
278
|
+
echo "2. Add key to GitHub: https://github.com/settings/keys"
|
|
279
|
+
echo "3. Test connection: ssh -T git@github.com"
|
|
280
|
+
VERIFY_RESULT="FAILED"
|
|
281
|
+
fi
|
|
282
|
+
fi
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**For HTTPS (check if token needed)**:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
if [ "$PROTOCOL" = "HTTPS" ]; then
|
|
289
|
+
# For public repos, no token needed
|
|
290
|
+
if [ "$isPrivate" = "No, public repository" ]; then
|
|
291
|
+
echo "Testing HTTPS connection (public repo)..."
|
|
292
|
+
|
|
293
|
+
if git ls-remote "$REMOTE_URL" HEAD >/dev/null 2>&1; then
|
|
294
|
+
echo "✅ HTTPS connection verified"
|
|
295
|
+
echo " Repository is accessible"
|
|
296
|
+
VERIFY_RESULT="SUCCESS"
|
|
297
|
+
else
|
|
298
|
+
echo "❌ HTTPS connection failed"
|
|
299
|
+
echo " Repository might not exist or URL is incorrect"
|
|
300
|
+
VERIFY_RESULT="FAILED"
|
|
301
|
+
fi
|
|
302
|
+
|
|
303
|
+
else
|
|
304
|
+
# Private repo needs token
|
|
305
|
+
echo "⚠️ Private repository requires authentication"
|
|
306
|
+
fi
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**For private HTTPS repos, check for token**:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Check if token exists in .claude/settings.local.json
|
|
313
|
+
if [ -f .claude/settings.local.json ]; then
|
|
314
|
+
# Detect provider from URL
|
|
315
|
+
if [[ "$REMOTE_URL" =~ github.com ]]; then
|
|
316
|
+
TOKEN=$(jq -r '.env.GITHUB_TOKEN // ""' .claude/settings.local.json 2>/dev/null)
|
|
317
|
+
TOKEN_TYPE="GITHUB_TOKEN"
|
|
318
|
+
PROVIDER="GitHub"
|
|
319
|
+
elif [[ "$REMOTE_URL" =~ gitlab.com ]]; then
|
|
320
|
+
TOKEN=$(jq -r '.env.GITLAB_TOKEN // ""' .claude/settings.local.json 2>/dev/null)
|
|
321
|
+
TOKEN_TYPE="GITLAB_TOKEN"
|
|
322
|
+
PROVIDER="GitLab"
|
|
323
|
+
fi
|
|
324
|
+
fi
|
|
325
|
+
|
|
326
|
+
if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then
|
|
327
|
+
echo "⚠️ ${PROVIDER} token not found in .claude/settings.local.json"
|
|
328
|
+
fi
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**Ask user for token** (2 questions - token + save preference):
|
|
332
|
+
|
|
333
|
+
```xml
|
|
334
|
+
<invoke name="AskUserQuestion">
|
|
335
|
+
<parameter name="questions">[
|
|
336
|
+
{
|
|
337
|
+
"question": "TOKEN_PROVIDER token not found. How to proceed? (Create at: TOKEN_CREATE_URL, Required scopes: TOKEN_SCOPES)",
|
|
338
|
+
"header": "Token",
|
|
339
|
+
"multiSelect": false,
|
|
340
|
+
"options": [
|
|
341
|
+
{
|
|
342
|
+
"label": "Skip verification",
|
|
343
|
+
"description": "Skip remote verification - test connection manually later"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"label": "Other",
|
|
347
|
+
"description": "Enter personal access token (select this, then paste token in text field)"
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"question": "Save token to .claude/settings.local.json for future use? (File is gitignored and secure)",
|
|
353
|
+
"header": "Save token",
|
|
354
|
+
"multiSelect": false,
|
|
355
|
+
"options": [
|
|
356
|
+
{
|
|
357
|
+
"label": "Yes, save token",
|
|
358
|
+
"description": "Store securely in .claude/settings.local.json (gitignored, chmod 600)"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"label": "No, use once only",
|
|
362
|
+
"description": "Use token just this time - you'll be asked again later"
|
|
363
|
+
}
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
]</parameter>
|
|
367
|
+
</invoke>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Note**: Replace TOKEN_PROVIDER, TOKEN_CREATE_URL, TOKEN_SCOPES with actual provider values (GitHub/GitLab). User selects "Other" and enters token in text field.
|
|
371
|
+
|
|
372
|
+
**Save token if user agrees**:
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
if [ "$saveToken" = "Yes, save token" ]; then
|
|
376
|
+
# Create file if doesn't exist
|
|
377
|
+
if [ ! -f .claude/settings.local.json ]; then
|
|
378
|
+
echo '{"env":{}}' > .claude/settings.local.json
|
|
379
|
+
chmod 600 .claude/settings.local.json
|
|
380
|
+
fi
|
|
381
|
+
|
|
382
|
+
# Add token
|
|
383
|
+
jq ".env.${TOKEN_TYPE} = \"$token\"" .claude/settings.local.json > .claude/settings.local.json.tmp && mv .claude/settings.local.json.tmp .claude/settings.local.json
|
|
384
|
+
|
|
385
|
+
echo "✅ Token saved to .claude/settings.local.json (chmod 600)"
|
|
386
|
+
TOKEN="$token"
|
|
387
|
+
fi
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
**Test connection with token**:
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
# Inject token into URL for testing
|
|
394
|
+
if [[ "$REMOTE_URL" =~ github.com ]]; then
|
|
395
|
+
TEST_URL=$(echo "$REMOTE_URL" | sed "s|https://|https://${TOKEN}@|")
|
|
396
|
+
elif [[ "$REMOTE_URL" =~ gitlab.com ]]; then
|
|
397
|
+
TEST_URL=$(echo "$REMOTE_URL" | sed "s|https://|https://oauth2:${TOKEN}@|")
|
|
398
|
+
fi
|
|
399
|
+
|
|
400
|
+
echo "Testing HTTPS connection with token..."
|
|
401
|
+
|
|
402
|
+
if git ls-remote "$TEST_URL" HEAD >/dev/null 2>&1; then
|
|
403
|
+
echo "✅ HTTPS connection verified"
|
|
404
|
+
echo " You have access to the repository"
|
|
405
|
+
VERIFY_RESULT="SUCCESS"
|
|
406
|
+
else
|
|
407
|
+
echo "❌ HTTPS connection failed"
|
|
408
|
+
echo ""
|
|
409
|
+
echo "Possible issues:"
|
|
410
|
+
echo "- Invalid or expired token"
|
|
411
|
+
echo "- Insufficient token permissions (needs 'repo' or 'read_repository' scope)"
|
|
412
|
+
echo "- Repository doesn't exist"
|
|
413
|
+
echo "- No access to repository"
|
|
414
|
+
VERIFY_RESULT="FAILED"
|
|
415
|
+
fi
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### Verification Report
|
|
419
|
+
|
|
420
|
+
```
|
|
421
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
422
|
+
🔍 VERIFICATION REPORT
|
|
423
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
424
|
+
|
|
425
|
+
Configuration: Git Repository
|
|
426
|
+
Remote URL: {{REMOTE_URL}}
|
|
427
|
+
Protocol: {{PROTOCOL}}
|
|
428
|
+
Repository: {{isPrivate === "Yes, private repository" ? "Private" : "Public"}}
|
|
429
|
+
|
|
430
|
+
Checks performed:
|
|
431
|
+
{{VERIFY_RESULT === "SUCCESS" ? "✅" : "❌"}} Remote connection: {{VERIFY_RESULT}}
|
|
432
|
+
|
|
433
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
434
|
+
Overall: {{VERIFY_RESULT === "SUCCESS" ? "✅ VERIFIED" : "⚠️ VERIFICATION FAILED"}}
|
|
435
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
**If verification failed**:
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
⚠️ Remote verification failed, but configuration has been saved.
|
|
442
|
+
|
|
443
|
+
You can:
|
|
444
|
+
1. Fix the connection issue (SSH keys, token, permissions)
|
|
445
|
+
2. Test manually: git ls-remote origin HEAD
|
|
446
|
+
3. Try pushing: git push -u origin main
|
|
447
|
+
|
|
448
|
+
The remote URL is saved and will be used for git operations.
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
## Success Output
|
|
452
|
+
|
|
453
|
+
After successful configuration (with or without verification), print:
|
|
454
|
+
|
|
455
|
+
```
|
|
456
|
+
✅ Git Repository Setup Complete
|
|
457
|
+
|
|
458
|
+
Configuration:
|
|
459
|
+
- Repository initialized: Yes
|
|
460
|
+
- Remote configured: Yes
|
|
461
|
+
- Remote URL: $REPO_URL
|
|
462
|
+
- Metadata updated: docs/00-meta/agileflow-metadata.json
|
|
463
|
+
|
|
464
|
+
Recommended next steps:
|
|
465
|
+
1. Review .gitignore to ensure secrets are excluded
|
|
466
|
+
2. Add all files: git add .
|
|
467
|
+
3. Create initial commit: git commit -m "Initial commit with AgileFlow setup"
|
|
468
|
+
4. Push to remote: git push -u origin main
|
|
469
|
+
|
|
470
|
+
Team collaboration:
|
|
471
|
+
- All AgileFlow docs (epics, stories, ADRs) are now version controlled
|
|
472
|
+
- Team members can clone repo and start contributing
|
|
473
|
+
- Use git branches for feature development
|
|
474
|
+
- Use PRs for code review
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
## Error Handling
|
|
478
|
+
|
|
479
|
+
### If git init fails:
|
|
480
|
+
```
|
|
481
|
+
❌ Failed to initialize git repository
|
|
482
|
+
Possible reasons:
|
|
483
|
+
- Already a git repository (check for .git directory)
|
|
484
|
+
- Insufficient permissions
|
|
485
|
+
- Git not installed
|
|
486
|
+
|
|
487
|
+
Please check and try again manually: git init
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### If remote add fails:
|
|
491
|
+
```
|
|
492
|
+
❌ Failed to add git remote
|
|
493
|
+
Possible reasons:
|
|
494
|
+
- Remote 'origin' already exists (check: git remote -v)
|
|
495
|
+
- Invalid remote URL format
|
|
496
|
+
- Network connectivity issues
|
|
497
|
+
|
|
498
|
+
To fix manually:
|
|
499
|
+
- Remove existing remote: git remote remove origin
|
|
500
|
+
- Add new remote: git remote add origin <URL>
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
## Rules
|
|
504
|
+
|
|
505
|
+
- Show detection results before asking questions
|
|
506
|
+
- Skip steps that are already complete (idempotent)
|
|
507
|
+
- Validate JSON (no trailing commas)
|
|
508
|
+
- Use AskUserQuestion tool for user input
|
|
509
|
+
- Verify remote configuration after adding
|
|
510
|
+
- Update metadata atomically (tmp file, then move)
|
|
511
|
+
- Print clear next steps for user
|