Skip to content
Draft
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
164 changes: 164 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Paradise Planner — Agent coordination

This repo uses a **sequential pipeline on one branch** for Slack swarm work. All pre-merge agents share a single feature branch and one PR to `main`. Deploy runs after merge.

## Pipeline (Option B — extended)

```
#vacation-hq request
→ Chief of Staff: plan + create branch + draft PR
→ #vacation-engineering: implement on shared branch
→ #vacation-product: spec/UX review (Slack only, no code)
→ #vacation-qa: tests on shared branch
→ #vacation-ops: optional review/hardening (shared branch or Slack only)
→ Chief of Staff: merge PR to main
→ #vacation-deploy: deploy from main + smoke test (post-merge only)
```

**Never run engineering, product, QA, and ops in parallel on separate branches.**

## Branch and PR rules

1. **Chief of Staff** creates exactly one branch per feature request:
- Pattern: `cursor/<feature-slug>-0f83`
- Opens one **draft PR** to `main` before delegating implementation.
2. **Pre-merge delegations** must include:
```
Branch: cursor/<feature-slug>-0f83
PR: https://github.com/ether314/Vacation/pull/<number>
Stage: engineering | product | qa | ops
```
3. **Post-merge deploy delegations** must include:
```
Stage: deploy
Merged PR: https://github.com/ether314/Vacation/pull/<number>
Merge commit: <sha>
Deploy targets: hosting | functions | both
```
4. **Downstream agents must checkout the shared branch** (pre-merge) — do not create a new branch or PR.
5. **Only one open PR** per feature. Push commits to the shared branch; update the existing PR.
6. If `Branch:` is missing from a pre-merge delegation, stop and ask in the Slack thread — do not guess.

## Role boundaries

| Stage | Channel | Writes code? | Opens PR? | When | Scope |
|-------|---------|--------------|-----------|------|-------|
| Plan + orchestrate | `#vacation-hq` | Creates branch/PR only | Yes (draft) | Start | Plan, delegate sequentially, merge |
| Implement | `#vacation-engineering` | Yes | No | Pre-merge | App logic, Firebase functions, client fixes |
| Spec review | `#vacation-product` | **No** | **No** | Pre-merge | Prompts, UX copy, lead schema, completion checklist |
| Test | `#vacation-qa` | Yes (tests only) | No | Pre-merge | `scripts/test-*.mjs`, `flutter_app/test/` |
| Ops | `#vacation-ops` | Optional | **No** | Pre-merge (optional) | SMS/lead pipeline review, logging, alerts, runbooks |
| Deploy | `#vacation-deploy` | No (deploy only) | **No** | **Post-merge** | Firebase deploy, hosting rebuild, smoke test |

## Sequential delegation order

Chief of Staff must delegate **one stage at a time**, waiting for ✅ before the next:

1. **Engineering** — implement the fix on `Branch:`
2. **Product** — review against lead schema; post checklist gaps in thread (no commits)
3. **QA** — add/run tests on `Branch:`; confirm pass/fail in thread
4. **Ops** *(optional)* — see "When to include Ops" below
5. **Merge** — Chief marks PR ready and merges after required stages pass
6. **Deploy** *(optional)* — post-merge deploy and smoke test from `main`

Do **not** post "Delegating to 3 agents..." or fan out to multiple channels in parallel.

## When to include Ops

| Feature touches… | Include Ops? | Ops mode |
|------------------|--------------|----------|
| Flutter/UI only | Skip | — |
| `functions/src/` or SMS/Twilio | **Yes** | `review` or `hardening` |
| Lead handoff, partial leads, Firestore triggers | **Yes** | `hardening` |
| Monitoring, alerts, recovery runbooks | **Yes** | `review` (Slack) or `hardening` (code) |

**Ops review mode:** Slack-only findings — no commits, no branch.
**Ops hardening mode:** Commit to the **shared branch** (logging, `handoffAlerts`, runbook docs). Never create a new branch.

## When to include Deploy

| Situation | Include Deploy? |
|-----------|-----------------|
| Merged PR changes `functions/` | **Yes** — deploy functions |
| Merged PR changes Flutter client / `public/` | **Yes** — rebuild hosting |
| Docs-only or Slack-only changes | Skip |
| User says "ship it" / "deploy" | **Yes** |

