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
2 changes: 1 addition & 1 deletion plugin/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "reva-turbo",
"displayName": "RevAOps Plugin",
"version": "2.1.3",
"version": "2.1.4",
"description": "The Rev A Manufacturing PM copilot — full RFQ-to-delivery workflow with CRM, memory, and 48 skills. Paste your key in chat and you're in; bring your own CRM (HubSpot, Salesforce, Attio, Pipedrive) or use the bundled Nakatomi + AutoMem defaults.",
"author": {
"name": "Rev A Manufacturing / MrDula Solutions",
Expand Down
2 changes: 1 addition & 1 deletion plugin/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.3
2.1.4
145 changes: 144 additions & 1 deletion plugin/skills/revmyengine/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: revmyengine
preamble-tier: 1
version: 2.1.3
version: 2.1.4
description: |
REVA-TURBO master orchestrator for Rev A Manufacturing PM workflow.
Routes requests to the correct sub-skill based on context. Chains the
Expand Down Expand Up @@ -373,6 +373,7 @@ Voice applies to greeting style, signoff, tone, email length, technical depth, f
| `/connected` | inline | Diagnostic: confirm router + show tool counts (`crm_*`, `mem_*`, `reva_*`) and current `mcp_url` |
| `/integrate [connector]` | inline | Show or change the team's primary CRM (nakatomi/hubspot/salesforce/attio/pipedrive). Calls `reva_set_primary_crm`; Nakatomi + AutoMem always shadow-write |
| `/heal` | inline | Hands-free recovery when install is stale. Downloads the latest zip, replaces the installed plugin dir, writes credentials. See **`/heal` — hands-free recovery** section below |
| `/demo [dry\|live\|clean]` | inline | Walk a fictional 500-unit CNC bracket RFQ through the full Rev A lifecycle so a PM can see the engine work before touching real data. See **`/demo` — end-to-end lifecycle walkthrough** below |
| `/send-logs` | inline | Package dev log + email to matt@mrdula.solutions |
| `/logs` | inline | Display recent telemetry entries in readable format |

Expand Down Expand Up @@ -767,6 +768,148 @@ only option is the Terminal one-liner.
heal is destructive (removes the install dir); don't run it on a
healthy install.

## `/demo` — end-to-end lifecycle walkthrough

Traditional SaaS onboarding shows a populated product before the user
touches it. The engine's version of that: run a fictional 500-unit
CNC-bracket RFQ through all 14 lifecycle stages so the PM sees every
skill fire — intake, qualify, customer onboarding, quote, submission,
order, China package, partner select, tracking, shipping, inspect, QA
gate, outbound, close — without risking real data.

The canonical scenario (customer, RFQ specs, expected quote, partner,
stage mapping) lives in
[`references/demo-scenario.md`](./references/demo-scenario.md). Read
that file every time `/demo` fires — don't improvise customer names,
prices, or PNs. Consistency is how this reads as a product demo rather
than ad-lib.

### Mode selection

When the PM types plain `/demo` (no arg), **ask once** via
`AskUserQuestion`:

> **Demo mode?**
>
> - **Dry run** — I narrate each stage with what the engine would do,
> but don't write anything to the CRM. Zero cleanup after.
> - **Live demo** — I actually create a tagged demo customer, RFQ,
> quote, and deal in Nakatomi so you see real data light up your
> dashboard. Everything is marked `reva-demo` and can be wiped with
> `/demo clean`.

Accept `dry`, `live`, or `clean` as direct arguments (`/demo dry`,
`/demo live`, `/demo clean`) and skip the question.

### Dry run (`/demo dry`)

For each of the 14 stages in `demo-scenario.md`:

1. Print a stage header: `Stage N — <stage name> [skill: <skill-slug>]`.
2. Summarize in 2–4 sentences what the skill *would* do with this
fictional input. Use the numbers from the scenario file (quantities,
tolerances, prices, lead times) verbatim — don't round or paraphrase.
3. Show the concrete output the engine would produce — for example at
Stage 4 show the per-unit cost breakdown table; at Stage 8 show the
3-partner scoring grid; at Stage 11 show the inspection sample
math. The table in `demo-scenario.md` is already per-unit-priced;
reuse those values.
4. End each stage with `→ Next: <stage N+1 name>` so the narrative reads as a chain.

After Stage 14, print a summary:
- Total lifecycle time (7 weeks modeled end-to-end)
- Quote value ($11,200) and realized margin
- Which skills fired (count + list)
- Links to the SKILL.md files for the 3 most complex ones

No tool calls. No CRM writes. No emails. This is pure narration with
real skill names so the PM learns the mental model.

### Live demo (`/demo live`)

Same 14-stage walk, but at each stage also invoke the router write
path. Every record MUST carry the tagging envelope from
`demo-scenario.md`:

```json
{
"source": "reva-demo",
"tags": ["reva-demo", "reva-demo-0001"],
"metadata": {
"demo_run_id": "<ISO-8601 start ts>",
"demo_operator": "<PM email>"
}
}
```

Before creating anything, **check for stragglers from a prior run**:

```
crm_search {"filters": {"tag": "reva-demo"}}
```

If any results come back, ask: *"Found N leftover records from a
previous demo run — wipe them first? [y/N]"* If yes, run `/demo clean`
inline before starting. If no, bail and tell the PM to resolve
manually — don't create duplicate demo records.

Stage-by-stage tool calls (adjust tool names to match the PM's primary
CRM — HubSpot / Salesforce / etc. tool prefixes differ, but the
shadow-write contract in `docs/CONNECTORS.md` still applies):

- **Stage 1–3** (intake / qualify / onboard): `crm_create_account`
(NexGen), `crm_create_contact` (Sarah + 2 supporting), `crm_create_rfq`.
- **Stage 4**: `crm_create_quote` with the line-item breakdown.
- **Stage 5**: `crm_create_communication` — **body only, do NOT send**.
Stamp `status="draft"`.
- **Stage 6–8**: `crm_create_order`, `crm_create_manufacturing_package`,
`crm_create_partner_award`.
- **Stage 9**: `crm_create_production_job` with 10 milestone stubs
(don't simulate progress — leave them at `planned`).
- **Stage 10–14**: `crm_create_shipment`, `crm_create_inspection`
(outcome ACCEPT), `crm_create_qa_gate`, `crm_create_outbound_shipment`,
`crm_close_order`.

Also write a matching memory at each stage via `mem_store` with
`{"tags": ["reva-demo"], "metadata": {"demo_run_id": "..."}}` so the
AutoMem pane shows the timeline.

After Stage 14, tell the PM:
- Where to see it: *"Open the dashboard — filter by tag `reva-demo`.
You'll see NexGen Aerospace with $11,200 in quoted value, one active
order, and 14 timeline entries."*
- How to clean up: *"When you're done poking around, run
`/demo clean` and everything above gets wiped in one sweep."*

### Cleanup (`/demo clean`)

1. Warn first: *"This will permanently delete every record tagged
`reva-demo` in workspace `<slug>`. Continue?"* Require explicit yes.
2. `crm_search {"filters": {"tag": "reva-demo"}}` across every entity
type the router exposes.
3. For each hit, call the matching `crm_*_delete` tool. Delete
children before parents (shipments/jobs before orders, contacts
before accounts, quotes before RFQs).
4. `mem_recall {"tags": ["reva-demo"]}` → `mem_delete` each match.
5. Report counts: *"Removed 1 account, 3 contacts, 1 RFQ, 1 quote, 1
order, 1 manufacturing package, 1 partner award, 1 production job,
2 shipments, 1 inspection, 1 QA gate, and 14 memory entries."*

If any delete fails, stop, report the specific error, and tell the PM
they can safely re-run `/demo clean` — deletes are idempotent on
already-gone records, so retry after fixing the blocker.

### When not to run `/demo`

- **In a workspace with real production data** if the PM is not
entirely sure the tagging filter will be honored by every downstream
system (BI dashboards, invoicing). The tag IS reliable in Nakatomi,
but if the primary CRM is HubSpot/Salesforce and the shadow-write
contract isn't honoring `tags[]` end-to-end, demo records will show
up in real reports. When in doubt, use `/demo dry`.
- **During live customer calls** — takes 60–90 seconds of narration
and the PM will want to follow along. Schedule a dry training block.

## Workflow State

Log every workflow transition to `~/.reva-turbo/state/workflow-state.jsonl`:
Expand Down
136 changes: 136 additions & 0 deletions plugin/skills/revmyengine/references/demo-scenario.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# `/demo` sample scenario — NexGen Aerospace bracket RFQ

The canonical demo dataset. Used by `/demo dry` and `/demo live`. Every
record created in `live` mode carries `source: "reva-demo"` and a
`reva-demo` tag so `/demo clean` can remove them in one sweep without
touching real data.

## Cast of characters (all fictional)

### Customer
- **Company:** NexGen Aerospace Systems, Inc.
- **Slug:** `nexgen-aerospace-demo`
- **Website:** `https://nexgen-aerospace.example` *(reserved TLD — never resolves)*
- **Billing address:** 1400 Innovation Way, Suite 300, Irvine, CA 92618
- **Credit terms (target):** Net 30
- **Industry:** Commercial aerospace subsystems
- **Classification:** Commercial (no ITAR / EAR99 on this part)

### Primary contact
- **Name:** Sarah Chen
- **Title:** Senior Sourcing Manager
- **Email:** `sarah.chen@nexgen-aerospace.example`
- **Phone:** +1 (949) 555-0142
- **Role in deal:** decision maker

### Supporting contacts
- **Mark Rodriguez**, Mechanical Engineer — `mark.rodriguez@nexgen-aerospace.example` *(technical)*
- **Priya Patel**, AP Specialist — `priya.patel@nexgen-aerospace.example` *(billing)*

### China partner (for partner-select stage)
- **Name:** Shenzhen Precision CNC Co., Ltd.
- **Slug:** `shenzhen-precision-demo`
- **Capability:** CNC milling / turning up to Ra 0.8, ±0.02mm
- **Scorecard (fictional rolling 12-month):** 94% on-time, 98.2% first-pass yield, 4.6/5 comms
- **MOQ:** 100 units
- **Typical lead time:** 5 weeks door-to-door (3w production + 2w freight)

## The RFQ

- **ID:** `RFQ-DEMO-0001`
- **Subject line (as received):** *"RFQ — Mounting bracket, P/N NX-BRK-4471, qty 500"*
- **Received:** Monday 09:12 via `rfq@revamfg.com`
- **Part number:** NX-BRK-4471 (customer's PN)
- **Description:** CNC-machined mounting bracket, 6061-T6 aluminum, clear Type II anodize
- **Quantity:** 500 units (firm order) + 1,000 unit/yr forecast
- **Target unit price:** $18 – $25
- **Target lead time:** 8 weeks from PO
- **Tolerances:** ±0.02mm on critical features, Ra 0.8 on mating surfaces
- **Drawing:** `NX-BRK-4471_rev_C.pdf` (referenced; not attached in demo)
- **Compliance:** Commercial — no ITAR, no export-controlled tech data
- **Quality reqs:** CoC + dimensional report (AQL 1.0) per lot; first-article inspection

## Expected quote (what the engine will produce in dry mode)

| Component | Per-unit |
|---|---|
| Material (6061-T6 billet, ~0.9 lb) | $2.80 |
| CNC time (22 min @ China partner rate) | $6.20 |
| Tooling amortization (over 500 units) | $1.40 |
| Anodize + mask | $1.90 |
| Inspection + CoC | $0.60 |
| Freight allocation (air consol) | $0.85 |
| Packaging | $0.35 |
| **Partner landed cost** | **$14.10** |
| Rev A margin @ 37% | $8.30 |
| **Customer unit price** | **$22.40** |

- **Line total:** $11,200 (500 × $22.40)
- **Quoted lead time:** 7 weeks (1w Rev A prep + 3w China production + 2w freight + 1w inspect/ship)
- **Quote validity:** 30 days
- **Expected win probability:** 68% (mid-budget, tight-but-achievable lead time, prior vendor issues on 2 quotes)

## 14-stage narration track

Each stage below has: the skill that fires, the one-line outcome, and
the record(s) created in `live` mode. PMs reading the output should
understand what the engine *is doing*, not just what it's saying.

| # | Stage | Skill | Outcome | Live-mode record |
|---|---|---|---|---|
| 1 | RFQ Intake | `reva-turbo-rfq-intake` | Parse email → structured RFQ object | `rfq` object created, tagged `reva-demo` |
| 2 | RFQ Qualify | `reva-turbo-rfq-qualify` | New customer + capability match + complexity 3/5 → **PROCEED** | `rfq` updated: `qualification="proceed"` |
| 3 | Customer Onboarding | `reva-turbo-customer-profile` | New account NexGen Aerospace + primary contact Sarah | `account` + `contact` created |
| 4 | Quote Generation | `reva-turbo-rfq-quote` | Build line item, margin calc, lead time → $22.40/unit | `quote` draft created |
| 5 | Quote Submission | `reva-turbo-customer-comms` | Compose cover email + quote PDF | `communication` record drafted (not sent in demo) |
| 6 | Order Acceptance | — | Simulate PO receipt → mark quote accepted | `order` created, `quote.status="accepted"` |
| 7 | Manufacturing Package | `reva-turbo-china-package` | Bundle drawings + translation notes + IP marks | `manufacturing_package` asset created |
| 8 | Partner Select | `reva-turbo-partner-select` | Score 3 candidates → Shenzhen Precision wins | `partner_award` record |
| 9 | Manufacturing Tracking | `reva-turbo-china-track` | 10-milestone schedule, stubs for progress pings | `production_job` with milestones |
| 10 | Shipping (CN→US) | `reva-turbo-logistics` | Book freight, generate shipping docs | `shipment` record |
| 11 | Incoming Inspection | `reva-turbo-inspect` | Sample AQL 1.0, dimensional + anodize check | `inspection` record (outcome: **ACCEPT**) |
| 12 | Quality Gate | `reva-turbo-quality-gate` | Final verification + CoC assembly | `qa_gate` record |
| 13 | Outbound Ship | `reva-turbo-order-track` | Domestic ground to Irvine, tracking pushed to Sarah | `outbound_shipment` record |
| 14 | Order Close | `reva-turbo-audit-trail` | T+3 satisfaction check stub, final audit summary | `order.status="closed"` + audit entry |

## Demo tagging conventions (live mode)

Every write MUST include these fields — no exceptions — so `/demo
clean` can reliably remove everything:

```json
{
"source": "reva-demo",
"tags": ["reva-demo", "reva-demo-0001"],
"metadata": {
"demo_run_id": "<ISO-8601 start timestamp>",
"demo_operator": "<PM email or display_name>"
}
}
```

Records in AutoMem get an associated memory with tag `reva-demo` for
symmetric cleanup.

## Cleanup (`/demo clean`)

1. Call `crm_search` with `{"filters": {"tag": "reva-demo"}}` across
accounts / contacts / rfqs / quotes / orders / shipments / etc.
2. For each returned record, call the matching `crm_*_delete` tool.
3. `mem_recall` with `{"tags": ["reva-demo"]}` → `mem_delete` each.
4. Report: "Removed N records (M accounts, O contacts, P RFQs, …)"

If any delete errors, stop and report — don't leave the workspace
half-cleaned. The PM can re-run `/demo clean` to retry; delete calls
are idempotent on already-gone records.

## Non-negotiables

- **No real customer lookalikes.** All company names / domains use the
`.example` TLD (RFC 6761 reserved — never resolves) so nothing can
leak into a real CRM.
- **Never send the drafted email.** Stage 5 drafts a communication but
the `send` call is always skipped, even in `live` mode.
- **Default to dry.** If the PM types plain `/demo`, ask once:
*"Dry run (narrate only — no CRM writes) or Live (creates tagged
demo records so you can see them in the dashboard)?"* — then obey.
2 changes: 1 addition & 1 deletion services/mcp-router/router/signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def _extract_detail(resp: httpx.Response, fallback: str) -> str:

<footer>
<span class="fa">Rev&nbsp;A Manufacturing · RevAOps</span>
<span>v2.1.3</span>
<span>v2.1.4</span>
</footer>
</main>
<script>
Expand Down
Loading