# Clone Instructions: Daily Bug & QA Report

> **For the clone.** Your user has handed you this file. Follow it step by step.
> **Version 1.0.0 · Last updated 2026-10-22**
>
> 🧩 **Based on the prebuilt skill `BugReport-QAReport`.** You attach it; you don't have to write it.

---

## 1. Role and goal

Set up the prebuilt skill **BugReport-QAReport**. When done, you reconcile open Salesforce Cases (Reason = Bug) against Linear daily and deliver an HTML email to `{REPORT_RECIPIENTS}` and a post to `{TEAM_CHANNEL}`. This is setup only. Salesforce only: if the user uses HubSpot, say it isn't supported for this card (no case operator) and stop.

## 2. Safety rules

1. Show a numbered plan and wait for an explicit "yes" before attaching, creating or changing anything.
2. Never ask for or handle passwords, API keys or tokens. The user connects via sign-in screens.
3. Never email customers. Only internal `{REPORT_RECIPIENTS}`, and test emails only after approval.
4. Read-only for Salesforce and Linear during setup and in the report. Any link backfill edits require a separate explicit "yes" per batch.
5. Use exact catalog names. Skill names can differ slightly between orgs.

## 3. Discovery

Use the `platform` tool to list skills, operators and connections; use `describeOperator` on each. Report:

| Item | Status (✅⚠️❌❓) | Exact name in catalog | Notes |
|---|---|---|---|
| BugReport-QAReport | | | |
| SalesforceCaseOperator | | | Check a "Bug" Reason value exists |
| Linear_Operator | | | |
| GoogleGmailOperator or Outlook email | | | |
| Slack or Teams | | | |
| Scheduled task (platform) | | | |

## 4. Collect placeholders

Ask once:
1. `{REPORT_RECIPIENTS}` (internal emails)
2. `{TEAM_CHANNEL}` (Slack or Teams)
3. `{BUG_REASON_VALUE}` (default "Bug")
4. `{LINK_CONVENTION}` (case number in Linear title/description, or Linear ID in a case field; name the field)
5. `{URGENT_LABELS}` (default DEFCON, urgent)
6. `{RUN_TIME}` with time zone

Confirm in a table (Placeholder / Value) before the plan.

## 5. What you can do yourself after approval

- Attach **BugReport-QAReport** via the `platform` tool.
- Create the daily scheduled task (section 7).
- Offer the one-time backfill (section 7).
If you can't attach the skill, tell the user: settings → Skills → find **BugReport-QAReport** in the catalog → Add → tell me "added".

## 6. What the user must do

1. **Connect Salesforce:** settings → Connections → Salesforce → sign in with an account that can read Cases.
2. **Connect Linear:** settings → Connections → Linear → sign in with read access.
3. **Gmail or Outlook:** confirm the clone's email connection can send.
4. **Slack or Teams:** confirm the clone can post to `{TEAM_CHANNEL}` (invite it to the channel if needed).
5. **Tell the team the link convention** (for example "[Case 00012345]" at the start of the Linear title).

## 7. Prebuilt skill: configure and run

**What BugReport-QAReport does, step by step:**
1. Query SalesforceCaseOperator for Cases with Reason = `{BUG_REASON_VALUE}` and Status not Closed.
2. For each, find linked Linear issue(s) via `{LINK_CONVENTION}` using Linear_Operator.
3. Read each issue's state, labels, due date or ETA.
4. Bucket: Closed & In Production, Ready for QA, In Progress, In Queue/Backlog, Non-actionable (unlinked, canceled, duplicate).
5. Put bugs with `{URGENT_LABELS}` at the top.
6. Per bug write: summary, status, ETA, suggested next action for the CS owner, QA guidance (what to test).
7. Flag cases closed in Linear but open in Salesforce: tell the customer and close the case.
8. Send a branded HTML email to `{REPORT_RECIPIENTS}`; post a summary to `{TEAM_CHANNEL}`.
9. If a call fails, retry once, then mark the source unavailable and say so in the report.

**Scheduled task:** create a daily task at `{RUN_TIME}` with this exact prompt:

```
Run the daily bug report
```

Optional customization lines (append only if the user asks):

```
Only include bugs for accounts owned by {TEAM_NAME}.
Post to {TEAM_CHANNEL} only when there are urgent bugs.
```

**One-time backfill (propose only):** list open bug cases with no Linear match; suggest candidate issues by title and account; present as a table; after the user says "yes" per batch, add the case number to the Linear issue title/description (or the issue ID to the case field). Never bulk-edit without approval.

## 8. Test plan

Use a test case and a test Linear issue if possible. Run "Run the daily bug report" on demand.

| Check | ☐ |
|---|---|
| Email arrived at `{REPORT_RECIPIENTS}` only | ☐ |
| Channel post appeared in `{TEAM_CHANNEL}` | ☐ |
| Urgent bugs are at the top | ☐ |
| A linked case lands in the right bucket | ☐ |
| An unlinked case is Non-actionable | ☐ |
| Each bug has next action and QA guidance | ☐ |
| Nothing was edited in Salesforce or Linear | ☐ |
| Scheduled task is listed with the right time zone | ☐ |

## 9. Final status checklist

- ✅ Done by me: skill attached, schedule created, test run
- ⏳ Waiting on you: Salesforce and Linear sign-in, channel access, link convention, backfill approval
- 💡 Optional next steps: custom buckets, per-team reports, weekly summary

Gotchas to repeat: unlinked cases can't be matched; keep the Reason picklist consistent; closed in Linear but open in CRM means tell the customer and close the case; internal recipients only.
