neversight/learn-skills.dev/portaly-sentry
Claude Code and agent skill by neversight/learn-skills.dev
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
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-sentrySemi-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:
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:
Standard → scope mapping (agent-internal; do not show this table to the user):
| User choice | Report includes | Blocking severity | Fix workflow | |
|---|---|---|---|---|
| 🚀 Pre-launch | all 26 checks | CRITICAL only | offered | |
| 🔧 Routine check | all 26 checks | CRITICAL + WARNING | offered | |
| 🏆 Gold standard | all 26 checks | all severities | offered | |
| 📄 Report only | all 26 checks | n/a | never offered | |
| ⏰ Weekly auto | skip scan → jump to Step 16 | n/a | n/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.
| ID | Check | Severity | |
|---|---|---|---|
| SIG-001 | Stable JSON sort order uses Object.entries().sort(([a],[b]) => a.localeCompare(b)) | CRITICAL | |
| SIG-002 | HMAC algorithm is SHA-256 | CRITICAL | |
| SIG-003 | Timestamp replay protection rejects callbacks older than 5 minutes | WARNING | |
| SIG-004 | Signature comparison uses crypto.timingSafeEqual | CRITICAL |
SUB — Subscription Lifecycle
Checks that subscription identifiers are stored and used correctly across the checkout-to-cancel flow.
| ID | Check | Severity | |
|---|---|---|---|
| SUB-001 | subscriptionId (= sessionId) persisted after checkout completion | CRITICAL | |
| SUB-002 | Duplicate callback handling via idempotency key | WARNING | |
| SUB-003 | Cancel/resume APIs use the persisted subscriptionId | CRITICAL |
CBK — Callback Endpoint
Checks callback endpoint configuration and behavior.
| ID | Check | Severity | |
|---|---|---|---|
| CBK-001 | callbackUrl uses HTTPS | CRITICAL | |
| CBK-002 | Signature verification failure is logged with diagnostics | WARNING | |
| CBK-003 | Callback handler returns explicit 200 on success | INFO |
ENV — Environment & Credentials
Checks credential management and environment configuration.
| ID | Check | Severity | |
|---|---|---|---|
| ENV-001 | PORTALY_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-002 | Sensitive .env files are gitignored (verified via git check-ignore; .env.example is excluded — it is a template meant to be committed) | CRITICAL | |
| ENV-003 | No API key or callback secret hardcoded in source files | CRITICAL |
SEC — Security Best Practices
Checks for security hygiene in the integration.
| ID | Check | Severity | |
|---|---|---|---|
| SEC-001 | No callback secret or API key in client-side / browser-accessible code | CRITICAL | |
| SEC-002 | Raw callback body persisted for audit trail | INFO | |
| SEC-003 | Secrets read from environment variables (rotation-ready) | INFO | |
| SEC-004 | Callback endpoint has no overly permissive CORS (Access-Control-Allow-Origin: *) | WARNING | |
| SEC-005 | Payment-related pages set Content-Security-Policy header | INFO |
WEB — Web Security Fundamentals
Checks for common web security issues in payment flows.
| ID | Check | Severity | |
|---|---|---|---|
| WEB-001 | successRedirectUrl / cancelRedirectUrl validated against domain allowlist | CRITICAL | |
| WEB-002 | Error responses do not expose stack traces, internal paths, or DB schema | WARNING | |
| WEB-003 | Callback endpoint validates Content-Type: application/json | WARNING | |
| WEB-004 | Callback endpoint enforces request body size limit | WARNING |
DEP — Dependency Security
Checks for known vulnerabilities in project dependencies.
| ID | Check | Severity | |
|---|---|---|---|
| DEP-001 | npm audit / pnpm audit reports no critical or high CVEs | CRITICAL | |
| DEP-002 | Lock file (package-lock.json / pnpm-lock.yaml) exists and is committed | WARNING |
DATA — Data Handling Security
Checks for safe data handling practices.
| ID | Check | Severity | |
|---|---|---|---|
| DATA-001 | Callback payload fields validated (type/length) before database writes | WARNING | |
| DATA-002 | Logs do not contain full API keys, callback secrets, or raw customer PII | WARNING |
Workflow
Step 4 — Discover integration files
Search the project for files related to Portaly payment integration:
- Files importing
cryptoor 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,sessionIdin 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:
- Check sort order pattern — compare against canonical implementation in
../portaly-payment/scripts/sign_callback.mjs. - Check HMAC algorithm — verify
createHmac('sha256', ...). - Check timestamp validation — look for comparison of
x-portaly-timestampagainst current time with a 5-minute window. - Check comparison method — verify
crypto.timingSafeEqualis used, not===or==.
Reference: scripts/check_signature_sort.mjs can automate this step.
Step 6 — Run SUB checks
Trace the subscription ID lifecycle:
- In the callback handler, after
status === 'completed', check what gets persisted. The stored value should besessionId(which equalssubscriptionIdper Portaly's current contract). - Check for idempotency — does the handler check if this
sessionIdwas already processed before fulfilling? - Trace the cancel/resume code path — verify it reads the same
subscriptionIdfield that the callback wrote and passes it to/subscriptions/{subscriptionId}/cancelor/resume.
Reference: scripts/check_subscription_lifecycle.mjs can automate this step.
Step 7 — Run CBK checks
- Check if
callbackUrlis constructed withhttps://. - Check the signature verification failure branch — does it log diagnostic info (timestamp, payload hash, expected vs actual)?
- Check that the success branch returns an explicit
200status.
Step 8 — Run ENV checks
- Look for
.env*files anywhere in the tree (root,functions/,apps/*,packages/*, etc.). - ENV-001 passes when both
PORTALY_API_KEYandPORTALY_CALLBACK_SECRETare referenced — either in.envfiles 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_KEYfor outbound calls andPORTALY_CALLBACK_SECRETfor verifying payment results. - ENV-002: verify each sensitive
.envfile is gitignored. Usegit check-ignoreso that hierarchical patterns are respected (e.g.**/.envin the root.gitignorecoversfunctions/.env). Skip.env.example— it is a placeholder template that is meant to be committed. If no sensitive.envfiles exist, or the project is not a git repository, the check passes (nothing can leak). - ENV-003: grep source files (excluding
node_modules,.env) for literalpcs_live_,pcs_test_, or any string that looks like a callback secret.
Step 9 — Run SEC checks
- Check for API key or callback secret in files under directories typically served to the browser (
src/,public/,app/,pages/for client components). Watch forNEXT_PUBLIC_prefixed env vars containing secrets. - Check if the raw callback body is saved to the database for auditing.
- Verify secrets are read from
process.envor equivalent, not hardcoded. - Check for CORS middleware on the callback endpoint — flag
Access-Control-Allow-Origin: *. - Check for CSP headers on success/cancel redirect pages.
Step 10 — Run WEB checks
- Check if
successRedirectUrlandcancelRedirectUrlare validated against an allowlist of trusted domains before being used in redirects. - Check error handling in the callback route — ensure
catchblocks do not send full error stacks in the response body. - Check that the callback endpoint validates
Content-Typeheader. - Check for body parser size limits (e.g.,
express.json({ limit: '1mb' })or equivalent).
Step 11 — Run DEP checks
- If
package.jsonexists, runnpm audit --jsonorpnpm audit --jsonand parse the output for critical/high severity vulnerabilities. - Check if
package-lock.jsonorpnpm-lock.yamlexists and is not in.gitignore.
Step 12 — Run DATA checks
- Check if callback payload fields are validated before database writes (type checks, length limits, sanitization).
- 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
- SKILL.md in the repositoryCheckingdata/skills-md/portaly-ai/portaly-skills/portaly-sentry/SKILL.md
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
[](https://verified-skill.com/skills/neversight/learn-skills.dev/portaly-sentry)