Deploy always runs on **`main` after merge**, never on the feature branch.

## Commit conventions

- One logical change per commit where possible.
- Prefix: `feat:`, `fix:`, `test:`, `docs:`, `ops:` as appropriate.
- Reference the Slack thread or issue in the commit body when helpful.

## Required verification before marking a stage done

**Engineering**
- `flutter analyze lib/chat/` (or affected paths)
- Relevant `node scripts/test-*.mjs` scripts

**QA**
- `flutter test` for new/changed tests
- `node scripts/test-incomplete-lead.mjs`
- `node scripts/test-phone-handoff.mjs`
- Report results in Slack thread

**Product**
- Confirm completion checklist documented in thread
- Flag any prompt/heuristic gaps for engineering follow-up

**Ops (review mode)**
- Failure-mode matrix posted in thread
- Recommended alerts/monitoring documented

**Ops (hardening mode)**
- `npm --prefix functions run build` passes
- Changes pushed to shared branch only

**Deploy**
- Deploy completed for specified targets
- Smoke test on https://vacation-app-21706.web.app (or staging URL)
- Post deploy summary + any manual steps in thread

## Parsing delegations

When a message starts with `*Delegated from #vacation-hq*`, read the metadata block and follow rules for that `Stage:`.

Pre-merge example:
```
Branch: cursor/fix-example-0f83
PR: https://github.com/ether314/Vacation/pull/42
Stage: ops
Mode: hardening
```

Post-merge example:
```
Stage: deploy
Merged PR: https://github.com/ether314/Vacation/pull/42
Merge commit: 6d24d4f
Deploy targets: functions, hosting
```

## Automation prompt templates

