ac-framework 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +299 -185
- package/bin/postinstall.js +8 -1
- package/framework/.agent/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.agent/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.agent/skills/brainstorming/SKILL.md +266 -38
- package/framework/.agent/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.agent/skills/code-review/SKILL.md +250 -0
- package/framework/.agent/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.agent/skills/documentation/SKILL.md +441 -0
- package/framework/.agent/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.agent/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.agent/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.agent/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.agent/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.agent/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.agent/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.agent/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.agent/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.agent/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.agent/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.agent/skills/testing-qa/SKILL.md +249 -0
- package/framework/.agent/workflows/ac-lite.md +192 -0
- package/framework/.agent/workflows/ac.md +402 -177
- package/framework/.amazonq/prompts/ac-lite.md +192 -0
- package/framework/.amazonq/prompts/ac.md +402 -177
- package/framework/.amazonq/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.amazonq/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.amazonq/skills/brainstorming/SKILL.md +266 -38
- package/framework/.amazonq/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.amazonq/skills/code-review/SKILL.md +250 -0
- package/framework/.amazonq/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.amazonq/skills/documentation/SKILL.md +441 -0
- package/framework/.amazonq/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.amazonq/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.amazonq/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.amazonq/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.amazonq/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.amazonq/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.amazonq/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.amazonq/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.amazonq/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.amazonq/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.amazonq/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.amazonq/skills/testing-qa/SKILL.md +249 -0
- package/framework/.antigravity/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.antigravity/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.antigravity/skills/api-design-principles/SKILL.md +528 -0
- package/framework/.antigravity/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/framework/.antigravity/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/framework/.antigravity/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/framework/.antigravity/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/framework/.antigravity/skills/brainstorming/SKILL.md +282 -0
- package/framework/.antigravity/skills/changelog-generator/SKILL.md +104 -0
- package/framework/.antigravity/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.antigravity/skills/code-maintainability/SKILL.md +1108 -0
- package/framework/.antigravity/skills/code-review/SKILL.md +250 -0
- package/framework/.antigravity/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.antigravity/skills/documentation/SKILL.md +441 -0
- package/framework/.antigravity/skills/error-handling-patterns/SKILL.md +641 -0
- package/framework/.antigravity/skills/interface-design/SKILL.md +310 -0
- package/framework/.antigravity/skills/interface-design/references/example.md +86 -0
- package/framework/.antigravity/skills/interface-design/references/principles.md +235 -0
- package/framework/.antigravity/skills/interface-design/references/validation.md +48 -0
- package/framework/.antigravity/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.antigravity/skills/openspec-apply-change/SKILL.md +172 -0
- package/framework/.antigravity/skills/openspec-archive-change/SKILL.md +130 -0
- package/framework/.antigravity/skills/openspec-bulk-archive-change/SKILL.md +262 -0
- package/framework/.antigravity/skills/openspec-continue-change/SKILL.md +134 -0
- package/framework/.antigravity/skills/openspec-explore/SKILL.md +306 -0
- package/framework/.antigravity/skills/openspec-ff-change/SKILL.md +117 -0
- package/framework/.antigravity/skills/openspec-new-change/SKILL.md +90 -0
- package/framework/.antigravity/skills/openspec-onboard/SKILL.md +529 -0
- package/framework/.antigravity/skills/openspec-sync-specs/SKILL.md +154 -0
- package/framework/.antigravity/skills/openspec-verify-change/SKILL.md +184 -0
- package/framework/.antigravity/skills/performance-optimizer/SKILL.md +43 -0
- package/framework/.antigravity/skills/project-constitution/SKILL.md +66 -0
- package/framework/.antigravity/skills/project-index/SKILL.md +234 -0
- package/framework/.antigravity/skills/project-index/scripts/scan_codebase.py +47 -0
- package/framework/.antigravity/skills/project-index/templates/agent-template.md +18 -0
- package/framework/.antigravity/skills/project-index/templates/skill-template.md +20 -0
- package/framework/.antigravity/skills/requirement-checklist/SKILL.md +90 -0
- package/framework/.antigravity/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.antigravity/skills/secure-coding-cybersecurity/SKILL.md +793 -0
- package/framework/.antigravity/skills/secure-coding-cybersecurity/references/ai_coding_pitfalls.md +44 -0
- package/framework/.antigravity/skills/secure-coding-cybersecurity/references/owasp_top_10_2025.md +28 -0
- package/framework/.antigravity/skills/secure-coding-cybersecurity/references/secure_coding_examples.md +102 -0
- package/framework/.antigravity/skills/secure-coding-cybersecurity/scripts/security_audit.py +46 -0
- package/framework/.antigravity/skills/skill-writer/SKILL.md +385 -0
- package/framework/.antigravity/skills/spec-analysis/SKILL.md +65 -0
- package/framework/.antigravity/skills/spec-clarification/SKILL.md +73 -0
- package/framework/.antigravity/skills/sync-index/SKILL.md +35 -0
- package/framework/.antigravity/skills/systematic-debugging/SKILL.md +296 -0
- package/framework/.antigravity/skills/test-generator/SKILL.md +41 -0
- package/framework/.antigravity/skills/testing-qa/SKILL.md +249 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/framework/.antigravity/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/framework/.antigravity/workflows/ac-lite.md +192 -0
- package/framework/.antigravity/workflows/ac.md +486 -0
- package/framework/.augment/commands/ac-lite.md +192 -0
- package/framework/.augment/commands/ac.md +402 -177
- package/framework/.augment/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.augment/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.augment/skills/brainstorming/SKILL.md +266 -38
- package/framework/.augment/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.augment/skills/code-review/SKILL.md +250 -0
- package/framework/.augment/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.augment/skills/documentation/SKILL.md +441 -0
- package/framework/.augment/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.augment/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.augment/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.augment/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.augment/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.augment/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.augment/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.augment/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.augment/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.augment/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.augment/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.augment/skills/testing-qa/SKILL.md +249 -0
- package/framework/.claude/commands/opsx/ac-lite.md +192 -0
- package/framework/.claude/commands/opsx/ac.md +402 -177
- package/framework/.claude/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.claude/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.claude/skills/brainstorming/SKILL.md +266 -38
- package/framework/.claude/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.claude/skills/code-review/SKILL.md +250 -0
- package/framework/.claude/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.claude/skills/documentation/SKILL.md +441 -0
- package/framework/.claude/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.claude/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.claude/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.claude/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.claude/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.claude/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.claude/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.claude/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.claude/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.claude/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.claude/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.claude/skills/testing-qa/SKILL.md +249 -0
- package/framework/.cline/commands/opsx/ac-lite.md +192 -0
- package/framework/.cline/commands/opsx/ac.md +486 -0
- package/framework/.cline/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.cline/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.cline/skills/brainstorming/SKILL.md +266 -38
- package/framework/.cline/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.cline/skills/code-review/SKILL.md +250 -0
- package/framework/.cline/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.cline/skills/documentation/SKILL.md +441 -0
- package/framework/.cline/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.cline/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.cline/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.cline/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.cline/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.cline/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.cline/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.cline/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.cline/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.cline/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.cline/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.cline/skills/testing-qa/SKILL.md +249 -0
- package/framework/.clinerules/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.clinerules/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.clinerules/skills/brainstorming/SKILL.md +266 -38
- package/framework/.clinerules/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.clinerules/skills/code-review/SKILL.md +250 -0
- package/framework/.clinerules/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.clinerules/skills/documentation/SKILL.md +441 -0
- package/framework/.clinerules/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.clinerules/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.clinerules/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.clinerules/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.clinerules/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.clinerules/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.clinerules/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.clinerules/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.clinerules/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.clinerules/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.clinerules/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.clinerules/skills/testing-qa/SKILL.md +249 -0
- package/framework/.clinerules/workflows/ac-lite.md +192 -0
- package/framework/.clinerules/workflows/ac.md +402 -177
- package/framework/.codebuddy/commands/opsx/ac-lite.md +192 -0
- package/framework/.codebuddy/commands/opsx/ac.md +402 -177
- package/framework/.codebuddy/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.codebuddy/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.codebuddy/skills/brainstorming/SKILL.md +266 -38
- package/framework/.codebuddy/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.codebuddy/skills/code-review/SKILL.md +250 -0
- package/framework/.codebuddy/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.codebuddy/skills/documentation/SKILL.md +441 -0
- package/framework/.codebuddy/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.codebuddy/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.codebuddy/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.codebuddy/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.codebuddy/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.codebuddy/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.codebuddy/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.codebuddy/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.codebuddy/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.codebuddy/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.codebuddy/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.codebuddy/skills/testing-qa/SKILL.md +249 -0
- package/framework/.codex/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.codex/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.codex/skills/brainstorming/SKILL.md +266 -38
- package/framework/.codex/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.codex/skills/code-review/SKILL.md +250 -0
- package/framework/.codex/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.codex/skills/documentation/SKILL.md +441 -0
- package/framework/.codex/skills/main-skill/SKILL.md +455 -0
- package/framework/.codex/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.codex/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.codex/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.codex/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.codex/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.codex/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.codex/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.codex/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.codex/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.codex/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.codex/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.codex/skills/testing-qa/SKILL.md +249 -0
- package/framework/.continue/prompts/ac-lite.md +192 -0
- package/framework/.continue/prompts/ac.md +486 -0
- package/framework/.continue/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.continue/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.continue/skills/brainstorming/SKILL.md +266 -38
- package/framework/.continue/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.continue/skills/code-review/SKILL.md +250 -0
- package/framework/.continue/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.continue/skills/documentation/SKILL.md +441 -0
- package/framework/.continue/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.continue/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.continue/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.continue/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.continue/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.continue/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.continue/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.continue/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.continue/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.continue/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.continue/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.continue/skills/testing-qa/SKILL.md +249 -0
- package/framework/.cospec/openspec/commands/ac-lite.md +192 -0
- package/framework/.cospec/openspec/commands/ac.md +402 -177
- package/framework/.cospec/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.cospec/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.cospec/skills/brainstorming/SKILL.md +266 -38
- package/framework/.cospec/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.cospec/skills/code-review/SKILL.md +250 -0
- package/framework/.cospec/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.cospec/skills/documentation/SKILL.md +441 -0
- package/framework/.cospec/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.cospec/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.cospec/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.cospec/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.cospec/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.cospec/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.cospec/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.cospec/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.cospec/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.cospec/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.cospec/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.cospec/skills/testing-qa/SKILL.md +249 -0
- package/framework/.crush/commands/opsx/ac-lite.md +192 -0
- package/framework/.crush/commands/opsx/ac.md +402 -177
- package/framework/.crush/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.crush/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.crush/skills/brainstorming/SKILL.md +266 -38
- package/framework/.crush/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.crush/skills/code-review/SKILL.md +250 -0
- package/framework/.crush/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.crush/skills/documentation/SKILL.md +441 -0
- package/framework/.crush/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.crush/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.crush/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.crush/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.crush/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.crush/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.crush/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.crush/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.crush/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.crush/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.crush/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.crush/skills/testing-qa/SKILL.md +249 -0
- package/framework/.cursor/commands/ac-lite.md +192 -0
- package/framework/.cursor/commands/ac.md +402 -177
- package/framework/.cursor/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.cursor/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.cursor/skills/brainstorming/SKILL.md +266 -38
- package/framework/.cursor/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.cursor/skills/code-review/SKILL.md +250 -0
- package/framework/.cursor/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.cursor/skills/documentation/SKILL.md +441 -0
- package/framework/.cursor/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.cursor/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.cursor/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.cursor/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.cursor/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.cursor/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.cursor/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.cursor/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.cursor/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.cursor/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.cursor/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.cursor/skills/testing-qa/SKILL.md +249 -0
- package/framework/.factory/commands/ac-lite.md +192 -0
- package/framework/.factory/commands/ac.md +402 -177
- package/framework/.factory/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.factory/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.factory/skills/brainstorming/SKILL.md +266 -38
- package/framework/.factory/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.factory/skills/code-review/SKILL.md +250 -0
- package/framework/.factory/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.factory/skills/documentation/SKILL.md +441 -0
- package/framework/.factory/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.factory/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.factory/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.factory/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.factory/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.factory/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.factory/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.factory/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.factory/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.factory/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.factory/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.factory/skills/testing-qa/SKILL.md +249 -0
- package/framework/.gemini/commands/opsx/ac-lite.md +192 -0
- package/framework/.gemini/commands/opsx/ac.md +486 -0
- package/framework/.gemini/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.gemini/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.gemini/skills/brainstorming/SKILL.md +266 -38
- package/framework/.gemini/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.gemini/skills/code-review/SKILL.md +250 -0
- package/framework/.gemini/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.gemini/skills/documentation/SKILL.md +441 -0
- package/framework/.gemini/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.gemini/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.gemini/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.gemini/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.gemini/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.gemini/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.gemini/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.gemini/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.gemini/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.gemini/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.gemini/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.gemini/skills/testing-qa/SKILL.md +249 -0
- package/framework/.github/prompts/ac-lite.md +192 -0
- package/framework/.github/prompts/ac.md +486 -0
- package/framework/.github/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.github/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.github/skills/brainstorming/SKILL.md +266 -38
- package/framework/.github/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.github/skills/code-review/SKILL.md +250 -0
- package/framework/.github/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.github/skills/documentation/SKILL.md +441 -0
- package/framework/.github/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.github/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.github/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.github/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.github/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.github/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.github/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.github/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.github/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.github/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.github/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.github/skills/testing-qa/SKILL.md +249 -0
- package/framework/.iflow/commands/ac-lite.md +192 -0
- package/framework/.iflow/commands/ac.md +402 -177
- package/framework/.iflow/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.iflow/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.iflow/skills/brainstorming/SKILL.md +266 -38
- package/framework/.iflow/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.iflow/skills/code-review/SKILL.md +250 -0
- package/framework/.iflow/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.iflow/skills/documentation/SKILL.md +441 -0
- package/framework/.iflow/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.iflow/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.iflow/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.iflow/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.iflow/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.iflow/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.iflow/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.iflow/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.iflow/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.iflow/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.iflow/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.iflow/skills/testing-qa/SKILL.md +249 -0
- package/framework/.kilocode/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.kilocode/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.kilocode/skills/brainstorming/SKILL.md +266 -38
- package/framework/.kilocode/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.kilocode/skills/code-review/SKILL.md +250 -0
- package/framework/.kilocode/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.kilocode/skills/documentation/SKILL.md +441 -0
- package/framework/.kilocode/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.kilocode/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.kilocode/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.kilocode/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.kilocode/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.kilocode/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.kilocode/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.kilocode/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.kilocode/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.kilocode/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.kilocode/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.kilocode/skills/testing-qa/SKILL.md +249 -0
- package/framework/.kilocode/workflows/ac-lite.md +192 -0
- package/framework/.kilocode/workflows/ac.md +402 -177
- package/framework/.kimi/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.kimi/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.kimi/skills/api-design-principles/SKILL.md +528 -0
- package/framework/.kimi/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/framework/.kimi/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/framework/.kimi/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/framework/.kimi/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/framework/.kimi/skills/brainstorming/SKILL.md +282 -0
- package/framework/.kimi/skills/changelog-generator/SKILL.md +104 -0
- package/framework/.kimi/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.kimi/skills/code-maintainability/SKILL.md +1108 -0
- package/framework/.kimi/skills/code-review/SKILL.md +250 -0
- package/framework/.kimi/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.kimi/skills/documentation/SKILL.md +441 -0
- package/framework/.kimi/skills/error-handling-patterns/SKILL.md +641 -0
- package/framework/.kimi/skills/interface-design/SKILL.md +310 -0
- package/framework/.kimi/skills/interface-design/references/example.md +86 -0
- package/framework/.kimi/skills/interface-design/references/principles.md +235 -0
- package/framework/.kimi/skills/interface-design/references/validation.md +48 -0
- package/framework/.kimi/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.kimi/skills/openspec-apply-change/SKILL.md +172 -0
- package/framework/.kimi/skills/openspec-archive-change/SKILL.md +130 -0
- package/framework/.kimi/skills/openspec-bulk-archive-change/SKILL.md +262 -0
- package/framework/.kimi/skills/openspec-continue-change/SKILL.md +134 -0
- package/framework/.kimi/skills/openspec-explore/SKILL.md +306 -0
- package/framework/.kimi/skills/openspec-ff-change/SKILL.md +117 -0
- package/framework/.kimi/skills/openspec-new-change/SKILL.md +90 -0
- package/framework/.kimi/skills/openspec-onboard/SKILL.md +529 -0
- package/framework/.kimi/skills/openspec-sync-specs/SKILL.md +154 -0
- package/framework/.kimi/skills/openspec-verify-change/SKILL.md +184 -0
- package/framework/.kimi/skills/performance-optimizer/SKILL.md +43 -0
- package/framework/.kimi/skills/project-constitution/SKILL.md +66 -0
- package/framework/.kimi/skills/project-index/SKILL.md +234 -0
- package/framework/.kimi/skills/project-index/scripts/scan_codebase.py +47 -0
- package/framework/.kimi/skills/project-index/templates/agent-template.md +18 -0
- package/framework/.kimi/skills/project-index/templates/skill-template.md +20 -0
- package/framework/.kimi/skills/requirement-checklist/SKILL.md +90 -0
- package/framework/.kimi/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.kimi/skills/secure-coding-cybersecurity/SKILL.md +793 -0
- package/framework/.kimi/skills/secure-coding-cybersecurity/references/ai_coding_pitfalls.md +44 -0
- package/framework/.kimi/skills/secure-coding-cybersecurity/references/owasp_top_10_2025.md +28 -0
- package/framework/.kimi/skills/secure-coding-cybersecurity/references/secure_coding_examples.md +102 -0
- package/framework/.kimi/skills/secure-coding-cybersecurity/scripts/security_audit.py +46 -0
- package/framework/.kimi/skills/skill-writer/SKILL.md +385 -0
- package/framework/.kimi/skills/spec-analysis/SKILL.md +65 -0
- package/framework/.kimi/skills/spec-clarification/SKILL.md +73 -0
- package/framework/.kimi/skills/sync-index/SKILL.md +35 -0
- package/framework/.kimi/skills/systematic-debugging/SKILL.md +296 -0
- package/framework/.kimi/skills/test-generator/SKILL.md +41 -0
- package/framework/.kimi/skills/testing-qa/SKILL.md +249 -0
- package/framework/.kimi/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/framework/.kimi/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/framework/.kimi/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/framework/.kimi/workflows/ac-lite.md +192 -0
- package/framework/.kimi/workflows/ac.md +486 -0
- package/framework/.kimi/workflows/opsx-apply.md +149 -0
- package/framework/.kimi/workflows/opsx-archive.md +154 -0
- package/framework/.kimi/workflows/opsx-bulk-archive.md +239 -0
- package/framework/.kimi/workflows/opsx-continue.md +111 -0
- package/framework/.kimi/workflows/opsx-explore.md +171 -0
- package/framework/.kimi/workflows/opsx-ff.md +91 -0
- package/framework/.kimi/workflows/opsx-new.md +66 -0
- package/framework/.kimi/workflows/opsx-onboard.md +522 -0
- package/framework/.kimi/workflows/opsx-sync.md +131 -0
- package/framework/.kimi/workflows/opsx-verify.md +161 -0
- package/framework/.opencode/command/ac-lite.md +192 -0
- package/framework/.opencode/command/ac.md +402 -177
- package/framework/.opencode/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.opencode/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.opencode/skills/brainstorming/SKILL.md +266 -38
- package/framework/.opencode/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.opencode/skills/code-review/SKILL.md +250 -0
- package/framework/.opencode/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.opencode/skills/documentation/SKILL.md +441 -0
- package/framework/.opencode/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.opencode/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.opencode/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.opencode/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.opencode/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.opencode/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.opencode/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.opencode/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.opencode/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.opencode/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.opencode/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.opencode/skills/testing-qa/SKILL.md +249 -0
- package/framework/.qoder/commands/opsx/ac-lite.md +192 -0
- package/framework/.qoder/commands/opsx/ac.md +402 -177
- package/framework/.qoder/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.qoder/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.qoder/skills/brainstorming/SKILL.md +266 -38
- package/framework/.qoder/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.qoder/skills/code-review/SKILL.md +250 -0
- package/framework/.qoder/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.qoder/skills/documentation/SKILL.md +441 -0
- package/framework/.qoder/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.qoder/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.qoder/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.qoder/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.qoder/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.qoder/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.qoder/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.qoder/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.qoder/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.qoder/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.qoder/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.qoder/skills/testing-qa/SKILL.md +249 -0
- package/framework/.qwen/commands/ac-lite.md +192 -0
- package/framework/.qwen/commands/ac.md +402 -177
- package/framework/.qwen/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.qwen/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.qwen/skills/brainstorming/SKILL.md +266 -38
- package/framework/.qwen/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.qwen/skills/code-review/SKILL.md +250 -0
- package/framework/.qwen/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.qwen/skills/documentation/SKILL.md +441 -0
- package/framework/.qwen/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.qwen/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.qwen/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.qwen/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.qwen/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.qwen/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.qwen/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.qwen/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.qwen/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.qwen/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.qwen/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.qwen/skills/testing-qa/SKILL.md +249 -0
- package/framework/.roo/commands/ac-lite.md +192 -0
- package/framework/.roo/commands/ac.md +402 -177
- package/framework/.roo/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.roo/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.roo/skills/brainstorming/SKILL.md +266 -38
- package/framework/.roo/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.roo/skills/code-review/SKILL.md +250 -0
- package/framework/.roo/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.roo/skills/documentation/SKILL.md +441 -0
- package/framework/.roo/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.roo/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.roo/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.roo/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.roo/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.roo/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.roo/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.roo/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.roo/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.roo/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.roo/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.roo/skills/testing-qa/SKILL.md +249 -0
- package/framework/.trae/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.trae/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.trae/skills/brainstorming/SKILL.md +266 -38
- package/framework/.trae/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.trae/skills/code-review/SKILL.md +250 -0
- package/framework/.trae/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.trae/skills/documentation/SKILL.md +441 -0
- package/framework/.trae/skills/main-skill/SKILL.md +455 -0
- package/framework/.trae/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.trae/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.trae/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.trae/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.trae/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.trae/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.trae/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.trae/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.trae/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.trae/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.trae/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.trae/skills/testing-qa/SKILL.md +249 -0
- package/framework/.windsurf/skills/acfm-memory/SKILL.md +312 -0
- package/framework/.windsurf/skills/acfm-spec-workflow/SKILL.md +269 -0
- package/framework/.windsurf/skills/brainstorming/SKILL.md +266 -38
- package/framework/.windsurf/skills/ci-deploy/SKILL.md +501 -0
- package/framework/.windsurf/skills/code-review/SKILL.md +250 -0
- package/framework/.windsurf/skills/context-synthesizer/SKILL.md +322 -0
- package/framework/.windsurf/skills/documentation/SKILL.md +441 -0
- package/framework/.windsurf/skills/microtask-decomposition/SKILL.md +368 -0
- package/framework/.windsurf/skills/openspec-apply-change/SKILL.md +23 -7
- package/framework/.windsurf/skills/openspec-archive-change/SKILL.md +22 -6
- package/framework/.windsurf/skills/openspec-bulk-archive-change/SKILL.md +25 -9
- package/framework/.windsurf/skills/openspec-continue-change/SKILL.md +20 -4
- package/framework/.windsurf/skills/openspec-explore/SKILL.md +17 -1
- package/framework/.windsurf/skills/openspec-ff-change/SKILL.md +21 -5
- package/framework/.windsurf/skills/openspec-new-change/SKILL.md +23 -7
- package/framework/.windsurf/skills/openspec-sync-specs/SKILL.md +20 -4
- package/framework/.windsurf/skills/openspec-verify-change/SKILL.md +24 -8
- package/framework/.windsurf/skills/research-retrieval/SKILL.md +357 -0
- package/framework/.windsurf/skills/testing-qa/SKILL.md +249 -0
- package/framework/.windsurf/workflows/ac-lite.md +192 -0
- package/framework/.windsurf/workflows/ac.md +402 -177
- package/framework/AGENTS.md +428 -135
- package/framework/CLAUDE.md +428 -135
- package/framework/GEMINI.md +428 -135
- package/framework/copilot-instructions.md +429 -136
- package/package.json +2 -1
- package/src/cli.js +2 -0
- package/src/commands/init.js +10 -12
- package/src/commands/memory.js +772 -0
- package/src/commands/spec.js +40 -8
- package/src/config/constants.js +10 -2
- package/src/config/ide-mapping.js +1 -0
- package/src/index.js +46 -0
- package/src/memory/autosave.js +382 -0
- package/src/memory/database.js +178 -0
- package/src/memory/engine.js +727 -0
- package/src/memory/index.js +62 -0
- package/src/memory/utils.js +128 -0
- package/src/services/spec-engine.js +170 -26
- package/src/ui/animations.js +82 -0
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: secure-coding-cybersecurity
|
|
3
|
+
description: "Expert guidance on secure coding practices, focusing on preventing common security errors made by AI during code generation. Use for: auditing AI-generated code, implementing secure design patterns, and ensuring code follows OWASP Top 10 standards. Covers input validation, authentication, cryptography, file handling, secure configuration, and business logic security."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Secure Coding & Cybersecurity Skill
|
|
7
|
+
|
|
8
|
+
## Vision and Purpose
|
|
9
|
+
|
|
10
|
+
This skill establishes security as a first-class citizen in code generation and review. It recognizes that AI-generated code often prioritizes functionality over security, inheriting and propagating vulnerabilities from training data. This skill provides comprehensive guardrails, checklists, and verification steps to ensure all code—especially AI-generated—is robust, secure, and follows industry best practices.
|
|
11
|
+
|
|
12
|
+
## Critical Understanding: Why AI Code is Often Insecure
|
|
13
|
+
|
|
14
|
+
AI models optimize for "working code" and "correct-looking output" before "secure and robust code." This introduces classic vulnerabilities at concerning rates:
|
|
15
|
+
|
|
16
|
+
### Root Causes of AI Security Failures
|
|
17
|
+
|
|
18
|
+
1. **Functionality over Security**: If the prompt doesn't explicitly demand security, the model prioritizes the shortest solution even if it uses `eval()`, SQL string concatenation, or hardcoded keys.
|
|
19
|
+
|
|
20
|
+
2. **Learning from Insecure Examples**: A significant portion of publicly available code contains bad practices (hardcoded secrets, weak encryption, missing validation), and models reproduce these patterns.
|
|
21
|
+
|
|
22
|
+
3. **Lack of Context Awareness**: AI doesn't understand your business rules, threat model, or compliance requirements (PCI-DSS, HIPAA, GDPR), filling gaps with dangerous assumptions.
|
|
23
|
+
|
|
24
|
+
4. **High CWE Rates in Studies**: Empirical research consistently finds serious vulnerabilities (SQLi, XSS, buffer overflows, crypto misuse, hardcoded credentials) in AI-generated code samples.
|
|
25
|
+
|
|
26
|
+
## The Security Non-Negotiables
|
|
27
|
+
|
|
28
|
+
These rules must NEVER be violated, regardless of convenience or "example purposes":
|
|
29
|
+
|
|
30
|
+
1. **Never Prioritize Simplicity Over Security**: Do not provide "clean" examples that omit input validation or use insecure defaults, even with disclaimers.
|
|
31
|
+
|
|
32
|
+
2. **Treat AI Output as Untrusted**: Always audit AI-generated snippets for hallucinated libraries, outdated patterns, and missing security controls.
|
|
33
|
+
|
|
34
|
+
3. **Fail Closed**: All logic must default to "Access Denied" if an exception occurs, validation fails, or state is unclear.
|
|
35
|
+
|
|
36
|
+
4. **No Hardcoded Secrets**: Never suggest code with hardcoded API keys, passwords, tokens, or cryptographic keys. Always use environment variables, secret managers, or secure vaults.
|
|
37
|
+
|
|
38
|
+
5. **Parameterized Everything**: Never use string concatenation or formatting for SQL queries, OS commands, HTML rendering, or LDAP filters.
|
|
39
|
+
|
|
40
|
+
6. **Validate All Inputs**: Every piece of external data must be validated and sanitized before use.
|
|
41
|
+
|
|
42
|
+
7. **Defense in Depth**: Never rely on a single security control; implement multiple layers of protection.
|
|
43
|
+
|
|
44
|
+
## Comprehensive Security Checklist
|
|
45
|
+
|
|
46
|
+
### 1. Input Validation and Injection Prevention
|
|
47
|
+
|
|
48
|
+
**The Problem**: AI frequently omits input validation and sanitization unless explicitly requested, leading to CWE-20 (Improper Input Validation) and the entire injection vulnerability family (SQLi, XSS, OS Command Injection, LDAP Injection).
|
|
49
|
+
|
|
50
|
+
**Research Finding**: Multiple studies identify SQL injection, XSS, and OS command injection as recurrent vulnerabilities in LLM-generated code.
|
|
51
|
+
|
|
52
|
+
#### Checklist
|
|
53
|
+
|
|
54
|
+
- [ ] **Validate and normalize ALL user input** before use, including:
|
|
55
|
+
- Query parameters (URL parameters)
|
|
56
|
+
- Request body (JSON, form data)
|
|
57
|
+
- Headers (including custom headers)
|
|
58
|
+
- Path parameters
|
|
59
|
+
- File uploads
|
|
60
|
+
- WebSocket messages
|
|
61
|
+
- GraphQL inputs
|
|
62
|
+
|
|
63
|
+
- [ ] **Use allowlists over denylists**: Define what is permitted rather than trying to block what is malicious. Use strict type checking, enum validation, and schema validation.
|
|
64
|
+
|
|
65
|
+
- [ ] **Parameterized queries ONLY**: Never concatenate strings to build SQL queries, shell commands, LDAP filters, XPath expressions, or NoSQL queries. Always use:
|
|
66
|
+
- Prepared statements with bound parameters
|
|
67
|
+
- ORM query builders with parameterized methods
|
|
68
|
+
- Safe API abstractions that prevent injection
|
|
69
|
+
|
|
70
|
+
- [ ] **XSS Prevention**: Escape or sanitize all data before rendering in HTML contexts:
|
|
71
|
+
- Use auto-escaping template engines
|
|
72
|
+
- Apply context-appropriate encoding (HTML, JavaScript, CSS, URL)
|
|
73
|
+
- Avoid `innerHTML`, `document.write`, and similar dangerous APIs
|
|
74
|
+
- Implement Content Security Policy (CSP) headers
|
|
75
|
+
|
|
76
|
+
- [ ] **Disable dangerous evaluation**: Never use `eval()`, `Function()`, `exec()`, `child_process.exec()`, `Runtime.exec()`, `os.system()`, or similar on user-controlled data. If dynamic execution is absolutely necessary, use strict sandboxing and allowlists.
|
|
77
|
+
|
|
78
|
+
- [ ] **Strict regex validation**: When using regular expressions for validation:
|
|
79
|
+
- Prefer exact match patterns (`^pattern$`) over partial matches
|
|
80
|
+
- Avoid overly permissive patterns
|
|
81
|
+
- Be aware of ReDoS (Regular Expression Denial of Service) vulnerabilities
|
|
82
|
+
|
|
83
|
+
#### Verification Steps
|
|
84
|
+
|
|
85
|
+
Before considering input handling complete:
|
|
86
|
+
|
|
87
|
+
1. **Fuzz Test**: Test with unexpected inputs (null, empty strings, very long strings, special characters, Unicode, binary data)
|
|
88
|
+
2. **Injection Test**: Attempt SQL, NoSQL, command, and XSS injection payloads
|
|
89
|
+
3. **Boundary Test**: Test at and beyond length limits, type boundaries, and range limits
|
|
90
|
+
4. **Negative Test**: Ensure invalid inputs are rejected with appropriate errors
|
|
91
|
+
|
|
92
|
+
#### Common AI Mistakes to Avoid
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
# ❌ NEVER DO THIS - SQL Injection vulnerability
|
|
96
|
+
query = f"SELECT * FROM users WHERE id = {user_id}"
|
|
97
|
+
cursor.execute(query)
|
|
98
|
+
|
|
99
|
+
# ✅ DO THIS INSTEAD - Parameterized query
|
|
100
|
+
query = "SELECT * FROM users WHERE id = ?"
|
|
101
|
+
cursor.execute(query, (user_id,))
|
|
102
|
+
|
|
103
|
+
# ❌ NEVER DO THIS - XSS vulnerability
|
|
104
|
+
element.innerHTML = userInput
|
|
105
|
+
|
|
106
|
+
// ❌ NEVER DO THIS - Command Injection
|
|
107
|
+
const output = exec(`ls ${userInput}`);
|
|
108
|
+
|
|
109
|
+
// ✅ DO THIS INSTEAD - Safe command execution with allowlist
|
|
110
|
+
const allowedCommands = ['list', 'status'];
|
|
111
|
+
if (allowedCommands.includes(userInput)) {
|
|
112
|
+
const output = execFile('ls', [safePath]);
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### 2. Authentication, Authorization, and Session Management
|
|
119
|
+
|
|
120
|
+
**The Problem**: AI generates authentication flows that "pass happy path tests" but ignore critical security details like rate limiting, constant-time comparison, or fine-grained authorization controls. This enables brute-force attacks, privilege escalation, and API abuse.
|
|
121
|
+
|
|
122
|
+
#### Checklist
|
|
123
|
+
|
|
124
|
+
- [ ] **Secure password storage**:
|
|
125
|
+
- Use modern, memory-hard algorithms: Argon2id (recommended), bcrypt, or scrypt
|
|
126
|
+
- Never use MD5, SHA1, SHA256 for password hashing (they're too fast)
|
|
127
|
+
- Always use unique salts per password
|
|
128
|
+
- Configure appropriate cost factors/work factors
|
|
129
|
+
|
|
130
|
+
- [ ] **Constant-time comparisons**: Compare tokens, passwords, and API keys using constant-time comparison functions to prevent timing attacks:
|
|
131
|
+
- Python: `hmac.compare_digest()`
|
|
132
|
+
- Node.js: `crypto.timingSafeEqual()`
|
|
133
|
+
- Java: `MessageDigest.isEqual()`
|
|
134
|
+
|
|
135
|
+
- [ ] **Rate limiting and brute-force protection**:
|
|
136
|
+
- Implement rate limiting on login endpoints, password reset, OTP verification, and sensitive APIs
|
|
137
|
+
- Use progressive delays for failed attempts
|
|
138
|
+
- Consider CAPTCHA after multiple failures
|
|
139
|
+
- Implement account lockout policies (with unlock mechanisms)
|
|
140
|
+
|
|
141
|
+
- [ ] **Authorization on every endpoint**:
|
|
142
|
+
- Verify ownership and permissions on every request, not just authentication
|
|
143
|
+
- Check for IDOR (Insecure Direct Object Reference) vulnerabilities
|
|
144
|
+
- Validate that users can only access their own resources
|
|
145
|
+
- Implement attribute-based access control (ABAC) where appropriate
|
|
146
|
+
|
|
147
|
+
- [ ] **Secure session management**:
|
|
148
|
+
- Use cryptographically secure random session IDs
|
|
149
|
+
- Implement reasonable session timeouts
|
|
150
|
+
- Support session revocation and rotation
|
|
151
|
+
- Regenerate session IDs on privilege changes (login, password change, role change)
|
|
152
|
+
|
|
153
|
+
- [ ] **Secure cookie configuration**:
|
|
154
|
+
- Set `HttpOnly` flag (prevents JavaScript access)
|
|
155
|
+
- Set `Secure` flag (HTTPS only)
|
|
156
|
+
- Set `SameSite` attribute (Strict or Lax)
|
|
157
|
+
- Use appropriate `Max-Age` or `Expires`
|
|
158
|
+
- Consider `__Host-` prefix for additional protection
|
|
159
|
+
|
|
160
|
+
- [ ] **JWT security**:
|
|
161
|
+
- Use strong signing algorithms (RS256, ES256, HS256 with strong secrets)
|
|
162
|
+
- Never use "none" algorithm or weak secrets
|
|
163
|
+
- Set short expiration times
|
|
164
|
+
- Include token rotation and revocation mechanisms
|
|
165
|
+
- Store tokens securely (not in localStorage for sensitive apps)
|
|
166
|
+
|
|
167
|
+
- [ ] **Password reset security**:
|
|
168
|
+
- Use cryptographically secure random tokens with high entropy
|
|
169
|
+
- Implement single-use tokens with short expiration
|
|
170
|
+
- Do not reveal whether an email exists in the system (privacy protection)
|
|
171
|
+
- Invalidate existing tokens when new ones are requested
|
|
172
|
+
- Require re-authentication after password reset
|
|
173
|
+
|
|
174
|
+
- [ ] **Multi-factor authentication (MFA)**:
|
|
175
|
+
- Support TOTP (Time-based One-Time Password)
|
|
176
|
+
- Support WebAuthn/FIDO2 for strong authentication
|
|
177
|
+
- Enforce MFA for privileged accounts
|
|
178
|
+
- Implement backup codes securely
|
|
179
|
+
|
|
180
|
+
#### Verification Steps
|
|
181
|
+
|
|
182
|
+
1. **Brute Force Test**: Attempt to guess passwords, session IDs, and tokens
|
|
183
|
+
2. **Timing Attack Test**: Measure response times for different inputs
|
|
184
|
+
3. **Authorization Test**: Try to access other users' resources
|
|
185
|
+
4. **Session Fixation Test**: Verify session ID changes on login
|
|
186
|
+
5. **Token Analysis**: Check JWT headers and payloads for security issues
|
|
187
|
+
|
|
188
|
+
#### Common AI Mistakes to Avoid
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
# ❌ NEVER DO THIS - Insecure password hashing
|
|
192
|
+
hashed = hashlib.md5(password.encode()).hexdigest()
|
|
193
|
+
|
|
194
|
+
# ✅ DO THIS INSTEAD - Secure password hashing
|
|
195
|
+
hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt(rounds=12))
|
|
196
|
+
|
|
197
|
+
# ❌ NEVER DO THIS - Timing attack vulnerability
|
|
198
|
+
if token == stored_token:
|
|
199
|
+
# authenticate
|
|
200
|
+
|
|
201
|
+
# ✅ DO THIS INSTEAD - Constant-time comparison
|
|
202
|
+
if hmac.compare_digest(token, stored_token):
|
|
203
|
+
# authenticate
|
|
204
|
+
|
|
205
|
+
# ❌ NEVER DO THIS - No rate limiting
|
|
206
|
+
@app.route('/login', methods=['POST'])
|
|
207
|
+
def login():
|
|
208
|
+
# authenticate
|
|
209
|
+
|
|
210
|
+
# ✅ DO THIS INSTEAD - Rate limiting
|
|
211
|
+
@limiter.limit("5 per minute")
|
|
212
|
+
@app.route('/login', methods=['POST'])
|
|
213
|
+
def login():
|
|
214
|
+
# authenticate
|
|
215
|
+
|
|
216
|
+
# ❌ NEVER DO THIS - Missing authorization check
|
|
217
|
+
@app.route('/api/documents/<doc_id>')
|
|
218
|
+
def get_document(doc_id):
|
|
219
|
+
return Document.query.get(doc_id) # No ownership check!
|
|
220
|
+
|
|
221
|
+
# ✅ DO THIS INSTEAD - Verify ownership
|
|
222
|
+
def get_document(doc_id):
|
|
223
|
+
document = Document.query.get_or_404(doc_id)
|
|
224
|
+
if document.owner_id != current_user.id:
|
|
225
|
+
abort(403)
|
|
226
|
+
return document
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### 3. Cryptography and Secrets Management
|
|
232
|
+
|
|
233
|
+
**The Problem**: AI models frequently copy insecure cryptographic patterns from training data: obsolete ciphers, incorrect modes, hardcoded keys, weak PRNGs, and custom cryptographic schemes. They also commonly suggest embedding secrets directly in code or configuration files.
|
|
234
|
+
|
|
235
|
+
#### Checklist
|
|
236
|
+
|
|
237
|
+
- [ ] **No hardcoded secrets**: Search for and eliminate:
|
|
238
|
+
- API keys embedded in source code
|
|
239
|
+
- Database passwords in configuration files
|
|
240
|
+
- Private keys in repositories
|
|
241
|
+
- Authentication tokens in comments or documentation
|
|
242
|
+
- Long hex/base64 strings that could be encoded secrets
|
|
243
|
+
|
|
244
|
+
- [ ] **Secure secrets management**:
|
|
245
|
+
- Use dedicated secrets managers (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, Google Secret Manager)
|
|
246
|
+
- Use environment variables as minimum acceptable practice (never commit `.env` files)
|
|
247
|
+
- Implement secret rotation policies
|
|
248
|
+
- Use separate secrets for different environments
|
|
249
|
+
|
|
250
|
+
- [ ] **Modern cryptographic algorithms**:
|
|
251
|
+
- Symmetric encryption: AES-256-GCM (authenticated encryption) or ChaCha20-Poly1305
|
|
252
|
+
- Asymmetric encryption: RSA-2048+ (OAEP padding) or ECC (P-256, P-384)
|
|
253
|
+
- Hashing: SHA-256, SHA-3, or BLAKE2/BLAKE3
|
|
254
|
+
- Password hashing: Argon2id, bcrypt, or scrypt
|
|
255
|
+
- Key exchange: ECDH, X25519
|
|
256
|
+
|
|
257
|
+
- [ ] **Avoid deprecated/weak algorithms**:
|
|
258
|
+
- Never use DES, 3DES, RC4, or AES-ECB
|
|
259
|
+
- Avoid MD5 and SHA1 for security-sensitive operations
|
|
260
|
+
- Don't use PKCS#1 v1.5 padding for RSA
|
|
261
|
+
|
|
262
|
+
- [ ] **Cryptographically secure random number generation**:
|
|
263
|
+
- Python: `secrets.token_hex()`, `secrets.token_urlsafe()`, `secrets.randbits()`
|
|
264
|
+
- Node.js: `crypto.randomBytes()`, `crypto.randomUUID()`
|
|
265
|
+
- Java: `SecureRandom`
|
|
266
|
+
- Never use `Math.random()`, `random` module, or other non-cryptographic RNGs for security purposes
|
|
267
|
+
|
|
268
|
+
- [ ] **Proper key lengths and parameters**:
|
|
269
|
+
- AES: 256-bit keys
|
|
270
|
+
- RSA: 2048-bit minimum (4096 recommended for long-term)
|
|
271
|
+
- ECC: P-256 minimum
|
|
272
|
+
- Argon2id: Appropriate memory, iterations, and parallelism for your hardware
|
|
273
|
+
|
|
274
|
+
- [ ] **Proper IV/nonce handling**:
|
|
275
|
+
- Use cryptographically secure random IVs for each encryption operation
|
|
276
|
+
- Never reuse IVs with the same key (especially for GCM mode)
|
|
277
|
+
- IVs don't need to be secret but must be unique
|
|
278
|
+
|
|
279
|
+
- [ ] **Never roll your own crypto**:
|
|
280
|
+
- Don't create custom encryption schemes
|
|
281
|
+
- Don't implement your own authentication protocols
|
|
282
|
+
- Don't create custom hash functions
|
|
283
|
+
- Use well-vetted libraries and follow their documentation
|
|
284
|
+
|
|
285
|
+
#### Verification Steps
|
|
286
|
+
|
|
287
|
+
1. **Secret Scanning**: Use tools like `truffleHog`, `git-secrets`, or `detect-secrets` to find leaked secrets
|
|
288
|
+
2. **Algorithm Audit**: Verify all cryptographic algorithms are modern and properly used
|
|
289
|
+
3. **Key Analysis**: Check key generation, storage, and rotation practices
|
|
290
|
+
4. **Randomness Test**: Verify CSPRNG usage for all security-sensitive random values
|
|
291
|
+
|
|
292
|
+
#### Common AI Mistakes to Avoid
|
|
293
|
+
|
|
294
|
+
```python
|
|
295
|
+
# ❌ NEVER DO THIS - Hardcoded secret
|
|
296
|
+
API_KEY = "sk_live_1234567890abcdef"
|
|
297
|
+
|
|
298
|
+
# ✅ DO THIS INSTEAD - Load from environment
|
|
299
|
+
import os
|
|
300
|
+
API_KEY = os.environ.get('API_KEY')
|
|
301
|
+
if not API_KEY:
|
|
302
|
+
raise ValueError("API_KEY environment variable is required")
|
|
303
|
+
|
|
304
|
+
# ❌ NEVER DO THIS - Weak encryption
|
|
305
|
+
encrypted = des.encrypt(data)
|
|
306
|
+
|
|
307
|
+
# ✅ DO THIS INSTEAD - Authenticated encryption
|
|
308
|
+
from cryptography.fernet import Fernet
|
|
309
|
+
key = Fernet.generate_key()
|
|
310
|
+
cipher = Fernet(key)
|
|
311
|
+
encrypted = cipher.encrypt(data)
|
|
312
|
+
|
|
313
|
+
# ❌ NEVER DO THIS - Insecure random for security
|
|
314
|
+
import random
|
|
315
|
+
token = random.randint(100000, 999999)
|
|
316
|
+
|
|
317
|
+
# ✅ DO THIS INSTEAD - Cryptographically secure random
|
|
318
|
+
import secrets
|
|
319
|
+
token = secrets.randbelow(1000000)
|
|
320
|
+
|
|
321
|
+
# ❌ NEVER DO THIS - Custom crypto scheme
|
|
322
|
+
def custom_hash(data):
|
|
323
|
+
return data[::-1] + "salt"
|
|
324
|
+
|
|
325
|
+
# ✅ DO THIS INSTEAD - Use standard library
|
|
326
|
+
import hashlib
|
|
327
|
+
hashed = hashlib.sha256(data).hexdigest()
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
### 4. File Handling, Uploads, and Deserialization
|
|
333
|
+
|
|
334
|
+
**The Problem**: Documentation examples that AI learns from often omit path validation, file type checking, or size limits. This enables path traversal, remote code execution via deserialization, and Denial of Service through huge files. AI frequently uses dangerous APIs like `pickle.loads()` or `unserialize()` on untrusted data.
|
|
335
|
+
|
|
336
|
+
#### Checklist
|
|
337
|
+
|
|
338
|
+
- [ ] **Path traversal prevention**:
|
|
339
|
+
- Normalize all file paths derived from user input
|
|
340
|
+
- Restrict file access to allowlisted directories
|
|
341
|
+
- Use `chroot` jails or containerization where appropriate
|
|
342
|
+
- Validate that resolved paths stay within allowed boundaries
|
|
343
|
+
- Strip or reject path traversal sequences (`../`, `..\`, null bytes)
|
|
344
|
+
|
|
345
|
+
- [ ] **Secure file uploads**:
|
|
346
|
+
- Validate file extensions against allowlists, not denylists
|
|
347
|
+
- Verify MIME types match actual file content (magic bytes)
|
|
348
|
+
- Scan uploaded files for malware
|
|
349
|
+
- Limit file sizes and upload counts per request
|
|
350
|
+
- Store uploads outside web root or use safe serving mechanisms
|
|
351
|
+
- Rename files with random names to prevent execution attacks
|
|
352
|
+
- Remove or sanitize metadata that could leak sensitive information
|
|
353
|
+
|
|
354
|
+
- [ ] **Deserialization security**:
|
|
355
|
+
- Never deserialize untrusted data using pickle, marshal, or language-specific unsafe deserialization
|
|
356
|
+
- Use safe serialization formats: JSON, MessagePack, Protocol Buffers
|
|
357
|
+
- If object deserialization is necessary, implement strict type allowlists
|
|
358
|
+
- Use schema validation for all deserialized data
|
|
359
|
+
- Consider signing serialized data to prevent tampering
|
|
360
|
+
|
|
361
|
+
- [ ] **File permission security**:
|
|
362
|
+
- Set least-privilege file permissions (never world-writable)
|
|
363
|
+
- Use separate system users for file operations
|
|
364
|
+
- Implement proper cleanup of temporary files
|
|
365
|
+
- Secure file deletion when required
|
|
366
|
+
|
|
367
|
+
#### Verification Steps
|
|
368
|
+
|
|
369
|
+
1. **Path Traversal Test**: Attempt to access files outside allowed directories using `../`, null bytes, Unicode normalization attacks
|
|
370
|
+
2. **Upload Security Test**: Try uploading executable files, scripts, oversized files, and malicious content
|
|
371
|
+
3. **Deserialization Test**: Attempt deserialization attacks with malicious payloads
|
|
372
|
+
4. **File Permission Audit**: Verify file and directory permissions are appropriate
|
|
373
|
+
|
|
374
|
+
#### Common AI Mistakes to Avoid
|
|
375
|
+
|
|
376
|
+
```python
|
|
377
|
+
# ❌ NEVER DO THIS - Path traversal vulnerability
|
|
378
|
+
filename = request.args.get('file')
|
|
379
|
+
with open(f"/uploads/{filename}", 'r') as f:
|
|
380
|
+
content = f.read()
|
|
381
|
+
|
|
382
|
+
# ✅ DO THIS INSTEAD - Safe path handling
|
|
383
|
+
import os
|
|
384
|
+
from pathlib import Path
|
|
385
|
+
|
|
386
|
+
upload_dir = Path("/uploads").resolve()
|
|
387
|
+
filename = request.args.get('file')
|
|
388
|
+
# Sanitize and validate
|
|
389
|
+
safe_filename = os.path.basename(filename)
|
|
390
|
+
file_path = (upload_dir / safe_filename).resolve()
|
|
391
|
+
|
|
392
|
+
# Ensure the resolved path is within upload_dir
|
|
393
|
+
if not str(file_path).startswith(str(upload_dir)):
|
|
394
|
+
abort(403)
|
|
395
|
+
|
|
396
|
+
# ❌ NEVER DO THIS - Unsafe deserialization
|
|
397
|
+
import pickle
|
|
398
|
+
data = pickle.loads(untrusted_input)
|
|
399
|
+
|
|
400
|
+
# ✅ DO THIS INSTEAD - Safe deserialization
|
|
401
|
+
import json
|
|
402
|
+
data = json.loads(untrusted_input)
|
|
403
|
+
# Validate against schema
|
|
404
|
+
if not validate_json_schema(data, SCHEMA):
|
|
405
|
+
raise ValueError("Invalid data format")
|
|
406
|
+
|
|
407
|
+
# ❌ NEVER DO THIS - Insecure file upload
|
|
408
|
+
file = request.files['document']
|
|
409
|
+
file.save(f"/uploads/{file.filename}")
|
|
410
|
+
|
|
411
|
+
// ❌ NEVER DO THIS - Extension validation bypass
|
|
412
|
+
const allowedExtensions = ['.jpg', '.png'];
|
|
413
|
+
if (allowedExtensions.includes(path.extname(filename))) {
|
|
414
|
+
// This can be bypassed with double extensions or null bytes
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// ✅ DO THIS INSTEAD - Comprehensive validation
|
|
418
|
+
const allowedTypes = ['image/jpeg', 'image/png'];
|
|
419
|
+
const maxSize = 5 * 1024 * 1024; // 5MB
|
|
420
|
+
|
|
421
|
+
if (!allowedTypes.includes(file.mimetype)) {
|
|
422
|
+
throw new Error('Invalid file type');
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if (file.size > maxSize) {
|
|
426
|
+
throw new Error('File too large');
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// Verify magic bytes match MIME type
|
|
430
|
+
const magic = file.buffer.slice(0, 4);
|
|
431
|
+
if (!isValidMagicBytes(magic, file.mimetype)) {
|
|
432
|
+
throw new Error('File content does not match type');
|
|
433
|
+
}
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
### 5. Secure Configuration and Dependency Management
|
|
439
|
+
|
|
440
|
+
**The Problem**: AI frequently proposes insecure example configurations: CORS set to `*`, disabled TLS verification, disabled CSRF protection, or verbose debug logging in production. AI may also "hallucinate" packages that don't exist or suggest typosquatted/obsoleted dependencies.
|
|
441
|
+
|
|
442
|
+
#### Checklist
|
|
443
|
+
|
|
444
|
+
- [ ] **Secure CORS configuration**:
|
|
445
|
+
- Never use `*` in production (only for specific development scenarios)
|
|
446
|
+
- Explicitly define allowed origins
|
|
447
|
+
- Limit allowed methods and headers
|
|
448
|
+
- Set appropriate `maxAge` for preflight caching
|
|
449
|
+
- Consider credentials handling carefully
|
|
450
|
+
|
|
451
|
+
- [ ] **TLS/SSL security**:
|
|
452
|
+
- Always enforce HTTPS in production
|
|
453
|
+
- Use TLS 1.2 or higher (disable SSLv3, TLS 1.0, TLS 1.1)
|
|
454
|
+
- Use strong cipher suites
|
|
455
|
+
- Implement proper certificate validation
|
|
456
|
+
- Never disable certificate verification "to make it work"
|
|
457
|
+
|
|
458
|
+
- [ ] **Security headers**:
|
|
459
|
+
- Content Security Policy (CSP)
|
|
460
|
+
- X-Content-Type-Options: nosniff
|
|
461
|
+
- X-Frame-Options or CSP frame-ancestors
|
|
462
|
+
- Strict-Transport-Security (HSTS)
|
|
463
|
+
- Referrer-Policy
|
|
464
|
+
- Permissions-Policy
|
|
465
|
+
|
|
466
|
+
- [ ] **CSRF protection**:
|
|
467
|
+
- Enable CSRF tokens for state-changing operations
|
|
468
|
+
- Use double-submit cookie pattern or synchronizer token pattern
|
|
469
|
+
- Validate Origin/Referer headers as additional protection
|
|
470
|
+
- Consider SameSite cookies
|
|
471
|
+
|
|
472
|
+
- [ ] **Debug mode and information disclosure**:
|
|
473
|
+
- Disable debug mode in production
|
|
474
|
+
- Disable verbose error messages that expose stack traces
|
|
475
|
+
- Disable server version banners
|
|
476
|
+
- Remove default credentials and sample data
|
|
477
|
+
- Disable auto-reload and hot-reload in production
|
|
478
|
+
|
|
479
|
+
- [ ] **Secure logging**:
|
|
480
|
+
- Never log secrets, tokens, passwords, or PII (Personally Identifiable Information)
|
|
481
|
+
- Use structured logging with appropriate levels
|
|
482
|
+
- Implement log rotation and retention policies
|
|
483
|
+
- Protect log files with appropriate permissions
|
|
484
|
+
- Consider log aggregation with security monitoring
|
|
485
|
+
|
|
486
|
+
- [ ] **Dependency security**:
|
|
487
|
+
- Verify all suggested packages exist and are legitimate
|
|
488
|
+
- Check for typosquatting attacks (slight misspellings of popular packages)
|
|
489
|
+
- Use lockfiles (package-lock.json, yarn.lock, poetry.lock, Cargo.lock, etc.)
|
|
490
|
+
- Regularly audit dependencies for known vulnerabilities
|
|
491
|
+
- Keep dependencies updated
|
|
492
|
+
- Minimize dependency count (reduce attack surface)
|
|
493
|
+
|
|
494
|
+
- [ ] **Container and runtime security**:
|
|
495
|
+
- Run containers as non-root user
|
|
496
|
+
- Use minimal base images (distroless, Alpine, scratch)
|
|
497
|
+
- Implement read-only filesystems where possible
|
|
498
|
+
- Use security contexts and capabilities dropping
|
|
499
|
+
- Network segmentation and firewall rules
|
|
500
|
+
- Resource limits (CPU, memory, file descriptors)
|
|
501
|
+
|
|
502
|
+
#### Verification Steps
|
|
503
|
+
|
|
504
|
+
1. **Security Headers Test**: Use tools like `securityheaders.com` to verify header configuration
|
|
505
|
+
2. **Configuration Audit**: Review all configuration files for insecure defaults
|
|
506
|
+
3. **Dependency Scan**: Run SCA tools (Snyk, Dependabot, npm audit, pip-audit)
|
|
507
|
+
4. **Container Scan**: Use tools like Trivy, Clair, or Grype to scan container images
|
|
508
|
+
|
|
509
|
+
#### Common AI Mistakes to Avoid
|
|
510
|
+
|
|
511
|
+
```python
|
|
512
|
+
# ❌ NEVER DO THIS - Insecure CORS
|
|
513
|
+
CORS(app, resources={r"/*": {"origins": "*"}})
|
|
514
|
+
|
|
515
|
+
# ✅ DO THIS INSTEAD - Explicit origins
|
|
516
|
+
CORS(app, resources={
|
|
517
|
+
r"/api/*": {
|
|
518
|
+
"origins": ["https://app.example.com", "https://admin.example.com"],
|
|
519
|
+
"methods": ["GET", "POST"],
|
|
520
|
+
"allow_headers": ["Content-Type", "Authorization"]
|
|
521
|
+
}
|
|
522
|
+
})
|
|
523
|
+
|
|
524
|
+
# ❌ NEVER DO THIS - Disabled TLS verification
|
|
525
|
+
requests.get(url, verify=False)
|
|
526
|
+
|
|
527
|
+
# ✅ DO THIS INSTEAD - Proper TLS configuration
|
|
528
|
+
requests.get(url, verify=True) # Default, verify certificates
|
|
529
|
+
|
|
530
|
+
# ❌ NEVER DO THIS - Debug mode in production
|
|
531
|
+
app.run(debug=True)
|
|
532
|
+
|
|
533
|
+
# ✅ DO THIS INSTEAD - Environment-based configuration
|
|
534
|
+
debug = os.environ.get('FLASK_ENV') == 'development'
|
|
535
|
+
app.run(debug=debug)
|
|
536
|
+
|
|
537
|
+
# ❌ NEVER DO THIS - Logging sensitive data
|
|
538
|
+
logger.info(f"User login: {username}, password: {password}")
|
|
539
|
+
|
|
540
|
+
// ❌ NEVER DO THIS - Information disclosure in errors
|
|
541
|
+
app.use((err, req, res, next) => {
|
|
542
|
+
res.status(500).json({ error: err.stack });
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
// ✅ DO THIS INSTEAD - Safe error handling
|
|
546
|
+
app.use((err, req, res, next) => {
|
|
547
|
+
console.error(err); // Log internally
|
|
548
|
+
res.status(500).json({ error: 'Internal server error' }); // Generic public message
|
|
549
|
+
});
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
|
|
554
|
+
### 6. Business Logic and Contextual Security
|
|
555
|
+
|
|
556
|
+
**The Problem**: AI doesn't understand your business rules, threat model, or compliance requirements. It makes dangerous assumptions like "the input will always be valid" or "only internal users will call this API." This leads to logic vulnerabilities that aren't syntactically obvious.
|
|
557
|
+
|
|
558
|
+
#### Checklist
|
|
559
|
+
|
|
560
|
+
- [ ] **Document security assumptions**: Explicitly write down:
|
|
561
|
+
- Who is calling the API (internal, external, authenticated, anonymous)
|
|
562
|
+
- Where requests are coming from (IP ranges, geolocation)
|
|
563
|
+
- What privileges callers have
|
|
564
|
+
- What the input can contain (valid ranges, formats)
|
|
565
|
+
- What the expected threat model is
|
|
566
|
+
|
|
567
|
+
- [ ] **Beware of "fast paths"**: Review any logic that skips security controls under certain conditions:
|
|
568
|
+
- "If the request has X header, skip Y validation"
|
|
569
|
+
- "If the user is internal, skip Z check"
|
|
570
|
+
- These can often be abused
|
|
571
|
+
|
|
572
|
+
- [ ] **Server-side authorization**: Never rely on client-controlled data for authorization decisions:
|
|
573
|
+
- Don't trust JWT claims without verification
|
|
574
|
+
- Don't use client-provided role flags
|
|
575
|
+
- Don't trust client-side validation
|
|
576
|
+
- Always re-verify permissions server-side
|
|
577
|
+
|
|
578
|
+
- [ ] **Sensitive operation protection**:
|
|
579
|
+
- Require re-authentication for sensitive operations (email change, password change, role change, financial transactions)
|
|
580
|
+
- Implement MFA for high-risk operations
|
|
581
|
+
- Use confirmation mechanisms (email verification, OTP)
|
|
582
|
+
- Log all sensitive operations with audit trails
|
|
583
|
+
|
|
584
|
+
- [ ] **Data exposure review**:
|
|
585
|
+
- Review all API responses for over-exposure of data
|
|
586
|
+
- Don't expose internal fields (database IDs, internal flags, debug info)
|
|
587
|
+
- Implement field-level access control
|
|
588
|
+
- Use Data Transfer Objects (DTOs) to control exposed data
|
|
589
|
+
- Consider GraphQL query depth and complexity limiting
|
|
590
|
+
|
|
591
|
+
- [ ] **Race condition protection**:
|
|
592
|
+
- Use transactions for multi-step operations
|
|
593
|
+
- Implement proper locking mechanisms
|
|
594
|
+
- Handle concurrent modifications gracefully
|
|
595
|
+
- Use optimistic or pessimistic locking as appropriate
|
|
596
|
+
|
|
597
|
+
- [ ] **Business logic validation**:
|
|
598
|
+
- Validate business rules, not just data types
|
|
599
|
+
- Check for impossible states (negative balances, future dates in past, etc.)
|
|
600
|
+
- Implement workflow state validation
|
|
601
|
+
- Validate resource ownership and availability
|
|
602
|
+
|
|
603
|
+
#### Verification Steps
|
|
604
|
+
|
|
605
|
+
1. **Abuse Case Analysis**: Think like an attacker—how could this feature be misused?
|
|
606
|
+
2. **Boundary Testing**: Test edge cases and business rule boundaries
|
|
607
|
+
3. **Race Condition Testing**: Execute concurrent requests to identify timing issues
|
|
608
|
+
4. **Data Exposure Audit**: Review all API responses for over-exposure
|
|
609
|
+
|
|
610
|
+
#### Common AI Mistakes to Avoid
|
|
611
|
+
|
|
612
|
+
```python
|
|
613
|
+
# ❌ NEVER DO THIS - Client-controlled authorization
|
|
614
|
+
role = request.json.get('role') # User can set their own role!
|
|
615
|
+
if role == 'admin':
|
|
616
|
+
# grant admin access
|
|
617
|
+
|
|
618
|
+
# ✅ DO THIS INSTEAD - Server-side role verification
|
|
619
|
+
user = get_current_user()
|
|
620
|
+
if not user.has_permission('admin'):
|
|
621
|
+
abort(403)
|
|
622
|
+
|
|
623
|
+
# ❌ NEVER DO THIS - Sensitive operation without confirmation
|
|
624
|
+
@app.route('/api/change-email', methods=['POST'])
|
|
625
|
+
def change_email():
|
|
626
|
+
current_user.email = request.json['new_email']
|
|
627
|
+
db.session.commit()
|
|
628
|
+
return {'status': 'success'}
|
|
629
|
+
|
|
630
|
+
# ✅ DO THIS INSTEAD - Require verification
|
|
631
|
+
def change_email():
|
|
632
|
+
new_email = request.json['new_email']
|
|
633
|
+
token = generate_verification_token(new_email)
|
|
634
|
+
send_verification_email(new_email, token)
|
|
635
|
+
return {'status': 'verification_sent'}
|
|
636
|
+
|
|
637
|
+
// ❌ NEVER DO THIS - Over-exposure of data
|
|
638
|
+
app.get('/api/users', (req, res) => {
|
|
639
|
+
const users = await User.findAll();
|
|
640
|
+
res.json(users); // Returns all fields including hashed passwords!
|
|
641
|
+
});
|
|
642
|
+
|
|
643
|
+
// ✅ DO THIS INSTEAD - Selective field exposure
|
|
644
|
+
app.get('/api/users', async (req, res) => {
|
|
645
|
+
const users = await User.findAll({
|
|
646
|
+
attributes: ['id', 'username', 'email'] // Explicitly choose fields
|
|
647
|
+
});
|
|
648
|
+
res.json(users);
|
|
649
|
+
});
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
### 7. Error Handling and Information Disclosure
|
|
655
|
+
|
|
656
|
+
**The Problem**: AI-generated code often lacks proper error handling or exposes sensitive information in error messages, stack traces, or logs. This aids attackers in reconnaissance and exploitation.
|
|
657
|
+
|
|
658
|
+
#### Checklist
|
|
659
|
+
|
|
660
|
+
- [ ] **Safe error responses**:
|
|
661
|
+
- Return generic error messages to clients
|
|
662
|
+
- Don't expose stack traces, internal paths, or database details
|
|
663
|
+
- Use standardized error response formats
|
|
664
|
+
- Include error codes for support without revealing implementation
|
|
665
|
+
|
|
666
|
+
- [ ] **Proper exception handling**:
|
|
667
|
+
- Catch specific exceptions, not broad `except:` or `catch (Exception e)`
|
|
668
|
+
- Handle errors gracefully without crashing
|
|
669
|
+
- Ensure resources are cleaned up in finally blocks
|
|
670
|
+
- Don't swallow exceptions silently
|
|
671
|
+
|
|
672
|
+
- [ ] **Fail securely**:
|
|
673
|
+
- Default to "deny" when errors occur
|
|
674
|
+
- Don't bypass security controls due to exceptions
|
|
675
|
+
- Validate state after error recovery
|
|
676
|
+
- Log security-relevant errors
|
|
677
|
+
|
|
678
|
+
- [ ] **Information leakage prevention**:
|
|
679
|
+
- Remove version numbers from headers and error pages
|
|
680
|
+
- Don't reveal user enumeration (e.g., "password incorrect" vs "user not found")
|
|
681
|
+
- Sanitize error messages of sensitive data
|
|
682
|
+
- Be careful with 404 vs 403 responses (don't reveal resource existence)
|
|
683
|
+
|
|
684
|
+
#### Verification Steps
|
|
685
|
+
|
|
686
|
+
1. **Error Response Analysis**: Trigger errors and examine responses
|
|
687
|
+
2. **Stack Trace Exposure**: Verify stack traces aren't returned in production
|
|
688
|
+
3. **Information Leakage Test**: Attempt to extract system information through errors
|
|
689
|
+
|
|
690
|
+
---
|
|
691
|
+
|
|
692
|
+
### 8. API Security
|
|
693
|
+
|
|
694
|
+
**The Problem**: APIs are increasingly targeted and AI-generated code often lacks proper API security controls like rate limiting, authentication, input validation, and output encoding.
|
|
695
|
+
|
|
696
|
+
#### Checklist
|
|
697
|
+
|
|
698
|
+
- [ ] **API authentication**:
|
|
699
|
+
- Implement proper authentication for all endpoints
|
|
700
|
+
- Use API keys, OAuth 2.0, or JWT appropriately
|
|
701
|
+
- Secure API key transmission (headers, not URL/query params)
|
|
702
|
+
- Implement key rotation mechanisms
|
|
703
|
+
|
|
704
|
+
- [ ] **API rate limiting**:
|
|
705
|
+
- Implement tiered rate limits (different for authenticated vs anonymous)
|
|
706
|
+
- Use appropriate rate limit windows
|
|
707
|
+
- Return proper 429 status codes
|
|
708
|
+
- Include rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining)
|
|
709
|
+
|
|
710
|
+
- [ ] **API versioning**:
|
|
711
|
+
- Version your APIs to allow graceful deprecation
|
|
712
|
+
- Use URL versioning (/v1/, /v2/) or header versioning
|
|
713
|
+
- Document breaking changes
|
|
714
|
+
|
|
715
|
+
- [ ] **API documentation security**:
|
|
716
|
+
- Don't expose internal endpoints in public documentation
|
|
717
|
+
- Remove sensitive examples from documentation
|
|
718
|
+
- Secure API specification files
|
|
719
|
+
|
|
720
|
+
- [ ] **Webhook security**:
|
|
721
|
+
- Verify webhook signatures
|
|
722
|
+
- Use HTTPS for webhook URLs
|
|
723
|
+
- Implement replay attack prevention (timestamps, nonces)
|
|
724
|
+
- Allowlist IP ranges if possible
|
|
725
|
+
|
|
726
|
+
#### Verification Steps
|
|
727
|
+
|
|
728
|
+
1. **API Authentication Test**: Attempt to access protected endpoints without authentication
|
|
729
|
+
2. **Rate Limiting Test**: Exceed rate limits and verify behavior
|
|
730
|
+
3. **API Discovery**: Enumerate endpoints and verify no hidden/internal APIs are exposed
|
|
731
|
+
|
|
732
|
+
---
|
|
733
|
+
|
|
734
|
+
## Implementation Workflow
|
|
735
|
+
|
|
736
|
+
### Phase 1: Design
|
|
737
|
+
1. Define threat model and security requirements
|
|
738
|
+
2. Identify sensitive data and operations
|
|
739
|
+
3. Design authentication and authorization architecture
|
|
740
|
+
4. Plan security controls for each component
|
|
741
|
+
|
|
742
|
+
### Phase 2: Development
|
|
743
|
+
1. Apply secure coding patterns from this skill
|
|
744
|
+
2. Implement input validation at all entry points
|
|
745
|
+
3. Use parameterized queries and safe APIs
|
|
746
|
+
4. Configure security headers and CORS properly
|
|
747
|
+
5. Implement proper error handling
|
|
748
|
+
|
|
749
|
+
### Phase 3: Testing
|
|
750
|
+
1. Run automated security scans (SAST, SCA)
|
|
751
|
+
2. Perform manual code review with this checklist
|
|
752
|
+
3. Conduct penetration testing
|
|
753
|
+
4. Test with fuzzing and injection payloads
|
|
754
|
+
5. Verify business logic security
|
|
755
|
+
|
|
756
|
+
### Phase 4: Deployment
|
|
757
|
+
1. Secure configuration management
|
|
758
|
+
2. Enable security monitoring and logging
|
|
759
|
+
3. Implement incident response procedures
|
|
760
|
+
4. Plan for security updates and patches
|
|
761
|
+
|
|
762
|
+
## Compliance and Standards
|
|
763
|
+
|
|
764
|
+
### OWASP Top 10
|
|
765
|
+
Stay current with the latest OWASP Top 10 vulnerabilities and ensure your applications are protected against them.
|
|
766
|
+
|
|
767
|
+
### CWE/SANS Top 25
|
|
768
|
+
Address the most dangerous software weaknesses identified by MITRE and SANS.
|
|
769
|
+
|
|
770
|
+
### Industry-Specific Standards
|
|
771
|
+
- **PCI-DSS**: For payment card data
|
|
772
|
+
- **HIPAA**: For healthcare data
|
|
773
|
+
- **GDPR**: For EU personal data
|
|
774
|
+
- **SOC 2**: For service organizations
|
|
775
|
+
|
|
776
|
+
## When to Use This Skill
|
|
777
|
+
|
|
778
|
+
- **Before writing any code**: Review security requirements and threat model
|
|
779
|
+
- **During code generation**: Ensure AI-generated code follows security best practices
|
|
780
|
+
- **During code review**: Verify code against this comprehensive checklist
|
|
781
|
+
- **During security audits**: Use as a systematic guide for vulnerability assessment
|
|
782
|
+
- **During incident response**: Identify root causes and prevent recurrence
|
|
783
|
+
- **During security training**: Educate developers on secure coding practices
|
|
784
|
+
|
|
785
|
+
## Summary
|
|
786
|
+
|
|
787
|
+
Security is not a feature—it's a foundation. AI-generated code requires extra scrutiny because models prioritize functionality and aesthetics over security. This skill provides the guardrails, checklists, and verification steps needed to ensure your code is secure by design, not by accident, the examples provided in this place are from python but you need to adapt the logic from python to the codebase language.
|
|
788
|
+
|
|
789
|
+
Remember: **Trust but verify**. Always assume AI-generated code contains vulnerabilities until proven otherwise through rigorous review and testing.
|
|
790
|
+
|
|
791
|
+
---
|
|
792
|
+
|
|
793
|
+
*This skill should be consulted for every code generation task, every code review, and every security audit. Security is everyone's responsibility.*
|