Skip to content
Merged
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
12 changes: 10 additions & 2 deletions .agent/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ User confirms with numbered options to override if needed.
| `todo/tasks/prd-*.md` | Product requirement documents |
| `todo/tasks/tasks-*.md` | Implementation task lists |

**Slash commands:** `/save-todo`, `/plan-status`, `/create-prd`, `/generate-tasks`, `/log-time-spent`, `/ready`, `/sync-beads`, `/remember`, `/recall`
**Slash commands:** `/save-todo`, `/plan-status`, `/create-prd`, `/generate-tasks`, `/log-time-spent`, `/ready`, `/sync-beads`, `/remember`, `/recall`, `/session-review`, `/full-loop`

**Time tracking format:**

Expand Down Expand Up @@ -271,6 +271,12 @@ opencode mcp list

## Session Completion & Parallel Work

**Run `/session-review` before ending a session** to ensure:
- All objectives completed
- Workflow best practices followed
- Knowledge captured for future sessions
- Clear next steps identified

**Recognize session completion signals:**
- All session tasks marked `[x]` in TODO.md
- PR merged and release published
Expand Down Expand Up @@ -364,7 +370,7 @@ Subagents provide specialized capabilities. Read them when tasks require domain
| `services/hosting/` | Hosting providers - DNS, domains, cloud servers, managed WordPress | hostinger, hetzner, cloudflare, cloudron, closte, 101domains, spaceship |
| `services/email/` | Email services - transactional email, deliverability | ses |
| `services/accounting/` | Accounting integration - invoicing, expenses, financial reports | quickfile |
| `workflows/` | Development processes - branching, releases, PR reviews, quality gates | git-workflow, plans, release, version-bump, pr, preflight, postflight, ralph-loop |
| `workflows/` | Development processes - branching, releases, PR reviews, quality gates | git-workflow, plans, release, version-bump, pr, preflight, postflight, ralph-loop, session-review |
| `templates/` | Document templates - PRDs, task lists, planning documents | prd-template, tasks-template, plans-template, todo-template |
| `workflows/branch/` | Branch conventions - naming, purpose, merge strategies per branch type | feature, bugfix, hotfix, refactor, chore, experiment, release |
| `scripts/commands/` | Slash commands - save-todo, remember, recall, code-simplifier and other interactive commands | save-todo, remember, recall, code-simplifier |
Expand Down Expand Up @@ -469,6 +475,8 @@ Never create files in `~/` root for files needed only with the current task.
| `beads-sync-helper.sh` | Sync TODO.md/PLANS.md with Beads graph |
| `todo-ready.sh` | Show tasks with no open blockers |
| `ralph-loop-helper.sh` | Iterative AI development loops (Ralph technique) |
| `full-loop-helper.sh` | End-to-end development loop (task → PR → deploy) |
| `session-review-helper.sh` | Gather session context for completeness review |

## Quality Workflow

Expand Down
142 changes: 142 additions & 0 deletions .agent/scripts/commands/full-loop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
description: Start end-to-end development loop (task → preflight → PR → postflight → deploy)
agent: Build+
mode: subagent
---

Start a full development loop that chains all phases from task implementation to deployment.

Task/Prompt: $ARGUMENTS

## Full Loop Phases

```text
Task Development → Preflight → PR Create → PR Review → Postflight → Deploy
```

## Workflow

### Step 1: Validate Prerequisites

Before starting, verify:

1. **On feature branch**: Must not be on main/master
2. **Clean working directory**: Uncommitted changes should be committed or stashed
3. **Git remote configured**: Need to push and create PR

```bash
# Check branch
git branch --show-current

# Check for uncommitted changes
git status --short
```

### Step 2: Start Full Loop

```bash
~/.aidevops/agents/scripts/full-loop-helper.sh start "$ARGUMENTS"
```

This will:
1. Initialize the Ralph loop for task development
2. Set up state tracking in `.claude/full-loop.local.md`
3. Begin iterating on the task

### Step 3: Task Development (Ralph Loop)

The AI will iterate on the task until outputting:

```text
<promise>TASK_COMPLETE</promise>
```

**Completion criteria:**
- All requirements implemented
- Tests passing (if applicable)
- Code quality acceptable

### Step 4: Automatic Phase Progression

After task completion, the loop automatically:

1. **Preflight**: Runs quality checks, auto-fixes issues
2. **PR Create**: Creates pull request with `gh pr create --fill`
3. **PR Review**: Monitors CI checks and review status
4. **Postflight**: Verifies release health after merge
5. **Deploy**: Runs `setup.sh` (aidevops repos only)

### Step 5: Human Decision Points

The loop pauses for human input at:

| Point | When | Action Required |
|-------|------|-----------------|
| Merge approval | If repo requires human approval | Approve PR in GitHub |
| Rollback | If postflight detects issues | Decide whether to rollback |
| Scope change | If task evolves beyond original | Confirm new scope |

### Step 6: Completion

When all phases complete:

```text
<promise>FULL_LOOP_COMPLETE</promise>
```

