Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions ccpm/commands/pm/epic-merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Navigate to worktree and check status:
cd ../epic-$ARGUMENTS

# Check for uncommitted changes
if [[ $(git status --porcelain) ]]; then
if [[ `git status --porcelain` ]]; then
echo "⚠️ Uncommitted changes in worktree:"
git status --short
echo "Commit or stash changes before merging"
Expand Down Expand Up @@ -104,7 +104,7 @@ if [ -d ".claude/epics/$ARGUMENTS" ]; then
cd .claude/epics/$ARGUMENTS
for task_file in [0-9]*.md; do
[ -f "$task_file" ] || continue
task_name=$(grep '^name:' "$task_file" | cut -d: -f2 | sed 's/^ *//')
task_name=`grep '^name:' "$task_file" | cut -d: -f2 | sed 's/^ *//'`
feature_list="$feature_list\n- $task_name"
done
cd - > /dev/null
Expand All @@ -113,9 +113,9 @@ fi
echo "$feature_list"

# Extract epic issue number
epic_github_line=$(grep 'github:' .claude/epics/$ARGUMENTS/epic.md 2>/dev/null || true)
epic_github_line=`grep 'github:' .claude/epics/$ARGUMENTS/epic.md 2>/dev/null || true`
if [ -n "$epic_github_line" ]; then
epic_issue=$(echo "$epic_github_line" | grep -oE '[0-9]+' || true)
epic_issue=`echo "$epic_github_line" | grep -oE '[0-9]+' || true`
if [ -n "$epic_issue" ]; then
echo "\nCloses epic #$epic_issue"
fi
Expand All @@ -133,7 +133,7 @@ echo "
❌ Merge conflicts detected!

Conflicts in:
$(git diff --name-only --diff-filter=U)
`git diff --name-only --diff-filter=U`

Options:
1. Resolve manually:
Expand Down Expand Up @@ -179,9 +179,9 @@ Close related issues:
```bash
# Get issue numbers from epic
# Extract epic issue number
epic_github_line=$(grep 'github:' .claude/epics/archived/$ARGUMENTS/epic.md 2>/dev/null || true)
epic_github_line=`grep 'github:' .claude/epics/archived/$ARGUMENTS/epic.md 2>/dev/null || true`
if [ -n "$epic_github_line" ]; then
epic_issue=$(echo "$epic_github_line" | grep -oE '[0-9]+$' || true)
epic_issue=`echo "$epic_github_line" | grep -oE '[0-9]+$' || true`
else
epic_issue=""
fi
Expand All @@ -193,9 +193,9 @@ gh issue close $epic_issue -c "Epic completed and merged to main"
for task_file in .claude/epics/archived/$ARGUMENTS/[0-9]*.md; do
[ -f "$task_file" ] || continue
# Extract task issue number
task_github_line=$(grep 'github:' "$task_file" 2>/dev/null || true)
task_github_line=`grep 'github:' "$task_file" 2>/dev/null || true`
if [ -n "$task_github_line" ]; then
issue_num=$(echo "$task_github_line" | grep -oE '[0-9]+$' || true)
issue_num=`echo "$task_github_line" | grep -oE '[0-9]+$' || true`
else
issue_num=""
fi
Expand Down
6 changes: 3 additions & 3 deletions ccpm/commands/pm/epic-refresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ if [ ! -z "$epic_issue" ]; then
# For each task, check its status and update checkbox
for task_file in .claude/epics/$ARGUMENTS/[0-9]*.md; do
# Extract task issue number
task_github_line=$(grep 'github:' "$task_file" 2>/dev/null || true)
task_github_line=`grep 'github:' "$task_file" 2>/dev/null || true`
if [ -n "$task_github_line" ]; then
task_issue=$(echo "$task_github_line" | grep -oE '[0-9]+$' || true)
task_issue=`echo "$task_github_line" | grep -oE '[0-9]+$' || true`
else
task_issue=""
fi
task_status=$(grep 'status:' $task_file | cut -d: -f2 | tr -d ' ')
task_status=`grep 'status:' $task_file | cut -d: -f2 | tr -d ' '`

if [ "$task_status" = "closed" ]; then
# Mark as checked
Expand Down
2 changes: 1 addition & 1 deletion ccpm/commands/pm/epic-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Follow `/rules/branch-operations.md`:

```bash
# Check for uncommitted changes
if [ -n "$(git status --porcelain)" ]; then
if [ -n "`git status --porcelain`" ]; then
echo "❌ You have uncommitted changes. Please commit or stash them before starting an epic."
exit 1
fi
Expand Down
54 changes: 27 additions & 27 deletions ccpm/commands/pm/epic-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Follow `/rules/github-operations.md` to ensure we're not syncing to the CCPM tem

