@vesviet/agent-skills 0.0.0-stage → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +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 +241 -0
- package/core/README.md +53 -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
package/core/skills/security-data/manage-vietnam-accounting/references/vas-vfrs-chart-of-accounts.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Vietnam Accounting Standards (VAS) & VFRS Chart of Accounts Governance
|
|
2
|
+
|
|
3
|
+
## 1. Vietnamese Accounting Regimes Landscape
|
|
4
|
+
|
|
5
|
+
Vietnamese corporate accounting is governed by statutory accounting regimes promulgated by the Ministry of Finance (MoF). Selecting and maintaining the correct accounting regime is a mandatory legal invariant under the Law on Accounting No. 88/2015/QH13.
|
|
6
|
+
|
|
7
|
+
### Accounting Regimes Comparison
|
|
8
|
+
| Feature | Circular 200/2014/TT-BTC | Circular 133/2016/TT-BTC | Circular 132/2018/TT-BTC |
|
|
9
|
+
| :--- | :--- | :--- | :--- |
|
|
10
|
+
| **Target Entities** | Large and medium enterprises, listed corporations, public interest entities | Small and Medium Enterprises (SMEs) | Micro-enterprises (Doanh nghiệp siêu nhỏ) |
|
|
11
|
+
| **Account Code Structure** | Standard 4-digit accounts (e.g., TK 1111, 1121, 6421) | Simplified 3-digit accounts (e.g., TK 111, 112, 642) | Ultra-simplified 3-digit accounts |
|
|
12
|
+
| **Cost Gathering Method** | Multi-account cost gathering (TK 621, 622, 623, 627) | Single-account pooling (TK 154 only) | Direct expense recognition or simplified TK 154 |
|
|
13
|
+
| **Selling Expense Account** | Separate Account: TK 641 | Sub-account: TK 6421 | Gathered into general expenses |
|
|
14
|
+
| **Statutory Financial Statements** | B01-DN, B02-DN, B03-DN, B09-DN | B01a-DNN / B01b-DNN, B02-DNN, B09-DNN | Optional simplified B01-DNSN or tax-only records |
|
|
15
|
+
| **Policy Consistency Requirement** | Fiscal year consistency; changes must be reported in B09 | Fiscal year consistency; changes must be reported in B09 | Annual consistency |
|
|
16
|
+
|
|
17
|
+
### Forbidden SME Accounts under Circular 133
|
|
18
|
+
Circular 133/2016/TT-BTC explicitly prohibits the use of specific cost accounts that exist under Circular 200. Accounting engines and ERP systems must enforce these structural barriers:
|
|
19
|
+
|
|
20
|
+
1. **Manufacturing Cost Accounts**:
|
|
21
|
+
- `TK 621` (Chi phí nguyên liệu, vật liệu trực tiếp): **FORBIDDEN under TT 133**.
|
|
22
|
+
- `TK 622` (Chi phí nhân công trực tiếp): **FORBIDDEN under TT 133**.
|
|
23
|
+
- `TK 623` (Chi phí sử dụng máy thi công): **FORBIDDEN under TT 133**.
|
|
24
|
+
- `TK 627` (Chi phí sản xuất chung): **FORBIDDEN under TT 133**.
|
|
25
|
+
- *Statutory Rule*: Under Circular 133, all direct raw materials, direct labor, machinery, and production overhead must be recorded directly into **`TK 154` (Chi phí sản xuất, kinh doanh dở dang)** using distinct detail tracking codes (e.g., `TK 1541`, `1542`, `1543`).
|
|
26
|
+
2. **Selling Expense Account**:
|
|
27
|
+
- `TK 641` (Chi phí bán hàng): **FORBIDDEN under TT 133**.
|
|
28
|
+
- *Statutory Rule*: Selling expenses must be posted to **`TK 6421` (Chi phí bán hàng)** within general administrative account `TK 642`. Management administrative costs are recorded in **`TK 6422` (Chi phí quản lý doanh nghiệp)**.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 2. Decision 345/QD-BTC VFRS Transition Dual-Reporting Layer
|
|
33
|
+
|
|
34
|
+
Decision 345/QD-BTC approves the national roadmap for applying International Financial Reporting Standards (IFRS) in Vietnam, establishing Vietnam Financial Reporting Standards (VFRS).
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
+-------------------------------------------------------------------------+
|
|
38
|
+
| Enterprise Transaction / Ledger Event |
|
|
39
|
+
+-------------------------------------------------------------------------+
|
|
40
|
+
|
|
|
41
|
+
v
|
|
42
|
+
+------------------------------------+------------------------------------+
|
|
43
|
+
| |
|
|
44
|
+
| Layer 1: Statutory VAS (Circular 200) |
|
|
45
|
+
| - Historical cost convention |
|
|
46
|
+
| - Off-balance operating leases |
|
|
47
|
+
| - Circular 48 aging-bracket bad debt provisions |
|
|
48
|
+
| - Legal tax basis for CIT return (Form 03/TNDN) |
|
|
49
|
+
| |
|
|
50
|
+
+-------------------------------------------------------------------------+
|
|
51
|
+
|
|
|
52
|
+
v Deterministic Bridge & Adjustments
|
|
53
|
+
+-------------------------------------------------------------------------+
|
|
54
|
+
| Layer 2: VFRS / IFRS Reconciliation Layer |
|
|
55
|
+
| - IFRS 16: Right-of-Use Asset & Lease Liability |
|
|
56
|
+
| - IFRS 9: Forward-looking Expected Credit Loss (ECL) |
|
|
57
|
+
| - IFRS 15: 5-Step Revenue Recognition & Contract Assets/Liabilities |
|
|
58
|
+
| - Fair value measurements & Deferred Tax adjustments |
|
|
59
|
+
+-------------------------------------------------------------------------+
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Key Standard Divergences & Deterministic Adjustments
|
|
63
|
+
|
|
64
|
+
#### A. Lease Accounting (IFRS 16 vs VAS 06)
|
|
65
|
+
- **Statutory VAS (Circular 200)**:
|
|
66
|
+
- Operating leases are expensed on a straight-line basis to profit and loss:
|
|
67
|
+
- `Debit TK 642 / 641`: Monthly rental expense.
|
|
68
|
+
- `Credit TK 112 / 331`: Bank payment or vendor payable.
|
|
69
|
+
- No asset or liability is recognized on the balance sheet.
|
|
70
|
+
- **VFRS / IFRS 16 Adjustment**:
|
|
71
|
+
- Capitalize all leases with duration > 12 months:
|
|
72
|
+
1. Calculate initial **Right-of-Use (ROU) Asset** and **Lease Liability** as the present value of future lease payments discounted at the incremental borrowing rate.
|
|
73
|
+
2. Post adjustment entry:
|
|
74
|
+
- `Debit ROU_Asset`
|
|
75
|
+
- `Credit Lease_Liability`
|
|
76
|
+
3. Monthly adjustment entries:
|
|
77
|
+
- `Debit ROU_Amortization_Expense` / `Credit Accumulated_ROU_Amortization`
|
|
78
|
+
- `Debit Interest_Expense` / `Credit Lease_Liability`
|
|
79
|
+
- Reverse statutory VAS rental expense: `Credit Operating_Lease_Expense`
|
|
80
|
+
|
|
81
|
+
#### B. Financial Instruments & Expected Credit Loss (IFRS 9 vs Circular 48/2019)
|
|
82
|
+
- **Statutory VAS (Circular 48/2019/TT-BTC)**:
|
|
83
|
+
- Provision for doubtful debts is strictly rule-based according to invoice overdue aging brackets:
|
|
84
|
+
- Overdue 6 months to under 1 year: **30%** provision.
|
|
85
|
+
- Overdue 1 year to under 2 years: **50%** provision.
|
|
86
|
+
- Overdue 2 years to under 3 years: **70%** provision.
|
|
87
|
+
- Overdue 3 years or more: **100%** provision.
|
|
88
|
+
- Journal entry: `Debit TK 642` / `Credit TK 2293` (Dự phòng phải thu khó đòi).
|
|
89
|
+
- **VFRS / IFRS 9 Adjustment**:
|
|
90
|
+
- Forward-looking Expected Credit Loss (ECL) model:
|
|
91
|
+
- $ECL = PD \times LGD \times EAD$
|
|
92
|
+
- Provision is recognized at Day 1 (12-month ECL) and transitions to Lifetime ECL upon significant increase in credit risk (SICR).
|
|
93
|
+
- Adjustment entry posts delta between VAS Circular 48 provision and IFRS 9 ECL calculation.
|
|
94
|
+
|
|
95
|
+
#### C. Revenue Recognition (IFRS 15 vs VAS 14)
|
|
96
|
+
- **Statutory VAS (VAS 14 & Circular 200)**:
|
|
97
|
+
- Revenue recognized upon transfer of significant risks and rewards of ownership, reliable measurement, and economic benefits probable. Frequently bound to statutory invoice issuance date.
|
|
98
|
+
- **VFRS / IFRS 15 Adjustment**:
|
|
99
|
+
- Enforce the 5-Step Model:
|
|
100
|
+
1. Identify the contract with a customer.
|
|
101
|
+
2. Identify distinct performance obligations (PBOs).
|
|
102
|
+
3. Determine the transaction price (including variable consideration).
|
|
103
|
+
4. Allocate transaction price to performance obligations based on relative standalone selling prices (SSP).
|
|
104
|
+
5. Recognize revenue when/as each performance obligation is satisfied over time or at a point in time.
|
|
105
|
+
- Reclassify unfulfilled obligations to Contract Liabilities and earned unbilled revenue to Contract Assets.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 3. Circular 96/2015 36-Month Legal Ceiling on Prepaid Expenses (TK 242)
|
|
110
|
+
|
|
111
|
+
Prepaid expenses represent expenditures incurred that benefit operating results across multiple accounting periods.
|
|
112
|
+
|
|
113
|
+
### Statutory Ceiling Mandate
|
|
114
|
+
Under **Circular 96/2015/TT-BTC** (Article 4, amending Circular 78/2014/TT-BTC Article 6):
|
|
115
|
+
> "For purchases of tools, equipment, office leases, and repair costs of fixed assets that do not satisfy the criteria for fixed asset recognition, expenditures must be allocated into business costs over a duration **not exceeding 36 months**."
|
|
116
|
+
|
|
117
|
+
### Operational Accounting Rules for TK 242
|
|
118
|
+
1. **Initial Recognition**:
|
|
119
|
+
- `Debit TK 242` (Chi phí trả trước): Historical cost exclusive of VAT.
|
|
120
|
+
- `Debit TK 1331`: Deductible input VAT (evidenced by verified XML e-invoice).
|
|
121
|
+
- `Credit TK 112 / 331`: Payment or vendor liability.
|
|
122
|
+
2. **Monthly Straight-Line Allocation**:
|
|
123
|
+
- Monthly amortization formula:
|
|
124
|
+
$$\text{Monthly Allocation} = \frac{\text{Historical Cost}}{\text{Total Allocation Months}} \quad (\text{where } \text{Total Allocation Months} \le 36)$$
|
|
125
|
+
- Allocation journal entry:
|
|
126
|
+
- `Debit TK 642` (Administrative expenses) or `Debit TK 641` (Selling expenses) or `Debit TK 154` (Production costs).
|
|
127
|
+
- `Credit TK 242` (Prepaid expenses).
|
|
128
|
+
3. **Book-Tax Differences on TK 242**:
|
|
129
|
+
- **Internal Amortization > 36 Months**: If an enterprise amortizes office renovations over 60 months for management purposes, the tax authority strictly enforces the 36-month cap. Amortization expenses recorded in months 37–60 will be permanently disallowed for CIT deductions.
|
|
130
|
+
- **Lump-Sum Write-Off Violation**: Expensing large prepaid tool or renovation costs (e.g., > 100M VND) in a single month violates the matching principle and will be challenged during tax audits.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 4. Circular 45/2013 Fixed Asset Useful Life Depreciation Brackets (TK 214)
|
|
135
|
+
|
|
136
|
+
Under **Circular 45/2013/TT-BTC** (amended by Circular 147/2016/TT-BTC and Circular 28/2017/TT-BTC), tangible fixed assets must satisfy three concurrent conditions:
|
|
137
|
+
1. Future economic benefits are certain.
|
|
138
|
+
2. Useful life is estimated at **more than 01 year**.
|
|
139
|
+
3. Original historical cost is **30,000,000 VND or higher**.
|
|
140
|
+
|
|
141
|
+
### Statutory Useful Life Brackets (Circular 45 Appendix I)
|
|
142
|
+
Depreciation must be calculated within the minimum and maximum useful life brackets prescribed by the Ministry of Finance:
|
|
143
|
+
|
|
144
|
+
| Asset Class | Vietnamese Description | Statutory Useful Life Bracket |
|
|
145
|
+
| :--- | :--- | :--- |
|
|
146
|
+
| **Class A: Buildings & Structures** | Nhà cửa, vật kiến trúc | **10 to 50 years** (Industrial plants: 10–30 yrs; offices: 20–50 yrs) |
|
|
147
|
+
| **Class B: Machinery & Equipment** | Máy móc, thiết bị động lực | **3 to 20 years** (Manufacturing machines: 5–15 yrs) |
|
|
148
|
+
| **Class C: Transmission Equipment** | Phương tiện truyền dẫn | **4 to 10 years** (Power lines, pipelines, communications) |
|
|
149
|
+
| **Class D: Transport Equipment** | Thiết bị, phương tiện vận tải | **6 to 10 years** (Automobiles, trucks: 6–10 yrs) |
|
|
150
|
+
| **Class E: Office & IT Equipment** | Dụng cụ quản lý, máy vi tính | **3 to 8 years** (Laptops, servers, printers: 3–5 yrs) |
|
|
151
|
+
| **Class F: Intangible Assets** | Tài sản vô hình (phần mềm) | **2 to 20 years** (ERP software: 3–8 yrs; patents: legal duration) |
|
|
152
|
+
|
|
153
|
+
### Permitted Depreciation Methods
|
|
154
|
+
1. **Straight-Line Method (Khấu hao theo đường thẳng)**: Standard default method. Annual depreciation is uniform across the asset's registered useful life.
|
|
155
|
+
2. **Declining-Balance with Adjustment (Khấu hao theo số dư giảm dần có điều chỉnh)**: Permitted only for newly acquired machinery and equipment in high-tech or rapid technological innovation industries.
|
|
156
|
+
3. **Units-of-Production Method (Khấu hao theo sản lượng)**: Permitted when designed production capacity is established and annual production is predictable.
|
|
157
|
+
|
|
158
|
+
### Depreciation Allocation Entries (TK 214)
|
|
159
|
+
- Production equipment: `Debit TK 154` (TT 133) or `Debit TK 627` (TT 200) / `Credit TK 2141`.
|
|
160
|
+
- Selling vehicles/facilities: `Debit TK 6421` (TT 133) or `Debit TK 641` (TT 200) / `Credit TK 2141`.
|
|
161
|
+
- Head office & executive assets: `Debit TK 6422` (TT 133) or `Debit TK 642` (TT 200) / `Credit TK 2141`.
|
|
162
|
+
|
|
163
|
+
### Tax Non-Deductibility Threshold for Passenger Cars
|
|
164
|
+
Under Circular 96/2015/TT-BTC: For passenger cars with 9 seats or fewer (excluding cars used for commercial passenger transport, tourism, or hotel operations), depreciation corresponding to the portion of original historical cost exceeding **1,600,000,000 VND** (exclusive of VAT) is **non-deductible for CIT**.
|
|
165
|
+
- Annual excess depreciation must be tracked in the tax workpaper and added to taxable income via Box B4 on Form 03/TNDN.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 5. Chart of Accounts Crosswalk and Structural Rules
|
|
170
|
+
|
|
171
|
+
When transitioning or consolidating ledgers between Circular 200, Circular 133, and VFRS dual reporting, apply the following canonical crosswalk:
|
|
172
|
+
|
|
173
|
+
| Transaction Nature | Circular 200 Account | Circular 133 Account | VFRS Dual Layer Equivalent |
|
|
174
|
+
| :--- | :--- | :--- | :--- |
|
|
175
|
+
| Direct Raw Materials | `TK 621` | `TK 154 (Sub 1541)` | `COGS / WIP Inventory` |
|
|
176
|
+
| Direct Labor Cost | `TK 622` | `TK 154 (Sub 1542)` | `COGS / WIP Inventory` |
|
|
177
|
+
| Manufacturing Overhead | `TK 627` | `TK 154 (Sub 1543)` | `COGS / WIP Inventory` |
|
|
178
|
+
| Selling Expenses | `TK 641` | `TK 6421` | `Operating Expenses (Selling)` |
|
|
179
|
+
| General Administration | `TK 642` | `TK 6422` | `Operating Expenses (Admin)` |
|
|
180
|
+
| Long-Term Leases | Off-balance (`TK 001`) | Off-balance (`TK 001`) | `ROU Asset / Lease Liability` |
|
|
181
|
+
| Doubtful Debt Provision | `TK 2293` (Age-based) | `TK 2293` (Age-based) | `ECL Allowance (IFRS 9)` |
|
|
182
|
+
| Prepaid Allocation (<=36m) | `TK 242` | `TK 242` | `Prepayments / Other Assets` |
|
|
183
|
+
| Fixed Asset Depreciation | `TK 214` | `TK 214` | `Accumulated Depreciation` |
|
|
184
|
+
| Cost of Goods Sold | `TK 632` | `TK 632` | `Cost of Sales` |
|
|
185
|
+
| Financial Income | `TK 515` | `TK 515` | `Finance Income` |
|
|
186
|
+
| Financial Expenses | `TK 635` | `TK 635` | `Finance Costs` |
|
|
187
|
+
| Period Profit Clearing | `TK 911` | `TK 911` | `Retained Earnings Clearing` |
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 6. Regulatory Verification and Audit Checklist
|
|
192
|
+
|
|
193
|
+
- [ ] Legal entity size, ownership structure, and confirmed accounting regime documented.
|
|
194
|
+
- [ ] Circular 133 validation asserts absence of TK 621, 622, 623, 627, and 641.
|
|
195
|
+
- [ ] VFRS adjustment schedules maintained independently without altering statutory VAS general ledger.
|
|
196
|
+
- [ ] Prepaid expense master register asserts all amortizations under TK 242 $\le$ 36 months.
|
|
197
|
+
- [ ] Fixed asset register verifies registered useful life falls within Circular 45 Appendix I brackets.
|
|
198
|
+
- [ ] Passenger vehicle depreciation over 1.6 billion VND threshold properly segregated for CIT Box B4.
|
|
199
|
+
- [ ] Subledgers for TK 242 and TK 214 reconcile mathematically to General Ledger control accounts.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: optimize-olap-database
|
|
3
|
+
description: Design high-throughput OLAP schemas for Iceberg v4/v3, tune ClickHouse/DuckDB columnar engines, configure 8192-row sparse index granules, govern partition key cardinality, enable MinMax data skipping, implement streaming micro-batch buffering, profile query execution plans, enforce native table encryption (KMS), and prepare for Spark 4.1+/Flink 2.3. Use when designing, tuning, or troubleshooting high-throughput columnar databases and analytical storage engines.
|
|
4
|
+
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_build, run_tests]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Optimize OLAP Database
|
|
8
|
+
|
|
9
|
+
Use this skill when designing, tuning, or troubleshooting high-throughput columnar databases (ClickHouse, DuckDB, Apache Iceberg v3). For ad-hoc exploratory querying and cross-source joins, use `query-analytical-engine` instead.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- designing columnar database schemas and primary sorting keys for ClickHouse, DuckDB, or Apache Iceberg v4/v3
|
|
14
|
+
- configuring sparse primary index granules (8192-row alignment) to minimize index RAM footprint
|
|
15
|
+
- governing partition key cardinality (`PARTITION BY toYYYYMM`) to prevent the "Too many parts" error
|
|
16
|
+
- adding secondary data skipping indexes (minmax, set, bloom filter, tokenbf_v1) for non-prefix filter columns
|
|
17
|
+
- accelerating dimension lookups via LowCardinality dictionary encoding and in-memory external dictionaries
|
|
18
|
+
- designing streaming micro-batch ingestion pipelines (Buffer engine, Kafka MV, 256MB Parquet blocks)
|
|
19
|
+
- profiling query performance bottlenecks using `EXPLAIN PIPELINE`, `EXPLAIN ESTIMATE`, and `EXPLAIN PLAN`
|
|
20
|
+
- configuring automated TTL lifecycle policies for data expiration and tiered storage migration to S3
|
|
21
|
+
- deploying specialized MergeTree engines (ReplacingMergeTree, SummingMergeTree, AggregatingMergeTree)
|
|
22
|
+
- **implementing native table encryption (KMS) for Iceberg and Delta Lake tables**
|
|
23
|
+
- **preparing for Spark 4.1+ and Flink 2.3 compatibility**
|
|
24
|
+
|
|
25
|
+
## Core Rules
|
|
26
|
+
|
|
27
|
+
- **Sparse Index Granularity**: align ClickHouse primary keys with 8192-row granules (`index_granularity = 8192`); order primary key columns strictly from lowest to highest cardinality.
|
|
28
|
+
- **Partition Key Governance**: govern partition key cardinality to maintain <= 1000 active parts per table (e.g. `toYYYYMM(event_date)`); never partition by high-cardinality columns (UUID, timestamp by second).
|
|
29
|
+
- **Secondary Data Skipping**: configure `minmax`, `set(max_rows)`, or `bloom_filter` indexes on non-primary-key filter columns to eliminate unnecessary granule scans.
|
|
30
|
+
- **Dictionary Acceleration**: encode low-cardinality string columns as `LowCardinality(String)` and cache dimension tables in memory via `CREATE DICTIONARY` to replace distributed hash joins with O(1) lookups.
|
|
31
|
+
- **Micro-Batch Buffering**: prohibit single-row streaming inserts; enforce client or engine buffering (Buffer table engine or Kafka MV) with batches >= 10,000 rows or 5–30s flush intervals.
|
|
32
|
+
- **Engine Specialization**: leverage `ReplacingMergeTree` for deduplication, `SummingMergeTree` for metric accumulation, and `AggregatingMergeTree` with `-State`/`-Merge` combinators for pre-computed rollups.
|
|
33
|
+
- **Plan Profiling**: inspect execution plans via `EXPLAIN ESTIMATE` and `EXPLAIN PIPELINE header=1` before promoting queries to production dashboards.
|
|
34
|
+
- **TTL Lifecycle & Tiering**: declare table TTLs to purge stale data and tier cold partitions to S3 object storage (`TTL event_date + INTERVAL 30 DAY TO VOLUME 's3_cold'`).
|
|
35
|
+
- **Native Table Encryption (KMS)**: mandate AES-256 encryption at rest via cloud KMS (AWS KMS, GCP CMEK, Azure Key Vault) for all Iceberg and Delta Lake tables.
|
|
36
|
+
- **Spark 4.1+ & Flink 2.3 Readiness**: prepare OLAP schemas for compatibility with Spark 4.1+ compute engines and Flink 2.3 streaming sinks; validate schema evolution paths and partition evolution strategies.
|
|
37
|
+
- Detailed architecture, DDL templates, and profiling runbooks are maintained in [`references/olap-database-guide.md`](references/olap-database-guide.md).
|
|
38
|
+
|
|
39
|
+
## Suggested Process
|
|
40
|
+
|
|
41
|
+
### 1. Workload Profiling & Access Pattern Identification
|
|
42
|
+
Analyze query filter predicates, aggregation grains, and data arrival rates. Identify primary sort keys and dimension lookup requirements.
|
|
43
|
+
|
|
44
|
+
### 2. Schema Design & Primary Key Ordering
|
|
45
|
+
Define columnar DDL with `ORDER BY (tenant_id, event_date, event_type, id)`. Apply `LowCardinality(String)` to categorical columns.
|
|
46
|
+
|
|
47
|
+
### 3. Partition Strategy & Skipping Index Configuration
|
|
48
|
+
Configure coarse partition key (`PARTITION BY toYYYYMM(event_date)`). Attach secondary `minmax` and `bloom_filter` skipping indexes for selective non-key filters.
|
|
49
|
+
|
|
50
|
+
### 4. Ingestion Buffering & Engine Selection
|
|
51
|
+
Select MergeTree family engine (`ReplacingMergeTree`, `AggregatingMergeTree`). Configure client micro-batching or Buffer engine to guarantee batch flushes >= 10,000 rows.
|
|
52
|
+
|
|
53
|
+
### 5. Query Plan Profiling & Optimization Verification
|
|
54
|
+
Run `EXPLAIN ESTIMATE` and `EXPLAIN PIPELINE header=1`. Verify that index pruning eliminates >= 80% of unneeded granules without full table scans.
|
|
55
|
+
|
|
56
|
+
### 6. Native Encryption & Compatibility
|
|
57
|
+
Implement AES-256 encryption via KMS for all Iceberg tables. Validate Spark 4.1+ and Flink 2.3 compatibility for schema evolution and partition strategies.
|
|
58
|
+
|
|
59
|
+
### 7. Emit Data Pipeline Specification
|
|
60
|
+
Validate specifications against `contracts/schemas/data-pipeline-spec.json` and document schema properties.
|
|
61
|
+
|
|
62
|
+
## Checklist
|
|
63
|
+
|
|
64
|
+
- [ ] primary key columns ordered from lowest to highest cardinality with 8192-row granule alignment
|
|
65
|
+
- [ ] partition key expression evaluated to guarantee <= 1000 active parts across table lifecycle
|
|
66
|
+
- [ ] secondary skipping indexes (`minmax`, `set`, or `bloom_filter`) configured for non-primary filter columns
|
|
67
|
+
- [ ] low-cardinality categorical dimensions encoded via `LowCardinality(String)` or memory dictionaries
|
|
68
|
+
- [ ] streaming ingestion configured with micro-batch buffering (>= 10,000 rows or 5–30s intervals)
|
|
69
|
+
- [ ] query execution plan profiled via `EXPLAIN ESTIMATE` and `EXPLAIN PIPELINE header=1`
|
|
70
|
+
- [ ] automated TTL policies configured for data retention and S3 tiered storage migration
|
|
71
|
+
- [ ] schema specifications emitted and validated against `contracts/schemas/data-pipeline-spec.json`
|
|
72
|
+
- [ ] **Native table encryption (KMS) implemented** for Iceberg and Delta Lake tables
|
|
73
|
+
- [ ] **Spark 4.1+ and Flink 2.3 compatibility validated** for schema evolution and partition strategies
|
|
74
|
+
|
|
75
|
+
## Related Skills
|
|
76
|
+
|
|
77
|
+
- **build-data-pipeline**: Design transactional lakehouse pipelines and WAP branches for Iceberg tables
|
|
78
|
+
- **database-maintenance**: Execute 256MB bin-pack compaction and snapshot expiration
|
|
79
|
+
- **query-analytical-engine**: Execute in-process embedded SQL via chDB/DuckDB and cross-source joins
|
|
80
|
+
- **create-migration**: Author version-controlled DDL migration scripts for relational stores
|
|
81
|
+
- **security-audit**: Audit access control, TLS encryption, and PII masking across analytical stores
|
|
82
|
+
|
|
83
|
+
## Output Contracts
|
|
84
|
+
|
|
85
|
+
When emitting OLAP database specifications and performance audit results, emit:
|
|
86
|
+
|
|
87
|
+
- `contracts/schemas/data-pipeline-spec.json` — complete table definition, engine parameters, partition key, index granules, buffering rules, TTL policies, **native encryption (KMS) config, Spark 4.1+/Flink 2.3 compatibility notes**.
|
|
88
|
+
- `contracts/schemas/data-analysis-report.json` — query profiling benchmarks, scanned parts/marks metrics, and storage reduction figures.
|
|
89
|
+
|
|
90
|
+
## Failure Modes
|
|
91
|
+
|
|
92
|
+
- **Part fragmentation storm**: high-frequency single-row inserts create thousands of tiny parts, causing "Too many parts" merge errors. Mitigation: enforce micro-batch buffering >= 10,000 rows.
|
|
93
|
+
- **Over-partitioning catastrophe**: partitioning by high-cardinality columns exhausts filesystem inodes and crashes merges. Mitigation: restrict partition keys to coarse date ranges (`toYYYYMM`).
|
|
94
|
+
- **Primary key prefix misordering**: high-cardinality column placed first in `ORDER BY` disables pruning for subsequent columns. Mitigation: sort primary keys by cardinality ascending.
|
|
95
|
+
- **Unindexed cartesian joins**: joining large tables without dictionaries or subquery projections exhausts memory. Mitigation: pre-cache dimension tables in dictionaries and use `dictGet()`.
|
|
96
|
+
- **Missing native table encryption (KMS)**: Iceberg tables lack AES-256 encryption at rest. Mitigation: mandate KMS-managed encryption for all production lakehouse tables.
|
|
97
|
+
- **Incompatible with Spark 4.1+/Flink 2.3**: OLAP schemas break with newer compute engines. Mitigation: validate compatibility, test schema evolution paths, prepare for VARIANT type support.
|
|
98
|
+
|
|
99
|
+
## Security Guardrails (OWASP ASI)
|
|
100
|
+
|
|
101
|
+
- **ASI03 Identity & Privilege Abuse**: enforce role-based access control and read-only connection scoping for analytical query clients.
|
|
102
|
+
- **ASI04 Supply Chain**: validate database connectors, dictionary source drivers, and extension packages against verified package repositories.
|
|
103
|
+
- **ASI05 RCE Guard**: prohibit unvalidated raw SQL execution; parameterize dynamic filters and sanitize table identifiers.
|
|
104
|
+
- **ASI06 Context & Memory Poisoning**: sanitize document table extracts (Kreuzberg patterns) and validate schema contracts before lakehouse persistence.
|
|
105
|
+
- **ASI07 Inter-Agent Communication**: emit machine-readable `data-pipeline-spec.json` contracts for downstream agents.
|
|
106
|
+
- **ASI09 Human-Agent Trust Exploitation**: report true scanned row counts, query latencies, and storage overhead transparently.
|
|
107
|
+
- **NATIVE-ENCRYPTION-LOCK**: all Iceberg and Delta Lake tables must enforce AES-256 encryption at rest via cloud KMS; encryption keys managed through catalog-integrated key management.
|
|
108
|
+
- **SPARK-FLINK-COMPATIBILITY-LOCK**: OLAP schemas must maintain compatibility with Spark 4.1+ compute engines and Flink 2.3 streaming sinks; validate schema evolution paths and partition strategies.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Optimize OLAP Database"
|
|
3
|
+
short_description: "Design high-throughput OLAP schemas, sparse indexing, and query tuning"
|
|
4
|
+
default_prompt: "Use $optimize-olap-database to design, tune, or optimize columnar database schemas, indexing granules, partition keys, or micro-batch ingestion."
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
# OLAP Database Architecture & Optimization Guide
|
|
2
|
+
|
|
3
|
+
This reference provides technical architecture specifications, DDL patterns, and query performance tuning runbooks for high-throughput columnar analytical databases (ClickHouse, DuckDB, Apache Iceberg v3).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Columnar Storage Architecture
|
|
8
|
+
|
|
9
|
+
Columnar database engines organize data on physical storage by column rather than row. This architecture provides three primary performance advantages:
|
|
10
|
+
1. **Extreme Compression Ratios**: Storing homogenous data types contiguously allows specialized compression algorithms (LZ4, ZSTD, Delta, DoubleDelta, Gorilla, T64) to achieve 5x–15x storage reduction.
|
|
11
|
+
2. **I/O Projection Minimization**: Queries touch only the columns explicitly requested in `SELECT` and `WHERE` clauses, skipping unreferenced attributes entirely.
|
|
12
|
+
3. **SIMD Vectorized Processing**: In-memory execution engines evaluate operations over contiguous vectors of primitives using hardware SIMD (AVX-512, ARM NEON) instructions.
|
|
13
|
+
|
|
14
|
+
### Comparative Architectural Matrix
|
|
15
|
+
|
|
16
|
+
| Dimension | ClickHouse (MergeTree) | DuckDB (v1.1+) | Apache Iceberg v3 |
|
|
17
|
+
| :--- | :--- | :--- | :--- |
|
|
18
|
+
| **Primary Deployment** | Distributed high-throughput cluster & embedded chDB | In-process embedded engine | Open lakehouse format on object storage (S3/GCS) |
|
|
19
|
+
| **Index Granularity** | 8,192 rows per granule (`index_granularity = 8192`) | 122,880 rows per standard Parquet Row Group | Manifest file file-level and column-level stats |
|
|
20
|
+
| **Sorting & Clustering** | `ORDER BY (col1, col2, ...)` defines disk order | Sorting during write / ART index | Sorted / Z-Ordered / Liquid clustered data files |
|
|
21
|
+
| **Partition Scheme** | `PARTITION BY expr` (coarse time windows) | Directory-based Hive partitioning | Hidden partition evolution (`spec_id`) |
|
|
22
|
+
| **Mutation Paradigm** | Immutable parts merged asynchronously | MVCC with undo logs, local ACID | RoaringBitmap Deletion Vectors (Puffin format) |
|
|
23
|
+
| **Target Workload** | High-concurrency analytics, real-time ingestion | In-process analytical pipelines, zero-copy joins | Lakehouse storage, multi-engine transactions |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. Sparse Primary Index Mechanics & 8192-Row Granules
|
|
28
|
+
|
|
29
|
+
Relational databases employ dense B-Tree indexes that store a pointer for every single row. In petabyte-scale analytics, dense indexes exceed available RAM. ClickHouse instead implements a **sparse primary index**:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Data Parts on Disk (Physical Column Storage):
|
|
33
|
+
[Granule 0: Rows 0..8191] -> [Granule 1: Rows 8192..16383] -> [Granule 2: Rows 16384..24575]
|
|
34
|
+
^ ^ ^
|
|
35
|
+
| | |
|
|
36
|
+
Marks (.mrk2): Offset in .bin Offset in .bin Offset in .bin
|
|
37
|
+
^ ^ ^
|
|
38
|
+
| | |
|
|
39
|
+
Primary Index (primary.idx in RAM):
|
|
40
|
+
[Mark 0: (tenant=1, date=2026-01-01)] -> [Mark 1: (tenant=1, date=2026-01-05)] -> [Mark 2: (tenant=2, date=2026-01-01)]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Granule Indexing Lifecycle
|
|
44
|
+
1. **Granule Marks**: ClickHouse segments column data into granules of 8,192 rows (configurable via `index_granularity`). The primary index file (`primary.idx`) stores the primary key column values only for the *first row of each granule*.
|
|
45
|
+
2. **Marks File (`.mrk2`)**: Acts as a lookup table bridging the in-memory `primary.idx` to exact byte offsets (both compressed block offset and uncompressed intra-block offset) in column `.bin` files.
|
|
46
|
+
3. **Binary Search Pruning**: When executing a query with a filter matching the primary key prefix, ClickHouse performs binary search on `primary.idx` in RAM, identifies candidate granule ranges, and streams only matching granules from disk.
|
|
47
|
+
|
|
48
|
+
### Primary Key Ordering Rules
|
|
49
|
+
- **Cardinality Ascending Principle**: Sort keys must be ordered from **lowest cardinality to highest cardinality**:
|
|
50
|
+
```sql
|
|
51
|
+
ORDER BY (tenant_id, event_date, event_type, user_id)
|
|
52
|
+
```
|
|
53
|
+
- **Prefix Pruning Invariant**: If a high-cardinality column (such as UUID or millisecond timestamp) is placed at the front of the sort key, subsequent columns cannot effectively prune granules because each granule will contain different prefix values.
|
|
54
|
+
- **Index Granularity Tuning**: While 8192 rows is optimal for 95% of workloads, small lookup tables may use smaller granules (`index_granularity = 1024`), while wide telemetry tables may use `index_granularity = 16384` to reduce marks overhead.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 3. Partition Key Cardinality Governance
|
|
59
|
+
|
|
60
|
+
Partitions in MergeTree tables are physical filesystem directories that contain data parts.
|
|
61
|
+
|
|
62
|
+
### The "Too Many Parts" Failure Mode
|
|
63
|
+
When a table is partitioned on a high-cardinality key (e.g. `user_id` or `toYYYYMMDDhh(event_time)`):
|
|
64
|
+
1. Ingestion creates a separate part file in every active partition directory for each insert batch.
|
|
65
|
+
2. The number of unmerged parts explodes past system thresholds.
|
|
66
|
+
3. Background merge threads are overwhelmed, inode consumption exhausts OS limits, and ClickHouse rejects writes with:
|
|
67
|
+
`DB::Exception: Too many parts in all data parts in table (N > 300)`.
|
|
68
|
+
|
|
69
|
+
### Partitioning Rules & Guardrails
|
|
70
|
+
- **Cardinality Ceiling**: Total active partitions across a table's lifecycle must remain **<= 1000** (ideally between 10 and 200).
|
|
71
|
+
- **Standard Temporal Pattern**: Always partition by month using coarse temporal expressions:
|
|
72
|
+
```sql
|
|
73
|
+
PARTITION BY toYYYYMM(event_date)
|
|
74
|
+
```
|
|
75
|
+
- **Prohibited Partition Keys**: Never partition by user ID, device UUID, customer ID, or timestamps finer than a single day. For sub-daily slicing, rely on the sparse primary key `ORDER BY` clause.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 4. Secondary Data Skipping Indexes
|
|
80
|
+
|
|
81
|
+
When queries frequently filter on columns that cannot be placed in the primary key prefix, secondary data skipping indexes allow ClickHouse to prune granules during execution:
|
|
82
|
+
|
|
83
|
+
```sql
|
|
84
|
+
CREATE TABLE access_logs (
|
|
85
|
+
tenant_id UInt32,
|
|
86
|
+
event_time DateTime64(3),
|
|
87
|
+
event_date Date DEFAULT toDate(event_time),
|
|
88
|
+
client_ip String,
|
|
89
|
+
http_status UInt16,
|
|
90
|
+
request_path String,
|
|
91
|
+
bytes_sent UInt64,
|
|
92
|
+
INDEX idx_status http_status TYPE minmax GRANULARITY 2,
|
|
93
|
+
INDEX idx_ip client_ip TYPE set(500) GRANULARITY 1,
|
|
94
|
+
INDEX idx_path request_path TYPE tokenbf_v1(30720, 2, 0) GRANULARITY 1
|
|
95
|
+
)
|
|
96
|
+
ENGINE = MergeTree()
|
|
97
|
+
PARTITION BY toYYYYMM(event_date)
|
|
98
|
+
ORDER BY (tenant_id, event_date, event_time);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Skipping Index Types
|
|
102
|
+
1. **`minmax`**: Stores minimum and maximum values for a column across $N$ granules. Best for monotonically increasing or clustered numeric and timestamp columns.
|
|
103
|
+
2. **`set(max_rows)`**: Stores a set of unique column values across $N$ granules. If unique values exceed `max_rows`, it falls back to minmax. Ideal for low-to-medium cardinality categorical values (e.g., status codes, region codes).
|
|
104
|
+
3. **`bloom_filter([false_positive])`**: Evaluates Bloom filters for exact value matching. Highly effective for selective string searches.
|
|
105
|
+
4. **`tokenbf_v1(size, hash_functions, seed)`**: Tokenizes strings by whitespace and punctuation and indexes tokens in a Bloom filter. Optimized for URL paths, error messages, and SQL query logs.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 5. Dictionary Acceleration & LowCardinality Encodings
|
|
110
|
+
|
|
111
|
+
### `LowCardinality(String)`
|
|
112
|
+
For string columns containing fewer than 10,000 distinct values, wrap the type as `LowCardinality(String)`. ClickHouse stores a localized dictionary of strings per part and references entries using compact integer positions (UInt8 or UInt16):
|
|
113
|
+
- Reduces on-disk storage by 60%–80%.
|
|
114
|
+
- Accelerates string equality comparisons to integer comparisons using SIMD vector instructions.
|
|
115
|
+
|
|
116
|
+
### Memory-Resident External Dictionaries
|
|
117
|
+
Distributed joins in OLAP databases incur massive network shuffle costs. ClickHouse overcomes this by caching dimension tables in memory-resident dictionaries:
|
|
118
|
+
|
|
119
|
+
```sql
|
|
120
|
+
CREATE DICTIONARY dim_organizations (
|
|
121
|
+
org_id UInt64,
|
|
122
|
+
org_name String,
|
|
123
|
+
plan_tier LowCardinality(String),
|
|
124
|
+
is_enterprise UInt8
|
|
125
|
+
)
|
|
126
|
+
PRIMARY KEY org_id
|
|
127
|
+
SOURCE(CLICKHOUSE(TABLE 'organizations_source'))
|
|
128
|
+
LIFETIME(MIN 300 MAX 600)
|
|
129
|
+
LAYOUT(HASHED());
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Querying with `dictGet`
|
|
133
|
+
Replace expensive hash joins with $O(1)$ dictionary lookups:
|
|
134
|
+
|
|
135
|
+
```sql
|
|
136
|
+
-- Join-free dimension enrichment
|
|
137
|
+
SELECT
|
|
138
|
+
event_date,
|
|
139
|
+
dictGet('dim_organizations', 'org_name', org_id) AS organization_name,
|
|
140
|
+
count() AS total_events
|
|
141
|
+
FROM telemetry_events
|
|
142
|
+
WHERE event_date >= today() - 7
|
|
143
|
+
GROUP BY event_date, organization_name;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 6. Streaming Micro-Batch Buffering Architecture
|
|
149
|
+
|
|
150
|
+
Every `INSERT` statement in ClickHouse writes an immutable part file to disk. High-frequency, single-row writes (100 inserts/sec) rapidly crash the merge scheduler. High-throughput ingestion requires micro-batch buffering.
|
|
151
|
+
|
|
152
|
+
### 6.1 Buffer Table Engine
|
|
153
|
+
The `Buffer` table engine accumulates write traffic in memory and flushes to an underlying MergeTree table when configured thresholds are reached:
|
|
154
|
+
|
|
155
|
+
```sql
|
|
156
|
+
-- Target table for durable storage
|
|
157
|
+
CREATE TABLE raw_events_sink (
|
|
158
|
+
event_time DateTime64(3),
|
|
159
|
+
tenant_id UInt32,
|
|
160
|
+
payload String
|
|
161
|
+
)
|
|
162
|
+
ENGINE = MergeTree()
|
|
163
|
+
PARTITION BY toYYYYMM(toDate(event_time))
|
|
164
|
+
ORDER BY (tenant_id, event_time);
|
|
165
|
+
|
|
166
|
+
-- Buffer table for client writes
|
|
167
|
+
CREATE TABLE raw_events_buffer AS raw_events_sink
|
|
168
|
+
ENGINE = Buffer(
|
|
169
|
+
currentDatabase(), raw_events_sink,
|
|
170
|
+
16, -- num_layers: parallel write buffers
|
|
171
|
+
10, -- min_time: flush if older than 10s and min thresholds met
|
|
172
|
+
60, -- max_time: force flush after 60s
|
|
173
|
+
10000, -- min_rows: flush if >= 10,000 rows
|
|
174
|
+
1000000, -- max_rows: force flush if >= 1,000,000 rows
|
|
175
|
+
10485760, -- min_bytes: flush if >= 10MB
|
|
176
|
+
104857600 -- max_bytes: force flush if >= 100MB
|
|
177
|
+
);
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### 6.2 Kafka Engine + Materialized View Pipeline
|
|
181
|
+
For direct real-time ingestion from Apache Kafka, decouple consumption from storage using the Kafka table engine and an atomic Materialized View:
|
|
182
|
+
|
|
183
|
+
```sql
|
|
184
|
+
-- 1. Kafka consumer table (ephemeral stream)
|
|
185
|
+
CREATE TABLE kafka_telemetry_stream (
|
|
186
|
+
event_time DateTime64(3),
|
|
187
|
+
tenant_id UInt32,
|
|
188
|
+
payload String
|
|
189
|
+
)
|
|
190
|
+
ENGINE = Kafka
|
|
191
|
+
SETTINGS
|
|
192
|
+
kafka_broker_list = 'kafka:9092',
|
|
193
|
+
kafka_topic_list = 'telemetry-topic',
|
|
194
|
+
kafka_group_name = 'ch_telemetry_group',
|
|
195
|
+
kafka_format = 'JSONEachRow',
|
|
196
|
+
kafka_num_consumers = 2;
|
|
197
|
+
|
|
198
|
+
-- 2. Materialized view transforming and batching into target table
|
|
199
|
+
CREATE MATERIALIZED VIEW mv_telemetry_to_sink TO raw_events_sink AS
|
|
200
|
+
SELECT event_time, tenant_id, payload
|
|
201
|
+
FROM kafka_telemetry_stream;
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 7. Query Plan Profiling Runbook
|
|
207
|
+
|
|
208
|
+
Before deploying analytical queries to production dashboards or APIs, inspect the physical execution graph and index pruning efficiency:
|
|
209
|
+
|
|
210
|
+
### 7.1 `EXPLAIN ESTIMATE`
|
|
211
|
+
Quickly verify how many parts, marks, and rows ClickHouse will read before executing the query:
|
|
212
|
+
```sql
|
|
213
|
+
EXPLAIN ESTIMATE
|
|
214
|
+
SELECT count()
|
|
215
|
+
FROM telemetry_events
|
|
216
|
+
WHERE tenant_id = 42 AND event_date = '2026-09-18';
|
|
217
|
+
```
|
|
218
|
+
Output inspection:
|
|
219
|
+
- `parts`: Number of data parts selected (must be a small fraction of total parts).
|
|
220
|
+
- `rows`: Estimated row count to read.
|
|
221
|
+
- `marks`: Granules scanned (must verify that primary key pruning eliminates >80% of marks).
|
|
222
|
+
|
|
223
|
+
### 7.2 `EXPLAIN PIPELINE header=1`
|
|
224
|
+
Inspects multi-threaded pipeline execution, identifying pipeline stalls and concurrency bottlenecks:
|
|
225
|
+
```sql
|
|
226
|
+
EXPLAIN PIPELINE header=1
|
|
227
|
+
SELECT event_type, count()
|
|
228
|
+
FROM telemetry_events
|
|
229
|
+
WHERE tenant_id = 42
|
|
230
|
+
GROUP BY event_type;
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### 7.3 `EXPLAIN PLAN indexes=1, actions=1`
|
|
234
|
+
Verifies whether primary keys and secondary skipping indexes were utilized:
|
|
235
|
+
- Look for `Selected Parts: X, Selected Marks: Y, Total Marks: Z`.
|
|
236
|
+
- High efficiency: `Selected Marks / Total Marks < 0.10` (90%+ marks pruned).
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 8. Specialized MergeTree Engines
|
|
241
|
+
|
|
242
|
+
### 8.1 `ReplacingMergeTree`
|
|
243
|
+
Deduplicates records sharing the same sorting key during background merges, retaining the row with the highest version (`ver`):
|
|
244
|
+
```sql
|
|
245
|
+
CREATE TABLE dimension_users (
|
|
246
|
+
user_id UInt64,
|
|
247
|
+
email String,
|
|
248
|
+
tier LowCardinality(String),
|
|
249
|
+
updated_at DateTime64(3)
|
|
250
|
+
)
|
|
251
|
+
ENGINE = ReplacingMergeTree(updated_at)
|
|
252
|
+
ORDER BY user_id;
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### 8.2 `SummingMergeTree`
|
|
256
|
+
Automatically aggregates numeric metrics across identical primary keys during background merges:
|
|
257
|
+
```sql
|
|
258
|
+
CREATE TABLE metric_hourly_rollups (
|
|
259
|
+
metric_name LowCardinality(String),
|
|
260
|
+
bucket_hour DateTime,
|
|
261
|
+
total_count UInt64,
|
|
262
|
+
error_count UInt64
|
|
263
|
+
)
|
|
264
|
+
ENGINE = SummingMergeTree((total_count, error_count))
|
|
265
|
+
ORDER BY (metric_name, bucket_hour);
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### 8.3 `AggregatingMergeTree`
|
|
269
|
+
Stores intermediate aggregate states (`AggregateFunction`), enabling exact and approximate aggregations over billions of rows in milliseconds:
|
|
270
|
+
```sql
|
|
271
|
+
CREATE TABLE telemetry_aggregates (
|
|
272
|
+
tenant_id UInt32,
|
|
273
|
+
event_date Date,
|
|
274
|
+
p95_latency AggregateFunction(quantile(0.95), Float64),
|
|
275
|
+
unique_users AggregateFunction(uniq, UInt64)
|
|
276
|
+
)
|
|
277
|
+
ENGINE = AggregatingMergeTree()
|
|
278
|
+
ORDER BY (tenant_id, event_date);
|
|
279
|
+
|
|
280
|
+
-- Querying using combinators
|
|
281
|
+
SELECT
|
|
282
|
+
tenant_id,
|
|
283
|
+
event_date,
|
|
284
|
+
quantileMerge(0.95)(p95_latency) AS latency_p95,
|
|
285
|
+
uniqMerge(unique_users) AS total_active_users
|
|
286
|
+
FROM telemetry_aggregates
|
|
287
|
+
GROUP BY tenant_id, event_date;
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 9. Automated TTL Lifecycle & Tiered Storage Policies
|
|
293
|
+
|
|
294
|
+
Configure storage tiering and automatic partition purging directly in table DDL:
|
|
295
|
+
|
|
296
|
+
```sql
|
|
297
|
+
CREATE TABLE audit_telemetry (
|
|
298
|
+
event_time DateTime64(3),
|
|
299
|
+
event_date Date DEFAULT toDate(event_time),
|
|
300
|
+
tenant_id UInt32,
|
|
301
|
+
details String
|
|
302
|
+
)
|
|
303
|
+
ENGINE = MergeTree()
|
|
304
|
+
PARTITION BY toYYYYMM(event_date)
|
|
305
|
+
ORDER BY (tenant_id, event_date, event_time)
|
|
306
|
+
TTL event_date + INTERVAL 30 DAY TO VOLUME 's3_cold',
|
|
307
|
+
event_date + INTERVAL 365 DAY DELETE;
|
|
308
|
+
```
|
|
309
|
+
- **NVMe to S3 Tiering**: Data older than 30 days is moved by background threads to cold S3 object storage without query interruption.
|
|
310
|
+
- **Automated Delete**: Partitions or rows older than 365 days are permanently dropped.
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 10. Document & Table Extraction Pipeline (Kreuzberg Pattern)
|
|
315
|
+
|
|
316
|
+
Unstructured operational documents (PDF/DOCX reports, regulatory filings) frequently contain tabular datasets required in OLAP systems.
|
|
317
|
+
|
|
318
|
+
### Extraction Architecture
|
|
319
|
+
1. **Kreuzberg Engine**: High-throughput parsing detects table boundaries, multi-line headers, and cell alignments.
|
|
320
|
+
2. **Schema & Contract Validation**: Extracted tabular structures are parsed into typed Apache Arrow RecordBatches and validated against Open Data Contract Standard (ODCS v3.1.0) definitions.
|
|
321
|
+
3. **Deterministic Natural Keys**: Rows are assigned deterministic SHA-256 composite identifiers:
|
|
322
|
+
```
|
|
323
|
+
natural_key = SHA256(document_hash || '|' || table_index || '|' || row_index)
|
|
324
|
+
```
|
|
325
|
+
4. **Idempotent Ingestion**: Data is staged into Iceberg or ClickHouse `ReplacingMergeTree` tables using micro-batch buffers, guaranteeing zero duplicate entries upon pipeline retry.
|