## Commands

```bash
# Start new loop
/full-loop "Implement feature X with tests"

# Check status
~/.aidevops/agents/scripts/full-loop-helper.sh status

# Resume after interruption
~/.aidevops/agents/scripts/full-loop-helper.sh resume

# Cancel loop
~/.aidevops/agents/scripts/full-loop-helper.sh cancel
```

## Options

Pass options after the prompt:

```bash
/full-loop "Fix bug Y" --max-task-iterations 30 --skip-postflight
```

| Option | Description |
|--------|-------------|
| `--max-task-iterations N` | Max iterations for task (default: 50) |
| `--max-preflight-iterations N` | Max iterations for preflight (default: 5) |
| `--max-pr-iterations N` | Max iterations for PR review (default: 20) |
| `--skip-preflight` | Skip preflight checks |
| `--skip-postflight` | Skip postflight monitoring |
| `--no-auto-pr` | Pause for manual PR creation |
| `--no-auto-deploy` | Don't auto-run setup.sh |

## Examples

```bash
# Basic feature implementation
/full-loop "Add user authentication with JWT tokens"

# Bug fix with limited iterations
/full-loop "Fix memory leak in connection pool" --max-task-iterations 20

# Skip postflight for quick iteration
/full-loop "Update documentation" --skip-postflight

# Manual PR creation
/full-loop "Refactor database layer" --no-auto-pr
```

## Related

- `workflows/ralph-loop.md` - Ralph loop technique details
- `workflows/preflight.md` - Pre-commit quality checks
- `workflows/pr.md` - PR creation workflow
- `workflows/postflight.md` - Post-release verification
154 changes: 154 additions & 0 deletions .agent/scripts/commands/session-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
description: Review session for completeness, best practices, and knowledge capture
agent: Build+
mode: subagent
---

Review the current session for completeness and aidevops workflow adherence.

Focus area: $ARGUMENTS

## Review Process

### Step 1: Gather Context

Run the helper script to collect session data:

```bash
~/.aidevops/agents/scripts/session-review-helper.sh gather
```

### Step 2: Analyze Objectives

Review what was accomplished in this session:

1. **Initial Request**: What did the user originally ask for?
2. **Branch Purpose**: Does the branch name reflect the work done?
3. **Commits Made**: Do commits align with the objective?
4. **Outstanding Items**: What remains incomplete?

Calculate completion score:
- 100%: All objectives met, no outstanding items
- 75-99%: Primary objective met, minor items remain
- 50-74%: Partial completion, significant work remains
- <50%: Major objectives incomplete

### Step 3: Check Workflow Adherence

Verify aidevops best practices:

| Practice | Check | Required |
|----------|-------|----------|
| Feature branch | Not on main/master | Yes |
| Pre-edit check | Ran before first edit | Yes |
| Atomic commits | Each commit is focused | Yes |
| TODO tracking | Tasks logged appropriately | Recommended |
| Quality checks | Linters run before commit | Recommended |

### Step 4: Identify Knowledge to Capture

Look for learnings that should be preserved:

1. **Corrections Made**: Did the AI make mistakes that were corrected?
2. **New Patterns**: Were new approaches discovered?
3. **Tool Issues**: Did any tools not work as expected?
4. **User Preferences**: Did the user express preferences?

For each learning, suggest where to document:
- Agent improvements → `@agent-review`
- Code patterns → Code comments or docs
- User preferences → `memory/` files
- Temporary workarounds → TODO.md

### Step 5: Session Health Assessment

Determine recommendation:

**End Session When:**
- All objectives complete
- PR merged
- Blocked on external factors
- Context becoming stale (long session)
- Topic shift to unrelated work

**Continue Session When:**
- More work in scope
- User wants to continue
- Related follow-up tasks

**Start New Session For:**
- Unrelated topics
- Clean context needed
- Parallel work on different branch

## Output Format

```text
# Session Review

**Branch**: {branch-name}
**Duration**: {approximate}
**Date**: {YYYY-MM-DD}

---

## Objective Completion: {score}%

### Completed
- [x] {item 1}
- [x] {item 2}

### Outstanding
- [ ] {item} - {reason/next step}

---

## Workflow Adherence

### Followed
- [x] {practice}

### Improvements Needed
- [ ] {practice} - {recommendation}

---

## Knowledge Capture

### Should Document
- {learning}: {suggested location}

### Action Items
1. {specific action}

---

## Session Recommendation

**Verdict**: {Continue | End Session | Start New Session}

### Immediate Actions
1. {action}

### For Future Sessions
- {topic}: suggest branch `{type}/{name}`

---

*Review generated by /session-review*
```

## Quick Review (Summary Only)

For a quick status check without full analysis:

```bash
~/.aidevops/agents/scripts/session-review-helper.sh summary
```

## Integration Points

- **Before PR**: Run to ensure nothing forgotten
- **Before ending session**: Capture learnings
- **After Ralph loop**: Verify completion promise was truly met
- **On topic shift**: Decide whether to continue or start fresh
Loading