this repo has no description

agents: make dev-philosophy an actual skill

seth.computer b1e35a09 15709c00

verified
+428
+4
agents/skills/dev-philosophy.md agents/skills/dev-philosophy/SKILL.md
··· 1 + --- 2 + name: software-dev 3 + description: Use when the agent is performing any direct software development implementation or planning tasks. Provides the principles and values that must be followed. 4 + --- 1 5 # Software Development Philosophy 2 6 3 7 This skill defines how I approach software development. Apply these principles whenever working on code.
+328
agents/skills/task-execution/SKILL.md
··· 1 + --- 2 + name: task 3 + description: Start and track work on a task. Use when the user says "lets work on...", "start task", or invokes /task. Creates TASK.md and PLAN.md for requirements and implementation tracking, handles branch setup, creates worktrees, and pushes incremental progress to draft MRs. 4 + allowed-tools: 5 + - Read(TASK.md) 6 + - Read(PLAN.md) 7 + - Read(.worktree.yml) 8 + - Read(.claude/worktree.yml) 9 + - Write(TASK.md) 10 + - Write(PLAN.md) 11 + - Edit(TASK.md) 12 + - Edit(PLAN.md) 13 + - Bash(git:*) 14 + - Bash(~/.claude/skills/task-execution/worktree-setup.sh) 15 + - Bash(mkdir -p:*) 16 + - AskUserQuestion 17 + - TodoWrite 18 + --- 19 + 20 + # Task Execution 21 + 22 + Manage task lifecycle from start to completion using two files: 23 + - **TASK.md**: Requirements, context, questions, decisions 24 + - **PLAN.md**: Implementation steps with progress tracking 25 + 26 + --- 27 + 28 + ## Input 29 + 30 + Accept any combination of: 31 + - **Jira ticket** (e.g., `ADE-123`) 32 + - **Task description** (e.g., "add logout button") 33 + - **Both** 34 + 35 + --- 36 + 37 + ## Mode Detection 38 + 39 + Determine mode based on current directory: 40 + 41 + **Single-repo mode**: `git rev-parse --show-toplevel` succeeds 42 + - Working on one repository 43 + - `.tasks/` folder created in repo root 44 + - Worktree source is the repo itself 45 + 46 + **Multi-repo mode**: Not inside a git repo 47 + - Working across multiple repositories 48 + - `.tasks/` folder created in current directory 49 + - CLAUDE.md should specify repos location (e.g., `Repos: ./zapier/`) 50 + - Repos are listed in TASK.md during planning 51 + 52 + --- 53 + 54 + ## Phase 1: Task Setup 55 + 56 + ### 1. Detect Mode 57 + 58 + ```bash 59 + git rev-parse --show-toplevel # Success = single-repo, failure = multi-repo 60 + ``` 61 + 62 + ### 2. Gather Context 63 + 64 + - If Jira ticket provided: fetch it for context 65 + - Check for uncommitted changes in current directory 66 + - If uncommitted changes exist: STOP and ask how to handle them 67 + 68 + ### 3. Create Task Folder 69 + 70 + Generate task name: `{ticket-lower}-{short-description}` (e.g., `ade-123-add-logout`) 71 + 72 + ```bash 73 + mkdir -p .tasks/{task-name} 74 + ``` 75 + 76 + ### 4. Create TASK.md 77 + 78 + ```markdown 79 + # {Task Title} 80 + 81 + **Ticket**: {TICKET-NUM or N/A} 82 + **Branch**: {branch-name} 83 + 84 + ## Goal 85 + 86 + {What are we trying to achieve?} 87 + 88 + ## Requirements 89 + 90 + - {From ticket, discussion, or inferred} 91 + 92 + ## Repos 93 + 94 + {For multi-repo: list repos and what changes in each} 95 + {For single-repo: omit this section} 96 + 97 + ## Constraints 98 + 99 + - {Technical constraints, deadlines, scope limits} 100 + 101 + ## Open Questions 102 + 103 + - {Anything unclear that needs resolution} 104 + 105 + ## Decisions 106 + 107 + - {Decisions made during planning/implementation} 108 + ``` 109 + 110 + --- 111 + 112 + ## Phase 2: Planning 113 + 114 + Iterate on TASK.md until requirements are clear, then create PLAN.md. 115 + 116 + ### 1. Understand the Work 117 + 118 + - Explore relevant code 119 + - Identify affected areas and dependencies 120 + - Resolve open questions through discussion 121 + - For multi-repo: identify which repos are involved, update `## Repos` section 122 + 123 + ### 2. Create PLAN.md 124 + 125 + ```markdown 126 + # Implementation Plan 127 + 128 + ## Approach 129 + 130 + {High-level approach and key decisions} 131 + 132 + ## Steps 133 + 134 + - [ ] Step 1: {description} 135 + - [ ] Step 2: {description} 136 + - [ ] Step 3: {description} 137 + 138 + ## Testing 139 + 140 + - {How we'll verify the implementation} 141 + 142 + ## Files to Modify 143 + 144 + - `path/to/file.py` - {what changes} 145 + ``` 146 + 147 + ### 3. Get Approval 148 + 149 + For non-trivial tasks, confirm the plan before proceeding. 150 + 151 + --- 152 + 153 + ## Phase 3: Implementation 154 + 155 + ### 1. Create Worktrees 156 + 157 + For each repo involved (or the single repo in single-repo mode): 158 + 159 + **Find the source repo**: 160 + - Single-repo: `git rev-parse --show-toplevel` from task folder parent 161 + - Multi-repo: Use repos location from CLAUDE.md 162 + 163 + **Create worktree**: 164 + ```bash 165 + # Fetch latest 166 + git -C {source-repo} fetch origin 167 + 168 + # Create worktree with new branch 169 + git -C {source-repo} worktree add .tasks/{task-name}/{repo-name} -b {branch-name} origin/main 170 + ``` 171 + 172 + Branch name: `{ticket-lower}-{short-description}` (same as task folder) 173 + 174 + **Run setup**: 175 + ```bash 176 + cd .tasks/{task-name}/{repo-name} 177 + ~/.claude/skills/task-execution/worktree-setup.sh 178 + ``` 179 + 180 + This copies files and runs setup commands per `.worktree.yml` in the source repo. 181 + 182 + ### 2. Create Draft MR 183 + 184 + Push each branch and create draft merge requests: 185 + ```bash 186 + git -C .tasks/{task-name}/{repo-name} push -u origin {branch-name} 187 + # Create draft MR via glab 188 + ``` 189 + 190 + ### 3. Track Progress 191 + 192 + - Use TodoWrite for real-time tracking 193 + - Update PLAN.md checkboxes as steps complete 194 + - Update TASK.md with decisions and resolved questions 195 + 196 + ### 4. Commit Incrementally 197 + 198 + Make small, focused commits as you complete logical units: 199 + - Commit code changes as they're done 200 + - Push to draft MR regularly for CI feedback 201 + - Update and commit PLAN.md progress periodically 202 + 203 + ### 5. Follow TDD 204 + 205 + 1. Write failing test 206 + 2. Confirm failure 207 + 3. Implement minimum to pass 208 + 4. Confirm success 209 + 5. Refactor if needed 210 + 211 + --- 212 + 213 + ## Phase 4: Completion 214 + 215 + ### 1. Final Updates 216 + 217 + - Mark all PLAN.md steps complete 218 + - Update TASK.md with any final decisions 219 + - Ensure all tests pass 220 + 221 + ### 2. Ready for Review 222 + 223 + - Push final commits 224 + - Mark MR(s) as ready (no longer draft) 225 + - Ask if any follow-up tasks should be created 226 + 227 + ### 3. Cleanup 228 + 229 + After merge, task folder can be removed: 230 + ```bash 231 + # Remove worktrees 232 + git worktree remove .tasks/{task-name}/{repo-name} 233 + 234 + # Remove task folder 235 + rm -rf .tasks/{task-name} 236 + ``` 237 + 238 + --- 239 + 240 + ## File Maintenance 241 + 242 + **TASK.md**: Living document for collaboration 243 + - Add decisions as they're made 244 + - Resolve and remove open questions 245 + - Keep requirements updated if scope changes 246 + 247 + **PLAN.md**: Implementation checklist 248 + - Check off steps as completed 249 + - Add steps if scope expands 250 + - Note blockers or changes to approach 251 + 252 + **Prune aggressively**: Remove obsolete information. These files should stay useful, not become history logs. 253 + 254 + --- 255 + 256 + ## Resuming Work 257 + 258 + When returning to an existing task: 259 + 260 + 1. Read TASK.md and PLAN.md to restore context 261 + 2. Check git status in worktrees for uncommitted work 262 + 3. Review where we left off in PLAN.md 263 + 4. Continue from there 264 + 265 + --- 266 + 267 + ## Worktree Setup Script 268 + 269 + The script `~/.claude/skills/task-execution/worktree-setup.sh` runs in a new worktree to: 270 + 271 + 1. Find the main worktree (source repo) 272 + 2. Read `.worktree.yml` or `.claude/worktree.yml` from source 273 + 3. Copy files listed in `copy:` section 274 + 4. Run commands listed in `setup:` section 275 + 276 + **Example .worktree.yml**: 277 + ```yaml 278 + copy: 279 + - .env 280 + - .env.local 281 + - .envrc 282 + - .tool-versions 283 + 284 + setup: 285 + - npm install 286 + - direnv allow 287 + ``` 288 + 289 + --- 290 + 291 + ## Directory Structure Examples 292 + 293 + **Single-repo**: 294 + ``` 295 + some-repo/ 296 + ├── .tasks/ 297 + │ └── ade-123-fix-bug/ 298 + │ ├── TASK.md 299 + │ ├── PLAN.md 300 + │ └── some-repo/ # worktree 301 + ├── .worktree.yml 302 + └── src/ 303 + ``` 304 + 305 + **Multi-repo** (CLAUDE.md specifies `Repos: ./zapier/`): 306 + ``` 307 + ~/projects/zapier/ 308 + ├── .tasks/ 309 + │ └── ade-123-add-logout/ 310 + │ ├── TASK.md 311 + │ ├── PLAN.md 312 + │ ├── zapier-web/ # worktree 313 + │ └── zapier-api/ # worktree 314 + └── zapier/ 315 + ├── zapier-web/ 316 + └── zapier-api/ 317 + ``` 318 + 319 + --- 320 + 321 + ## Subagent Coordination 322 + 323 + When using subagents for implementation: 324 + 325 + - Each subagent works in a specific worktree: `.tasks/{task-name}/{repo-name}/` 326 + - Subagents reference shared context: `../TASK.md` and `../PLAN.md` 327 + - Main agent tracks overall progress in PLAN.md 328 + - Each repo gets its own commits and draft MR
+96
agents/skills/task-execution/worktree-setup.sh
··· 1 + #!/bin/bash 2 + # 3 + # worktree-setup.sh 4 + # 5 + # Run from within a new git worktree to copy files and run setup commands 6 + # based on .worktree.yml configuration from the main worktree. 7 + # 8 + # Usage: worktree-setup.sh 9 + # 10 + # Configuration (.worktree.yml or .claude/worktree.yml in main worktree): 11 + # copy: 12 + # - .env 13 + # - .envrc 14 + # setup: 15 + # - npm install 16 + # - direnv allow 17 + 18 + set -e 19 + 20 + # Find main worktree 21 + main_git_dir=$(git rev-parse --git-common-dir 2>/dev/null) 22 + if [[ -z "$main_git_dir" ]]; then 23 + echo "Error: Not in a git repository" 24 + exit 1 25 + fi 26 + 27 + main_worktree=$(dirname "$main_git_dir") 28 + current_worktree=$(pwd) 29 + 30 + # Check if we're actually in a worktree (not the main repo) 31 + if [[ "$main_worktree" == "$current_worktree" ]]; then 32 + echo "Error: Already in main worktree, nothing to set up" 33 + exit 1 34 + fi 35 + 36 + # Find config file 37 + config="" 38 + for path in ".worktree.yml" ".claude/worktree.yml"; do 39 + if [[ -f "$main_worktree/$path" ]]; then 40 + config="$main_worktree/$path" 41 + break 42 + fi 43 + done 44 + 45 + if [[ -z "$config" ]]; then 46 + echo "No .worktree.yml found in main worktree, skipping setup" 47 + exit 0 48 + fi 49 + 50 + echo "Using config: $config" 51 + echo "Source: $main_worktree" 52 + echo "Target: $current_worktree" 53 + echo "" 54 + 55 + # Copy files 56 + echo "Copying files..." 57 + copied=0 58 + skipped=0 59 + while IFS= read -r file; do 60 + # Skip empty lines 61 + [[ -z "$file" ]] && continue 62 + 63 + src="$main_worktree/$file" 64 + dest="$current_worktree/$file" 65 + 66 + if [[ -f "$src" ]]; then 67 + # Create parent directory if needed 68 + mkdir -p "$(dirname "$dest")" 69 + cp "$src" "$dest" 70 + echo " Copied: $file" 71 + ((copied++)) 72 + else 73 + echo " Skipped (not found): $file" 74 + ((skipped++)) 75 + fi 76 + done < <(yq -r '.copy[]?' "$config" 2>/dev/null) 77 + 78 + echo "Copied $copied file(s), skipped $skipped" 79 + echo "" 80 + 81 + # Run setup commands 82 + echo "Running setup commands..." 83 + while IFS= read -r cmd; do 84 + # Skip empty lines 85 + [[ -z "$cmd" ]] && continue 86 + 87 + echo " Running: $cmd" 88 + if eval "$cmd"; then 89 + echo " Done" 90 + else 91 + echo " Warning: Command failed (continuing)" 92 + fi 93 + done < <(yq -r '.setup[]?' "$config" 2>/dev/null) 94 + 95 + echo "" 96 + echo "Worktree setup complete"