@vesviet/agent-skills 5.8.0 → 5.11.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/INDEX.md +35 -22
- package/README.md +7 -18
- package/VERSION +1 -1
- package/adapters/antigravity/ANTIGRAVITY.md +40 -142
- package/adapters/antigravity/INDEX_TIER1.json +174 -146
- package/adapters/antigravity/a2a-config.template.yaml +1 -1
- package/adapters/antigravity/antigravity-tools.md +25 -0
- package/adapters/antigravity/role-skill-index.json +175 -58
- package/adapters/claude/CLAUDE_ADAPTER.md +3 -7
- package/adapters/claude/settings.template.json +18 -3
- package/adapters/cursor/README.md +1 -5
- package/adapters/cursor/hooks.template.json +4 -2
- package/core/contracts/README.md +0 -20
- package/core/contracts/schemas/compact-working-state.json +42 -1
- package/core/contracts/schemas/ui-component-spec.json +28 -2
- package/core/policies/README.md +0 -20
- package/core/policies/action-boundaries.yaml +10 -1
- package/core/policies/execution-sandbox.md +0 -12
- package/core/policies/mcp-tool-map.yaml +28 -0
- package/core/roles/3d-graphics-engineer.md +144 -208
- package/core/roles/README.md +1 -23
- package/core/roles/agent-coordinator.md +28 -147
- package/core/roles/agent-discovery-engineer.md +46 -39
- package/core/roles/ai-systems-engineer.md +2 -0
- package/core/roles/backend-developer.md +22 -117
- package/core/roles/cloudflare-engineer.md +1 -1
- package/core/roles/data-engineer.md +3 -1
- package/core/roles/devops-engineer.md +4 -3
- package/core/roles/ecommerce-engineer.md +18 -6
- package/core/roles/frontend-developer.md +146 -317
- package/core/roles/game-developer.md +2 -1
- package/core/roles/mobile-engineer.md +18 -204
- package/core/roles/product-manager.md +3 -3
- package/core/roles/project-manager.md +5 -5
- package/core/roles/references/3d-graphics-engineer-review-checklist.md +109 -109
- package/core/roles/references/agent-coordinator-responsibilities.md +120 -0
- package/core/roles/references/agent-coordinator-review-checklist.md +22 -4
- package/core/roles/references/agent-discovery-engineer-review-checklist.md +29 -20
- package/core/roles/references/backend-developer-responsibilities.md +47 -0
- package/core/roles/references/backend-developer-review-checklist.md +15 -0
- package/core/roles/references/business-analyst-responsibilities.md +2 -2
- package/core/roles/references/frontend-developer-responsibilities.md +14 -6
- package/core/roles/references/frontend-developer-review-checklist.md +13 -6
- package/core/roles/references/mobile-engineer-responsibilities.md +137 -0
- package/core/roles/references/mobile-engineer-review-checklist.md +63 -0
- package/core/roles/references/reviewer-review-checklist.md +54 -0
- package/core/roles/references/sdet-review-checklist.md +53 -0
- package/core/roles/references/solution-architect-responsibilities.md +134 -0
- package/core/roles/references/sre-review-checklist.md +81 -0
- package/core/roles/references/system-engineer-responsibilities.md +124 -0
- package/core/roles/references/technical-architect-responsibilities.md +192 -0
- package/core/roles/references/technical-architect-review-checklist.md +58 -0
- package/core/roles/references/technical-lead-review-checklist.md +65 -0
- package/core/roles/references/ui-ux-designer-anti-slop-standards.md +61 -35
- package/core/roles/references/ui-ux-designer-responsibilities.md +79 -226
- package/core/roles/references/ui-ux-designer-review-checklist.md +102 -116
- package/core/roles/references/vietnam-accounting-specialist-review-checklist.md +6 -6
- package/core/roles/researcher.md +3 -3
- package/core/roles/reviewer.md +2 -2
- package/core/roles/role-standard.md +79 -205
- package/core/roles/sdet.md +5 -6
- package/core/roles/security-engineer.md +4 -3
- package/core/roles/solution-architect.md +9 -130
- package/core/roles/sre.md +1 -0
- package/core/roles/system-engineer.md +15 -155
- package/core/roles/task-planner.md +1 -1
- package/core/roles/technical-architect.md +15 -244
- package/core/roles/technical-lead.md +1 -0
- package/core/roles/technical-writer.md +3 -3
- package/core/roles/ui-ux-designer.md +158 -303
- package/core/roles/vietnam-accounting-specialist.md +20 -20
- package/core/rules/README.md +0 -22
- package/core/rules/code.md +11 -6
- package/core/skills/README.md +12 -25
- package/core/skills/agent/agent-delegation/SKILL.md +11 -0
- package/core/skills/agent/agent-graph-orchestration/SKILL.md +5 -0
- package/core/skills/agent/agent-memory-compaction/SKILL.md +79 -82
- package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +74 -115
- package/core/skills/agent/agent-model-routing/SKILL.md +2 -0
- package/core/skills/agent/agent-observability/SKILL.md +12 -6
- package/core/skills/agent/agent-observability/references/session-forensics-7-dimensions.md +41 -0
- package/core/skills/agent/agent-panel-meeting/SKILL.md +3 -3
- package/core/skills/agent/agent-quality-gate/SKILL.md +9 -0
- package/core/skills/agent/configure-agent-commerce/SKILL.md +2 -0
- package/core/skills/agent/configure-agent-commerce/examples/ucp-commerce-manifest-and-endpoints.json +55 -0
- package/core/skills/agent/configure-agent-commerce/references/acp-ucp-agent-commerce-manifest-specs.md +66 -0
- package/core/skills/agent/configure-agent-headers/SKILL.md +3 -0
- package/core/skills/agent/configure-agent-skills/SKILL.md +4 -4
- package/core/skills/agent/configure-oauth-metadata/SKILL.md +10 -7
- package/core/skills/agent/manage-agent-identity/SKILL.md +2 -0
- package/core/skills/agent/manage-agent-identity/examples/agent-identity-spire-workload.yaml +72 -0
- package/core/skills/agent/manage-agent-identity/references/nhi-lifecycle-and-token-rotation.md +45 -0
- package/core/skills/ai/deploy-vllm-inference/SKILL.md +2 -0
- package/core/skills/ai/deploy-vllm-inference/examples/vllm-production-serve-config.yaml +22 -0
- package/core/skills/ai/deploy-vllm-inference/references/vllm-v1-paged-attention-and-kv-tiering.md +20 -0
- package/core/skills/ai/openrouter-task/SKILL.md +5 -5
- package/core/skills/ai-agent/context-optimization/SKILL.md +2 -0
- package/core/skills/ai-agent/context-optimization/examples/context-pruner-and-reorderer.py +85 -0
- package/core/skills/ai-agent/context-optimization/references/token-budgeting-and-attention-allocation.md +47 -0
- package/core/skills/ai-agent/memory-hygiene/SKILL.md +13 -0
- package/core/skills/ai-agent/memory-hygiene/examples/memory-audit-and-compaction-routine.py +90 -0
- package/core/skills/ai-agent/memory-hygiene/references/agent-memory-vault-spec.md +137 -0
- package/core/skills/ai-agent/memory-hygiene/references/owasp-asi06-and-memory-poisoning-defense.md +38 -0
- package/core/skills/backend/add-api-endpoint/SKILL.md +9 -0
- package/core/skills/backend/add-api-endpoint/examples/express-zod-rfc9457-endpoint.md +329 -0
- package/core/skills/backend/add-api-endpoint/examples/kratos-go-clean-architecture-endpoint.md +405 -0
- package/core/skills/backend/add-api-endpoint/references/idempotency-and-rate-limiting.md +116 -0
- package/core/skills/backend/add-event-handler/SKILL.md +12 -1
- package/core/skills/backend/add-event-handler/examples/go-outbox-skip-locked-relay.go +97 -0
- package/core/skills/backend/add-event-handler/references/transactional-outbox-and-cloudevents.md +42 -0
- package/core/skills/backend/add-service-client/SKILL.md +2 -0
- package/core/skills/backend/add-service-client/examples/ts-circuit-breaker-full-jitter-client.ts +71 -0
- package/core/skills/backend/add-service-client/references/resilient-client-circuit-breaker-specs.md +25 -0
- package/core/skills/backend/build-mcp-server/SKILL.md +2 -0
- package/core/skills/backend/build-mcp-server/examples/ts-stateless-mcp-server-zod.ts +52 -0
- package/core/skills/backend/build-mcp-server/references/mcp-2026-stateless-contract-specs.md +21 -0
- package/core/skills/backend/design-caching-and-locking/SKILL.md +83 -0
- package/core/skills/backend/design-caching-and-locking/examples/redis-lua-atomic-reservation-fencing.lua +30 -0
- package/core/skills/backend/design-caching-and-locking/references/redis-lua-fencing-and-stampede-specs.md +25 -0
- package/core/skills/backend/design-caching-and-locking/scripts/verify_lua_atomicity.py +68 -0
- package/core/skills/backend/implement-auth/SKILL.md +9 -0
- package/core/skills/backend/implement-structured-outputs/SKILL.md +2 -0
- package/core/skills/backend/implement-structured-outputs/examples/python-pydantic-structured-output.py +65 -0
- package/core/skills/backend/implement-structured-outputs/references/constrained-decoding-and-double-validation.md +18 -0
- package/core/skills/backend/optimize-postgres/SKILL.md +9 -0
- package/core/skills/backend/scaffold-new-service/SKILL.md +2 -1
- package/core/skills/backend/scaffold-new-service/references/deep-modules-and-seams.md +43 -0
- package/core/skills/business/elicit-requirements/SKILL.md +2 -0
- package/core/skills/business/trace-requirements-impact/SKILL.md +1 -0
- package/core/skills/business/write-use-cases/SKILL.md +1 -0
- package/core/skills/commerce/handle-checkout-flow/SKILL.md +18 -66
- package/core/skills/commerce/handle-checkout-flow/examples/production-checkout-orchestrator.ts +185 -0
- package/core/skills/commerce/handle-checkout-flow/references/pci-dss-v4-and-agentic-checkout-specs.md +72 -0
- package/core/skills/commerce/integrate-payment-gateway/SKILL.md +22 -58
- package/core/skills/commerce/integrate-payment-gateway/examples/resilient-webhook-and-mpp-handler.ts +164 -0
- package/core/skills/commerce/integrate-payment-gateway/references/mpp-x402-and-webhook-security-specs.md +47 -0
- package/core/skills/commerce/manage-order-fulfillment/SKILL.md +17 -50
- package/core/skills/commerce/manage-order-fulfillment/examples/temporal-fulfillment-saga.ts +104 -0
- package/core/skills/commerce/manage-order-fulfillment/references/event-sourced-fulfillment-and-carrier-webhooks.md +58 -0
- package/core/skills/commerce/manage-product-catalog/SKILL.md +5 -1
- package/core/skills/commerce/manage-product-catalog/examples/hybrid-search-and-governance-pipeline.ts +120 -0
- package/core/skills/commerce/manage-product-catalog/references/semantic-vector-catalog-and-graphrag.md +54 -0
- package/core/skills/content/write-article/SKILL.md +1 -1
- package/core/skills/document/docx/SKILL.md +1 -0
- package/core/skills/document/pdf/SKILL.md +2 -0
- package/core/skills/document/pdf/references/pdf-acroforms-and-pdfplumber-specs.md +54 -0
- package/core/skills/document/pdf/scripts/check_fillable_fields.py +144 -0
- package/core/skills/document/pdf/scripts/fill_fillable_fields.py +145 -0
- package/core/skills/document/xlsx/SKILL.md +1 -0
- package/core/skills/documentation/configure-llms-txt/SKILL.md +3 -0
- package/core/skills/documentation/configure-llms-txt/examples/canonical-llms-txt-and-full-txt.md +45 -0
- package/core/skills/documentation/configure-llms-txt/references/llms-txt-and-llms-full-txt-standard.md +37 -0
- package/core/skills/documentation/write-documentation/SKILL.md +4 -1
- package/core/skills/documentation/write-documentation/examples/microservice-production-readme-and-api-docs.md +70 -0
- package/core/skills/documentation/write-documentation/references/diataxis-framework-and-doc-standards.md +62 -0
- package/core/skills/documentation/write-tech-radar/SKILL.md +1 -0
- package/core/skills/education/create-exercises/SKILL.md +1 -0
- package/core/skills/education/design-learning-plan/SKILL.md +1 -0
- package/core/skills/education/grade-and-review/SKILL.md +1 -0
- package/core/skills/foundation/accessibility-review/SKILL.md +1 -0
- package/core/skills/foundation/ai-risk-assessment/SKILL.md +4 -5
- package/core/skills/foundation/ai-risk-assessment/examples/genai-system-risk-register.md +67 -0
- package/core/skills/foundation/ai-risk-assessment/references/nist-ai-rmf-and-eu-ai-act-taxonomy.md +49 -0
- package/core/skills/foundation/combinatorial-testing/SKILL.md +1 -0
- package/core/skills/foundation/conduct-research/SKILL.md +2 -2
- package/core/skills/foundation/conduct-research/references/ai-era-source-discipline.md +1 -1
- package/core/skills/foundation/create-migration/SKILL.md +10 -0
- package/core/skills/foundation/design-review/SKILL.md +9 -10
- package/core/skills/foundation/design-ux-flow/SKILL.md +9 -7
- package/core/skills/foundation/discernment-nudge/SKILL.md +2 -0
- package/core/skills/foundation/hostile-component-stress-testing/SKILL.md +1 -0
- package/core/skills/foundation/incident-report/SKILL.md +1 -0
- package/core/skills/foundation/plan-technical-delivery/SKILL.md +3 -1
- package/core/skills/foundation/playwright-evidence-qa/SKILL.md +1 -0
- package/core/skills/foundation/refactor-legacy-code/SKILL.md +84 -0
- package/core/skills/foundation/refactor-legacy-code/examples/characterization-test-seam-extraction.py +34 -0
- package/core/skills/foundation/refactor-legacy-code/references/strangler-fig-seams-and-characterization-tests.md +17 -0
- package/core/skills/foundation/refactor-legacy-code/scripts/check_refactor_blast_radius.py +63 -0
- package/core/skills/foundation/release-notes/SKILL.md +3 -3
- package/core/skills/foundation/release-notes/examples/enterprise-platform-release-notes.md +42 -0
- package/core/skills/foundation/release-notes/references/keep-a-changelog-and-semver-governance.md +43 -0
- package/core/skills/foundation/systematic-debugging/SKILL.md +15 -0
- package/core/skills/foundation/webapp-server-runner/SKILL.md +1 -0
- package/core/skills/foundation/write-product-brief/SKILL.md +1 -0
- package/core/skills/foundation/write-tests/SKILL.md +9 -0
- package/core/skills/foundation/write-tests/examples/anti-tautological-tdd-walkthrough.md +204 -0
- package/core/skills/foundation/write-tests/examples/testcontainers-kratos-integration-test.md +186 -0
- package/core/skills/foundation/write-tests/references/contract-and-chaos-testing.md +187 -0
- package/core/skills/frontend/INDEX.json +16 -0
- package/core/skills/frontend/add-page-route/SKILL.md +10 -8
- package/core/skills/frontend/add-page-route/examples/streaming-rsc-page-with-view-transition.tsx +133 -0
- package/core/skills/frontend/add-page-route/references/rsc-routing-and-view-transitions.md +72 -0
- package/core/skills/frontend/add-ui-component/SKILL.md +4 -1
- package/core/skills/frontend/add-ui-component/examples/compound-dialog-and-form-actions.tsx +193 -0
- package/core/skills/frontend/add-ui-component/references/react19-component-standards-and-anti-slop.md +55 -0
- package/core/skills/frontend/component-composition/SKILL.md +12 -1
- package/core/skills/frontend/component-composition/examples/headless-combobox-compound-component.tsx +207 -0
- package/core/skills/frontend/design-md-specification/SKILL.md +5 -0
- package/core/skills/frontend/design-system-engineering/SKILL.md +4 -2
- package/core/skills/frontend/frontend-micro-polish/SKILL.md +1 -0
- package/core/skills/frontend/frontend-testing/SKILL.md +4 -1
- package/core/skills/frontend/frontend-testing/examples/playwright-e2e-with-msw-and-axe.spec.ts +87 -0
- package/core/skills/frontend/frontend-testing/references/playwright-msw-and-a11y-testing-standards.md +78 -0
- package/core/skills/frontend/implement-ai-disclosure/SKILL.md +119 -0
- package/core/skills/frontend/implement-view-transitions/SKILL.md +1 -0
- package/core/skills/frontend/implement-webmcp/SKILL.md +7 -4
- package/core/skills/frontend/implement-webmcp/examples/webmcp-provider-and-hitl-modal.tsx +163 -0
- package/core/skills/frontend/implement-webmcp/references/webmcp-architecture-and-hitl-security.md +48 -0
- package/core/skills/frontend/integrate-api-client/SKILL.md +12 -12
- package/core/skills/frontend/integrate-api-client/examples/orval-query-and-streaming-mutation.ts +102 -0
- package/core/skills/frontend/integrate-api-client/references/orval-tanstack-query-and-streaming-specs.md +57 -0
- package/core/skills/frontend/interactive-component-workbench/SKILL.md +1 -0
- package/core/skills/frontend/motion-performance-engineering/SKILL.md +1 -0
- package/core/skills/frontend/setup-design-system/SKILL.md +6 -3
- package/core/skills/frontend/setup-design-system/examples/tailwind-v4-theme-and-dtcg-tokens.css +87 -0
- package/core/skills/frontend/setup-design-system/references/tailwind-v4-oklch-and-dtcg-tokens.md +61 -0
- package/core/skills/frontend/setup-visual-regression/SKILL.md +8 -5
- package/core/skills/frontend/setup-visual-regression/examples/visual-regression-playwright.config.ts +83 -0
- package/core/skills/frontend/setup-visual-regression/references/visual-regression-docker-and-masking-specs.md +46 -0
- package/core/skills/frontend/ui-ux-designer-anti-slop-standards.md +64 -42
- package/core/skills/frontend/web-quality-audit/SKILL.md +1 -0
- package/core/skills/gamedev/abstract-input-actions/SKILL.md +2 -0
- package/core/skills/gamedev/abstract-input-actions/examples/input-action-manager.ts +85 -0
- package/core/skills/gamedev/abstract-input-actions/references/action-mapping-and-analog-deadzones.md +54 -0
- package/core/skills/gamedev/architect-ecs-systems/SKILL.md +2 -0
- package/core/skills/gamedev/architect-ecs-systems/examples/bevy-flecs-combat-system.rs +73 -0
- package/core/skills/gamedev/architect-ecs-systems/references/data-oriented-design-and-archetype-ecs.md +39 -0
- package/core/skills/gamedev/author-game-ai/SKILL.md +2 -0
- package/core/skills/gamedev/author-game-ai/examples/modular-behavior-tree-ai.ts +98 -0
- package/core/skills/gamedev/author-game-ai/references/behavior-trees-and-utility-ai-curves.md +47 -0
- package/core/skills/gamedev/configure-physics-collision/SKILL.md +2 -0
- package/core/skills/gamedev/configure-physics-collision/examples/kinematic-physics-substepping.cpp +100 -0
- package/core/skills/gamedev/configure-physics-collision/references/continuous-collision-detection-and-substepping.md +50 -0
- package/core/skills/gamedev/develop-gameplay-systems/SKILL.md +2 -0
- package/core/skills/gamedev/develop-gameplay-systems/examples/kinematic-character-controller.gd +86 -0
- package/core/skills/gamedev/develop-gameplay-systems/references/deterministic-gameplay-state-machines.md +42 -0
- package/core/skills/gamedev/implement-save-persistence/SKILL.md +2 -0
- package/core/skills/gamedev/implement-save-persistence/examples/versioned-save-manager.ts +127 -0
- package/core/skills/gamedev/implement-save-persistence/references/versioned-save-schemas-and-checksums.md +44 -0
- package/core/skills/gamedev/render-webgl-threejs/SKILL.md +14 -10
- package/core/skills/gamedev/render-webgl-threejs/examples/production-threejs-webgpu-scene.ts +116 -0
- package/core/skills/gamedev/render-webgl-threejs/references/webgpu-threejs-pbr-pipeline.md +72 -0
- package/core/skills/legal-compliance/audit-ai-compliance/SKILL.md +1 -0
- package/core/skills/legal-compliance/draft-legal-opinion/SKILL.md +1 -0
- package/core/skills/legal-compliance/manage-vietnam-legal/SKILL.md +1 -0
- package/core/skills/meetings-analysis/analyze-business-requirements/SKILL.md +1 -0
- package/core/skills/meetings-analysis/analyze-data/SKILL.md +1 -0
- package/core/skills/meetings-analysis/meeting-review/SKILL.md +1 -0
- package/core/skills/mmo/analyze-campaign-roi/SKILL.md +2 -0
- package/core/skills/mmo/analyze-campaign-roi/examples/campaign-roi-and-roas-dashboard.py +80 -0
- package/core/skills/mmo/analyze-campaign-roi/references/multi-touch-attribution-and-cpa-analytics.md +33 -0
- package/core/skills/mmo/create-automation-script/SKILL.md +2 -0
- package/core/skills/mmo/create-automation-script/examples/stealth-browser-automation-flow.ts +65 -0
- package/core/skills/mmo/create-automation-script/references/stealth-cdp-and-behavioral-mimicry.md +37 -0
- package/core/skills/mmo/deploy-mmo-infrastructure/SKILL.md +3 -0
- package/core/skills/mmo/deploy-mmo-infrastructure/examples/proxy-health-probe-and-rotation-daemon.py +75 -0
- package/core/skills/mmo/deploy-mmo-infrastructure/references/proxy-pool-rotation-and-anti-detect-specs.md +45 -0
- package/core/skills/mmo/deploy-proxyware-fleet/SKILL.md +3 -0
- package/core/skills/mmo/deploy-proxyware-fleet/examples/docker-compose-depin-light-node-fleet.yaml +52 -0
- package/core/skills/mmo/deploy-proxyware-fleet/references/depin-bandwidth-monetization-node-specs.md +43 -0
- package/core/skills/mmo/generate-mmo-content/SKILL.md +2 -0
- package/core/skills/mmo/generate-mmo-content/examples/pseo-programmatic-page-generator.ts +76 -0
- package/core/skills/mmo/generate-mmo-content/references/pseo-landing-pages-and-social-video-hooks.md +39 -0
- package/core/skills/mmo/manage-mmo-assets/SKILL.md +2 -0
- package/core/skills/mmo/manage-mmo-assets/examples/mmo-asset-vault-manager.py +63 -0
- package/core/skills/mmo/manage-mmo-assets/references/mmo-asset-rbac-and-vault-isolation.md +38 -0
- package/core/skills/mmo/setup-tracking-system/SKILL.md +2 -0
- package/core/skills/mmo/setup-tracking-system/examples/meta-capi-s2s-event-dispatcher.ts +79 -0
- package/core/skills/mmo/setup-tracking-system/references/server-to-server-postback-and-capi-specs.md +45 -0
- package/core/skills/mobile/deploy-mobile-app/SKILL.md +1 -0
- package/core/skills/mobile/develop-mobile-app/SKILL.md +1 -0
- package/core/skills/platform/add-telemetry-instrumentation/SKILL.md +2 -0
- package/core/skills/platform/add-telemetry-instrumentation/examples/kratos-otel-middleware-instrumentation.go +87 -0
- package/core/skills/platform/add-telemetry-instrumentation/references/opentelemetry-semantic-conventions-2026.md +37 -0
- package/core/skills/platform/agents-sdk/SKILL.md +1 -0
- package/core/skills/platform/aws-infrastructure/SKILL.md +2 -0
- package/core/skills/platform/aws-infrastructure/examples/opentofu-eks-pod-identity-vpc.tf +101 -0
- package/core/skills/platform/aws-infrastructure/references/opentofu-aws-zero-trust-and-irsa.md +40 -0
- package/core/skills/platform/cloudflare-email-service/SKILL.md +2 -2
- package/core/skills/platform/configure-ci-cd-pipeline/SKILL.md +83 -0
- package/core/skills/platform/configure-ci-cd-pipeline/examples/hardened-ci-matrix-workflow.yml +33 -0
- package/core/skills/platform/configure-ci-cd-pipeline/references/github-actions-sha-pinning-and-slsa-specs.md +22 -0
- package/core/skills/platform/configure-ci-cd-pipeline/scripts/audit_workflow_pinning.py +74 -0
- package/core/skills/platform/debug-runtime-platform/SKILL.md +1 -2
- package/core/skills/platform/debug-workers-edge/SKILL.md +2 -2
- package/core/skills/platform/durable-objects/SKILL.md +1 -0
- package/core/skills/platform/orchestrate-chaos-experiment/SKILL.md +1 -0
- package/core/skills/platform/sandbox-sdk/SKILL.md +1 -0
- package/core/skills/platform/setup-deployment/SKILL.md +6 -2
- package/core/skills/platform/setup-deployment/examples/kustomize-production-service-manifests.yaml +123 -0
- package/core/skills/platform/setup-deployment/references/interactive-hitl-wizard.md +55 -0
- package/core/skills/platform/setup-deployment/references/k8s-gitops-and-kustomize-invariants.md +40 -0
- package/core/skills/platform/setup-gpu-finops/SKILL.md +2 -0
- package/core/skills/platform/setup-gpu-finops/examples/gpu-finops-prometheus-rules.yaml +23 -0
- package/core/skills/platform/setup-gpu-finops/references/dcgm-kubecost-gpu-attribution-specs.md +16 -0
- package/core/skills/platform/setup-llm-gateway/SKILL.md +2 -0
- package/core/skills/platform/setup-llm-gateway/examples/litellm-gateway-config.yaml +28 -0
- package/core/skills/platform/setup-llm-gateway/references/litellm-routing-budget-failover-specs.md +16 -0
- package/core/skills/platform/supply-chain-security/SKILL.md +3 -2
- package/core/skills/platform/supply-chain-security/examples/github-actions-sbom-cosign.yaml +57 -0
- package/core/skills/platform/supply-chain-security/references/slsa-provenance-and-sbom-sigstore.md +60 -0
- package/core/skills/platform/turnstile-spin/SKILL.md +2 -2
- package/core/skills/platform/web-perf/SKILL.md +2 -2
- package/core/skills/platform/workers-best-practices/SKILL.md +1 -0
- package/core/skills/platform/wrangler/SKILL.md +1 -0
- package/core/skills/product/build-story-map/SKILL.md +3 -0
- package/core/skills/product/define-product-strategy/SKILL.md +1 -0
- package/core/skills/product/model-saas-metrics/SKILL.md +1 -0
- package/core/skills/product/prioritize-roadmap/SKILL.md +1 -0
- package/core/skills/repo-ops/commit-code/SKILL.md +1 -0
- package/core/skills/repo-ops/navigate-service/SKILL.md +28 -132
- package/core/skills/repo-ops/navigate-service/examples/service-boundary-map-example.md +14 -0
- package/core/skills/repo-ops/navigate-service/references/service-topology-mapping-guide.md +18 -0
- package/core/skills/repo-ops/review-code/SKILL.md +12 -2
- package/core/skills/repo-ops/review-code/examples/adversarial-two-axis-pr-review.md +167 -0
- package/core/skills/repo-ops/review-code/examples/ai-vibe-slop-remediation.md +220 -0
- package/core/skills/repo-ops/review-code/references/supply-chain-and-migration-safety.md +103 -0
- package/core/skills/repo-ops/review-service/SKILL.md +4 -1
- package/core/skills/repo-ops/review-service/examples/service-release-audit-report.md +21 -0
- package/core/skills/repo-ops/review-service/references/release-readiness-audit-rubric.md +21 -0
- package/core/skills/repo-ops/troubleshoot-service/SKILL.md +1 -0
- package/core/skills/security-data/database-maintenance/SKILL.md +1 -1
- package/core/skills/security-data/manage-secrets/SKILL.md +2 -0
- package/core/skills/security-data/manage-secrets/examples/external-secrets-vault-crds.yaml +53 -0
- package/core/skills/security-data/manage-secrets/references/zero-trust-secret-rotation-and-eso.md +30 -0
- package/core/skills/security-data/manage-vietnam-accounting/SKILL.md +8 -7
- package/core/skills/security-data/prompt-injection-defense/SKILL.md +2 -0
- package/core/skills/security-data/prompt-injection-defense/examples/bounded-tool-execution-wrapper.py +78 -0
- package/core/skills/security-data/prompt-injection-defense/references/prompt-injection-taxonomy-and-delimiters.md +37 -0
- package/core/skills/security-data/reverse-engineer-binary/SKILL.md +3 -0
- package/core/skills/security-data/reverse-engineer-binary/examples/binary-triage-and-vulnerability-dossier.md +58 -0
- package/core/skills/security-data/reverse-engineer-binary/references/ghidra-radare2-and-rea-evidence-ledgers.md +43 -0
- package/core/skills/security-data/security-audit/SKILL.md +3 -1
- package/core/skills/security-data/security-audit/examples/enterprise-service-security-audit-report.md +54 -0
- package/core/skills/security-data/security-audit/references/owasp-asi-and-cvss4-threat-modeling.md +39 -0
- package/core/skills/security-data/skill-preflight-ast-check/SKILL.md +3 -0
- package/core/skills/security-data/skill-preflight-ast-check/references/ast-lethal-trifecta-and-static-vetting.md +38 -0
- package/core/skills/security-data/skill-preflight-ast-check/scripts/scan-skill-ast.py +127 -0
- package/core/skills/seo/audit-technical-seo/SKILL.md +1 -0
- package/core/skills/seo/implement-schema-markup/SKILL.md +1 -0
- package/core/workflows/README.md +0 -20
- package/overlays/README.md +2 -22
- package/overlays/astro-cloudflare/README.md +0 -20
- package/overlays/astro-cloudflare/rules/astro-cloudflare-conventions.md +0 -31
- package/overlays/b2b-catalog-golf/README.md +0 -20
- package/overlays/b2b-catalog-golf/rules/golf-project-rules.md +0 -31
- package/overlays/b2b-catalog-golf/skills/develop-b2b-golf-feature/SKILL.md +1 -0
- package/overlays/b2b-factory-catalog/README.md +0 -20
- package/overlays/b2b-factory-catalog/rules/icm-project-rules.md +0 -31
- package/overlays/b2b-factory-catalog/skills/develop-b2b-catalog-feature/SKILL.md +1 -0
- package/overlays/b2b-sport-catalog/README.md +0 -20
- package/overlays/b2b-sport-catalog/rules/sport-project-rules.md +0 -31
- package/overlays/cad-projection/README.md +0 -20
- package/overlays/cad-projection/rules/cad-conventions.md +0 -20
- package/overlays/cad-projection/skills/isometric-svg-projection/SKILL.md +1 -0
- package/overlays/data-analyst-stack/README.md +0 -20
- package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +0 -31
- package/overlays/data-analyst-stack/rules/stack-conventions.md +0 -31
- package/overlays/data-warehouse/README.md +0 -22
- package/overlays/data-warehouse/learning/learning-conventions.md +0 -31
- package/overlays/data-warehouse/learning/phase-roadmap.md +0 -31
- package/overlays/data-warehouse/rules/amis-accounting-standards.md +0 -33
- package/overlays/data-warehouse/rules/duckdb-concurrency.md +0 -37
- package/overlays/data-warehouse/rules/pii-scrubbing.md +0 -37
- package/overlays/data-warehouse/rules/stocktake-tolerance.md +0 -33
- package/overlays/ecommerce-microservices/README.md +22 -35
- package/overlays/ecommerce-microservices/config/README.md +3 -1
- package/overlays/ecommerce-microservices/rules/README.md +2 -1
- package/overlays/ecommerce-microservices/rules/microservices-conventions.md +30 -0
- package/overlays/ecommerce-microservices/skills/README.md +1 -1
- package/overlays/ecommerce-microservices/workflows/README.md +3 -1
- package/overlays/fintech-compliance/README.md +0 -20
- package/overlays/fintech-compliance/rules/credit-scorecard-rules.md +0 -20
- package/overlays/fintech-compliance/skills/build-credit-scorecard/SKILL.md +1 -0
- package/overlays/go-microservices/README.md +1 -21
- package/overlays/go-microservices/rules/go-conventions.md +0 -31
- package/overlays/hugo-authority-content/README.md +0 -20
- package/overlays/hugo-authority-content/roles/README.md +0 -20
- package/overlays/hugo-authority-content/rules/content-brand.md +0 -30
- package/overlays/hugo-authority-content/rules/link-topology.md +0 -30
- package/overlays/hugo-authority-content/rules/seo-authority.md +0 -30
- package/overlays/hugo-authority-content/rules/technical-article-2027.md +0 -30
- package/overlays/hugo-authority-content/skills/audit-technical-article/SKILL.md +1 -0
- package/overlays/hugo-authority-content/skills/write-hugo-twin-content/SKILL.md +1 -0
- package/overlays/hugo-authority-content/workflows/README.md +0 -20
- package/overlays/hvac-authority-content/README.md +0 -20
- package/overlays/hvac-authority-content/config/collections.md +0 -22
- package/overlays/hvac-authority-content/rules/content-schema.md +0 -30
- package/overlays/hvac-authority-content/rules/hvac-engineering-standards.md +0 -30
- package/overlays/hvac-authority-content/rules/silo-linking.md +0 -30
- package/overlays/hvac-authority-content/skills/write-hvac-authority-content/SKILL.md +1 -0
- package/overlays/hvac-authority-content/workflows/publish-hvac-content.md +0 -22
- package/overlays/laravel-ecommerce/README.md +0 -20
- package/overlays/laravel-ecommerce/rules/elomus-design-system.md +0 -31
- package/overlays/laravel-ecommerce/rules/laravel-ecommerce-rules.md +0 -31
- package/overlays/laravel-ecommerce/skills/develop-laravel-ecommerce-feature/SKILL.md +1 -0
- package/overlays/laravel-filament/README.md +0 -20
- package/overlays/laravel-filament/rules/laravel-conventions.md +0 -31
- package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +1 -0
- package/overlays/livestream-web/README.md +0 -20
- package/overlays/livestream-web/rules/livestream-web-ux-conventions.md +0 -31
- package/overlays/obj-configurator/README.md +0 -20
- package/overlays/obj-configurator/rules/obj-project-rules.md +0 -31
- package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +1 -0
- package/overlays/r3f-stack/README.md +0 -20
- package/overlays/r3f-stack/rules/stub.md +0 -31
- package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +4 -2
- package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +6 -5
- package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +4 -3
- package/overlays/real-estate-content/README.md +0 -20
- package/overlays/real-estate-content/roles/README.md +0 -20
- package/overlays/real-estate-content/rules/affiliate-links.md +0 -31
- package/overlays/real-estate-content/rules/content-schema.md +0 -31
- package/overlays/real-estate-content/rules/seo-baseline.md +0 -31
- package/overlays/real-estate-content/skills/write-real-estate-astro-data/SKILL.md +1 -0
- package/overlays/real-estate-content/workflows/README.md +0 -20
- package/overlays/security-research/README.md +0 -20
- package/overlays/security-research/rules/reverse-engineering-rules.md +0 -20
- package/overlays/seo-publishing/README.md +1 -21
- package/overlays/seo-publishing/rules/publish-log-conventions.md +0 -31
- package/overlays/seo-publishing/rules/publishing-cadence.md +0 -31
- package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +0 -31
- package/overlays/seo-publishing/rules/topic-board-template.md +0 -31
- package/overlays/ui-design-system/README.md +0 -20
- package/overlays/ui-design-system/rules/handoff-conventions.md +0 -31
- package/package.json +2 -2
- package/packs/README.md +3 -9
- package/packs/ecommerce-team/manifest.yaml +1 -1
- package/core/skills/commerce/2026_STANDARDS_SUMMARY.md +0 -316
- package/core/skills/commerce/handle-checkout-flow/UPGRADE_PLAN_2026.md +0 -99
- package/core/skills/commerce/integrate-payment-gateway/UPGRADE_PLAN_2026.md +0 -128
- package/core/skills/commerce/manage-order-fulfillment/UPGRADE_PLAN_2026.md +0 -136
- package/core/skills/commerce/manage-product-catalog/UPGRADE_PLAN_2026.md +0 -130
- package/core/skills/education/2026_STANDARDS_SUMMARY.md +0 -290
- package/core/skills/education/create-exercises/UPGRADE_PLAN_2026.md +0 -115
- package/core/skills/education/design-learning-plan/UPGRADE_PLAN_2026.md +0 -140
- package/core/skills/education/grade-and-review/UPGRADE_PLAN_2026.md +0 -141
- package/core/skills/frontend/2026_STANDARDS_SUMMARY.md +0 -345
- package/core/skills/frontend/add-page-route/UPGRADE_PLAN_2026.md +0 -102
- package/core/skills/frontend/add-ui-component/UPGRADE_PLAN_2026.md +0 -114
- package/core/skills/frontend/component-composition/UPGRADE_PLAN_2026.md +0 -103
- package/core/skills/frontend/frontend-testing/UPGRADE_PLAN_2026.md +0 -137
- package/core/skills/frontend/implement-view-transitions/UPGRADE_PLAN_2026.md +0 -118
- package/core/skills/frontend/implement-webmcp/UPGRADE_PLAN_2026.md +0 -108
- package/core/skills/frontend/integrate-api-client/UPGRADE_PLAN_2026.md +0 -118
- package/core/skills/frontend/setup-design-system/UPGRADE_PLAN_2026.md +0 -123
- package/core/skills/frontend/setup-visual-regression/UPGRADE_PLAN_2026.md +0 -121
- package/core/skills/meetings-analysis/2026_STANDARDS_SUMMARY.md +0 -236
- package/core/skills/meetings-analysis/analyze-business-requirements/UPGRADE_PLAN_2026.md +0 -97
- package/core/skills/meetings-analysis/analyze-data/UPGRADE_PLAN_2026.md +0 -143
- package/core/skills/meetings-analysis/meeting-review/UPGRADE_PLAN_2026.md +0 -125
- package/core/skills/mobile/2026_STANDARDS_SUMMARY.md +0 -209
- package/core/skills/mobile/deploy-mobile-app/UPGRADE_PLAN_2026.md +0 -122
- package/core/skills/mobile/develop-mobile-app/UPGRADE_PLAN_2026.md +0 -141
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Machine Payments Protocol (MPP), x402, and Webhook Security Specifications (2026)
|
|
2
|
+
|
|
3
|
+
## 1. Webhook Ingestion & Cryptographic Verification
|
|
4
|
+
|
|
5
|
+
### 1.1 HMAC SHA-256 Signature Hardening
|
|
6
|
+
Payment webhook endpoints are the primary target for unauthorized state transition tampering. The following invariants are non-negotiable:
|
|
7
|
+
- **Raw Payload Preservation**: The HMAC signature must be calculated exclusively over the raw, unparsed byte buffer of the HTTP request body (`req.rawBody`). Any JSON re-serialization before verification introduces whitespace/key-ordering mutations that break cryptographic integrity.
|
|
8
|
+
- **Constant-Time Comparison**: Comparison between computed and transmitted HMAC digests must use constant-time operations (`crypto.timingSafeEqual` in Node.js or `hmac.compare_digest` in Python) to prevent statistical timing side-channel attacks.
|
|
9
|
+
- **Replay Window Enforcement**: Reject any webhook where the payload timestamp drifts by more than 300 seconds ($T_{drift} > 300\text{s}$) relative to server time ($T_{now}$).
|
|
10
|
+
|
|
11
|
+
### 1.2 Queue-First Architecture (<500ms SLA)
|
|
12
|
+
To guarantee high availability and prevent gateway timeouts:
|
|
13
|
+
1. Verify signature over raw bytes.
|
|
14
|
+
2. Persist the raw event to an asynchronous durable message queue (Kafka, Cloudflare Queues, AWS SQS, or RabbitMQ).
|
|
15
|
+
3. Immediately return HTTP `200 OK` within 500ms.
|
|
16
|
+
4. Downstream consumer workers execute business logic (ledger booking, fulfillment dispatch).
|
|
17
|
+
|
|
18
|
+
### 1.3 Dual-Write Idempotency Guards
|
|
19
|
+
Webhook delivery semantics are strictly at-least-once. To ensure exactly-once execution:
|
|
20
|
+
- **Database Composite Constraint**: Enforce a unique database constraint on `(provider, event_id, event_type)`.
|
|
21
|
+
- **Distributed Lock**: Acquire a distributed lock (Redis Redlock or PostgreSQL Advisory Lock) keyed by `lock:payment:event:<event_id>` with a 30-second TTL before initiating order state transitions.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 2. Machine Payments Protocol (MPP) & HTTP 402 / x402
|
|
26
|
+
|
|
27
|
+
### 2.1 Autonomous Agent Payment Flow
|
|
28
|
+
Autonomous AI agents interact with paywalled APIs via the Machine Payments Protocol (MPP) and the open x402 specification:
|
|
29
|
+
|
|
30
|
+
1. **Challenge Stage**: Client agent requests a restricted resource; server responds with HTTP `402 Payment Required` accompanied by the `Payment-Required` challenge header containing base64-encoded payment schemes, pricing, and deposit addresses.
|
|
31
|
+
2. **Credential Negotiation**:
|
|
32
|
+
- *Fiat / Cards*: Shared Payment Tokens (SPTs) or off-session `SetupIntents` with `setup_future_usage: "off_session"`.
|
|
33
|
+
- *Stablecoins*: USDC on Base or Tempo network via Coinbase Developer Platform (CDP) facilitators.
|
|
34
|
+
3. **Settlement Verification**:
|
|
35
|
+
- Merchant validates the on-chain transaction receipt or Stripe `crypto` transaction verification object (`POST /v1/crypto/deposit_addresses`).
|
|
36
|
+
4. **Fulfillment**: Once verified, the server yields the requested resource payload with payment confirmation headers.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 3. Account-to-Account (A2A) Pay by Bank Settlement
|
|
41
|
+
|
|
42
|
+
### 3.1 Asynchronous Settlement State Machine
|
|
43
|
+
Bank-to-bank direct payment rails (Plaid, TrueLayer, Stripe Pay by Bank) execute across asynchronous settlement phases:
|
|
44
|
+
- `processing`: Initial customer bank consent and payment initiation.
|
|
45
|
+
- `pending`: ACH/SEPA clearance in flight. Inventory must be protected with a soft TTL lock (typically 48–72 hours).
|
|
46
|
+
- `settled`: Final funds settlement confirmed via signed webhook. Order transitions to `paid`, locking inventory hard.
|
|
47
|
+
- `failed` / `cancelled`: Settlement rejected or NSF. Soft inventory lock automatically releases via sweeper.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: manage-order-fulfillment
|
|
3
3
|
description: Implement and manage the post-purchase order lifecycle including order status management, packing, shipping label generation, carrier tracking, and refund or return processing. Use when building or maintaining fulfillment workflows after a successful payment.
|
|
4
|
+
version: "1.0.0"
|
|
4
5
|
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, fetch]
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -33,67 +34,31 @@ Use this skill when the task involves the operations and engineering required to
|
|
|
33
34
|
## Suggested Process
|
|
34
35
|
|
|
35
36
|
### 1. Define the Event-Sourced Order State Machine
|
|
36
|
-
|
|
37
|
-
Map the full lifecycle as immutable event log before implementing:
|
|
38
|
-
|
|
37
|
+
Map the lifecycle as an immutable event log:
|
|
39
38
|
```
|
|
40
39
|
order_placed → payment_captured → fulfillment_started → packed → shipped → delivered → completed
|
|
41
40
|
↘ return_requested → returned → refunded
|
|
42
|
-
pending → cancelled (only before shipped)
|
|
43
41
|
```
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
- **derive current status by projecting event stream** — NO mutable status field updates
|
|
47
|
-
- emit an event or webhook on each state change for downstream systems (warehouse, email, analytics)
|
|
48
|
-
- **Temporal/Step Functions Saga**: compensating branches for each failure mode, durable retries, automatic compensation registration
|
|
42
|
+
- enforce state transitions in code, derive status by projecting the event stream, and emit domain events
|
|
43
|
+
- orchestrate compensating branches via Temporal / AWS Step Functions (Shipping → Inventory → Payment)
|
|
49
44
|
|
|
50
45
|
### 2. Implement Order Processing
|
|
51
|
-
|
|
52
|
-
- on payment confirmation: create the order record, decrement inventory, send confirmation email
|
|
53
|
-
- assign the order to a fulfillment queue (warehouse team, 3PL, or automated picker)
|
|
54
|
-
- allow operations team to view and manage orders through an admin interface
|
|
55
|
-
- **Temporal patterns**: declarative states with guards in config, pure decider owns decisions; derived UI steps via `deriveStep()`; price integrity with `reviewedCartVersion`; reservation management with TTL
|
|
46
|
+
- create confirmed order, reserve/decrement inventory, enqueue warehouse/3PL fulfillment, and validate `reviewedCartVersion` with reservation TTL
|
|
56
47
|
|
|
57
48
|
### 3. Implement Shipping Label Generation
|
|
58
|
-
|
|
59
|
-
- integrate with carrier API (EasyPost, Shippo, DHL API, GHTK for Vietnam) to generate shipping labels
|
|
60
|
-
- validate the shipping address before requesting a label (reduce carrier correction fees)
|
|
61
|
-
- store the label URL and tracking number against the order record
|
|
62
|
-
- mark order as `shipped` after label is generated and send tracking info to customer
|
|
49
|
+
- validate shipping address first, request carrier label, persist label URL + tracking ID, and transition order to `shipped`
|
|
63
50
|
|
|
64
51
|
### 4. Implement Vietnamese Carrier Tracking (Webhook Callbacks)
|
|
52
|
+
- integrate **GHN** (`ready_to_pick`/`delivering`/`delivered` + COD webhook), **GHTK** (G1 Open API), **GrabExpress**, **Viettel Post**, **J&T Express** via webhooks over polling
|
|
53
|
+
- verify HMAC signatures + carrier IP allowlists; normalize codes to `label_created` → `picked_up` → `in_transit` → `out_for_delivery` → `exception` / `delivered`
|
|
65
54
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
**Viettel Post**: government-backed, nationwide coverage
|
|
70
|
-
**J&T Express**: regional Southeast Asia coverage
|
|
71
|
-
|
|
72
|
-
- **Webhook callbacks OVER polling** for all carriers
|
|
73
|
-
- **Normalize carrier codes** to unified milestones: `label_created` → `picked_up` → `in_transit` → `out_for_delivery` → `exception` / `delivered`
|
|
74
|
-
- verify webhook signatures (HMAC) and carrier allowlist to prevent spoofing
|
|
75
|
-
|
|
76
|
-
### 5. Implement Refund and Returns
|
|
77
|
-
|
|
78
|
-
- create a `ReturnRequest` with reason, items, and quantity
|
|
79
|
-
- validate return eligibility: within return window, original order in `completed` or `delivered` state
|
|
80
|
-
- on approval: initiate refund via `integrate-payment-gateway` using original transaction ID
|
|
81
|
-
- **Restock Inspection Gate**: `return_received` → `inspection_completed` (Grade A) → `restocked`; automatic restock on RMA creation FORBIDDEN
|
|
82
|
-
- emit a `refund_issued` event for accounting systems
|
|
83
|
-
|
|
84
|
-
### 6. Agent-Initiated Fulfillment Authorization
|
|
85
|
-
|
|
86
|
-
- verify agent JWT contains `fulfillment_authorized: true` claim
|
|
87
|
-
- claim must be cryptographically verified and scoped to specific order ID
|
|
88
|
-
- verify BEFORE inventory lock or allocation routines
|
|
89
|
-
- reject unauthorized agent fulfillment requests
|
|
90
|
-
|
|
91
|
-
### 7. Vietnam Decree 248/2026/ND-CP Compliance
|
|
55
|
+
### 5. Implement Refund, Returns & Restock Inspection Gate
|
|
56
|
+
- validate return eligibility (`delivered`/`completed`, within window) and refund via `integrate-payment-gateway`
|
|
57
|
+
- enforce `return_received` → `inspection_completed` (Grade A) → `restocked`; auto-restock on RMA creation is FORBIDDEN
|
|
92
58
|
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
- **Electronic ID Verification**: sellers and livestream sellers from Jan 1, 2027
|
|
59
|
+
### 6. Agent Authorization & Vietnam Decree 248/2026 Compliance
|
|
60
|
+
- verify `fulfillment_authorized: true` JWT claim scoped to `order_id` BEFORE allocating inventory
|
|
61
|
+
- enforce Decree 248/2026/ND-CP seller verification gate before `fulfillment_started`, affiliate disclosures, and electronic ID checks (from Jan 1, 2027)
|
|
97
62
|
|
|
98
63
|
## 2026 Fulfillment Architecture Patterns
|
|
99
64
|
|
|
@@ -193,5 +158,7 @@ Skip emission for single-order experiments that do not cross a role boundary.
|
|
|
193
158
|
- **add-event-handler**: Handle carrier tracking webhooks and order state events
|
|
194
159
|
- **add-api-endpoint**: Expose fulfillment status and return endpoints
|
|
195
160
|
- **incident-report**: Escalate lost packages, carrier failures, and refund disputes
|
|
161
|
+
- Companion reference: `references/event-sourced-fulfillment-and-carrier-webhooks.md`
|
|
162
|
+
- Companion example: `examples/temporal-fulfillment-saga.ts`
|
|
196
163
|
|
|
197
|
-
Last updated: 2026-
|
|
164
|
+
Last updated: 2026-11-08
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Production Temporal Fulfillment Saga Workflow
|
|
3
|
+
*
|
|
4
|
+
* Implements:
|
|
5
|
+
* - Orchestration-based Saga with explicit compensating activities
|
|
6
|
+
* - Reverse compensation order (Shipping -> Inventory -> Payment)
|
|
7
|
+
* - Deterministic event generation for event-sourced projections
|
|
8
|
+
* - Vietnamese carrier label generation (GHN integration)
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export interface FulfillmentSagaInput {
|
|
12
|
+
orderId: string;
|
|
13
|
+
customerId: string;
|
|
14
|
+
items: Array<{ sku: string; quantity: number }>;
|
|
15
|
+
shippingAddress: {
|
|
16
|
+
name: string;
|
|
17
|
+
phone: string;
|
|
18
|
+
address: string;
|
|
19
|
+
wardCode: string;
|
|
20
|
+
districtId: number;
|
|
21
|
+
};
|
|
22
|
+
totalAmountCents: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface InventoryAllocation {
|
|
26
|
+
allocationId: string;
|
|
27
|
+
orderId: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ShippingLabel {
|
|
31
|
+
trackingCode: string;
|
|
32
|
+
carrierOrderCode: string;
|
|
33
|
+
labelUrl: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Workflow Activities Contract
|
|
37
|
+
export interface FulfillmentActivities {
|
|
38
|
+
allocateInventory(orderId: string, items: Array<{ sku: string; quantity: number }>): Promise<InventoryAllocation>;
|
|
39
|
+
releaseInventory(allocationId: string): Promise<void>;
|
|
40
|
+
createGhnShippingOrder(input: FulfillmentSagaInput): Promise<ShippingLabel>;
|
|
41
|
+
cancelGhnShippingOrder(carrierOrderCode: string): Promise<void>;
|
|
42
|
+
capturePayment(orderId: string, amountCents: number): Promise<{ paymentId: string }>;
|
|
43
|
+
refundPayment(paymentId: string, reason: string): Promise<void>;
|
|
44
|
+
recordOrderEvent(orderId: string, eventType: string, payload: Record<string, unknown>): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export async function fulfillmentSagaWorkflow(
|
|
48
|
+
input: FulfillmentSagaInput,
|
|
49
|
+
activities: FulfillmentActivities
|
|
50
|
+
): Promise<{ status: 'fulfilled' | 'compensated'; trackingCode?: string; error?: string }> {
|
|
51
|
+
const compensations: Array<() => Promise<void>> = [];
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
// Step 1: Capture Payment (or verify prior capture)
|
|
55
|
+
await activities.recordOrderEvent(input.orderId, 'order_placed', { total: input.totalAmountCents });
|
|
56
|
+
const payment = await activities.capturePayment(input.orderId, input.totalAmountCents);
|
|
57
|
+
compensations.push(async () => {
|
|
58
|
+
await activities.refundPayment(payment.paymentId, 'Fulfillment saga failure compensation');
|
|
59
|
+
await activities.recordOrderEvent(input.orderId, 'payment_refunded', { paymentId: payment.paymentId });
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Step 2: Allocate Inventory
|
|
63
|
+
const allocation = await activities.allocateInventory(input.orderId, input.items);
|
|
64
|
+
compensations.push(async () => {
|
|
65
|
+
await activities.releaseInventory(allocation.allocationId);
|
|
66
|
+
await activities.recordOrderEvent(input.orderId, 'inventory_released', { allocationId: allocation.allocationId });
|
|
67
|
+
});
|
|
68
|
+
await activities.recordOrderEvent(input.orderId, 'inventory_allocated', { allocationId: allocation.allocationId });
|
|
69
|
+
|
|
70
|
+
// Step 3: Generate Vietnamese Carrier Label (GHN)
|
|
71
|
+
const shippingLabel = await activities.createGhnShippingOrder(input);
|
|
72
|
+
compensations.push(async () => {
|
|
73
|
+
await activities.cancelGhnShippingOrder(shippingLabel.carrierOrderCode);
|
|
74
|
+
await activities.recordOrderEvent(input.orderId, 'shipping_cancelled', { code: shippingLabel.carrierOrderCode });
|
|
75
|
+
});
|
|
76
|
+
await activities.recordOrderEvent(input.orderId, 'carrier_dispatched', {
|
|
77
|
+
carrier: 'GHN',
|
|
78
|
+
trackingCode: shippingLabel.trackingCode,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
status: 'fulfilled',
|
|
83
|
+
trackingCode: shippingLabel.trackingCode,
|
|
84
|
+
};
|
|
85
|
+
} catch (err: unknown) {
|
|
86
|
+
const errorMsg = err instanceof Error ? err.message : 'Unknown fulfillment failure';
|
|
87
|
+
await activities.recordOrderEvent(input.orderId, 'fulfillment_failed', { error: errorMsg });
|
|
88
|
+
|
|
89
|
+
// Execute compensations in strict reverse order
|
|
90
|
+
while (compensations.length > 0) {
|
|
91
|
+
const compensate = compensations.pop()!;
|
|
92
|
+
try {
|
|
93
|
+
await compensate();
|
|
94
|
+
} catch (compErr) {
|
|
95
|
+
console.error(`[CRITICAL] Compensation failed during rollback for ${input.orderId}:`, compErr);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
status: 'compensated',
|
|
101
|
+
error: errorMsg,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Event-Sourced Order Fulfillment & Carrier Webhook Specifications (2026)
|
|
2
|
+
|
|
3
|
+
## 1. Event-Sourced Order State Machine
|
|
4
|
+
|
|
5
|
+
### 1.1 Append-Only Event Log Architecture
|
|
6
|
+
Direct mutable updates to order status (e.g., `UPDATE orders SET status = 'shipped'`) are strictly prohibited. Order state is modeled as an append-only stream of immutable events:
|
|
7
|
+
1. `order_placed`: Cart confirmed, preliminary reservation recorded.
|
|
8
|
+
2. `payment_captured`: Payment processor confirmed settlement.
|
|
9
|
+
3. `inventory_allocated`: Hard decrement on warehouse bins.
|
|
10
|
+
4. `fulfillment_started`: Picking list generated and dispatched.
|
|
11
|
+
5. `packed`: Box sealed, dimensions and weight verified.
|
|
12
|
+
6. `carrier_dispatched`: Handed off to carrier courier with tracking ID.
|
|
13
|
+
7. `in_transit`: Scanned at regional carrier sorting hub.
|
|
14
|
+
8. `out_for_delivery`: Loaded onto last-mile vehicle.
|
|
15
|
+
9. `delivery_confirmed`: Signed proof of delivery (POD) recorded.
|
|
16
|
+
10. `return_initiated` / `inspection_completed` / `restocked`: Controlled return lifecycle.
|
|
17
|
+
|
|
18
|
+
Current status is computed by applying a deterministic projection function over the event history:
|
|
19
|
+
$$\text{State}_N = \text{Fold}(\text{InitialState}, [E_1, E_2, \dots, E_N])$$
|
|
20
|
+
|
|
21
|
+
### 1.2 Warehouse Restock Inspection Gate
|
|
22
|
+
Returned merchandise must never be automatically restored to sellable inventory upon Return Merchandise Authorization (RMA) generation. The event stream requires:
|
|
23
|
+
$$\text{return\_received} \longrightarrow \text{inspection\_completed (Grade A confirmed)} \longrightarrow \text{restocked}$$
|
|
24
|
+
Merchandise graded below Grade A is routed to liquidation or refurbishment streams.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 2. Orchestration-Based Saga Architecture (Temporal)
|
|
29
|
+
|
|
30
|
+
### 2.1 Forward Actions & Compensations
|
|
31
|
+
Distributed e-commerce fulfillment requires an orchestrator managing compensating transactions in strict reverse order:
|
|
32
|
+
- **Activity 1**: `AllocateInventory` $\longleftrightarrow$ **Compensating Activity**: `ReleaseInventoryAllocation`
|
|
33
|
+
- **Activity 2**: `GenerateCarrierLabel` $\longleftrightarrow$ **Compensating Activity**: `VoidCarrierLabel`
|
|
34
|
+
- **Activity 3**: `CapturePayment` $\longleftrightarrow$ **Compensating Activity**: `IssueStripeRefund`
|
|
35
|
+
|
|
36
|
+
If `GenerateCarrierLabel` encounters an unrecoverable routing error (e.g., remote province embargo), the Saga triggers compensations in reverse:
|
|
37
|
+
1. `VoidCarrierLabel` (if partially allocated).
|
|
38
|
+
2. `ReleaseInventoryAllocation` (restores stock immediately).
|
|
39
|
+
3. `IssueStripeRefund` (credits customer card).
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 3. Vietnamese Last-Mile Carrier Webhook Normalization
|
|
44
|
+
|
|
45
|
+
Carrier webhooks must be verified via HMAC signatures and mapped to normalized internal status milestones:
|
|
46
|
+
|
|
47
|
+
| Carrier | Raw Status Code | Normalized Milestone |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| **GHN** | `ready_to_pick` | `label_created` |
|
|
50
|
+
| **GHN** | `delivering` | `in_transit` |
|
|
51
|
+
| **GHN** | `delivered` | `delivery_confirmed` |
|
|
52
|
+
| **GHTK (G1)** | `1` (Chưa tiếp nhận) | `label_created` |
|
|
53
|
+
| **GHTK (G1)** | `3` (Đang lấy hàng) | `picked_up` |
|
|
54
|
+
| **GHTK (G1)** | `5` (Đang giao hàng) | `out_for_delivery` |
|
|
55
|
+
| **GHTK (G1)** | `6` (Đã giao hàng) | `delivery_confirmed` |
|
|
56
|
+
| **GrabExpress** | `ALLOCATING` | `label_created` |
|
|
57
|
+
| **GrabExpress** | `PICKED_UP` | `picked_up` |
|
|
58
|
+
| **GrabExpress** | `COMPLETED` | `delivery_confirmed` |
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: manage-product-catalog
|
|
3
3
|
description: Build or maintain a product catalog including product creation, variant management (size, color, SKU), pricing, and inventory synchronization across channels. Use when adding, updating, or structuring product data in an e-commerce system.
|
|
4
|
+
version: "1.0.0"
|
|
4
5
|
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, fetch]
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -45,6 +46,7 @@ When the catalog change is consumed by a storefront, a marketplace sync, or a do
|
|
|
45
46
|
|
|
46
47
|
- **`contracts/schemas/api-contract-spec.json`** describing the catalog entity shape, variant structure, inventory model, vector search endpoints, content governance review workflows, and seller verification gates.
|
|
47
48
|
- **`contracts/schemas/data-pipeline-spec.json`** for Kafka event-sourced inventory adjustments, CDC feeds, knowledge graph ETL, and downstream consumer contracts.
|
|
49
|
+
- **`contracts/schemas/schema-migration.json`** when product, SKU, variant, or inventory schema tables evolve.
|
|
48
50
|
- **`contracts/schemas/deployment-plan.json`** when the catalog change is part of a coordinated multi-role rollout.
|
|
49
51
|
- For human-readable reports, a markdown diff of the affected SKUs and the rationale.
|
|
50
52
|
|
|
@@ -180,5 +182,7 @@ Clarify before building:
|
|
|
180
182
|
- **build-data-pipeline**: Synchronize product data from ERP, supplier feeds, or PIM systems
|
|
181
183
|
- **add-api-endpoint**: Expose catalog CRUD endpoints for admin and storefront consumers
|
|
182
184
|
- **database-maintenance**: Maintain catalog indexes and handle bulk data operations
|
|
185
|
+
- Companion reference: `references/semantic-vector-catalog-and-graphrag.md`
|
|
186
|
+
- Companion example: `examples/hybrid-search-and-governance-pipeline.ts`
|
|
183
187
|
|
|
184
|
-
Last updated: 2026-
|
|
188
|
+
Last updated: 2026-11-08
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hybrid Search (RRF) & AI Content Governance Pipeline
|
|
3
|
+
*
|
|
4
|
+
* Implements:
|
|
5
|
+
* - Reciprocal Rank Fusion (RRF) combining BM25 keyword ranking and pgvector dense cosine search
|
|
6
|
+
* - Human-in-the-Loop AI content governance review gate
|
|
7
|
+
* - Brand voice linter detecting disallowed claims prior to publishing
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export interface ProductCatalogItem {
|
|
11
|
+
id: string;
|
|
12
|
+
sku: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
status: 'draft' | 'pending_review' | 'published';
|
|
16
|
+
embedding: number[];
|
|
17
|
+
governanceMetadata?: {
|
|
18
|
+
model: string;
|
|
19
|
+
promptHash: string;
|
|
20
|
+
reviewedBy?: string;
|
|
21
|
+
reviewedAt?: string;
|
|
22
|
+
bannedWordsPassed: boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SearchResult {
|
|
27
|
+
productId: string;
|
|
28
|
+
title: string;
|
|
29
|
+
score: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class HybridSearchPipeline {
|
|
33
|
+
private readonly RRF_K = 60;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Computes Reciprocal Rank Fusion across BM25 and Dense Vector ranking lists.
|
|
37
|
+
*/
|
|
38
|
+
public computeRrf(
|
|
39
|
+
bm25RankedIds: string[],
|
|
40
|
+
denseRankedIds: string[]
|
|
41
|
+
): Array<{ productId: string; rrfScore: number }> {
|
|
42
|
+
const scores = new Map<string, number>();
|
|
43
|
+
|
|
44
|
+
// Accumulate BM25 reciprocal ranks
|
|
45
|
+
bm25RankedIds.forEach((id, rankIndex) => {
|
|
46
|
+
const rank = rankIndex + 1;
|
|
47
|
+
const current = scores.get(id) || 0;
|
|
48
|
+
scores.set(id, current + 1 / (this.RRF_K + rank));
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Accumulate Dense Vector reciprocal ranks
|
|
52
|
+
denseRankedIds.forEach((id, rankIndex) => {
|
|
53
|
+
const rank = rankIndex + 1;
|
|
54
|
+
const current = scores.get(id) || 0;
|
|
55
|
+
scores.set(id, current + 1 / (this.RRF_K + rank));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Sort by combined RRF score descending
|
|
59
|
+
return Array.from(scores.entries())
|
|
60
|
+
.map(([productId, rrfScore]) => ({ productId, rrfScore }))
|
|
61
|
+
.sort((a, b) => b.rrfScore - a.rrfScore);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class ProductGovernanceEngine {
|
|
66
|
+
private readonly BANNED_TERMS = [
|
|
67
|
+
'miracle cure',
|
|
68
|
+
'guaranteed 100% profit',
|
|
69
|
+
'risk-free',
|
|
70
|
+
'FDA approved without clinical trial',
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Pre-review automated brand voice and regulatory linter.
|
|
75
|
+
*/
|
|
76
|
+
public lintProductCopy(description: string): { passed: boolean; violations: string[] } {
|
|
77
|
+
const violations: string[] = [];
|
|
78
|
+
const lower = description.toLowerCase();
|
|
79
|
+
|
|
80
|
+
for (const term of this.BANNED_TERMS) {
|
|
81
|
+
if (lower.includes(term)) {
|
|
82
|
+
violations.push(term);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
passed: violations.length === 0,
|
|
88
|
+
violations,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Approves transition from draft to published, enforcing mandatory human review.
|
|
94
|
+
*/
|
|
95
|
+
public approveForPublish(
|
|
96
|
+
item: ProductCatalogItem,
|
|
97
|
+
reviewerId: string
|
|
98
|
+
): ProductCatalogItem {
|
|
99
|
+
const lint = this.lintProductCopy(item.description);
|
|
100
|
+
if (!lint.passed) {
|
|
101
|
+
throw new Error(`Cannot publish product with regulatory violations: ${lint.violations.join(', ')}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!reviewerId || reviewerId.trim() === '') {
|
|
105
|
+
throw new Error('Mandatory human reviewer ID required before publishing AI content');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
...item,
|
|
110
|
+
status: 'published',
|
|
111
|
+
governanceMetadata: {
|
|
112
|
+
model: item.governanceMetadata?.model || 'manual',
|
|
113
|
+
promptHash: item.governanceMetadata?.promptHash || 'n/a',
|
|
114
|
+
reviewedBy: reviewerId,
|
|
115
|
+
reviewedAt: new Date().toISOString(),
|
|
116
|
+
bannedWordsPassed: true,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Semantic Vector Catalog & GraphRAG Governance Specifications (2026)
|
|
2
|
+
|
|
3
|
+
## 1. Hybrid Search Architecture & Reciprocal Rank Fusion (RRF)
|
|
4
|
+
|
|
5
|
+
### 1.1 Dense Vector Layer with pgvector HNSW
|
|
6
|
+
E-commerce catalogs in 2026 deploy hybrid retrieval combining sparse BM25 text search with dense semantic embeddings:
|
|
7
|
+
- **Embedding Generation**: Compute dense embeddings on product write/update using `text-embedding-3-large` (1536/3072 dimensions) or Cohere `embed-v4`.
|
|
8
|
+
- **pgvector Indexing**: Index dense vectors using Hierarchical Navigable Small World (HNSW) with production-calibrated hyperparameters:
|
|
9
|
+
```sql
|
|
10
|
+
CREATE INDEX idx_products_embedding ON products
|
|
11
|
+
USING hnsw (embedding vector_cosine_ops)
|
|
12
|
+
WITH (m = 16, ef_construction = 64);
|
|
13
|
+
```
|
|
14
|
+
- **Reciprocal Rank Fusion (RRF)**:
|
|
15
|
+
Merge sparse keyword ranks ($R_{\text{BM25}}$) and vector similarity ranks ($R_{\text{dense}}$) using constant $k = 60$:
|
|
16
|
+
$$\text{RRF Score}(d) = \frac{1}{60 + R_{\text{BM25}}(d)} + \frac{1}{60 + R_{\text{dense}}(d)}$$
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 2. AI Content Governance Pipeline (Human-in-the-Loop)
|
|
21
|
+
|
|
22
|
+
### 2.1 State Transition Enforcement
|
|
23
|
+
Autonomous LLM-generated product descriptions, titles, and variant attributes must never be set directly to `published`:
|
|
24
|
+
$$\text{Draft (AI Generated)} \xrightarrow{\text{Brand Voice Linter}} \text{Pending Review} \xrightarrow{\text{Human Gate Approved}} \text{Published}$$
|
|
25
|
+
|
|
26
|
+
### 2.2 Mandatory Provenance Metadata
|
|
27
|
+
Every catalog entity carries immutable provenance audit attributes:
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"generation_metadata": {
|
|
31
|
+
"generated_by_model": "gpt-4o-2026-08-06",
|
|
32
|
+
"prompt_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
33
|
+
"generated_at": "2026-11-08T09:00:00Z",
|
|
34
|
+
"banned_claims_check_passed": true,
|
|
35
|
+
"reviewed_by_user_id": "usr_compliance_lead_08",
|
|
36
|
+
"reviewed_at": "2026-11-08T09:30:00Z",
|
|
37
|
+
"approval_status": "APPROVED"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 3. Real-Time Inventory CDC & Event Sourcing
|
|
45
|
+
|
|
46
|
+
- **Debezium CDC**: Stream database inventory adjustments to Kafka / Cloudflare Queues with sub-second latency.
|
|
47
|
+
- **Safety Stock Deduction**: Deduct a virtual safety stock buffer (5% or minimum 3 units) before publishing available inventory to external channels (Shopee, Lazada, TikTok Shop, Amazon).
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 4. Knowledge Graph & GraphRAG Grounding
|
|
52
|
+
|
|
53
|
+
- **Graph Topology**: Model cross-sell relationships, bundles, compatibility constraints, and replacement components in Neo4j or Amazon Neptune.
|
|
54
|
+
- **Cited Recommendations**: Use LangChain `GraphCypherQAChain` to execute natural language queries against graph topology, enforcing explicit source node citations on all LLM recommendations.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: write-article
|
|
3
|
-
description: Plan, research, outline, and draft long-form articles and blog posts with explicit evidence discipline, answer-first structure, GEO/AEO execution, non-commodity
|
|
3
|
+
description: Plan, research, outline, and draft long-form articles and blog posts with explicit evidence discipline, answer-first structure, GEO/AEO execution, non-commodity quality gates, E-E-A-T experience signals, and SEO-brief alignment. Use when writing narrative long-form content, guides, reviews, or announcements—not for API runbooks or pure technical reference docs.
|
|
4
4
|
version: 2.0.0
|
|
5
5
|
allowed-tools: [read_file, write_file, edit_file, create_file, search_code]
|
|
6
6
|
---
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docx
|
|
3
3
|
description: "Use when creating, editing, inspecting, or formatting Microsoft Word (.docx) documents, enforcing DXA table column width invariants, raw XML unzipping workflows, or reading documents via pandoc markdown extraction."
|
|
4
|
+
version: "1.0.0"
|
|
4
5
|
allowed-tools: [read_file, write_file, edit_file, create_file, search_code]
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pdf
|
|
3
3
|
description: "Use when reading, extracting, creating, or modifying PDF documents, parsing text and tables via pdfplumber/pypdf, discovering and filling interactive AcroForms, performing OCR, or verifying digital signatures."
|
|
4
|
+
version: "1.0.0"
|
|
4
5
|
allowed-tools: [read_file, write_file, edit_file, create_file, search_code]
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -58,6 +59,7 @@ allowed-tools: [read_file, write_file, edit_file, create_file, search_code]
|
|
|
58
59
|
- **write-documentation**: Author technical specifications converted to executive PDF manuals.
|
|
59
60
|
- **release-notes**: Compiles release artifacts into customer-facing PDF documentation.
|
|
60
61
|
- **docx**: Converts source Word manuscripts into finalized PDF publications.
|
|
62
|
+
- Companion reference: `references/pdf-acroforms-and-pdfplumber-specs.md`
|
|
61
63
|
|
|
62
64
|
## Output Contracts
|
|
63
65
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# PDF AcroForms, pdfplumber & Form Extraction Specifications (2026)
|
|
2
|
+
|
|
3
|
+
## 1. Overview & Tooling Architecture
|
|
4
|
+
|
|
5
|
+
Automated PDF document processing enforces a deterministic tripartite extraction architecture:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Input PDF Document
|
|
9
|
+
│
|
|
10
|
+
┌───────────────┼───────────────┐
|
|
11
|
+
▼ ▼ ▼
|
|
12
|
+
Interactive Form? Native Text? Scanned Raster?
|
|
13
|
+
│ │ │
|
|
14
|
+
pypdf AcroForm pdfplumber Tesseract OCR
|
|
15
|
+
get_fields() API Cell Extractor Confidence Gate
|
|
16
|
+
│ │ │
|
|
17
|
+
└───────────────┼───────────────┘
|
|
18
|
+
▼
|
|
19
|
+
Document Manifest & Validation
|
|
20
|
+
(document-manifest.json)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 2. AcroForm Discovery & Population Invariants
|
|
24
|
+
|
|
25
|
+
1. **Discovery API**:
|
|
26
|
+
Use `pypdf.PdfReader.get_fields()`. Never parse raw PDF dictionary syntax with ad-hoc regex.
|
|
27
|
+
2. **Field Classification**:
|
|
28
|
+
Distinguish text fields (`/Tx`), choice fields (`/Ch`), checkboxes (`/Btn`), and signature blocks (`/Sig`).
|
|
29
|
+
3. **Form Filling Semantics**:
|
|
30
|
+
- Write using `PdfWriter.update_page_form_field_values()`.
|
|
31
|
+
- Set `/NeedAppearances` flag to `true` in `/AcroForm` catalog to force visual rendering across diverse PDF viewers.
|
|
32
|
+
- Flatten annotations when producing immutable archival PDF/A deliverables.
|
|
33
|
+
|
|
34
|
+
## 3. Tabular Data Extraction with `pdfplumber`
|
|
35
|
+
|
|
36
|
+
When parsing invoices, financial statements, and manifests:
|
|
37
|
+
- Extract bounding boxes using explicit horizontal and vertical line detection:
|
|
38
|
+
```python
|
|
39
|
+
table_settings = {
|
|
40
|
+
"vertical_strategy": "lines",
|
|
41
|
+
"horizontal_strategy": "lines",
|
|
42
|
+
"snap_tolerance": 3,
|
|
43
|
+
"join_tolerance": 3,
|
|
44
|
+
}
|
|
45
|
+
tables = page.extract_tables(table_settings)
|
|
46
|
+
```
|
|
47
|
+
- Normalize column alignment, strip leading/trailing whitespace, and preserve multiline cell wraps.
|
|
48
|
+
|
|
49
|
+
## 4. Visual Verification Gate
|
|
50
|
+
|
|
51
|
+
Before committing generated PDFs:
|
|
52
|
+
1. Render pages to high-resolution PNGs: `pdftoppm -png -r 150 document.pdf page_preview`.
|
|
53
|
+
2. Inspect for visual defects, truncated table cells, text overflows, and missing font subsets.
|
|
54
|
+
3. Verify signature vector presence: $w \ge 100\text{px}, h \ge 50\text{px}$.
|