Skip to content

Commit 1e92913

Browse files
fix: apply skill-reviewer feedback and preserve prototype to durable path
- Move preserved prototypes from .context/ to prototypes/<topic>/ at repo root since .context/ is ephemeral scratch space - Add trigger phrases: 'feasibility check', 'experiment with this', 'will this actually work' - Mark origin field as optional in template to match schema - Add example validation report in examples/ for LLM quality reference - Update prototype_path description in schema Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d8497bd commit 1e92913

4 files changed

Lines changed: 79 additions & 6 deletions

File tree

plugins/compound-engineering/skills/ce-prototype/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: ce:prototype
3-
description: "Build a throwaway prototype to validate assumptions before committing to an implementation plan. Use when the user says 'prototype this', 'let me test this idea first', 'spike on this', 'validate this before planning', 'build a quick prototype', 'I want to test if this works', 'try this out before we plan', 'proof of concept', 'quick test', 'throwaway prototype', or 'validate assumptions'. Also use when a brainstorm or requirements document contains untested assumptions about APIs, data sources, UX patterns, or integrations, or when the user wants to de-risk before planning."
3+
description: "Build a throwaway prototype to validate assumptions before committing to an implementation plan. Use when the user says 'prototype this', 'let me test this idea first', 'spike on this', 'validate this before planning', 'build a quick prototype', 'I want to test if this works', 'try this out before we plan', 'proof of concept', 'quick test', 'throwaway prototype', 'validate assumptions', 'feasibility check', 'experiment with this', or 'will this actually work'. Also use when a brainstorm or requirements document contains untested assumptions about APIs, data sources, UX patterns, or integrations, or when the user wants to de-risk before planning."
44
argument-hint: "[optional: feature description, requirements doc path, or specific assumptions to validate]"
55
---
66

@@ -194,7 +194,7 @@ If anything is found, flag it to the user with a brief explanation. Let them dec
194194

195195
Delete the prototype directory under `.context/compound-engineering/ce-prototype/`. The validation report in `docs/prototypes/` persists.
196196

197-
If the user explicitly asks to keep the prototype, respect that — but note in the validation report that the prototype code still exists and where.
197+
If the user explicitly asks to keep the prototype, move it out of `.context/` (which is ephemeral scratch space subject to cleanup) to a durable location: `prototypes/<topic-slug>/` at the repo root. Note the preserved path in the validation report.
198198

199199
#### 4.3 Recommend Next Step
200200

@@ -238,7 +238,7 @@ If this prototype was triggered manually (not from a brainstorm recommendation):
238238
- `docs/prototypes/<topic-slug>-validation-<date>.md` — Validation report
239239

240240
**Temporary output (deleted after report):**
241-
- `.context/compound-engineering/ce-prototype/<topic-slug>-<YYYYMMDD-HHMMSS>/` — Throwaway prototype code
241+
- `.context/compound-engineering/ce-prototype/<topic-slug>-<YYYYMMDD-HHMMSS>/` — Throwaway prototype code (moved to `prototypes/<topic-slug>/` if user chooses to keep it)
242242

243243
## Success Output
244244

