@ketecode/loom 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +616 -2
- package/agents/accessibility-reviewer/AGENT.md +70 -0
- package/agents/accessibility-reviewer/evals/triggers.json +15 -0
- package/agents/agent-evaluator/AGENT.md +74 -0
- package/agents/agent-evaluator/evals/triggers.json +15 -0
- package/agents/architect/AGENT.md +82 -0
- package/agents/architect/evals/triggers.json +17 -0
- package/agents/billing-reviewer/AGENT.md +68 -0
- package/agents/billing-reviewer/evals/triggers.json +16 -0
- package/agents/code-reviewer/AGENT.md +51 -0
- package/agents/code-reviewer/evals/behavior.json +60 -0
- package/agents/code-reviewer/evals/triggers.json +14 -0
- package/agents/code-simplifier/AGENT.md +74 -0
- package/agents/code-simplifier/evals/triggers.json +15 -0
- package/agents/cpp-build-resolver/AGENT.md +73 -0
- package/agents/cpp-build-resolver/evals/triggers.json +16 -0
- package/agents/cpp-reviewer/AGENT.md +59 -0
- package/agents/cpp-reviewer/evals/triggers.json +16 -0
- package/agents/csharp-build-resolver/AGENT.md +84 -0
- package/agents/csharp-build-resolver/evals/triggers.json +17 -0
- package/agents/csharp-reviewer/AGENT.md +88 -0
- package/agents/csharp-reviewer/evals/triggers.json +17 -0
- package/agents/dart-build-resolver/AGENT.md +80 -0
- package/agents/dart-build-resolver/evals/triggers.json +17 -0
- package/agents/dart-reviewer/AGENT.md +66 -0
- package/agents/dart-reviewer/evals/triggers.json +17 -0
- package/agents/database-reviewer/AGENT.md +72 -0
- package/agents/database-reviewer/evals/triggers.json +16 -0
- package/agents/django-reviewer/AGENT.md +61 -0
- package/agents/django-reviewer/evals/triggers.json +15 -0
- package/agents/doc-updater/AGENT.md +92 -0
- package/agents/doc-updater/evals/triggers.json +14 -0
- package/agents/e2e-runner/AGENT.md +88 -0
- package/agents/e2e-runner/evals/triggers.json +16 -0
- package/agents/fastapi-reviewer/AGENT.md +63 -0
- package/agents/fastapi-reviewer/evals/triggers.json +15 -0
- package/agents/flutter-reviewer/AGENT.md +70 -0
- package/agents/flutter-reviewer/evals/triggers.json +15 -0
- package/agents/fsharp-build-resolver/AGENT.md +81 -0
- package/agents/fsharp-build-resolver/evals/triggers.json +15 -0
- package/agents/fsharp-reviewer/AGENT.md +77 -0
- package/agents/fsharp-reviewer/evals/triggers.json +15 -0
- package/agents/go-build-resolver/AGENT.md +85 -0
- package/agents/go-build-resolver/evals/triggers.json +16 -0
- package/agents/go-reviewer/AGENT.md +66 -0
- package/agents/go-reviewer/evals/triggers.json +16 -0
- package/agents/healthcare-reviewer/AGENT.md +65 -0
- package/agents/healthcare-reviewer/evals/triggers.json +16 -0
- package/agents/i18n-reviewer/AGENT.md +64 -0
- package/agents/i18n-reviewer/evals/triggers.json +16 -0
- package/agents/inbox-triager/AGENT.md +98 -0
- package/agents/inbox-triager/evals/triggers.json +16 -0
- package/agents/infra-reviewer/AGENT.md +93 -0
- package/agents/infra-reviewer/evals/triggers.json +15 -0
- package/agents/java-build-resolver/AGENT.md +82 -0
- package/agents/java-build-resolver/evals/triggers.json +16 -0
- package/agents/java-reviewer/AGENT.md +64 -0
- package/agents/java-reviewer/evals/triggers.json +16 -0
- package/agents/kotlin-build-resolver/AGENT.md +89 -0
- package/agents/kotlin-build-resolver/evals/triggers.json +16 -0
- package/agents/kotlin-reviewer/AGENT.md +75 -0
- package/agents/kotlin-reviewer/evals/triggers.json +16 -0
- package/agents/mle-reviewer/AGENT.md +68 -0
- package/agents/mle-reviewer/evals/triggers.json +16 -0
- package/agents/network-config-reviewer/AGENT.md +68 -0
- package/agents/network-config-reviewer/evals/triggers.json +17 -0
- package/agents/payments-reviewer/AGENT.md +64 -0
- package/agents/payments-reviewer/evals/triggers.json +16 -0
- package/agents/performance-optimizer/AGENT.md +86 -0
- package/agents/performance-optimizer/evals/triggers.json +16 -0
- package/agents/perl-build-resolver/AGENT.md +84 -0
- package/agents/perl-build-resolver/evals/triggers.json +15 -0
- package/agents/perl-reviewer/AGENT.md +77 -0
- package/agents/perl-reviewer/evals/triggers.json +15 -0
- package/agents/php-build-resolver/AGENT.md +88 -0
- package/agents/php-build-resolver/evals/triggers.json +16 -0
- package/agents/php-reviewer/AGENT.md +61 -0
- package/agents/php-reviewer/evals/triggers.json +15 -0
- package/agents/planner/AGENT.md +75 -0
- package/agents/planner/evals/triggers.json +17 -0
- package/agents/pr-test-analyzer/AGENT.md +82 -0
- package/agents/pr-test-analyzer/evals/triggers.json +16 -0
- package/agents/python-build-resolver/AGENT.md +87 -0
- package/agents/python-build-resolver/evals/triggers.json +16 -0
- package/agents/python-reviewer/AGENT.md +63 -0
- package/agents/python-reviewer/evals/triggers.json +15 -0
- package/agents/rag-reviewer/AGENT.md +71 -0
- package/agents/rag-reviewer/evals/triggers.json +16 -0
- package/agents/react-reviewer/AGENT.md +70 -0
- package/agents/react-reviewer/evals/triggers.json +16 -0
- package/agents/refactor-cleaner/AGENT.md +82 -0
- package/agents/refactor-cleaner/evals/triggers.json +16 -0
- package/agents/ruby-build-resolver/AGENT.md +93 -0
- package/agents/ruby-build-resolver/evals/triggers.json +16 -0
- package/agents/ruby-reviewer/AGENT.md +62 -0
- package/agents/ruby-reviewer/evals/triggers.json +16 -0
- package/agents/rust-build-resolver/AGENT.md +98 -0
- package/agents/rust-build-resolver/evals/triggers.json +16 -0
- package/agents/rust-reviewer/AGENT.md +78 -0
- package/agents/rust-reviewer/evals/triggers.json +15 -0
- package/agents/security-reviewer/AGENT.md +84 -0
- package/agents/security-reviewer/evals/triggers.json +16 -0
- package/agents/silent-failure-hunter/AGENT.md +66 -0
- package/agents/silent-failure-hunter/evals/triggers.json +16 -0
- package/agents/solidity-reviewer/AGENT.md +70 -0
- package/agents/solidity-reviewer/evals/triggers.json +16 -0
- package/agents/spec-reviewer/AGENT.md +95 -0
- package/agents/spec-reviewer/evals/behavior.json +57 -0
- package/agents/spec-reviewer/evals/triggers.json +16 -0
- package/agents/swift-build-resolver/AGENT.md +85 -0
- package/agents/swift-build-resolver/evals/triggers.json +15 -0
- package/agents/swift-reviewer/AGENT.md +75 -0
- package/agents/swift-reviewer/evals/triggers.json +15 -0
- package/agents/task-implementer/AGENT.md +89 -0
- package/agents/task-implementer/evals/behavior.json +47 -0
- package/agents/task-implementer/evals/triggers.json +16 -0
- package/agents/typescript-build-resolver/AGENT.md +76 -0
- package/agents/typescript-build-resolver/evals/triggers.json +15 -0
- package/agents/typescript-reviewer/AGENT.md +76 -0
- package/agents/typescript-reviewer/evals/triggers.json +15 -0
- package/agents/vue-reviewer/AGENT.md +75 -0
- package/agents/vue-reviewer/evals/triggers.json +15 -0
- package/bin/kete-loom.js +723 -0
- package/commands/aside.md +19 -0
- package/commands/brainstorm.md +25 -0
- package/commands/build-fix.md +26 -0
- package/commands/campaign.md +19 -0
- package/commands/changelog.md +36 -0
- package/commands/checkpoint.md +26 -0
- package/commands/codemap.md +25 -0
- package/commands/commit.md +26 -0
- package/commands/debug.md +27 -0
- package/commands/deps-audit.md +32 -0
- package/commands/dual-review.md +34 -0
- package/commands/epic-decompose.md +21 -0
- package/commands/explain.md +37 -0
- package/commands/feature-dev.md +23 -0
- package/commands/finish-branch.md +26 -0
- package/commands/fix-bug.md +38 -0
- package/commands/hookify.md +23 -0
- package/commands/i18n-check.md +39 -0
- package/commands/issue-sync.md +22 -0
- package/commands/jira.md +19 -0
- package/commands/learn.md +23 -0
- package/commands/loom.md +21 -0
- package/commands/loop.md +20 -0
- package/commands/model-route.md +27 -0
- package/commands/onboard.md +35 -0
- package/commands/orchestrate.md +21 -0
- package/commands/plan-feature.md +36 -0
- package/commands/postmortem.md +42 -0
- package/commands/pr-describe.md +39 -0
- package/commands/pr.md +22 -0
- package/commands/prd.md +41 -0
- package/commands/production-readiness.md +45 -0
- package/commands/project-init.md +21 -0
- package/commands/refactor-clean.md +24 -0
- package/commands/resume-session.md +22 -0
- package/commands/review.md +35 -0
- package/commands/save-session.md +37 -0
- package/commands/security-scan.md +32 -0
- package/commands/sessions.md +21 -0
- package/commands/skill-create.md +21 -0
- package/commands/tdd.md +36 -0
- package/commands/test-coverage.md +24 -0
- package/commands/threat-model.md +36 -0
- package/commands/update-docs.md +25 -0
- package/commands/usage-report.md +43 -0
- package/commands/verify.md +21 -0
- package/hooks/block-dangerous-commands/HOOK.md +30 -0
- package/hooks/block-dangerous-commands/cases.json +50 -0
- package/hooks/block-dangerous-commands/hook.js +75 -0
- package/hooks/block-foreground-servers/HOOK.md +34 -0
- package/hooks/block-foreground-servers/cases.json +31 -0
- package/hooks/block-foreground-servers/hook.js +41 -0
- package/hooks/block-no-verify/HOOK.md +25 -0
- package/hooks/block-no-verify/cases.json +30 -0
- package/hooks/block-no-verify/hook.js +43 -0
- package/hooks/capture-lessons/HOOK.md +24 -0
- package/hooks/capture-lessons/hook.js +48 -0
- package/hooks/format-on-edit/HOOK.md +24 -0
- package/hooks/format-on-edit/hook.js +89 -0
- package/hooks/guard-secrets/HOOK.md +19 -0
- package/hooks/guard-secrets/cases.json +110 -0
- package/hooks/guard-secrets/hook.js +44 -0
- package/hooks/load-session-context/HOOK.md +20 -0
- package/hooks/load-session-context/hook.js +56 -0
- package/hooks/notify-on-stop/HOOK.md +25 -0
- package/hooks/notify-on-stop/hook.js +27 -0
- package/hooks/protect-files/HOOK.md +24 -0
- package/hooks/protect-files/cases.json +27 -0
- package/hooks/protect-files/hook.js +39 -0
- package/hooks/protect-lint-config/HOOK.md +29 -0
- package/hooks/protect-lint-config/cases.json +18 -0
- package/hooks/protect-lint-config/fixtures/.eslintrc.json +1 -0
- package/hooks/protect-lint-config/fixtures/.golangci.yml +1 -0
- package/hooks/protect-lint-config/fixtures/.prettierrc +1 -0
- package/hooks/protect-lint-config/fixtures/.rubocop.yml +1 -0
- package/hooks/protect-lint-config/fixtures/biome.json +1 -0
- package/hooks/protect-lint-config/fixtures/eslint.config.mjs +1 -0
- package/hooks/protect-lint-config/fixtures/ruff.toml +1 -0
- package/hooks/protect-lint-config/hook.js +25 -0
- package/hooks/read-before-edit/HOOK.md +26 -0
- package/hooks/read-before-edit/cases.json +15 -0
- package/hooks/read-before-edit/hook.js +50 -0
- package/hooks/run.js +148 -0
- package/hooks/verify-before-stop/HOOK.md +32 -0
- package/hooks/verify-before-stop/hook.js +70 -0
- package/mcp/atlassian.json +11 -0
- package/mcp/chrome-devtools.json +18 -0
- package/mcp/clickhouse.json +11 -0
- package/mcp/cloudflare.json +11 -0
- package/mcp/context7.json +11 -0
- package/mcp/exa.json +11 -0
- package/mcp/fetch.json +17 -0
- package/mcp/figma.json +11 -0
- package/mcp/firecrawl.json +11 -0
- package/mcp/git.json +17 -0
- package/mcp/github.json +11 -0
- package/mcp/linear.json +11 -0
- package/mcp/memory.json +18 -0
- package/mcp/notion.json +11 -0
- package/mcp/playwright.json +18 -0
- package/mcp/sentry.json +11 -0
- package/mcp/stripe.json +11 -0
- package/mcp/supabase.json +11 -0
- package/mcp/time.json +17 -0
- package/mcp/vercel.json +11 -0
- package/package.json +61 -4
- package/profiles.json +214 -0
- package/rules/common.md +21 -0
- package/rules/cpp.md +29 -0
- package/rules/csharp.md +25 -0
- package/rules/dart.md +29 -0
- package/rules/fsharp.md +28 -0
- package/rules/git.md +26 -0
- package/rules/go.md +29 -0
- package/rules/java.md +29 -0
- package/rules/kotlin.md +27 -0
- package/rules/perl.md +26 -0
- package/rules/php.md +28 -0
- package/rules/python.md +30 -0
- package/rules/ruby.md +27 -0
- package/rules/rust.md +26 -0
- package/rules/security.md +29 -0
- package/rules/swift.md +28 -0
- package/rules/testing.md +25 -0
- package/rules/typescript.md +29 -0
- package/rules/use-skills.md +23 -0
- package/schemas/skill-frontmatter.schema.json +52 -0
- package/scripts/lib/audit.js +96 -0
- package/scripts/lib/behavior.js +52 -0
- package/scripts/lib/frontmatter.js +65 -0
- package/scripts/lib/hooks-install.js +294 -0
- package/scripts/lib/i18n.js +51 -0
- package/scripts/lib/inventory.js +85 -0
- package/scripts/lib/lint.js +180 -0
- package/scripts/lib/mcp-install.js +288 -0
- package/scripts/lib/profiles.js +128 -0
- package/scripts/lib/render.js +92 -0
- package/scripts/lib/rules-install.js +118 -0
- package/scripts/lib/skills.js +87 -0
- package/scripts/lib/targets.js +123 -0
- package/skills/accounting-api-integration/SKILL.md +81 -0
- package/skills/accounting-api-integration/evals/triggers.json +17 -0
- package/skills/accounting-api-integration/references/quickbooks.md +48 -0
- package/skills/accounting-api-integration/references/xero.md +45 -0
- package/skills/agent-failure-debugging/SKILL.md +92 -0
- package/skills/agent-failure-debugging/evals/triggers.json +16 -0
- package/skills/agent-harness-design/SKILL.md +125 -0
- package/skills/agent-harness-design/evals/triggers.json +21 -0
- package/skills/agent-outbound-messaging/SKILL.md +92 -0
- package/skills/agent-outbound-messaging/evals/triggers.json +16 -0
- package/skills/agent-security/SKILL.md +117 -0
- package/skills/agent-security/evals/triggers.json +16 -0
- package/skills/agent-security/references/host-configs.md +37 -0
- package/skills/ai-media-generation/SKILL.md +89 -0
- package/skills/ai-media-generation/evals/triggers.json +16 -0
- package/skills/ai-media-generation/references/job-pipeline.md +76 -0
- package/skills/angular-patterns/SKILL.md +122 -0
- package/skills/angular-patterns/evals/triggers.json +16 -0
- package/skills/api-client-integration/SKILL.md +86 -0
- package/skills/api-client-integration/evals/triggers.json +16 -0
- package/skills/api-client-integration/references/resilience.md +57 -0
- package/skills/api-design/SKILL.md +96 -0
- package/skills/api-design/evals/triggers.json +18 -0
- package/skills/api-design/references/conventions.md +133 -0
- package/skills/architecture-decision-records/SKILL.md +98 -0
- package/skills/architecture-decision-records/evals/triggers.json +17 -0
- package/skills/article-writing/SKILL.md +108 -0
- package/skills/article-writing/evals/triggers.json +16 -0
- package/skills/aspnet-core-patterns/SKILL.md +149 -0
- package/skills/aspnet-core-patterns/evals/triggers.json +16 -0
- package/skills/auth-patterns/SKILL.md +104 -0
- package/skills/auth-patterns/evals/triggers.json +17 -0
- package/skills/auth-patterns/references/oauth-oidc.md +64 -0
- package/skills/autonomous-loops/SKILL.md +99 -0
- package/skills/autonomous-loops/evals/triggers.json +14 -0
- package/skills/aws-patterns/SKILL.md +91 -0
- package/skills/aws-patterns/evals/triggers.json +16 -0
- package/skills/azure-patterns/SKILL.md +86 -0
- package/skills/azure-patterns/evals/triggers.json +16 -0
- package/skills/benchmark-methodology/SKILL.md +88 -0
- package/skills/benchmark-methodology/evals/triggers.json +16 -0
- package/skills/benchmark-methodology/references/language-harnesses.md +130 -0
- package/skills/bgp-diagnostics/SKILL.md +84 -0
- package/skills/bgp-diagnostics/evals/triggers.json +18 -0
- package/skills/bgp-diagnostics/references/bgp-reference.md +81 -0
- package/skills/bioinformatics-workflows/SKILL.md +108 -0
- package/skills/bioinformatics-workflows/evals/triggers.json +16 -0
- package/skills/bioinformatics-workflows/references/commands.md +71 -0
- package/skills/bioinformatics-workflows/references/formats.md +24 -0
- package/skills/bioinformatics-workflows/references/workflow-managers.md +107 -0
- package/skills/blender-automation/SKILL.md +100 -0
- package/skills/blender-automation/evals/triggers.json +16 -0
- package/skills/blender-automation/references/batch-and-render.md +77 -0
- package/skills/blender-automation/references/bpy-inspection.md +91 -0
- package/skills/blender-automation/references/rig-and-retarget-checks.md +23 -0
- package/skills/brand-strategy/SKILL.md +83 -0
- package/skills/brand-strategy/evals/triggers.json +16 -0
- package/skills/brand-voice/SKILL.md +112 -0
- package/skills/brand-voice/evals/triggers.json +16 -0
- package/skills/browser-qa/SKILL.md +99 -0
- package/skills/browser-qa/evals/triggers.json +16 -0
- package/skills/bun-runtime/SKILL.md +93 -0
- package/skills/bun-runtime/evals/triggers.json +16 -0
- package/skills/change-impact-analysis/SKILL.md +89 -0
- package/skills/change-impact-analysis/evals/triggers.json +16 -0
- package/skills/change-impact-analysis/references/graph-commands.md +28 -0
- package/skills/cisco-ios-config/SKILL.md +101 -0
- package/skills/cisco-ios-config/evals/triggers.json +18 -0
- package/skills/cisco-ios-config/references/verification.md +63 -0
- package/skills/clickhouse-patterns/SKILL.md +101 -0
- package/skills/clickhouse-patterns/evals/triggers.json +18 -0
- package/skills/clickhouse-patterns/references/engines-and-views.md +138 -0
- package/skills/clinical-decision-support/SKILL.md +90 -0
- package/skills/clinical-decision-support/evals/triggers.json +16 -0
- package/skills/clinical-decision-support/references/cds-hooks.md +76 -0
- package/skills/clinical-decision-support/references/regulatory-boundaries.md +37 -0
- package/skills/code-tour/SKILL.md +97 -0
- package/skills/code-tour/evals/triggers.json +14 -0
- package/skills/codebase-onboarding/SKILL.md +112 -0
- package/skills/codebase-onboarding/evals/triggers.json +14 -0
- package/skills/cold-outreach-sequences/SKILL.md +90 -0
- package/skills/cold-outreach-sequences/evals/triggers.json +16 -0
- package/skills/content-repurposing/SKILL.md +82 -0
- package/skills/content-repurposing/evals/triggers.json +16 -0
- package/skills/context-budget/SKILL.md +84 -0
- package/skills/context-budget/evals/triggers.json +14 -0
- package/skills/contract-drafting/SKILL.md +96 -0
- package/skills/contract-drafting/evals/triggers.json +16 -0
- package/skills/contract-drafting/references/term-sheets.md +68 -0
- package/skills/contract-first-development/SKILL.md +86 -0
- package/skills/contract-first-development/evals/triggers.json +16 -0
- package/skills/contract-first-development/references/tooling.md +46 -0
- package/skills/conventional-commits/SKILL.md +144 -0
- package/skills/conventional-commits/evals/triggers.json +16 -0
- package/skills/cpp-patterns/SKILL.md +129 -0
- package/skills/cpp-patterns/evals/triggers.json +16 -0
- package/skills/cpp-patterns/references/cmake-and-tooling.md +88 -0
- package/skills/cpp-patterns/references/undefined-behaviour.md +75 -0
- package/skills/cpp-testing/SKILL.md +131 -0
- package/skills/cpp-testing/evals/triggers.json +16 -0
- package/skills/csharp-patterns/SKILL.md +110 -0
- package/skills/csharp-patterns/evals/triggers.json +17 -0
- package/skills/csharp-patterns/references/analyzers.md +59 -0
- package/skills/csharp-testing/SKILL.md +85 -0
- package/skills/csharp-testing/evals/triggers.json +17 -0
- package/skills/csharp-testing/references/integration-tests.md +77 -0
- package/skills/css-architecture/SKILL.md +143 -0
- package/skills/css-architecture/evals/triggers.json +16 -0
- package/skills/customs-trade-compliance/SKILL.md +95 -0
- package/skills/customs-trade-compliance/evals/triggers.json +16 -0
- package/skills/customs-trade-compliance/references/incoterms-2020.md +42 -0
- package/skills/dart-patterns/SKILL.md +157 -0
- package/skills/dart-patterns/evals/triggers.json +18 -0
- package/skills/dart-testing/SKILL.md +164 -0
- package/skills/dart-testing/evals/triggers.json +18 -0
- package/skills/data-analysis-notebooks/SKILL.md +113 -0
- package/skills/data-analysis-notebooks/evals/triggers.json +16 -0
- package/skills/data-analysis-notebooks/references/dataframe-pitfalls.md +49 -0
- package/skills/data-analysis-notebooks/references/statistics-pitfalls.md +24 -0
- package/skills/data-pipelines/SKILL.md +90 -0
- package/skills/data-pipelines/evals/triggers.json +16 -0
- package/skills/data-pipelines/references/orchestrators.md +64 -0
- package/skills/database-migrations/SKILL.md +102 -0
- package/skills/database-migrations/evals/triggers.json +16 -0
- package/skills/database-migrations/references/recipes.md +98 -0
- package/skills/database-migrations/references/tools.md +21 -0
- package/skills/dbt-patterns/SKILL.md +96 -0
- package/skills/dbt-patterns/evals/triggers.json +16 -0
- package/skills/dbt-patterns/references/yaml-examples.md +114 -0
- package/skills/decision-council/SKILL.md +98 -0
- package/skills/decision-council/evals/triggers.json +16 -0
- package/skills/deep-research/SKILL.md +107 -0
- package/skills/deep-research/evals/triggers.json +14 -0
- package/skills/dependency-audit/SKILL.md +103 -0
- package/skills/dependency-audit/evals/triggers.json +16 -0
- package/skills/dependency-audit/references/tools.md +124 -0
- package/skills/deployment-strategies/SKILL.md +108 -0
- package/skills/deployment-strategies/evals/triggers.json +16 -0
- package/skills/design-brainstorming/SKILL.md +132 -0
- package/skills/design-brainstorming/evals/behavior.json +55 -0
- package/skills/design-brainstorming/evals/triggers.json +16 -0
- package/skills/design-brainstorming/references/visual-mockups.md +34 -0
- package/skills/desktop-app-testing/SKILL.md +104 -0
- package/skills/desktop-app-testing/evals/triggers.json +16 -0
- package/skills/desktop-app-testing/references/drivers.md +81 -0
- package/skills/django-patterns/SKILL.md +123 -0
- package/skills/django-patterns/evals/triggers.json +16 -0
- package/skills/docker-patterns/SKILL.md +132 -0
- package/skills/docker-patterns/evals/triggers.json +16 -0
- package/skills/docker-patterns/references/dockerfiles.md +105 -0
- package/skills/document-processing/SKILL.md +100 -0
- package/skills/document-processing/evals/triggers.json +17 -0
- package/skills/document-processing/references/extraction-and-ocr.md +71 -0
- package/skills/document-processing/references/forms-and-conversion.md +69 -0
- package/skills/document-processing/references/redaction.md +61 -0
- package/skills/e2e-testing-playwright/SKILL.md +94 -0
- package/skills/e2e-testing-playwright/evals/triggers.json +16 -0
- package/skills/e2e-testing-playwright/references/config-and-ci.md +129 -0
- package/skills/ef-core-patterns/SKILL.md +117 -0
- package/skills/ef-core-patterns/evals/triggers.json +16 -0
- package/skills/email-deliverability/SKILL.md +99 -0
- package/skills/email-deliverability/evals/triggers.json +17 -0
- package/skills/email-deliverability/references/dns-records.md +85 -0
- package/skills/energy-procurement/SKILL.md +106 -0
- package/skills/energy-procurement/evals/triggers.json +16 -0
- package/skills/error-handling-patterns/SKILL.md +112 -0
- package/skills/error-handling-patterns/evals/triggers.json +18 -0
- package/skills/error-handling-patterns/references/language-idioms.md +49 -0
- package/skills/estimation-and-scoping/SKILL.md +97 -0
- package/skills/estimation-and-scoping/evals/triggers.json +14 -0
- package/skills/evm-dapp-integration/SKILL.md +73 -0
- package/skills/evm-dapp-integration/evals/triggers.json +16 -0
- package/skills/fastapi-patterns/SKILL.md +127 -0
- package/skills/fastapi-patterns/evals/triggers.json +16 -0
- package/skills/ffmpeg-media-processing/SKILL.md +94 -0
- package/skills/ffmpeg-media-processing/evals/triggers.json +16 -0
- package/skills/ffmpeg-media-processing/references/recipes.md +112 -0
- package/skills/fhir-integration/SKILL.md +81 -0
- package/skills/fhir-integration/evals/triggers.json +16 -0
- package/skills/fhir-integration/references/search-and-bundles.md +73 -0
- package/skills/fhir-integration/references/smart-on-fhir.md +50 -0
- package/skills/finishing-a-branch/SKILL.md +127 -0
- package/skills/finishing-a-branch/evals/behavior.json +49 -0
- package/skills/finishing-a-branch/evals/triggers.json +16 -0
- package/skills/flask-patterns/SKILL.md +132 -0
- package/skills/flask-patterns/evals/triggers.json +16 -0
- package/skills/flutter-patterns/SKILL.md +99 -0
- package/skills/flutter-patterns/evals/triggers.json +16 -0
- package/skills/flutterwave-integration/SKILL.md +75 -0
- package/skills/flutterwave-integration/evals/triggers.json +16 -0
- package/skills/flutterwave-integration/references/api.md +73 -0
- package/skills/flutterwave-integration/references/webhooks.md +49 -0
- package/skills/freight-carrier-management/SKILL.md +107 -0
- package/skills/freight-carrier-management/evals/triggers.json +16 -0
- package/skills/fsharp-patterns/SKILL.md +133 -0
- package/skills/fsharp-patterns/evals/triggers.json +16 -0
- package/skills/fsharp-testing/SKILL.md +136 -0
- package/skills/fsharp-testing/evals/triggers.json +16 -0
- package/skills/gcp-patterns/SKILL.md +86 -0
- package/skills/gcp-patterns/evals/triggers.json +16 -0
- package/skills/git-workflow/SKILL.md +114 -0
- package/skills/git-workflow/evals/triggers.json +16 -0
- package/skills/git-worktrees/SKILL.md +130 -0
- package/skills/git-worktrees/evals/behavior.json +56 -0
- package/skills/git-worktrees/evals/triggers.json +16 -0
- package/skills/github-actions-ci/SKILL.md +117 -0
- package/skills/github-actions-ci/evals/triggers.json +16 -0
- package/skills/github-api-automation/SKILL.md +101 -0
- package/skills/github-api-automation/evals/triggers.json +17 -0
- package/skills/go-patterns/SKILL.md +118 -0
- package/skills/go-patterns/evals/triggers.json +17 -0
- package/skills/go-patterns/references/concurrency.md +162 -0
- package/skills/go-testing/SKILL.md +154 -0
- package/skills/go-testing/evals/triggers.json +17 -0
- package/skills/google-workspace-integration/SKILL.md +65 -0
- package/skills/google-workspace-integration/evals/triggers.json +17 -0
- package/skills/google-workspace-integration/references/api.md +121 -0
- package/skills/harmonyos-arkts/SKILL.md +117 -0
- package/skills/harmonyos-arkts/evals/triggers.json +16 -0
- package/skills/harmonyos-arkts/references/build-errors.md +42 -0
- package/skills/hexagonal-architecture/SKILL.md +89 -0
- package/skills/hexagonal-architecture/evals/triggers.json +17 -0
- package/skills/hipaa-compliance/SKILL.md +91 -0
- package/skills/hipaa-compliance/evals/triggers.json +18 -0
- package/skills/hipaa-compliance/references/safeguards.md +68 -0
- package/skills/hl7v2-integration/SKILL.md +69 -0
- package/skills/hl7v2-integration/evals/triggers.json +16 -0
- package/skills/hl7v2-integration/references/messages-and-ack.md +78 -0
- package/skills/homelab-network-setup/SKILL.md +125 -0
- package/skills/homelab-network-setup/evals/triggers.json +18 -0
- package/skills/homelab-network-setup/references/firewall-and-dns.md +45 -0
- package/skills/homelab-network-setup/references/wireguard.md +72 -0
- package/skills/hubtel-integration/SKILL.md +77 -0
- package/skills/hubtel-integration/evals/triggers.json +16 -0
- package/skills/hubtel-integration/references/api.md +92 -0
- package/skills/i18n-localization/SKILL.md +114 -0
- package/skills/i18n-localization/evals/triggers.json +16 -0
- package/skills/i18n-localization/references/libraries.md +52 -0
- package/skills/implementation-plans/SKILL.md +117 -0
- package/skills/implementation-plans/evals/behavior.json +54 -0
- package/skills/implementation-plans/evals/triggers.json +16 -0
- package/skills/incident-postmortem/SKILL.md +118 -0
- package/skills/incident-postmortem/evals/triggers.json +14 -0
- package/skills/inventory-demand-planning/SKILL.md +89 -0
- package/skills/inventory-demand-planning/evals/triggers.json +16 -0
- package/skills/inventory-demand-planning/references/formulas.md +62 -0
- package/skills/investor-materials/SKILL.md +127 -0
- package/skills/investor-materials/evals/triggers.json +16 -0
- package/skills/investor-materials/references/templates.md +74 -0
- package/skills/invoicing-and-tax/SKILL.md +84 -0
- package/skills/invoicing-and-tax/evals/triggers.json +17 -0
- package/skills/invoicing-and-tax/references/e-invoicing.md +24 -0
- package/skills/invoicing-and-tax/references/invoice-fields.md +38 -0
- package/skills/invoicing-and-tax/references/rounding.md +26 -0
- package/skills/ios-platform-features/SKILL.md +99 -0
- package/skills/ios-platform-features/evals/triggers.json +16 -0
- package/skills/ios-platform-features/references/foundation-models.md +90 -0
- package/skills/java-patterns/SKILL.md +141 -0
- package/skills/java-patterns/evals/triggers.json +17 -0
- package/skills/java-testing/SKILL.md +142 -0
- package/skills/java-testing/evals/triggers.json +16 -0
- package/skills/jetpack-compose-patterns/SKILL.md +88 -0
- package/skills/jetpack-compose-patterns/evals/triggers.json +16 -0
- package/skills/jira-integration/SKILL.md +92 -0
- package/skills/jira-integration/evals/triggers.json +17 -0
- package/skills/jpa-hibernate/SKILL.md +92 -0
- package/skills/jpa-hibernate/evals/triggers.json +18 -0
- package/skills/jpa-hibernate/references/mapping.md +99 -0
- package/skills/jvm-sql-mappers/SKILL.md +98 -0
- package/skills/jvm-sql-mappers/evals/triggers.json +16 -0
- package/skills/jvm-sql-mappers/references/examples.md +129 -0
- package/skills/kotlin-multiplatform/SKILL.md +97 -0
- package/skills/kotlin-multiplatform/evals/triggers.json +16 -0
- package/skills/kotlin-patterns/SKILL.md +128 -0
- package/skills/kotlin-patterns/evals/triggers.json +16 -0
- package/skills/kotlin-testing/SKILL.md +117 -0
- package/skills/kotlin-testing/evals/triggers.json +16 -0
- package/skills/ktor-patterns/SKILL.md +135 -0
- package/skills/ktor-patterns/evals/triggers.json +18 -0
- package/skills/kubernetes-patterns/SKILL.md +106 -0
- package/skills/kubernetes-patterns/evals/triggers.json +16 -0
- package/skills/kubernetes-patterns/references/manifests.md +115 -0
- package/skills/laravel-patterns/SKILL.md +136 -0
- package/skills/laravel-patterns/evals/triggers.json +16 -0
- package/skills/linear-integration/SKILL.md +98 -0
- package/skills/linear-integration/evals/triggers.json +17 -0
- package/skills/literature-review/SKILL.md +109 -0
- package/skills/literature-review/evals/triggers.json +16 -0
- package/skills/literature-review/references/appraisal.md +41 -0
- package/skills/literature-review/references/search-sources.md +39 -0
- package/skills/llm-app-patterns/SKILL.md +97 -0
- package/skills/llm-app-patterns/evals/triggers.json +17 -0
- package/skills/llm-evals/SKILL.md +98 -0
- package/skills/llm-evals/evals/triggers.json +16 -0
- package/skills/llm-evals/references/graders.md +66 -0
- package/skills/logistics-exception-management/SKILL.md +90 -0
- package/skills/logistics-exception-management/evals/triggers.json +16 -0
- package/skills/manim-animations/SKILL.md +106 -0
- package/skills/manim-animations/evals/triggers.json +16 -0
- package/skills/market-research/SKILL.md +117 -0
- package/skills/market-research/evals/triggers.json +16 -0
- package/skills/marketing-campaign/SKILL.md +111 -0
- package/skills/marketing-campaign/evals/triggers.json +16 -0
- package/skills/mcp-server-patterns/SKILL.md +127 -0
- package/skills/mcp-server-patterns/evals/triggers.json +18 -0
- package/skills/mcp-server-patterns/references/protocol-notes.md +68 -0
- package/skills/metrics-dashboards/SKILL.md +113 -0
- package/skills/metrics-dashboards/evals/triggers.json +16 -0
- package/skills/ml-experiment-workflow/SKILL.md +125 -0
- package/skills/ml-experiment-workflow/evals/triggers.json +16 -0
- package/skills/mobile-accessibility/SKILL.md +94 -0
- package/skills/mobile-accessibility/evals/triggers.json +16 -0
- package/skills/mongodb-patterns/SKILL.md +115 -0
- package/skills/mongodb-patterns/evals/triggers.json +18 -0
- package/skills/mongodb-patterns/references/indexes-and-aggregation.md +94 -0
- package/skills/mpesa-daraja-integration/SKILL.md +70 -0
- package/skills/mpesa-daraja-integration/evals/triggers.json +16 -0
- package/skills/mpesa-daraja-integration/references/api.md +103 -0
- package/skills/mpesa-daraja-integration/references/callbacks.md +74 -0
- package/skills/mtn-momo-integration/SKILL.md +66 -0
- package/skills/mtn-momo-integration/evals/triggers.json +16 -0
- package/skills/mtn-momo-integration/references/api.md +153 -0
- package/skills/mtn-momo-integration/references/callbacks.md +92 -0
- package/skills/mtn-momo-integration/references/sandbox-and-go-live.md +51 -0
- package/skills/mtn-momo-integration/scripts/sandbox-setup.js +79 -0
- package/skills/mysql-patterns/SKILL.md +96 -0
- package/skills/mysql-patterns/evals/triggers.json +16 -0
- package/skills/mysql-patterns/references/explain.md +34 -0
- package/skills/mysql-patterns/references/online-ddl.md +41 -0
- package/skills/nestjs-patterns/SKILL.md +114 -0
- package/skills/nestjs-patterns/evals/triggers.json +16 -0
- package/skills/nestjs-patterns/references/testing.md +68 -0
- package/skills/network-automation/SKILL.md +107 -0
- package/skills/network-automation/evals/triggers.json +18 -0
- package/skills/network-automation/references/tool-snippets.md +153 -0
- package/skills/network-design/SKILL.md +98 -0
- package/skills/network-design/evals/triggers.json +16 -0
- package/skills/network-troubleshooting/SKILL.md +152 -0
- package/skills/network-troubleshooting/evals/triggers.json +18 -0
- package/skills/network-troubleshooting/references/commands.md +33 -0
- package/skills/nextjs-patterns/SKILL.md +150 -0
- package/skills/nextjs-patterns/evals/triggers.json +18 -0
- package/skills/nextjs-patterns/references/caching.md +87 -0
- package/skills/node-backend-patterns/SKILL.md +103 -0
- package/skills/node-backend-patterns/evals/triggers.json +16 -0
- package/skills/node-backend-patterns/references/templates.md +122 -0
- package/skills/nuxt-patterns/SKILL.md +103 -0
- package/skills/nuxt-patterns/evals/triggers.json +16 -0
- package/skills/observability/SKILL.md +125 -0
- package/skills/observability/evals/triggers.json +17 -0
- package/skills/observability/references/otel-setup.md +87 -0
- package/skills/observability/references/slo-alerts.md +70 -0
- package/skills/open-source-release/SKILL.md +107 -0
- package/skills/open-source-release/evals/triggers.json +15 -0
- package/skills/open-source-release/references/history-scrub.md +65 -0
- package/skills/parallel-agent-orchestration/SKILL.md +106 -0
- package/skills/parallel-agent-orchestration/evals/triggers.json +14 -0
- package/skills/patent-research/SKILL.md +94 -0
- package/skills/patent-research/evals/triggers.json +16 -0
- package/skills/patent-research/references/databases-and-queries.md +52 -0
- package/skills/paystack-integration/SKILL.md +59 -0
- package/skills/paystack-integration/evals/triggers.json +14 -0
- package/skills/paystack-integration/references/api.md +73 -0
- package/skills/paystack-integration/references/mobile-money.md +50 -0
- package/skills/paystack-integration/references/webhooks.md +80 -0
- package/skills/pci-dss-scope/SKILL.md +103 -0
- package/skills/pci-dss-scope/evals/triggers.json +18 -0
- package/skills/pci-dss-scope/references/saq-and-data.md +36 -0
- package/skills/perl-patterns/SKILL.md +135 -0
- package/skills/perl-patterns/evals/triggers.json +18 -0
- package/skills/perl-testing/SKILL.md +126 -0
- package/skills/perl-testing/evals/triggers.json +17 -0
- package/skills/php-patterns/SKILL.md +116 -0
- package/skills/php-patterns/evals/triggers.json +16 -0
- package/skills/php-testing/SKILL.md +123 -0
- package/skills/php-testing/evals/triggers.json +16 -0
- package/skills/postgres-patterns/SKILL.md +103 -0
- package/skills/postgres-patterns/evals/triggers.json +17 -0
- package/skills/postgres-patterns/references/explain.md +59 -0
- package/skills/postgres-patterns/references/locks.md +53 -0
- package/skills/prd-writing/SKILL.md +124 -0
- package/skills/prd-writing/evals/triggers.json +15 -0
- package/skills/prisma-patterns/SKILL.md +83 -0
- package/skills/prisma-patterns/evals/triggers.json +18 -0
- package/skills/prisma-patterns/references/prisma-8.md +46 -0
- package/skills/prisma-patterns/references/workflow.md +50 -0
- package/skills/privacy-compliance/SKILL.md +121 -0
- package/skills/privacy-compliance/evals/triggers.json +18 -0
- package/skills/privacy-compliance/references/jurisdictions.md +51 -0
- package/skills/production-scheduling/SKILL.md +98 -0
- package/skills/production-scheduling/evals/triggers.json +16 -0
- package/skills/prompt-engineering/SKILL.md +92 -0
- package/skills/prompt-engineering/evals/triggers.json +16 -0
- package/skills/prospect-research/SKILL.md +87 -0
- package/skills/prospect-research/evals/triggers.json +16 -0
- package/skills/python-app-distribution/SKILL.md +107 -0
- package/skills/python-app-distribution/evals/triggers.json +16 -0
- package/skills/python-app-distribution/references/pypi-trusted-publishing.md +55 -0
- package/skills/python-app-distribution/references/windows-macos-signing.md +70 -0
- package/skills/python-patterns/SKILL.md +107 -0
- package/skills/python-patterns/evals/triggers.json +16 -0
- package/skills/python-patterns/references/tooling.md +101 -0
- package/skills/python-testing/SKILL.md +126 -0
- package/skills/python-testing/evals/triggers.json +16 -0
- package/skills/python-testing/references/mocking.md +71 -0
- package/skills/pytorch-patterns/SKILL.md +139 -0
- package/skills/pytorch-patterns/evals/triggers.json +16 -0
- package/skills/pytorch-patterns/references/debugging.md +39 -0
- package/skills/quality-nonconformance/SKILL.md +107 -0
- package/skills/quality-nonconformance/evals/triggers.json +16 -0
- package/skills/quality-nonconformance/references/8d-and-capa.md +46 -0
- package/skills/quarkus-patterns/SKILL.md +93 -0
- package/skills/quarkus-patterns/evals/triggers.json +18 -0
- package/skills/rag-pipeline-patterns/SKILL.md +117 -0
- package/skills/rag-pipeline-patterns/evals/triggers.json +18 -0
- package/skills/rag-pipeline-patterns/references/evaluation.md +37 -0
- package/skills/rag-pipeline-patterns/references/retrieval-recipes.md +78 -0
- package/skills/rails-patterns/SKILL.md +132 -0
- package/skills/rails-patterns/evals/triggers.json +16 -0
- package/skills/react-native-patterns/SKILL.md +101 -0
- package/skills/react-native-patterns/evals/triggers.json +16 -0
- package/skills/react-patterns/SKILL.md +140 -0
- package/skills/react-patterns/evals/triggers.json +18 -0
- package/skills/react-performance/SKILL.md +107 -0
- package/skills/react-performance/evals/triggers.json +18 -0
- package/skills/react-testing/SKILL.md +121 -0
- package/skills/react-testing/evals/triggers.json +18 -0
- package/skills/react-testing/references/msw.md +64 -0
- package/skills/react-testing/references/queries.md +41 -0
- package/skills/react-testing/references/setup.md +74 -0
- package/skills/recommender-systems/SKILL.md +119 -0
- package/skills/recommender-systems/evals/triggers.json +16 -0
- package/skills/recommender-systems/references/evaluation.md +39 -0
- package/skills/redis-patterns/SKILL.md +109 -0
- package/skills/redis-patterns/evals/triggers.json +18 -0
- package/skills/redis-patterns/references/operations.md +61 -0
- package/skills/refactoring-safely/SKILL.md +107 -0
- package/skills/refactoring-safely/evals/behavior.json +57 -0
- package/skills/refactoring-safely/evals/triggers.json +17 -0
- package/skills/release-management/SKILL.md +141 -0
- package/skills/release-management/evals/triggers.json +16 -0
- package/skills/remotion-video/SKILL.md +91 -0
- package/skills/remotion-video/evals/triggers.json +16 -0
- package/skills/remotion-video/references/lambda.md +66 -0
- package/skills/reproducible-dev-environments/SKILL.md +132 -0
- package/skills/reproducible-dev-environments/evals/triggers.json +16 -0
- package/skills/responding-to-code-review/SKILL.md +124 -0
- package/skills/responding-to-code-review/evals/behavior.json +54 -0
- package/skills/responding-to-code-review/evals/triggers.json +16 -0
- package/skills/returns-reverse-logistics/SKILL.md +97 -0
- package/skills/returns-reverse-logistics/evals/triggers.json +16 -0
- package/skills/ruby-patterns/SKILL.md +127 -0
- package/skills/ruby-patterns/evals/triggers.json +18 -0
- package/skills/ruby-testing/SKILL.md +113 -0
- package/skills/ruby-testing/evals/triggers.json +18 -0
- package/skills/runbook-writing/SKILL.md +101 -0
- package/skills/runbook-writing/evals/triggers.json +14 -0
- package/skills/rust-patterns/SKILL.md +118 -0
- package/skills/rust-patterns/evals/triggers.json +16 -0
- package/skills/rust-patterns/references/cargo-and-clippy.md +105 -0
- package/skills/rust-patterns/references/errors-and-traits.md +97 -0
- package/skills/rust-testing/SKILL.md +148 -0
- package/skills/rust-testing/evals/triggers.json +16 -0
- package/skills/rust-testing/references/fakes-proptest-async.md +113 -0
- package/skills/search-first/SKILL.md +73 -0
- package/skills/search-first/evals/triggers.json +14 -0
- package/skills/security-review/SKILL.md +58 -0
- package/skills/security-review/evals/behavior.json +56 -0
- package/skills/security-review/evals/triggers.json +14 -0
- package/skills/security-review/references/checklist.md +54 -0
- package/skills/security-review/scripts/scan-secrets.js +79 -0
- package/skills/seo-audit/SKILL.md +111 -0
- package/skills/seo-audit/evals/triggers.json +16 -0
- package/skills/seo-audit/references/checks.md +65 -0
- package/skills/session-handoff/SKILL.md +101 -0
- package/skills/session-handoff/evals/behavior.json +55 -0
- package/skills/session-handoff/evals/triggers.json +14 -0
- package/skills/skill-authoring/SKILL.md +98 -0
- package/skills/skill-authoring/evals/triggers.json +15 -0
- package/skills/skill-authoring/references/frontmatter.md +40 -0
- package/skills/skill-authoring/references/pressure-testing.md +87 -0
- package/skills/slack-app-integration/SKILL.md +108 -0
- package/skills/slack-app-integration/evals/triggers.json +17 -0
- package/skills/slide-decks/SKILL.md +107 -0
- package/skills/slide-decks/evals/triggers.json +18 -0
- package/skills/slide-decks/references/html-decks.md +86 -0
- package/skills/slide-decks/references/layouts.md +45 -0
- package/skills/slide-decks/references/pptx.md +87 -0
- package/skills/smart-contract-security/SKILL.md +110 -0
- package/skills/smart-contract-security/evals/triggers.json +16 -0
- package/skills/smart-contract-security/references/vulnerability-checklist.md +79 -0
- package/skills/social-media-publishing/SKILL.md +84 -0
- package/skills/social-media-publishing/evals/triggers.json +17 -0
- package/skills/social-media-publishing/references/platform-apis.md +116 -0
- package/skills/solidity-patterns/SKILL.md +95 -0
- package/skills/solidity-patterns/evals/triggers.json +16 -0
- package/skills/spring-boot-patterns/SKILL.md +128 -0
- package/skills/spring-boot-patterns/evals/triggers.json +18 -0
- package/skills/spring-boot-patterns/references/testing.md +72 -0
- package/skills/stripe-integration/SKILL.md +69 -0
- package/skills/stripe-integration/evals/triggers.json +16 -0
- package/skills/stripe-integration/references/api.md +71 -0
- package/skills/stripe-integration/references/billing.md +58 -0
- package/skills/stripe-integration/references/webhooks.md +76 -0
- package/skills/subagent-driven-development/SKILL.md +109 -0
- package/skills/subagent-driven-development/evals/behavior.json +53 -0
- package/skills/subagent-driven-development/evals/triggers.json +15 -0
- package/skills/subagent-driven-development/references/implementer-brief.md +60 -0
- package/skills/subagent-driven-development/references/reviewer-briefs.md +52 -0
- package/skills/subscription-billing-ops/SKILL.md +118 -0
- package/skills/subscription-billing-ops/evals/triggers.json +17 -0
- package/skills/subscription-billing-ops/references/proration.md +47 -0
- package/skills/subscription-billing-ops/references/revenue-metrics.md +38 -0
- package/skills/svelte-patterns/SKILL.md +122 -0
- package/skills/svelte-patterns/evals/triggers.json +16 -0
- package/skills/swift-patterns/SKILL.md +113 -0
- package/skills/swift-patterns/evals/triggers.json +16 -0
- package/skills/swift-patterns/references/concurrency-migration.md +40 -0
- package/skills/swift-testing/SKILL.md +121 -0
- package/skills/swift-testing/evals/triggers.json +16 -0
- package/skills/swift-testing/references/swift-testing-cheatsheet.md +81 -0
- package/skills/swiftui-patterns/SKILL.md +102 -0
- package/skills/swiftui-patterns/evals/triggers.json +16 -0
- package/skills/systematic-debugging/SKILL.md +92 -0
- package/skills/systematic-debugging/evals/behavior.json +59 -0
- package/skills/systematic-debugging/evals/triggers.json +16 -0
- package/skills/systematic-debugging/references/condition-waiting.md +52 -0
- package/skills/systematic-debugging/references/root-cause-tracing.md +49 -0
- package/skills/systematic-debugging/references/test-pollution.md +46 -0
- package/skills/tdd-workflow/SKILL.md +69 -0
- package/skills/tdd-workflow/evals/behavior.json +55 -0
- package/skills/tdd-workflow/evals/triggers.json +15 -0
- package/skills/tdd-workflow/references/testing-anti-patterns.md +87 -0
- package/skills/technical-writing/SKILL.md +95 -0
- package/skills/technical-writing/evals/triggers.json +14 -0
- package/skills/terraform-patterns/SKILL.md +122 -0
- package/skills/terraform-patterns/evals/triggers.json +16 -0
- package/skills/terraform-patterns/references/backends.md +67 -0
- package/skills/test-coverage-improvement/SKILL.md +107 -0
- package/skills/test-coverage-improvement/evals/triggers.json +16 -0
- package/skills/threat-modeling/SKILL.md +113 -0
- package/skills/threat-modeling/evals/triggers.json +16 -0
- package/skills/transactional-email/SKILL.md +68 -0
- package/skills/transactional-email/evals/triggers.json +17 -0
- package/skills/transactional-email/references/providers.md +63 -0
- package/skills/typescript-patterns/SKILL.md +122 -0
- package/skills/typescript-patterns/evals/triggers.json +16 -0
- package/skills/typescript-testing/SKILL.md +101 -0
- package/skills/typescript-testing/evals/triggers.json +16 -0
- package/skills/ui-demo-recording/SKILL.md +93 -0
- package/skills/ui-demo-recording/evals/triggers.json +16 -0
- package/skills/ui-demo-recording/references/cursor-and-captions.md +48 -0
- package/skills/ui-demo-recording/references/playwright-recording.md +63 -0
- package/skills/ui-demo-recording/references/post-processing.md +57 -0
- package/skills/ui-design-polish/SKILL.md +113 -0
- package/skills/ui-design-polish/evals/triggers.json +18 -0
- package/skills/ui-design-polish/references/detail-checklist.md +45 -0
- package/skills/ui-design-polish/references/tokens.md +68 -0
- package/skills/ui-flow-audit/SKILL.md +112 -0
- package/skills/ui-flow-audit/evals/triggers.json +17 -0
- package/skills/ui-motion/SKILL.md +103 -0
- package/skills/ui-motion/evals/triggers.json +18 -0
- package/skills/ui-motion/references/patterns.md +138 -0
- package/skills/ui-motion/references/tokens.md +52 -0
- package/skills/unicode-text-processing/SKILL.md +103 -0
- package/skills/unicode-text-processing/evals/triggers.json +17 -0
- package/skills/unicode-text-processing/references/apis.md +89 -0
- package/skills/unicode-text-processing/references/script-notes.md +50 -0
- package/skills/verification-loop/SKILL.md +70 -0
- package/skills/verification-loop/evals/behavior.json +52 -0
- package/skills/verification-loop/evals/triggers.json +14 -0
- package/skills/verification-loop/scripts/detect-checks.js +102 -0
- package/skills/video-editing/SKILL.md +111 -0
- package/skills/video-editing/evals/triggers.json +16 -0
- package/skills/video-editing/references/edl-and-logging.md +44 -0
- package/skills/video-editing/references/ffmpeg-edit-recipes.md +92 -0
- package/skills/video-editing/references/resolve-scripting.md +53 -0
- package/skills/vite-patterns/SKILL.md +117 -0
- package/skills/vite-patterns/evals/triggers.json +16 -0
- package/skills/vue-patterns/SKILL.md +104 -0
- package/skills/vue-patterns/evals/triggers.json +16 -0
- package/skills/web-accessibility/SKILL.md +119 -0
- package/skills/web-accessibility/evals/triggers.json +16 -0
- package/skills/web-performance/SKILL.md +107 -0
- package/skills/web-performance/evals/triggers.json +16 -0
- package/skills/web-scraping/SKILL.md +80 -0
- package/skills/web-scraping/evals/triggers.json +16 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Platform API shapes
|
|
2
|
+
|
|
3
|
+
Request shapes for the common publish paths. Check each platform's docs for the current API version, access tier and limits before relying on these.
|
|
4
|
+
|
|
5
|
+
## X (docs.x.com)
|
|
6
|
+
|
|
7
|
+
Auth: OAuth 2.0 authorization code with PKCE, user-context token in `Authorization: Bearer`. `POST /2/tweets` accepts only user-context tokens (OAuth 2.0 user token with `tweet.read`, `users.read`, `tweet.write`, or OAuth 1.0a user token); app-only tokens cannot post. Without `offline.access` the token lasts two hours and no refresh token is issued.
|
|
8
|
+
|
|
9
|
+
Chunked media upload:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
POST https://api.x.com/2/media/upload/initialize
|
|
13
|
+
{ "media_type": "video/mp4", "total_bytes": 10485760, "media_category": "tweet_video" }
|
|
14
|
+
-> { "data": { "id": "<media_id>", ... } }
|
|
15
|
+
|
|
16
|
+
POST https://api.x.com/2/media/upload/<media_id>/append (multipart: segment_index, media)
|
|
17
|
+
POST https://api.x.com/2/media/upload/<media_id>/finalize
|
|
18
|
+
GET https://api.x.com/2/media/upload?command=STATUS&media_id=<media_id>
|
|
19
|
+
repeat after processing_info.check_after_secs until state is "succeeded"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- Do not send `command=INIT|APPEND|FINALIZE` to `POST /2/media/upload`; that is the previous protocol.
|
|
23
|
+
- Keep each chunk at or under 5 MB (the server maximum is 8 MB). `media_category` values include `tweet_image`, `tweet_gif`, `tweet_video`, `amplify_video`, `dm_image`, `dm_gif`, `dm_video`, `subtitles`. Status states are `pending`, `in_progress`, `succeeded`, `failed`. Size and duration limits depend on the user's account type.
|
|
24
|
+
|
|
25
|
+
Create the post:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
POST https://api.x.com/2/tweets
|
|
29
|
+
{ "text": "Shipping today", "media": { "media_ids": ["<media_id>"] } }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`media_ids` takes 1 to 4 IDs.
|
|
33
|
+
|
|
34
|
+
Threads: post the first, then each next post with `"reply": { "in_reply_to_tweet_id": "<previous id>" }`.
|
|
35
|
+
|
|
36
|
+
Access tiers and pricing change; confirm in the developer console which endpoints and volumes the user's plan includes.
|
|
37
|
+
|
|
38
|
+
## LinkedIn (learn.microsoft.com/linkedin)
|
|
39
|
+
|
|
40
|
+
Every versioned call sends `Linkedin-Version: YYYYMM` and `X-Restli-Protocol-Version: 2.0.0`. Versions are released monthly and supported for at least one year before sunset; a sunset or missing version returns an error, so keep the header current.
|
|
41
|
+
|
|
42
|
+
Image:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
POST https://api.linkedin.com/rest/images?action=initializeUpload
|
|
46
|
+
{ "initializeUploadRequest": { "owner": "urn:li:organization:123" } }
|
|
47
|
+
-> { "value": { "uploadUrl": "https://www.linkedin.com/dms-uploads/...", "image": "urn:li:image:C4E..." } }
|
|
48
|
+
|
|
49
|
+
PUT <uploadUrl> (raw bytes, Authorization header)
|
|
50
|
+
GET https://api.linkedin.com/rest/images/urn:li:image:C4E... until status is AVAILABLE
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Video: `POST /rest/videos?action=initializeUpload` with `owner` and `fileSizeBytes` returns `uploadInstructions` (one upload URL per 4 MB byte range) and an `uploadToken`. PUT each part and keep the `ETag` response header, then `POST /rest/videos?action=finalizeUpload` with `video`, `uploadToken` and `uploadedPartIds` (the ETags, in part order). Poll `GET /rest/videos/{urn}` until status is `AVAILABLE`.
|
|
54
|
+
|
|
55
|
+
Post:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
POST https://api.linkedin.com/rest/posts
|
|
59
|
+
{
|
|
60
|
+
"author": "urn:li:organization:123",
|
|
61
|
+
"commentary": "Text of the post",
|
|
62
|
+
"visibility": "PUBLIC",
|
|
63
|
+
"distribution": { "feedDistribution": "MAIN_FEED", "targetEntities": [], "thirdPartyDistributionChannels": [] },
|
|
64
|
+
"content": { "media": { "id": "urn:li:image:C4E...", "altText": "Describe the image" } },
|
|
65
|
+
"lifecycleState": "PUBLISHED",
|
|
66
|
+
"isReshareDisabledByAuthor": false
|
|
67
|
+
}
|
|
68
|
+
-> 201, post URN in the x-restli-id response header
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- Member posts: `w_member_social`, author `urn:li:person:<sub from /v2/userinfo>`.
|
|
72
|
+
- Company posts: `w_organization_social`, and the member must hold the ADMINISTRATOR, CONTENT_ADMIN or DIRECT_SPONSORED_CONTENT_POSTER role on the page.
|
|
73
|
+
- LinkedIn Help gives 3,000 characters as the post limit; the API returns `FIELD_LENGTH_TOO_LONG` when `commentary` is over its maximum. `commentary` uses LinkedIn's "little text" format: escape the reserved characters `| { } @ [ ] ( ) < > # \ * _ ~` with a backslash whenever they are plain text rather than mention or hashtag syntax. Mentions are `@[Name](urn:li:organization:123)`; the name must match the entity's name.
|
|
74
|
+
- `ugcPosts` is legacy (the Posts API replaces it); use `/rest/posts`.
|
|
75
|
+
|
|
76
|
+
## Facebook Page (developers.facebook.com, Graph API)
|
|
77
|
+
|
|
78
|
+
Use a Page access token for a Page the user manages. Facebook Login requests `pages_manage_engagement`, `pages_manage_posts`, `pages_read_engagement` and `pages_read_user_engagement`, plus `publish_video` for video.
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
POST https://graph.facebook.com/<version>/<page-id>/feed
|
|
82
|
+
message=...&link=https://...
|
|
83
|
+
POST https://graph.facebook.com/<version>/<page-id>/photos
|
|
84
|
+
url=https://.../image.jpg&caption=...
|
|
85
|
+
Scheduled: add published=false&scheduled_publish_time=<unix time> (10 minutes to 30 days from the request)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Pin a Graph API version in the URL (`v<major>.0`) and upgrade before Meta retires it.
|
|
89
|
+
|
|
90
|
+
## Instagram professional account
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
POST https://graph.facebook.com/<version>/<ig-user-id>/media (Facebook Login)
|
|
94
|
+
POST https://graph.instagram.com/<version>/<ig-user-id>/media (Instagram Login)
|
|
95
|
+
image_url=https://public.example.com/a.jpg&caption=...
|
|
96
|
+
or media_type=REELS&video_url=...
|
|
97
|
+
or media_type=CAROUSEL with children=<up to 10 container ids>
|
|
98
|
+
-> { "id": "<container id>" }
|
|
99
|
+
|
|
100
|
+
GET .../<container id>?fields=status_code IN_PROGRESS -> FINISHED (or ERROR; EXPIRED if not published within 24 hours)
|
|
101
|
+
POST .../<ig-user-id>/media_publish creation_id=<container id>
|
|
102
|
+
GET .../<ig-user-id>/content_publishing_limit current usage against the 24-hour cap
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- Media must be at a publicly reachable HTTPS URL; Meta fetches it.
|
|
106
|
+
- There is a rolling 24-hour cap on API-published posts per account (carousels count as one). Meta's pages have stated different numbers over time; read `content_publishing_limit` instead of hard-coding it.
|
|
107
|
+
- The API requires an Instagram professional (business or creator) account; personal accounts are not supported.
|
|
108
|
+
- Captions: at most 2,200 characters, 30 hashtags and 20 @ tags.
|
|
109
|
+
- Permissions: `instagram_business_basic` and `instagram_business_content_publish` (Instagram Login, `graph.instagram.com`), or `instagram_basic`, `instagram_content_publish` and `pages_read_engagement` (Facebook Login, `graph.facebook.com`).
|
|
110
|
+
|
|
111
|
+
## Sources
|
|
112
|
+
|
|
113
|
+
- X chunked upload: https://docs.x.com/x-api/media/quickstart/media-upload-chunked . Create post: https://docs.x.com/x-api/posts/create-post . Scopes: https://docs.x.com/fundamentals/authentication/oauth-2-0/authorization-code . Character counting: https://docs.x.com/fundamentals/counting-characters
|
|
114
|
+
- LinkedIn Posts API: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/posts-api . little text: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/little-text-format . Videos: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/videos-api . Versioning: https://learn.microsoft.com/en-us/linkedin/marketing/versioning . Post length: https://www.linkedin.com/help/linkedin/answer/a528176
|
|
115
|
+
- Facebook Pages posts: https://developers.facebook.com/docs/pages-api/posts
|
|
116
|
+
- Instagram publishing: https://developers.facebook.com/docs/instagram-platform/content-publishing . Media reference (caption limits): https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-user/media
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: solidity-patterns
|
|
3
|
+
description: Writes Solidity contracts for Ethereum and other EVM chains the safe way, applying checks-effects-interactions ordering, Ownable2Step or AccessControl roles, OpenZeppelin Contracts instead of hand-rolled tokens, a deliberate choice between immutable and UUPS or transparent proxy deployments with ERC-7201 namespaced storage, events for every state change, custom errors and basic gas hygiene, inside a Foundry or Hardhat project with tests. Use when creating or extending a smart contract, adding an ERC-20, ERC-721 or ERC-1155 token, deciding whether a contract should be upgradeable, or setting up a new Foundry or Hardhat workspace.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Any Agent Skills host. Needs Foundry (forge) or Hardhat with Node.js to compile and test. Examples target Solidity 0.8.x and OpenZeppelin Contracts 5.x.
|
|
6
|
+
metadata:
|
|
7
|
+
kete-loom/version: "0.1.0"
|
|
8
|
+
kete-loom/category: security
|
|
9
|
+
kete-loom/risk: runs-commands
|
|
10
|
+
kete-loom/requires: "forge"
|
|
11
|
+
kete-loom/owner: "Kete-org"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Solidity patterns
|
|
15
|
+
|
|
16
|
+
Write contracts that are boring on purpose: audited building blocks, state updated before any external call, every privileged function guarded, every change logged by an event, and tests that try to break it. Deployed code is public and usually permanent, so a bug is a loss, not a ticket. This is engineering guidance, not financial or legal advice.
|
|
17
|
+
|
|
18
|
+
## Ground rules
|
|
19
|
+
|
|
20
|
+
1. **Pin the compiler.** `pragma solidity 0.8.x;` with an exact version in `foundry.toml` (`solc_version`) or `hardhat.config` (`solidity.version`). 0.8 reverts on overflow by default; `unchecked { }` only where you proved the bound in a comment.
|
|
21
|
+
2. **Use OpenZeppelin Contracts** (`@openzeppelin/contracts`, or `@openzeppelin/contracts-upgradeable` for proxies) for tokens, access control, `ReentrancyGuard`, `SafeERC20`, `ECDSA`, `EIP712`. Never copy-paste or re-implement an ERC standard. Pin the library version.
|
|
22
|
+
3. **Checks-effects-interactions.** Validate inputs (checks), write storage (effects), then call other contracts or send ETH (interactions). Add `nonReentrant` on functions that make external calls and touch balances anyway.
|
|
23
|
+
4. **Guard every privileged function** (`mint`, `pause`, `setFee`, `withdraw`, `upgradeTo...`, initializers). Default to `Ownable2Step` for a single admin or `AccessControl` for several roles; the owner should be a multisig or timelock in production, not a laptop key.
|
|
24
|
+
5. **Events for every state change** an off-chain system or user cares about: transfers, role grants, parameter changes, upgrades, pauses. Index the fields people filter on (addresses, IDs), at most three indexed.
|
|
25
|
+
6. **Custom errors** (`error InsufficientBalance(uint256 have, uint256 want);` with `revert InsufficientBalance(...)`) instead of revert strings.
|
|
26
|
+
7. **Pull over push** for payouts: record what each address is owed and let it `withdraw()`; never loop over an unbounded array sending ETH.
|
|
27
|
+
8. **No `tx.origin` for auth**, no `block.timestamp` or `blockhash` as randomness, no `selfdestruct`, no `delegatecall` to an address a user can influence.
|
|
28
|
+
|
|
29
|
+
## Project layout
|
|
30
|
+
|
|
31
|
+
Foundry (preferred for new work): `forge init`, then
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
src/ contracts
|
|
35
|
+
test/ *.t.sol tests (forge-std Test), fuzz and invariant tests
|
|
36
|
+
script/ *.s.sol deploy scripts (forge script)
|
|
37
|
+
lib/ dependencies (forge install OpenZeppelin/openzeppelin-contracts)
|
|
38
|
+
foundry.toml solc_version, optimizer, remappings, [fuzz] runs
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Hardhat: `contracts/`, `test/`, `ignition/modules/` or `scripts/`, `hardhat.config.ts`, dependencies from npm. Follow whichever the repo already uses; don't mix both without reason.
|
|
42
|
+
|
|
43
|
+
Keys and RPC URLs come from environment variables or an encrypted keystore (`cast wallet import`), never from committed files.
|
|
44
|
+
|
|
45
|
+
## Steps for a new or changed contract
|
|
46
|
+
|
|
47
|
+
1. **Write the spec first** in the contract's NatSpec: who can call each external function, what invariants must hold (for example "sum of balances == totalSupply", "only owner can mint"), and what happens on failure.
|
|
48
|
+
2. **Pick the building block.** Token: inherit `ERC20`, `ERC721` or `ERC1155` and add only what's needed (`ERC20Permit`, `ERC20Votes`, `Pausable`). Do not override `transfer` or `_update` hooks unless the spec needs it, and then call `super`.
|
|
49
|
+
3. **Decide on upgradeability** using the table below. Write the answer and the reason at the top of the contract.
|
|
50
|
+
4. **Write the contract** following the ground rules. Mark functions `external` when not called internally, state `immutable` or `constant` where possible, and visibility on everything.
|
|
51
|
+
5. **Handle tokens defensively.** Use `SafeERC20` (`safeTransfer`, `safeTransferFrom`, `forceApprove`) for arbitrary ERC-20s. For deposits, measure the balance before and after if fee-on-transfer tokens are possible, or document that they're unsupported.
|
|
52
|
+
6. **Test**: unit tests for each function and each revert, a test per access-controlled function proving a stranger is rejected, fuzz tests on amount inputs, and invariant tests for the spec's invariants (`forge test`, `[invariant]` in `foundry.toml`). Fork tests (`--fork-url`) when integrating live protocols.
|
|
53
|
+
7. **Static analysis**: run `slither .` and fix or justify every finding. For the full audit procedure use the `smart-contract-security` skill.
|
|
54
|
+
8. **Deploy** to a local node (`anvil`) and a testnet first with the same script you'll use on mainnet; verify the source on the block explorer.
|
|
55
|
+
|
|
56
|
+
## Upgradeability: decide deliberately
|
|
57
|
+
|
|
58
|
+
| Option | Choose when | Costs |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| Immutable contract | Logic is small, well tested, and trust minimisation matters | Bugs need a migration to a new address |
|
|
61
|
+
| UUPS proxy (`UUPSUpgradeable`) | You need upgrades and want them cheap; upgrade logic lives in the implementation | Forgetting `_authorizeUpgrade` access control, or shipping an implementation without it, can brick or hand over the proxy |
|
|
62
|
+
| Transparent proxy (`TransparentUpgradeableProxy`) | You want the admin path separated from user calls | Extra deploy cost; in OZ 5.x the proxy deploys its own `ProxyAdmin` owned by `initialOwner` |
|
|
63
|
+
|
|
64
|
+
Rules for any proxy:
|
|
65
|
+
|
|
66
|
+
- No constructor logic; use an `initialize` function with the `initializer` modifier, call every parent `__X_init`, and call `_disableInitializers()` in the implementation's constructor.
|
|
67
|
+
- Use ERC-7201 namespaced storage (the OZ 5.x upgradeable contracts do) or append-only layouts; never reorder, remove or change the type of an existing state variable.
|
|
68
|
+
- Check every upgrade with the OpenZeppelin Upgrades plugin (`@openzeppelin/hardhat-upgrades` or `openzeppelin-foundry-upgrades`) before deploying it.
|
|
69
|
+
- Put upgrades behind a multisig and, where users hold funds, a timelock so they can exit.
|
|
70
|
+
|
|
71
|
+
## Gas basics (after correctness)
|
|
72
|
+
|
|
73
|
+
- Cache storage reads in memory inside loops; pack small types that are read together into one slot.
|
|
74
|
+
- `calldata` instead of `memory` for read-only external array and struct arguments.
|
|
75
|
+
- `immutable`/`constant` for values fixed at deploy.
|
|
76
|
+
- Avoid unbounded loops over user-growable arrays; they become a denial of service once gas exceeds the block limit.
|
|
77
|
+
- Measure with `forge test --gas-report` or `forge snapshot` before and after; never trade a safety check for gas.
|
|
78
|
+
|
|
79
|
+
## Stop and ask the user
|
|
80
|
+
|
|
81
|
+
- Before deploying or broadcasting anything to a mainnet, or to any network with real funds; confirm the network, chain ID and deployer address.
|
|
82
|
+
- Who should own admin roles in production (EOA, multisig, timelock, or renounced).
|
|
83
|
+
- Whether the contract should be upgradeable at all, when the spec doesn't say.
|
|
84
|
+
- Before writing token economics, fees or anything that holds user funds and will launch without a professional audit; recommend one.
|
|
85
|
+
|
|
86
|
+
## Never
|
|
87
|
+
|
|
88
|
+
- Never put private keys, mnemonics or RPC keys in source, tests or scripts.
|
|
89
|
+
- Never write a custom ERC-20/721 from scratch, a custom signature scheme, or inline assembly to save gas without a written reason and tests.
|
|
90
|
+
- Never leave an initializer unprotected or an implementation contract uninitialized.
|
|
91
|
+
- Never claim a contract is secure; say what was tested and what wasn't.
|
|
92
|
+
|
|
93
|
+
## Before you finish
|
|
94
|
+
|
|
95
|
+
Report: compiler version, libraries and versions, upgradeability choice and why, roles and who holds them, events emitted, test and fuzz results (`forge test` output summary), Slither results, and what still needs an external audit.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"should_trigger": [
|
|
3
|
+
"Write an ERC-20 token contract with a capped supply and an owner-only mint using Foundry",
|
|
4
|
+
"Should our staking vault contract be upgradeable with UUPS or deployed immutable?",
|
|
5
|
+
"Set up a new Foundry project with OpenZeppelin and a basic NFT contract",
|
|
6
|
+
"Add a withdraw function to my Solidity escrow contract that follows checks-effects-interactions",
|
|
7
|
+
"Refactor this Solidity contract to use custom errors and emit events when the fee changes"
|
|
8
|
+
],
|
|
9
|
+
"should_not_trigger": [
|
|
10
|
+
"Audit our lending protocol contracts for oracle manipulation and reentrancy before launch",
|
|
11
|
+
"Connect MetaMask to our React app with viem and show the user's USDC balance",
|
|
12
|
+
"Review the Solidity diff in this PR for missing access control and storage collisions",
|
|
13
|
+
"Integrate Stripe subscriptions into the billing page",
|
|
14
|
+
"Write a Rust program that parses a CSV of transactions"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spring-boot-patterns
|
|
3
|
+
description: Spring Boot application structure and conventions, covering controller-service-repository layering, constructor injection, typed @ConfigurationProperties, @Transactional boundaries, Bean Validation, ProblemDetail error responses, SecurityFilterChain setup, Actuator exposure and focused test slices such as @WebMvcTest and @DataJpaTest. Use when building or changing a Spring Boot service, adding an endpoint or configuration, securing routes, wiring health checks, or writing Spring Boot tests.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Any Agent Skills host. Needs a JDK and the project's Maven or Gradle wrapper. Written for Spring Boot 3.x and 4.x; version-specific differences are called out.
|
|
6
|
+
metadata:
|
|
7
|
+
kete-loom/version: "0.1.0"
|
|
8
|
+
kete-loom/category: coding
|
|
9
|
+
kete-loom/risk: runs-commands
|
|
10
|
+
kete-loom/requires: "java"
|
|
11
|
+
kete-loom/owner: "Kete-org"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Spring Boot patterns
|
|
15
|
+
|
|
16
|
+
Write Spring Boot code that is easy to test, fails loudly on bad configuration, and keeps transactions and security explicit. For entity mapping, fetch plans and N+1 problems, use the `jpa-hibernate` skill alongside this one.
|
|
17
|
+
|
|
18
|
+
## 0. Before you change anything
|
|
19
|
+
|
|
20
|
+
1. Find the Boot version in `pom.xml` (`spring-boot-starter-parent`) or `build.gradle(.kts)` (`org.springframework.boot` plugin). Boot 3 and 4 differ in test setup and Jackson (see `references/testing.md`).
|
|
21
|
+
2. Find the build command: `./mvnw verify` or `./gradlew build`. Run it once and record the result. If it already fails, **stop and tell the user** before editing.
|
|
22
|
+
3. Read one existing controller, service and test, and follow their package layout, naming and style. Don't introduce a second style.
|
|
23
|
+
|
|
24
|
+
## 1. Structure
|
|
25
|
+
|
|
26
|
+
- Package **by feature** (`orders/`, `billing/`), not by layer, unless the project already does otherwise. Keep the `@SpringBootApplication` class in the root package so component scanning finds everything.
|
|
27
|
+
- Layers inside a feature:
|
|
28
|
+
- **Controller**: HTTP only. Parse, validate, call one service method, map to a response DTO. No repository calls, no business rules.
|
|
29
|
+
- **Service**: business rules and the transaction boundary.
|
|
30
|
+
- **Repository**: Spring Data interfaces. No business logic.
|
|
31
|
+
- Never return JPA entities from controllers. Map to records (`record OrderResponse(...)`) so lazy fields, internal columns and cycles never leak into JSON.
|
|
32
|
+
|
|
33
|
+
## 2. Dependency injection
|
|
34
|
+
|
|
35
|
+
- Use **constructor injection** with `final` fields. One constructor needs no `@Autowired`. Never use field injection in new code.
|
|
36
|
+
- Prefer one implementation per interface. When there are several, choose with `@Qualifier` or a `Map<String, T>` injection, not `@Primary` scattered around.
|
|
37
|
+
- A circular dependency is a design bug. Split the class; don't enable `spring.main.allow-circular-references`.
|
|
38
|
+
|
|
39
|
+
## 3. Configuration
|
|
40
|
+
|
|
41
|
+
- Bind related settings to a typed record and validate it at startup:
|
|
42
|
+
|
|
43
|
+
```java
|
|
44
|
+
@ConfigurationProperties(prefix = "payments")
|
|
45
|
+
@Validated
|
|
46
|
+
public record PaymentsProperties(@NotBlank String baseUrl, @NotNull Duration timeout) {}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Register it with `@ConfigurationPropertiesScan` (or `@EnableConfigurationProperties`). Prefer this over many `@Value` fields.
|
|
50
|
+
- Secrets come from environment variables or a secret store, never committed `application.yml`. Relaxed binding maps `PAYMENTS_BASEURL` to `payments.base-url`.
|
|
51
|
+
- Profiles (`application-dev.yml`, `spring.profiles.active`) change environment details, not behaviour. Never gate business logic on a profile name.
|
|
52
|
+
- Set `spring.jpa.open-in-view=false` in new services so lazy loading can't run during view rendering (Boot logs a warning while it is left on).
|
|
53
|
+
|
|
54
|
+
## 4. Transactions
|
|
55
|
+
|
|
56
|
+
- Put `@Transactional` on **public service methods**, not controllers or repositories. Use `@Transactional(readOnly = true)` for queries.
|
|
57
|
+
- The annotation works through a proxy, so it is **ignored** on a call from another method in the same class (self-invocation) and on private methods. Move the method to another bean if it needs its own transaction.
|
|
58
|
+
- By default only unchecked exceptions roll back. If a checked exception must roll back, set `rollbackFor`.
|
|
59
|
+
- Never call a slow remote API (payment provider, email) inside a database transaction. Commit first, then call out, or use an outbox table or `@TransactionalEventListener(phase = AFTER_COMMIT)`.
|
|
60
|
+
|
|
61
|
+
## 5. Validation and errors
|
|
62
|
+
|
|
63
|
+
- Annotate request DTOs with Jakarta Bean Validation (`@NotBlank`, `@Size`, `@Email`) and the controller parameter with `@Valid`. Needs `spring-boot-starter-validation`.
|
|
64
|
+
- Return RFC 9457 problem details. Set `spring.mvc.problemdetails.enabled=true` or add one `@RestControllerAdvice` (extending `ResponseEntityExceptionHandler`) that maps domain exceptions to `ProblemDetail` with the right status:
|
|
65
|
+
|
|
66
|
+
```java
|
|
67
|
+
@ExceptionHandler(OrderNotFoundException.class)
|
|
68
|
+
ProblemDetail notFound(OrderNotFoundException e) {
|
|
69
|
+
return ProblemDetail.forStatusAndDetail(HttpStatus.NOT_FOUND, e.getMessage());
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- Never return stack traces, SQL or exception class names to clients. Log them server-side with a correlation id.
|
|
74
|
+
- Don't catch an exception just to log and rethrow it; let the advice handle it once.
|
|
75
|
+
|
|
76
|
+
## 6. Security basics
|
|
77
|
+
|
|
78
|
+
- Configure Spring Security with a `SecurityFilterChain` bean (the old `WebSecurityConfigurerAdapter` is gone):
|
|
79
|
+
|
|
80
|
+
```java
|
|
81
|
+
@Bean
|
|
82
|
+
SecurityFilterChain api(HttpSecurity http) throws Exception {
|
|
83
|
+
return http
|
|
84
|
+
.authorizeHttpRequests(a -> a
|
|
85
|
+
.requestMatchers("/actuator/health/**").permitAll()
|
|
86
|
+
.anyRequest().authenticated())
|
|
87
|
+
.oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults()))
|
|
88
|
+
.build();
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- Deny by default: end with `.anyRequest().authenticated()` (or `denyAll()`), and permit only named paths.
|
|
93
|
+
- Disable CSRF only for stateless token-authenticated APIs; keep it for cookie sessions.
|
|
94
|
+
- Hash passwords with `PasswordEncoderFactories.createDelegatingPasswordEncoder()` (bcrypt by default). Never store or log raw passwords or tokens.
|
|
95
|
+
- Check ownership in the service ("does this order belong to the caller?"), not only the role. `@PreAuthorize` needs `@EnableMethodSecurity`.
|
|
96
|
+
- **Stop and ask the user** before changing who can reach an endpoint, the auth mechanism, or CORS origins.
|
|
97
|
+
|
|
98
|
+
## 7. Actuator
|
|
99
|
+
|
|
100
|
+
- Add `spring-boot-starter-actuator`. Only `health` is exposed over HTTP by default; keep it that way and expose more by name (`management.endpoints.web.exposure.include=health,info,prometheus`), never `*` on a public port.
|
|
101
|
+
- Use the liveness and readiness health groups (`/actuator/health/liveness`, `/actuator/health/readiness`, enabled by default) for container probes. Readiness may check dependencies; liveness must not, or a database outage restarts every pod.
|
|
102
|
+
- Put management on a separate port (`management.server.port`) when the platform allows, and protect anything beyond health.
|
|
103
|
+
|
|
104
|
+
## 8. Testing
|
|
105
|
+
|
|
106
|
+
Use the narrowest slice that covers the behaviour. Details, annotations and Boot 3 versus 4 differences are in `references/testing.md`.
|
|
107
|
+
|
|
108
|
+
| What you test | Use |
|
|
109
|
+
|---|---|
|
|
110
|
+
| Pure business logic | Plain JUnit, no Spring context |
|
|
111
|
+
| Controller: routing, validation, status codes, JSON | `@WebMvcTest(OrderController.class)` with `@MockitoBean` services; `@Import` your security config |
|
|
112
|
+
| Repository queries and mappings | `@DataJpaTest` with `@AutoConfigureTestDatabase(replace = NONE)` and a Testcontainers database |
|
|
113
|
+
| Full wiring, security and config | `@SpringBootTest` sparingly, with `@ServiceConnection` containers |
|
|
114
|
+
|
|
115
|
+
- Assert status, body and problem details for error paths, not only the happy path.
|
|
116
|
+
- Test security rules: an unauthenticated request gets 401, the wrong user gets 403 or 404.
|
|
117
|
+
- Don't use H2 to stand in for PostgreSQL or MySQL in repository tests; dialect differences hide real bugs.
|
|
118
|
+
|
|
119
|
+
## Never
|
|
120
|
+
|
|
121
|
+
- Field injection, entities in API responses, or `@Transactional` on private or self-invoked methods.
|
|
122
|
+
- `permitAll()` on everything "for now", or `exposure.include=*` in production.
|
|
123
|
+
- `spring.jpa.hibernate.ddl-auto=update` or `create` outside local dev; use migrations.
|
|
124
|
+
- Catching `Exception` in controllers and returning 200 with an error message.
|
|
125
|
+
|
|
126
|
+
## Before you finish
|
|
127
|
+
|
|
128
|
+
Run the full build (`./mvnw verify` or `./gradlew build`). Report: what changed (files), new config keys and their defaults, security rules touched, tests added, and the final test counts.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"should_trigger": [
|
|
3
|
+
"Add a new REST endpoint to our Spring Boot order service with request validation and proper 404 responses",
|
|
4
|
+
"Bind the payments.* settings in application.yml to a typed config class in Spring Boot",
|
|
5
|
+
"My @Transactional method in the Spring service doesn't roll back when called from the same class, why?",
|
|
6
|
+
"Lock down our Spring Boot API with a SecurityFilterChain and JWT resource server, keeping actuator health public",
|
|
7
|
+
"Write a @WebMvcTest for the invoice controller using MockitoBean instead of MockBean",
|
|
8
|
+
"Which actuator endpoints should a Spring Boot app expose for Kubernetes liveness and readiness probes?"
|
|
9
|
+
],
|
|
10
|
+
"should_not_trigger": [
|
|
11
|
+
"Our Hibernate entities trigger hundreds of selects when loading the order list, fix the N+1",
|
|
12
|
+
"Build a Quarkus REST endpoint backed by Panache and make it compile to a native image",
|
|
13
|
+
"Add JWT authentication and StatusPages error handling to my Ktor server",
|
|
14
|
+
"Review this Java pull request for null handling and resource leaks",
|
|
15
|
+
"Fix the Maven build: cannot find symbol after upgrading the JDK to 21",
|
|
16
|
+
"Write JUnit 5 parameterized tests for this plain Java date parsing utility"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Spring Boot testing reference
|
|
2
|
+
|
|
3
|
+
## Slice annotations
|
|
4
|
+
|
|
5
|
+
| Annotation | Loads | Typical collaborators |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `@WebMvcTest(X.class)` | MVC infrastructure, controller `X`, advice, filters (not `@Configuration` or `@Component` beans) | `MockMvc` or `MockMvcTester`, `@MockitoBean` services |
|
|
8
|
+
| `@WebFluxTest(X.class)` | WebFlux infrastructure for controller `X` | `WebTestClient` |
|
|
9
|
+
| `@DataJpaTest` | JPA, repositories, `TestEntityManager`; each test rolls back | Testcontainers database |
|
|
10
|
+
| `@JsonTest` | Jackson configuration | `JacksonTester` |
|
|
11
|
+
| `@RestClientTest` | `RestClient` / `RestTemplate` builders | `MockRestServiceServer` |
|
|
12
|
+
| `@SpringBootTest` | The whole application | `@AutoConfigureMockMvc`, real containers |
|
|
13
|
+
|
|
14
|
+
`@DataJpaTest` replaces the datasource with an embedded one by default. To test against a container, add `@AutoConfigureTestDatabase(replace = Replace.NONE)` and import the container configuration below.
|
|
15
|
+
|
|
16
|
+
`@WebMvcTest` does not pick up a `SecurityFilterChain` defined in your own `@Configuration` class, so the slice runs Boot's default security instead of your rules. `@Import(SecurityConfig.class)` into the test; with a JWT resource server, also add `@MockitoBean JwtDecoder` so the context starts without an issuer.
|
|
17
|
+
|
|
18
|
+
## Mocks
|
|
19
|
+
|
|
20
|
+
- `@MockitoBean` and `@MockitoSpyBean` (Spring Framework 6.2+) replace `@MockBean` and `@SpyBean`. `@MockBean` is deprecated in Boot 3.4 and removed in Boot 4.
|
|
21
|
+
- `@MockitoBean` goes on test class fields, not in `@Configuration` classes.
|
|
22
|
+
- Every distinct set of mocks creates a new application context. Keep mock sets consistent across test classes so the context cache is reused.
|
|
23
|
+
|
|
24
|
+
## Example: controller slice
|
|
25
|
+
|
|
26
|
+
```java
|
|
27
|
+
@WebMvcTest(OrderController.class)
|
|
28
|
+
@Import(SecurityConfig.class)
|
|
29
|
+
class OrderControllerTest {
|
|
30
|
+
@Autowired MockMvc mvc;
|
|
31
|
+
@MockitoBean OrderService orders;
|
|
32
|
+
@MockitoBean JwtDecoder jwtDecoder;
|
|
33
|
+
|
|
34
|
+
@Test
|
|
35
|
+
void returns404ProblemWhenMissing() throws Exception {
|
|
36
|
+
when(orders.find(42L)).thenThrow(new OrderNotFoundException(42L));
|
|
37
|
+
mvc.perform(get("/orders/42").with(jwt()))
|
|
38
|
+
.andExpect(status().isNotFound())
|
|
39
|
+
.andExpect(jsonPath("$.status").value(404));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@Test
|
|
43
|
+
void rejectsAnonymous() throws Exception {
|
|
44
|
+
mvc.perform(get("/orders/42")).andExpect(status().isUnauthorized());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`jwt()` comes from `spring-security-test` (`SecurityMockMvcRequestPostProcessors`).
|
|
50
|
+
|
|
51
|
+
## Example: Testcontainers with service connections
|
|
52
|
+
|
|
53
|
+
```java
|
|
54
|
+
@TestConfiguration(proxyBeanMethods = false)
|
|
55
|
+
class TestcontainersConfig {
|
|
56
|
+
@Bean @ServiceConnection
|
|
57
|
+
PostgreSQLContainer<?> postgres() { return new PostgreSQLContainer<>("postgres:16-alpine"); }
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Import it with `@Import(TestcontainersConfig.class)` in `@SpringBootTest` classes, or in `@DataJpaTest` classes together with `@AutoConfigureTestDatabase(replace = Replace.NONE)`. `@ServiceConnection` (Boot 3.1+) sets the datasource URL and credentials, so no `@DynamicPropertySource` is needed.
|
|
62
|
+
|
|
63
|
+
## Boot 4 differences
|
|
64
|
+
|
|
65
|
+
From the Spring Boot 4.0 migration guide:
|
|
66
|
+
|
|
67
|
+
- Test support is split per technology. Add the matching test starter, for example `spring-boot-starter-webmvc-test` or `spring-boot-starter-data-jpa-test`; these bring in `spring-boot-starter-test`. Slice annotations move to the matching `spring-boot-<technology>-test` module, so imports change.
|
|
68
|
+
- `@SpringBootTest` no longer configures MockMvc on its own. Add `@AutoConfigureMockMvc`.
|
|
69
|
+
- `TestRestTemplate` needs `@AutoConfigureTestRestTemplate`; the newer `RestTestClient` uses `@AutoConfigureRestTestClient`.
|
|
70
|
+
- Jackson 3 is the default (`tools.jackson` packages; `@JsonComponent` becomes `@JacksonComponent`). The auto-configured mapper is a `JsonMapper`; to replace it, define a `JsonMapper` bean, because a plain `ObjectMapper` bean no longer makes it back off.
|
|
71
|
+
|
|
72
|
+
When upgrading, follow the official migration guide rather than this summary.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stripe-integration
|
|
3
|
+
description: Builds and hardens Stripe payments and billing, from Checkout Sessions and Payment Intents with SCA and 3D Secure handling to Stripe-Signature webhook verification on the unparsed request body, Idempotency-Key headers on every POST, subscriptions driven by invoice events, the Billing customer portal, and test clocks for simulating renewals and trial ends. Use when adding Stripe Checkout or Elements, setting up Stripe subscriptions or the customer portal, fixing a Stripe webhook signature error or duplicate fulfilment, or testing billing cycles with the Stripe CLI.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Any Agent Skills host. Live calls need network access to api.stripe.com; local webhook testing uses the Stripe CLI. Examples are TypeScript with the official stripe-node library; the rules apply to any Stripe SDK.
|
|
6
|
+
metadata:
|
|
7
|
+
kete-loom/version: "0.1.0"
|
|
8
|
+
kete-loom/category: integrations
|
|
9
|
+
kete-loom/risk: network
|
|
10
|
+
kete-loom/requires: "stripe"
|
|
11
|
+
kete-loom/owner: "Kete-org"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Stripe integration
|
|
15
|
+
|
|
16
|
+
Build a Stripe flow where the price comes from the server, a webhook is trusted only after its signature checks out, retries never create a second charge, and subscription access follows what Stripe says, not what the browser says.
|
|
17
|
+
|
|
18
|
+
## Ground rules
|
|
19
|
+
|
|
20
|
+
1. **Secret key on the server only.** `STRIPE_SECRET_KEY` (`sk_...`, or a restricted `rk_...` key with only the permissions the service needs) and the webhook secret (`whsec_...`) come from the environment. Only the publishable key (`pk_...`) reaches the browser.
|
|
21
|
+
2. **Prices come from Stripe or your database.** Pass a `price` ID or compute `amount` server-side. Never accept an amount, currency or price ID from the client without checking it against an allow-list.
|
|
22
|
+
3. **Amounts are integers in the smallest unit** (cents for USD, pence for GBP; zero-decimal currencies such as JPY are whole units). No float maths.
|
|
23
|
+
4. **Fulfil from webhooks.** `checkout.session.completed` (plus `checkout.session.async_payment_succeeded` for delayed methods) or `payment_intent.succeeded`. The success page only shows status; it may never load.
|
|
24
|
+
5. **Verify every webhook** with the SDK on the **raw request bytes**, the `Stripe-Signature` header and that endpoint's `whsec_` secret. Keep the default 5-minute tolerance; never set it to 0.
|
|
25
|
+
6. **Idempotent both ways.** Send an `Idempotency-Key` (a UUID v4 stored with your order) on every create/update POST so a network retry can't double-charge. Record processed `event.id`s and guard fulfilment with `UPDATE ... WHERE status = 'pending'`, because Stripe delivers events at least once and out of order.
|
|
26
|
+
7. **Test mode or a sandbox first**, with the Stripe CLI forwarding events, before any live key is configured.
|
|
27
|
+
|
|
28
|
+
## Choose the flow
|
|
29
|
+
|
|
30
|
+
| Need | Use |
|
|
31
|
+
|---|---|
|
|
32
|
+
| One-off or subscription payment, least code, SCA handled for you | Checkout Session (`mode: 'payment'` or `'subscription'`), hosted or embedded |
|
|
33
|
+
| Your own payment form | Payment Intent + Payment Element; confirm on the client with `stripe.confirmPayment` |
|
|
34
|
+
| Save a card for later charges | `setup_future_usage: 'off_session'` on the Payment Intent, or a Setup Intent |
|
|
35
|
+
| Let customers manage plans, cards and invoices | Billing customer portal session |
|
|
36
|
+
|
|
37
|
+
## Implementation steps
|
|
38
|
+
|
|
39
|
+
1. **Create a Checkout Session** on the server with `line_items: [{ price, quantity }]`, `mode`, `success_url` (include `{CHECKOUT_SESSION_ID}`), `cancel_url`, `client_reference_id` or `metadata.order_id`, and an idempotency key. Redirect to `session.url`. Shapes in `references/api.md`.
|
|
40
|
+
2. **Or create a Payment Intent** with `amount`, `currency`, `automatic_payment_methods: { enabled: true }`, `metadata.order_id`; send only `client_secret` to the browser.
|
|
41
|
+
3. **Webhook endpoint**: follow `references/webhooks.md`. Mount it before any JSON body parser, verify with `stripe.webhooks.constructEvent`, return `2xx` fast, process in a queue.
|
|
42
|
+
4. **Handle SCA**: a Payment Intent in `requires_action` needs the customer to authenticate; the client SDK does this when confirming. For off-session charges (renewals, saved cards) handle `authentication_required` by emailing the customer a link back on-session. Never mark paid on `processing`.
|
|
43
|
+
5. **Subscriptions**: create through Checkout with `mode: 'subscription'`, store `customer` and `subscription` IDs, and drive access from events: `invoice.paid` (extend access; from API `2025-03-31.basil` the period end is on `items.data[].current_period_end`), `invoice.payment_failed` (dunning, keep or restrict per policy), `customer.subscription.updated` / `.deleted` (plan changes, cancellation). Details in `references/billing.md`.
|
|
44
|
+
6. **Customer portal**: configure it in the Dashboard, then create `billingPortal.sessions.create({ customer, return_url })` from an authenticated route and redirect. Never create a portal session for a customer ID taken from the request; look it up from the logged-in user.
|
|
45
|
+
7. **Test clocks** for billing: create a clock, attach a new customer to it, subscribe, then advance time to see trials end, renewals and failed payments fire their webhooks (`references/billing.md`).
|
|
46
|
+
8. **Persist**: order/payment row with expected amount and currency, Checkout Session or Payment Intent ID, idempotency key, status; a `stripe_events` table of processed event IDs; customer and subscription IDs per user.
|
|
47
|
+
|
|
48
|
+
## Reviewing an existing integration
|
|
49
|
+
|
|
50
|
+
Check each ground rule, then look for:
|
|
51
|
+
|
|
52
|
+
- Webhook route behind `express.json()` / framework body parsing, so `constructEvent` fails or was "fixed" by skipping verification.
|
|
53
|
+
- One `whsec_` reused across endpoints or between test and live (each endpoint and mode has its own).
|
|
54
|
+
- Fulfilment in the success page handler, or on `payment_intent.created` / `processing`.
|
|
55
|
+
- Event order assumed (`invoice.paid` before `customer.subscription.created`); missing objects not fetched from the API.
|
|
56
|
+
- No idempotency key on PaymentIntent, refund or subscription creation; or a new key generated on each retry, which defeats it.
|
|
57
|
+
- Subscription access granted from `checkout.session.completed` alone and never revoked on `customer.subscription.deleted`.
|
|
58
|
+
- Prices or amounts sent from the client; `price` IDs hard-coded from test mode in live config.
|
|
59
|
+
- Secret key in front-end code or a `NEXT_PUBLIC_`/`VITE_` variable.
|
|
60
|
+
|
|
61
|
+
## Stop and ask the user
|
|
62
|
+
|
|
63
|
+
- Before switching any configuration to live keys.
|
|
64
|
+
- Whether to keep or cut access on a failed renewal (business decision), and what the dunning and retry settings should be.
|
|
65
|
+
- Before building Connect (marketplaces, payouts to others); it is a different model with onboarding and liability decisions.
|
|
66
|
+
|
|
67
|
+
## Before you finish
|
|
68
|
+
|
|
69
|
+
Stripe's docs at docs.stripe.com and the API version pinned on your account are the final word on field names; this skill gives the rules and the shape. Test with `stripe listen --forward-to localhost:4242/webhook` and `stripe trigger`: card `4242 4242 4242 4242` succeeds, `4000 0025 0000 3155` requires 3D Secure, `4000 0000 0000 9995` declines for insufficient funds. Also test a replayed event (processed once), a bad signature (rejected with 400), a retried create call with the same idempotency key (one object), and a test-clock renewal that fails.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"should_trigger": [
|
|
3
|
+
"Integrate Stripe subscriptions into the billing page",
|
|
4
|
+
"Stripe webhook keeps failing with No signatures found matching the expected signature",
|
|
5
|
+
"Add a Stripe customer portal so users can cancel or change their plan",
|
|
6
|
+
"How do I use Stripe test clocks to check what happens when a trial ends?",
|
|
7
|
+
"Handle 3D Secure when charging a saved card off-session with Payment Intents"
|
|
8
|
+
],
|
|
9
|
+
"should_not_trigger": [
|
|
10
|
+
"Add Flutterwave checkout to our Nigerian e-commerce site",
|
|
11
|
+
"Add Paystack checkout to our Next.js shop so Ghanaian customers can pay",
|
|
12
|
+
"Review the payment module for secret keys leaked into front-end code",
|
|
13
|
+
"Work out which parts of our card checkout fall inside PCI DSS scope",
|
|
14
|
+
"Design the REST API for our invoicing service"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Stripe API shapes used by this skill
|
|
2
|
+
|
|
3
|
+
Use the official SDK for your language and pin the API version your account uses. Every create/update call takes an idempotency key in the request options (`Idempotency-Key` header over HTTP).
|
|
4
|
+
|
|
5
|
+
Idempotency facts (API v1): keys up to 255 characters, UUID v4 recommended, don't put personal data in them. Stripe saves the first response for a key (including a `500`) and returns it on retries; reusing a key with different parameters is an error; keys can be pruned after 24 hours. Don't send keys on `GET` or `DELETE`.
|
|
6
|
+
|
|
7
|
+
## Checkout Session (TypeScript, stripe-node)
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import Stripe from 'stripe';
|
|
11
|
+
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
|
|
12
|
+
|
|
13
|
+
export async function startCheckout(order: { id: string; priceId: string; quantity: number; idemKey: string }) {
|
|
14
|
+
const session = await stripe.checkout.sessions.create(
|
|
15
|
+
{
|
|
16
|
+
mode: 'payment',
|
|
17
|
+
line_items: [{ price: order.priceId, quantity: order.quantity }], // priceId from your DB, not the client
|
|
18
|
+
success_url: 'https://app.example.com/checkout/success?session_id={CHECKOUT_SESSION_ID}',
|
|
19
|
+
cancel_url: 'https://app.example.com/cart',
|
|
20
|
+
client_reference_id: order.id,
|
|
21
|
+
metadata: { order_id: order.id },
|
|
22
|
+
},
|
|
23
|
+
{ idempotencyKey: order.idemKey }, // stored with the order, reused on retry
|
|
24
|
+
);
|
|
25
|
+
return session.url!;
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The success page may call `stripe.checkout.sessions.retrieve(session_id)` to show status, but fulfilment stays in the webhook. Check `session.payment_status === 'paid'` (or `'no_payment_required'`) before fulfilling; for delayed methods it is `'unpaid'` at completion and you wait for `checkout.session.async_payment_succeeded`.
|
|
30
|
+
|
|
31
|
+
## Payment Intent
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
const pi = await stripe.paymentIntents.create(
|
|
35
|
+
{ amount: 2550, currency: 'usd', automatic_payment_methods: { enabled: true }, metadata: { order_id: order.id } },
|
|
36
|
+
{ idempotencyKey: order.idemKey },
|
|
37
|
+
);
|
|
38
|
+
// send pi.client_secret to the browser; confirm there with stripe.confirmPayment({ elements, confirmParams: { return_url } })
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Statuses: `requires_payment_method` → `requires_confirmation` → `requires_action` (SCA / 3DS) → `processing` → `succeeded`, or `canceled`. Only `succeeded` (seen in `payment_intent.succeeded`) means paid. On `payment_intent.payment_failed`, read `last_payment_error` and let the customer try another method.
|
|
42
|
+
|
|
43
|
+
## Off-session charge with a saved method
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
try {
|
|
47
|
+
await stripe.paymentIntents.create(
|
|
48
|
+
{ amount, currency, customer, payment_method, off_session: true, confirm: true },
|
|
49
|
+
{ idempotencyKey },
|
|
50
|
+
);
|
|
51
|
+
} catch (err: any) {
|
|
52
|
+
if (err.code === 'authentication_required') {
|
|
53
|
+
// SCA needed: email the customer a link to an on-session page that confirms err.raw.payment_intent
|
|
54
|
+
} else throw err;
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Refund
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
await stripe.refunds.create({ payment_intent: piId, amount: partialMinor }, { idempotencyKey: refundKey });
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Test cards
|
|
65
|
+
|
|
66
|
+
| Number | Behaviour |
|
|
67
|
+
|---|---|
|
|
68
|
+
| 4242 4242 4242 4242 | Succeeds |
|
|
69
|
+
| 4000 0025 0000 3155 | Requires 3D Secure authentication |
|
|
70
|
+
| 4000 0000 0000 9995 | Declined, insufficient funds |
|
|
71
|
+
| 4000 0000 0000 0002 | Declined, generic |
|