```bash
# Check if remote origin is the CCPM template repository
remote_url=$(git remote get-url origin 2>/dev/null || echo "")
remote_url=`git remote get-url origin 2>/dev/null || echo ""`
if [[ "$remote_url" == *"automazeio/ccpm"* ]] || [[ "$remote_url" == *"automazeio/ccpm.git"* ]]; then
echo "❌ ERROR: You're trying to sync with the CCPM template repository!"
echo ""
Expand All @@ -58,8 +58,8 @@ fi
#### First, detect the GitHub repository:
```bash
# Get the current repository from git remote
remote_url=$(git remote get-url origin 2>/dev/null || echo "")
REPO=$(echo "$remote_url" | sed 's|.*github.com[:/]||' | sed 's|\.git$||')
remote_url=`git remote get-url origin 2>/dev/null || echo ""`
REPO=`echo "$remote_url" | sed 's|.*github.com[:/]||' | sed 's|\.git$||'`
[ -z "$REPO" ] && REPO="user/repo"
echo "Creating issues in repository: $REPO"
```
Expand Down Expand Up @@ -118,12 +118,12 @@ else
fi

# Create epic issue with labels
epic_number=$(gh issue create \
epic_number=`gh issue create \
--repo "$REPO" \
--title "Epic: $ARGUMENTS" \
--body-file /tmp/epic-body.md \
--label "epic,epic:$ARGUMENTS,$epic_type" \
--json number -q .number)
--json number -q .number`
```

Store the returned issue number for epic frontmatter update.
Expand All @@ -142,7 +142,7 @@ fi

Count task files to determine strategy:
```bash
task_count=$(ls .claude/epics/$ARGUMENTS/[0-9][0-9][0-9].md 2>/dev/null | wc -l)
task_count=`ls .claude/epics/$ARGUMENTS/[0-9][0-9][0-9].md 2>/dev/null | wc -l`
```

### For Small Batches (< 5 tasks): Sequential Creation
Expand All @@ -154,26 +154,26 @@ if [ "$task_count" -lt 5 ]; then
[ -f "$task_file" ] || continue

# Extract task name from frontmatter
task_name=$(grep '^name:' "$task_file" | sed 's/^name: *//')
task_name=`grep '^name:' "$task_file" | sed 's/^name: *//'`

# Strip frontmatter from task content
sed '1,/^---$/d; 1,/^---$/d' "$task_file" > /tmp/task-body.md

