claude-autopm 1.20.1 → 1.22.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/README.md +255 -878
- package/autopm/.claude/agents/cloud/gcp-cloud-functions-engineer.md +5 -10
- package/autopm/.claude/agents/cloud/gemini-api-expert.md +1 -1
- package/autopm/.claude/agents/cloud/openai-python-expert.md +1 -1
- package/autopm/.claude/agents/cloud/terraform-infrastructure-expert.md +7 -11
- package/autopm/.claude/agents/core/mcp-manager.md +7 -0
- package/autopm/.claude/agents/data/airflow-orchestration-expert.md +1 -1
- package/autopm/.claude/agents/data/kedro-pipeline-expert.md +1 -1
- package/autopm/.claude/agents/data/langgraph-workflow-expert.md +1 -1
- package/autopm/.claude/agents/databases/bigquery-expert.md +1 -1
- package/autopm/.claude/agents/databases/cosmosdb-expert.md +1 -1
- package/autopm/.claude/agents/databases/mongodb-expert.md +1 -1
- package/autopm/.claude/agents/databases/postgresql-expert.md +1 -1
- package/autopm/.claude/agents/databases/redis-expert.md +1 -1
- package/autopm/.claude/agents/decision-matrices/playwright-testing-selection.md +6 -0
- package/autopm/.claude/agents/decision-matrices/python-backend-selection.md +7 -0
- package/autopm/.claude/agents/decision-matrices/ui-framework-selection.md +7 -0
- package/autopm/.claude/agents/devops/azure-devops-specialist.md +1 -1
- package/autopm/.claude/agents/devops/github-operations-specialist.md +7 -0
- package/autopm/.claude/agents/devops/mcp-context-manager.md +7 -0
- package/autopm/.claude/agents/devops/ssh-operations-expert.md +1 -1
- package/autopm/.claude/agents/devops/traefik-proxy-expert.md +1 -1
- package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +1 -1
- package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +1 -1
- package/autopm/.claude/agents/languages/bash-scripting-expert.md +1 -1
- package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +1 -1
- package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +3 -7
- package/autopm/.claude/agents/languages/python-backend-engineer.md +1 -1
- package/autopm/.claude/commands/ai/langgraph-workflow.md +17 -0
- package/autopm/.claude/commands/ai/openai-chat.md +17 -0
- package/autopm/.claude/commands/azure/active-work.md +17 -0
- package/autopm/.claude/commands/azure/aliases.md +17 -0
- package/autopm/.claude/commands/azure/blocked-items.md +17 -0
- package/autopm/.claude/commands/azure/clean.md +17 -0
- package/autopm/.claude/commands/azure/docs-query.md +17 -0
- package/autopm/.claude/commands/azure/feature-decompose.md +17 -0
- package/autopm/.claude/commands/azure/feature-list.md +17 -0
- package/autopm/.claude/commands/azure/feature-new.md +17 -0
- package/autopm/.claude/commands/azure/feature-show.md +17 -0
- package/autopm/.claude/commands/azure/feature-start.md +17 -0
- package/autopm/.claude/commands/azure/fix-integration-example.md +17 -0
- package/autopm/.claude/commands/azure/help.md +17 -0
- package/autopm/.claude/commands/azure/import-us.md +17 -0
- package/autopm/.claude/commands/azure/init.md +17 -0
- package/autopm/.claude/commands/azure/next-task.md +17 -0
- package/autopm/.claude/commands/azure/search.md +17 -0
- package/autopm/.claude/commands/azure/sprint-status.md +17 -0
- package/autopm/.claude/commands/azure/standup.md +17 -0
- package/autopm/.claude/commands/azure/sync-all.md +17 -0
- package/autopm/.claude/commands/azure/task-analyze.md +17 -0
- package/autopm/.claude/commands/azure/task-close.md +17 -0
- package/autopm/.claude/commands/azure/task-edit.md +17 -0
- package/autopm/.claude/commands/azure/task-list.md +17 -0
- package/autopm/.claude/commands/azure/task-new.md +17 -0
- package/autopm/.claude/commands/azure/task-reopen.md +17 -0
- package/autopm/.claude/commands/azure/task-show.md +17 -0
- package/autopm/.claude/commands/azure/task-start.md +17 -0
- package/autopm/.claude/commands/azure/task-status.md +17 -0
- package/autopm/.claude/commands/azure/task-sync.md +17 -0
- package/autopm/.claude/commands/azure/us-edit.md +17 -0
- package/autopm/.claude/commands/azure/us-list.md +17 -0
- package/autopm/.claude/commands/azure/us-new.md +17 -0
- package/autopm/.claude/commands/azure/us-parse.md +17 -0
- package/autopm/.claude/commands/azure/us-show.md +17 -0
- package/autopm/.claude/commands/azure/us-status.md +17 -0
- package/autopm/.claude/commands/azure/validate.md +17 -0
- package/autopm/.claude/commands/azure/work-item-sync.md +17 -0
- package/autopm/.claude/commands/cloud/infra-deploy.md +17 -0
- package/autopm/.claude/commands/config/toggle-features.md +15 -0
- package/autopm/.claude/commands/context/create.md +16 -0
- package/autopm/.claude/commands/context/prime.md +16 -0
- package/autopm/.claude/commands/context/update.md +16 -0
- package/autopm/.claude/commands/github/workflow-create.md +17 -0
- package/autopm/.claude/commands/infrastructure/ssh-security.md +17 -0
- package/autopm/.claude/commands/infrastructure/traefik-setup.md +17 -0
- package/autopm/.claude/commands/kubernetes/deploy.md +16 -0
- package/autopm/.claude/commands/mcp/context-setup.md +17 -0
- package/autopm/.claude/commands/mcp/docs-refresh.md +17 -0
- package/autopm/.claude/commands/playwright/test-scaffold.md +17 -0
- package/autopm/.claude/commands/pm/blocked.md +17 -0
- package/autopm/.claude/commands/pm/clean.md +17 -0
- package/autopm/.claude/commands/pm/context.md +17 -0
- package/autopm/.claude/commands/pm/epic-close.md +17 -0
- package/autopm/.claude/commands/pm/epic-decompose.md +16 -0
- package/autopm/.claude/commands/pm/epic-edit.md +17 -0
- package/autopm/.claude/commands/pm/epic-list.md +17 -0
- package/autopm/.claude/commands/pm/epic-merge.md +17 -0
- package/autopm/.claude/commands/pm/epic-oneshot.md +17 -0
- package/autopm/.claude/commands/pm/epic-refresh.md +17 -0
- package/autopm/.claude/commands/pm/epic-show.md +17 -0
- package/autopm/.claude/commands/pm/epic-split.md +17 -0
- package/autopm/.claude/commands/pm/epic-start.md +17 -0
- package/autopm/.claude/commands/pm/epic-status.md +17 -0
- package/autopm/.claude/commands/pm/epic-sync-modular.md +17 -0
- package/autopm/.claude/commands/pm/epic-sync-original.md +17 -0
- package/autopm/.claude/commands/pm/epic-sync.md +54 -4
- package/autopm/.claude/commands/pm/help.md +17 -0
- package/autopm/.claude/commands/pm/import.md +17 -0
- package/autopm/.claude/commands/pm/in-progress.md +17 -0
- package/autopm/.claude/commands/pm/init.md +17 -0
- package/autopm/.claude/commands/pm/issue-analyze.md +17 -0
- package/autopm/.claude/commands/pm/issue-close.md +17 -0
- package/autopm/.claude/commands/pm/issue-edit.md +17 -0
- package/autopm/.claude/commands/pm/issue-reopen.md +17 -0
- package/autopm/.claude/commands/pm/issue-show.md +17 -0
- package/autopm/.claude/commands/pm/issue-start.md +16 -0
- package/autopm/.claude/commands/pm/issue-status.md +17 -0
- package/autopm/.claude/commands/pm/issue-sync.md +17 -0
- package/autopm/.claude/commands/pm/next.md +17 -0
- package/autopm/.claude/commands/pm/prd-edit.md +17 -0
- package/autopm/.claude/commands/pm/prd-list.md +17 -0
- package/autopm/.claude/commands/pm/prd-new.md +16 -0
- package/autopm/.claude/commands/pm/prd-parse.md +17 -0
- package/autopm/.claude/commands/pm/prd-status.md +17 -0
- package/autopm/.claude/commands/pm/search.md +17 -0
- package/autopm/.claude/commands/pm/standup.md +17 -0
- package/autopm/.claude/commands/pm/status.md +17 -0
- package/autopm/.claude/commands/pm/sync.md +17 -0
- package/autopm/.claude/commands/pm/test-reference-update.md +17 -0
- package/autopm/.claude/commands/pm/validate.md +17 -0
- package/autopm/.claude/commands/pm/what-next.md +17 -0
- package/autopm/.claude/commands/python/api-scaffold.md +17 -0
- package/autopm/.claude/commands/python/docs-query.md +17 -0
- package/autopm/.claude/commands/react/app-scaffold.md +17 -0
- package/autopm/.claude/commands/testing/prime.md +17 -0
- package/autopm/.claude/commands/testing/run.md +17 -0
- package/autopm/.claude/commands/ui/bootstrap-scaffold.md +17 -0
- package/autopm/.claude/commands/ui/tailwind-system.md +17 -0
- package/autopm/.claude/hooks/pre-agent-context7.js +224 -0
- package/autopm/.claude/hooks/pre-command-context7.js +229 -0
- package/autopm/.claude/rules/context7-enforcement.md +292 -0
- package/autopm/.claude/rules/framework-path-rules.md +180 -0
- package/autopm/.claude/scripts/pm/epic-sync/README.md +208 -0
- package/autopm/.claude/scripts/pm/epic-sync/create-epic-issue.sh +68 -192
- package/autopm/.claude/scripts/pm/epic-sync/create-task-issues.sh +60 -328
- package/autopm/.claude/scripts/pm/epic-sync/update-epic-file.sh +61 -354
- package/autopm/.claude/scripts/pm/epic-sync/update-references.sh +67 -305
- package/autopm/.claude/scripts/pm/epic-sync.sh +137 -0
- package/package.json +4 -2
- package/scripts/add-context7-to-commands.js +351 -0
- package/scripts/validate-framework-paths.sh +104 -0
|
@@ -1,327 +1,89 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Update References
|
|
3
|
-
#
|
|
2
|
+
# Update Task References
|
|
3
|
+
# Renames task files to GitHub issue numbers and updates frontmatter
|
|
4
4
|
|
|
5
5
|
set -euo pipefail
|
|
6
6
|
|
|
7
|
-
# Load libraries
|
|
8
7
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
source "${SCRIPT_DIR}/../../lib/frontmatter-utils.sh"
|
|
12
|
-
source "${SCRIPT_DIR}/../../lib/validation-utils.sh"
|
|
13
|
-
source "${SCRIPT_DIR}/../../lib/datetime-utils.sh"
|
|
8
|
+
EPIC_NAME="${1:-}"
|
|
9
|
+
MAPPING_FILE="${2:-}"
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
declare -g temp_dir=""
|
|
21
|
-
declare -g id_mapping_file=""
|
|
22
|
-
|
|
23
|
-
# Main function
|
|
24
|
-
main() {
|
|
25
|
-
print_banner "Task References Updater" "1.0.0"
|
|
26
|
-
|
|
27
|
-
# Validate inputs
|
|
28
|
-
log_info "Validating inputs: epic=$EPIC_NAME, mapping_file=$TASK_MAPPING_FILE"
|
|
29
|
-
validate_inputs || exit 1
|
|
30
|
-
|
|
31
|
-
# Setup workspace
|
|
32
|
-
setup_workspace
|
|
33
|
-
|
|
34
|
-
# Build ID mapping from old numbers to new issue numbers
|
|
35
|
-
with_error_handling "Build ID mapping" \
|
|
36
|
-
build_id_mapping
|
|
37
|
-
|
|
38
|
-
# Process each task file: update references and rename
|
|
39
|
-
with_error_handling "Update task files and references" \
|
|
40
|
-
update_task_files
|
|
41
|
-
|
|
42
|
-
# Display results
|
|
43
|
-
display_results
|
|
44
|
-
|
|
45
|
-
log_success "Task references update completed successfully"
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
# Validate script inputs
|
|
49
|
-
validate_inputs() {
|
|
50
|
-
log_function_entry "validate_inputs"
|
|
51
|
-
|
|
52
|
-
validate_epic_name "$EPIC_NAME" || return 1
|
|
53
|
-
validate_file_exists "$TASK_MAPPING_FILE" "Task mapping file" || return 1
|
|
54
|
-
validate_epic_structure "$EPIC_NAME" || return 1
|
|
55
|
-
validate_github_auth || return 1
|
|
56
|
-
|
|
57
|
-
log_function_exit "validate_inputs"
|
|
58
|
-
return 0
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
# Setup temporary workspace
|
|
62
|
-
setup_workspace() {
|
|
63
|
-
log_function_entry "setup_workspace"
|
|
64
|
-
|
|
65
|
-
temp_dir="/tmp/update-refs-$$"
|
|
66
|
-
id_mapping_file="$temp_dir/id-mapping.txt"
|
|
67
|
-
|
|
68
|
-
log_info "Creating workspace: $temp_dir"
|
|
69
|
-
mkdir -p "$temp_dir"
|
|
70
|
-
|
|
71
|
-
# Cleanup on exit
|
|
72
|
-
trap "cleanup_workspace" EXIT
|
|
73
|
-
|
|
74
|
-
log_function_exit "setup_workspace"
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
# Cleanup workspace
|
|
78
|
-
cleanup_workspace() {
|
|
79
|
-
if [[ -n "$temp_dir" ]] && [[ -d "$temp_dir" ]]; then
|
|
80
|
-
log_debug "Cleaning up workspace: $temp_dir"
|
|
81
|
-
rm -rf "$temp_dir"
|
|
82
|
-
fi
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
# Build mapping from old task numbers to new issue IDs
|
|
86
|
-
build_id_mapping() {
|
|
87
|
-
log_function_entry "build_id_mapping"
|
|
11
|
+
if [[ -z "$EPIC_NAME" ]] || [[ -z "$MAPPING_FILE" ]]; then
|
|
12
|
+
echo "❌ Error: Epic name and mapping file required"
|
|
13
|
+
echo "Usage: $0 <epic_name> <mapping_file>"
|
|
14
|
+
exit 1
|
|
15
|
+
fi
|
|
88
16
|
|
|
89
|
-
|
|
17
|
+
if [[ ! -f "$MAPPING_FILE" ]]; then
|
|
18
|
+
echo "❌ Error: Mapping file not found: $MAPPING_FILE"
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
90
21
|
|
|
91
|
-
|
|
22
|
+
EPIC_DIR=".claude/epics/$EPIC_NAME"
|
|
92
23
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
24
|
+
if [[ ! -d "$EPIC_DIR" ]]; then
|
|
25
|
+
echo "❌ Error: Epic directory not found: $EPIC_DIR"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
97
28
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
old_num=$(basename "$task_file" .md)
|
|
29
|
+
# Get repository info
|
|
30
|
+
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "unknown/repo")
|
|
101
31
|
|
|
102
|
-
|
|
103
|
-
if [[ "$old_num" =~ ^[0-9]{3}$ ]]; then
|
|
104
|
-
echo "$old_num:$task_number" >> "$id_mapping_file"
|
|
105
|
-
mapping_count=$((mapping_count + 1))
|
|
106
|
-
log_debug "Mapped $old_num → $task_number"
|
|
107
|
-
else
|
|
108
|
-
log_warning "Skipping non-numbered file: $task_file"
|
|
109
|
-
fi
|
|
110
|
-
done < "$TASK_MAPPING_FILE"
|
|
32
|
+
echo "🔗 Updating task references and renaming files"
|
|
111
33
|
|
|
112
|
-
|
|
34
|
+
# Read mapping file and rename files
|
|
35
|
+
while read -r old_name new_number; do
|
|
36
|
+
old_file="$EPIC_DIR/$old_name.md"
|
|
37
|
+
new_file="$EPIC_DIR/$new_number.md"
|
|
113
38
|
|
|
114
|
-
if [[
|
|
115
|
-
|
|
116
|
-
|
|
39
|
+
if [[ ! -f "$old_file" ]]; then
|
|
40
|
+
echo "⚠️ File not found: $old_file (skipping)"
|
|
41
|
+
continue
|
|
117
42
|
fi
|
|
118
43
|
|
|
119
|
-
|
|
120
|
-
return 0
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
# Update task files with new references and rename them
|
|
124
|
-
update_task_files() {
|
|
125
|
-
log_function_entry "update_task_files"
|
|
126
|
-
|
|
127
|
-
local updated_count=0
|
|
128
|
-
local skipped_count=0
|
|
129
|
-
|
|
130
|
-
# Get repository info for GitHub URLs
|
|
131
|
-
local repo_info
|
|
132
|
-
repo_info=$(get_repo_info)
|
|
133
|
-
local repo_name
|
|
134
|
-
repo_name=$(echo "$repo_info" | grep -o '"nameWithOwner":"[^"]*"' | cut -d'"' -f4)
|
|
135
|
-
|
|
136
|
-
log_info "Repository: $repo_name"
|
|
137
|
-
|
|
138
|
-
# Process each task file from the mapping
|
|
139
|
-
while IFS=: read -r task_file task_number; do
|
|
140
|
-
# Skip empty lines
|
|
141
|
-
[[ -n "$task_file" && -n "$task_number" ]] || continue
|
|
142
|
-
|
|
143
|
-
if [[ ! -f "$task_file" ]]; then
|
|
144
|
-
log_warning "Task file not found: $task_file"
|
|
145
|
-
skipped_count=$((skipped_count + 1))
|
|
146
|
-
continue
|
|
147
|
-
fi
|
|
148
|
-
|
|
149
|
-
log_info "Processing: $(basename "$task_file") → #$task_number"
|
|
150
|
-
|
|
151
|
-
# Update file with new references and frontmatter
|
|
152
|
-
if update_single_task_file "$task_file" "$task_number" "$repo_name"; then
|
|
153
|
-
updated_count=$((updated_count + 1))
|
|
154
|
-
else
|
|
155
|
-
log_error "Failed to update: $task_file"
|
|
156
|
-
skipped_count=$((skipped_count + 1))
|
|
157
|
-
fi
|
|
158
|
-
|
|
159
|
-
done < "$TASK_MAPPING_FILE"
|
|
160
|
-
|
|
161
|
-
log_info "Updated $updated_count files, skipped $skipped_count files"
|
|
162
|
-
log_function_exit "update_task_files"
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
# Update a single task file with new references
|
|
166
|
-
update_single_task_file() {
|
|
167
|
-
local task_file="$1"
|
|
168
|
-
local task_number="$2"
|
|
169
|
-
local repo_name="$3"
|
|
44
|
+
echo -n " Renaming $old_name.md → $new_number.md... "
|
|
170
45
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
local epic_dir
|
|
174
|
-
epic_dir=$(dirname "$task_file")
|
|
175
|
-
local new_filename="${task_number}.md"
|
|
176
|
-
local new_filepath="$epic_dir/$new_filename"
|
|
177
|
-
|
|
178
|
-
# Read the original file content
|
|
179
|
-
local content
|
|
180
|
-
content=$(cat "$task_file")
|
|
181
|
-
|
|
182
|
-
# Update dependencies and conflicts references
|
|
183
|
-
while IFS=: read -r old_num new_num; do
|
|
184
|
-
# Update references in arrays like [001, 002] and individual references
|
|
185
|
-
# Use word boundaries to avoid partial matches
|
|
186
|
-
content=$(echo "$content" | sed "s/\\b$old_num\\b/$new_num/g")
|
|
187
|
-
done < "$id_mapping_file"
|
|
188
|
-
|
|
189
|
-
# Write updated content to new file
|
|
190
|
-
echo "$content" > "$new_filepath"
|
|
46
|
+
# Create backup
|
|
47
|
+
cp "$old_file" "$old_file.backup"
|
|
191
48
|
|
|
192
49
|
# Update frontmatter with GitHub URL and timestamp
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
50
|
+
github_url="https://github.com/$REPO/issues/$new_number"
|
|
51
|
+
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
52
|
+
|
|
53
|
+
# Update frontmatter
|
|
54
|
+
awk -v url="$github_url" -v ts="$timestamp" '
|
|
55
|
+
BEGIN { in_front=0; front_done=0 }
|
|
56
|
+
/^---$/ {
|
|
57
|
+
if (!front_done) {
|
|
58
|
+
in_front = !in_front
|
|
59
|
+
if (!in_front) front_done=1
|
|
60
|
+
}
|
|
61
|
+
print
|
|
62
|
+
next
|
|
63
|
+
}
|
|
64
|
+
in_front && /^github:/ {
|
|
65
|
+
print "github: " url
|
|
66
|
+
next
|
|
67
|
+
}
|
|
68
|
+
in_front && /^updated:/ {
|
|
69
|
+
print "updated: " ts
|
|
70
|
+
next
|
|
71
|
+
}
|
|
72
|
+
{ print }
|
|
73
|
+
' "$old_file" > "$new_file"
|
|
74
|
+
|
|
75
|
+
# Remove old file if new file was created successfully
|
|
76
|
+
if [[ -f "$new_file" ]]; then
|
|
77
|
+
rm "$old_file"
|
|
78
|
+
rm "$old_file.backup"
|
|
79
|
+
echo "✓"
|
|
205
80
|
else
|
|
206
|
-
|
|
81
|
+
# Restore from backup if something went wrong
|
|
82
|
+
mv "$old_file.backup" "$old_file"
|
|
83
|
+
echo "FAILED"
|
|
207
84
|
fi
|
|
208
85
|
|
|
209
|
-
|
|
210
|
-
return 0
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
# Display update results
|
|
214
|
-
display_results() {
|
|
215
|
-
local epic_dir=".claude/epics/$EPIC_NAME"
|
|
216
|
-
|
|
217
|
-
print_section "✅ Task References Update Results"
|
|
218
|
-
|
|
219
|
-
echo "Epic: $EPIC_NAME"
|
|
220
|
-
echo "Updated files:"
|
|
221
|
-
|
|
222
|
-
# List all numbered task files (now with issue numbers)
|
|
223
|
-
local task_files=()
|
|
224
|
-
readarray -t task_files < <(find "$epic_dir" -name '[0-9]*.md' -type f | sort -n)
|
|
225
|
-
|
|
226
|
-
for task_file in "${task_files[@]}"; do
|
|
227
|
-
local issue_number
|
|
228
|
-
issue_number=$(basename "$task_file" .md)
|
|
229
|
-
|
|
230
|
-
local task_name
|
|
231
|
-
task_name=$(get_frontmatter_field "$task_file" "name" 2>/dev/null || echo "Unknown")
|
|
232
|
-
|
|
233
|
-
local github_url
|
|
234
|
-
github_url=$(get_frontmatter_field "$task_file" "github" 2>/dev/null || echo "")
|
|
235
|
-
|
|
236
|
-
echo " #$issue_number: $task_name"
|
|
237
|
-
if [[ -n "$github_url" ]]; then
|
|
238
|
-
echo " → $github_url"
|
|
239
|
-
fi
|
|
240
|
-
done
|
|
241
|
-
|
|
242
|
-
echo ""
|
|
243
|
-
echo "✅ All task files updated with GitHub issue numbers"
|
|
244
|
-
echo "✅ All dependency references updated"
|
|
245
|
-
echo "✅ Frontmatter updated with GitHub URLs"
|
|
246
|
-
|
|
247
|
-
# Check for any remaining old-format files
|
|
248
|
-
local old_files=()
|
|
249
|
-
readarray -t old_files < <(find "$epic_dir" -name '[0-9][0-9][0-9].md' -type f 2>/dev/null || true)
|
|
250
|
-
|
|
251
|
-
if [[ ${#old_files[@]} -gt 0 ]]; then
|
|
252
|
-
echo ""
|
|
253
|
-
echo "⚠️ Warning: Found old-format files that weren't processed:"
|
|
254
|
-
printf " - %s\n" "${old_files[@]}"
|
|
255
|
-
fi
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
# Validate dependency references in a task file
|
|
259
|
-
validate_task_dependencies() {
|
|
260
|
-
local task_file="$1"
|
|
261
|
-
|
|
262
|
-
log_function_entry "validate_task_dependencies" "$(basename "$task_file")"
|
|
263
|
-
|
|
264
|
-
# Extract depends_on and conflicts_with arrays
|
|
265
|
-
local depends_on
|
|
266
|
-
local conflicts_with
|
|
267
|
-
|
|
268
|
-
depends_on=$(get_frontmatter_field "$task_file" "depends_on" 2>/dev/null || echo "")
|
|
269
|
-
conflicts_with=$(get_frontmatter_field "$task_file" "conflicts_with" 2>/dev/null || echo "")
|
|
270
|
-
|
|
271
|
-
# Check if references are still in old format (3-digit numbers)
|
|
272
|
-
local has_old_refs=false
|
|
273
|
-
|
|
274
|
-
if [[ "$depends_on" =~ [0-9]{3} ]]; then
|
|
275
|
-
log_warning "$(basename "$task_file"): depends_on still has old references: $depends_on"
|
|
276
|
-
has_old_refs=true
|
|
277
|
-
fi
|
|
278
|
-
|
|
279
|
-
if [[ "$conflicts_with" =~ [0-9]{3} ]]; then
|
|
280
|
-
log_warning "$(basename "$task_file"): conflicts_with still has old references: $conflicts_with"
|
|
281
|
-
has_old_refs=true
|
|
282
|
-
fi
|
|
283
|
-
|
|
284
|
-
if [[ "$has_old_refs" == "true" ]]; then
|
|
285
|
-
log_function_exit "validate_task_dependencies" 1
|
|
286
|
-
return 1
|
|
287
|
-
fi
|
|
288
|
-
|
|
289
|
-
log_debug "Task dependencies validated: $(basename "$task_file")"
|
|
290
|
-
log_function_exit "validate_task_dependencies"
|
|
291
|
-
return 0
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
# Error handling
|
|
295
|
-
handle_error() {
|
|
296
|
-
local exit_code=$?
|
|
297
|
-
log_error "Script failed with exit code: $exit_code"
|
|
298
|
-
log_error "Task references update failed for epic: $EPIC_NAME"
|
|
299
|
-
exit "$exit_code"
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
# Set up error handling
|
|
303
|
-
trap handle_error ERR
|
|
304
|
-
|
|
305
|
-
# Validate arguments
|
|
306
|
-
if [[ $# -ne 2 ]]; then
|
|
307
|
-
echo "Usage: $0 <epic_name> <task_mapping_file>"
|
|
308
|
-
echo ""
|
|
309
|
-
echo "Updates task file references and renames files to use GitHub issue numbers."
|
|
310
|
-
echo ""
|
|
311
|
-
echo "Arguments:"
|
|
312
|
-
echo " epic_name Name of the epic directory"
|
|
313
|
-
echo " task_mapping_file File containing task_file:issue_number mappings"
|
|
314
|
-
echo ""
|
|
315
|
-
echo "The mapping file should contain lines in the format:"
|
|
316
|
-
echo " /path/to/001.md:123"
|
|
317
|
-
echo " /path/to/002.md:124"
|
|
318
|
-
echo ""
|
|
319
|
-
echo "Examples:"
|
|
320
|
-
echo " $0 authentication /tmp/task-mapping.txt"
|
|
321
|
-
echo " $0 user-dashboard ./epic-mappings.txt"
|
|
322
|
-
echo ""
|
|
323
|
-
exit 1
|
|
324
|
-
fi
|
|
86
|
+
done < "$MAPPING_FILE"
|
|
325
87
|
|
|
326
|
-
|
|
327
|
-
|
|
88
|
+
echo ""
|
|
89
|
+
echo "✅ Task files renamed and frontmatter updated"
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Epic Sync - Complete Orchestration
|
|
3
|
+
# Orchestrates the full epic sync workflow with all 4 modular scripts
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
EPIC_NAME="${1:-}"
|
|
9
|
+
|
|
10
|
+
if [[ -z "$EPIC_NAME" ]]; then
|
|
11
|
+
echo ""
|
|
12
|
+
echo "❌ Error: Epic name required"
|
|
13
|
+
echo ""
|
|
14
|
+
echo "Usage: $0 <epic_name>"
|
|
15
|
+
echo ""
|
|
16
|
+
echo "Example:"
|
|
17
|
+
echo " $0 postgresql-connection-module"
|
|
18
|
+
echo ""
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
EPIC_DIR=".claude/epics/$EPIC_NAME"
|
|
23
|
+
|
|
24
|
+
# Validate epic exists
|
|
25
|
+
if [[ ! -d "$EPIC_DIR" ]]; then
|
|
26
|
+
echo "❌ Error: Epic directory not found: $EPIC_DIR"
|
|
27
|
+
echo ""
|
|
28
|
+
echo "Create an epic first:"
|
|
29
|
+
echo " /pm:prd-new $EPIC_NAME"
|
|
30
|
+
echo " /pm:prd-parse $EPIC_NAME"
|
|
31
|
+
echo " /pm:epic-decompose $EPIC_NAME"
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
if [[ ! -f "$EPIC_DIR/epic.md" ]]; then
|
|
36
|
+
echo "❌ Error: Epic file not found: $EPIC_DIR/epic.md"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
# Check for tasks
|
|
41
|
+
task_count=$(find "$EPIC_DIR" -name "[0-9]*.md" -type f 2>/dev/null | wc -l)
|
|
42
|
+
if [[ $task_count -eq 0 ]]; then
|
|
43
|
+
echo "❌ Error: No tasks found in $EPIC_DIR"
|
|
44
|
+
echo ""
|
|
45
|
+
echo "Create tasks first:"
|
|
46
|
+
echo " /pm:epic-decompose $EPIC_NAME"
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
echo ""
|
|
51
|
+
echo "🚀 Starting Epic Sync"
|
|
52
|
+
echo "═══════════════════════════════════════════"
|
|
53
|
+
echo " Epic: $EPIC_NAME"
|
|
54
|
+
echo " Tasks: $task_count"
|
|
55
|
+
echo "═══════════════════════════════════════════"
|
|
56
|
+
echo ""
|
|
57
|
+
|
|
58
|
+
# Step 1: Create epic issue
|
|
59
|
+
echo "📝 Step 1/4: Creating Epic Issue"
|
|
60
|
+
echo "─────────────────────────────────────────"
|
|
61
|
+
|
|
62
|
+
epic_number=$(bash "$SCRIPT_DIR/epic-sync/create-epic-issue.sh" "$EPIC_NAME")
|
|
63
|
+
|
|
64
|
+
if [[ -z "$epic_number" ]]; then
|
|
65
|
+
echo ""
|
|
66
|
+
echo "❌ Failed to create epic issue"
|
|
67
|
+
exit 1
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
echo ""
|
|
71
|
+
echo "✅ Epic issue created: #$epic_number"
|
|
72
|
+
echo ""
|
|
73
|
+
|
|
74
|
+
# Step 2: Create task issues
|
|
75
|
+
echo "📋 Step 2/4: Creating Task Issues"
|
|
76
|
+
echo "─────────────────────────────────────────"
|
|
77
|
+
|
|
78
|
+
task_mapping_file=$(bash "$SCRIPT_DIR/epic-sync/create-task-issues.sh" "$EPIC_NAME" "$epic_number")
|
|
79
|
+
|
|
80
|
+
if [[ ! -f "$task_mapping_file" ]]; then
|
|
81
|
+
echo ""
|
|
82
|
+
echo "❌ Failed to create task issues or mapping file"
|
|
83
|
+
exit 1
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
echo ""
|
|
87
|
+
echo "✅ Task issues created"
|
|
88
|
+
echo " Mapping: $task_mapping_file"
|
|
89
|
+
echo ""
|
|
90
|
+
|
|
91
|
+
# Step 3: Update references and rename files
|
|
92
|
+
echo "🔗 Step 3/4: Updating References & Renaming Files"
|
|
93
|
+
echo "─────────────────────────────────────────"
|
|
94
|
+
|
|
95
|
+
bash "$SCRIPT_DIR/epic-sync/update-references.sh" "$EPIC_NAME" "$task_mapping_file"
|
|
96
|
+
|
|
97
|
+
echo ""
|
|
98
|
+
echo "✅ Files renamed and references updated"
|
|
99
|
+
echo ""
|
|
100
|
+
|
|
101
|
+
# Step 4: Update epic file
|
|
102
|
+
echo "📄 Step 4/4: Updating Epic File"
|
|
103
|
+
echo "─────────────────────────────────────────"
|
|
104
|
+
|
|
105
|
+
bash "$SCRIPT_DIR/epic-sync/update-epic-file.sh" "$EPIC_NAME" "$epic_number"
|
|
106
|
+
|
|
107
|
+
echo ""
|
|
108
|
+
|
|
109
|
+
# Get repository info for final output
|
|
110
|
+
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "unknown/repo")
|
|
111
|
+
|
|
112
|
+
# Final summary
|
|
113
|
+
echo ""
|
|
114
|
+
echo "✨ Epic Sync Complete!"
|
|
115
|
+
echo "═══════════════════════════════════════════"
|
|
116
|
+
echo ""
|
|
117
|
+
echo "📊 Summary:"
|
|
118
|
+
echo " Epic: #$epic_number - $EPIC_NAME"
|
|
119
|
+
echo " Tasks: $task_count issues created"
|
|
120
|
+
echo " Files: Renamed to GitHub issue numbers"
|
|
121
|
+
echo ""
|
|
122
|
+
echo "🔗 Links:"
|
|
123
|
+
echo " Epic: https://github.com/$REPO/issues/$epic_number"
|
|
124
|
+
echo " Tasks: View in GitHub project board"
|
|
125
|
+
echo ""
|
|
126
|
+
echo "📁 Local Files:"
|
|
127
|
+
echo " Epic: $EPIC_DIR/epic.md"
|
|
128
|
+
echo " Tasks: $EPIC_DIR/<issue_number>.md"
|
|
129
|
+
echo " Mapping: $EPIC_DIR/.task-mapping.txt"
|
|
130
|
+
echo ""
|
|
131
|
+
echo "📋 Next Steps:"
|
|
132
|
+
echo " 1. Review epic and tasks on GitHub"
|
|
133
|
+
echo " 2. Start working on a task:"
|
|
134
|
+
echo " /pm:issue-start <issue_number>"
|
|
135
|
+
echo " 3. Or start the full epic in parallel:"
|
|
136
|
+
echo " /pm:epic-start $EPIC_NAME"
|
|
137
|
+
echo ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-autopm",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "Autonomous Project Management Framework for Claude Code - Advanced AI-powered development automation",
|
|
5
5
|
"main": "bin/autopm.js",
|
|
6
6
|
"bin": {
|
|
@@ -63,7 +63,9 @@
|
|
|
63
63
|
"pm:test": "node scripts/self-maintenance.js test",
|
|
64
64
|
"pm:metrics": "node scripts/self-maintenance.js metrics",
|
|
65
65
|
"pm:optimize": "node scripts/self-maintenance.js optimize",
|
|
66
|
-
"pm:health": "node scripts/self-maintenance.js health"
|
|
66
|
+
"pm:health": "node scripts/self-maintenance.js health",
|
|
67
|
+
"validate:paths": "bash scripts/validate-framework-paths.sh",
|
|
68
|
+
"setup:githooks": "bash scripts/setup-githooks.sh"
|
|
67
69
|
},
|
|
68
70
|
"keywords": [
|
|
69
71
|
"ai",
|