Aligned with pi-web native subsessions (pi-subagents retired): implementation and review run in tracked child sessions, review is a separate fresh-context child reading code-review SKILL.md by path. Issue IID drives branch naming (type/IID-slug). New section 3: one git worktree per feature for parallel features, cleanup after merge. Dropped global branch-strategy block in favor of project AGENTS.md rules.
74 lines
3.2 KiB
Markdown
74 lines
3.2 KiB
Markdown
---
|
|
name: dev-workflow
|
|
description: Personal development workflow for software projects. Use when implementing an approved plan, when the user says "workflow" or "implement", or when creating the issue/branch/MR chain for a feature or fix. Assumes pi-web subsessions and one worktree per feature.
|
|
---
|
|
|
|
# Dev Workflow
|
|
|
|
My personal workflow for software projects. Assumes pi-web (subsession tools
|
|
available). Without them, implement and review in the main session and say so.
|
|
|
|
Core idea: the main chat plans and discusses; implementation and review run in
|
|
tracked subsessions; every feature lives in its own git worktree so several
|
|
features can run in parallel without branches fighting over one checkout.
|
|
|
|
## 1. Plan and approve
|
|
|
|
Discuss the task until there is an implementation plan: summary plus discrete
|
|
steps. **Wait for explicit approval** (`go`, `approved`, `start`) before
|
|
creating anything.
|
|
|
|
## 2. Issue
|
|
|
|
Follow the project's AGENTS.md for branches, commits, and MRs. Without project
|
|
rules: branch off the integration branch (e.g. `development`), never off main.
|
|
|
|
- Create a GitLab issue containing the plan (English), normal human title.
|
|
- Note the IID; everything below derives its name from it.
|
|
|
|
## 3. Worktree (one per feature)
|
|
|
|
Worktrees let several features run in parallel; plain branch switching cannot.
|
|
|
|
- Check for an existing worktree for this IID (`git worktree list`). Reuse it
|
|
if present; do not create duplicates.
|
|
- Otherwise, from the main checkout (which stays on the integration branch):
|
|
`git worktree add ../<repo>-<slug> -b <type>/<IID>-<slug>`
|
|
e.g. `git worktree add ../ai-cowork-mode-routing -b feature/105-mode-model-routing`.
|
|
- The main checkout is never the implementation target while a worktree exists.
|
|
- Node projects: install dependencies in the fresh worktree once before
|
|
implementing (follow the project's AGENTS.md toolchain notes).
|
|
|
|
## 4. Implementation (tracked subsession in the worktree)
|
|
|
|
Spawn ONE subsession with `cwd` set to the worktree path. Task text: approved
|
|
plan, issue IID, branch name, and "read AGENTS.md first". Stay responsive in
|
|
the main chat; the user watches and steers the subsession directly in pi-web.
|
|
At the join point call `yield_to_subsessions`, then verify the commits
|
|
(`git log`) before moving on.
|
|
|
|
## 5. Review (fresh context, separate subsession, same worktree)
|
|
|
|
Spawn a SECOND subsession with the same `cwd` — never reuse the implementation
|
|
child. Task text: diff range (`git diff <base>...HEAD`), issue reference, and:
|
|
"Read /home/markus/workspace/skills/dev/code-review/SKILL.md and follow it."
|
|
(subsessions do not inherit the skills catalog.) The reviewer reports findings
|
|
and fixes nothing.
|
|
|
|
## 6. Iterate, merge, clean up
|
|
|
|
- Fix findings as NEW commits (never amend/force-push a pushed branch).
|
|
- Substantial findings: another fresh review pass.
|
|
- Create the MR (English title/description), inform the user, then watch the
|
|
pipeline (gitlab_pipeline_status, job logs) and fix failures as new commits.
|
|
- After the MR merges: `git worktree remove ../<repo>-<slug>` and delete the
|
|
branch, unless the user wants it kept for follow-up work.
|
|
|
|
## 7. Long work
|
|
|
|
Work spanning multiple sessions: track it in goal-state.yaml (goal-state skill).
|
|
|
|
## Language
|
|
|
|
Plans, issues, commits, MR descriptions: English. Discussion: any language.
|