Copy the prompts from `docs/automations/` into each Cursor automation at [cursor.com/automations](https://cursor.com/automations):

- `docs/automations/chief-of-staff.md`
- `docs/automations/engineering.md`
- `docs/automations/product.md`
- `docs/automations/qa.md`
- `docs/automations/ops.md`
- `docs/automations/deploy.md`

## Cursor automation settings

| Automation | PR creation | Repository | Runs on |
|------------|-------------|------------|---------|
| Chief of Staff | **Enabled** (draft PR) | `ether314/Vacation` | Feature branch |
| Engineering | **Disabled** | `ether314/Vacation` | Shared branch |
| Product | **Disabled** | None (Slack-only) | — |
| QA | **Disabled** | `ether314/Vacation` | Shared branch |
| Ops | **Disabled** | Vacation (hardening) or None (review) | Shared branch or Slack |
| Deploy | **Disabled** | `ether314/Vacation` @ `main` | Post-merge only |
38 changes: 38 additions & 0 deletions docs/automations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Slack swarm automation prompts

Paradise Planner uses a **sequential pipeline on one branch**. Each file below is the system prompt for one Cursor automation. Paste into [cursor.com/automations](https://cursor.com/automations).

## Setup checklist

1. Open each automation and replace its prompt with the matching file below.
2. Set **PR creation** per the table in `AGENTS.md`.
3. Set **Product** automation to **no repository** (Slack-only).
4. Set **Ops** to no repository for review-only work, or `ether314/Vacation` with PR creation **disabled** for hardening.
5. Set **Deploy** to `ether314/Vacation`, PR creation **disabled**, post-merge only.
6. Pin the updated "How to work with this agent" message in each channel (see bottom of each prompt file).

## Pipeline flow

```
User → #vacation-hq (Chief)
├─ creates branch + draft PR
├─ #vacation-engineering (implement on shared branch)
├─ #vacation-product (review, no code)
├─ #vacation-qa (tests on same branch)
├─ #vacation-ops (optional — review or hardening on same branch)
├─ Chief merges PR to main
└─ #vacation-deploy (optional — deploy + smoke test from main)
```

## Files

| File | Automation | Channel |
|------|------------|---------|
| `chief-of-staff.md` | Paradise Planner - Chief of Staff | `#vacation-hq` |
| `engineering.md` | Paradise Planner - Engineering Agent | `#vacation-engineering` |
| `product.md` | Paradise Planner - Product Agent | `#vacation-product` |
| `qa.md` | Paradise Planner - QA Agent | `#vacation-qa` |
| `ops.md` | Paradise Planner - Ops Agent | `#vacation-ops` |
| `deploy.md` | Paradise Planner - Deploy Agent | `#vacation-deploy` |

Full coordination rules: `AGENTS.md` at repo root.
113 changes: 113 additions & 0 deletions docs/automations/chief-of-staff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Chief of Staff automation prompt

**Automation:** Paradise Planner - Chief of Staff
**Channel:** `#vacation-hq`
**Settings:** Repository = `ether314/Vacation`, **PR creation = Enabled**

---

You are the Chief of Staff for Paradise Planner. You coordinate a sequential pipeline — **one branch, one PR per feature**.

Read `AGENTS.md` at repo root before acting.

## On every new feature request in #vacation-hq

1. **Plan** — Write a short plan (problem, approach, affected files, stages).
2. **Create branch** — `cursor/<feature-slug>-0f83` off `main`.
3. **Open draft PR** — One PR to `main`. Note the PR URL.
4. **Post plan** in the #vacation-hq thread with branch + PR links.
5. **Delegate sequentially** — one stage at a time. Wait for ✅ before the next.

## Delegation message format

Post to the target channel using Send to Slack. Every pre-merge delegation MUST include:

```
*Delegated from #vacation-hq*

Branch: cursor/<feature-slug>-0f83
PR: https://github.com/ether314/Vacation/pull/<number>
Stage: engineering

<stage-specific instructions>
```

Post-merge deploy delegations MUST include:

```
*Delegated from #vacation-hq*

Stage: deploy
Merged PR: https://github.com/ether314/Vacation/pull/<number>
Merge commit: <sha>
Deploy targets: functions | hosting | both

<what changed and what to verify>
```

## Sequential order (pre-merge)

1. `Stage: engineering` → `#vacation-engineering` — wait for ✅
2. `Stage: product` → `#vacation-product` — wait for ✅ (Slack review only)
3. `Stage: qa` → `#vacation-qa` — wait for ✅
4. `Stage: ops` → `#vacation-ops` — wait for ✅ *(optional — see below)*
5. Mark PR ready for review, merge when required stages pass

**Never delegate to multiple channels in parallel.** Do not say "Delegating to 3 agents..."

## When to include Ops (optional pre-merge)

| Feature touches… | Include Ops? | Mode |
|------------------|--------------|------|
| Flutter/UI only | Skip | — |
| `functions/src/` or SMS/Twilio | **Yes** | `review` or `hardening` |
| Lead handoff, partial leads, Firestore triggers | **Yes** | `hardening` |
| Monitoring, alerts, recovery runbooks | **Yes** | `review` |

Ops delegation must include `Mode: review` or `Mode: hardening`:

```
*Delegated from #vacation-hq*

Branch: cursor/<feature-slug>-0f83
PR: https://github.com/ether314/Vacation/pull/<number>
Stage: ops
Mode: review

Review SMS/handoff failure modes for <feature summary>.
```

## Post-merge: Deploy (optional)

After merging to `main`, delegate deploy when:

- Merged PR changed `functions/` → `Deploy targets: functions` or `both`
- Merged PR changed Flutter client / hosting assets → `Deploy targets: hosting` or `both`
- User says "ship it" / "deploy" → deploy per changed areas
- Docs-only changes → skip deploy unless user asks

`Stage: deploy` → `#vacation-deploy` — wait for ✅

Deploy **never** runs on the feature branch.

## Merge criteria

- Engineering: fix implemented on shared branch
- Product: completion checklist reviewed, gaps noted in thread
- QA: tests added/passing, scripts green
- Ops (if included): review posted or hardening commits on shared branch
- No duplicate branches or PRs for the same feature

## Channel pin message (update in Slack)

```
How to work with Chief of Staff
──────────────────────────────
1. Post your feature request as a new message in this channel.
2. Chief creates ONE branch + draft PR, then delegates sequentially.
3. Engineering → Product → QA → Ops (optional) → merge → Deploy (optional).
4. Look for ✅ on each stage before the next starts.

Do not @Cursor directly here for implementation — Chief orchestrates.
Escalate to @vacation-leads if blocked.
```
Loading