@skill-graph/cli 0.5.6
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/CHANGELOG.md +247 -0
- package/LICENSE +200 -0
- package/NOTICE +62 -0
- package/README.md +398 -0
- package/SKILL_GRAPH.md +443 -0
- package/bin/skill-graph.js +374 -0
- package/docs/ADOPTION.md +117 -0
- package/docs/CONFORMANCE.md +66 -0
- package/docs/PRIMER.md +384 -0
- package/docs/QUICKSTART-30MIN.md +333 -0
- package/docs/ROUTING-METRICS.md +120 -0
- package/docs/SKILL-MD-FORMAT-COMPATIBILITY.md +127 -0
- package/docs/SKILL_AUDIT_CHECKLIST.md +199 -0
- package/docs/SKILL_AUDIT_LOOP.md +195 -0
- package/docs/SKILL_METADATA_PROTOCOL.md +609 -0
- package/docs/_archived/marketplace-publication-priority-2026-05-18.md +239 -0
- package/docs/adr/0001-predicate-set.md +69 -0
- package/docs/adr/0002-json-ld-context.md +82 -0
- package/docs/adr/0003-ontoclean-rigidity-tags.md +65 -0
- package/docs/adr/0004-persistent-identifiers.md +74 -0
- package/docs/adr/0005-freshness-consolidation.md +70 -0
- package/docs/adr/0006-revise-predicate-rename.md +105 -0
- package/docs/adr/0007-audit-loop-cadence.md +99 -0
- package/docs/adr/0008-skill-surface-split-and-curation-policy.md +93 -0
- package/docs/category-consumers.md +168 -0
- package/docs/concept-map.md +194 -0
- package/docs/diagrams/drift-states.mmd +21 -0
- package/docs/diagrams/manifest-pipeline.mmd +25 -0
- package/docs/diagrams/routing-harness.mmd +41 -0
- package/docs/diagrams/starter-graph.mmd +53 -0
- package/docs/field-decision-guide.md +315 -0
- package/docs/field-rationale.md +211 -0
- package/docs/field-reference.generated.md +624 -0
- package/docs/field-reference.md +1426 -0
- package/docs/glossary.md +190 -0
- package/docs/head-noun-glossary.md +63 -0
- package/docs/images/audit-phases.png +0 -0
- package/docs/images/drift-states.png +0 -0
- package/docs/images/graded-mode.png +0 -0
- package/docs/images/manifest-pipeline.png +0 -0
- package/docs/images/routing-harness.png +0 -0
- package/docs/images/skill-anatomy.png +0 -0
- package/docs/images/starter-graph.png +0 -0
- package/docs/images/system-model.png +0 -0
- package/docs/integrations/github-actions.md +155 -0
- package/docs/manifest-field-mapping.md +443 -0
- package/docs/marketplace-publication-queue.generated.md +240 -0
- package/docs/marketplace-release-agent-prompt.md +82 -0
- package/docs/marketplace-skill-candidate-list.md +272 -0
- package/docs/marketplace-syndication.md +222 -0
- package/docs/migration-sample-review.md +155 -0
- package/docs/migrations/v4-to-v5.md +168 -0
- package/docs/migrations/v5-to-v6.md +221 -0
- package/docs/name-exceptions.yaml +37 -0
- package/docs/plans/marketplace-p1-public-migration-plan.md +41 -0
- package/docs/plans/multi-root-workspace.md +148 -0
- package/docs/plans/scripts-roadmap.md +107 -0
- package/docs/plans/v4-schema-bump.md +160 -0
- package/docs/plans/wave-2-extraction.md +122 -0
- package/docs/positioning-vs-marketplaces.md +175 -0
- package/docs/proposals/skill-audit-loop-positioning.md +160 -0
- package/docs/quality-doctrine.md +138 -0
- package/docs/recommended-skills.md +150 -0
- package/docs/research/skill-comprehension-eval-research.md +1830 -0
- package/docs/research/skill-retrieval-evidence.md +66 -0
- package/docs/skill-metadata-protocol.md +471 -0
- package/docs/skills-sh-maintainer-cleanup-request.md +80 -0
- package/examples/audits/a11y/findings.md +52 -0
- package/examples/audits/a11y/scorecard.md +21 -0
- package/examples/audits/a11y/verdict.md +44 -0
- package/examples/audits/debugging/findings.md +59 -0
- package/examples/audits/debugging/scorecard.md +22 -0
- package/examples/audits/debugging/verdict.md +33 -0
- package/examples/audits/documentation/findings.md +59 -0
- package/examples/audits/documentation/scorecard.md +22 -0
- package/examples/audits/documentation/verdict.md +33 -0
- package/examples/evals/a11y.json +140 -0
- package/examples/evals/api-design.json +52 -0
- package/examples/evals/code-review.json +52 -0
- package/examples/evals/data-modeling.json +52 -0
- package/examples/evals/database-migration.json +52 -0
- package/examples/evals/debugging.json +118 -0
- package/examples/evals/dependency-architecture.json +52 -0
- package/examples/evals/design-system-architecture.json +52 -0
- package/examples/evals/error-tracking.json +52 -0
- package/examples/evals/event-contract-design.json +52 -0
- package/examples/evals/form-ux-architecture.json +52 -0
- package/examples/evals/framework-fit-analysis.json +52 -0
- package/examples/evals/graph-audit.json +139 -0
- package/examples/evals/information-architecture.json +52 -0
- package/examples/evals/interaction-feedback.json +52 -0
- package/examples/evals/interaction-patterns.json +52 -0
- package/examples/evals/layout-composition.json +52 -0
- package/examples/evals/lint-overlay.json +117 -0
- package/examples/evals/microcopy.json +52 -0
- package/examples/evals/observability-modeling.json +52 -0
- package/examples/evals/pattern-recognition.json +96 -0
- package/examples/evals/performance-engineering.json +52 -0
- package/examples/evals/refactor.json +128 -0
- package/examples/evals/semiotics.json +52 -0
- package/examples/evals/skill-infrastructure.json +96 -0
- package/examples/evals/skill-router.json +140 -0
- package/examples/evals/skill-router.routing.json +113 -0
- package/examples/evals/system-interface-contracts.json +52 -0
- package/examples/evals/task-analysis.json +52 -0
- package/examples/evals/testing-strategy.json +118 -0
- package/examples/evals/type-safety.json +249 -0
- package/examples/evals/visual-design-foundations.json +52 -0
- package/examples/evals/webhook-integration.json +52 -0
- package/examples/exports/a11y.skill-md.md +80 -0
- package/examples/exports/debugging.skill-md.md +80 -0
- package/examples/exports/refactor.skill-md.md +78 -0
- package/examples/exports/testing-strategy.skill-md.md +81 -0
- package/examples/projects/markdown-static-site/README.md +115 -0
- package/examples/projects/markdown-static-site/skills/content-source-router/SKILL.md +131 -0
- package/examples/projects/markdown-static-site/skills/image-optimization-pipeline-config/SKILL.md +132 -0
- package/examples/projects/markdown-static-site/skills/link-rot-detection/SKILL.md +103 -0
- package/examples/projects/markdown-static-site/skills/markdown-post-frontmatter-validation/SKILL.md +133 -0
- package/examples/projects/markdown-static-site/skills/migrate-posts-to-v2-frontmatter/SKILL.md +140 -0
- package/examples/projects/saas-stripe-postgres/README.md +208 -0
- package/examples/projects/saas-stripe-postgres/db/migrations/0004_canonicalize_orders.sql +37 -0
- package/examples/projects/saas-stripe-postgres/db/schema.sql +112 -0
- package/examples/projects/saas-stripe-postgres/skills/migrate-orders-to-canonical-schema/SKILL.md +149 -0
- package/examples/projects/saas-stripe-postgres/skills/nextjs-server-action-validation/SKILL.md +154 -0
- package/examples/projects/saas-stripe-postgres/skills/payment-provider-router/SKILL.md +153 -0
- package/examples/projects/saas-stripe-postgres/skills/postgres-rls-pattern/SKILL.md +163 -0
- package/examples/projects/saas-stripe-postgres/skills/stripe-webhook-signature-verification/SKILL.md +137 -0
- package/examples/protocol/skill-metadata-template.md +301 -0
- package/examples/protocol/skills.manifest.sample.json +13245 -0
- package/examples/skill-metadata-template.md +317 -0
- package/examples/skills.manifest.sample.json +13519 -0
- package/examples/tests/v3-1-skos-fixture/SKILL.md +93 -0
- package/marketplace/README.md +17 -0
- package/marketplace/skills/a11y/SKILL.md +66 -0
- package/marketplace/skills/acid-fundamentals/SKILL.md +106 -0
- package/marketplace/skills/agent-engineering/SKILL.md +386 -0
- package/marketplace/skills/agent-eval-design/SKILL.md +55 -0
- package/marketplace/skills/ai-native-development/SKILL.md +294 -0
- package/marketplace/skills/api-design/SKILL.md +60 -0
- package/marketplace/skills/architecture-decision-records/SKILL.md +55 -0
- package/marketplace/skills/background-jobs/SKILL.md +265 -0
- package/marketplace/skills/bounded-context-mapping/SKILL.md +55 -0
- package/marketplace/skills/cap-theorem-tradeoffs/SKILL.md +127 -0
- package/marketplace/skills/client-server-boundary/SKILL.md +187 -0
- package/marketplace/skills/code-review/SKILL.md +120 -0
- package/marketplace/skills/color-system-design/SKILL.md +43 -0
- package/marketplace/skills/component-architecture/SKILL.md +126 -0
- package/marketplace/skills/compression/SKILL.md +112 -0
- package/marketplace/skills/conceptual-modeling/SKILL.md +181 -0
- package/marketplace/skills/connection-pooling/SKILL.md +105 -0
- package/marketplace/skills/constraint-awareness/SKILL.md +287 -0
- package/marketplace/skills/content-monitor/SKILL.md +209 -0
- package/marketplace/skills/context-engineering/SKILL.md +320 -0
- package/marketplace/skills/context-graph/SKILL.md +174 -0
- package/marketplace/skills/context-management/SKILL.md +174 -0
- package/marketplace/skills/context-window/SKILL.md +239 -0
- package/marketplace/skills/contract-testing/SKILL.md +120 -0
- package/marketplace/skills/cron-scheduling/SKILL.md +223 -0
- package/marketplace/skills/dark-mode-implementation/SKILL.md +47 -0
- package/marketplace/skills/data-modeling/SKILL.md +59 -0
- package/marketplace/skills/data-modeling-fundamentals/SKILL.md +117 -0
- package/marketplace/skills/database-migration/SKILL.md +429 -0
- package/marketplace/skills/debugging/SKILL.md +67 -0
- package/marketplace/skills/dependency-architecture/SKILL.md +58 -0
- package/marketplace/skills/design-module-composition/SKILL.md +43 -0
- package/marketplace/skills/design-system-architecture/SKILL.md +61 -0
- package/marketplace/skills/design-thinking/SKILL.md +44 -0
- package/marketplace/skills/diagnosis/SKILL.md +296 -0
- package/marketplace/skills/diff-analysis/SKILL.md +188 -0
- package/marketplace/skills/e2e-test-design/SKILL.md +113 -0
- package/marketplace/skills/entity-relationship-modeling/SKILL.md +218 -0
- package/marketplace/skills/epistemic-grounding/SKILL.md +112 -0
- package/marketplace/skills/error-boundary/SKILL.md +235 -0
- package/marketplace/skills/error-tracking/SKILL.md +261 -0
- package/marketplace/skills/eval-driven-development/SKILL.md +147 -0
- package/marketplace/skills/evaluation/SKILL.md +113 -0
- package/marketplace/skills/event-contract-design/SKILL.md +60 -0
- package/marketplace/skills/event-storming/SKILL.md +56 -0
- package/marketplace/skills/form-ux-architecture/SKILL.md +60 -0
- package/marketplace/skills/framework-fit-analysis/SKILL.md +59 -0
- package/marketplace/skills/frontend-architecture/SKILL.md +43 -0
- package/marketplace/skills/generative-ui/SKILL.md +118 -0
- package/marketplace/skills/graph-audit/SKILL.md +81 -0
- package/marketplace/skills/guardrails/SKILL.md +118 -0
- package/marketplace/skills/hooks-patterns/SKILL.md +185 -0
- package/marketplace/skills/http-semantics/SKILL.md +136 -0
- package/marketplace/skills/ideation/SKILL.md +41 -0
- package/marketplace/skills/indexing-strategy/SKILL.md +108 -0
- package/marketplace/skills/information-architecture/SKILL.md +59 -0
- package/marketplace/skills/integration-test-design/SKILL.md +111 -0
- package/marketplace/skills/intent-recognition/SKILL.md +136 -0
- package/marketplace/skills/interaction-feedback/SKILL.md +59 -0
- package/marketplace/skills/interaction-patterns/SKILL.md +59 -0
- package/marketplace/skills/journey-mapping/SKILL.md +41 -0
- package/marketplace/skills/keywords/SKILL.md +213 -0
- package/marketplace/skills/knowledge-modeling/SKILL.md +232 -0
- package/marketplace/skills/layout-composition/SKILL.md +59 -0
- package/marketplace/skills/linguistics/SKILL.md +429 -0
- package/marketplace/skills/lint-overlay/SKILL.md +76 -0
- package/marketplace/skills/mental-models/SKILL.md +126 -0
- package/marketplace/skills/merge-queue/SKILL.md +94 -0
- package/marketplace/skills/methodology/SKILL.md +317 -0
- package/marketplace/skills/microcopy/SKILL.md +232 -0
- package/marketplace/skills/middleware-patterns/SKILL.md +363 -0
- package/marketplace/skills/mobile-responsive-ux/SKILL.md +287 -0
- package/marketplace/skills/mutation-testing/SKILL.md +112 -0
- package/marketplace/skills/naming-conventions/SKILL.md +112 -0
- package/marketplace/skills/observability-modeling/SKILL.md +59 -0
- package/marketplace/skills/ontology-modeling/SKILL.md +67 -0
- package/marketplace/skills/owasp-security/SKILL.md +153 -0
- package/marketplace/skills/pattern-recognition/SKILL.md +472 -0
- package/marketplace/skills/performance-budgets/SKILL.md +185 -0
- package/marketplace/skills/performance-engineering/SKILL.md +58 -0
- package/marketplace/skills/performance-testing/SKILL.md +125 -0
- package/marketplace/skills/printify/SKILL.md +42 -0
- package/marketplace/skills/prioritization/SKILL.md +118 -0
- package/marketplace/skills/problem-framing/SKILL.md +41 -0
- package/marketplace/skills/problem-locating-solving/SKILL.md +203 -0
- package/marketplace/skills/project-knowledge-extraction/SKILL.md +54 -0
- package/marketplace/skills/prompt-craft/SKILL.md +134 -0
- package/marketplace/skills/prompt-injection-defense/SKILL.md +132 -0
- package/marketplace/skills/property-based-testing/SKILL.md +100 -0
- package/marketplace/skills/prototyping/SKILL.md +43 -0
- package/marketplace/skills/query-optimization/SKILL.md +144 -0
- package/marketplace/skills/real-time-updates/SKILL.md +324 -0
- package/marketplace/skills/ref-patterns/SKILL.md +284 -0
- package/marketplace/skills/refactor/SKILL.md +65 -0
- package/marketplace/skills/rendering-models/SKILL.md +142 -0
- package/marketplace/skills/replication-patterns/SKILL.md +110 -0
- package/marketplace/skills/research-synthesis/SKILL.md +41 -0
- package/marketplace/skills/route-handler-design/SKILL.md +347 -0
- package/marketplace/skills/schema-evolution/SKILL.md +140 -0
- package/marketplace/skills/security-fundamentals/SKILL.md +139 -0
- package/marketplace/skills/semantic-center/SKILL.md +194 -0
- package/marketplace/skills/semantic-relations/SKILL.md +250 -0
- package/marketplace/skills/semantics/SKILL.md +366 -0
- package/marketplace/skills/semiotics/SKILL.md +230 -0
- package/marketplace/skills/seo-strategy/SKILL.md +260 -0
- package/marketplace/skills/server-actions-design/SKILL.md +243 -0
- package/marketplace/skills/server-components-design/SKILL.md +190 -0
- package/marketplace/skills/sharding-strategy/SKILL.md +123 -0
- package/marketplace/skills/shopify/SKILL.md +42 -0
- package/marketplace/skills/skill-infrastructure/SKILL.md +320 -0
- package/marketplace/skills/skill-router/SKILL.md +71 -0
- package/marketplace/skills/skill-scaffold/SKILL.md +105 -0
- package/marketplace/skills/snapshot-testing/SKILL.md +120 -0
- package/marketplace/skills/spec-driven-development/SKILL.md +148 -0
- package/marketplace/skills/state-machine-modeling/SKILL.md +56 -0
- package/marketplace/skills/state-management/SKILL.md +134 -0
- package/marketplace/skills/streaming-architecture/SKILL.md +194 -0
- package/marketplace/skills/summarization/SKILL.md +156 -0
- package/marketplace/skills/suspense-patterns/SKILL.md +265 -0
- package/marketplace/skills/system-interface-contracts/SKILL.md +59 -0
- package/marketplace/skills/task-analysis/SKILL.md +201 -0
- package/marketplace/skills/taxonomy-design/SKILL.md +66 -0
- package/marketplace/skills/test-coverage-strategy/SKILL.md +108 -0
- package/marketplace/skills/test-doubles-design/SKILL.md +98 -0
- package/marketplace/skills/test-driven-development/SKILL.md +96 -0
- package/marketplace/skills/testing-strategy/SKILL.md +67 -0
- package/marketplace/skills/theme-system-design/SKILL.md +43 -0
- package/marketplace/skills/tool-call-flow/SKILL.md +229 -0
- package/marketplace/skills/tool-call-strategy/SKILL.md +292 -0
- package/marketplace/skills/transaction-isolation/SKILL.md +98 -0
- package/marketplace/skills/type-safety/SKILL.md +177 -0
- package/marketplace/skills/typography-system/SKILL.md +43 -0
- package/marketplace/skills/usability-testing/SKILL.md +43 -0
- package/marketplace/skills/user-research/SKILL.md +43 -0
- package/marketplace/skills/vercel-composition-patterns/SKILL.md +157 -0
- package/marketplace/skills/version-control/SKILL.md +233 -0
- package/marketplace/skills/visual-design-foundations/SKILL.md +59 -0
- package/marketplace/skills/visual-hierarchy/SKILL.md +43 -0
- package/marketplace/skills/webhook-integration/SKILL.md +331 -0
- package/marketplace/skills/writing-humanizer/SKILL.md +380 -0
- package/package.json +67 -0
- package/schemas/manifest.schema.json +811 -0
- package/schemas/manifest.v2.schema.json +164 -0
- package/schemas/manifest.v3.schema.json +758 -0
- package/schemas/manifest.v4.schema.json +755 -0
- package/schemas/manifest.v5.schema.json +755 -0
- package/schemas/manifest.v6.schema.json +811 -0
- package/schemas/skill.context.jsonld +279 -0
- package/schemas/skill.schema.json +919 -0
- package/schemas/skill.v2.schema.json +201 -0
- package/schemas/skill.v3.schema.json +827 -0
- package/schemas/skill.v4.schema.json +822 -0
- package/schemas/skill.v5.schema.json +830 -0
- package/schemas/skill.v6.schema.json +946 -0
- package/schemas/vocabulary/keywords.json +180 -0
- package/schemas/vocabulary/workspace_tags.json +23 -0
- package/scripts/__tests__/migrate-skill-v2-to-v3.test.js +161 -0
- package/scripts/__tests__/migrate-skill-v3-to-v4.test.js +158 -0
- package/scripts/__tests__/test-export-parser-drift.js +149 -0
- package/scripts/__tests__/test-marketplace-export.js +114 -0
- package/scripts/__tests__/test-router-paths.js +82 -0
- package/scripts/__tests__/test-stability-promotion.js +244 -0
- package/scripts/__tests__/test-v3-1-alias-contract.js +109 -0
- package/scripts/__tests__/test-v3-1-skos-runtime.js +116 -0
- package/scripts/backfill-schema-version.js +198 -0
- package/scripts/build-field-reference.js +160 -0
- package/scripts/build-retrieval-baseline.js +511 -0
- package/scripts/check-markdown-links.js +211 -0
- package/scripts/check-protocol-consistency.js +979 -0
- package/scripts/export-marketplace-skills.js +610 -0
- package/scripts/export-skill.js +374 -0
- package/scripts/generate-manifest.js +787 -0
- package/scripts/lib/alias-contract.js +83 -0
- package/scripts/lib/audit-prompt-builder.js +771 -0
- package/scripts/lib/mock-grader.js +134 -0
- package/scripts/lib/parse-frontmatter.js +429 -0
- package/scripts/lib/roots.js +119 -0
- package/scripts/lint/check-archetype-sections.js +185 -0
- package/scripts/lint/check-category-enum.js +83 -0
- package/scripts/lint/check-routing-eval.js +146 -0
- package/scripts/lint/check-routing-quality.js +211 -0
- package/scripts/lint/check-stability-promotion.js +220 -0
- package/scripts/lint/format-code-frame.js +206 -0
- package/scripts/marketplace-install.js +125 -0
- package/scripts/migrate-category-to-enum.js +169 -0
- package/scripts/migrate-skill-v2-to-v3.js +424 -0
- package/scripts/migrate-skill-v3-to-v4.js +200 -0
- package/scripts/migrate-skill-v5-to-v6.js +304 -0
- package/scripts/restructure-by-category.js +85 -0
- package/scripts/seed-publication-classification.js +282 -0
- package/scripts/skill-audit.js +893 -0
- package/scripts/skill-graph-drift.js +483 -0
- package/scripts/skill-graph-route.js +766 -0
- package/scripts/skill-graph-routing-eval.js +393 -0
- package/scripts/skill-lint.js +1317 -0
- package/scripts/skill-overlap.js +213 -0
- package/scripts/verify-skill-md-export.js +201 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ontology-modeling
|
|
3
|
+
description: "Use when formalizing domain meaning with classes, properties, constraints, RDF/OWL-style semantics, SHACL-like validation shapes, or reasoning-ready axioms. Do NOT use for simple category trees (use `taxonomy-design`), pre-implementation business entity sketches (use `conceptual-modeling`), database schemas (use `data-modeling`), or broad representation choice (use `knowledge-modeling`)."
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: "Portable ontology modeling guidance; implementation can be Markdown, RDF, JSON-LD, OWL, SHACL, or an internal schema language."
|
|
6
|
+
allowed-tools: Read Grep
|
|
7
|
+
metadata:
|
|
8
|
+
metadata: "{\"schema_version\":6,\"version\":\"1.1.0\",\"type\":\"capability\",\"category\":\"foundations\",\"domain\":\"foundations/ontology\",\"scope\":\"portable\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-05-16\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-05-16\\\\\\\"}\",\"eval_artifacts\":\"planned\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"comprehension_state\":\"present\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"ontology modeling\\\\\\\",\\\\\\\"formal semantics\\\\\\\",\\\\\\\"RDF\\\\\\\",\\\\\\\"OWL\\\\\\\",\\\\\\\"JSON-LD\\\\\\\",\\\\\\\"SHACL\\\\\\\",\\\\\\\"class axioms\\\\\\\",\\\\\\\"property domains\\\\\\\",\\\\\\\"property ranges\\\\\\\",\\\\\\\"disjoint classes\\\\\\\",\\\\\\\"reasoning constraints\\\\\\\",\\\\\\\"semantic interoperability\\\\\\\"]\",\"examples\":\"[\\\\\\\"we need class and property definitions that another system can reason over, not just a human-readable diagram\\\\\\\",\\\\\\\"should Customer and Organization be disjoint classes in this ontology?\\\\\\\",\\\\\\\"define property domains and ranges for our skill graph export\\\\\\\",\\\\\\\"turn this conceptual model into a machine-checkable ontology without inventing database tables\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"make a simple browse category tree for skills\\\\\\\",\\\\\\\"identify the business entities and relationships before implementation\\\\\\\",\\\\\\\"design the SQL tables, keys, and indexes\\\\\\\",\\\\\\\"choose whether this knowledge belongs in rules, frames, a graph, or a hybrid\\\\\\\"]\",\"relations\":\"{\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"taxonomy-design\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"taxonomy-design owns informal classification and facets; ontology-modeling owns formal semantics\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"conceptual-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"conceptual-modeling is stakeholder-readable domain analysis; ontology-modeling is machine-checkable semantic formalization\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"data-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"data-modeling owns persistence structure and constraints; ontology-modeling owns meaning constraints\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"knowledge-modeling\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"knowledge-modeling chooses the representation paradigm; ontology-modeling applies one formal paradigm\\\\\\\"}],\\\\\\\"related\\\\\\\":[\\\\\\\"semantic-relations\\\\\\\",\\\\\\\"taxonomy-design\\\\\\\",\\\\\\\"knowledge-modeling\\\\\\\"],\\\\\\\"depends_on\\\\\\\":[\\\\\\\"semantic-relations\\\\\\\"],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"semantic-relations\\\\\\\",\\\\\\\"conceptual-modeling\\\\\\\"]}\",\"portability\":\"{\\\\\\\"readiness\\\\\\\":\\\\\\\"scripted\\\\\\\",\\\\\\\"targets\\\\\\\":[\\\\\\\"skill-md\\\\\\\"]}\",\"lifecycle\":\"{\\\\\\\"stale_after_days\\\\\\\":365,\\\\\\\"review_cadence\\\\\\\":\\\\\\\"quarterly\\\\\\\"}\",\"mental_model\":\"|\",\"purpose\":\"|\",\"boundary\":\"|\",\"analogy\":\"An ontology is to a domain model what an engineering tolerance specification is to a manufactured part — the part might fit at +/-0.5mm informally (taxonomy, conceptual model), but if another factory must mass-produce a counterpart that mates with it, both factories need a tolerance spec that says *exactly* what 'fits' means in microns. The spec is more expensive to write than the napkin sketch, but it is the artefact that lets two shops produce interlocking parts without ever talking to each other.\",\"misconception\":\"|\",\"concept\":\"{\\\\\\\"definition\\\\\\\":\\\\\\\"Ontology modeling is the discipline of formalizing the meaning of a domain into classes, properties, and axioms whose semantics is precise enough for automated reasoning, validation, or cross-system interoperability. Drawing from Aristotle's categories, Gruber's information-systems definition of ontology, and Guarino's formal ontology tradition, it treats meaning as something that can be specified — a *commitment to a conceptualization* — and the specification as a contract that downstream consumers can compute over.\\\\\\\",\\\\\\\"mental_model\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"purpose\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"boundary\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"taxonomy\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"analogy\\\\\\\":\\\\\\\"|\\\\\\\",\\\\\\\"misconception\\\\\\\":\\\\\\\"|\\\\\\\"}\",\"skill_graph_source_repo\":\"https://github.com/jacob-balslev/skill-graph\",\"skill_graph_protocol\":\"Skill Metadata Protocol v5\",\"skill_graph_project\":\"Skill Graph\",\"skill_graph_canonical_skill\":\"skills/ontology-modeling/SKILL.md\"}"
|
|
9
|
+
skill_graph_source_repo: "https://github.com/jacob-balslev/skill-graph"
|
|
10
|
+
skill_graph_protocol: Skill Metadata Protocol v4
|
|
11
|
+
skill_graph_project: Skill Graph
|
|
12
|
+
skill_graph_canonical_skill: skills/ontology-modeling/SKILL.md
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Ontology Modeling
|
|
16
|
+
|
|
17
|
+
## Coverage
|
|
18
|
+
|
|
19
|
+
Formalize domain meaning into classes, properties, constraints, and axioms. Covers class hierarchy, object/data properties, domain/range, cardinality constraints, equivalence, disjointness, identity, controlled vocabularies, validation shapes, and interop-oriented JSON-LD/RDF projection. The output may be an actual ontology file or a precise ontology sketch before implementation.
|
|
20
|
+
|
|
21
|
+
## Philosophy
|
|
22
|
+
|
|
23
|
+
Ontology modeling is only worth its cost when ambiguity, interoperability, validation, or reasoning matter. Most teams do not need OWL. They need clear conceptual models and controlled vocabularies. Escalate to ontology when another consumer must compute over the semantics, validate instances against constraints, or align meaning across systems.
|
|
24
|
+
|
|
25
|
+
The ontology must preserve business meaning while stating which inferences are allowed. A vague ontology is worse than no ontology because it gives false confidence to downstream tools.
|
|
26
|
+
|
|
27
|
+
## Method
|
|
28
|
+
|
|
29
|
+
1. Identify competency questions: what must the ontology answer or validate?
|
|
30
|
+
2. Separate classes, instances, and literals.
|
|
31
|
+
3. Define properties with domain, range, direction, and cardinality where needed.
|
|
32
|
+
4. Add equivalence and disjointness only when the claim is durable.
|
|
33
|
+
5. Reuse existing vocabularies where they fit; do not rename standards for style.
|
|
34
|
+
6. Validate against positive and negative instance examples.
|
|
35
|
+
7. Document open-world vs closed-world assumptions.
|
|
36
|
+
|
|
37
|
+
## Verification
|
|
38
|
+
|
|
39
|
+
- [ ] Every class exists to answer a competency question
|
|
40
|
+
- [ ] Property domain and range are explicit where consumers depend on them
|
|
41
|
+
- [ ] Disjointness claims are intentional and tested with counterexamples
|
|
42
|
+
- [ ] Synonyms are aliases, not duplicate classes
|
|
43
|
+
- [ ] The model distinguishes class, instance, and literal values
|
|
44
|
+
- [ ] Validation examples include invalid cases
|
|
45
|
+
- [ ] Reasoning assumptions are stated
|
|
46
|
+
|
|
47
|
+
## Do NOT Use When
|
|
48
|
+
|
|
49
|
+
| Use instead | When |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `taxonomy-design` | You need a human-governed category tree or facets, not formal axioms. |
|
|
52
|
+
| `conceptual-modeling` | You are still discovering business entities and relationships with stakeholders. |
|
|
53
|
+
| `data-modeling` | You need persistence schema, keys, indexes, or denormalization decisions. |
|
|
54
|
+
| `semantic-relations` | You only need to choose the relation type between concepts. |
|
|
55
|
+
|
|
56
|
+
## Key Sources
|
|
57
|
+
|
|
58
|
+
- Gruber, T. R. (1993). "A Translation Approach to Portable Ontology Specifications." *Knowledge Acquisition*, 5(2), 199-220. The canonical definition of ontology as "a specification of a conceptualization"; the modern grounding of formal ontology in information systems.
|
|
59
|
+
- Guarino, N. (1998). "Formal Ontology and Information Systems." In *Proceedings of FOIS '98*. IOS Press. The methodological foundation for evaluating ontologies; the discipline of distinguishing ontology from taxonomy by the presence of formal axioms.
|
|
60
|
+
- Guarino, N., & Welty, C. (2002). "Evaluating ontological decisions with OntoClean." *Communications of the ACM*, 45(2), 61-65. The OntoClean methodology: meta-properties (rigidity, unity, identity, dependence) for evaluating subclass-relation correctness.
|
|
61
|
+
- Baader, F., Calvanese, D., McGuinness, D. L., Nardi, D., & Patel-Schneider, P. F. (Eds.). (2003). *The Description Logic Handbook*. Cambridge University Press. The canonical reference for the formal foundations of OWL: syntax, semantics, complexity, and reasoning algorithms.
|
|
62
|
+
- W3C. [OWL 2 Web Ontology Language: Document Overview (Second Edition)](https://www.w3.org/TR/owl2-overview/). The normative specification of OWL 2 and its profiles (EL, QL, RL).
|
|
63
|
+
- W3C. [RDF Schema 1.1](https://www.w3.org/TR/rdf-schema/). The minimal RDFS vocabulary used as the lightweight precursor to OWL.
|
|
64
|
+
- W3C. [Shapes Constraint Language (SHACL)](https://www.w3.org/TR/shacl/). The validation companion to OWL: closed-world validation shapes for RDF data.
|
|
65
|
+
- Sowa, J. F. (2000). *Knowledge Representation: Logical, Philosophical, and Computational Foundations*. Brooks/Cole. Comprehensive synthesis covering description logics, conceptual graphs, and the historical lineage from Aristotle to modern formal ontology.
|
|
66
|
+
- Smith, B. (2004). "Beyond Concepts: Ontology as Reality Representation." In *Proceedings of FOIS 2004*. The realist position on ontology: ontologies represent what exists in the world, not just what is in someone's head. Foundation for upper ontologies like BFO.
|
|
67
|
+
- Noy, N. F., & McGuinness, D. L. (2001). ["Ontology Development 101: A Guide to Creating Your First Ontology."](https://protege.stanford.edu/publications/ontology_development/ontology101.pdf) Stanford KSL Technical Report. The widely-cited practitioner methodology for ontology authoring.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: owasp-security
|
|
3
|
+
description: "Use when reviewing code for security vulnerabilities, threat-modelling a new feature, implementing authentication or authorization, handling user input, or auditing a codebase against the OWASP Top 10 (2021). Covers injection (SQL, NoSQL, command, LDAP, XSS), broken access control, cryptographic failures, insecure design, security misconfiguration, vulnerable dependencies, identification and authentication failures, software and data integrity failures, logging and monitoring failures, and server-side request forgery. Do NOT use for general code review (use `code-review` for the holistic per-PR pass), for chasing a known production bug (use `debugging`), or for writing a security policy doc (use `documentation`)."
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Language-agnostic; OWASP Top 10 2021 reference
|
|
6
|
+
allowed-tools: Read Grep Bash
|
|
7
|
+
metadata:
|
|
8
|
+
metadata: "{\"schema_version\":6,\"version\":\"1.0.0\",\"type\":\"capability\",\"category\":\"quality\",\"domain\":\"quality/security\",\"scope\":\"portable\",\"owner\":\"skill-graph-maintainer\",\"freshness\":\"2026-05-04\",\"drift_check\":\"{\\\\\\\"last_verified\\\\\\\":\\\\\\\"2026-05-04\\\\\\\"}\",\"eval_artifacts\":\"planned\",\"eval_state\":\"unverified\",\"routing_eval\":\"absent\",\"stability\":\"experimental\",\"keywords\":\"[\\\\\\\"security\\\\\\\",\\\\\\\"owasp\\\\\\\",\\\\\\\"owasp top 10\\\\\\\",\\\\\\\"vulnerability\\\\\\\",\\\\\\\"sql injection\\\\\\\",\\\\\\\"xss\\\\\\\",\\\\\\\"cross site scripting\\\\\\\",\\\\\\\"csrf\\\\\\\",\\\\\\\"authentication\\\\\\\",\\\\\\\"authorization\\\\\\\",\\\\\\\"access control\\\\\\\",\\\\\\\"broken access control\\\\\\\",\\\\\\\"secret in code\\\\\\\",\\\\\\\"insecure design\\\\\\\",\\\\\\\"cryptographic failure\\\\\\\",\\\\\\\"ssrf\\\\\\\",\\\\\\\"threat model\\\\\\\",\\\\\\\"security review\\\\\\\",\\\\\\\"dependency vulnerability\\\\\\\",\\\\\\\"audit code for security\\\\\\\",\\\\\\\"is this code safe\\\\\\\",\\\\\\\"detect security vulnerabilities\\\\\\\"]\",\"examples\":\"[\\\\\\\"audit this endpoint for SQL injection and XSS specifically\\\\\\\",\\\\\\\"this PR adds user input — what security checks should I run?\\\\\\\",\\\\\\\"threat-model this new file-upload feature\\\\\\\",\\\\\\\"review this auth flow against OWASP — is there a bypass?\\\\\\\",\\\\\\\"I'm building a search box — how do I prevent injection?\\\\\\\",\\\\\\\"the dependency scanner flagged 12 vulnerabilities — which ones matter?\\\\\\\",\\\\\\\"is this code path vulnerable to SSRF?\\\\\\\",\\\\\\\"review this access-control logic — can a non-admin escalate?\\\\\\\"]\",\"anti_examples\":\"[\\\\\\\"review this PR holistically\\\\\\\",\\\\\\\"production users are reporting an error — debug it\\\\\\\",\\\\\\\"write our company security policy doc\\\\\\\",\\\\\\\"scaffold a new skill teaching security review\\\\\\\",\\\\\\\"rename this auth function for clarity\\\\\\\"]\",\"relations\":\"{\\\\\\\"boundary\\\\\\\":[{\\\\\\\"skill\\\\\\\":\\\\\\\"code-review\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"code-review is the holistic per-PR pass that includes security as one of many concerns; owasp-security is the security-specific deep audit\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"debugging\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"debugging chases a known failure (security or otherwise); owasp-security finds vulnerabilities BEFORE they are exploited in production\\\\\\\"},{\\\\\\\"skill\\\\\\\":\\\\\\\"testing-strategy\\\\\\\",\\\\\\\"reason\\\\\\\":\\\\\\\"testing-strategy decides what to test broadly; owasp-security defines security-specific test cases (auth bypass tests, injection tests, etc.) as a sub-concern\\\\\\\"}],\\\\\\\"related\\\\\\\":[\\\\\\\"code-review\\\\\\\",\\\\\\\"testing-strategy\\\\\\\"],\\\\\\\"verify_with\\\\\\\":[\\\\\\\"testing-strategy\\\\\\\",\\\\\\\"code-review\\\\\\\"]}\",\"portability\":\"{\\\\\\\"readiness\\\\\\\":\\\\\\\"scripted\\\\\\\",\\\\\\\"targets\\\\\\\":[\\\\\\\"skill-md\\\\\\\"]}\",\"lifecycle\":\"{\\\\\\\"stale_after_days\\\\\\\":180,\\\\\\\"review_cadence\\\\\\\":\\\\\\\"quarterly\\\\\\\"}\",\"skill_graph_source_repo\":\"https://github.com/jacob-balslev/skill-graph\",\"skill_graph_protocol\":\"Skill Metadata Protocol v5\",\"skill_graph_project\":\"Skill Graph\",\"skill_graph_canonical_skill\":\"skills/owasp-security/SKILL.md\"}"
|
|
9
|
+
skill_graph_source_repo: "https://github.com/jacob-balslev/skill-graph"
|
|
10
|
+
skill_graph_protocol: Skill Metadata Protocol v4
|
|
11
|
+
skill_graph_project: Skill Graph
|
|
12
|
+
skill_graph_canonical_skill: skills/owasp-security/SKILL.md
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# OWASP Security
|
|
16
|
+
|
|
17
|
+
## Coverage
|
|
18
|
+
|
|
19
|
+
- The OWASP Top 10 (2021) categories: A01 Broken Access Control, A02 Cryptographic Failures, A03 Injection, A04 Insecure Design, A05 Security Misconfiguration, A06 Vulnerable Components, A07 Identification and Authentication Failures, A08 Software and Data Integrity Failures, A09 Security Logging and Monitoring Failures, A10 Server-Side Request Forgery
|
|
20
|
+
- Detection patterns per category: the code shapes that signal vulnerability and the grep / static-analysis queries that surface them
|
|
21
|
+
- Mitigation patterns per category: parameterised queries, output encoding, principle-of-least-privilege access checks, secure defaults, dependency pinning, input allowlisting, structured logging
|
|
22
|
+
- Threat modelling: the four-question STRIDE-lite (what are we building, what could go wrong, what are we doing about it, did we do a good job) for new features
|
|
23
|
+
- The AI-generated code premium: vulnerabilities specifically common in LLM-authored code (1.7-2.74× rate per published research) and what to look for
|
|
24
|
+
- Severity grading and disclosure: when a finding is critical, high, medium, or informational, and how to communicate fixes without leaking exploitable detail
|
|
25
|
+
- Defence in depth: why a single mitigation is insufficient, and how to layer controls
|
|
26
|
+
- The auth invariants that recur: authentication separated from authorisation, every privileged action checked, sessions invalidated on logout, secrets never in code or logs
|
|
27
|
+
|
|
28
|
+
## Philosophy
|
|
29
|
+
|
|
30
|
+
Security is not a feature; it is a *property* of the system that erodes silently unless actively maintained. The OWASP Top 10 is not a checklist to memorise — it is a vocabulary for naming the most-common ways software fails. A reviewer who can name "this is A03 Injection" and "this is A07 Identification Failure" can communicate findings to teammates, prioritise against industry data, and reach mitigations that are already documented and known to work.
|
|
31
|
+
|
|
32
|
+
The most expensive security bug is the one you didn't *notice was a security bug*. Most live vulnerabilities started life as a perfectly reasonable-looking line of code that the author did not recognise as a security-relevant decision. The point of this skill is to enrich your default reading of code with a security lens — not as a separate review pass, but as a way of seeing every input, every boundary, and every privileged action.
|
|
33
|
+
|
|
34
|
+
## The OWASP Top 10 — Detection and Mitigation
|
|
35
|
+
|
|
36
|
+
### A01 — Broken Access Control
|
|
37
|
+
|
|
38
|
+
**Detection.** Look for: missing authorisation checks on routes, IDOR-shaped URLs (`/users/{id}/...` with no ownership check), client-side-only role checks, force-browsing exposed endpoints, missing CSRF tokens on state-changing requests.
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
grep -rn "router\.\(get\|post\|put\|delete\)" --include="*.ts" \
|
|
42
|
+
| grep -v "requireAuth\|requireAdmin\|allowAnonymous"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Mitigation.** Centralise authorisation in middleware or a request-scoped helper (`requireAuth`, `requireOrgAccess`, `requireResourceOwnership`). Default to deny; require an explicit positive decision to allow. Test access denial as carefully as access success.
|
|
46
|
+
|
|
47
|
+
### A02 — Cryptographic Failures
|
|
48
|
+
|
|
49
|
+
**Detection.** Plaintext storage of credentials/PII, weak hashing (`md5`, `sha1`) for passwords (use Argon2 or bcrypt), reused IVs, hardcoded keys, missing TLS on sensitive endpoints, weak random sources (non-cryptographic random functions) for security tokens.
|
|
50
|
+
|
|
51
|
+
**Mitigation.** Use library primitives, not hand-rolled crypto. `crypto.randomBytes` for tokens; Argon2id/bcrypt for password hashing; AES-256-GCM with unique nonces for symmetric encryption; TLS 1.3 in transit; environment-variable secrets that the deployment system injects.
|
|
52
|
+
|
|
53
|
+
### A03 — Injection (SQL, NoSQL, command, LDAP, XSS)
|
|
54
|
+
|
|
55
|
+
**Detection.** String concatenation building queries, unparameterised user input interpolated into SQL/NoSQL/shell, dynamic-code-evaluation primitives invoked on any user input, direct DOM injection from user-controlled strings, missing output encoding in templates.
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
grep -rn "exec\|innerHTML\s*=" --include="*.ts" --include="*.js"
|
|
59
|
+
grep -rn "query.*\${" --include="*.ts" --include="*.sql"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The dynamic-code-evaluation family of primitives — those that take a string and execute it as code — is the highest-severity injection surface and should be banned in production code on user-controlled paths.
|
|
63
|
+
|
|
64
|
+
**Mitigation.** Parameterised queries always (`db.query("WHERE id = $1", [id])`, not template-literal interpolation of user input). Output encoding by default in the templating layer. Allowlist user input where the input space is narrow (enums, IDs). Content-Security-Policy headers to limit XSS blast radius. Forbid the dynamic-code-evaluation primitives entirely on production paths via a project-wide lint rule.
|
|
65
|
+
|
|
66
|
+
### A04 — Insecure Design
|
|
67
|
+
|
|
68
|
+
**Detection.** No threat model exists for the feature. Trust boundaries are not documented. Rate limiting absent on expensive operations. Business logic that can be subverted (price-tampering, quantity-tampering, redirect-tampering).
|
|
69
|
+
|
|
70
|
+
**Mitigation.** Threat-model new features at design time, not at review time. Document trust boundaries (what data is trusted, what is not). Rate-limit expensive operations and authentication endpoints. Server-side validate every business-rule the client could subvert.
|
|
71
|
+
|
|
72
|
+
### A05 — Security Misconfiguration
|
|
73
|
+
|
|
74
|
+
**Detection.** Default credentials in production. Verbose error messages (stack traces) returned to users. Unnecessary services enabled. Permissive CORS (`Access-Control-Allow-Origin: *` on credentialed endpoints). Missing security headers (CSP, X-Frame-Options, X-Content-Type-Options).
|
|
75
|
+
|
|
76
|
+
**Mitigation.** Secure defaults. Generic error messages to users; verbose logs to internal-only systems. Minimal services. Specific allowlisted origins for CORS on credentialed endpoints. Helmet (Node) or equivalent for header defaults.
|
|
77
|
+
|
|
78
|
+
### A06 — Vulnerable Components
|
|
79
|
+
|
|
80
|
+
**Detection.** Dependency lockfile not committed. No automated dependency-vulnerability scanning (Dependabot, Snyk, npm audit). Outdated framework versions with known CVEs.
|
|
81
|
+
|
|
82
|
+
**Mitigation.** Lockfiles committed. Automated vulnerability scanning on every PR. Pin direct dependencies; let the lockfile pin transitive ones. Patch high/critical CVEs within the disclosure SLA (typically 7-30 days).
|
|
83
|
+
|
|
84
|
+
### A07 — Identification and Authentication Failures
|
|
85
|
+
|
|
86
|
+
**Detection.** Weak password policies, no rate limiting on login, predictable session tokens, sessions not invalidated on logout, missing MFA option on sensitive accounts, password reset flow with predictable tokens.
|
|
87
|
+
|
|
88
|
+
**Mitigation.** Use a battle-tested auth library (NextAuth, Auth0, Clerk, Devise) — do not hand-roll. Rate-limit authentication. Invalidate sessions on logout, password change, and privilege escalation. Offer MFA. Password reset tokens must be cryptographically random and single-use with a short expiry.
|
|
89
|
+
|
|
90
|
+
### A08 — Software and Data Integrity Failures
|
|
91
|
+
|
|
92
|
+
**Detection.** Insecure deserialisation — using language-native binary deserialisers (e.g., Python's object-deserialisation module, Java native serialisation) on untrusted input is a remote code execution surface. JSON-parse with prototype-pollution risk on untrusted input. Unsigned packages or scripts loaded at runtime. CI/CD pipelines that pull and execute from mutable sources (pipe-to-shell of remote scripts).
|
|
93
|
+
|
|
94
|
+
**Mitigation.** Treat deserialised data as untrusted; validate against a schema before consuming. Prefer JSON or schema-validated formats over native binary deserialisers for any cross-trust-boundary data. Sign artifacts; verify signatures. Pin script sources by hash for any pipe-to-shell.
|
|
95
|
+
|
|
96
|
+
### A09 — Security Logging and Monitoring Failures
|
|
97
|
+
|
|
98
|
+
**Detection.** Authentication failures not logged. Sensitive operations (privilege change, data export) not logged. Logs that contain PII or secrets. No alerting on auth-anomaly patterns.
|
|
99
|
+
|
|
100
|
+
**Mitigation.** Log every authentication attempt (success and failure). Log every privileged operation with actor and target. Strip PII and secrets from logs. Alert on burst-authentication-failure patterns and unusual privileged actions.
|
|
101
|
+
|
|
102
|
+
### A10 — Server-Side Request Forgery (SSRF)
|
|
103
|
+
|
|
104
|
+
**Detection.** User input flowing into outbound HTTP requests (`fetch(userInput)`, `axios.get(userInput)`). Webhook URL validation that allows internal IPs. Image-proxying or URL-preview endpoints.
|
|
105
|
+
|
|
106
|
+
**Mitigation.** Allowlist outbound destinations. Reject URLs that resolve to RFC 1918 private addresses, link-local, or loopback. Use a separate egress-restricted network namespace for user-driven outbound calls.
|
|
107
|
+
|
|
108
|
+
## The AI-Generated Code Premium
|
|
109
|
+
|
|
110
|
+
Empirical studies (Stanford/Microsoft 2023, GitClear 2024) report AI-generated code has 1.7-2.74× the security-issue rate of human-authored equivalents. The recurring failure modes:
|
|
111
|
+
|
|
112
|
+
- **CWE-89 SQL Injection** — string-concatenated queries, the most common AI failure.
|
|
113
|
+
- **CWE-79 XSS** — direct DOM injection patterns from user-controlled strings, the second most common.
|
|
114
|
+
- **CWE-306 Missing Authentication** — endpoints generated without a thought to who can hit them.
|
|
115
|
+
- **CWE-918 SSRF** — user-input URLs passed to fetch with no validation.
|
|
116
|
+
- **CWE-22 Path Traversal** — file operations with unsanitised paths.
|
|
117
|
+
|
|
118
|
+
When reviewing AI-generated diffs, give these five categories deliberate attention. The code "looks fine" because it pattern-matches reasonable code; the security flaw is invisible at the line level and visible only when you ask the security questions explicitly.
|
|
119
|
+
|
|
120
|
+
## Threat-Modelling a New Feature
|
|
121
|
+
|
|
122
|
+
Four questions, asked at design time:
|
|
123
|
+
|
|
124
|
+
1. **What are we building?** A one-paragraph summary of the feature, including who the users are.
|
|
125
|
+
2. **What could go wrong?** Walk through STRIDE: Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege. For each, name a concrete attacker-story.
|
|
126
|
+
3. **What are we doing about it?** For each "could go wrong", name the mitigation. Defence in depth — at least two independent controls per category.
|
|
127
|
+
4. **Did we do a good job?** What evidence will convince us the mitigations work? Tests, code review, penetration testing, monitoring alerts.
|
|
128
|
+
|
|
129
|
+
The four questions are due *before* implementation, not during review. A feature without a threat model is shipping its security as a guess.
|
|
130
|
+
|
|
131
|
+
## Verification
|
|
132
|
+
|
|
133
|
+
- [ ] Every input boundary (HTTP, CLI, file upload, environment) is identified and the trust posture is explicit
|
|
134
|
+
- [ ] Every privileged action has an authorisation check that defaults to deny
|
|
135
|
+
- [ ] All database queries are parameterised; no string-concatenated SQL/NoSQL
|
|
136
|
+
- [ ] All HTML output is encoded by default; direct DOM injection from user-controlled strings is absent
|
|
137
|
+
- [ ] Dynamic-code-evaluation primitives are forbidden on production paths
|
|
138
|
+
- [ ] Secrets are loaded from environment, not committed in code or logs
|
|
139
|
+
- [ ] Dependencies are scanned on every PR; high/critical CVEs are patched within SLA
|
|
140
|
+
- [ ] Authentication is rate-limited; sessions invalidate on logout, password change, privilege escalation
|
|
141
|
+
- [ ] Outbound HTTP from user input is allowlisted (no SSRF surface)
|
|
142
|
+
- [ ] AI-generated diffs have been audited specifically for the five most-common AI failure modes
|
|
143
|
+
- [ ] A threat model exists for the feature being shipped
|
|
144
|
+
|
|
145
|
+
## Do NOT Use When
|
|
146
|
+
|
|
147
|
+
| Use instead | When |
|
|
148
|
+
|---|---|
|
|
149
|
+
| `code-review` | Conducting a holistic per-PR review (security is one concern of many) |
|
|
150
|
+
| `debugging` | Investigating a known production failure (security or otherwise) |
|
|
151
|
+
| `documentation` | Writing security policy or contributor security guide |
|
|
152
|
+
| `testing-strategy` | Deciding broadly what to test (security tests are one slice of strategy) |
|
|
153
|
+
| `skill-scaffold` | Authoring a new SKILL.md, including a security-themed skill |
|