ai-developer-skill-os 7.5.1 → 8.1.4
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/.agents/docs/ARCHITECTURE.md +156 -0
- package/.agents/docs/MIGRATION-CLEANUP-V8.1.3.md +36 -0
- package/.agents/docs/MIGRATION-STATUS.md +35 -0
- package/.agents/docs/MIGRATION-V8.md +10 -0
- package/.agents/docs/ROADMAP-V8.2.md +78 -0
- package/.agents/docs/V8-CERTIFICATION.md +27 -0
- package/.agents/docs/VERSIONING.md +95 -0
- package/.agents/docs/decisions/ADR-001-v8-migration.md +58 -0
- package/.agents/docs/decisions/ADR-002-workflow-separation.md +50 -0
- package/.agents/docs/decisions/ADR-003-registry-generated.md +54 -0
- package/.agents/docs/decisions/ADR-008-skill-boundary-review.md +27 -0
- package/.agents/docs/schemas/learning.schema.yml +69 -0
- package/.agents/docs/schemas/skill.schema.yml +188 -0
- package/.agents/docs/schemas/workflow.schema.yml +33 -0
- package/.agents/knowledge/design-intelligence/industries/ecommerce.md +3 -0
- package/.agents/knowledge/design-intelligence/industries/fintech.md +3 -0
- package/.agents/knowledge/design-intelligence/industries/healthcare.md +3 -0
- package/.agents/learnings/draft/README.md +37 -0
- package/.agents/registry/capability-graph.yml +500 -0
- package/.agents/registry/skills-index.yml +525 -0
- package/.agents/reports/RELEASE-CHECKLIST.md +29 -0
- package/.agents/reports/architecture-audit.md +13 -0
- package/.agents/reports/graph-health.md +20 -0
- package/.agents/reports/skill-audit.md +215 -0
- package/.agents/rules/coding.md +102 -0
- package/.agents/rules/command-safety.md +21 -0
- package/.agents/rules/global.md +135 -0
- package/.agents/rules/priorities.yml +24 -0
- package/.agents/rules/safety.md +84 -0
- package/.agents/rules/security.md +13 -0
- package/.agents/rules/skill-quality.md +14 -0
- package/.agents/skills/_template/SKILL.md +132 -0
- package/.agents/skills/qk-access-policy/SKILL.md +61 -5
- package/.agents/skills/qk-agent-observability/SKILL.md +73 -0
- package/.agents/skills/qk-ai-builder/SKILL.md +62 -5
- package/.agents/skills/qk-api-lifecycle/SKILL.md +59 -6
- package/.agents/skills/qk-bug-resolution/SKILL.md +64 -6
- package/.agents/skills/qk-context-loader/SKILL.md +63 -11
- package/.agents/skills/qk-data-lifecycle/SKILL.md +61 -5
- package/.agents/skills/qk-db-optimizer/SKILL.md +61 -5
- package/.agents/skills/qk-design-system-engineering/SKILL.md +112 -0
- package/.agents/skills/qk-devops-platform/SKILL.md +117 -0
- package/.agents/skills/qk-docs/SKILL.md +62 -6
- package/.agents/skills/qk-engineering-standard/SKILL.md +62 -12
- package/.agents/skills/qk-fe-api-integration/SKILL.md +60 -6
- package/.agents/skills/qk-feature-delivery/SKILL.md +65 -6
- package/.agents/skills/qk-frontend-architecture/SKILL.md +134 -0
- package/.agents/skills/qk-help/SKILL.md +245 -193
- package/.agents/skills/qk-orchestrator/SKILL.md +64 -11
- package/.agents/skills/qk-orchestrator/references/routing-table.md +1 -1
- package/.agents/skills/qk-product-specification/SKILL.md +130 -0
- package/.agents/skills/qk-production-release/SKILL.md +59 -6
- package/.agents/skills/qk-project-bootstrap/SKILL.md +66 -6
- package/.agents/skills/qk-project-health/SKILL.md +63 -6
- package/.agents/skills/qk-project-memory/SKILL.md +63 -6
- package/.agents/skills/qk-security-audit/SKILL.md +135 -0
- package/.agents/skills/qk-system-evolution/SKILL.md +63 -12
- package/.agents/skills/qk-test-engineering/SKILL.md +139 -0
- package/.agents/skills/qk-ui-audit/SKILL.md +60 -6
- package/.agents/skills/qk-ui-builder/SKILL.md +509 -446
- package/.agents/skills/qk-ui-system-builder/SKILL.md +61 -5
- package/.agents/skills/qk-validation-gate/SKILL.md +63 -11
- package/.agents/skills/qk-web-quality-gate/SKILL.md +114 -0
- package/.agents/workflows/_schema.yml +109 -0
- package/.agents/workflows/bug-resolution.yml +101 -0
- package/.agents/workflows/code-review.yml +77 -0
- package/.agents/workflows/documentation.yml +75 -0
- package/.agents/workflows/feature-delivery.yml +103 -0
- package/.agents/workflows/refactor.yml +81 -0
- package/.agents/workflows/research.yml +60 -0
- package/.agents/workflows/security-audit.yml +72 -0
- package/.agents/workflows/skill-evolution.yml +65 -0
- package/.agents/workflows/spec-driven-development.yml +57 -0
- package/CHANGELOG.md +91 -70
- package/README.md +44 -59
- package/bin/install.js +57 -309
- package/package.json +13 -2
- package/tooling/generate-evaluation-cases.cjs +44 -0
- package/tooling/generate-registry.js +157 -0
- package/tooling/run-aar.js +143 -0
- package/tooling/validate-graph.js +87 -0
- package/tooling/validate-skills.js +102 -0
- package/.agents/skills.json +0 -819
- package/.github/workflows/ci.yml +0 -56
- package/CLAUDE.md +0 -110
- package/_template/BEHAVIOR_SPEC.md +0 -96
- package/_template/examples/example-en.md +0 -49
- package/_template/examples/example-vi.md +0 -49
- package/add_lang.js +0 -21
- package/add_lang.py +0 -25
- package/add_sections.py +0 -53
- package/bin/lint.js +0 -123
- package/docs/CHI_TIET_SKILLS.md +0 -126
- package/docs/GOVERNANCE.md +0 -40
- package/docs/HUONG_DAN_SU_DUNG.md +0 -120
- package/docs/SPEC.md +0 -87
- package/docs/adr/0001-intent-based-architecture.md +0 -19
- package/docs/adr/0002-kernel-freeze.md +0 -21
- package/docs/adr/0003-risk-based-verification.md +0 -20
- package/docs/adr/0004-progressive-evidence.md +0 -19
- package/docs/skill-classification.md +0 -25
- package/fix_seeds.js +0 -22
- package/framework/KERNEL.md +0 -83
- package/framework/bias-library/cosmetic-refactor.md +0 -21
- package/framework/bias-library/enterprise-crud.md +0 -21
- package/framework/bias-library/fake-ui-slop.md +0 -20
- package/framework/bias-library/hallucinated-tools.md +0 -20
- package/framework/bias-library/missing-ui-states.md +0 -19
- package/framework/bias-library/over-indexing.md +0 -20
- package/framework/bias-library/swallow-errors.md +0 -19
- package/framework/bias-library/ui-only-security.md +0 -17
- package/framework/decision-primitives.md +0 -48
- package/framework/dial-library/complexity-budget.md +0 -13
- package/framework/dial-library/granularity.md +0 -13
- package/framework/dial-library/optimization-strategy.md +0 -13
- package/framework/dial-library/strictness.md +0 -13
- package/framework/rule-library/delegation-only.md +0 -9
- package/framework/rule-library/minimal-diff.md +0 -9
- package/framework/skill-schema.md +0 -310
- package/knowledge/backend/nodejs.md +0 -52
- package/knowledge/frontend/react.md +0 -81
- package/migrate-to-v6.js +0 -130
- package/migrate.js +0 -147
- package/migrate.py +0 -133
- package/migrate_all.cjs +0 -96
- package/patch.js +0 -15
- package/patch.py +0 -89
- package/patch2.py +0 -83
- package/rename.js +0 -64
- package/skills/_archive_old_skills/qk-accessibility-audit/SKILL.md +0 -121
- package/skills/_archive_old_skills/qk-agent-orchestrator/SKILL.md +0 -179
- package/skills/_archive_old_skills/qk-api-integration/SKILL.md +0 -389
- package/skills/_archive_old_skills/qk-auth-security/SKILL.md +0 -96
- package/skills/_archive_old_skills/qk-backend-architecture/SKILL.md +0 -125
- package/skills/_archive_old_skills/qk-bug-fix/SKILL.md +0 -213
- package/skills/_archive_old_skills/qk-component-generator/SKILL.md +0 -136
- package/skills/_archive_old_skills/qk-context-manager/SKILL.md +0 -175
- package/skills/_archive_old_skills/qk-database-engineer/SKILL.md +0 -104
- package/skills/_archive_old_skills/qk-deployment/SKILL.md +0 -96
- package/skills/_archive_old_skills/qk-design-system/SKILL.md +0 -137
- package/skills/_archive_old_skills/qk-form-builder/SKILL.md +0 -140
- package/skills/_archive_old_skills/qk-frontend-architecture/SKILL.md +0 -155
- package/skills/_archive_old_skills/qk-frontend-debug/SKILL.md +0 -133
- package/skills/_archive_old_skills/qk-frontend-performance/SKILL.md +0 -129
- package/skills/_archive_old_skills/qk-frontend-testing/SKILL.md +0 -146
- package/skills/_archive_old_skills/qk-git-engineer/SKILL.md +0 -304
- package/skills/_archive_old_skills/qk-help/SKILL.md +0 -68
- package/skills/_archive_old_skills/qk-migration/SKILL.md +0 -284
- package/skills/_archive_old_skills/qk-project-audit/SKILL.md +0 -280
- package/skills/_archive_old_skills/qk-refactor/SKILL.md +0 -222
- package/skills/_archive_old_skills/qk-state-management/SKILL.md +0 -140
- package/skills/_archive_old_skills/qk-table-crud-generator/SKILL.md +0 -127
- package/skills/_archive_old_skills/qk-ui-builder/SKILL.md +0 -152
- package/skills/_template/SKILL.md +0 -239
- package/skills/qk-access-policy/SKILL.md +0 -180
- package/skills/qk-ai-builder/SKILL.md +0 -216
- package/skills/qk-api-lifecycle/SKILL.md +0 -177
- package/skills/qk-bug-resolution/SKILL.md +0 -308
- package/skills/qk-context-loader/SKILL.md +0 -219
- package/skills/qk-data-lifecycle/SKILL.md +0 -193
- package/skills/qk-db-optimizer/SKILL.md +0 -197
- package/skills/qk-docs/SKILL.md +0 -199
- package/skills/qk-engineering-standard/SKILL.md +0 -352
- package/skills/qk-engineering-standard/rules/backend.md +0 -122
- package/skills/qk-engineering-standard/rules/database.md +0 -3
- package/skills/qk-engineering-standard/rules/frontend.md +0 -152
- package/skills/qk-engineering-standard/rules/security.md +0 -3
- package/skills/qk-engineering-standard/rules/testing.md +0 -3
- package/skills/qk-fe-api-integration/SKILL.md +0 -327
- package/skills/qk-feature-delivery/SKILL.md +0 -306
- package/skills/qk-help/SKILL.md +0 -194
- package/skills/qk-orchestrator/SKILL.md +0 -279
- package/skills/qk-orchestrator/references/routing-table.md +0 -78
- package/skills/qk-production-release/SKILL.md +0 -285
- package/skills/qk-project-bootstrap/SKILL.md +0 -236
- package/skills/qk-project-health/SKILL.md +0 -200
- package/skills/qk-project-memory/SKILL.md +0 -219
- package/skills/qk-system-evolution/SKILL.md +0 -282
- package/skills/qk-ui-audit/SKILL.md +0 -316
- package/skills/qk-ui-audit/references/anti-slop-checklist.md +0 -136
- package/skills/qk-ui-builder/SKILL.md +0 -447
- package/skills/qk-ui-builder/references/anti-patterns.md +0 -295
- package/skills/qk-ui-builder/references/color.md +0 -115
- package/skills/qk-ui-builder/references/component-cookbook.md +0 -1194
- package/skills/qk-ui-builder/references/copy.md +0 -250
- package/skills/qk-ui-builder/references/interaction-and-states.md +0 -115
- package/skills/qk-ui-builder/references/layout-and-space.md +0 -111
- package/skills/qk-ui-builder/references/macrostructures/01-bento-grid.md +0 -48
- package/skills/qk-ui-builder/references/macrostructures/02-long-document.md +0 -50
- package/skills/qk-ui-builder/references/macrostructures/03-marquee-hero.md +0 -51
- package/skills/qk-ui-builder/references/macrostructures/04-stat-led.md +0 -49
- package/skills/qk-ui-builder/references/macrostructures/05-workbench.md +0 -44
- package/skills/qk-ui-builder/references/macrostructures/06-conversational-faq.md +0 -50
- package/skills/qk-ui-builder/references/macrostructures/07-manifesto.md +0 -51
- package/skills/qk-ui-builder/references/macrostructures/08-photographic.md +0 -50
- package/skills/qk-ui-builder/references/macrostructures/09-quote-led.md +0 -50
- package/skills/qk-ui-builder/references/macrostructures/11-catalogue.md +0 -49
- package/skills/qk-ui-builder/references/macrostructures/12-letter.md +0 -49
- package/skills/qk-ui-builder/references/macrostructures/13-index-first.md +0 -49
- package/skills/qk-ui-builder/references/macrostructures/14-narrative-workflow.md +0 -48
- package/skills/qk-ui-builder/references/macrostructures/15-split-studio.md +0 -48
- package/skills/qk-ui-builder/references/macrostructures/16-feature-stack.md +0 -51
- package/skills/qk-ui-builder/references/macrostructures/17-type-specimen.md +0 -48
- package/skills/qk-ui-builder/references/macrostructures/18-portfolio-grid.md +0 -48
- package/skills/qk-ui-builder/references/macrostructures/19-map-diagram.md +0 -50
- package/skills/qk-ui-builder/references/macrostructures/20-ecosystem-index.md +0 -48
- package/skills/qk-ui-builder/references/macrostructures/21-component-playground.md +0 -45
- package/skills/qk-ui-builder/references/macrostructures.md +0 -38
- package/skills/qk-ui-builder/references/motion.md +0 -95
- package/skills/qk-ui-builder/references/responsive.md +0 -115
- package/skills/qk-ui-builder/references/slop-test.md +0 -135
- package/skills/qk-ui-builder/references/structure.md +0 -280
- package/skills/qk-ui-builder/references/themes/atmospheric.md +0 -53
- package/skills/qk-ui-builder/references/themes/carnival.md +0 -52
- package/skills/qk-ui-builder/references/themes/cobalt.md +0 -52
- package/skills/qk-ui-builder/references/themes/editorial.md +0 -52
- package/skills/qk-ui-builder/references/themes/garden.md +0 -52
- package/skills/qk-ui-builder/references/themes/hum.md +0 -52
- package/skills/qk-ui-builder/references/themes/lumen.md +0 -52
- package/skills/qk-ui-builder/references/themes/midnight.md +0 -52
- package/skills/qk-ui-builder/references/themes/modern-minimal.md +0 -52
- package/skills/qk-ui-builder/references/themes/playful.md +0 -52
- package/skills/qk-ui-builder/references/themes/specimen.md +0 -52
- package/skills/qk-ui-builder/references/themes/terminal.md +0 -52
- package/skills/qk-ui-builder/references/typography.md +0 -129
- package/skills/qk-ui-system-builder/SKILL.md +0 -222
- package/skills/qk-validation-gate/SKILL.md +0 -360
- package/skills.json +0 -820
- package/specs/contracts/behavior-contract.yaml +0 -40
- package/specs/expectations/qk-bug-resolution.yaml +0 -35
- package/specs/fixtures/user-payload.json +0 -12
- package/specs/regressions/api-integration-null-fields.yaml +0 -19
- package/specs/scenarios/fix-login-nullref.yaml +0 -3
- package/taste-skill/.claude-plugin/marketplace.json +0 -20
- package/taste-skill/.claude-plugin/plugin.json +0 -19
- package/taste-skill/.github/FUNDING.yml +0 -1
- package/taste-skill/.github/copilot-instructions.md +0 -11
- package/taste-skill/CHANGELOG.md +0 -111
- package/taste-skill/LICENSE +0 -21
- package/taste-skill/README.md +0 -212
- package/taste-skill/assets/.gitkeep +0 -0
- package/taste-skill/assets/readme-banner.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-agent-skills.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-changelog.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-mit.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-site.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-tools.webp +0 -0
- package/taste-skill/assets/readme-cta-tasteskill.svg +0 -5
- package/taste-skill/assets/sponsors/animations-dev.webp +0 -0
- package/taste-skill/assets/sponsors/emil-animations-dev.webp +0 -0
- package/taste-skill/assets/taste-skill-logo.png +0 -0
- package/taste-skill/assets/taste-skill-logo.webp +0 -0
- package/taste-skill/assets/vercel-oss-program-badge.svg +0 -44
- package/taste-skill/examples/floria-bottom.webp +0 -0
- package/taste-skill/examples/floria-full.webp +0 -0
- package/taste-skill/examples/floria-top.webp +0 -0
- package/taste-skill/research/README.md +0 -8
- package/taste-skill/research/laziness/README.md +0 -25
- package/taste-skill/research/laziness/findings/empirical-results.md +0 -58
- package/taste-skill/research/laziness/findings/references.md +0 -20
- package/taste-skill/research/laziness/remediation/architectural-patterns.md +0 -55
- package/taste-skill/research/laziness/remediation/parameter-tuning.md +0 -44
- package/taste-skill/research/laziness/remediation/prompt-engineering.md +0 -52
- package/taste-skill/research/laziness/remediation/reference-prompts.md +0 -79
- package/taste-skill/research/laziness/root-causes/cognitive-shortcuts.md +0 -23
- package/taste-skill/research/laziness/root-causes/output-limits.md +0 -39
- package/taste-skill/research/laziness/root-causes/rlhf-and-compute.md +0 -27
- package/taste-skill/research/laziness/root-causes/training-data-bias.md +0 -28
- package/taste-skill/scripts/build-emil-sponsor-row.mjs +0 -41
- package/taste-skill/scripts/convert-readme-assets-webp.mjs +0 -142
- package/taste-skill/scripts/process-readme-buttons.mjs +0 -108
- package/taste-skill/scripts/process-sponsor-badge.mjs +0 -83
- package/taste-skill/skill.sh +0 -25
- package/taste-skill/skills/brandkit/SKILL.md +0 -798
- package/taste-skill/skills/brutalist-skill/SKILL.md +0 -92
- package/taste-skill/skills/gpt-tasteskill/SKILL.md +0 -74
- package/taste-skill/skills/image-to-code-skill/SKILL.md +0 -1228
- package/taste-skill/skills/imagegen-frontend-mobile/SKILL.md +0 -1465
- package/taste-skill/skills/imagegen-frontend-web/SKILL.md +0 -987
- package/taste-skill/skills/llms.txt +0 -13
- package/taste-skill/skills/minimalist-skill/SKILL.md +0 -85
- package/taste-skill/skills/output-skill/SKILL.md +0 -49
- package/taste-skill/skills/redesign-skill/SKILL.md +0 -178
- package/taste-skill/skills/soft-skill/SKILL.md +0 -98
- package/taste-skill/skills/stitch-skill/DESIGN.md +0 -121
- package/taste-skill/skills/stitch-skill/SKILL.md +0 -184
- package/taste-skill/skills/taste-skill/SKILL.md +0 -1206
- package/taste-skill/skills/taste-skill-v1/SKILL.md +0 -226
- package/temp_fix.js +0 -61
- package/templates/DESIGN.md +0 -38
- package/templates/bug-report.md +0 -21
- package/templates/design-report.md +0 -21
- package/templates/feature-report.md +0 -20
- package/templates/review-report.md +0 -21
- package/templates/skill-template.md +0 -38
- package/tests/behavior-conformance.test.js +0 -154
- package/tests/install-script.test.js +0 -38
- package/tests/registry.test.js +0 -111
- package/update_template.js +0 -28
- package/vitest.config.js +0 -11
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: fake-ui-slop
|
|
3
|
-
type: bias
|
|
4
|
-
description: LLM draws fake charts, images, or dashboard UI elements using generic div blocks instead of integrating real assets.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Detection:
|
|
8
|
-
- Did I use `<div class="bg-blue-500 w-full h-32">Fake Chart</div>`?
|
|
9
|
-
- Did I forget to add placeholders for real images?
|
|
10
|
-
|
|
11
|
-
Risk:
|
|
12
|
-
- Unprofessional UI design.
|
|
13
|
-
- Technical debt for the frontend developer.
|
|
14
|
-
|
|
15
|
-
Correction:
|
|
16
|
-
- Insert a comment like `<!-- TODO: Insert real image -->`.
|
|
17
|
-
- Use high-quality placeholder services (e.g., picsum).
|
|
18
|
-
|
|
19
|
-
Evidence:
|
|
20
|
-
- Highlight the exact placeholder used.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: hallucinated-tools
|
|
3
|
-
type: bias
|
|
4
|
-
description: LLM invents APIs, tools, or shell commands that do not exist in the current environment.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Detection:
|
|
8
|
-
- Did I attempt to call a CLI tool without verifying it is installed?
|
|
9
|
-
- Did I invent a non-existent method on a standard library?
|
|
10
|
-
|
|
11
|
-
Risk:
|
|
12
|
-
- Execution failure.
|
|
13
|
-
- Broken workflows.
|
|
14
|
-
|
|
15
|
-
Correction:
|
|
16
|
-
- Verify tools and APIs before using them.
|
|
17
|
-
- Stick to standard, known commands.
|
|
18
|
-
|
|
19
|
-
Evidence:
|
|
20
|
-
- Provide documentation or link to the specific tool usage.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: missing-ui-states
|
|
3
|
-
type: bias
|
|
4
|
-
description: LLM writes frontend components assuming the "happy path" only, ignoring Loading, Error, and Empty states.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Detection:
|
|
8
|
-
- Did I write a fetch component without a loading spinner?
|
|
9
|
-
- Did I forget to handle the case where the data array is empty?
|
|
10
|
-
|
|
11
|
-
Risk:
|
|
12
|
-
- Poor user experience.
|
|
13
|
-
- UI crashes on undefined data.
|
|
14
|
-
|
|
15
|
-
Correction:
|
|
16
|
-
- Always implement Loading, Error, and Empty states for any asynchronous UI component.
|
|
17
|
-
|
|
18
|
-
Evidence:
|
|
19
|
-
- Point to the conditional rendering logic.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: over-indexing
|
|
3
|
-
type: bias
|
|
4
|
-
description: LLM recommends adding database indexes to every column to "improve performance", ignoring write penalties.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Detection:
|
|
8
|
-
- Did I suggest indexing a column with low cardinality (e.g., boolean status)?
|
|
9
|
-
- Did I suggest indexing multiple columns without analyzing query patterns?
|
|
10
|
-
|
|
11
|
-
Risk:
|
|
12
|
-
- Slower INSERT/UPDATE operations.
|
|
13
|
-
- Increased database storage costs.
|
|
14
|
-
|
|
15
|
-
Correction:
|
|
16
|
-
- Only recommend indexes for Foreign Keys or heavily filtered/sorted columns.
|
|
17
|
-
- Suggest resolving N+1 queries first.
|
|
18
|
-
|
|
19
|
-
Evidence:
|
|
20
|
-
- Provide the exact slow query that justifies the index.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: swallow-errors
|
|
3
|
-
type: bias
|
|
4
|
-
description: LLM wraps code in a try/catch block but leaves the catch block empty or just logs to console, effectively hiding fatal errors.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Detection:
|
|
8
|
-
- Did I write `catch (e) { console.error(e) }` without throwing or returning an error state?
|
|
9
|
-
- Did I fail to surface the error to the UI?
|
|
10
|
-
|
|
11
|
-
Risk:
|
|
12
|
-
- Silent failures.
|
|
13
|
-
- Extremely difficult debugging.
|
|
14
|
-
|
|
15
|
-
Correction:
|
|
16
|
-
- Always handle the error gracefully (e.g., return a unified error object or show a toast notification).
|
|
17
|
-
|
|
18
|
-
Evidence:
|
|
19
|
-
- Point to the specific error handling logic.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: ui-only-security
|
|
3
|
-
type: bias
|
|
4
|
-
description: LLM hides a button on the UI for unauthorized users but forgets to secure the backend API endpoint.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Detection:
|
|
8
|
-
- Did I add a role check in the React component but not in the Node.js controller?
|
|
9
|
-
|
|
10
|
-
Risk:
|
|
11
|
-
- Critical security vulnerability (users can bypass UI and hit the API directly).
|
|
12
|
-
|
|
13
|
-
Correction:
|
|
14
|
-
- Security must always be enforced at the Backend/API layer first. UI hiding is just for UX.
|
|
15
|
-
|
|
16
|
-
Evidence:
|
|
17
|
-
- Point to the backend middleware or controller where the permission is checked.
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# 🧩 Bảng Tuần Hoàn: Decision Primitives (v6.0)
|
|
2
|
-
|
|
3
|
-
Rule-Skins v6 không coi các Agent là những "con người ảo" (Personas), mà coi chúng là những **Cỗ máy Ra Quyết định (Decision Engines)**.
|
|
4
|
-
Mọi hành vi phức tạp của bất kỳ Agent nào trong hệ thống đều được cấu thành từ sự lắp ghép của **6 Decision Primitives** cốt lõi dưới đây.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## 1. 🧲 Collect (Thu thập)
|
|
9
|
-
- **Bản chất:** Đi tìm kiếm thông tin, tải bối cảnh từ bên ngoài vào bộ nhớ.
|
|
10
|
-
- **Trigger:** Thiếu context hoặc nhận một task yêu cầu đọc dữ liệu.
|
|
11
|
-
- **Evidence Required:** Quyền truy cập repository, cấu trúc file, URL.
|
|
12
|
-
- **Ví dụ Skills:** `qk-context-loader`, bước đầu của `qk-bug-resolution`.
|
|
13
|
-
|
|
14
|
-
## 2. 🩺 Diagnose (Chẩn đoán)
|
|
15
|
-
- **Bản chất:** Phân tích một triệu chứng (symptom) dựa trên bằng chứng để tìm ra nguyên nhân gốc rễ (root cause).
|
|
16
|
-
- **Trigger:** Có lỗi (Bug report, error log, test failure).
|
|
17
|
-
- **Evidence Required:** Stack trace, logs, test output.
|
|
18
|
-
- **Ví dụ Skills:** `qk-bug-resolution`, `qk-project-health`.
|
|
19
|
-
|
|
20
|
-
## 3. 🗺️ Plan (Lập Kế hoạch)
|
|
21
|
-
- **Bản chất:** Vạch ra một lộ trình các bước cần làm trước khi trực tiếp nhúng tay vào việc.
|
|
22
|
-
- **Trigger:** Yêu cầu một tính năng mới hoặc một nhiệm vụ quá phức tạp để làm một bước.
|
|
23
|
-
- **Evidence Required:** Yêu cầu (Requirements), Specs, Architecture.
|
|
24
|
-
- **Ví dụ Skills:** `qk-feature-delivery`, `qk-api-lifecycle`.
|
|
25
|
-
|
|
26
|
-
## 4. ⚖️ Evaluate (Đánh giá)
|
|
27
|
-
- **Bản chất:** Đối chiếu một sản phẩm (artifact) có sẵn với một tiêu chuẩn (standard/policy) để đưa ra phán quyết (Pass/Fail) hoặc gợi ý sửa đổi.
|
|
28
|
-
- **Trigger:** Một đoạn code mới, một bản thiết kế, một PR.
|
|
29
|
-
- **Evidence Required:** Artifact cần review, Guidelines, Linter rules.
|
|
30
|
-
- **Ví dụ Skills:** `qk-engineering-standard`, `qk-validation-gate`, `qk-ui-audit`.
|
|
31
|
-
|
|
32
|
-
## 5. 🛠️ Execute (Thực thi)
|
|
33
|
-
- **Bản chất:** Trực tiếp sửa đổi trạng thái hệ thống (viết code, xóa file, sửa file).
|
|
34
|
-
- **Trigger:** Đã có kế hoạch rõ ràng hoặc đã xác định xong lỗi.
|
|
35
|
-
- **Evidence Required:** Codebase hiện tại, Kế hoạch.
|
|
36
|
-
- **Ví dụ Skills:** `qk-feature-delivery` (bước sau), `qk-ui-builder`.
|
|
37
|
-
|
|
38
|
-
## 6. 🚦 Delegate / Govern (Điều phối / Quản trị)
|
|
39
|
-
- **Bản chất:** Không trực tiếp làm việc, mà làm nhiệm vụ định tuyến (routing) công việc cho Agent khác hoặc kiểm soát quyền (deny/allow) dựa trên luật lệ.
|
|
40
|
-
- **Trigger:** Nhận task không thuộc chuyên môn, hoặc nhận yêu cầu xác thực quyền hạn.
|
|
41
|
-
- **Evidence Required:** Danh sách các Skills khác, Policies (RBAC/ABAC).
|
|
42
|
-
- **Ví dụ Skills:** `qk-orchestrator`, `qk-access-policy`.
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
> **Nguyên tắc Thiết kế Hệ thống:**
|
|
47
|
-
> Khi tạo một Skill mới, đừng cố gắng mô tả "tính cách" của nó. Hãy tự hỏi: *Nó cần dùng những Primitives nào để hoàn thành nhiệm vụ?*
|
|
48
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: complexity-budget
|
|
3
|
-
type: dial
|
|
4
|
-
description: Defines the ceiling for architectural and code complexity.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Levels:
|
|
8
|
-
- **Level 1 (Prototype):** Hardcode data, skip tests, minimal validation. Goal is highest speed.
|
|
9
|
-
- **Level 5 (Standard):** Monolith, basic SQL/ORM, Zod validation, essential error states.
|
|
10
|
-
- **Level 10 (Enterprise):** Event-driven architecture, CQRS, strict rate limiting, 100% test coverage.
|
|
11
|
-
|
|
12
|
-
Usage:
|
|
13
|
-
- The AI must infer the current budget based on the Project Scale (MVP vs Enterprise) and stick to it. Never exceed the budget.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: granularity
|
|
3
|
-
type: dial
|
|
4
|
-
description: Defines the level of detail for access control policies.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Levels:
|
|
8
|
-
- **Level 1 (Coarse):** Role-based (Admin vs User).
|
|
9
|
-
- **Level 5 (Fine-grained):** Attribute-based (Owner of the resource).
|
|
10
|
-
- **Level 10 (Micro):** Field-level permissions (Can edit Title but not Price).
|
|
11
|
-
|
|
12
|
-
Usage:
|
|
13
|
-
- Adjust based on the project scale. For MVP, stick to Level 1.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: optimization-strategy
|
|
3
|
-
type: dial
|
|
4
|
-
description: Defines the approach to database and performance optimization.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Levels:
|
|
8
|
-
- **Level 1 (Query Fixes):** Resolve N+1 issues and add basic indexes.
|
|
9
|
-
- **Level 5 (Caching):** Introduce Redis or Memcached for heavy read paths.
|
|
10
|
-
- **Level 10 (Architecture):** CQRS, Read Replicas, Sharding.
|
|
11
|
-
|
|
12
|
-
Usage:
|
|
13
|
-
- Start at Level 1. Never jump to Level 5 or 10 without explicit bottleneck evidence.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: strictness
|
|
3
|
-
type: dial
|
|
4
|
-
description: Defines how rigidly the AI enforces patterns and rules.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Levels:
|
|
8
|
-
- **Level 1 (Lenient):** Fix only syntax errors and fatal bugs. Ignore bad architecture.
|
|
9
|
-
- **Level 5 (Balanced):** Suggest improvements but don't rewrite entire files.
|
|
10
|
-
- **Level 10 (Draconian):** Fail immediately on any Linter warning. Enforce strict SOLID principles.
|
|
11
|
-
|
|
12
|
-
Usage:
|
|
13
|
-
- Adjust based on the user's intent. If they just want a quick fix, lower the strictness. If they ask for an audit, raise it.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: delegation-only
|
|
3
|
-
type: rule
|
|
4
|
-
description: Restricts the skill from making direct system modifications.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Condition:
|
|
8
|
-
- The skill must ONLY plan, analyze, and dispatch instructions to sub-skills.
|
|
9
|
-
- It must NEVER write code, execute CLI commands, or modify files directly.
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
# Skill Schema V7.5 — Runtime Standard Specification
|
|
2
|
-
|
|
3
|
-
> **Mục đích:** Đây là "lint rules" chính thức cho mọi skill trong bộ V7.5.
|
|
4
|
-
> Bất kỳ skill nào không pass spec này đều **phải được fix trước khi publish**.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Frontmatter Required Fields
|
|
9
|
-
|
|
10
|
-
```yaml
|
|
11
|
-
# REQUIRED — tất cả fields sau đây bắt buộc phải có
|
|
12
|
-
name: string # qk-[skill-name]
|
|
13
|
-
category: enum # core|frontend|backend|fullstack|security|qa|maintenance|devops|utilities
|
|
14
|
-
version: semver # 7.5.x
|
|
15
|
-
description: string # one sentence, ends without period
|
|
16
|
-
platforms: array # [antigravity, claude-code, cursor, windsurf, kilo-code]
|
|
17
|
-
execution_mode: string # deterministic | exploratory
|
|
18
|
-
skill_version: semver # same as version
|
|
19
|
-
runtime_version: integer # 1 (current runtime contract version)
|
|
20
|
-
schema_version: integer # 2 (current schema version)
|
|
21
|
-
cost: enum # low | medium | high
|
|
22
|
-
latency: enum # fast | medium | slow
|
|
23
|
-
risk: enum # low | medium | high
|
|
24
|
-
side_effects: enum # edit_files | run_commands | read_only | none
|
|
25
|
-
produces: array # [code, report, schema, plan, tokens]
|
|
26
|
-
consumes: array # [context-graph, design-md, stack-trace, json-payload, none]
|
|
27
|
-
token_budget:
|
|
28
|
-
max_files_read: integer # 1–10
|
|
29
|
-
max_lines_per_read: integer # 50–200
|
|
30
|
-
max_shell_commands: integer # 0–5
|
|
31
|
-
stop_early: boolean
|
|
32
|
-
exit_codes: array # must include: [SUCCESS, BLOCKED, FAILED, PARTIAL]
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**Lint Rule:** Bất kỳ field nào thiếu → FAIL frontmatter check.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## 11 Required Body Sections
|
|
40
|
-
|
|
41
|
-
Dưới đây là 11 sections bắt buộc trong body mỗi SKILL.md, theo thứ tự.
|
|
42
|
-
**Special skills** (redirect, help) được miễn một số section — xem `special_skill_exemptions` cuối file.
|
|
43
|
-
|
|
44
|
-
### Section 1: Language Rule Header
|
|
45
|
-
```
|
|
46
|
-
> **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese (match user language).
|
|
47
|
-
```
|
|
48
|
-
**Lint Rule:** Phải có ngay sau heading `# qk-[name]`.
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
### Section 2: Preconditions
|
|
53
|
-
```markdown
|
|
54
|
-
## Preconditions
|
|
55
|
-
- [ ] [Condition 1]
|
|
56
|
-
- [ ] [Condition N]
|
|
57
|
-
|
|
58
|
-
\`\`\`
|
|
59
|
-
On missing precondition:
|
|
60
|
-
EXIT: BLOCKED
|
|
61
|
-
Message: "[specific message]"
|
|
62
|
-
\`\`\`
|
|
63
|
-
```
|
|
64
|
-
**Lint Rules:**
|
|
65
|
-
- Phải có ít nhất 1 precondition
|
|
66
|
-
- Phải có code block với `EXIT: BLOCKED` và `Message:`
|
|
67
|
-
- Không được chỉ có "Repository accessible" — phải specific
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
### Section 3: Scope + Non-Goals
|
|
72
|
-
```markdown
|
|
73
|
-
## Scope
|
|
74
|
-
- ✅ [What it DOES]
|
|
75
|
-
|
|
76
|
-
## Non-Goals
|
|
77
|
-
- ❌ [Anti-pattern — with reason]
|
|
78
|
-
```
|
|
79
|
-
**Lint Rules:**
|
|
80
|
-
- Scope: ≥ 2 items
|
|
81
|
-
- Non-Goals: ≥ 3 items
|
|
82
|
-
- At least one Non-Goal must be about tool usage (never create scripts / never read entire files)
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
### Section 4: Priority Order
|
|
87
|
-
```markdown
|
|
88
|
-
## Priority Order
|
|
89
|
-
| Priority | Task | Skip Threshold |
|
|
90
|
-
|----------|------|----------------|
|
|
91
|
-
| P1 | ... | Never |
|
|
92
|
-
```
|
|
93
|
-
**Lint Rules:**
|
|
94
|
-
- Minimum 3 priorities
|
|
95
|
-
- P1 must have "Never" skip threshold
|
|
96
|
-
- At least one Px must have a percentage threshold (e.g., "Budget < 50%")
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
### Section 5: Workflow with Decision Trees
|
|
101
|
-
```markdown
|
|
102
|
-
## Workflow
|
|
103
|
-
|
|
104
|
-
### Phase N — [Name]
|
|
105
|
-
**Steps:**
|
|
106
|
-
1. [step]
|
|
107
|
-
|
|
108
|
-
**Decision:**
|
|
109
|
-
\`\`\`
|
|
110
|
-
IF [condition] → [action]
|
|
111
|
-
ELSE → [action]
|
|
112
|
-
\`\`\`
|
|
113
|
-
|
|
114
|
-
**Exit When:**
|
|
115
|
-
- [condition] → go to Phase N+1 | EXIT: [code]
|
|
116
|
-
```
|
|
117
|
-
**Lint Rules:**
|
|
118
|
-
- Minimum 2 phases
|
|
119
|
-
- Each phase MUST have at least one `Decision:` block
|
|
120
|
-
- Each phase MUST have `Exit When:` conditions
|
|
121
|
-
- No phase can have only "steps" without decisions
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
### Section 6: Confidence Model
|
|
126
|
-
```markdown
|
|
127
|
-
## Confidence Model
|
|
128
|
-
| Level | Condition | Action |
|
|
129
|
-
|--------|-----------|--------|
|
|
130
|
-
| HIGH | ... | ... |
|
|
131
|
-
| MEDIUM | ... | ... |
|
|
132
|
-
| LOW | ... | EXIT: BLOCKED |
|
|
133
|
-
```
|
|
134
|
-
**Lint Rules:**
|
|
135
|
-
- Must have all 3 levels: HIGH, MEDIUM, LOW
|
|
136
|
-
- LOW must always lead to either BLOCKED or user confirmation
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
### Section 7: Severity
|
|
141
|
-
```markdown
|
|
142
|
-
## Severity
|
|
143
|
-
| Level | Definition | Example |
|
|
144
|
-
|----------|-----------|---------|
|
|
145
|
-
| CRITICAL | ... | ... |
|
|
146
|
-
| HIGH | ... | ... |
|
|
147
|
-
| MEDIUM | ... | ... |
|
|
148
|
-
| LOW | ... | ... |
|
|
149
|
-
```
|
|
150
|
-
**Lint Rules:**
|
|
151
|
-
- Must have all 4 levels: CRITICAL, HIGH, MEDIUM, LOW
|
|
152
|
-
- Each level must have a concrete Example column
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
### Section 8: Evidence Format
|
|
157
|
-
```markdown
|
|
158
|
-
## Evidence Format
|
|
159
|
-
\`\`\`
|
|
160
|
-
[SEVERITY] path/to/file.ts:LINE
|
|
161
|
-
[Field]: [value]
|
|
162
|
-
Confidence: [HIGH|MEDIUM|LOW]
|
|
163
|
-
Fix: [suggestion]
|
|
164
|
-
\`\`\`
|
|
165
|
-
```
|
|
166
|
-
**Lint Rules:**
|
|
167
|
-
- Must include `[SEVERITY]` tag with file:LINE format
|
|
168
|
-
- Must include `Confidence:` field
|
|
169
|
-
- Must include `Fix:` field
|
|
170
|
-
- Must include a filled example below the template
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
### Section 9: Retry Policy
|
|
175
|
-
```markdown
|
|
176
|
-
## Retry Policy
|
|
177
|
-
\`\`\`
|
|
178
|
-
[trigger]
|
|
179
|
-
└─ [action]
|
|
180
|
-
├─ [outcome A]
|
|
181
|
-
└─ [outcome B] → [escalation]
|
|
182
|
-
└─ Do NOT retry more than N times
|
|
183
|
-
\`\`\`
|
|
184
|
-
```
|
|
185
|
-
**Lint Rules:**
|
|
186
|
-
- Must have explicit max retry count (≤ 3)
|
|
187
|
-
- Must specify what happens after max retries (ESCALATE or FAILED)
|
|
188
|
-
- Read-only skills may have simplified retry: "Audit is read-only — no retry needed."
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
### Section 10: Escalation Rules
|
|
193
|
-
```markdown
|
|
194
|
-
## Escalation Rules
|
|
195
|
-
\`\`\`
|
|
196
|
-
BLOCKED: [specific reason]
|
|
197
|
-
Missing:
|
|
198
|
-
- [artifact or info needed]
|
|
199
|
-
Questions:
|
|
200
|
-
1. [specific question]
|
|
201
|
-
Recommended Assumptions (if proceeding):
|
|
202
|
-
- [assumption]
|
|
203
|
-
\`\`\`
|
|
204
|
-
```
|
|
205
|
-
**Lint Rules:**
|
|
206
|
-
- Must have structured format: BLOCKED, Missing, Questions, Recommended Assumptions
|
|
207
|
-
- Cannot be just "ask user" or "STOP"
|
|
208
|
-
- Must have at least 1 specific question
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
### Section 11: Handoff Contract
|
|
213
|
-
```markdown
|
|
214
|
-
## Handoff Contract
|
|
215
|
-
### Consumes
|
|
216
|
-
\`\`\`json
|
|
217
|
-
{ "from": "...", "required_fields": [...], "optional_fields": [...] }
|
|
218
|
-
\`\`\`
|
|
219
|
-
### Produces
|
|
220
|
-
\`\`\`json
|
|
221
|
-
{ "to": "...", "output_fields": [...] }
|
|
222
|
-
\`\`\`
|
|
223
|
-
```
|
|
224
|
-
**Lint Rules:**
|
|
225
|
-
- Both Consumes and Produces must be present
|
|
226
|
-
- `required_fields` must be a non-empty array
|
|
227
|
-
- `to` in Produces must reference a real skill name or "user"
|
|
228
|
-
|
|
229
|
-
---
|
|
230
|
-
|
|
231
|
-
### Section 12: Exit Codes Table
|
|
232
|
-
```markdown
|
|
233
|
-
## Exit Codes
|
|
234
|
-
| Code | Meaning | When |
|
|
235
|
-
|---------|---------|------|
|
|
236
|
-
| SUCCESS | ... | ... |
|
|
237
|
-
| PARTIAL | ... | ... |
|
|
238
|
-
| BLOCKED | ... | ... |
|
|
239
|
-
| FAILED | ... | ... |
|
|
240
|
-
```
|
|
241
|
-
**Lint Rules:**
|
|
242
|
-
- Must have all 4 codes: SUCCESS, PARTIAL, BLOCKED, FAILED
|
|
243
|
-
- Each must have "When" column with specific trigger condition
|
|
244
|
-
|
|
245
|
-
---
|
|
246
|
-
|
|
247
|
-
### Section 13: Compliance Block (NEW — End of File)
|
|
248
|
-
```markdown
|
|
249
|
-
## Compliance
|
|
250
|
-
| Check | Status |
|
|
251
|
-
|----------------------|--------|
|
|
252
|
-
| Runtime Standard | 11/11 |
|
|
253
|
-
| Frontmatter Complete | ✅ |
|
|
254
|
-
| References Valid | ✅ |
|
|
255
|
-
| Decision Trees | PASS |
|
|
256
|
-
| Thresholds Defined | PASS |
|
|
257
|
-
| schema_version | 2 |
|
|
258
|
-
| runtime_version | 1 |
|
|
259
|
-
```
|
|
260
|
-
**Lint Rules:**
|
|
261
|
-
- Must be the LAST section in every skill
|
|
262
|
-
- Must be auto-generated or manually updated on each change
|
|
263
|
-
- "References Valid" = all `references/*.md` files actually exist
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
## Reference Files Rule
|
|
268
|
-
|
|
269
|
-
If a SKILL.md mentions `references/[file].md`, that file MUST exist.
|
|
270
|
-
|
|
271
|
-
```
|
|
272
|
-
LINT ERROR: qk-ui-audit references "references/anti-slop-checklist.md" — FILE NOT FOUND
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## Special Skill Exemptions
|
|
278
|
-
|
|
279
|
-
Some skills have reduced requirements:
|
|
280
|
-
|
|
281
|
-
| Skill Type | Exempted Sections |
|
|
282
|
-
|-----------|-------------------|
|
|
283
|
-
| Redirect skill (`qk-policy-engine`) | Sections 2-12 optional — must have redirect target |
|
|
284
|
-
| Help/Discovery skill (`qk-help`) | Sections 5-11 optional — must have skill list |
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## Lint Scoring
|
|
289
|
-
|
|
290
|
-
```
|
|
291
|
-
Total sections: 13 (including Compliance block)
|
|
292
|
-
Frontmatter: Pass/Fail (binary)
|
|
293
|
-
|
|
294
|
-
Score = (sections_present / 13) × 100
|
|
295
|
-
|
|
296
|
-
Grade:
|
|
297
|
-
100% → COMPLIANT ✅
|
|
298
|
-
90%+ → MINOR ISSUES ⚠️
|
|
299
|
-
70%+ → NEEDS WORK ❌
|
|
300
|
-
<70% → NON-COMPLIANT 🔴
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
## Version History
|
|
306
|
-
|
|
307
|
-
| schema_version | runtime_version | Changes |
|
|
308
|
-
|---------------|-----------------|---------|
|
|
309
|
-
| 1 | 1 | Initial V7.0 (YAML constraints only) |
|
|
310
|
-
| 2 | 1 | V7.5 Runtime Standard (11 sections + metadata) |
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: nodejs-knowledge-base
|
|
3
|
-
domain: backend
|
|
4
|
-
tags: [nodejs, express, api, middleware]
|
|
5
|
-
priority: high
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Node.js Backend Knowledge Base
|
|
9
|
-
|
|
10
|
-
## Architecture Patterns
|
|
11
|
-
- **Controller Layer:** Handle HTTP requests/responses, input validation, delegate to Service
|
|
12
|
-
- **Service Layer:** Business logic, data transformation, transaction management
|
|
13
|
-
- **Repository Layer:** Direct database queries, ORM interactions
|
|
14
|
-
- **Middleware:** Auth guards, logging, rate limiting, error handling
|
|
15
|
-
|
|
16
|
-
## Express Best Practices
|
|
17
|
-
```ts
|
|
18
|
-
// Controller pattern - thin, delegates to service
|
|
19
|
-
export async function createUser(req: Request, res: Response) {
|
|
20
|
-
const result = await userService.create(req.body);
|
|
21
|
-
res.status(201).json(result);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Service pattern - business logic
|
|
25
|
-
export async function create(userData: UserDto) {
|
|
26
|
-
// Validation
|
|
27
|
-
const validated = userSchema.parse(userData);
|
|
28
|
-
// Transaction
|
|
29
|
-
return db.user.create({ data: validated });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Middleware pattern - reusable
|
|
33
|
-
export const requireAuth = (req: Request, res: Response, next: NextFunction) => {
|
|
34
|
-
const user = verifyToken(req.headers.authorization);
|
|
35
|
-
if (!user) return res.status(401).json({ error: 'Unauthorized' });
|
|
36
|
-
req.user = user;
|
|
37
|
-
next();
|
|
38
|
-
};
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Error Handling
|
|
42
|
-
- Never throw raw Errors. Use custom error classes.
|
|
43
|
-
- Always catch async errors in middleware.
|
|
44
|
-
- Return consistent error format: `{ error: string, code?: string }`
|
|
45
|
-
|
|
46
|
-
## Security Checklist
|
|
47
|
-
- Use helmet middleware for security headers
|
|
48
|
-
- Validate all inputs with Zod/Joi
|
|
49
|
-
- Never commit .env files
|
|
50
|
-
- Use parameterized queries to prevent SQL injection
|
|
51
|
-
- Rate limit public endpoints
|
|
52
|
-
- Log security events (failed logins, permission denied)
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: react-knowledge-base
|
|
3
|
-
domain: frontend
|
|
4
|
-
tags: [react, hooks, components, state]
|
|
5
|
-
priority: high
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# React Knowledge Base
|
|
9
|
-
|
|
10
|
-
## State Management Rules
|
|
11
|
-
- Use `useState` for strictly local UI state (e.g., dropdown toggle).
|
|
12
|
-
- Use `useContext` or global stores (Zustand/Redux) when prop drilling exceeds 3 levels.
|
|
13
|
-
- Never store derived data in state. Compute it on the fly during render.
|
|
14
|
-
- Never store API responses in Redux if a Server State tool (React Query/SWR) is available.
|
|
15
|
-
- For forms: Use React Hook Form + Zod for validation, NOT useState for each field.
|
|
16
|
-
|
|
17
|
-
## Hooks Best Practices
|
|
18
|
-
- **useEffect:** Avoid using `useEffect` for data transformation or syncing state. Only use it for actual side effects (subscriptions, API calls, manual DOM mutations).
|
|
19
|
-
- **useMemo / useCallback:** Only use when passing props to heavily memoized child components or when the computation is extremely expensive. Do not use them blindly.
|
|
20
|
-
- **Custom Hooks:** Extract complex logic out of UI components into custom hooks. Prefix them with `use` (e.g., `useUserAuth`).
|
|
21
|
-
- **Custom Hook Pattern:**
|
|
22
|
-
```ts
|
|
23
|
-
// useApi.ts - Generic API hook
|
|
24
|
-
export function useApi<T>(url: string) {
|
|
25
|
-
const [data, setData] = useState<T | null>(null);
|
|
26
|
-
const [loading, setLoading] = useState(false);
|
|
27
|
-
const [error, setError] = useState<string | null>(null);
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
fetchData();
|
|
31
|
-
}, [url]);
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Component Boundaries
|
|
36
|
-
- Follow Single Responsibility Principle. A component should either handle logic (Container) or handle rendering UI (Presentational), ideally not both if it's complex.
|
|
37
|
-
- Keep files under 300 lines. If a file is larger, break it down.
|
|
38
|
-
- **Component Hierarchy:**
|
|
39
|
-
- `components/shared/` - Reusable, no business logic
|
|
40
|
-
- `features/<domain>/components/` - Feature-specific components
|
|
41
|
-
- `layouts/` - Page layouts and wrappers
|
|
42
|
-
|
|
43
|
-
## Performance Gotchas
|
|
44
|
-
- Stale Closures: Always include all reactive variables in the dependency array of `useEffect` or `useCallback`.
|
|
45
|
-
- Keys in Lists: Always use unique IDs for `key` props. Never use array indices unless the list is completely static.
|
|
46
|
-
- **Re-render Detection:**
|
|
47
|
-
```ts
|
|
48
|
-
// Use console.log inside component to detect renders
|
|
49
|
-
// Wrap child in React.memo if unnecessary re-renders occur
|
|
50
|
-
export const MemoizedChild = React.memo(ChildComponent);
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Error Handling Patterns
|
|
54
|
-
```ts
|
|
55
|
-
// API Error Boundary
|
|
56
|
-
class ErrorBoundary extends React.Component {
|
|
57
|
-
state = { hasError: false };
|
|
58
|
-
static getDerivedStateFromError() {
|
|
59
|
-
return { hasError: true };
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Hook error handling
|
|
64
|
-
const { data, error, isLoading } = useQuery(['key'], fetchFn);
|
|
65
|
-
if (error) return <ErrorMessage error={error} />;
|
|
66
|
-
if (isLoading) return <LoadingSpinner />;
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Testing Patterns
|
|
70
|
-
```tsx
|
|
71
|
-
// Component test with React Testing Library
|
|
72
|
-
import { render, screen, waitFor } from '@testing-library/react';
|
|
73
|
-
import userEvent from '@testing-library/user-event';
|
|
74
|
-
|
|
75
|
-
test('handles user interaction', async () => {
|
|
76
|
-
render(<LoginForm />);
|
|
77
|
-
const button = screen.getByRole('button', { name: /login/i });
|
|
78
|
-
await userEvent.click(button);
|
|
79
|
-
await waitFor(() => expect(mockSubmit).toHaveBeenCalled());
|
|
80
|
-
});
|
|
81
|
-
```
|