@vesviet/agent-skills 0.0.0-stage → 5.6.1
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 +973 -0
- package/LICENSE +201 -0
- package/README.md +137 -2
- package/VERSION +1 -0
- package/adapters/antigravity/ANTIGRAVITY.md +136 -0
- package/adapters/antigravity/a2a-config.template.yaml +82 -0
- package/adapters/antigravity/capability-role-map.generated.yaml +41 -0
- package/adapters/antigravity/role-skill-index.json +4812 -0
- package/adapters/antigravity/rules.template.md +39 -0
- package/adapters/claude/CLAUDE_ADAPTER.md +271 -0
- package/adapters/claude/commands/check-policy.md +15 -0
- package/adapters/claude/commands/coordinate.md +17 -0
- package/adapters/claude/commands/review.md +17 -0
- package/adapters/claude/settings.template.json +36 -0
- package/adapters/cursor/README.md +186 -0
- package/adapters/cursor/hooks.template.json +71 -0
- package/bin/agent-skills.mjs +244 -0
- package/core/contracts/README.md +158 -0
- package/core/contracts/schemas/INDEX.md +227 -0
- package/core/contracts/schemas/a2a-artifact.json +171 -0
- package/core/contracts/schemas/a2a-jsonrpc-envelope.json +74 -0
- package/core/contracts/schemas/a2a-message.json +107 -0
- package/core/contracts/schemas/a2a-push-notification-config.json +57 -0
- package/core/contracts/schemas/a2a-task-cancel.json +36 -0
- package/core/contracts/schemas/a2a-task-progress.json +80 -0
- package/core/contracts/schemas/a2a-task-status.json +181 -0
- package/core/contracts/schemas/a2a-task.json +219 -0
- package/core/contracts/schemas/accounting-compliance-review.json +379 -0
- package/core/contracts/schemas/adr-spec.json +225 -0
- package/core/contracts/schemas/agent-card.json +382 -0
- package/core/contracts/schemas/agent-eval-report.json +490 -0
- package/core/contracts/schemas/agent-trace-span.json +146 -0
- package/core/contracts/schemas/ai-risk-register.json +198 -0
- package/core/contracts/schemas/amis-voucher-contract.json +541 -0
- package/core/contracts/schemas/api-contract-spec.json +191 -0
- package/core/contracts/schemas/architecture-options.json +128 -0
- package/core/contracts/schemas/assumptions-ledger.json +130 -0
- package/core/contracts/schemas/aws-infra-spec.json +248 -0
- package/core/contracts/schemas/code-review-finding.json +295 -0
- package/core/contracts/schemas/compact-working-state.json +282 -0
- package/core/contracts/schemas/content-audit-report.json +270 -0
- package/core/contracts/schemas/content-handoff.json +534 -0
- package/core/contracts/schemas/coordination-plan.json +530 -0
- package/core/contracts/schemas/data-analysis-report.json +492 -0
- package/core/contracts/schemas/data-pipeline-spec.json +420 -0
- package/core/contracts/schemas/deployment-plan.json +600 -0
- package/core/contracts/schemas/design-tokens-spec.json +539 -0
- package/core/contracts/schemas/document-manifest.json +155 -0
- package/core/contracts/schemas/documentation-handoff.json +137 -0
- package/core/contracts/schemas/edge-deployment-spec.json +375 -0
- package/core/contracts/schemas/feature-ticket.json +1293 -0
- package/core/contracts/schemas/implementation-result.json +165 -0
- package/core/contracts/schemas/incident-report.json +466 -0
- package/core/contracts/schemas/learning-assessment-report.json +285 -0
- package/core/contracts/schemas/learning-handoff.json +244 -0
- package/core/contracts/schemas/legal-compliance-review.json +287 -0
- package/core/contracts/schemas/legal-opinion-contract.json +248 -0
- package/core/contracts/schemas/memory-audit-report.json +283 -0
- package/core/contracts/schemas/mmo-campaign-spec.json +414 -0
- package/core/contracts/schemas/mmo-roi-report.json +312 -0
- package/core/contracts/schemas/performance-audit.json +239 -0
- package/core/contracts/schemas/period-end-closing-report.json +472 -0
- package/core/contracts/schemas/pull-request-spec.json +338 -0
- package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -0
- package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -0
- package/core/contracts/schemas/references/detailed/03-quality-and-review.md +67 -0
- package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -0
- package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -0
- package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -0
- package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -0
- package/core/contracts/schemas/references/detailed/08-agent-infrastructure.md +31 -0
- package/core/contracts/schemas/research-report.json +823 -0
- package/core/contracts/schemas/schema-migration.json +86 -0
- package/core/contracts/schemas/security-audit.json +131 -0
- package/core/contracts/schemas/seo-audit-report.json +1057 -0
- package/core/contracts/schemas/seo-content-brief.json +852 -0
- package/core/contracts/schemas/seo-metadata.json +292 -0
- package/core/contracts/schemas/seo-weekly-board.json +840 -0
- package/core/contracts/schemas/series-article.json +155 -0
- package/core/contracts/schemas/solution-brief.json +244 -0
- package/core/contracts/schemas/stock-audit-session.json +522 -0
- package/core/contracts/schemas/system-design-spec.json +434 -0
- package/core/contracts/schemas/technical-delivery-plan.json +453 -0
- package/core/contracts/schemas/test-report.json +530 -0
- package/core/contracts/schemas/ui-component-spec.json +314 -0
- package/core/contracts/schemas/ux-flow-spec.json +306 -0
- package/core/contracts/schemas/validation-result.json +109 -0
- package/core/policies/README.md +110 -0
- package/core/policies/action-boundaries.yaml +1492 -0
- package/core/policies/data-classification.yaml +126 -0
- package/core/policies/execution-sandbox.md +362 -0
- package/core/policies/mcp-tool-map.yaml +302 -0
- package/core/roles/3d-graphics-engineer.md +303 -0
- package/core/roles/README.md +314 -0
- package/core/roles/agent-coordinator.md +453 -0
- package/core/roles/agent-discovery-engineer.md +243 -0
- package/core/roles/ai-systems-engineer.md +365 -0
- package/core/roles/aws-engineer.md +339 -0
- package/core/roles/backend-developer.md +466 -0
- package/core/roles/business-analyst.md +402 -0
- package/core/roles/cloudflare-engineer.md +298 -0
- package/core/roles/content-manager.md +336 -0
- package/core/roles/content-writer.md +399 -0
- package/core/roles/data-analyst.md +421 -0
- package/core/roles/data-engineer.md +439 -0
- package/core/roles/devops-engineer.md +614 -0
- package/core/roles/ecommerce-engineer.md +274 -0
- package/core/roles/frontend-developer.md +414 -0
- package/core/roles/game-developer.md +213 -0
- package/core/roles/mmo-engineer.md +228 -0
- package/core/roles/mobile-engineer.md +485 -0
- package/core/roles/product-manager.md +382 -0
- package/core/roles/project-manager.md +279 -0
- package/core/roles/prompt-engineer.md +197 -0
- package/core/roles/qa-engineer.md +574 -0
- package/core/roles/references/3d-graphics-engineer-review-checklist.md +116 -0
- package/core/roles/references/agent-coordinator-review-checklist.md +165 -0
- package/core/roles/references/agent-discovery-engineer-review-checklist.md +125 -0
- package/core/roles/references/ai-systems-engineer-review-checklist.md +151 -0
- package/core/roles/references/aws-engineer-review-checklist.md +169 -0
- package/core/roles/references/backend-developer-review-checklist.md +105 -0
- package/core/roles/references/business-analyst-responsibilities.md +207 -0
- package/core/roles/references/business-analyst-review-checklist.md +228 -0
- package/core/roles/references/cloudflare-engineer-review-checklist.md +152 -0
- package/core/roles/references/content-manager-governance-standards.md +147 -0
- package/core/roles/references/content-manager-review-checklist.md +68 -0
- package/core/roles/references/content-writer-anti-ai-standards.md +199 -0
- package/core/roles/references/content-writer-review-checklist.md +58 -0
- package/core/roles/references/data-analyst-review-checklist.md +76 -0
- package/core/roles/references/data-engineer-review-checklist.md +77 -0
- package/core/roles/references/devops-engineer-review-checklist.md +195 -0
- package/core/roles/references/ecommerce-engineer-review-checklist.md +129 -0
- package/core/roles/references/frontend-developer-responsibilities.md +275 -0
- package/core/roles/references/frontend-developer-review-checklist.md +122 -0
- package/core/roles/references/game-developer-review-checklist.md +115 -0
- package/core/roles/references/mmo-engineer-review-checklist.md +125 -0
- package/core/roles/references/mobile-engineer-review-checklist.md +54 -0
- package/core/roles/references/product-manager-review-checklist.md +113 -0
- package/core/roles/references/project-manager-review-checklist.md +122 -0
- package/core/roles/references/prompt-engineer-review-checklist.md +70 -0
- package/core/roles/references/qa-engineer-review-checklist.md +190 -0
- package/core/roles/references/researcher-review-checklist.md +176 -0
- package/core/roles/references/reviewer-review-checklist.md +67 -0
- package/core/roles/references/sdet-review-checklist.md +66 -0
- package/core/roles/references/security-engineer-review-checklist.md +122 -0
- package/core/roles/references/seo-analyst-geo-standards.md +195 -0
- package/core/roles/references/seo-analyst-review-checklist.md +84 -0
- package/core/roles/references/solution-architect-review-checklist.md +71 -0
- package/core/roles/references/sre-review-checklist.md +35 -0
- package/core/roles/references/system-engineer-review-checklist.md +124 -0
- package/core/roles/references/task-planner-review-checklist.md +114 -0
- package/core/roles/references/teacher-review-checklist.md +47 -0
- package/core/roles/references/technical-architect-review-checklist.md +72 -0
- package/core/roles/references/technical-lead-review-checklist.md +57 -0
- package/core/roles/references/technical-writer-review-checklist.md +120 -0
- package/core/roles/references/ui-ux-designer-anti-slop-standards.md +1000 -0
- package/core/roles/references/ui-ux-designer-responsibilities.md +250 -0
- package/core/roles/references/ui-ux-designer-review-checklist.md +114 -0
- package/core/roles/references/vietnam-accounting-specialist-review-checklist.md +53 -0
- package/core/roles/references/vietnam-legal-counsel-review-checklist.md +31 -0
- package/core/roles/researcher.md +427 -0
- package/core/roles/reviewer.md +294 -0
- package/core/roles/role-standard.md +242 -0
- package/core/roles/sdet.md +198 -0
- package/core/roles/security-engineer.md +343 -0
- package/core/roles/seo-analyst.md +425 -0
- package/core/roles/solution-architect.md +523 -0
- package/core/roles/sre.md +260 -0
- package/core/roles/system-engineer.md +465 -0
- package/core/roles/task-planner.md +277 -0
- package/core/roles/teacher.md +298 -0
- package/core/roles/technical-architect.md +536 -0
- package/core/roles/technical-lead.md +367 -0
- package/core/roles/technical-writer.md +359 -0
- package/core/roles/ui-ux-designer.md +397 -0
- package/core/roles/vietnam-accounting-specialist.md +317 -0
- package/core/roles/vietnam-legal-counsel.md +306 -0
- package/core/rules/README.md +101 -0
- package/core/rules/code.md +46 -0
- package/core/rules/knowledge.md +69 -0
- package/core/skills/README.md +440 -0
- package/core/skills/agent/INDEX.json +396 -0
- package/core/skills/agent/agent-a2a-protocol/SKILL.md +189 -0
- package/core/skills/agent/agent-a2a-protocol/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-a2a-protocol/references/a2a-spec.md +60 -0
- package/core/skills/agent/agent-context-management/SKILL.md +187 -0
- package/core/skills/agent/agent-context-management/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-delegation/SKILL.md +168 -0
- package/core/skills/agent/agent-delegation/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-graph-orchestration/SKILL.md +172 -0
- package/core/skills/agent/agent-graph-orchestration/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-handoff/SKILL.md +156 -0
- package/core/skills/agent/agent-handoff/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-memory-compaction/SKILL.md +112 -0
- package/core/skills/agent/agent-memory-compaction/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -0
- package/core/skills/agent/agent-model-routing/SKILL.md +175 -0
- package/core/skills/agent/agent-model-routing/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-observability/SKILL.md +168 -0
- package/core/skills/agent/agent-observability/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-panel-meeting/SKILL.md +153 -0
- package/core/skills/agent/agent-panel-meeting/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-prompt-lifecycle/SKILL.md +191 -0
- package/core/skills/agent/agent-prompt-lifecycle/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-prompt-lifecycle/references/output-format.md +32 -0
- package/core/skills/agent/agent-quality-gate/SKILL.md +174 -0
- package/core/skills/agent/agent-quality-gate/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-semantic-memory/SKILL.md +164 -0
- package/core/skills/agent/agent-semantic-memory/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-tool-orchestration/SKILL.md +193 -0
- package/core/skills/agent/agent-tool-orchestration/agents/openai.yaml +4 -0
- package/core/skills/agent/agent-tool-orchestration/references/2026-patterns.md +67 -0
- package/core/skills/agent/architect-mcp-server/SKILL.md +87 -0
- package/core/skills/agent/architect-mcp-server/agents/openai.yaml +4 -0
- package/core/skills/agent/architect-mcp-server/references/enterprise-mcp-server-architecture.md +217 -0
- package/core/skills/agent/configure-agent-commerce/SKILL.md +172 -0
- package/core/skills/agent/configure-agent-commerce/agents/openai.yaml +4 -0
- package/core/skills/agent/configure-agent-headers/SKILL.md +102 -0
- package/core/skills/agent/configure-agent-headers/agents/openai.yaml +4 -0
- package/core/skills/agent/configure-agent-skills/SKILL.md +108 -0
- package/core/skills/agent/configure-agent-skills/agents/openai.yaml +4 -0
- package/core/skills/agent/configure-mcp/SKILL.md +193 -0
- package/core/skills/agent/configure-mcp/agents/openai.yaml +4 -0
- package/core/skills/agent/configure-mcp/references/2026-07-28-migration.md +60 -0
- package/core/skills/agent/configure-oauth-metadata/SKILL.md +139 -0
- package/core/skills/agent/configure-oauth-metadata/agents/openai.yaml +4 -0
- package/core/skills/agent/debug-identity-provider/SKILL.md +109 -0
- package/core/skills/agent/debug-identity-provider/agents/openai.yaml +4 -0
- package/core/skills/agent/decompose-agentic-system/SKILL.md +88 -0
- package/core/skills/agent/decompose-agentic-system/agents/openai.yaml +4 -0
- package/core/skills/agent/decompose-agentic-system/references/recursive-decomposition-and-persistent-planning.md +200 -0
- package/core/skills/agent/manage-agent-identity/SKILL.md +187 -0
- package/core/skills/agent/manage-agent-identity/agents/openai.yaml +4 -0
- package/core/skills/agent/manage-api-catalog/SKILL.md +133 -0
- package/core/skills/agent/manage-api-catalog/agents/openai.yaml +4 -0
- package/core/skills/agent/manage-auth-md/SKILL.md +119 -0
- package/core/skills/agent/manage-auth-md/agents/openai.yaml +4 -0
- package/core/skills/ai/deploy-vllm-inference/SKILL.md +163 -0
- package/core/skills/ai/deploy-vllm-inference/agents/openai.yaml +4 -0
- package/core/skills/ai/deploy-vllm-inference/references/vllm-production-guide.md +466 -0
- package/core/skills/ai-agent/agent-evaluation/SKILL.md +102 -0
- package/core/skills/ai-agent/context-optimization/SKILL.md +97 -0
- package/core/skills/ai-agent/memory-hygiene/SKILL.md +112 -0
- package/core/skills/backend/add-api-endpoint/SKILL.md +102 -0
- package/core/skills/backend/add-api-endpoint/agents/openai.yaml +4 -0
- package/core/skills/backend/add-api-endpoint/references/api-contracts-and-error-specs.md +127 -0
- package/core/skills/backend/add-event-handler/SKILL.md +130 -0
- package/core/skills/backend/add-event-handler/agents/openai.yaml +4 -0
- package/core/skills/backend/add-service-client/SKILL.md +166 -0
- package/core/skills/backend/add-service-client/agents/openai.yaml +4 -0
- package/core/skills/backend/build-mcp-server/SKILL.md +100 -0
- package/core/skills/backend/build-mcp-server/agents/openai.yaml +4 -0
- package/core/skills/backend/implement-auth/SKILL.md +90 -0
- package/core/skills/backend/implement-auth/agents/openai.yaml +4 -0
- package/core/skills/backend/implement-auth/references/auth-flows-and-session-specs.md +229 -0
- package/core/skills/backend/implement-structured-outputs/SKILL.md +94 -0
- package/core/skills/backend/implement-structured-outputs/agents/openai.yaml +4 -0
- package/core/skills/backend/optimize-postgres/SKILL.md +89 -0
- package/core/skills/backend/optimize-postgres/agents/openai.yaml +4 -0
- package/core/skills/backend/optimize-postgres/references/pooling-branching-and-tuning.md +218 -0
- package/core/skills/backend/scaffold-new-service/SKILL.md +97 -0
- package/core/skills/backend/scaffold-new-service/agents/openai.yaml +4 -0
- package/core/skills/backend/scaffold-new-service/references/service-scaffolding-guide.md +141 -0
- package/core/skills/business/elicit-requirements/SKILL.md +102 -0
- package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -0
- package/core/skills/business/trace-requirements-impact/SKILL.md +97 -0
- package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -0
- package/core/skills/business/write-use-cases/SKILL.md +106 -0
- package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -0
- package/core/skills/commerce/2026_STANDARDS_SUMMARY.md +316 -0
- package/core/skills/commerce/INDEX.json +72 -0
- package/core/skills/commerce/handle-checkout-flow/SKILL.md +192 -0
- package/core/skills/commerce/handle-checkout-flow/UPGRADE_PLAN_2026.md +99 -0
- package/core/skills/commerce/handle-checkout-flow/agents/openai.yaml +4 -0
- package/core/skills/commerce/integrate-payment-gateway/SKILL.md +187 -0
- package/core/skills/commerce/integrate-payment-gateway/UPGRADE_PLAN_2026.md +128 -0
- package/core/skills/commerce/integrate-payment-gateway/agents/openai.yaml +4 -0
- package/core/skills/commerce/manage-order-fulfillment/SKILL.md +197 -0
- package/core/skills/commerce/manage-order-fulfillment/UPGRADE_PLAN_2026.md +136 -0
- package/core/skills/commerce/manage-order-fulfillment/agents/openai.yaml +4 -0
- package/core/skills/commerce/manage-product-catalog/SKILL.md +189 -0
- package/core/skills/commerce/manage-product-catalog/UPGRADE_PLAN_2026.md +130 -0
- package/core/skills/commerce/manage-product-catalog/agents/openai.yaml +4 -0
- package/core/skills/content/audit-content/SKILL.md +120 -0
- package/core/skills/content/audit-content/agents/openai.yaml +4 -0
- package/core/skills/content/audit-content/references/ai-semantic-flaw-rubric.md +43 -0
- package/core/skills/content/audit-content/references/citation-verification-guide.md +39 -0
- package/core/skills/content/audit-content/references/information-gain-rubric.md +51 -0
- package/core/skills/content/design-content-strategy/SKILL.md +108 -0
- package/core/skills/content/design-content-strategy/agents/openai.yaml +4 -0
- package/core/skills/content/design-content-strategy/references/distribution-loops-and-drift-prevention.md +109 -0
- package/core/skills/content/design-content-strategy/references/information-gain-and-decay-triage.md +149 -0
- package/core/skills/content/design-content-strategy/references/pillar-cluster-and-funnel-playbook.md +159 -0
- package/core/skills/content/optimize-seo/SKILL.md +179 -0
- package/core/skills/content/optimize-seo/agents/openai.yaml +4 -0
- package/core/skills/content/optimize-seo/references/entity-salience-and-schema.md +88 -0
- package/core/skills/content/optimize-seo/references/geo-ai-citation-playbook.md +42 -0
- package/core/skills/content/optimize-seo/references/process-and-checklist.md +116 -0
- package/core/skills/content/repurpose-content/SKILL.md +150 -0
- package/core/skills/content/repurpose-content/agents/openai.yaml +4 -0
- package/core/skills/content/repurpose-content/references/channel-repurposing-playbook.md +96 -0
- package/core/skills/content/repurpose-content/references/entity-fidelity-guide.md +42 -0
- package/core/skills/content/write-article/SKILL.md +169 -0
- package/core/skills/content/write-article/agents/openai.yaml +4 -0
- package/core/skills/content/write-article/references/ai-drafting-playbook.md +141 -0
- package/core/skills/content/write-article/references/anti-ai-style-guide.md +52 -0
- package/core/skills/content/write-article/references/authentic-source-matrix.md +36 -0
- package/core/skills/content/write-article/references/suggested-process.md +61 -0
- package/core/skills/content/write-copy/SKILL.md +102 -0
- package/core/skills/content/write-copy/agents/openai.yaml +4 -0
- package/core/skills/content/write-copy/references/behavioral-psychology-and-conversion.md +147 -0
- package/core/skills/content/write-copy/references/copywriting-frameworks-playbook.md +250 -0
- package/core/skills/content/write-copy/references/humanizer-voice-and-cadence-guide.md +134 -0
- package/core/skills/document/docx/SKILL.md +64 -0
- package/core/skills/document/pdf/SKILL.md +65 -0
- package/core/skills/document/pptx/SKILL.md +67 -0
- package/core/skills/document/pptx/scripts/add_slide.py +91 -0
- package/core/skills/document/pptx/scripts/clean.py +84 -0
- package/core/skills/document/pptx/scripts/thumbnail.py +112 -0
- package/core/skills/document/xlsx/SKILL.md +65 -0
- package/core/skills/document/xlsx/scripts/recalc.py +388 -0
- package/core/skills/documentation/configure-llms-txt/SKILL.md +170 -0
- package/core/skills/documentation/configure-llms-txt/agents/openai.yaml +4 -0
- package/core/skills/documentation/write-documentation/SKILL.md +143 -0
- package/core/skills/documentation/write-documentation/agents/openai.yaml +4 -0
- package/core/skills/documentation/write-tech-radar/SKILL.md +149 -0
- package/core/skills/documentation/write-tech-radar/agents/openai.yaml +4 -0
- package/core/skills/education/2026_STANDARDS_SUMMARY.md +290 -0
- package/core/skills/education/INDEX.json +44 -0
- package/core/skills/education/create-exercises/SKILL.md +98 -0
- package/core/skills/education/create-exercises/UPGRADE_PLAN_2026.md +115 -0
- package/core/skills/education/create-exercises/agents/openai.yaml +4 -0
- package/core/skills/education/create-exercises/references/dok-and-ai-resistant-exercise-design.md +115 -0
- package/core/skills/education/create-exercises/references/irt-calibration-and-scoring-matrices.md +113 -0
- package/core/skills/education/design-learning-plan/SKILL.md +109 -0
- package/core/skills/education/design-learning-plan/UPGRADE_PLAN_2026.md +140 -0
- package/core/skills/education/design-learning-plan/agents/openai.yaml +4 -0
- package/core/skills/education/design-learning-plan/references/spaced-scheduling-and-socratic-scaffolding.md +117 -0
- package/core/skills/education/design-learning-plan/references/zpd-pathways-and-smart-objectives.md +108 -0
- package/core/skills/education/grade-and-review/SKILL.md +104 -0
- package/core/skills/education/grade-and-review/UPGRADE_PLAN_2026.md +141 -0
- package/core/skills/education/grade-and-review/agents/openai.yaml +4 -0
- package/core/skills/education/grade-and-review/references/analytic-rubrics-and-grading-hallucination-defense.md +117 -0
- package/core/skills/education/grade-and-review/references/cognitive-error-analysis-and-socratic-feedback.md +124 -0
- package/core/skills/foundation/accessibility-review/SKILL.md +160 -0
- package/core/skills/foundation/accessibility-review/agents/openai.yaml +4 -0
- package/core/skills/foundation/ai-risk-assessment/SKILL.md +198 -0
- package/core/skills/foundation/ai-risk-assessment/agents/openai.yaml +4 -0
- package/core/skills/foundation/combinatorial-testing/SKILL.md +165 -0
- package/core/skills/foundation/combinatorial-testing/agents/openai.yaml +4 -0
- package/core/skills/foundation/conduct-research/SKILL.md +132 -0
- package/core/skills/foundation/conduct-research/agents/openai.yaml +4 -0
- package/core/skills/foundation/conduct-research/references/ai-era-source-discipline.md +58 -0
- package/core/skills/foundation/conduct-research/references/output-format.md +75 -0
- package/core/skills/foundation/conduct-research/references/sota-deep-research-architecture.md +733 -0
- package/core/skills/foundation/create-migration/SKILL.md +151 -0
- package/core/skills/foundation/create-migration/agents/openai.yaml +4 -0
- package/core/skills/foundation/create-migration/references/patterns-and-gotchas.md +58 -0
- package/core/skills/foundation/create-migration/references/suggested-process.md +111 -0
- package/core/skills/foundation/design-review/SKILL.md +138 -0
- package/core/skills/foundation/design-review/agents/openai.yaml +4 -0
- package/core/skills/foundation/design-ux-flow/SKILL.md +153 -0
- package/core/skills/foundation/design-ux-flow/agents/openai.yaml +4 -0
- package/core/skills/foundation/discernment-nudge/SKILL.md +64 -0
- package/core/skills/foundation/hostile-component-stress-testing/SKILL.md +139 -0
- package/core/skills/foundation/incident-report/SKILL.md +119 -0
- package/core/skills/foundation/incident-report/agents/openai.yaml +4 -0
- package/core/skills/foundation/performance-profiling/SKILL.md +127 -0
- package/core/skills/foundation/performance-profiling/agents/openai.yaml +4 -0
- package/core/skills/foundation/performance-profiling/references/patterns-and-safety.md +57 -0
- package/core/skills/foundation/performance-profiling/references/suggested-process.md +113 -0
- package/core/skills/foundation/plan-technical-delivery/SKILL.md +118 -0
- package/core/skills/foundation/plan-technical-delivery/agents/openai.yaml +4 -0
- package/core/skills/foundation/plan-technical-delivery/references/spec-driven-planning.md +104 -0
- package/core/skills/foundation/playwright-evidence-qa/SKILL.md +139 -0
- package/core/skills/foundation/release-notes/SKILL.md +192 -0
- package/core/skills/foundation/release-notes/agents/openai.yaml +4 -0
- package/core/skills/foundation/systematic-debugging/SKILL.md +165 -0
- package/core/skills/foundation/systematic-debugging/agents/openai.yaml +4 -0
- package/core/skills/foundation/webapp-server-runner/SKILL.md +67 -0
- package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +182 -0
- package/core/skills/foundation/write-product-brief/SKILL.md +160 -0
- package/core/skills/foundation/write-product-brief/agents/openai.yaml +4 -0
- package/core/skills/foundation/write-tests/SKILL.md +173 -0
- package/core/skills/foundation/write-tests/agents/openai.yaml +4 -0
- package/core/skills/foundation/write-tests/references/advanced-testing-methodologies.md +102 -0
- package/core/skills/foundation/write-tests/references/patterns-and-ai-testing.md +78 -0
- package/core/skills/frontend/2026_STANDARDS_SUMMARY.md +345 -0
- package/core/skills/frontend/INDEX.json +158 -0
- package/core/skills/frontend/add-page-route/SKILL.md +154 -0
- package/core/skills/frontend/add-page-route/UPGRADE_PLAN_2026.md +102 -0
- package/core/skills/frontend/add-page-route/agents/openai.yaml +4 -0
- package/core/skills/frontend/add-ui-component/SKILL.md +162 -0
- package/core/skills/frontend/add-ui-component/UPGRADE_PLAN_2026.md +114 -0
- package/core/skills/frontend/add-ui-component/agents/openai.yaml +4 -0
- package/core/skills/frontend/anti-ui-slop-finish-gate/SKILL.md +128 -0
- package/core/skills/frontend/component-composition/SKILL.md +116 -0
- package/core/skills/frontend/component-composition/UPGRADE_PLAN_2026.md +103 -0
- package/core/skills/frontend/component-composition/agents/openai.yaml +4 -0
- package/core/skills/frontend/component-composition/references/composition-architecture-and-headless-specs.md +375 -0
- package/core/skills/frontend/design-md-specification/SKILL.md +99 -0
- package/core/skills/frontend/design-system-engineering/SKILL.md +128 -0
- package/core/skills/frontend/frontend-micro-polish/SKILL.md +133 -0
- package/core/skills/frontend/frontend-testing/SKILL.md +196 -0
- package/core/skills/frontend/frontend-testing/UPGRADE_PLAN_2026.md +137 -0
- package/core/skills/frontend/frontend-testing/agents/openai.yaml +4 -0
- package/core/skills/frontend/implement-view-transitions/SKILL.md +109 -0
- package/core/skills/frontend/implement-view-transitions/UPGRADE_PLAN_2026.md +118 -0
- package/core/skills/frontend/implement-view-transitions/agents/openai.yaml +4 -0
- package/core/skills/frontend/implement-view-transitions/references/view-transitions-and-motion-specs.md +255 -0
- package/core/skills/frontend/implement-webmcp/SKILL.md +121 -0
- package/core/skills/frontend/implement-webmcp/UPGRADE_PLAN_2026.md +108 -0
- package/core/skills/frontend/implement-webmcp/agents/openai.yaml +4 -0
- package/core/skills/frontend/integrate-api-client/SKILL.md +186 -0
- package/core/skills/frontend/integrate-api-client/UPGRADE_PLAN_2026.md +118 -0
- package/core/skills/frontend/integrate-api-client/agents/openai.yaml +4 -0
- package/core/skills/frontend/interactive-component-workbench/SKILL.md +141 -0
- package/core/skills/frontend/motion-performance-engineering/SKILL.md +100 -0
- package/core/skills/frontend/setup-design-system/SKILL.md +179 -0
- package/core/skills/frontend/setup-design-system/UPGRADE_PLAN_2026.md +123 -0
- package/core/skills/frontend/setup-design-system/agents/openai.yaml +4 -0
- package/core/skills/frontend/setup-visual-regression/SKILL.md +115 -0
- package/core/skills/frontend/setup-visual-regression/UPGRADE_PLAN_2026.md +121 -0
- package/core/skills/frontend/setup-visual-regression/agents/openai.yaml +4 -0
- package/core/skills/frontend/ui-ux-designer-anti-slop-standards.md +1004 -0
- package/core/skills/frontend/web-quality-audit/SKILL.md +102 -0
- package/core/skills/gamedev/abstract-input-actions/SKILL.md +80 -0
- package/core/skills/gamedev/architect-ecs-systems/SKILL.md +80 -0
- package/core/skills/gamedev/author-game-ai/SKILL.md +78 -0
- package/core/skills/gamedev/automate-game-publishing/SKILL.md +80 -0
- package/core/skills/gamedev/build-game-ui-ux/SKILL.md +78 -0
- package/core/skills/gamedev/configure-physics-collision/SKILL.md +80 -0
- package/core/skills/gamedev/design-procedural-generation/SKILL.md +80 -0
- package/core/skills/gamedev/develop-gameplay-systems/SKILL.md +71 -0
- package/core/skills/gamedev/direct-camera-systems/SKILL.md +79 -0
- package/core/skills/gamedev/generate-game-assets-pipeline/SKILL.md +82 -0
- package/core/skills/gamedev/implement-save-persistence/SKILL.md +84 -0
- package/core/skills/gamedev/inspect-blender-rigs-motion/SKILL.md +82 -0
- package/core/skills/gamedev/integrate-dialogue-narrative/SKILL.md +80 -0
- package/core/skills/gamedev/integrate-game-engine/SKILL.md +81 -0
- package/core/skills/gamedev/manage-scene-lifecycle/SKILL.md +80 -0
- package/core/skills/gamedev/mix-dynamic-game-audio/SKILL.md +80 -0
- package/core/skills/gamedev/profile-game-performance/SKILL.md +81 -0
- package/core/skills/gamedev/program-game-shaders/SKILL.md +83 -0
- package/core/skills/gamedev/render-webgl-threejs/SKILL.md +81 -0
- package/core/skills/gamedev/tune-game-feel/SKILL.md +75 -0
- package/core/skills/legal-compliance/audit-ai-compliance/SKILL.md +85 -0
- package/core/skills/legal-compliance/audit-ai-compliance/agents/openai.yaml +4 -0
- package/core/skills/legal-compliance/audit-ai-compliance/references/ai-law-compliance-guide.md +52 -0
- package/core/skills/legal-compliance/draft-legal-opinion/SKILL.md +89 -0
- package/core/skills/legal-compliance/draft-legal-opinion/agents/openai.yaml +4 -0
- package/core/skills/legal-compliance/draft-legal-opinion/references/legal-opinion-guide.md +53 -0
- package/core/skills/legal-compliance/manage-vietnam-legal/SKILL.md +95 -0
- package/core/skills/legal-compliance/manage-vietnam-legal/references/statutory-checklists.md +208 -0
- package/core/skills/meetings-analysis/2026_STANDARDS_SUMMARY.md +236 -0
- package/core/skills/meetings-analysis/INDEX.json +56 -0
- package/core/skills/meetings-analysis/analyze-business-requirements/SKILL.md +146 -0
- package/core/skills/meetings-analysis/analyze-business-requirements/UPGRADE_PLAN_2026.md +97 -0
- package/core/skills/meetings-analysis/analyze-business-requirements/agents/openai.yaml +4 -0
- package/core/skills/meetings-analysis/analyze-business-requirements/references/layered-requirements-pipeline-and-bdd-standards.md +107 -0
- package/core/skills/meetings-analysis/analyze-data/SKILL.md +164 -0
- package/core/skills/meetings-analysis/analyze-data/UPGRADE_PLAN_2026.md +143 -0
- package/core/skills/meetings-analysis/analyze-data/agents/openai.yaml +4 -0
- package/core/skills/meetings-analysis/analyze-data/references/inprocess-analytics-and-hallucination-prevention.md +83 -0
- package/core/skills/meetings-analysis/analyze-data/references/semantic-catalog-and-drift-detection.md +87 -0
- package/core/skills/meetings-analysis/meeting-review/SKILL.md +199 -0
- package/core/skills/meetings-analysis/meeting-review/UPGRADE_PLAN_2026.md +125 -0
- package/core/skills/meetings-analysis/meeting-review/agents/openai.yaml +4 -0
- package/core/skills/meetings-analysis/meeting-review/references/perspectives-and-process.md +90 -0
- package/core/skills/mmo/INDEX.json +126 -0
- package/core/skills/mmo/analyze-campaign-roi/SKILL.md +134 -0
- package/core/skills/mmo/analyze-campaign-roi/agents/openai.yaml +4 -0
- package/core/skills/mmo/create-automation-script/SKILL.md +139 -0
- package/core/skills/mmo/create-automation-script/agents/openai.yaml +4 -0
- package/core/skills/mmo/deploy-mmo-infrastructure/SKILL.md +137 -0
- package/core/skills/mmo/deploy-mmo-infrastructure/agents/openai.yaml +4 -0
- package/core/skills/mmo/deploy-proxyware-fleet/SKILL.md +133 -0
- package/core/skills/mmo/deploy-proxyware-fleet/agents/openai.yaml +4 -0
- package/core/skills/mmo/generate-mmo-content/SKILL.md +134 -0
- package/core/skills/mmo/generate-mmo-content/agents/openai.yaml +4 -0
- package/core/skills/mmo/manage-mmo-assets/SKILL.md +134 -0
- package/core/skills/mmo/manage-mmo-assets/agents/openai.yaml +4 -0
- package/core/skills/mmo/setup-tracking-system/SKILL.md +149 -0
- package/core/skills/mmo/setup-tracking-system/agents/openai.yaml +4 -0
- package/core/skills/mobile/2026_STANDARDS_SUMMARY.md +209 -0
- package/core/skills/mobile/INDEX.json +40 -0
- package/core/skills/mobile/deploy-mobile-app/SKILL.md +132 -0
- package/core/skills/mobile/deploy-mobile-app/UPGRADE_PLAN_2026.md +122 -0
- package/core/skills/mobile/deploy-mobile-app/agents/openai.yaml +4 -0
- package/core/skills/mobile/deploy-mobile-app/references/eas-build-ota-and-store-compliance-specs.md +217 -0
- package/core/skills/mobile/develop-mobile-app/SKILL.md +125 -0
- package/core/skills/mobile/develop-mobile-app/UPGRADE_PLAN_2026.md +141 -0
- package/core/skills/mobile/develop-mobile-app/agents/openai.yaml +4 -0
- package/core/skills/mobile/develop-mobile-app/references/react-native-new-architecture-and-offline-specs.md +246 -0
- package/core/skills/platform/add-telemetry-instrumentation/SKILL.md +92 -0
- package/core/skills/platform/add-telemetry-instrumentation/agents/openai.yaml +4 -0
- package/core/skills/platform/agents-sdk/SKILL.md +90 -0
- package/core/skills/platform/aws-infrastructure/SKILL.md +120 -0
- package/core/skills/platform/aws-infrastructure/agents/openai.yaml +4 -0
- package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -0
- package/core/skills/platform/cloudflare-email-service/agents/openai.yaml +4 -0
- package/core/skills/platform/cloudflare-email-service/references/cli-and-mcp.md +125 -0
- package/core/skills/platform/cloudflare-email-service/references/deliverability.md +285 -0
- package/core/skills/platform/cloudflare-email-service/references/rest-api.md +184 -0
- package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -0
- package/core/skills/platform/cloudflare-email-service/references/sending.md +252 -0
- package/core/skills/platform/debug-runtime-platform/SKILL.md +143 -0
- package/core/skills/platform/debug-runtime-platform/agents/openai.yaml +4 -0
- package/core/skills/platform/debug-workers-edge/SKILL.md +111 -0
- package/core/skills/platform/debug-workers-edge/agents/openai.yaml +4 -0
- package/core/skills/platform/deploy-aws-eks-workloads/SKILL.md +168 -0
- package/core/skills/platform/deploy-aws-eks-workloads/agents/openai.yaml +4 -0
- package/core/skills/platform/deploy-aws-eks-workloads/references/aws-eks-workload-guide.md +353 -0
- package/core/skills/platform/durable-objects/SKILL.md +114 -0
- package/core/skills/platform/durable-objects/agents/openai.yaml +4 -0
- package/core/skills/platform/durable-objects/references/code-patterns.md +115 -0
- package/core/skills/platform/durable-objects/references/rules.md +295 -0
- package/core/skills/platform/durable-objects/references/testing.md +264 -0
- package/core/skills/platform/durable-objects/references/workers.md +346 -0
- package/core/skills/platform/orchestrate-chaos-experiment/SKILL.md +98 -0
- package/core/skills/platform/orchestrate-chaos-experiment/agents/openai.yaml +4 -0
- package/core/skills/platform/orchestrate-chaos-experiment/references/chaos-engineering-guide.md +237 -0
- package/core/skills/platform/sandbox-sdk/SKILL.md +183 -0
- package/core/skills/platform/sandbox-sdk/agents/openai.yaml +4 -0
- package/core/skills/platform/sandbox-sdk/references/api-quick-ref.md +113 -0
- package/core/skills/platform/sandbox-sdk/references/examples.md +49 -0
- package/core/skills/platform/setup-deployment/SKILL.md +136 -0
- package/core/skills/platform/setup-deployment/agents/openai.yaml +4 -0
- package/core/skills/platform/setup-gpu-finops/SKILL.md +107 -0
- package/core/skills/platform/setup-gpu-finops/agents/openai.yaml +4 -0
- package/core/skills/platform/setup-llm-gateway/SKILL.md +108 -0
- package/core/skills/platform/setup-llm-gateway/agents/openai.yaml +4 -0
- package/core/skills/platform/supply-chain-security/SKILL.md +195 -0
- package/core/skills/platform/supply-chain-security/agents/openai.yaml +4 -0
- package/core/skills/platform/system-design/SKILL.md +184 -0
- package/core/skills/platform/system-design/agents/openai.yaml +4 -0
- package/core/skills/platform/system-design/references/cellular-topology-and-capacity-sizing.md +151 -0
- package/core/skills/platform/turnstile-spin/README.md +45 -0
- package/core/skills/platform/turnstile-spin/SKILL.md +118 -0
- package/core/skills/platform/turnstile-spin/agents/openai.yaml +4 -0
- package/core/skills/platform/turnstile-spin/references/astro.md +102 -0
- package/core/skills/platform/turnstile-spin/references/code-patterns.md +132 -0
- package/core/skills/platform/turnstile-spin/references/hugo.md +62 -0
- package/core/skills/platform/turnstile-spin/references/nextjs-app.md +110 -0
- package/core/skills/platform/turnstile-spin/references/nextjs-pages.md +59 -0
- package/core/skills/platform/turnstile-spin/references/sveltekit.md +84 -0
- package/core/skills/platform/turnstile-spin/references/vanilla-html.md +62 -0
- package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +82 -0
- package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +66 -0
- package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +53 -0
- package/core/skills/platform/turnstile-spin/scripts/validate.sh +87 -0
- package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +57 -0
- package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +102 -0
- package/core/skills/platform/turnstile-spin/templates/worker/LICENSE +21 -0
- package/core/skills/platform/turnstile-spin/templates/worker/README.md +196 -0
- package/core/skills/platform/turnstile-spin/templates/worker/package.json +39 -0
- package/core/skills/platform/turnstile-spin/templates/worker/public/post-deploy.html +287 -0
- package/core/skills/platform/turnstile-spin/templates/worker/src/errors.ts +29 -0
- package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -0
- package/core/skills/platform/turnstile-spin/templates/worker/src/observability.ts +34 -0
- package/core/skills/platform/turnstile-spin/templates/worker/src/types.ts +95 -0
- package/core/skills/platform/turnstile-spin/templates/worker/src/validate.ts +101 -0
- package/core/skills/platform/turnstile-spin/templates/worker/test/deploy.test.ts +71 -0
- package/core/skills/platform/turnstile-spin/templates/worker/test/integration.test.ts +87 -0
- package/core/skills/platform/turnstile-spin/templates/worker/test/unit.test.ts +372 -0
- package/core/skills/platform/turnstile-spin/templates/worker/test/validation.test.ts +201 -0
- package/core/skills/platform/turnstile-spin/templates/worker/tsconfig.json +24 -0
- package/core/skills/platform/turnstile-spin/templates/worker/vitest.config.ts +12 -0
- package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -0
- package/core/skills/platform/turnstile-spin/tests/validation.md +69 -0
- package/core/skills/platform/web-perf/SKILL.md +151 -0
- package/core/skills/platform/web-perf/agents/openai.yaml +4 -0
- package/core/skills/platform/workers-best-practices/SKILL.md +93 -0
- package/core/skills/platform/workers-best-practices/agents/openai.yaml +4 -0
- package/core/skills/platform/workers-best-practices/references/review.md +174 -0
- package/core/skills/platform/workers-best-practices/references/rules.md +463 -0
- package/core/skills/platform/wrangler/SKILL.md +89 -0
- package/core/skills/platform/wrangler/agents/openai.yaml +4 -0
- package/core/skills/product/build-story-map/SKILL.md +104 -0
- package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -0
- package/core/skills/product/define-product-strategy/SKILL.md +105 -0
- package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -0
- package/core/skills/product/model-saas-metrics/SKILL.md +104 -0
- package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -0
- package/core/skills/product/prioritize-roadmap/SKILL.md +106 -0
- package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -0
- package/core/skills/repo-ops/commit-code/SKILL.md +190 -0
- package/core/skills/repo-ops/commit-code/agents/openai.yaml +4 -0
- package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -0
- package/core/skills/repo-ops/navigate-service/SKILL.md +199 -0
- package/core/skills/repo-ops/navigate-service/agents/openai.yaml +4 -0
- package/core/skills/repo-ops/review-code/SKILL.md +102 -0
- package/core/skills/repo-ops/review-code/agents/openai.yaml +4 -0
- package/core/skills/repo-ops/review-code/references/adversarial-review-rubric.md +80 -0
- package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -0
- package/core/skills/repo-ops/review-code/references/two-axis-review.md +78 -0
- package/core/skills/repo-ops/review-service/SKILL.md +186 -0
- package/core/skills/repo-ops/review-service/agents/openai.yaml +4 -0
- package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -0
- package/core/skills/repo-ops/troubleshoot-service/agents/openai.yaml +4 -0
- package/core/skills/repo-ops/troubleshoot-service/references/common-failure-areas.md +71 -0
- package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -0
- package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -0
- package/core/skills/security-data/build-data-pipeline/SKILL.md +139 -0
- package/core/skills/security-data/build-data-pipeline/agents/openai.yaml +4 -0
- package/core/skills/security-data/build-data-pipeline/references/producer-contracts-and-lakehouse.md +112 -0
- package/core/skills/security-data/build-data-pipeline/references/quality-gates-dlq-and-replayability.md +105 -0
- package/core/skills/security-data/database-maintenance/SKILL.md +102 -0
- package/core/skills/security-data/database-maintenance/agents/openai.yaml +4 -0
- package/core/skills/security-data/database-maintenance/references/lakehouse-ops-and-finops.md +125 -0
- package/core/skills/security-data/database-maintenance/references/relational-and-vector-maintenance.md +81 -0
- package/core/skills/security-data/manage-secrets/SKILL.md +137 -0
- package/core/skills/security-data/manage-secrets/agents/openai.yaml +4 -0
- package/core/skills/security-data/manage-vietnam-accounting/SKILL.md +93 -0
- package/core/skills/security-data/manage-vietnam-accounting/agents/openai.yaml +4 -0
- package/core/skills/security-data/manage-vietnam-accounting/references/e-invoice-risk-playbook.md +270 -0
- package/core/skills/security-data/manage-vietnam-accounting/references/three-way-matching-and-controls.md +227 -0
- package/core/skills/security-data/manage-vietnam-accounting/references/vas-vfrs-chart-of-accounts.md +199 -0
- package/core/skills/security-data/optimize-olap-database/SKILL.md +108 -0
- package/core/skills/security-data/optimize-olap-database/agents/openai.yaml +4 -0
- package/core/skills/security-data/optimize-olap-database/references/olap-database-guide.md +325 -0
- package/core/skills/security-data/prompt-injection-defense/SKILL.md +103 -0
- package/core/skills/security-data/query-analytical-engine/SKILL.md +92 -0
- package/core/skills/security-data/query-analytical-engine/agents/openai.yaml +4 -0
- package/core/skills/security-data/query-analytical-engine/references/analytical-query-guide.md +326 -0
- package/core/skills/security-data/security-audit/SKILL.md +119 -0
- package/core/skills/security-data/security-audit/agents/openai.yaml +4 -0
- package/core/skills/security-data/skill-preflight-ast-check/SKILL.md +132 -0
- package/core/skills/seo/audit-technical-seo/SKILL.md +109 -0
- package/core/skills/seo/audit-technical-seo/agents/openai.yaml +4 -0
- package/core/skills/seo/audit-technical-seo/references/core-web-vitals-and-performance.md +104 -0
- package/core/skills/seo/audit-technical-seo/references/crawl-budget-and-bot-access-guide.md +188 -0
- package/core/skills/seo/audit-technical-seo/references/redirects-canonicals-and-status-codes.md +145 -0
- package/core/skills/seo/implement-schema-markup/SKILL.md +103 -0
- package/core/skills/seo/implement-schema-markup/agents/openai.yaml +4 -0
- package/core/skills/seo/implement-schema-markup/references/connected-graph-schema-architecture.md +219 -0
- package/core/skills/seo/implement-schema-markup/references/entity-grounding-and-wikidata.md +155 -0
- package/core/skills/seo/implement-schema-markup/references/rich-results-and-validation-guide.md +83 -0
- package/core/workflows/README.md +140 -0
- package/core/workflows/add-new-feature.md +212 -0
- package/core/workflows/agent-a2a-delegation.md +142 -0
- package/core/workflows/bug-fix.md +147 -0
- package/core/workflows/build-deploy.md +208 -0
- package/core/workflows/code-review.md +137 -0
- package/core/workflows/content-audit.md +158 -0
- package/core/workflows/content-publishing.md +208 -0
- package/core/workflows/curriculum-delivery.md +181 -0
- package/core/workflows/data-migration.md +202 -0
- package/core/workflows/data-pipeline-incident.md +176 -0
- package/core/workflows/dependency-upgrade.md +193 -0
- package/core/workflows/feature-delivery.md +149 -0
- package/core/workflows/hotfix-production.md +172 -0
- package/core/workflows/mmo-campaign-lifecycle.md +123 -0
- package/core/workflows/period-end-closing.md +245 -0
- package/core/workflows/qa-validation.md +231 -0
- package/core/workflows/refactoring.md +154 -0
- package/core/workflows/revert-deployment.md +147 -0
- package/core/workflows/security-incident-response.md +191 -0
- package/core/workflows/seo-content-lifecycle.md +91 -0
- package/core/workflows/seo-keyword-brief.md +178 -0
- package/core/workflows/service-review-release.md +223 -0
- package/core/workflows/setup-new-service.md +214 -0
- package/core/workflows/tech-repo-review.md +245 -0
- package/core/workflows/troubleshooting.md +241 -0
- package/overlays/README.md +89 -0
- package/overlays/astro-cloudflare/README.md +93 -0
- package/overlays/astro-cloudflare/rules/astro-cloudflare-conventions.md +191 -0
- package/overlays/b2b-catalog-golf/README.md +50 -0
- package/overlays/b2b-catalog-golf/rules/golf-project-rules.md +78 -0
- package/overlays/b2b-catalog-golf/skills/develop-b2b-golf-feature/SKILL.md +84 -0
- package/overlays/b2b-catalog-golf/skills/develop-b2b-golf-feature/agents/openai.yaml +4 -0
- package/overlays/b2b-factory-catalog/README.md +54 -0
- package/overlays/b2b-factory-catalog/rules/icm-project-rules.md +93 -0
- package/overlays/b2b-factory-catalog/skills/develop-b2b-catalog-feature/SKILL.md +68 -0
- package/overlays/b2b-factory-catalog/skills/develop-b2b-catalog-feature/agents/openai.yaml +4 -0
- package/overlays/b2b-sport-catalog/README.md +64 -0
- package/overlays/b2b-sport-catalog/rules/sport-project-rules.md +82 -0
- package/overlays/cad-projection/README.md +49 -0
- package/overlays/cad-projection/rules/cad-conventions.md +76 -0
- package/overlays/cad-projection/skills/isometric-svg-projection/SKILL.md +132 -0
- package/overlays/data-analyst-stack/README.md +109 -0
- package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -0
- package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -0
- package/overlays/data-warehouse/README.md +133 -0
- package/overlays/data-warehouse/learning/README.md +40 -0
- package/overlays/data-warehouse/learning/learning-conventions.md +113 -0
- package/overlays/data-warehouse/learning/phase-roadmap.md +444 -0
- package/overlays/data-warehouse/learning/progress.md +38 -0
- package/overlays/data-warehouse/rules/amis-accounting-standards.md +271 -0
- package/overlays/data-warehouse/rules/duckdb-concurrency.md +362 -0
- package/overlays/data-warehouse/rules/pii-scrubbing.md +238 -0
- package/overlays/data-warehouse/rules/stocktake-tolerance.md +276 -0
- package/overlays/ecommerce-microservices/README.md +65 -0
- package/overlays/ecommerce-microservices/config/README.md +3 -0
- package/overlays/ecommerce-microservices/rules/README.md +3 -0
- package/overlays/ecommerce-microservices/skills/README.md +3 -0
- package/overlays/ecommerce-microservices/workflows/README.md +3 -0
- package/overlays/fintech-compliance/README.md +50 -0
- package/overlays/fintech-compliance/rules/credit-scorecard-rules.md +98 -0
- package/overlays/fintech-compliance/skills/build-credit-scorecard/SKILL.md +133 -0
- package/overlays/go-microservices/README.md +78 -0
- package/overlays/go-microservices/rules/go-conventions.md +223 -0
- package/overlays/hugo-authority-content/README.md +58 -0
- package/overlays/hugo-authority-content/config/sites.md +51 -0
- package/overlays/hugo-authority-content/roles/README.md +25 -0
- package/overlays/hugo-authority-content/rules/content-brand.md +124 -0
- package/overlays/hugo-authority-content/rules/link-topology.md +72 -0
- package/overlays/hugo-authority-content/rules/seo-authority.md +83 -0
- package/overlays/hugo-authority-content/rules/technical-article-2027.md +91 -0
- package/overlays/hugo-authority-content/skills/audit-technical-article/SKILL.md +77 -0
- package/overlays/hugo-authority-content/skills/write-hugo-twin-content/SKILL.md +103 -0
- package/overlays/hugo-authority-content/skills/write-hugo-twin-content/agents/openai.yaml +4 -0
- package/overlays/hugo-authority-content/workflows/README.md +31 -0
- package/overlays/hugo-authority-content/workflows/affiliate-publishing.md +55 -0
- package/overlays/hugo-authority-content/workflows/article-creation-and-upgrade-lifecycle.md +426 -0
- package/overlays/hugo-authority-content/workflows/content-audit-refresh.md +105 -0
- package/overlays/hugo-authority-content/workflows/masterclass-batch-upgrade.md +66 -0
- package/overlays/hugo-authority-content/workflows/publish-series.md +126 -0
- package/overlays/hugo-authority-content/workflows/series-sync-upgrade.md +138 -0
- package/overlays/hvac-authority-content/README.md +54 -0
- package/overlays/hvac-authority-content/config/collections.md +70 -0
- package/overlays/hvac-authority-content/rules/content-schema.md +134 -0
- package/overlays/hvac-authority-content/rules/hvac-engineering-standards.md +62 -0
- package/overlays/hvac-authority-content/rules/silo-linking.md +73 -0
- package/overlays/hvac-authority-content/skills/write-hvac-authority-content/SKILL.md +80 -0
- package/overlays/hvac-authority-content/workflows/publish-hvac-content.md +102 -0
- package/overlays/laravel-ecommerce/README.md +39 -0
- package/overlays/laravel-ecommerce/config/README.md +3 -0
- package/overlays/laravel-ecommerce/roles/README.md +3 -0
- package/overlays/laravel-ecommerce/rules/elomus-design-system.md +89 -0
- package/overlays/laravel-ecommerce/rules/laravel-ecommerce-rules.md +107 -0
- package/overlays/laravel-ecommerce/skills/develop-laravel-ecommerce-feature/SKILL.md +125 -0
- package/overlays/laravel-ecommerce/skills/develop-laravel-ecommerce-feature/agents/openai.yaml +4 -0
- package/overlays/laravel-ecommerce/workflows/README.md +3 -0
- package/overlays/laravel-ecommerce/workflows/deploy-laravel-ecommerce.md +128 -0
- package/overlays/laravel-filament/README.md +90 -0
- package/overlays/laravel-filament/config/README.md +3 -0
- package/overlays/laravel-filament/roles/README.md +3 -0
- package/overlays/laravel-filament/rules/laravel-conventions.md +220 -0
- package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -0
- package/overlays/laravel-filament/skills/develop-laravel-feature/agents/openai.yaml +4 -0
- package/overlays/laravel-filament/workflows/README.md +3 -0
- package/overlays/laravel-filament/workflows/deploy-laravel.md +134 -0
- package/overlays/livestream-web/README.md +45 -0
- package/overlays/livestream-web/rules/livestream-web-ux-conventions.md +55 -0
- package/overlays/obj-configurator/README.md +42 -0
- package/overlays/obj-configurator/rules/obj-project-rules.md +111 -0
- package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -0
- package/overlays/obj-configurator/skills/develop-obj-feature/agents/openai.yaml +4 -0
- package/overlays/r3f-stack/README.md +89 -0
- package/overlays/r3f-stack/rules/stub.md +43 -0
- package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -0
- package/overlays/r3f-stack/skills/debug-3d-scene/agents/openai.yaml +4 -0
- package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -0
- package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/agents/openai.yaml +4 -0
- package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -0
- package/overlays/r3f-stack/skills/optimize-3d-assets/agents/openai.yaml +4 -0
- package/overlays/real-estate-content/README.md +51 -0
- package/overlays/real-estate-content/config/collections.md +64 -0
- package/overlays/real-estate-content/roles/README.md +25 -0
- package/overlays/real-estate-content/rules/affiliate-links.md +54 -0
- package/overlays/real-estate-content/rules/content-schema.md +89 -0
- package/overlays/real-estate-content/rules/seo-baseline.md +53 -0
- package/overlays/real-estate-content/skills/write-real-estate-astro-data/SKILL.md +102 -0
- package/overlays/real-estate-content/skills/write-real-estate-astro-data/agents/openai.yaml +4 -0
- package/overlays/real-estate-content/workflows/README.md +25 -0
- package/overlays/real-estate-content/workflows/publish-real-estate-content.md +68 -0
- package/overlays/security-research/README.md +50 -0
- package/overlays/security-research/rules/reverse-engineering-rules.md +82 -0
- package/overlays/security-research/skills/reverse-engineer-binary/SKILL.md +129 -0
- package/overlays/seo-publishing/README.md +93 -0
- package/overlays/seo-publishing/rules/publish-log-conventions.md +64 -0
- package/overlays/seo-publishing/rules/publishing-cadence.md +89 -0
- package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -0
- package/overlays/seo-publishing/rules/topic-board-template.md +67 -0
- package/overlays/ui-design-system/README.md +59 -0
- package/overlays/ui-design-system/rules/handoff-conventions.md +73 -0
- package/package.json +47 -4
- package/packs/README.md +223 -0
- package/packs/affiliate-cashback-team/README.md +219 -0
- package/packs/affiliate-cashback-team/manifest.yaml +125 -0
- package/packs/affiliate-cashback-team/workflows/affiliate-tri-engine-lifecycle.md +178 -0
- package/packs/b2b-catalog-team/manifest.yaml +63 -0
- package/packs/b2b-golf-team/manifest.yaml +63 -0
- package/packs/b2b-sport-team/manifest.yaml +63 -0
- package/packs/content-sprint-team/manifest.yaml +61 -0
- package/packs/data-analyst-team/manifest.yaml +65 -0
- package/packs/data-warehouse/manifest.yaml +143 -0
- package/packs/ecommerce-team/manifest.yaml +65 -0
- package/packs/global-engineering/manifest.yaml +55 -0
- package/packs/hugo-authority-team/README.md +381 -0
- package/packs/hugo-authority-team/manifest.yaml +167 -0
- package/packs/hugo-authority-team/workflows/article-creation-and-upgrade-lifecycle.md +426 -0
- package/packs/hvac-content-team/README.md +194 -0
- package/packs/hvac-content-team/manifest.yaml +117 -0
- package/packs/hvac-content-team/workflows/publish-hvac-content.md +68 -0
- package/packs/landing-pages-team/README.md +115 -0
- package/packs/landing-pages-team/manifest.yaml +91 -0
- package/packs/landing-pages-team/workflows/landing-page-creation-lifecycle.md +70 -0
- package/packs/laravel-ecommerce-team/manifest.yaml +65 -0
- package/packs/livestream-team/manifest.yaml +61 -0
- package/packs/mmo-growth-team/README.md +206 -0
- package/packs/mmo-growth-team/manifest.yaml +131 -0
- package/packs/obj-team/manifest.yaml +68 -0
- package/packs/real-estate-team/README.md +208 -0
- package/packs/real-estate-team/manifest.yaml +117 -0
- package/packs/real-estate-team/workflows/publish-real-estate-content.md +73 -0
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
# Production vLLM v1 Deployment & High-Throughput Inference Guide
|
|
2
|
+
|
|
3
|
+
This reference guide provides production-grade architecture patterns, mathematical formulations, Kubernetes resource manifests, and observability configurations for deploying large language models with the vLLM v1 inference engine in enterprise environments.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Architectural Foundations: vLLM v0 vs vLLM v1
|
|
8
|
+
|
|
9
|
+
The vLLM v1 architecture redesigns the engine core to address the concurrency, latency jitter, and memory fragmentation bottlenecks inherent in Python-bound serving architectures.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
+-------------------------------------------------------------------------------+
|
|
13
|
+
| HTTP / gRPC Ingress (FastAPI / Envoy) |
|
|
14
|
+
+---------------------------------------+---------------------------------------+
|
|
15
|
+
| Zero-Copy Deserialization
|
|
16
|
+
v
|
|
17
|
+
+-------------------------------------------------------------------------------+
|
|
18
|
+
| vLLM v1 C++ Engine Core (Process Isolated) |
|
|
19
|
+
| |
|
|
20
|
+
| +-----------------------+ Shared Memory +----------------------+ |
|
|
21
|
+
| | Request Scheduler | <====================> | PagedBlockManager | |
|
|
22
|
+
| | (Chunked Prefill) | Lock-Free SPSC | (Radix Tree Cache) | |
|
|
23
|
+
| +-----------------------+ Ring Buffers +----------------------+ |
|
|
24
|
+
+---------------------------------------+---------------------------------------+
|
|
25
|
+
| Asynchronous TMA Descriptors
|
|
26
|
+
v
|
|
27
|
+
+-------------------------------------------------------------------------------+
|
|
28
|
+
| NVIDIA Hopper Architecture (H100 / H200 SXM5) |
|
|
29
|
+
| |
|
|
30
|
+
| Producer Warps: Async TMA Load (HBM3e -> Shared Memory / Register File) |
|
|
31
|
+
| Consumer Warps: FP8 Tensor Core Matrix Multiply (Warp Specialization) |
|
|
32
|
+
+-------------------------------------------------------------------------------+
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Key Architectural Shifts
|
|
36
|
+
|
|
37
|
+
1. **Decoupled C++ Engine Core (`VLLM_USE_V1=1`)**: Request scheduling, block allocation, and iteration execution run in a dedicated C++ process completely decoupled from the Python Global Interpreter Lock (GIL). This reduces scheduling step latency from $> 1.8\text{ms}$ in v0 to $< 0.15\text{ms}$ in v1.
|
|
38
|
+
2. **Lock-Free SPSC Ring Buffers**: Inter-process communication between HTTP frontend workers and the C++ engine core operates over POSIX shared memory (`/dev/shm`) using lock-free Single-Producer Single-Consumer (SPSC) ring buffers. Synchronous CPU polling loops (`torch.cuda.Event.query()`) are replaced with asynchronous CUDA completion queues.
|
|
39
|
+
3. **Hopper Warp Specialization & TMA**: KV cache operations on Hopper GPUs leverage Tensor Memory Accelerator (TMA) hardware for asynchronous, direct memory copies between High Bandwidth Memory (HBM3e) and Shared Memory (SMem), bypassing register files and CPU overhead. Producer warps issue TMA memory descriptors while consumer warps execute FP8 Tensor Core GEMMs concurrently.
|
|
40
|
+
4. **MFU Target**: High-throughput serving clusters achieve Model FLOPs Utilization (MFU) of $\ge 50\%$ on NVIDIA H100 SXM5 across large batch sizes ($B_{concurrency} \ge 128$).
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 2. Mathematical Modeling of PagedAttention v3 Memory Bounds
|
|
45
|
+
|
|
46
|
+
PagedAttention partitions the continuous Key-Value (KV) cache of autoregressive models into fixed-size physical memory slabs, analogous to virtual memory paging in operating systems.
|
|
47
|
+
|
|
48
|
+
### 2.1 Token Block Formulation
|
|
49
|
+
|
|
50
|
+
Let sequence $i$ have current context length $S_i$ tokens. The number of allocated physical blocks $N_{blocks}(i)$ is defined by:
|
|
51
|
+
|
|
52
|
+
$$N_{blocks}(i) = \left\lceil \frac{S_i}{B} \right\rceil$$
|
|
53
|
+
|
|
54
|
+
where $B$ is the block size ($B = 32$ tokens in PagedAttention v3).
|
|
55
|
+
|
|
56
|
+
### 2.2 Slab Memory Footprint
|
|
57
|
+
|
|
58
|
+
The memory footprint of a single physical block across all Transformer layers $L$ is given by:
|
|
59
|
+
|
|
60
|
+
$$\text{BlockSize}_{bytes} = 2 \times L \times H_{KV} \times D_{head} \times B \times \text{sizeof}(\text{dtype})$$
|
|
61
|
+
|
|
62
|
+
where:
|
|
63
|
+
- $L$ is the number of hidden transformer layers.
|
|
64
|
+
- $H_{KV}$ is the number of Key/Value attention heads (accounting for Grouped-Query Attention, GQA).
|
|
65
|
+
- $D_{head}$ is the attention head hidden dimension ($D_{head} = \frac{d_{model}}{H_{Q}}$).
|
|
66
|
+
- $\text{sizeof}(\text{dtype}) = 1\text{ byte}$ for FP8 (`fp8_e4m3`), or $2\text{ bytes}$ for FP16/BF16.
|
|
67
|
+
|
|
68
|
+
For Meta-Llama-3.1-70B-Instruct ($L = 80$, $H_{KV} = 8$, $D_{head} = 128$, $B = 32$):
|
|
69
|
+
- **FP16 KV Cache**: $\text{BlockSize}_{bytes} = 2 \times 80 \times 8 \times 128 \times 32 \times 2 = 10,485,760\text{ bytes} \approx 10.0\text{ MiB per block}$ ($327.68\text{ KB/token}$). Across Tensor Parallel size 8 ($TP=8$), this equals $40.96\text{ KB/token/GPU}$.
|
|
70
|
+
- **FP8 KV Cache**: $\text{BlockSize}_{bytes} = 2 \times 80 \times 8 \times 128 \times 32 \times 1 = 5,242,880\text{ bytes} \approx 5.0\text{ MiB per block}$ ($163.84\text{ KB/token}$). Across $TP=8$, this equals $20.48\text{ KB/token/GPU}$.
|
|
71
|
+
|
|
72
|
+
### 2.3 Memory Fragmentation Bounds
|
|
73
|
+
|
|
74
|
+
- **External Fragmentation**: Bounded to $0.0\%$. PagedAttention allocates non-contiguous physical blocks from a pre-allocated pool, eliminating external fragmentation entirely.
|
|
75
|
+
- **Internal Fragmentation**: Only the final block of an active sequence contains unwritten token slots. For sequence $i$, unused tokens in the tail block are:
|
|
76
|
+
|
|
77
|
+
$$U_i = (N_{blocks}(i) \times B) - S_i, \quad 0 \le U_i < B$$
|
|
78
|
+
|
|
79
|
+
The fraction of wasted memory $\Phi_i$ for sequence $i$ is strictly bounded by:
|
|
80
|
+
|
|
81
|
+
$$\Phi_i = \frac{U_i}{N_{blocks}(i) \times B} < \frac{B}{S_i}$$
|
|
82
|
+
|
|
83
|
+
For $B = 32$ and standard context length $S_i = 4096$:
|
|
84
|
+
|
|
85
|
+
$$\Phi_i < \frac{32}{4096} = 0.78125\%$$
|
|
86
|
+
|
|
87
|
+
Across concurrent workloads with mixed sequence lengths, internal fragmentation remains strictly $< 2.4\%$.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 3. Dynamic Chunked Prefill & Iteration Scheduling Mechanics
|
|
92
|
+
|
|
93
|
+
Monolithic prompt prefill causes severe head-of-line blocking: when a 32,768-token prompt arrives, a monolithic scheduler monopolizes GPU Tensor Cores for $\sim 410\text{ms}$. During this window, all active decode streams stall, causing Time-Per-Output-Token (TPOT) to spike from $11\text{ms}$ to $> 180\text{ms}$ ($16\times$ jitter).
|
|
94
|
+
|
|
95
|
+
### 3.1 Token Chunk Formulation
|
|
96
|
+
|
|
97
|
+
Dynamic chunked prefill slices incoming prefill requests into bounded token chunks $c_p$ that interleave with active decode tokens within a global iteration token budget $T_{budget}$:
|
|
98
|
+
|
|
99
|
+
$$c_p = \min\left(U_p,\, C_{chunk},\, C_{avail}^{(k)}\right)$$
|
|
100
|
+
|
|
101
|
+
where:
|
|
102
|
+
- $U_p$ is remaining uncomputed tokens for prefill request $p$.
|
|
103
|
+
- $C_{chunk}$ is the maximum chunk size ($C_{chunk} \in [512, 2048]$, default: $1024$).
|
|
104
|
+
- $C_{avail}^{(k)} = T_{budget} - \sum_{d \in \mathcal{D}} 1 - \sum_{j < p} c_j$ is remaining token capacity in iteration $k$.
|
|
105
|
+
- $\mathcal{D}$ is the set of active decode requests.
|
|
106
|
+
- $T_{budget}$ is the global iteration token budget ($T_{budget} = 2048$).
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
Iteration k:
|
|
110
|
+
+-------------------------------------------------------------+
|
|
111
|
+
| Decode Tokens (64 reqs = 64 tokens) | Chunked Prefill (1984) |
|
|
112
|
+
+-------------------------------------------------------------+
|
|
113
|
+
<------------------------ T_budget = 2048 -------------------->
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 3.2 Performance Guarantees
|
|
117
|
+
|
|
118
|
+
- **TPOT Stability**: Interleaving bounded prefill slices restricts single-step GPU kernel execution time to $\le 25\text{ms}$, locking TPOT tail jitter within $\pm 1.8\text{ms}$.
|
|
119
|
+
- **TTFT Target**: Chunked prefill guarantees high scheduling fairness, maintaining P99 Time-to-First-Token (TTFT) $\le 100\text{ms}$ under concurrent burst arrivals.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 4. Hierarchical Radix Tree Prefix Caching
|
|
124
|
+
|
|
125
|
+
Prefix caching avoids redundant computation by reusing KV cache blocks for prompts sharing common initial sequences (e.g., system prompts, few-shot examples, multi-turn dialogues).
|
|
126
|
+
|
|
127
|
+
### 4.1 Radix Tree Data Structure
|
|
128
|
+
|
|
129
|
+
Instead of static, flat hash tables, vLLM v1 uses a memory-resident Radix Tree:
|
|
130
|
+
- **Nodes**: Represent token sequences of variable length.
|
|
131
|
+
- **Edges**: Labeled by sub-sequences of token IDs.
|
|
132
|
+
- **Block Mapping**: Nodes map directly to physical PagedAttention block IDs with reference counters.
|
|
133
|
+
- **Branch Sharing**: Multi-turn dialogue branches split from common ancestor nodes without duplicating ancestor KV blocks.
|
|
134
|
+
|
|
135
|
+
### 4.2 Pruning & Eviction Policy
|
|
136
|
+
|
|
137
|
+
When GPU memory utilization reaches the high watermark ($88\%$ of physical KV cache capacity):
|
|
138
|
+
1. The block manager identifies nodes with reference count $\text{ref\_count} = 0$ (no active request currently generating from this prefix).
|
|
139
|
+
2. Eviction runs via Least-Recently-Used (LRU) order from leaf nodes toward root nodes.
|
|
140
|
+
3. Root nodes containing frequently referenced enterprise system instructions stay pinned in HBM, maintaining warm prefix cache hit rates $\ge 70\%$.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 5. Multi-Tier Distributed KV Cache Offloading (RoCEv2 RDMA Fabric)
|
|
145
|
+
|
|
146
|
+
When local GPU HBM3e is saturated during high-concurrency peaks, KV slabs offload across a 4-tier storage hierarchy:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
+-------------------------------------------------------------------------+
|
|
150
|
+
| Tier 0: GPU HBM3e | 4.8 TB/s Bandwidth | Sub-Microsecond |
|
|
151
|
+
+-------------------------------------------------------------------------+
|
|
152
|
+
| PCIe Gen5 x16 (64 GB/s)
|
|
153
|
+
v
|
|
154
|
+
+-------------------------------------------------------------------------+
|
|
155
|
+
| Tier 1: Host NUMA DDR5 | 64 GB/s Bandwidth | Latency: ~15µs |
|
|
156
|
+
+-------------------------------------------------------------------------+
|
|
157
|
+
| GPUDirect Storage / io_uring
|
|
158
|
+
v
|
|
159
|
+
+-------------------------------------------------------------------------+
|
|
160
|
+
| Tier 2: Local NVMe SSD | 14 GB/s Bandwidth | Latency: ~80µs |
|
|
161
|
+
+-------------------------------------------------------------------------+
|
|
162
|
+
| 400Gbps RoCEv2 (GPUDirect RDMA)
|
|
163
|
+
v
|
|
164
|
+
+-------------------------------------------------------------------------+
|
|
165
|
+
| Tier 3: Remote Node Memory | 46 GB/s Wire Speed | Latency: 3.4ms |
|
|
166
|
+
+-------------------------------------------------------------------------+
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 5.1 Kernel-Bypass GPUDirect RDMA Transfers
|
|
170
|
+
|
|
171
|
+
1. **One-Sided Operations**: KV tensors are transferred between local GPU HBM and remote GPU memory via one-sided InfiniBand / RoCEv2 RDMA writes (`IBV_WR_RDMA_WRITE`).
|
|
172
|
+
2. **Zero Host CPU Involvement**: The host CPU is not interrupted during packet transfers; Mellanox ConnectX-7 NICs interact directly with GPU HBM via PCIe Gen5 switches.
|
|
173
|
+
3. **Lossless Fabric**: Priority Flow Control (PFC, IEEE 802.1Qbb) on priority 3 and Data Center Quantized Congestion Notification (DCQCN) eliminate packet drops and head-of-line blocking across the 400Gbps network fabric.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 6. Kubernetes 1.31+ Dynamic Resource Allocation (DRA) & NVIDIA MIG
|
|
178
|
+
|
|
179
|
+
### 6.1 Kubernetes 1.31+ DRA `ResourceClaimTemplate`
|
|
180
|
+
|
|
181
|
+
Declare accelerator requirements declaratively using Common Expression Language (CEL) selectors matching GPU topology and memory capacity:
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
apiVersion: resource.k8s.io/v1alpha3
|
|
185
|
+
kind: ResourceClaimTemplate
|
|
186
|
+
metadata:
|
|
187
|
+
name: vllm-h100-dra-template
|
|
188
|
+
namespace: ai-inference
|
|
189
|
+
spec:
|
|
190
|
+
spec:
|
|
191
|
+
devices:
|
|
192
|
+
requests:
|
|
193
|
+
- name: gpu-cluster
|
|
194
|
+
deviceClassName: gpu.nvidia.com
|
|
195
|
+
count: 8
|
|
196
|
+
selectors:
|
|
197
|
+
- cel:
|
|
198
|
+
expression: >-
|
|
199
|
+
device.attributes['gpu.nvidia.com'].architecture == 'Hopper' &&
|
|
200
|
+
device.attributes['gpu.nvidia.com'].memory >= 80.GiB &&
|
|
201
|
+
device.attributes['gpu.nvidia.com'].interconnect == 'NVLink'
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### 6.2 Multi-Instance GPU (MIG) Slicing
|
|
205
|
+
|
|
206
|
+
For smaller models (e.g. 7B–14B SLMs) or multi-tenant workloads, physical hardware partitioning via NVIDIA Multi-Instance GPU (MIG) enforces hardware-level fault isolation:
|
|
207
|
+
|
|
208
|
+
- **Profile**: `nvidia.com/mig-3g.40gb` (3 GPU Compute Instances, 40GB dedicated HBM3e, 4 memory controllers).
|
|
209
|
+
- **Isolation**: Each slice possesses dedicated streaming multiprocessors (SMs), memory controllers, crossbar paths, and DMA engines. Software time-slicing is strictly prohibited in production inference to eliminate noisy-neighbor latency cascades and cross-tenant CUDA OOMs.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 7. Complete Production Kubernetes StatefulSet Manifest
|
|
214
|
+
|
|
215
|
+
```yaml
|
|
216
|
+
apiVersion: apps/v1
|
|
217
|
+
kind: StatefulSet
|
|
218
|
+
metadata:
|
|
219
|
+
name: vllm-llama3-70b-v1
|
|
220
|
+
namespace: ai-inference
|
|
221
|
+
labels:
|
|
222
|
+
app.kubernetes.io/name: vllm-inference
|
|
223
|
+
app.kubernetes.io/part-of: ai-platform
|
|
224
|
+
model: meta-llama-3.1-70b-instruct
|
|
225
|
+
spec:
|
|
226
|
+
serviceName: vllm-llama3-70b-headless
|
|
227
|
+
replicas: 2
|
|
228
|
+
podManagementPolicy: Parallel
|
|
229
|
+
selector:
|
|
230
|
+
matchLabels:
|
|
231
|
+
app.kubernetes.io/name: vllm-inference
|
|
232
|
+
template:
|
|
233
|
+
metadata:
|
|
234
|
+
labels:
|
|
235
|
+
app.kubernetes.io/name: vllm-inference
|
|
236
|
+
model: meta-llama-3.1-70b-instruct
|
|
237
|
+
team-id: enterprise-ai
|
|
238
|
+
service-name: llm-serving
|
|
239
|
+
budget-tier: production-high
|
|
240
|
+
annotations:
|
|
241
|
+
prometheus.io/scrape: "true"
|
|
242
|
+
prometheus.io/port: "8000"
|
|
243
|
+
prometheus.io/path: "/metrics"
|
|
244
|
+
k8s.v1.cni.cncf.io/networks: '[{"name": "rocev2-net", "interface": "net1"}]'
|
|
245
|
+
spec:
|
|
246
|
+
priorityClassName: system-cluster-critical
|
|
247
|
+
terminationGracePeriodSeconds: 120
|
|
248
|
+
containers:
|
|
249
|
+
- name: vllm-engine
|
|
250
|
+
image: vllm/vllm-openai:v0.7.2
|
|
251
|
+
imagePullPolicy: IfNotPresent
|
|
252
|
+
env:
|
|
253
|
+
- name: VLLM_USE_V1
|
|
254
|
+
value: "1"
|
|
255
|
+
- name: NCCL_DEBUG
|
|
256
|
+
value: "WARN"
|
|
257
|
+
- name: NCCL_IB_DISABLE
|
|
258
|
+
value: "0"
|
|
259
|
+
- name: NCCL_IB_HCA
|
|
260
|
+
value: "mlx5_0,mlx5_1"
|
|
261
|
+
- name: NCCL_IB_GID_INDEX
|
|
262
|
+
value: "3"
|
|
263
|
+
- name: NCCL_NET_GDR_LEVEL
|
|
264
|
+
value: "5"
|
|
265
|
+
- name: HF_HUB_ENABLE_HF_TRANSFER
|
|
266
|
+
value: "1"
|
|
267
|
+
- name: MODEL_NAME
|
|
268
|
+
value: "meta-llama/Meta-Llama-3.1-70B-Instruct"
|
|
269
|
+
args:
|
|
270
|
+
- "--model=$(MODEL_NAME)"
|
|
271
|
+
- "--tensor-parallel-size=8"
|
|
272
|
+
- "--kv-cache-dtype=fp8"
|
|
273
|
+
- "--block-size=32"
|
|
274
|
+
- "--max-num-batched-tokens=2048"
|
|
275
|
+
- "--max-num-seqs=256"
|
|
276
|
+
- "--enable-chunked-prefill=true"
|
|
277
|
+
- "--enable-prefix-caching=true"
|
|
278
|
+
- "--gpu-memory-utilization=0.90"
|
|
279
|
+
- "--swap-space=16"
|
|
280
|
+
- "--disable-log-requests"
|
|
281
|
+
- "--port=8000"
|
|
282
|
+
resources:
|
|
283
|
+
claims:
|
|
284
|
+
- name: gpu-cluster
|
|
285
|
+
requests:
|
|
286
|
+
cpu: "32"
|
|
287
|
+
memory: "256Gi"
|
|
288
|
+
hugepages-2Mi: "32Gi"
|
|
289
|
+
limits:
|
|
290
|
+
cpu: "64"
|
|
291
|
+
memory: "384Gi"
|
|
292
|
+
hugepages-2Mi: "32Gi"
|
|
293
|
+
securityContext:
|
|
294
|
+
capabilities:
|
|
295
|
+
add:
|
|
296
|
+
- IPC_LOCK
|
|
297
|
+
- SYS_RAWIO
|
|
298
|
+
- NET_RAW
|
|
299
|
+
readOnlyRootFilesystem: false
|
|
300
|
+
ports:
|
|
301
|
+
- name: http
|
|
302
|
+
containerPort: 8000
|
|
303
|
+
protocol: TCP
|
|
304
|
+
volumeMounts:
|
|
305
|
+
- name: dshm
|
|
306
|
+
mountPath: /dev/shm
|
|
307
|
+
- name: hugepages
|
|
308
|
+
mountPath: /dev/hugepages
|
|
309
|
+
- name: model-cache
|
|
310
|
+
mountPath: /root/.cache/huggingface
|
|
311
|
+
startupProbe:
|
|
312
|
+
httpGet:
|
|
313
|
+
path: /health
|
|
314
|
+
port: 8000
|
|
315
|
+
initialDelaySeconds: 60
|
|
316
|
+
periodSeconds: 10
|
|
317
|
+
failureThreshold: 30
|
|
318
|
+
livenessProbe:
|
|
319
|
+
httpGet:
|
|
320
|
+
path: /health
|
|
321
|
+
port: 8000
|
|
322
|
+
periodSeconds: 15
|
|
323
|
+
timeoutSeconds: 5
|
|
324
|
+
failureThreshold: 3
|
|
325
|
+
readinessProbe:
|
|
326
|
+
httpGet:
|
|
327
|
+
path: /health
|
|
328
|
+
port: 8000
|
|
329
|
+
periodSeconds: 5
|
|
330
|
+
timeoutSeconds: 3
|
|
331
|
+
failureThreshold: 2
|
|
332
|
+
volumes:
|
|
333
|
+
- name: dshm
|
|
334
|
+
emptyDir:
|
|
335
|
+
medium: Memory
|
|
336
|
+
sizeLimit: 64Gi
|
|
337
|
+
- name: hugepages
|
|
338
|
+
emptyDir:
|
|
339
|
+
medium: HugePages
|
|
340
|
+
- name: model-cache
|
|
341
|
+
persistentVolumeClaim:
|
|
342
|
+
claimName: model-cache-pvc
|
|
343
|
+
resourceClaims:
|
|
344
|
+
- name: gpu-cluster
|
|
345
|
+
resourceClaimTemplateName: vllm-h100-dra-template
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 8. Prometheus Custom Metric HorizontalPodAutoscaler (HPA)
|
|
351
|
+
|
|
352
|
+
Autoregressive LLM generation is fundamentally memory-bandwidth bound. Scaling purely on GPU compute utilization (`DCGM_FI_DEV_GPU_UTIL`) fails because compute utilization hovers around 30%–45% during decode iterations even as incoming requests accumulate in queues.
|
|
353
|
+
|
|
354
|
+
Inference autoscaling must scale on **queue depth** and **KV cache utilization**.
|
|
355
|
+
|
|
356
|
+
```yaml
|
|
357
|
+
apiVersion: autoscaling/v2
|
|
358
|
+
kind: HorizontalPodAutoscaler
|
|
359
|
+
metadata:
|
|
360
|
+
name: vllm-queue-hpa
|
|
361
|
+
namespace: ai-inference
|
|
362
|
+
spec:
|
|
363
|
+
scaleTargetRef:
|
|
364
|
+
apiVersion: apps/v1
|
|
365
|
+
kind: StatefulSet
|
|
366
|
+
name: vllm-llama3-70b-v1
|
|
367
|
+
minReplicas: 2
|
|
368
|
+
maxReplicas: 12
|
|
369
|
+
behavior:
|
|
370
|
+
scaleUp:
|
|
371
|
+
stabilizationWindowSeconds: 0
|
|
372
|
+
policies:
|
|
373
|
+
- type: Percent
|
|
374
|
+
value: 100
|
|
375
|
+
periodSeconds: 15
|
|
376
|
+
- type: Pods
|
|
377
|
+
value: 4
|
|
378
|
+
periodSeconds: 15
|
|
379
|
+
selectPolicy: Max
|
|
380
|
+
scaleDown:
|
|
381
|
+
stabilizationWindowSeconds: 300
|
|
382
|
+
policies:
|
|
383
|
+
- type: Percent
|
|
384
|
+
value: 25
|
|
385
|
+
periodSeconds: 60
|
|
386
|
+
selectPolicy: Min
|
|
387
|
+
metrics:
|
|
388
|
+
- type: Pods
|
|
389
|
+
pods:
|
|
390
|
+
metric:
|
|
391
|
+
name: vllm_num_requests_waiting_per_pod
|
|
392
|
+
target:
|
|
393
|
+
type: AverageValue
|
|
394
|
+
averageValue: "5"
|
|
395
|
+
- type: Pods
|
|
396
|
+
pods:
|
|
397
|
+
metric:
|
|
398
|
+
name: vllm_gpu_cache_usage_factor_per_pod
|
|
399
|
+
target:
|
|
400
|
+
type: AverageValue
|
|
401
|
+
averageValue: "800m"
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## 9. NVIDIA DCGM Prometheus Metric Queries & Grafana Alerting Rules
|
|
407
|
+
|
|
408
|
+
### 9.1 Essential PromQL Queries
|
|
409
|
+
|
|
410
|
+
1. **Queue Saturation (Waiting Requests per Pod)**:
|
|
411
|
+
```promql
|
|
412
|
+
sum by (pod) (vllm:num_requests_waiting{namespace="ai-inference"})
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
2. **KV Cache Memory Utilization Factor**:
|
|
416
|
+
```promql
|
|
417
|
+
avg by (pod) (vllm:gpu_cache_usage_factor{namespace="ai-inference"}) * 100
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
3. **Prefix Cache Hit Rate Percentage**:
|
|
421
|
+
```promql
|
|
422
|
+
(
|
|
423
|
+
sum by (pod) (rate(vllm:prefix_cache_hits_total[5m]))
|
|
424
|
+
/
|
|
425
|
+
sum by (pod) (rate(vllm:prefix_cache_queries_total[5m]))
|
|
426
|
+
) * 100
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
4. **Normalized Token Generation Throughput (Tokens/sec)**:
|
|
430
|
+
```promql
|
|
431
|
+
sum by (model) (rate(vllm:generation_tokens_total[2m]))
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
5. **P99 Time-to-First-Token (TTFT)**:
|
|
435
|
+
```promql
|
|
436
|
+
histogram_quantile(0.99, sum by (le, model) (rate(vllm:time_to_first_token_seconds_bucket[5m])))
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
6. **P99 Time-Per-Output-Token (TPOT)**:
|
|
440
|
+
```promql
|
|
441
|
+
histogram_quantile(0.99, sum by (le, model) (rate(vllm:time_per_output_token_seconds_bucket[5m])))
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
7. **DCGM GPU High-Bandwidth Memory (HBM) Utilization**:
|
|
445
|
+
```promql
|
|
446
|
+
(
|
|
447
|
+
DCGM_FI_DEV_FB_USED{model="meta-llama-3.1-70b-instruct"}
|
|
448
|
+
/
|
|
449
|
+
(DCGM_FI_DEV_FB_USED{model="meta-llama-3.1-70b-instruct"} + DCGM_FI_DEV_FB_FREE{model="meta-llama-3.1-70b-instruct"})
|
|
450
|
+
) * 100
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### 9.2 Grafana Alerting Rules
|
|
454
|
+
|
|
455
|
+
- **Alert: `InferenceQueueSaturationCritical`**
|
|
456
|
+
- **Condition**: `sum(vllm:num_requests_waiting) > 25 for 1m`
|
|
457
|
+
- **Severity**: `critical`
|
|
458
|
+
- **Mitigation**: Trigger immediate HPA burst scale-out; enable LiteLLM fallback to cloud provider.
|
|
459
|
+
- **Alert: `KVCacheExhaustionImminent`**
|
|
460
|
+
- **Condition**: `avg(vllm:gpu_cache_usage_factor) > 0.95 for 30s`
|
|
461
|
+
- **Severity**: `page`
|
|
462
|
+
- **Mitigation**: Shed batch prefill load; prune unpinned prefix cache blocks; shed lowest priority tenants.
|
|
463
|
+
- **Alert: `TPOTLatencyJitterBreach`**
|
|
464
|
+
- **Condition**: `histogram_quantile(0.99, sum by (le)(rate(vllm:time_per_output_token_seconds_bucket[5m]))) > 0.035 for 2m`
|
|
465
|
+
- **Severity**: `warning`
|
|
466
|
+
- **Mitigation**: Audit dynamic chunked prefill settings; verify `--max-num-batched-tokens` is not exceeded.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-evaluation
|
|
3
|
+
description: Use when constructing representative agent evaluation benchmark suites, defining scoring rubrics, implementing deterministic and LLM-as-a-judge graders, classifying failure taxonomies, and establishing reproducible agent release gates.
|
|
4
|
+
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agent Evaluation
|
|
8
|
+
|
|
9
|
+
Establish empirical benchmark suites, calibrated multi-dimensional scoring rubrics, automated evaluation harnesses, and standardized failure taxonomies to validate agent reliability before production deployment.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- Benchmarking agent performance across prompt adjustments or model version migrations
|
|
14
|
+
- Quantifying regression risk during skill, tool definition, or system prompt updates
|
|
15
|
+
- Establishing automated CI release gates for agent pipelines and multi-agent teams
|
|
16
|
+
- Diagnosing recurring behavioral defects such as hallucinations, tool breaches, or reasoning loops
|
|
17
|
+
- Scoring complex agent outputs using hybrid deterministic and model-graded rubrics
|
|
18
|
+
|
|
19
|
+
## Core Rules
|
|
20
|
+
|
|
21
|
+
- **Representative Evaluation Dataset Design**:
|
|
22
|
+
- Evaluation suites must comprise at least 30 diverse test cases stratified across three tiers:
|
|
23
|
+
1. *Nominal Happy Paths ($40\%$)*: Standard domain requests exercising core capabilities.
|
|
24
|
+
2. *Adversarial & Edge Cases ($40\%$)*: Malformed inputs, ambiguous requests, and boundary conditions.
|
|
25
|
+
3. *Hostile & Safety Probes ($20\%$)*: Prompt injection attempts, forbidden tool requests, and policy traps.
|
|
26
|
+
- Every test case must maintain immutable inputs paired with explicit ground-truth criteria.
|
|
27
|
+
- **Hybrid Grader Hierarchy**:
|
|
28
|
+
- *Tier 1 (Deterministic Graders)*: Exact token presence (`must_include`), forbidden token absence (`must_not_include`), regex patterns, and JSON Schema Draft 2020-12 validation. Deterministic failures fail fast.
|
|
29
|
+
- *Tier 2 (Heuristic Graders)*: Token length boundaries, execution step counts, and latency percentiles ($p50$, $p95$).
|
|
30
|
+
- *Tier 3 (Model-Based Evaluators)*: LLM-as-a-judge rubrics evaluating qualitative traits (faithfulness, conciseness, reasoning depth) using 1–5 Likert scales with explicit rubric anchors.
|
|
31
|
+
- **Composite Scoring and Release Gates**:
|
|
32
|
+
- Compute weighted composite score across rubric dimensions:
|
|
33
|
+
$$S_{\text{composite}} = \sum_{i=1}^n w_i \cdot s_i \quad \text{where} \quad \sum w_i = 1.0$$
|
|
34
|
+
- *Release Thresholds*:
|
|
35
|
+
- Pass: Overall pass rate $\ge 90\%$, zero safety violations, composite score $\ge 0.85$.
|
|
36
|
+
- Conditional Approval: Pass rate between $80\%-89\%$ with non-critical edge case failures only.
|
|
37
|
+
- Fail-Closed: Pass rate $< 80\%$, any safety/injection breach, or any structural contract invalidity.
|
|
38
|
+
- **Structured Failure Taxonomy**:
|
|
39
|
+
- Every failure must be categorized into standard defect classes: `hallucination`, `goal_hijack`, `schema_violation`, `trajectory_loop`, `tool_breach`, or `timeout`.
|
|
40
|
+
|
|
41
|
+
## Suggested Process
|
|
42
|
+
|
|
43
|
+
1. **Curate Benchmark Test Suites**:
|
|
44
|
+
- Assemble representative evaluation fixtures pairing raw prompt inputs with expected criteria.
|
|
45
|
+
- Version-control evaluation datasets in jsonl or paired json test files.
|
|
46
|
+
2. **Configure Deterministic and Model-Based Rubrics**:
|
|
47
|
+
- Define exact contract schema assertions and structural invariants.
|
|
48
|
+
- Write explicit rubric prompts for qualitative judges, specifying criteria for each point on the scale.
|
|
49
|
+
3. **Execute Evaluation Harness**:
|
|
50
|
+
- Run the agent through all test fixtures in an isolated sandbox environment.
|
|
51
|
+
- Capture comprehensive execution telemetry: turn count, tool calls, token usage, and latency.
|
|
52
|
+
4. **Grade and Classify Outputs**:
|
|
53
|
+
- Run deterministic schema and regex assertions first.
|
|
54
|
+
- Run model-based judges with temperature $0.0$ for reproducible qualitative scoring.
|
|
55
|
+
- Aggregate failure metrics across the standardized failure taxonomy.
|
|
56
|
+
5. **Emit Evaluation Report and Enforce Gate**:
|
|
57
|
+
- Compile benchmark results into the standardized contract schema.
|
|
58
|
+
- Trigger automated build failure if the evaluation run violates release thresholds.
|
|
59
|
+
|
|
60
|
+
## Output Contracts
|
|
61
|
+
|
|
62
|
+
When completing an evaluation benchmark, emit `contracts/schemas/agent-eval-report.json`:
|
|
63
|
+
- `eval_run_id`: Unique identifier for the evaluation execution.
|
|
64
|
+
- `summary`: Total cases, pass rate, latency percentiles, and overall pass/fail status.
|
|
65
|
+
- `rubrics`: Weighted rubric scores and threshold compliance flags.
|
|
66
|
+
- `failure_taxonomy`: Quantified failure distribution across defect classes.
|
|
67
|
+
- `verdict`: Automated release recommendation (`pass`, `conditional_approval`, `fail_closed`).
|
|
68
|
+
|
|
69
|
+
## Failure Modes
|
|
70
|
+
|
|
71
|
+
- **Evaluation Dataset Contamination**: Training or tuning system prompts directly on the test set. Mitigation: maintain strict separation between few-shot prompt examples and held-out evaluation splits.
|
|
72
|
+
- **LLM Judge Self-Preference Bias**: Using the same LLM family to judge its own outputs, inflating scores. Mitigation: use cross-family judges or calibrate model judges against human golden annotations.
|
|
73
|
+
- **Flaky Heuristic Assertions**: Writing overly fragile string matching assertions that fail on valid synonymous phrasing. Mitigation: use semantic assertions and regex flexibility for prose while reserving strict matching for schemas and IDs.
|
|
74
|
+
- **Silent Degradation on Edge Cases**: Masking critical edge case failures beneath high overall aggregate pass rates. Mitigation: enforce zero-tolerance floor gates on safety and structural schema rubrics regardless of aggregate score.
|
|
75
|
+
|
|
76
|
+
## Checklist
|
|
77
|
+
|
|
78
|
+
- [ ] Evaluation dataset covers nominal ($40\%$), edge case ($40\%$), and hostile safety ($20\%$) suites
|
|
79
|
+
- [ ] Every test case includes immutable inputs and verifiable expected behaviors
|
|
80
|
+
- [ ] Deterministic schema validations executed before qualitative model judges
|
|
81
|
+
- [ ] LLM judges configured with temperature 0.0 and anchored 1–5 scoring definitions
|
|
82
|
+
- [ ] Weighted composite score calculated with explicit threshold boundaries
|
|
83
|
+
- [ ] All test failures classified into standardized failure taxonomy categories
|
|
84
|
+
- [ ] Output artifacts strictly validate against `agent-eval-report.json`
|
|
85
|
+
- [ ] Automated gate blocks release upon safety violations or pass rate below 90%
|
|
86
|
+
|
|
87
|
+
## Security Guardrails (OWASP ASI)
|
|
88
|
+
|
|
89
|
+
- **ASI01 Goal Hijack**: the 20% hostile safety probes contain real injection payloads that can hijack the harness or the executing agent under test. Mitigation: run all fixtures in the isolated sandbox; grade safety probes with deterministic `must_not_include` assertions so injected content never reaches an executing tool or a free-text judge.
|
|
90
|
+
- **ASI04 Supply Chain**: benchmark suites imported from external registries carry poisoned fixtures or golden labels. Mitigation: version-control all fixtures in-repo with immutable inputs; verify provenance and schema before importing any external suite.
|
|
91
|
+
- **ASI06 Context & Memory Poisoning**: LLM-as-judge rubric prompts read adversarial test outputs that can instruct the judge to award top scores. Mitigation: wrap judge inputs as untrusted reference material, anchor every Likert point explicitly, and run judges at temperature 0.0.
|
|
92
|
+
- **ASI07 Inter-Agent Communication**: `agent-eval-report.json` is consumed by Technical Lead, Prompt Engineer, and automated release gates. Mitigation: emit only schema-validated reports so downstream agents and CI gates never parse partial or schema-drifted results.
|
|
93
|
+
- **ASI08 Cascading Failures**: a flaky gate or partial run silently unblocks (or blocks) a downstream release. Mitigation: fail-closed on any structural contract invalidity; declare evaluation failure explicitly instead of propagating partial results.
|
|
94
|
+
- **ASI09 Human-Agent Trust Exploitation**: self-preference-biased scores, or a `conditional_approval` dressed as a pass, are presented as objective evidence to ship. Mitigation: disclose judge identity and calibration; fail-closed on any safety/injection breach regardless of the composite score.
|
|
95
|
+
|
|
96
|
+
## Related Skills
|
|
97
|
+
|
|
98
|
+
- **write-tests**: Authoring unit and integration tests for software components.
|
|
99
|
+
- **agent-quality-gate**: Enforcing quality and validation thresholds in agentic pipelines.
|
|
100
|
+
- **context-optimization**: Optimizing prompt contexts to maximize evaluation benchmark scores.
|
|
101
|
+
- **prompt-injection-defense**: Verifying agent resilience against adversarial prompt injection attacks.
|
|
102
|
+
- **combinatorial-testing**: Generating combinatorial input matrices for exhaustive test coverage.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-optimization
|
|
3
|
+
description: Use when optimizing LLM agent context windows, allocating token budgets, pruning semantic duplicates, scoring relevance density, and ordering context to mitigate lost-in-the-middle degradation.
|
|
4
|
+
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Context Optimization
|
|
8
|
+
|
|
9
|
+
Maximize effective reasoning density in agent context windows by allocating strict token budgets, eliminating redundant context via semantic deduplication, and structuring prompt sequences to eliminate lost-in-the-middle attention degradation.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- Constructing multi-turn agent execution loops with growing conversation histories
|
|
14
|
+
- Injecting multi-document retrieval-augmented generation (RAG) contexts into system prompts
|
|
15
|
+
- Compacting multi-agent message transcripts before dispatching downstream tasks
|
|
16
|
+
- Mitigating attention dilution and instruction forgetting in high-capacity LLMs
|
|
17
|
+
- Staying within hard token budget ceilings while preserving critical grounding facts
|
|
18
|
+
|
|
19
|
+
## Core Rules
|
|
20
|
+
|
|
21
|
+
- **Five-Tier Token Budget Allocation**:
|
|
22
|
+
- Context capacity must be partitioned into strict deterministic slices:
|
|
23
|
+
1. *System & Behavioral Invariants*: $15\%$ (fixed prompt, role constraints, tool contracts).
|
|
24
|
+
2. *Dynamic Task Grounding*: $35\%$ (task objectives, retrieved references, verified facts).
|
|
25
|
+
3. *Working Memory & Turn History*: $25\%$ (recent tool calls, observations, active state).
|
|
26
|
+
4. *Scratchpad & Intermediate Reasoning*: $10\%$ (scratch notes, plan checklists).
|
|
27
|
+
5. *Output Generation Reserve*: $15\%$ (completion buffer to prevent truncated generations).
|
|
28
|
+
- **Lost-in-the-Middle Priority Ordering**:
|
|
29
|
+
- Frontier LLMs demonstrate highest attention retrieval accuracy at the extreme prompt boundaries (primacy and recency effects).
|
|
30
|
+
- *Boundary Placement*: Position mandatory constraints, system instructions, and schema definitions at the very top ($0\%-15\%$).
|
|
31
|
+
- *Recency Placement*: Position current turn objective, active input parameters, and explicit completion format triggers at the very bottom ($85\%-100\%$).
|
|
32
|
+
- *Middle Zone*: Confine secondary reference data, supporting documentation, and historical tool logs to the central window ($15\%-85\%$).
|
|
33
|
+
- **Semantic & Syntactic Deduplication**:
|
|
34
|
+
- Compute sliding 4-gram overlaps across retrieved documents; drop paragraphs with $> 70\%$ verbatim overlap.
|
|
35
|
+
- Apply vector cosine thresholding: if $\text{sim}(e_a, e_b) \ge 0.88$, merge or discard the lower-relevance passage.
|
|
36
|
+
- **Relevance Density Scoring**:
|
|
37
|
+
- Every injected token must contribute directly to task resolution:
|
|
38
|
+
$$\text{Density} = \frac{\text{Entity and Assertion Token Count}}{\text{Total Segment Token Count}}$$
|
|
39
|
+
- Strip markdown decorative wrappers, repeated navigation headers, and verbose boilerplate when density falls below $0.40$.
|
|
40
|
+
|
|
41
|
+
## Suggested Process
|
|
42
|
+
|
|
43
|
+
1. **Calculate In-Flight Token Consumption**:
|
|
44
|
+
- Tokenize prompt components using target model tokenizers (e.g. tiktoken cl100k or o200k).
|
|
45
|
+
- Evaluate available window margin against output reserve requirements.
|
|
46
|
+
2. **Prune and Deduplicate Ingested Content**:
|
|
47
|
+
- Run n-gram and semantic similarity deduplication across candidate context passages.
|
|
48
|
+
- Collapse repetitious error logs, stack traces, and identical tool call arguments into summarized counts.
|
|
49
|
+
3. **Restructure Passage Sequences**:
|
|
50
|
+
- Reorder retrieved documents: place highest-relevance evidence at the top and immediate query grounding at the bottom.
|
|
51
|
+
- Isolate secondary background material in the middle tier.
|
|
52
|
+
4. **Compress Conversation and Memory Turns**:
|
|
53
|
+
- For dialogues exceeding 8 turns, summarize completed subtask milestones into an immutable context summary.
|
|
54
|
+
- Retain only the last 3 turns of verbatim raw tool invocations and results.
|
|
55
|
+
5. **Verify Context Integrity**:
|
|
56
|
+
- Verify that all schema requirements, critical entity IDs, and active task objectives survived pruning.
|
|
57
|
+
|
|
58
|
+
## Output Contracts
|
|
59
|
+
|
|
60
|
+
When context optimization produces structured task dispatches or plans, emit `contracts/schemas/coordination-plan.json`:
|
|
61
|
+
- `plan_id`: Unique identifier for the optimized orchestration dispatch.
|
|
62
|
+
- `phases`: Sliced execution stages respecting token budget allocations.
|
|
63
|
+
- `handoffs`: Minimized context payloads carrying only verified entity references.
|
|
64
|
+
|
|
65
|
+
## Failure Modes
|
|
66
|
+
|
|
67
|
+
- **Lost-in-the-Middle Forgetting**: Placing critical safety constraints in the center of a 100k token window where attention fades. Mitigation: anchor non-negotiable rules at the top and repeat key invariants directly preceding the final user prompt.
|
|
68
|
+
- **Aggressive Over-Pruning**: Truncating necessary domain terminology or schema fields during compression. Mitigation: preserve structured contract JSON definitions intact; compress only unstructured prose.
|
|
69
|
+
- **Context Window Thrashing**: Expanding and contracting context dynamically between turns, causing unstable cache hit rates. Mitigation: standardize static prompt prefix boundaries to leverage prefix prompt caching.
|
|
70
|
+
- **Boilerplate Token Bloat**: Passing raw web HTML or unparsed API responses into context. Mitigation: extract pure text and structured data tables prior to prompt assembly.
|
|
71
|
+
|
|
72
|
+
## Checklist
|
|
73
|
+
|
|
74
|
+
- [ ] Token budget partitions configured (system, grounding, memory, scratchpad, reserve)
|
|
75
|
+
- [ ] Output generation reserve of at least 15% preserved to prevent response truncation
|
|
76
|
+
- [ ] Primacy and recency ordering verified: critical rules at top, immediate task trigger at bottom
|
|
77
|
+
- [ ] Syntactic n-gram and semantic similarity deduplication applied to retrieved documents
|
|
78
|
+
- [ ] Conversation history older than 3 turns compressed into milestone summaries
|
|
79
|
+
- [ ] Static system prompt prefixes kept stable across turns to maximize prefix caching
|
|
80
|
+
- [ ] Raw JSON and stack traces stripped of redundant whitespace and repeated log lines
|
|
81
|
+
- [ ] Verified that all essential entity IDs, URLs, and contract requirements remain intact
|
|
82
|
+
|
|
83
|
+
## Security Guardrails (OWASP ASI)
|
|
84
|
+
|
|
85
|
+
- **ASI01 Goal Hijack**: pruning or reordering promotes middle-zone untrusted content toward the prompt boundary while dropping the system invariants that constrain it. Mitigation: never compress, relocate, or trim the system-and-invariants tier; keep untrusted content confined to the middle zone inside its delimiters.
|
|
86
|
+
- **ASI04 Supply Chain**: token counts computed with a different tokenizer than the target model (or an unpinned embedding model for cosine dedup) silently mis-size every budget slice. Mitigation: pin the tokenizer version (cl100k/o200k) matching the deployed model and use one pinned embedding model for similarity scoring.
|
|
87
|
+
- **ASI06 Context & Memory Poisoning**: density scoring strips provenance tags and trust delimiters from retrieved passages, erasing the trusted/untrusted boundary in the assembled window. Mitigation: exclude trust markers and provenance metadata from density scoring; never strip `<untrusted_data>` wrappers during compression.
|
|
88
|
+
- **ASI07 Inter-Agent Communication**: summarized handoff payloads pass unverified facts downstream as established grounding. Mitigation: `handoffs` in `coordination-plan.json` must carry only verified entity references and preserve the fact/assumption boundary for receiving agents.
|
|
89
|
+
- **ASI09 Human-Agent Trust Exploitation**: reporting token savings while critical schema fields or entity IDs were truncated during pruning. Mitigation: complete the integrity verification (schema requirements, entity IDs, active objectives survived) before reporting any savings figure.
|
|
90
|
+
|
|
91
|
+
## Related Skills
|
|
92
|
+
|
|
93
|
+
- **agent-tool-orchestration**: Coordinating tool executions within token-bounded contexts.
|
|
94
|
+
- **agent-graph-orchestration**: Orchestrating multi-agent state machines across bounded context nodes.
|
|
95
|
+
- **agent-evaluation**: Evaluating agent reasoning performance under varying context lengths.
|
|
96
|
+
- **prompt-injection-defense**: Sanitizing and delimiting untrusted inputs within optimized context boundaries.
|
|
97
|
+
- **systematic-debugging**: Diagnosing context leakage and token exhaustion failures.
|