---
name: plugin-feedback
description: "Send feedback about the plugin to the development team."
---

# Plugin Feedback Skill

> **Plugin**: ASU Canvas Course Builder
> **Webhook**: Coda automation (see below)

## Purpose
Collect user feedback about the plugin and send it to the development team via a Coda webhook. Can be triggered explicitly by the user or proactively by Claude when issues are detected.

## Required Inputs

| Input | Source |
|---|---|
| Feedback text | Conversational |
| Situation recap | Auto-generated by Claude |

Note: User name is resolved automatically from Canvas API via the proxy — no need to ask.

## Prerequisites
- Internet access (for proxy POST)
- Canvas credentials in `.env` (`CANVAS_TOKEN` and `CANVAS_DOMAIN`) — used for authentication

---

## Proxy Configuration

All feedback is sent through the ASU Plugin Proxy, which holds third-party API keys as Vercel environment variables. The plugin never touches Coda credentials directly.

**Endpoint**: `https://asu-plugin-api.vercel.app/api/feedback`

**Method**: POST

**Headers**:
```
Content-Type: application/json
Authorization: Bearer <CANVAS_TOKEN from .env>
X-Canvas-Domain: <CANVAS_DOMAIN from .env>
```

**Body**:
```json
{
  "feedback": "The actual feedback text",
  "situation_recap": "Claude's auto-generated context summary"
}
```

Note: The proxy authenticates the Canvas token, resolves the user's name from their Canvas profile, and forwards the feedback to the Coda table. No Coda credentials or user name are needed in the request.

---

## Trigger Modes

### 1. User-Initiated

User says something like:
- "Leave feedback"
- "I want to suggest something"
- "Report a problem"
- "Send feedback to the plugin team"

### 2. Proactive (Claude-Initiated)

Claude suggests feedback when it detects:
- **3+ consecutive errors** in a single skill invocation
- **User frustration signals**: "this isn't working", "that's wrong", "ugh", "this is broken"
- **Repeated rejections**: User rejects or asks to redo skill output more than twice
- **Workaround patterns**: Claude has to improvise around a limitation
- **Missing capability**: User asks for something no skill handles

**Proactive prompt**: "I noticed we hit some issues. Would you like me to send feedback to the plugin team so they can improve things?"

Present as an `AskUserQuestion`:

| Label | Description |
|---|---|
| **Yes, send feedback** | Help me capture what happened for the team |
| **No thanks** | I'll handle it myself |

If "No thanks": drop it. Do not ask again during this session.

---

## Flow

### Step 1: Verify Canvas Credentials

Check that `.env` exists with `CANVAS_TOKEN` and `CANVAS_DOMAIN`. These are required for the proxy to authenticate and resolve the user's name automatically.

- **If credentials exist**: Proceed to Step 2. The proxy will resolve the user's name from Canvas — no need to ask.
- **If credentials are missing**: Tell the user "I need your Canvas credentials to send feedback. Let's connect to Canvas first, or I can send it anonymously." If they choose anonymous, note that the proxy still requires a valid Canvas token — anonymous feedback is not currently supported without credentials.

### Step 2: Collect Feedback

Ask: "What feedback would you like to share? This can be anything — bug reports, feature requests, skill improvements, or general comments."

Let the user write freely. If they're brief, don't push for more — respect their time.

### Step 3: Auto-Generate Situation Recap

Claude automatically generates a brief recap of the session context. Include:
- Which skill(s) were running when the feedback was triggered
- What the user was trying to accomplish
- What went wrong or what limitation was encountered
- Any error messages or unexpected behavior
- Which course/module was being worked on (if applicable)

Keep the recap to 2-4 sentences. Be factual, not defensive.

**Example**:
> "User was running course-build for a 10-module nursing course. During Phase 3 (assessment creation), quiz-generator produced questions that didn't align with the module objectives — user rejected the output twice. The skill regenerated but still missed Objective 3.2 (pharmacokinetics calculations)."

### Step 4: Confirm and Send

Show the user what will be sent:

```
Feedback: [their feedback]
Situation recap: [auto-generated context]
```

Note: The user's name will be resolved automatically by the proxy from their Canvas profile — no need to display it here.

**Question**: "Ready to send this to the plugin team?"

| Label | Description |
|---|---|
| **Send it** | Submit the feedback now |
| **Edit first** | Let me adjust something |
| **Cancel** | Never mind |

- **Send it**: POST to the webhook (see below)
- **Edit first**: Let the user modify any field, then re-confirm
- **Cancel**: Drop it, no further prompts

### Step 5: Send

Read `CANVAS_TOKEN` and `CANVAS_DOMAIN` from `.env`, then POST to the proxy:

```bash
# Auth headers piped via stdin (not argv) so CANVAS_TOKEN never appears in `ps`/process listings.
curl -X POST "https://asu-plugin-api.vercel.app/api/feedback" \
  -H "Content-Type: application/json" \
  -H @- \
  -d '{
    "feedback": "...",
    "situation_recap": "..."
  }' <<HEADERS
Authorization: Bearer $CANVAS_TOKEN
X-Canvas-Domain: $CANVAS_DOMAIN
HEADERS
```

The proxy authenticates the token, resolves the user's name from Canvas, and forwards to the Coda table.

### Step 6: Confirm

Tell the user: "Feedback sent! The plugin team will review it. Thanks for helping improve the tool."

---

## Proactive Trigger Rules

These rules guide when Claude should suggest feedback. They are NOT automatic sends — always ask the user first.

| Trigger | When |
|---|---|
| Consecutive errors | 3+ errors from Canvas API calls, file operations, or skill logic in a single skill run |
| User frustration | Explicit frustration language detected in user messages |
| Repeated rejections | User says "no", "redo", "that's wrong", or similar 3+ times for the same skill output |
| Workaround needed | Claude has to deviate from skill instructions to accomplish the user's goal |
| Missing capability | User asks for something and no skill handles it |

**Important**: Only suggest feedback **once per session**. If the user declines, don't ask again.

---

## Output

The skill produces:
1. A POST request to the Coda webhook with feedback data
2. Confirmation message to the user
