Skip to content
Open
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
58 changes: 58 additions & 0 deletions .cursor/rules/import-playbook-flow-designer.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
description: Import Webex Contact Center Flow Designer sample assets from a GitHub repo subdirectory into playbooks/<slug>/src/
globs:
alwaysApply: false
---

# Import Playbook — Flow Designer samples (Cursor)

Create a Webex Integration Playbook by copying a **user-chosen top-level directory**
from a flows sample repository into `playbooks/<slug>/src/`, with full playbook
scaffolding (README, APPHUB.yaml, diagrams).

**How to invoke:** Type `/import-playbook-flow-designer` in Cursor chat. The message
**must** include the **source directory name** under the repo root (e.g.
`ai-agent-autonomous`). Optional: full GitHub clone URL (default
`https://github.com/WebexSamples/webex-contact-center-flows.git`), optional explicit
playbook folder name `<slug>` if it should differ from the directory name.

Example:

> `/import-playbook-flow-designer — source directory ai-agent-autonomous`

---

Follow the full instructions in `docs/commands/import_playbook_flow_designer.md`.

**Cursor-specific notes:**

- **Parameters:** Parse `<source-directory>` from the user message (required). Parse
optional GitHub URL; default clone:
`https://github.com/WebexSamples/webex-contact-center-flows.git`. Derive `<repo-slug>`
from the repo name in the URL (lowercase, kebab-case). Derive `<slug>` from
`<source-directory>` unless the user specifies a different playbook folder name.

- **Step 0:** Run `git clone --depth 1 <url> .import-playbook-cache/<repo-slug>` after
`mkdir -p .import-playbook-cache`. The clone is gitignored under
`.import-playbook-cache/`.

- **Step 1:** Read files from
`.import-playbook-cache/<repo-slug>/<source-directory>/` using the Read tool (and list
the directory if needed). If that path does not exist, stop and explain.

- **Copy:** Recursively copy everything under
`.import-playbook-cache/<repo-slug>/<source-directory>/` into
`playbooks/<slug>/src/`, preserving relative paths and filenames.

- **Validation:** Do not run validation automatically. Output the validation command
(`./scripts/validate-playbook-local.sh playbooks/<slug>`) in a code block and prompt
the author to run it in the integrated terminal.

- **Cleanup:** Run `rm -rf .import-playbook-cache/<repo-slug>` after the playbook is
created.

- Create all playbook output files directly in the workspace using the editor.

- Replace every instance of `<slug>` in the instructions with the chosen playbook folder
name; use `<repo-slug>` and `<source-directory>` as resolved from the user message and
URL.
216 changes: 216 additions & 0 deletions docs/commands/import_playbook_flow_designer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
# import-playbook-flow-designer — Core Instructions

This document is the single source of truth for the **import-playbook-flow-designer**
command. It is referenced by `.cursor/rules/import-playbook-flow-designer.mdc` (Cursor).
For generic third-party app imports, see [import_playbook.md](import_playbook.md). For
reference-only playbooks (no vendored `src/`), see
[import_playbook_reference.md](import_playbook_reference.md).

---

## Purpose

Create a Webex Integration Playbook whose `playbooks/<slug>/src/` contains a **vendored
copy** of one **top-level subdirectory** from a GitHub repository of Webex Contact
Center **Flow Designer** sample assets (flow definitions, README, diagrams, exported
configuration, etc.).

The “subset” is **the chosen folder** under the repo root—not the entire repository.
Each run must identify that folder by name.

---

## Parameters (required and optional)

| Parameter | Required | Description |
| --------- | -------- | ----------- |
| `<source-directory>` | **Yes** | Top-level directory name under the cloned repo (e.g. `ai-agent-autonomous`). This is **not** hardcoded; any valid folder name the repo contains may be used on subsequent runs. |
| GitHub repo URL | No | Defaults to `https://github.com/WebexSamples/webex-contact-center-flows.git`. Use a fork or alternate URL when needed. |
| `<slug>` (playbook folder) | No | Defaults to `<source-directory>` normalized to kebab-case. Override if the folder name would collide or is unsuitable for `playbooks/<slug>/`. |

Parse `owner` and `repo` from the GitHub URL. Derive **`<repo-slug>`** from `repo`:
lowercase, kebab-case (typically the repo name, e.g. `webex-contact-center-flows`).

---

## Step 0 — Clone the source repo into the workspace

Run a shallow clone into the workspace cache:

```bash
mkdir -p .import-playbook-cache
git clone --depth 1 https://github.com/<owner>/<repo>.git .import-playbook-cache/<repo-slug>
```

The clone path is `.import-playbook-cache/<repo-slug>/`.

If the clone fails (private repo, network error, wrong URL), note the error. Do not
proceed with copy steps until the clone exists or the user provides access. Raw-URL
fallback is impractical for multi-file flow trees; prefer fixing clone access (HTTPS,
VPN, fork).

---

## Step 1 — Read the selected sample directory

Verify that this path exists:

```text
.import-playbook-cache/<repo-slug>/<source-directory>/
```