plugins/compound-engineering/skills/ce-prototype/assets/validation-report-template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Use this template when writing prototype validation reports to `docs/prototypes/
77
title: [Topic] Prototype Validation
88
date: YYYY-MM-DD
99
topic: <kebab-case-topic>
10-
origin: <path to requirements doc, if any>
10+
origin: <path to requirements doc, if any> # optional
1111
status: complete | partial
1212
goals_proved: <count>
1313
goals_disproved: <count>
@@ -67,6 +67,6 @@ tags: [prototype, validation, keyword-one, keyword-two]
6767

6868
**Tech used:** [e.g., Static HTML + fetch API, Python script, curl commands]
6969
**Time spent:** [Actual effort, e.g., "~25 minutes"]
70-
**Prototype location:** [Deleted / Preserved at <path>]
70+
**Prototype location:** [Deleted / Preserved at prototypes/<topic-slug>/]
7171
**Artifacts preserved:** [List any files moved out of prototype before deletion, or "none"]
7272
```
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: Stripe Refund Webhooks Prototype Validation
3+
date: 2026-04-04
4+
topic: stripe-refund-webhooks
5+
origin: docs/brainstorms/2026-04-01-stripe-refund-webhooks-requirements.md
6+
status: complete
7+
goals_proved: 2
8+
goals_disproved: 1
9+
goals_inconclusive: 1
10+
tags: [prototype, validation, stripe, webhooks, refunds]
11+
effort_minutes: 30
12+
iterations: 2
13+
---
14+
15+
# Stripe Refund Webhooks Prototype Validation
16+
17+
## Summary
18+
19+
Prototyped Stripe webhook handling for refund events to validate payload structure, delivery latency, and rate limit viability before planning the refund notification system. Payload and latency validated well; free tier rate limits are insufficient for peak traffic.
20+
21+
## Origin
22+
23+
**Requirements document:** `docs/brainstorms/2026-04-01-stripe-refund-webhooks-requirements.md`
24+
**Prototype trigger:** Requirements assumed webhook payload includes refund metadata -- needed verification against real API behavior.
25+
26+
## Validation Goals and Results
27+
28+
### Goal 1: Stripe webhook payload includes refund metadata fields
29+
30+
- **Status:** Proved
31+
- **Evidence:** Triggered test refund events via Stripe CLI. The `charge.refund.updated` event payload includes `reason`, `receipt_number`, `amount`, `currency`, and `metadata` object. All fields needed for the notification system are present.
32+
- **Detail:** Metadata is nested under `data.object.metadata`, not at the top level. The plan should reference this path explicitly.
33+
34+
### Goal 2: Webhook delivery latency is under 2s for test events
35+
36+
- **Status:** Proved
37+
- **Evidence:** Measured 50 test webhook deliveries. Mean latency: 340ms. P95: 890ms. Max: 1.4s. All within the 2s threshold.
38+
39+
### Goal 3: Free tier webhook rate limit is sufficient for peak traffic
40+
41+
- **Status:** Disproved
42+
- **Evidence:** Free tier allows 500 webhooks/hour. Peak traffic estimate from requirements: 1,200 refund events/hour during holiday sales. Free tier covers ~42% of peak demand.
43+
- **Detail:** Paid tier ($0.01/event beyond free tier) or a queuing strategy needed. Estimated monthly cost at peak: ~$168.
44+
45+
### Goal 4: Retry logic handles partial failures gracefully
46+
47+
- **Status:** Inconclusive
48+
- **Evidence:** Stripe retries failed deliveries up to 3 times with exponential backoff. Simulated partial failures (returning 500 on first attempt, 200 on retry) worked correctly. However, the test only covered single-event retries -- behavior under concurrent retry storms during an outage recovery was not tested.
49+
50+
## Surprises
51+
52+
- Webhook signature verification requires access to the raw request body. Express middleware that parses JSON before signature verification will break it. The implementation must use `express.raw()` on the webhook endpoint.
53+
54+
## Constraints Discovered
55+
56+
| Constraint | Impact | Mitigation |
57+
|-----------|--------|------------|
58+
| Free tier: 500 webhooks/hour | Insufficient for peak traffic (1,200/hr) | Implement queuing strategy or upgrade to paid tier |
59+
| Refund metadata format changed in Stripe API v2024-12 | Field paths differ between API versions | Pin API version in webhook endpoint configuration |
60+
| Signature verification needs raw body | Standard JSON parsing middleware breaks verification | Use `express.raw()` middleware on webhook route |
61+
62+
## Recommendations
63+
64+
- **For planning:** Pin Stripe API version, use `express.raw()` on webhook endpoint, implement a queue for peak traffic buffering.
65+
- **For requirements:** Update rate limit assumption -- free tier is insufficient. Decision needed: paid tier vs. queuing.
66+
- **For further prototyping:** Retry behavior under concurrent storm conditions (Goal 4) should be validated once the queue architecture is designed.
67+
68+
## Prototype Details
69+
70+
**Tech used:** Node.js script, Stripe CLI for webhook forwarding, manual event triggers
71+
**Time spent:** ~30 minutes
72+
**Prototype location:** Deleted
73+
**Artifacts preserved:** None

plugins/compound-engineering/skills/ce-prototype/references/validation-report-schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Canonical frontmatter fields for prototype validation reports in `docs/prototype
2121
| `origin` | string (repo-relative path) | Path to the upstream requirements document, if any |
2222
| `tags` | array[string] | Search keywords, lowercase and hyphen-separated. Always include `prototype` and `validation`. Max 8 tags. |
2323
| `prototype_preserved` | boolean | Whether the prototype code was kept (default: false) |
24-
| `prototype_path` | string | Path to preserved prototype, if `prototype_preserved: true` |
24+
| `prototype_path` | string | Path to preserved prototype (e.g., `prototypes/<topic-slug>/`), if `prototype_preserved: true` |
2525
| `effort_minutes` | integer | Approximate time spent on the prototype |
2626
| `iterations` | integer | Number of build-feedback iterations before final validation (typically 1-3) |
2727

0 commit comments

Comments
 (0)