neversight/learn-skills.dev/portaly-sentry

Claude Code and agent skill by neversight/learn-skills.dev

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Run a security and reliability health check on a Portaly Vibe payment integration before deployment. Trigger when the user mentions Portaly health check, payment security audit, pre-deploy check, sentry scan, callback verification audit, integration safety check, or wants to verify their Portaly payment integration is safe to go live.

Install

npx vskill@latest install neversight/learn-skills.dev/portaly-sentry

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as neversight/learn-skills.dev/portaly-sentry.

Portaly Sentry — Payment Integration Health Check

Use this skill to run a comprehensive security and reliability health check on a Portaly Vibe payment integration. This skill is designed for non-engineers using vibe coding tools who want to ship with confidence. Keep output human and actionable: lead with a plain-language summary and let the user drill in — reserve the 26-row technical table for when they ask for it.

This skill works alongside portaly-payment. It uses the same API contract as the canonical source of truth for what a correct integration looks like.

Quick Start

Step 1 — Confirm integration exists
  • Confirm the project has a Portaly Vibe payment integration (look for portaly, callbackSecret, x-portaly-signature, or checkout session creation code).
  • If no integration is found, tell the user and stop.
Step 2 — Introduce what Sentry checks, in plain language

Before asking anything else, show the user this intro so they understand what Sentry actually does. Do not skip this step — the first-time user has no idea what "SIG" or "SUB" means.

Template:

Portaly Sentry checks your payment integration across 3 areas:
🏦 Is the payment flow itself done right? signatures, callbacks, subscriptions
🔐 Are your merchant credentials safe? env vars, credential management
🛡️ Is everything else hardened? dependencies, web security, data handling
26 checks in total, graded by severity: CRITICAL / WARNING / INFO.
Step 3 — Ask which project and which scan standard

Do not pick a default — ask the user both questions and wait for an answer. Phrase it as a checkpoint, not a suggestion.

Template:

Two things before I start:
① Which project should I scan? (e.g. ~/gratitude-app)
② Which standard do you want?
🚀 Pre-launch — pass all CRITICAL
🔧 Routine check — pass all CRITICAL + WARNING
🏆 Gold standard — pass all 26 (including INFO)
📄 Report only — scan and show the report, skip the fix workflow
⏰ Weekly auto — schedule a recurring scan instead of scanning now

Standard → scope mapping (agent-internal; do not show this table to the user):

User choiceReport includesBlocking severityFix workflow
🚀 Pre-launchall 26 checksCRITICAL onlyoffered
🔧 Routine checkall 26 checksCRITICAL + WARNINGoffered
🏆 Gold standardall 26 checksall severitiesoffered
📄 Report onlyall 26 checksn/anever offered
⏰ Weekly autoskip scan → jump to Step 16n/an/a

All four non-scheduled standards run all 26 checks. The first three differ only in the pass/fail threshold used in the Layer 1 summary's "Status" line (see Step 14). 📄 Report only runs the same scan but skips Layer 2 (the fix-mode prompt) and ends after Layer 3 — use it for audits, code-review handoffs, or when the user just wants to see results without committing to fixes now.

Advanced. If the user explicitly asks to scan only one category (e.g. "only scan signatures" or "re-run SIG"), accept that as a single-category mode using one of: SIG, SUB, CBK, ENV, SEC, WEB, DEP, DATA. Do not surface this as a main option — category codes overwhelm first-time users.

Prerequisites
  • Static analysis checks (SIG, SUB, CBK, ENV, SEC, WEB, DATA) do not require credentials.
  • For DEP checks, the project must have a package.json.
  • For reporting results to Portaly, the user needs a PORTALY_API_KEY.

Health Check Categories

SIG — Signature Verification

Checks that callback signature verification matches Portaly's canonical implementation.

IDCheckSeverity
SIG-001Stable JSON sort order uses Object.entries().sort(([a],[b]) => a.localeCompare(b))CRITICAL
SIG-002HMAC algorithm is SHA-256CRITICAL
SIG-003Timestamp replay protection rejects callbacks older than 5 minutesWARNING
SIG-004Signature comparison uses crypto.timingSafeEqualCRITICAL
SUB — Subscription Lifecycle

Checks that subscription identifiers are stored and used correctly across the checkout-to-cancel flow.

IDCheckSeverity
SUB-001subscriptionId (= sessionId) persisted after checkout completionCRITICAL
SUB-002Duplicate callback handling via idempotency keyWARNING
SUB-003Cancel/resume APIs use the persisted subscriptionIdCRITICAL
CBK — Callback Endpoint

Checks callback endpoint configuration and behavior.

IDCheckSeverity
CBK-001callbackUrl uses HTTPSCRITICAL
CBK-002Signature verification failure is logged with diagnosticsWARNING
CBK-003Callback handler returns explicit 200 on successINFO
ENV — Environment & Credentials

Checks credential management and environment configuration.

IDCheckSeverity
ENV-001PORTALY_API_KEY and PORTALY_CALLBACK_SECRET are referenced in .env files or in source code (proves the keys are wired via some mechanism — .env, secret manager, runtime env, etc.)CRITICAL
ENV-002Sensitive .env files are gitignored (verified via git check-ignore; .env.example is excluded — it is a template meant to be committed)CRITICAL
ENV-003No API key or callback secret hardcoded in source filesCRITICAL
SEC — Security Best Practices

Checks for security hygiene in the integration.

IDCheckSeverity
SEC-001No callback secret or API key in client-side / browser-accessible codeCRITICAL
SEC-002Raw callback body persisted for audit trailINFO
SEC-003Secrets read from environment variables (rotation-ready)INFO
SEC-004Callback endpoint has no overly permissive CORS (Access-Control-Allow-Origin: *)WARNING
SEC-005Payment-related pages set Content-Security-Policy headerINFO
WEB — Web Security Fundamentals