If it does not exist, stop and report clearly (wrong `<source-directory>` name, wrong
branch, or repo layout changed).

Read thoroughly:

- Any `README*` in that directory or parent repo (for context)
- All files under `<source-directory>/` (flows, JSON, XML, images, etc.)
- Root `LICENSE` in `.import-playbook-cache/<repo-slug>/` if present

Extract:

- What the sample demonstrates (voice vs digital, AI agent, routing, etc.)
- Prerequisites stated in README (WxCC org, licenses, Flow Designer access)
- Import or deployment steps if documented
- Any limitations or product availability notes

**Competitor tools:** If the repository is primarily for Genesys, NICE, Five9, or
Talkdesk as the integration target, stop and explain that those are not allowed as
primary targets per project policy. Do not proceed.

---

## Step 2 — Determine the Playbook slug and APPHUB.yaml values

- **Folder slug:** Use explicit `<slug>` from the message if provided; otherwise use
`<source-directory>` as-is when it is already kebab-case and valid; normalize if
needed (lowercase, kebab-case, no leading/trailing hyphens).
- **Default integration profile:** Webex Contact Center + Flow Designer samples.

Use the integration mapping from [import_playbook.md](import_playbook.md) (Step 2). For
typical WxCC flow samples:

- `product_types`: include `contact_center`
- `app_context`: include `contact_center` and `sidebar` unless the sample clearly targets
a different surface

Set `categories`, `estimated_implementation_time`, and `tag_line` (max 128 characters)
from the sample’s scope and README.

---

## Step 3 — Create the Playbook folder and files

Create:

```text
playbooks/<slug>/
├── README.md
├── APPHUB.yaml
├── diagrams/
│ └── architecture-diagram.md
└── src/
└── (full recursive copy of <source-directory>/ contents — preserve paths)
```

Optional: `src/env.template` — only if the sample documents environment variables or
API keys that operators must configure. If the sample is purely flow/config assets
with no secrets pattern, omit `env.template`. Do not invent variables.

### README.md

Write all **six** required sections (same headers as
[PLAYBOOK_TEMPLATE/README.md](../../PLAYBOOK_TEMPLATE/README.md)). Follow the README
guidance in [import_playbook.md](import_playbook.md) (Step 3), adapted for Flow Designer:

- **Use Case Overview:** Business outcome, persona, estimated implementation time.
Credit the upstream sample, e.g. “This Playbook bundles assets from
[`<owner>/<repo>`](https://github.com/<owner>/<repo>) …”
- **Architecture:** WxCC, Flow Designer, and any AI/agent components; point to
`diagrams/architecture-diagram.md`.
- **Prerequisites:** WxCC org, admin access, any AI agent or feature flags noted upstream.
- **Code Scaffold:** Describe **files under `/src/`** (flow exports, configs, docs). It
is acceptable that there is no `main.js` — state what each type of asset is for.
- **Deployment Guide:** Numbered steps to import or apply flows in Control Hub / Flow
Designer using these files, aligned with upstream README when available.
- **Known Limitations:** Upstream caveats, license pointer to this repo’s
[`LICENSE`](../../LICENSE), and the standard Webex disclaimer from
[import_playbook.md](import_playbook.md).

### APPHUB.yaml

Follow [import_playbook.md](import_playbook.md) APPHUB section: copy comment structure
from [PLAYBOOK_TEMPLATE/APPHUB.yaml](../../PLAYBOOK_TEMPLATE/APPHUB.yaml), substitute
values. Set `product_url` to this Playbook’s path in WebexPlaybooks:
`https://github.com/webex/WebexPlaybooks/tree/main/playbooks/<slug>` (adjust if org
fork).

### diagrams/architecture-diagram.md

Mermaid diagram: caller or digital entry → WxCC flow → Flow Designer activities (e.g.
AI agent) → outcomes (handled, escalated). Use names from the sample.

### src/ — Copy the sample tree

Recursively copy **everything** under:

```text
.import-playbook-cache/<repo-slug>/<source-directory>/
```

into:

```text
playbooks/<slug>/src/
```

Preserve inner directory structure and filenames (same principle as
[import_playbook.md](import_playbook.md) Step 3 `src/`).

After copy, scan for accidental secrets (long tokens, private keys). Redact or replace
with placeholders and document in `env.template` only where operators must supply
values.

**Runtime code:** Flow Designer samples may not include executable integration code. Do
not add a fake `main.js` solely to satisfy a template; the README **Code Scaffold**
explains the assets. If the sample *does* include scripts, keep secrets in environment
variables per repository policy.

---

## Step 4 — Run validation checks

Do **not** run validation automatically. Output the command for the author:

```bash
./scripts/validate-playbook-local.sh playbooks/<slug>
```

---

## Step 5 — Report to the author

Same reporting structure as [import_playbook.md](import_playbook.md) Step 5 (what was
created, confidence, TODOs, APPHUB review, suggested next steps, branch naming
`playbook/<slug>`). Do not open a PR unless the author asks.

---

## Step 6 — Clean up the clone cache

Remove the clone used for this import:

```bash
rm -rf .import-playbook-cache/<repo-slug>
```

---

## Troubleshooting

- **Empty or missing path after clone:** Confirm `<source-directory>` matches a
top-level folder on the default branch (often `main`). Listing the repo root in the
clone helps.
- **Unreachable GitHub repo:** Verify URL, authentication, and that the sample is
public or that credentials are configured for `git clone`.
105 changes: 105 additions & 0 deletions playbooks/ai-agent-autonomous/APPHUB.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# APPHUB.yaml — Playbook metadata for Webex App Hub
# Copy this file into your Playbook folder under playbooks/<tool-slug>/
# Fill in all required fields. See CONTRIBUTING.md for field rules.

# -----------------------------------------------------------------------------
# friendly_id — Unique identifier. Must end with -playbook (e.g. epic-ehr-playbook)
# -----------------------------------------------------------------------------
friendly_id: "ai-agent-autonomous-playbook"

# -----------------------------------------------------------------------------
# title — Display name for the Playbook (matches ContentStack field)
# -----------------------------------------------------------------------------
title: "Webex Contact Center + Autonomous AI Agent Flow (Package Tracking)"

# -----------------------------------------------------------------------------
# tag_line — Short tagline for App Hub detail page (required, max 128 chars)
# -----------------------------------------------------------------------------
tag_line: "WxCC Flow Designer template: autonomous AI for package tracking, TTS, queue escalation"

# -----------------------------------------------------------------------------
# description — 1–2 sentences, used as App Hub listing copy
# -----------------------------------------------------------------------------
description: |
Flow Designer JSON templates for an inbound voice flow that uses Virtual Agent V2 with an
autonomous AI agent for package tracking, with human queue escalation and disconnect handling.

# -----------------------------------------------------------------------------
# product_types — Where this Playbook appears. Pick one or more.
# Valid: teams | meetings | calling | rooms | contact_center
# -----------------------------------------------------------------------------
product_types:
- "contact_center"

# -----------------------------------------------------------------------------
# app_context — Where the integration runs. Pick one or more.
# Valid: space | in_meeting | call | device | contact_center | sidebar | mcp | a2a
# -----------------------------------------------------------------------------
app_context:
- "contact_center"
- "sidebar"

# -----------------------------------------------------------------------------
# categories — App Hub category slugs. Pick one or more.
# Verticals: healthcare | financial-services | retail-ecommerce
# App categories (use kebab-case slugs):
# ai-agent-testing-observability | agent-supervisor-tools | analytics |
# calendar-scheduling | collaboration-management | customer-relations |
# customer-support | developer-tools | doc-management | education |
# finance | government | healthcare | human-resources | internet-of-things |
# marketing-sales | orchestration | platform | productivity |
# project-management | recording-transcriptions | security-compliance |
# self-service-bots | social-and-fun | strategy-team-planning |
# workflow-automation | workforce-optimization | other
# -----------------------------------------------------------------------------
categories:
- "customer-support"
- "self-service-bots"
- "workflow-automation"

# -----------------------------------------------------------------------------
# company_name — Your company or team name
# -----------------------------------------------------------------------------
company_name: "Webex for Developers"

# -----------------------------------------------------------------------------
# company_url — Your company or project URL
# -----------------------------------------------------------------------------
company_url: "https://developer.webex.com"

# -----------------------------------------------------------------------------
# support_url — Issues or support link (e.g. GitHub issues)
# -----------------------------------------------------------------------------
support_url: "https://github.com/webex/WebexPlaybooks/issues"

# -----------------------------------------------------------------------------
# product_url — Link to this Playbook in the repo (required)
# -----------------------------------------------------------------------------
product_url: "https://github.com/webex/WebexPlaybooks/tree/main/playbooks/ai-agent-autonomous"

# -----------------------------------------------------------------------------
# logo — (Optional) URL to your logo image. If not provided, defaults to the
# standard Webex Playbook logo.
# -----------------------------------------------------------------------------
logo: "https://images.contentstack.io/v3/assets/bltd14fd2a03236233f/blta2de9daa773c6604/60f71f81e2de935fc7e35dbe/download"

# -----------------------------------------------------------------------------
# estimated_implementation_time — e.g. "2-4 hours", "1 day"
# -----------------------------------------------------------------------------
estimated_implementation_time: "4-8 hours"

# -----------------------------------------------------------------------------
# third_party_tool — (Optional) The tool being integrated (e.g. Salesforce, Epic)
# Omit for generic playbooks (e.g. "any CMS")
# -----------------------------------------------------------------------------
third_party_tool: "Webex AI Agent Studio"

# -----------------------------------------------------------------------------
# privacy_url — Privacy policy URL (required; use Cisco default for Webex-authored)
# -----------------------------------------------------------------------------
privacy_url: "https://www.cisco.com/c/en/us/about/legal/privacy-full.html"

# -----------------------------------------------------------------------------
# submission_date — (Optional) ISO date (e.g. 2025-03-01)
# -----------------------------------------------------------------------------
submission_date: "2025-03-24"
Loading