# Create sub-issue with labels
if [ "$use_subissues" = true ]; then
task_number=$(gh sub-issue create \
task_number=`gh sub-issue create \
--parent "$epic_number" \
--title "$task_name" \
--body-file /tmp/task-body.md \
--label "task,epic:$ARGUMENTS" \
--json number -q .number)
--json number -q .number`
else
task_number=$(gh issue create \
task_number=`gh issue create \
--repo "$REPO" \
--title "$task_name" \
--body-file /tmp/task-body.md \
--label "task,epic:$ARGUMENTS" \
--json number -q .number)
--json number -q .number`
fi

# Record mapping for renaming
Expand Down Expand Up @@ -252,7 +252,7 @@ First, build a mapping of old numbers to new issue IDs:
> /tmp/id-mapping.txt
while IFS=: read -r task_file task_number; do
# Extract old number from filename (e.g., 001 from 001.md)
old_num=$(basename "$task_file" .md)
old_num=`basename "$task_file" .md`
echo "$old_num:$task_number" >> /tmp/id-mapping.txt
done < /tmp/task-mapping.txt
```
Expand All @@ -261,15 +261,15 @@ Then rename files and update all references:
```bash
# Process each task file
while IFS=: read -r task_file task_number; do
new_name="$(dirname "$task_file")/${task_number}.md"
new_name="`dirname "$task_file"`/${task_number}.md"

# Read the file content
content=$(cat "$task_file")
content=`cat "$task_file"`

# Update depends_on and conflicts_with references
while IFS=: read -r old_num new_num; do
# Update arrays like [001, 002] to use new issue numbers
content=$(echo "$content" | sed "s/\b$old_num\b/$new_num/g")
content=`echo "$content" | sed "s/\b$old_num\b/$new_num/g"`
done < /tmp/id-mapping.txt

# Write updated content to new file
Expand All @@ -280,11 +280,11 @@ while IFS=: read -r task_file task_number; do

# Update github field in frontmatter
# Add the GitHub URL to the frontmatter
repo=$(gh repo view --json nameWithOwner -q .nameWithOwner)
repo=`gh repo view --json nameWithOwner -q .nameWithOwner`
github_url="https://github.com/$repo/issues/$task_number"

# Update frontmatter with GitHub URL and current timestamp
current_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
current_date=`date -u +"%Y-%m-%dT%H:%M:%SZ"`

# Use sed to update the github and updated fields
sed -i.bak "/^github:/c\github: $github_url" "$new_name"
Expand Down Expand Up @@ -325,9 +325,9 @@ Update the epic file with GitHub URL, timestamp, and real task IDs:
#### 5a. Update Frontmatter
```bash
# Get repo info
repo=$(gh repo view --json nameWithOwner -q .nameWithOwner)
repo=`gh repo view --json nameWithOwner -q .nameWithOwner`
epic_url="https://github.com/$repo/issues/$epic_number"
current_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
current_date=`date -u +"%Y-%m-%dT%H:%M:%SZ"`

# Update epic frontmatter
sed -i.bak "/^github:/c\github: $epic_url" .claude/epics/$ARGUMENTS/epic.md
Expand All @@ -347,21 +347,21 @@ for task_file in .claude/epics/$ARGUMENTS/[0-9]*.md; do
[ -f "$task_file" ] || continue

# Get issue number (filename without .md)
issue_num=$(basename "$task_file" .md)
issue_num=`basename "$task_file" .md`

# Get task name from frontmatter
task_name=$(grep '^name:' "$task_file" | sed 's/^name: *//')
task_name=`grep '^name:' "$task_file" | sed 's/^name: *//'`

# Get parallel status
parallel=$(grep '^parallel:' "$task_file" | sed 's/^parallel: *//')
parallel=`grep '^parallel:' "$task_file" | sed 's/^parallel: *//'`

# Add to tasks section
echo "- [ ] #${issue_num} - ${task_name} (parallel: ${parallel})" >> /tmp/tasks-section.md
done

# Add summary statistics
total_count=$(ls .claude/epics/$ARGUMENTS/[0-9]*.md 2>/dev/null | wc -l)
parallel_count=$(grep -l '^parallel: true' .claude/epics/$ARGUMENTS/[0-9]*.md 2>/dev/null | wc -l)
total_count=`ls .claude/epics/$ARGUMENTS/[0-9]*.md 2>/dev/null | wc -l`
parallel_count=`grep -l '^parallel: true' .claude/epics/$ARGUMENTS/[0-9]*.md 2>/dev/null | wc -l`
sequential_count=$((total_count - parallel_count))

cat >> /tmp/tasks-section.md << EOF
Expand Down Expand Up @@ -408,15 +408,15 @@ EOF
for task_file in .claude/epics/$ARGUMENTS/[0-9]*.md; do
[ -f "$task_file" ] || continue

issue_num=$(basename "$task_file" .md)
task_name=$(grep '^name:' "$task_file" | sed 's/^name: *//')
issue_num=`basename "$task_file" .md`
task_name=`grep '^name:' "$task_file" | sed 's/^name: *//'`

echo "- #${issue_num}: ${task_name} - https://github.com/${repo}/issues/${issue_num}" >> .claude/epics/$ARGUMENTS/github-mapping.md
done

# Add sync timestamp
echo "" >> .claude/epics/$ARGUMENTS/github-mapping.md
echo "Synced: $(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> .claude/epics/$ARGUMENTS/github-mapping.md
echo "Synced: `date -u +"%Y-%m-%dT%H:%M:%SZ"`" >> .claude/epics/$ARGUMENTS/github-mapping.md
```

### 7. Create Worktree
Expand Down
2 changes: 1 addition & 1 deletion ccpm/commands/pm/issue-close.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Check the task checkbox in the epic issue:
epic_name={extract_from_path}

# Get epic issue number from epic.md
epic_issue=$(grep 'github:' .claude/epics/$epic_name/epic.md | grep -oE '[0-9]+$')
epic_issue=`grep 'github:' .claude/epics/$epic_name/epic.md | grep -oE '[0-9]+$'`

if [ ! -z "$epic_issue" ]; then
# Get current epic body
Expand Down
2 changes: 1 addition & 1 deletion ccpm/commands/pm/issue-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Do not bother the user with preflight checks progress ("I'm not going to ...").
0. **Repository Protection Check:**
Follow `/rules/github-operations.md` - check remote origin:
```bash
remote_url=$(git remote get-url origin 2>/dev/null || echo "")
remote_url=`git remote get-url origin 2>/dev/null || echo ""`
if [[ "$remote_url" == *"automazeio/ccpm"* ]]; then
echo "❌ ERROR: Cannot sync to CCPM template repository!"
echo "Update your remote: git remote set-url origin https://github.com/YOUR_USERNAME/YOUR_REPO.git"
Expand Down
6 changes: 3 additions & 3 deletions ccpm/commands/pm/test-reference-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ EOF
# Create old -> new ID mapping
> /tmp/id-mapping.txt
while IFS=: read -r task_file task_number; do
old_num=$(basename "$task_file" .md)
old_num=`basename "$task_file" .md`
echo "$old_num:$task_number" >> /tmp/id-mapping.txt
done < /tmp/task-mapping.txt

Expand All @@ -90,11 +90,11 @@ while IFS=: read -r task_file task_number; do
echo "Processing: $task_file -> $task_number.md"

# Read the file content
content=$(cat "$task_file")
content=`cat "$task_file"`

# Update references
while IFS=: read -r old_num new_num; do
content=$(echo "$content" | sed "s/\b$old_num\b/$new_num/g")
content=`echo "$content" | sed "s/\b$old_num\b/$new_num/g"`
done < /tmp/id-mapping.txt

# Write to new file
Expand Down
12 changes: 6 additions & 6 deletions ccpm/hooks/bash-worktree-fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ shell_squote() {
# Detect if CWD is inside a *linked worktree* and print the worktree root.
# Returns 0 with path on stdout if yes; 1 otherwise.
get_worktree_path() {
check_dir="$(pwd)"
check_dir="`pwd`"

if [ ! -d "${check_dir}" ]; then
debug_log "pwd is not a directory: ${check_dir}"
Expand All @@ -35,7 +35,7 @@ get_worktree_path() {
if [ -r "${check_dir}/.git" ]; then
IFS= read -r gitdir_content < "${check_dir}/.git" || gitdir_content=""
# Strip a possible trailing CR (CRLF files)
gitdir_content=$(printf %s "$gitdir_content" | tr -d '\r')
gitdir_content=`printf %s "$gitdir_content" | tr -d '\r'`
else
debug_log "Unreadable .git file at: ${check_dir}"
fi
Expand Down Expand Up @@ -81,7 +81,7 @@ get_worktree_path() {
return 1
fi

check_dir=$(dirname "${check_dir}")
check_dir=`dirname "${check_dir}"`
done

debug_log "No git repository found"
Expand Down Expand Up @@ -141,7 +141,7 @@ inject_prefix() {
worktree_path=$1
command=$2

qpath=$(shell_squote "${worktree_path}")
qpath=`shell_squote "${worktree_path}"`

# Right-trim spaces (portable loop)
trimmed=${command}
Expand Down Expand Up @@ -170,7 +170,7 @@ main() {
debug_log "Processing command: ${original_command}"

# Fast path: if not in a worktree, pass through unchanged
if ! worktree_path="$(get_worktree_path)"; then
if ! worktree_path="`get_worktree_path`"; then
debug_log "Not in worktree, passing through unchanged"
printf '%s\n' "${original_command}"
exit 0
Expand All @@ -180,7 +180,7 @@ main() {
debug_log "Passing through unchanged"
printf '%s\n' "${original_command}"
else
modified_command="$(inject_prefix "${worktree_path}" "${original_command}")"
modified_command="`inject_prefix "${worktree_path}" "${original_command}"`"
debug_log "Modified command: ${modified_command}"
printf '%s\n' "${modified_command}"
fi
Expand Down
2 changes: 1 addition & 1 deletion ccpm/rules/agent-coordination.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Before modifying a shared file:
git status {file}

# If modified by another agent, wait
if [[ $(git status --porcelain {file}) ]]; then
if [[ `git status --porcelain {file}` ]]; then
echo "Waiting for {file} to be available..."
sleep 30
# Retry
Expand Down
4 changes: 2 additions & 2 deletions ccpm/rules/datetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ updated: 2024-01-15T14:30:45Z # Use actual output from date command
**Creating a new PRD:**
```bash
# First, get current datetime
CURRENT_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
CURRENT_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
# Output: 2024-01-15T14:30:45Z

# Then use in frontmatter:
Expand All @@ -75,7 +75,7 @@ created: 2024-01-15T14:30:45Z # Use the actual $CURRENT_DATE value
**Updating an existing task:**
```bash
# Get current datetime for update
UPDATE_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
UPDATE_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`

# Update only the 'updated' field:
---
Expand Down
Loading