Skip to content

xiduzo/wtf / skills/wtf.pr-review

wtf.pr-review

Verified

This skill should be used when a developer or tech lead wants to review a pull request for correctness, spec adherence, and code quality — for example "review PR

evals/fixtures/scope-creep.json

View on GitHub
{
  "_note": "Fixture for eval 3 — diff correctly implements the claimed export scenario but also modifies src/auth/middleware.ts (JWT token revocation), which implements the 'Revoked session cannot export settlements' scenario claimed by a different Trace (#26) in the Trace Plan. Scope creep under the Trace model: work on scenarios outside this Trace's Scenario Claim.",
  "trace": {
    "number": 25,
    "title": "☄️ Trace: Add settlement export button",
    "labels": [{ "name": "trace" }, { "name": "designed" }],
    "body": "## Story\n\n- As a **Merchant**, I want **to export my visible settlements to CSV** so that **I can reconcile payouts in my own accounting tool**\n\n## Scenario Claim\n\n- Scenario: Merchant exports visible settlements to CSV\n\n<details>\n<summary>Claimed scenarios — synced from Feature #23 — edit there, not here</summary>\n\n```gherkin\nScenario: Merchant exports visible settlements to CSV\n  Given the merchant is viewing a list of settlements\n  When the merchant clicks the Export button\n  Then a CSV file is downloaded containing the visible settlements\n  And the filename includes today's date\n```\n\n</details>\n\n## Spine Position\n\n- Position: Extension\n- Builds on: Trace #21 (Skeleton — settlement list rendering)\n\n## Contracts & Interfaces\n\nGET /settlements/export response:\n- Content-Type: text/csv\n- Content-Disposition: attachment; filename=\"settlements-<date>.csv\"\n\n## Definition of Done\n\n- [ ] Export button renders in SettlementList component\n- [ ] Clicking the button triggers a file download\n- [ ] CSV filename includes today's date\n- [ ] Unit test covers the button render and click handler\n- [ ] System releasable after merge"
  },
  "feature": {
    "number": 23,
    "title": "🚀 Feature: Settlement export",
    "body": "## User Stories\n\n### As a Merchant, I want to export my visible settlements to CSV so that I can reconcile payouts in my own accounting tool\n\n```gherkin\nScenario: Merchant exports visible settlements to CSV\n  Given the merchant is viewing a list of settlements\n  When the merchant clicks the Export button\n  Then a CSV file is downloaded containing the visible settlements\n  And the filename includes today's date\n\nScenario: Revoked session cannot export settlements\n  Given a merchant session whose token has been revoked\n  When the merchant calls the export endpoint\n  Then the request is rejected as unauthorized\n  And no CSV file is produced\n```\n\n## Trace Plan\n\n1. [x] ☄️ Skeleton — settlement list rendering (claims: \"Merchant views the settlement list\") — Trace #21\n2. [ ] ☄️ Add settlement export button (claims: \"Merchant exports visible settlements to CSV\") — Trace #25\n3. [ ] ☄️ Deepening — export authorization failure modes (claims: \"Revoked session cannot export settlements\") — Trace #26\n"
  },
  "diff_stat": "4 files changed, 87 insertions(+), 6 deletions(-)",
  "diff": "diff --git a/src/ui/components/SettlementList/SettlementList.tsx b/src/ui/components/SettlementList/SettlementList.tsx\nindex e1f2a3b..c4d5e6f 100644\n--- a/src/ui/components/SettlementList/SettlementList.tsx\n+++ b/src/ui/components/SettlementList/SettlementList.tsx\n@@ -1,6 +1,8 @@\n import React from 'react';\n import { Settlement } from '../../../types/settlement';\n+import { exportSettlements } from '../../../api/settlements';\n \n interface Props {\n   settlements: Settlement[];\n@@ -15,6 +17,16 @@ export const SettlementList: React.FC<Props> = ({ settlements }) => {\n       </thead>\n       <tbody>...</tbody>\n     </table>\n+    <div className=\"settlement-list__actions\">\n+      <button\n+        type=\"button\"\n+        className=\"btn btn-secondary\"\n+        onClick={() => exportSettlements(settlements)}\n+      >\n+        Export CSV\n+      </button>\n+    </div>\n   );\n };\ndiff --git a/src/ui/components/SettlementList/SettlementList.test.tsx b/src/ui/components/SettlementList/SettlementList.test.tsx\nindex b2c3d4e..f7a8b9c 100644\n--- a/src/ui/components/SettlementList/SettlementList.test.tsx\n+++ b/src/ui/components/SettlementList/SettlementList.test.tsx\n@@ -1,5 +1,30 @@\n import { render, screen, fireEvent } from '@testing-library/react';\n import { SettlementList } from './SettlementList';\n+import { exportSettlements } from '../../../api/settlements';\n+\n+jest.mock('../../../api/settlements');\n \n describe('SettlementList', () => {\n+  const mockSettlements = [\n+    { id: 's-1', amount: 1000, currency: 'EUR', status: 'completed' },\n+  ];\n+\n+  it('renders the Export CSV button', () => {\n+    render(<SettlementList settlements={mockSettlements} />);\n+    expect(screen.getByRole('button', { name: /export csv/i })).toBeInTheDocument();\n+  });\n+\n+  it('calls exportSettlements when the button is clicked', () => {\n+    render(<SettlementList settlements={mockSettlements} />);\n+    fireEvent.click(screen.getByRole('button', { name: /export csv/i }));\n+    expect(exportSettlements).toHaveBeenCalledWith(mockSettlements);\n+  });\n });\ndiff --git a/src/api/routes/settlements.ts b/src/api/routes/settlements.ts\nindex c3d4e5f..a6b7c8d 100644\n--- a/src/api/routes/settlements.ts\n+++ b/src/api/routes/settlements.ts\n@@ -1,5 +1,7 @@\n import { Router } from 'express';\n import { SettlementRepository } from '../../repositories/settlement';\n+import { toCsv } from '../../utils/csv';\n \n const router = Router();\n+const settlementRepo = new SettlementRepository();\n \n@@ -20,3 +22,18 @@ router.get('/', async (req, res) => {\n   res.json(settlements);\n });\n+\n+router.get('/export', async (req, res) => {\n+  const settlements = await settlementRepo.findAll();\n+  const date = new Date().toISOString().split('T')[0];\n+  const csv = toCsv(settlements);\n+\n+  res.setHeader('Content-Type', 'text/csv');\n+  res.setHeader('Content-Disposition', `attachment; filename=\"settlements-${date}.csv\"`);\n+  res.send(csv);\n+});\n+\n export default router;\ndiff --git a/src/auth/middleware.ts b/src/auth/middleware.ts\nindex d4e5f6a..b7c8d9e 100644\n--- a/src/auth/middleware.ts\n+++ b/src/auth/middleware.ts\n@@ -1,6 +1,7 @@\n import { Request, Response, NextFunction } from 'express';\n import jwt from 'jsonwebtoken';\n+import { TokenBlacklist } from '../services/tokenBlacklist';\n \n const JWT_SECRET = process.env.JWT_SECRET!;\n+const blacklist = new TokenBlacklist();\n \n@@ -14,6 +15,14 @@ export const authenticateJwt = async (\n   try {\n     const token = authHeader.split(' ')[1];\n     const decoded = jwt.verify(token, JWT_SECRET);\n+\n+    if (await blacklist.isRevoked(token)) {\n+      return res.status(401).json({ error: 'Token has been revoked' });\n+    }\n+\n     req.user = decoded as JwtPayload;\n     next();\n   } catch (err) {\n"
}
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall