startloop
Start the agentic development loop to autonomously work through beads issues
What this skill does
# Start Agentic Development Loop
Initiates an autonomous development loop that iteratively works through beads issues. The loop automatically selects the highest priority ready task (no blockers), claims it, and presents it for implementation.
## Usage
```bash
# Start a new development loop
/bkff:startloop
# Resume a paused loop
/bkff:startloop --resume
```
## How It Works
1. **Task Selection**: Finds the highest priority task with no blockers (`bd ready`)
2. **Task Claiming**: Sets the task status to `in_progress`
3. **Work Presentation**: Displays the task details for implementation
4. **Completion**: After work is done, verification passes, and task is closed
5. **Iteration**: Automatically selects the next ready task
## Loop Lifecycle
```
┌─────────────────────────────────────────────────────────┐
│ START LOOP │
└─────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ SELECT READY TASK │
│ (highest priority, no blockers) │
└─────────────────────┬───────────────────────────────────┘
│
┌──────────┴──────────┐
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Task Found │ │ No Tasks │
└──────┬──────┘ └──────┬──────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Claim Task │ │ LOOP STOPS │
│ (in_progress│ │ (complete) │
└──────┬──────┘ └─────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ WORK ON TASK │
│ • Implement changes │
│ • Generate tests (/bkff:gentests) │
│ • Run verification (/bkff:verifytask) │
└─────────────────────┬───────────────────────────────┘
│
┌──────────┴──────────┐
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Success │ │ Failure │
└──────┬──────┘ └──────┬──────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Close Task │ │ Retry with │
│ Continue │◄──────│ Backoff │
│ Loop │ └──────┬──────┘
└──────┬──────┘ │
│ ┌──────┴──────┐
│ │ Max Retries │
│ │ Exceeded │
│ └──────┬──────┘
│ │
│ ▼
│ ┌─────────────┐
│ │ LOOP PAUSES │
│ │ (user input)│
│ └─────────────┘
│
└──────────────────────┐
│
▼
(back to SELECT)
```
## Output
### Starting New Loop
```
Development Loop Status
─────────────────────────────────────
Status: running
Started: 2026-01-24T10:30:00Z
Completed: 0 tasks
─────────────────────────────────────
Working on: T015 Implement compliance check logic
Issue: beads-abc123
─────────────────────────────────────
The development loop has selected this task.
Work on implementing the task, then run verification.
When complete, the loop will automatically select the next task.
To pause: /bkff:cancelloop
```
### No Ready Tasks
```
Development Loop Status
─────────────────────────────────────
Status: running
Started: 2026-01-24T10:30:00Z
Completed: 5 tasks
Info: No ready tasks available
✓ Loop completed - all tasks done or blocked
```
### Resuming Paused Loop
```
Info: Loop resumed
Development Loop Status
─────────────────────────────────────
Status: running
Started: 2026-01-24T10:30:00Z
Completed: 3 tasks
─────────────────────────────────────
Working on: T018 Fix failing test
Issue: beads-def456
─────────────────────────────────────
```
## State Management
Loop state is persisted in `.bkff/loop-state.json`:
```json
{
"status": "running",
"started_at": "2026-01-24T10:30:00Z",
"current_task": {
"beads_id": "beads-abc123",
"task_id": "T015",
"title": "Implement compliance check logic",
"started_at": "2026-01-24T10:35:00Z"
},
"completed_tasks": [
{
"beads_id": "beads-xyz789",
"task_id": "T014",
"completed_at": "2026-01-24T10:34:00Z",
"duration_seconds": 240
}
],
"paused_reason": null,
"retry_count": 0,
"last_error": null
}
```
## Retry Behavior
When errors occur, the loop implements exponential backoff:
| Attempt | Wait Time |
|---------|-----------|
| 1 | 5 seconds |
| 2 | 10 seconds |
| 3 | 20 seconds |
| Max | Pause loop |
After max retries (default: 3), the loop pauses and waits for user input.
## Requirements
- Must be run inside a git repository
- Beads must be initialized with tasks
- `bd` CLI must be available
- No other loop currently running (or use `--resume`)
## Exit Codes
- `0` - Loop started/resumed successfully
- `1` - Loop paused (issue encountered)
- `2` - No ready tasks (all done or blocked)
- `3` - Another loop already running
## Related Skills
- `/bkff:cancelloop` - Stop the development loop
- `/bkff:verifytask` - Verify task completion
- `/bkff:gentests` - Generate tests for implemented code
## Implementation
```bash
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PLUGIN_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
source "$PLUGIN_DIR/lib/common.sh"
source "$PLUGIN_DIR/lib/loop-state.sh"
# Parse arguments
resume=false
for arg in "$@"; do
case "$arg" in
--resume) resume=true ;;
esac
done
# Validate prerequisites
require_worktree
require_beads
require_bd
# Handle resume
if [[ "$resume" == "true" ]]; then
if ! has_loop; then
error_exit "No loop to resume"
fi
resume_loop
print_loop_status
run_loop_cycle
exit $?
fi
# Check for existing loop
if has_loop; then
error_exit "A development loop is already active. Use --resume or run /bkff:cancelloop first."
fi
# Initialize new loop
init_loop
print_loop_status
# Start first cycle
run_loop_cycle
exit_code=$?
case $exit_code in
0) exit 0 ;; # Task selected, continue
1) exit 1 ;; # Paused
2) # No tasks
success "Loop completed - all tasks done or blocked"
cancel_loop
exit 0
;;
esac
```
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.