Skip to content

heymegabyte/agent-skills / 13-observability-and-growth

observability-and-growth

Verified

Full instrumentation from day one. PostHog consolidates product analytics + feature flags + error tracking (one platform, one bill). GA4 via GTM (14-step automation, custom dimensions over events, server-side tagging). Sentry (deep error tracking + performance). Stripe (webhook-first with idempotent processing). Listmonk on Coolify (newsletters via Amazon SES SMTP relay). PLG 7-layer framework. Programmatic SEO (5 page types). Incident auto-remediation via Sentry→Inngest pipeline. AI search (GEO) awareness. Local business conversions (phone_click, direction_click, form_submit, booking_click) with CRO patterns for both SaaS and local.

FileKindSize
SKILL.mdskill md6.8 KB
activation-funnel.mdmarkdown11.0 KB
analytics-configuration.mdmarkdown7.2 KB
conversion-optimization.mdmarkdown4.9 KB
email-marketing-and-listmonk.mdmarkdown8.1 KB
feature-flags-and-experiments.mdmarkdown6.6 KB
mcp-server-registry.mdmarkdown15.0 KB
sentry-alert-rules.mdmarkdown8.7 KB
square-payments.mdmarkdown13.3 KB
stripe-billing.mdmarkdown9.8 KB
user-feedback-collection.mdmarkdown8.9 KB
workers-tracing-otlp.mdmarkdown3.0 KB

user-feedback-collection.md

View on GitHub
---
name: "User Feedback Collection"
description: "In-app feedback widget: 5-star rating + text comment, stored in D1, reviewed at /admin/feedback. NPS survey at day 7 and day 30 via PostHog. Testimonial collection at /feedback for moderated display. Tracks satisfaction trends over time."
updated: "2026-04-23"
---

# User Feedback Collection

## Feedback Widget (In-App)

### HTML

```html
<button id="feedbackBtn" class="feedback-trigger" aria-label="Give feedback">
  πŸ’¬
</button>
<div id="feedbackModal" class="feedback-modal" hidden>
  <form id="feedbackForm">
    <h3>How's your experience?</h3>
    <div class="rating" role="radiogroup" aria-label="Rating">
      ${[1,2,3,4,5].map(n => `
        <button type="button" class="star" data-value="${n}" aria-label="${n} stars">
          ${'β˜…'.repeat(n)}${'β˜†'.repeat(5-n)}
        </button>
      `).join('')}
    </div>
    <textarea name="comment" placeholder="Tell us more (optional)" rows="3" maxlength="1000"></textarea>
    <button type="submit">Send Feedback</button>
  </form>
</div>
```

### Backend

```typescript
const FeedbackSchema = z.object({
  rating: z.number().min(1).max(5),
  comment: z.string().max(1000).optional(),
  page: z.string().optional(),
});

app.post('/api/feedback', async (c) => {
  const body = await c.req.json();
  const parsed = FeedbackSchema.parse(body);

  await c.env.DB.prepare(
    'INSERT INTO feedback (id, rating, comment, page, created_at) VALUES (?, ?, ?, ?, ?)'
  ).bind(ulid(), parsed.rating, parsed.comment || null, parsed.page || c.req.header('referer'), new Date().toISOString()).run();

  posthog.capture('feedback_submitted', { rating: parsed.rating });
  return c.json({ success: true });
});
```

### D1 Schema

```sql
CREATE TABLE feedback (
  id TEXT PRIMARY KEY,
  rating INTEGER NOT NULL CHECK(rating BETWEEN 1 AND 5),
  comment TEXT,
  page TEXT,
  status TEXT DEFAULT 'pending', -- pending, approved, rejected
  created_at TEXT NOT NULL
);
```

## NPS Survey (PostHog)

### Day 7 + Day 30 Surveys

```javascript
// Trigger via PostHog surveys feature
posthog.init('PROJECT_KEY', {
  api_host: 'https://us.i.posthog.com',
  surveys: true, // Enable surveys
});
```

Set up in PostHog dashboard:

- **Day 7 survey** β€” `"How likely are you to recommend [Product]? (0-10)"`
- **Day 30 survey** β€” Same question + `"What could we improve?"`
- Target: users who signed up 7/30 days ago

### NPS Scoring

- **9-10** β€” Promoter
- **7-8** β€” Passive
- **0-6** β€” Detractor
- **NPS** β€” `% Promoters - % Detractors` (target: >30)

## Testimonial Collection (`/feedback`)

Public-facing page for collecting testimonials:

```typescript
app.get('/feedback', (c) => c.html(renderFeedbackPage()));

app.post('/api/testimonial', async (c) => {
  const body = await c.req.json();
  const parsed = z.object({
    name: z.string().min(1).max(100),
    role: z.string().max(100).optional(),
    quote: z.string().min(10).max(500),
    rating: z.number().min(1).max(5),
  }).parse(body);

  await c.env.DB.prepare(
    'INSERT INTO testimonials (id, name, role, quote, rating, status, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)'
  ).bind(ulid(), parsed.name, parsed.role, parsed.quote, parsed.rating, 'pending', new Date().toISOString()).run();

  return c.json({ success: true, message: 'Thanks! Your testimonial will be reviewed.' });
});
```

**Moderation** β€” testimonials are `pending` until approved; display approved on homepage as social proof (skill 09).

## Admin View (`/admin/feedback`)

Table of all feedback with approve/reject buttons. Protected by auth or basic admin password.

## MCP Tools Available

### Notion MCP (`mcp__notion__*`) β€” for feedback storage and triage