Checks for common web security issues in payment flows.

IDCheckSeverity
WEB-001successRedirectUrl / cancelRedirectUrl validated against domain allowlistCRITICAL
WEB-002Error responses do not expose stack traces, internal paths, or DB schemaWARNING
WEB-003Callback endpoint validates Content-Type: application/jsonWARNING
WEB-004Callback endpoint enforces request body size limitWARNING
DEP — Dependency Security

Checks for known vulnerabilities in project dependencies.

IDCheckSeverity
DEP-001npm audit / pnpm audit reports no critical or high CVEsCRITICAL
DEP-002Lock file (package-lock.json / pnpm-lock.yaml) exists and is committedWARNING
DATA — Data Handling Security

Checks for safe data handling practices.

IDCheckSeverity
DATA-001Callback payload fields validated (type/length) before database writesWARNING
DATA-002Logs do not contain full API keys, callback secrets, or raw customer PIIWARNING

Workflow

Step 4 — Discover integration files

Search the project for files related to Portaly payment integration:

  • Files importing crypto or containing HMAC operations
  • Files containing portaly, x-portaly-signature, x-portaly-timestamp, callbackSecret, PORTALY_CALLBACK_SECRET
  • Callback route handlers (Express routes, Next.js API routes, Cloud Functions HTTP triggers)
  • Files containing subscriptionId, sessionId in the context of checkout completion
  • Files containing successRedirectUrl, cancelRedirectUrl

Build a file inventory and map each file to the relevant check categories.

Step 5 — Run SIG checks

For each signature-related file:

  1. Check sort order pattern — compare against canonical implementation in ../portaly-payment/scripts/sign_callback.mjs.
  2. Check HMAC algorithm — verify createHmac('sha256', ...).
  3. Check timestamp validation — look for comparison of x-portaly-timestamp against current time with a 5-minute window.
  4. Check comparison method — verify crypto.timingSafeEqual is used, not === or ==.

Reference: scripts/check_signature_sort.mjs can automate this step.

Step 6 — Run SUB checks

Trace the subscription ID lifecycle:

  1. In the callback handler, after status === 'completed', check what gets persisted. The stored value should be sessionId (which equals subscriptionId per Portaly's current contract).
  2. Check for idempotency — does the handler check if this sessionId was already processed before fulfilling?
  3. Trace the cancel/resume code path — verify it reads the same subscriptionId field that the callback wrote and passes it to /subscriptions/{subscriptionId}/cancel or /resume.

Reference: scripts/check_subscription_lifecycle.mjs can automate this step.

Step 7 — Run CBK checks
  1. Check if callbackUrl is constructed with https://.
  2. Check the signature verification failure branch — does it log diagnostic info (timestamp, payload hash, expected vs actual)?
  3. Check that the success branch returns an explicit 200 status.
Step 8 — Run ENV checks
  1. Look for .env* files anywhere in the tree (root, functions/, apps/*, packages/*, etc.).
  2. ENV-001 passes when both PORTALY_API_KEY and PORTALY_CALLBACK_SECRET are referenced — either in .env files or by name in source code. A name appearing in code (e.g. process.env.PORTALY_API_KEY, defineSecret('PORTALY_API_KEY'), or any other usage) means the project has wired the key via some mechanism (.env, a secret manager, runtime env, shell exports, etc.) — the script does not need to know which platform is in use. Both keys are always required: PORTALY_API_KEY for outbound calls and PORTALY_CALLBACK_SECRET for verifying payment results.
  3. ENV-002: verify each sensitive .env file is gitignored. Use git check-ignore so that hierarchical patterns are respected (e.g. **/.env in the root .gitignore covers functions/.env). Skip .env.example — it is a placeholder template that is meant to be committed. If no sensitive .env files exist, or the project is not a git repository, the check passes (nothing can leak).
  4. ENV-003: grep source files (excluding node_modules, .env) for literal pcs_live_, pcs_test_, or any string that looks like a callback secret.
Step 9 — Run SEC checks
  1. Check for API key or callback secret in files under directories typically served to the browser (src/, public/, app/, pages/ for client components). Watch for NEXT_PUBLIC_ prefixed env vars containing secrets.
  2. Check if the raw callback body is saved to the database for auditing.
  3. Verify secrets are read from process.env or equivalent, not hardcoded.
  4. Check for CORS middleware on the callback endpoint — flag Access-Control-Allow-Origin: *.
  5. Check for CSP headers on success/cancel redirect pages.
Step 10 — Run WEB checks
  1. Check if successRedirectUrl and cancelRedirectUrl are validated against an allowlist of trusted domains before being used in redirects.
  2. Check error handling in the callback route — ensure catch blocks do not send full error stacks in the response body.
  3. Check that the callback endpoint validates Content-Type header.
  4. Check for body parser size limits (e.g., express.json({ limit: '1mb' }) or equivalent).
Step 11 — Run DEP checks
  1. If package.json exists, run npm audit --json or pnpm audit --json and parse the output for critical/high severity vulnerabilities.
  2. Check if package-lock.json or pnpm-lock.yaml exists and is not in .gitignore.
Step 12 — Run DATA checks
  1. Check if callback payload fields are validated before database writes (type checks, length limits, sanitization).
  2. Grep log statements (console.log, console.error, logger.) for potential secret or PII exposure — flag any that log the full callback payload, API key, or callback secret.
Step 13 — Sync results to Portaly (optional)

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/neversight/learn-skills.dev/portaly-sentry/badge)](https://verified-skill.com/skills/neversight/learn-skills.dev/portaly-sentry)

Something wrong with this skill or its page? Tell us.