- `mcp__notion__API-post-page` β€” create a feedback entry in Notion database
- `mcp__notion__API-query-data-source` β€” query feedback database with filters (rating, status, date)
- `mcp__notion__API-patch-page` β€” update feedback status (pending β†’ reviewed β†’ actioned)
- `mcp__notion__API-post-search` β€” search feedback by keyword
- `mcp__notion__API-retrieve-a-database` β€” get feedback database schema
- `mcp__notion__API-create-a-comment` β€” add internal notes to feedback entries

### Notion Feedback Database Schema

```
Database: "User Feedback"
Properties:
  - Rating (Number, 1-5)
  - Comment (Rich Text)
  - Page URL (URL)
  - Status (Select: Pending, Reviewed, Actioned, Dismissed)
  - Source (Select: Widget, NPS, Testimonial, Email)
  - User Email (Email, optional)
  - Created (Created Time)
  - Priority (Select: Low, Medium, High, Critical)
```

### PostHog MCP (`mcp__posthog__*`) β€” for feedback analytics

- `mcp__posthog__authenticate` β€” connect to PostHog instance

PostHog integration points:

- Track `feedback_submitted` event with rating + page properties
- Track `nps_response` event with score + segment (promoter/passive/detractor)
- Track `testimonial_submitted` event
- Create PostHog insight: "Average Rating Over Time" (line chart, weekly)
- Create PostHog insight: "NPS Score Trend" (line chart, monthly)
- Feature flag: `show_feedback_widget` β€” control which pages show the widget

### Playwright MCP (`mcp__playwright__*`) β€” for widget testing

- `mcp__playwright__browser_navigate` β€” navigate to page with feedback widget
- `mcp__playwright__browser_click` β€” open feedback modal, click stars, submit
- `mcp__playwright__browser_take_screenshot` β€” screenshot widget at each state (closed, open, submitted)
- `mcp__playwright__browser_snapshot` β€” verify ARIA roles on rating component

## Feedback Widget Implementation Details

### Angular Component (Standalone)

```typescript
@Component({
  selector: 'app-feedback-widget',
  standalone: true,
  imports: [CommonModule, ReactiveFormsModule],
  template: `
    <button (click)="isOpen.set(true)" class="feedback-trigger"
            aria-label="Give feedback" data-testid="feedback-trigger">
      <span aria-hidden="true">πŸ’¬</span>
    </button>
    @if (isOpen()) {
      <div class="feedback-modal" role="dialog" aria-label="Feedback form"
           data-testid="feedback-modal">
        <form [formGroup]="form" (ngSubmit)="submit()">
          <h3>How's your experience?</h3>
          <div role="radiogroup" aria-label="Rating">
            @for (n of [1,2,3,4,5]; track n) {
              <button type="button" [attr.aria-label]="n + ' stars'"
                      [class.active]="form.get('rating')?.value === n"
                      (click)="form.patchValue({ rating: n })"
                      data-testid="star-{{n}}">
                {{ n <= (form.get('rating')?.value || 0) ? 'β˜…' : 'β˜†' }}
              </button>
            }
          </div>
          <textarea formControlName="comment" placeholder="Tell us more (optional)"
                    rows="3" maxlength="1000" data-testid="feedback-comment"></textarea>
          <button type="submit" [disabled]="!form.get('rating')?.value"
                  data-testid="feedback-submit">Send Feedback</button>
        </form>
      </div>
    }
  `
})
export class FeedbackWidgetComponent {
  isOpen = signal(false);
  form = new FormGroup({
    rating: new FormControl<number | null>(null),
    comment: new FormControl(''),
  });

  private http = inject(HttpClient);

  submit() {
    this.http.post('/api/feedback', {
      rating: this.form.value.rating,
      comment: this.form.value.comment,
      page: window.location.pathname,
    }).subscribe(() => {
      this.isOpen.set(false);
      this.form.reset();
    });
  }
}
```

## Computer Use Integration

Use `mcp__computer-use__*` for feedback triage workflows:

1. **Notion dashboard review** β€” screenshot the Notion feedback database view to see pending feedback at a glance
2. **PostHog dashboards** β€” screenshot the NPS trend and rating distribution insights for weekly review
3. **Widget visual testing** β€” screenshot the feedback widget at 375px and 1280px to verify it doesn't obstruct content

## Acceptance Criteria

1. **Feedback widget visible on all pages** β€” Playwright: `data-testid="feedback-trigger"` visible on homepage + 2 inner pages
2. **Rating submission works** β€” POST `/api/feedback` with rating 1-5 returns `{ success: true }`
3. **Invalid ratings rejected** β€” POST with rating 0 or 6 returns 400 error
4. **Comment length enforced** β€” POST with >1000 char comment returns 400
5. **Feedback stored in D1** β€” query D1 `feedback` table; new row exists with correct rating + page
6. **Feedback synced to Notion** β€” `mcp__notion__API-query-data-source` returns matching entry
7. **PostHog event fires** β€” check PostHog for `feedback_submitted` event with correct properties
8. **NPS survey triggers at day 7** β€” user created 7 days ago sees NPS survey (PostHog survey targeting)
9. **Testimonials require moderation** β€” new testimonial has `status: 'pending'`, not shown on site until approved
10. **Widget accessible** β€” axe-core: 0 violations on feedback modal; keyboard navigable; ARIA roles correct
11. **Admin view shows all feedback** β€” `/admin/feedback` renders table with rating, comment, page, status, date
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path β€” even casually (like "the xlsx in my downloads") β€” and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall