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,641 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: error-handling-patterns
|
|
3
|
+
description: Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Error Handling Patterns
|
|
7
|
+
|
|
8
|
+
Build resilient applications with robust error handling strategies that gracefully handle failures and provide excellent debugging experiences.
|
|
9
|
+
|
|
10
|
+
## When to Use This Skill
|
|
11
|
+
|
|
12
|
+
- Implementing error handling in new features
|
|
13
|
+
- Designing error-resilient APIs
|
|
14
|
+
- Debugging production issues
|
|
15
|
+
- Improving application reliability
|
|
16
|
+
- Creating better error messages for users and developers
|
|
17
|
+
- Implementing retry and circuit breaker patterns
|
|
18
|
+
- Handling async/concurrent errors
|
|
19
|
+
- Building fault-tolerant distributed systems
|
|
20
|
+
|
|
21
|
+
## Core Concepts
|
|
22
|
+
|
|
23
|
+
### 1. Error Handling Philosophies
|
|
24
|
+
|
|
25
|
+
**Exceptions vs Result Types:**
|
|
26
|
+
|
|
27
|
+
- **Exceptions**: Traditional try-catch, disrupts control flow
|
|
28
|
+
- **Result Types**: Explicit success/failure, functional approach
|
|
29
|
+
- **Error Codes**: C-style, requires discipline
|
|
30
|
+
- **Option/Maybe Types**: For nullable values
|
|
31
|
+
|
|
32
|
+
**When to Use Each:**
|
|
33
|
+
|
|
34
|
+
- Exceptions: Unexpected errors, exceptional conditions
|
|
35
|
+
- Result Types: Expected errors, validation failures
|
|
36
|
+
- Panics/Crashes: Unrecoverable errors, programming bugs
|
|
37
|
+
|
|
38
|
+
### 2. Error Categories
|
|
39
|
+
|
|
40
|
+
**Recoverable Errors:**
|
|
41
|
+
|
|
42
|
+
- Network timeouts
|
|
43
|
+
- Missing files
|
|
44
|
+
- Invalid user input
|
|
45
|
+
- API rate limits
|
|
46
|
+
|
|
47
|
+
**Unrecoverable Errors:**
|
|
48
|
+
|
|
49
|
+
- Out of memory
|
|
50
|
+
- Stack overflow
|
|
51
|
+
- Programming bugs (null pointer, etc.)
|
|
52
|
+
|
|
53
|
+
## Language-Specific Patterns
|
|
54
|
+
|
|
55
|
+
### Python Error Handling
|
|
56
|
+
|
|
57
|
+
**Custom Exception Hierarchy:**
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
class ApplicationError(Exception):
|
|
61
|
+
"""Base exception for all application errors."""
|
|
62
|
+
def __init__(self, message: str, code: str = None, details: dict = None):
|
|
63
|
+
super().__init__(message)
|
|
64
|
+
self.code = code
|
|
65
|
+
self.details = details or {}
|
|
66
|
+
self.timestamp = datetime.utcnow()
|
|
67
|
+
|
|
68
|
+
class ValidationError(ApplicationError):
|
|
69
|
+
"""Raised when validation fails."""
|
|
70
|
+
pass
|
|
71
|
+
|
|
72
|
+
class NotFoundError(ApplicationError):
|
|
73
|
+
"""Raised when resource not found."""
|
|
74
|
+
pass
|
|
75
|
+
|
|
76
|
+
class ExternalServiceError(ApplicationError):
|
|
77
|
+
"""Raised when external service fails."""
|
|
78
|
+
def __init__(self, message: str, service: str, **kwargs):
|
|
79
|
+
super().__init__(message, **kwargs)
|
|
80
|
+
self.service = service
|
|
81
|
+
|
|
82
|
+
# Usage
|
|
83
|
+
def get_user(user_id: str) -> User:
|
|
84
|
+
user = db.query(User).filter_by(id=user_id).first()
|
|
85
|
+
if not user:
|
|
86
|
+
raise NotFoundError(
|
|
87
|
+
f"User not found",
|
|
88
|
+
code="USER_NOT_FOUND",
|
|
89
|
+
details={"user_id": user_id}
|
|
90
|
+
)
|
|
91
|
+
return user
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Context Managers for Cleanup:**
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from contextlib import contextmanager
|
|
98
|
+
|
|
99
|
+
@contextmanager
|
|
100
|
+
def database_transaction(session):
|
|
101
|
+
"""Ensure transaction is committed or rolled back."""
|
|
102
|
+
try:
|
|
103
|
+
yield session
|
|
104
|
+
session.commit()
|
|
105
|
+
except Exception as e:
|
|
106
|
+
session.rollback()
|
|
107
|
+
raise
|
|
108
|
+
finally:
|
|
109
|
+
session.close()
|
|
110
|
+
|
|
111
|
+
# Usage
|
|
112
|
+
with database_transaction(db.session) as session:
|
|
113
|
+
user = User(name="Alice")
|
|
114
|
+
session.add(user)
|
|
115
|
+
# Automatic commit or rollback
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Retry with Exponential Backoff:**
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
import time
|
|
122
|
+
from functools import wraps
|
|
123
|
+
from typing import TypeVar, Callable
|
|
124
|
+
|
|
125
|
+
T = TypeVar('T')
|
|
126
|
+
|
|
127
|
+
def retry(
|
|
128
|
+
max_attempts: int = 3,
|
|
129
|
+
backoff_factor: float = 2.0,
|
|
130
|
+
exceptions: tuple = (Exception,)
|
|
131
|
+
):
|
|
132
|
+
"""Retry decorator with exponential backoff."""
|
|
133
|
+
def decorator(func: Callable[..., T]) -> Callable[..., T]:
|
|
134
|
+
@wraps(func)
|
|
135
|
+
def wrapper(*args, **kwargs) -> T:
|
|
136
|
+
last_exception = None
|
|
137
|
+
for attempt in range(max_attempts):
|
|
138
|
+
try:
|
|
139
|
+
return func(*args, **kwargs)
|
|
140
|
+
except exceptions as e:
|
|
141
|
+
last_exception = e
|
|
142
|
+
if attempt < max_attempts - 1:
|
|
143
|
+
sleep_time = backoff_factor ** attempt
|
|
144
|
+
time.sleep(sleep_time)
|
|
145
|
+
continue
|
|
146
|
+
raise
|
|
147
|
+
raise last_exception
|
|
148
|
+
return wrapper
|
|
149
|
+
return decorator
|
|
150
|
+
|
|
151
|
+
# Usage
|
|
152
|
+
@retry(max_attempts=3, exceptions=(NetworkError,))
|
|
153
|
+
def fetch_data(url: str) -> dict:
|
|
154
|
+
response = requests.get(url, timeout=5)
|
|
155
|
+
response.raise_for_status()
|
|
156
|
+
return response.json()
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### TypeScript/JavaScript Error Handling
|
|
160
|
+
|
|
161
|
+
**Custom Error Classes:**
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
// Custom error classes
|
|
165
|
+
class ApplicationError extends Error {
|
|
166
|
+
constructor(
|
|
167
|
+
message: string,
|
|
168
|
+
public code: string,
|
|
169
|
+
public statusCode: number = 500,
|
|
170
|
+
public details?: Record<string, any>,
|
|
171
|
+
) {
|
|
172
|
+
super(message);
|
|
173
|
+
this.name = this.constructor.name;
|
|
174
|
+
Error.captureStackTrace(this, this.constructor);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
class ValidationError extends ApplicationError {
|
|
179
|
+
constructor(message: string, details?: Record<string, any>) {
|
|
180
|
+
super(message, "VALIDATION_ERROR", 400, details);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
class NotFoundError extends ApplicationError {
|
|
185
|
+
constructor(resource: string, id: string) {
|
|
186
|
+
super(`${resource} not found`, "NOT_FOUND", 404, { resource, id });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Usage
|
|
191
|
+
function getUser(id: string): User {
|
|
192
|
+
const user = users.find((u) => u.id === id);
|
|
193
|
+
if (!user) {
|
|
194
|
+
throw new NotFoundError("User", id);
|
|
195
|
+
}
|
|
196
|
+
return user;
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Result Type Pattern:**
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
// Result type for explicit error handling
|
|
204
|
+
type Result<T, E = Error> = { ok: true; value: T } | { ok: false; error: E };
|
|
205
|
+
|
|
206
|
+
// Helper functions
|
|
207
|
+
function Ok<T>(value: T): Result<T, never> {
|
|
208
|
+
return { ok: true, value };
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function Err<E>(error: E): Result<never, E> {
|
|
212
|
+
return { ok: false, error };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Usage
|
|
216
|
+
function parseJSON<T>(json: string): Result<T, SyntaxError> {
|
|
217
|
+
try {
|
|
218
|
+
const value = JSON.parse(json) as T;
|
|
219
|
+
return Ok(value);
|
|
220
|
+
} catch (error) {
|
|
221
|
+
return Err(error as SyntaxError);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Consuming Result
|
|
226
|
+
const result = parseJSON<User>(userJson);
|
|
227
|
+
if (result.ok) {
|
|
228
|
+
console.log(result.value.name);
|
|
229
|
+
} else {
|
|
230
|
+
console.error("Parse failed:", result.error.message);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Chaining Results
|
|
234
|
+
function chain<T, U, E>(
|
|
235
|
+
result: Result<T, E>,
|
|
236
|
+
fn: (value: T) => Result<U, E>,
|
|
237
|
+
): Result<U, E> {
|
|
238
|
+
return result.ok ? fn(result.value) : result;
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Async Error Handling:**
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
// Async/await with proper error handling
|
|
246
|
+
async function fetchUserOrders(userId: string): Promise<Order[]> {
|
|
247
|
+
try {
|
|
248
|
+
const user = await getUser(userId);
|
|
249
|
+
const orders = await getOrders(user.id);
|
|
250
|
+
return orders;
|
|
251
|
+
} catch (error) {
|
|
252
|
+
if (error instanceof NotFoundError) {
|
|
253
|
+
return []; // Return empty array for not found
|
|
254
|
+
}
|
|
255
|
+
if (error instanceof NetworkError) {
|
|
256
|
+
// Retry logic
|
|
257
|
+
return retryFetchOrders(userId);
|
|
258
|
+
}
|
|
259
|
+
// Re-throw unexpected errors
|
|
260
|
+
throw error;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Promise error handling
|
|
265
|
+
function fetchData(url: string): Promise<Data> {
|
|
266
|
+
return fetch(url)
|
|
267
|
+
.then((response) => {
|
|
268
|
+
if (!response.ok) {
|
|
269
|
+
throw new NetworkError(`HTTP ${response.status}`);
|
|
270
|
+
}
|
|
271
|
+
return response.json();
|
|
272
|
+
})
|
|
273
|
+
.catch((error) => {
|
|
274
|
+
console.error("Fetch failed:", error);
|
|
275
|
+
throw error;
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Rust Error Handling
|
|
281
|
+
|
|
282
|
+
**Result and Option Types:**
|
|
283
|
+
|
|
284
|
+
```rust
|
|
285
|
+
use std::fs::File;
|
|
286
|
+
use std::io::{self, Read};
|
|
287
|
+
|
|
288
|
+
// Result type for operations that can fail
|
|
289
|
+
fn read_file(path: &str) -> Result<String, io::Error> {
|
|
290
|
+
let mut file = File::open(path)?; // ? operator propagates errors
|
|
291
|
+
let mut contents = String::new();
|
|
292
|
+
file.read_to_string(&mut contents)?;
|
|
293
|
+
Ok(contents)
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Custom error types
|
|
297
|
+
#[derive(Debug)]
|
|
298
|
+
enum AppError {
|
|
299
|
+
Io(io::Error),
|
|
300
|
+
Parse(std::num::ParseIntError),
|
|
301
|
+
NotFound(String),
|
|
302
|
+
Validation(String),
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
impl From<io::Error> for AppError {
|
|
306
|
+
fn from(error: io::Error) -> Self {
|
|
307
|
+
AppError::Io(error)
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Using custom error type
|
|
312
|
+
fn read_number_from_file(path: &str) -> Result<i32, AppError> {
|
|
313
|
+
let contents = read_file(path)?; // Auto-converts io::Error
|
|
314
|
+
let number = contents.trim().parse()
|
|
315
|
+
.map_err(AppError::Parse)?; // Explicitly convert ParseIntError
|
|
316
|
+
Ok(number)
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// Option for nullable values
|
|
320
|
+
fn find_user(id: &str) -> Option<User> {
|
|
321
|
+
users.iter().find(|u| u.id == id).cloned()
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Combining Option and Result
|
|
325
|
+
fn get_user_age(id: &str) -> Result<u32, AppError> {
|
|
326
|
+
find_user(id)
|
|
327
|
+
.ok_or_else(|| AppError::NotFound(id.to_string()))
|
|
328
|
+
.map(|user| user.age)
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Go Error Handling
|
|
333
|
+
|
|
334
|
+
**Explicit Error Returns:**
|
|
335
|
+
|
|
336
|
+
```go
|
|
337
|
+
// Basic error handling
|
|
338
|
+
func getUser(id string) (*User, error) {
|
|
339
|
+
user, err := db.QueryUser(id)
|
|
340
|
+
if err != nil {
|
|
341
|
+
return nil, fmt.Errorf("failed to query user: %w", err)
|
|
342
|
+
}
|
|
343
|
+
if user == nil {
|
|
344
|
+
return nil, errors.New("user not found")
|
|
345
|
+
}
|
|
346
|
+
return user, nil
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Custom error types
|
|
350
|
+
type ValidationError struct {
|
|
351
|
+
Field string
|
|
352
|
+
Message string
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
func (e *ValidationError) Error() string {
|
|
356
|
+
return fmt.Sprintf("validation failed for %s: %s", e.Field, e.Message)
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Sentinel errors for comparison
|
|
360
|
+
var (
|
|
361
|
+
ErrNotFound = errors.New("not found")
|
|
362
|
+
ErrUnauthorized = errors.New("unauthorized")
|
|
363
|
+
ErrInvalidInput = errors.New("invalid input")
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
// Error checking
|
|
367
|
+
user, err := getUser("123")
|
|
368
|
+
if err != nil {
|
|
369
|
+
if errors.Is(err, ErrNotFound) {
|
|
370
|
+
// Handle not found
|
|
371
|
+
} else {
|
|
372
|
+
// Handle other errors
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// Error wrapping and unwrapping
|
|
377
|
+
func processUser(id string) error {
|
|
378
|
+
user, err := getUser(id)
|
|
379
|
+
if err != nil {
|
|
380
|
+
return fmt.Errorf("process user failed: %w", err)
|
|
381
|
+
}
|
|
382
|
+
// Process user
|
|
383
|
+
return nil
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// Unwrap errors
|
|
387
|
+
err := processUser("123")
|
|
388
|
+
if err != nil {
|
|
389
|
+
var valErr *ValidationError
|
|
390
|
+
if errors.As(err, &valErr) {
|
|
391
|
+
fmt.Printf("Validation error: %s\n", valErr.Field)
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
## Universal Patterns
|
|
397
|
+
|
|
398
|
+
### Pattern 1: Circuit Breaker
|
|
399
|
+
|
|
400
|
+
Prevent cascading failures in distributed systems.
|
|
401
|
+
|
|
402
|
+
```python
|
|
403
|
+
from enum import Enum
|
|
404
|
+
from datetime import datetime, timedelta
|
|
405
|
+
from typing import Callable, TypeVar
|
|
406
|
+
|
|
407
|
+
T = TypeVar('T')
|
|
408
|
+
|
|
409
|
+
class CircuitState(Enum):
|
|
410
|
+
CLOSED = "closed" # Normal operation
|
|
411
|
+
OPEN = "open" # Failing, reject requests
|
|
412
|
+
HALF_OPEN = "half_open" # Testing if recovered
|
|
413
|
+
|
|
414
|
+
class CircuitBreaker:
|
|
415
|
+
def __init__(
|
|
416
|
+
self,
|
|
417
|
+
failure_threshold: int = 5,
|
|
418
|
+
timeout: timedelta = timedelta(seconds=60),
|
|
419
|
+
success_threshold: int = 2
|
|
420
|
+
):
|
|
421
|
+
self.failure_threshold = failure_threshold
|
|
422
|
+
self.timeout = timeout
|
|
423
|
+
self.success_threshold = success_threshold
|
|
424
|
+
self.failure_count = 0
|
|
425
|
+
self.success_count = 0
|
|
426
|
+
self.state = CircuitState.CLOSED
|
|
427
|
+
self.last_failure_time = None
|
|
428
|
+
|
|
429
|
+
def call(self, func: Callable[[], T]) -> T:
|
|
430
|
+
if self.state == CircuitState.OPEN:
|
|
431
|
+
if datetime.now() - self.last_failure_time > self.timeout:
|
|
432
|
+
self.state = CircuitState.HALF_OPEN
|
|
433
|
+
self.success_count = 0
|
|
434
|
+
else:
|
|
435
|
+
raise Exception("Circuit breaker is OPEN")
|
|
436
|
+
|
|
437
|
+
try:
|
|
438
|
+
result = func()
|
|
439
|
+
self.on_success()
|
|
440
|
+
return result
|
|
441
|
+
except Exception as e:
|
|
442
|
+
self.on_failure()
|
|
443
|
+
raise
|
|
444
|
+
|
|
445
|
+
def on_success(self):
|
|
446
|
+
self.failure_count = 0
|
|
447
|
+
if self.state == CircuitState.HALF_OPEN:
|
|
448
|
+
self.success_count += 1
|
|
449
|
+
if self.success_count >= self.success_threshold:
|
|
450
|
+
self.state = CircuitState.CLOSED
|
|
451
|
+
self.success_count = 0
|
|
452
|
+
|
|
453
|
+
def on_failure(self):
|
|
454
|
+
self.failure_count += 1
|
|
455
|
+
self.last_failure_time = datetime.now()
|
|
456
|
+
if self.failure_count >= self.failure_threshold:
|
|
457
|
+
self.state = CircuitState.OPEN
|
|
458
|
+
|
|
459
|
+
# Usage
|
|
460
|
+
circuit_breaker = CircuitBreaker()
|
|
461
|
+
|
|
462
|
+
def fetch_data():
|
|
463
|
+
return circuit_breaker.call(lambda: external_api.get_data())
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### Pattern 2: Error Aggregation
|
|
467
|
+
|
|
468
|
+
Collect multiple errors instead of failing on first error.
|
|
469
|
+
|
|
470
|
+
```typescript
|
|
471
|
+
class ErrorCollector {
|
|
472
|
+
private errors: Error[] = [];
|
|
473
|
+
|
|
474
|
+
add(error: Error): void {
|
|
475
|
+
this.errors.push(error);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
hasErrors(): boolean {
|
|
479
|
+
return this.errors.length > 0;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
getErrors(): Error[] {
|
|
483
|
+
return [...this.errors];
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
throw(): never {
|
|
487
|
+
if (this.errors.length === 1) {
|
|
488
|
+
throw this.errors[0];
|
|
489
|
+
}
|
|
490
|
+
throw new AggregateError(
|
|
491
|
+
this.errors,
|
|
492
|
+
`${this.errors.length} errors occurred`,
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// Usage: Validate multiple fields
|
|
498
|
+
function validateUser(data: any): User {
|
|
499
|
+
const errors = new ErrorCollector();
|
|
500
|
+
|
|
501
|
+
if (!data.email) {
|
|
502
|
+
errors.add(new ValidationError("Email is required"));
|
|
503
|
+
} else if (!isValidEmail(data.email)) {
|
|
504
|
+
errors.add(new ValidationError("Email is invalid"));
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
if (!data.name || data.name.length < 2) {
|
|
508
|
+
errors.add(new ValidationError("Name must be at least 2 characters"));
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
if (!data.age || data.age < 18) {
|
|
512
|
+
errors.add(new ValidationError("Age must be 18 or older"));
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if (errors.hasErrors()) {
|
|
516
|
+
errors.throw();
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
return data as User;
|
|
520
|
+
}
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### Pattern 3: Graceful Degradation
|
|
524
|
+
|
|
525
|
+
Provide fallback functionality when errors occur.
|
|
526
|
+
|
|
527
|
+
```python
|
|
528
|
+
from typing import Optional, Callable, TypeVar
|
|
529
|
+
|
|
530
|
+
T = TypeVar('T')
|
|
531
|
+
|
|
532
|
+
def with_fallback(
|
|
533
|
+
primary: Callable[[], T],
|
|
534
|
+
fallback: Callable[[], T],
|
|
535
|
+
log_error: bool = True
|
|
536
|
+
) -> T:
|
|
537
|
+
"""Try primary function, fall back to fallback on error."""
|
|
538
|
+
try:
|
|
539
|
+
return primary()
|
|
540
|
+
except Exception as e:
|
|
541
|
+
if log_error:
|
|
542
|
+
logger.error(f"Primary function failed: {e}")
|
|
543
|
+
return fallback()
|
|
544
|
+
|
|
545
|
+
# Usage
|
|
546
|
+
def get_user_profile(user_id: str) -> UserProfile:
|
|
547
|
+
return with_fallback(
|
|
548
|
+
primary=lambda: fetch_from_cache(user_id),
|
|
549
|
+
fallback=lambda: fetch_from_database(user_id)
|
|
550
|
+
)
|
|
551
|
+
|
|
552
|
+
# Multiple fallbacks
|
|
553
|
+
def get_exchange_rate(currency: str) -> float:
|
|
554
|
+
return (
|
|
555
|
+
try_function(lambda: api_provider_1.get_rate(currency))
|
|
556
|
+
or try_function(lambda: api_provider_2.get_rate(currency))
|
|
557
|
+
or try_function(lambda: cache.get_rate(currency))
|
|
558
|
+
or DEFAULT_RATE
|
|
559
|
+
)
|
|
560
|
+
|
|
561
|
+
def try_function(func: Callable[[], Optional[T]]) -> Optional[T]:
|
|
562
|
+
try:
|
|
563
|
+
return func()
|
|
564
|
+
except Exception:
|
|
565
|
+
return None
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
## Best Practices
|
|
569
|
+
|
|
570
|
+
1. **Fail Fast**: Validate input early, fail quickly
|
|
571
|
+
2. **Preserve Context**: Include stack traces, metadata, timestamps
|
|
572
|
+
3. **Meaningful Messages**: Explain what happened and how to fix it
|
|
573
|
+
4. **Log Appropriately**: Error = log, expected failure = don't spam logs
|
|
574
|
+
5. **Handle at Right Level**: Catch where you can meaningfully handle
|
|
575
|
+
6. **Clean Up Resources**: Use try-finally, context managers, defer
|
|
576
|
+
7. **Don't Swallow Errors**: Log or re-throw, don't silently ignore
|
|
577
|
+
8. **Type-Safe Errors**: Use typed errors when possible
|
|
578
|
+
|
|
579
|
+
```python
|
|
580
|
+
# Good error handling example
|
|
581
|
+
def process_order(order_id: str) -> Order:
|
|
582
|
+
"""Process order with comprehensive error handling."""
|
|
583
|
+
try:
|
|
584
|
+
# Validate input
|
|
585
|
+
if not order_id:
|
|
586
|
+
raise ValidationError("Order ID is required")
|
|
587
|
+
|
|
588
|
+
# Fetch order
|
|
589
|
+
order = db.get_order(order_id)
|
|
590
|
+
if not order:
|
|
591
|
+
raise NotFoundError("Order", order_id)
|
|
592
|
+
|
|
593
|
+
# Process payment
|
|
594
|
+
try:
|
|
595
|
+
payment_result = payment_service.charge(order.total)
|
|
596
|
+
except PaymentServiceError as e:
|
|
597
|
+
# Log and wrap external service error
|
|
598
|
+
logger.error(f"Payment failed for order {order_id}: {e}")
|
|
599
|
+
raise ExternalServiceError(
|
|
600
|
+
f"Payment processing failed",
|
|
601
|
+
service="payment_service",
|
|
602
|
+
details={"order_id": order_id, "amount": order.total}
|
|
603
|
+
) from e
|
|
604
|
+
|
|
605
|
+
# Update order
|
|
606
|
+
order.status = "completed"
|
|
607
|
+
order.payment_id = payment_result.id
|
|
608
|
+
db.save(order)
|
|
609
|
+
|
|
610
|
+
return order
|
|
611
|
+
|
|
612
|
+
except ApplicationError:
|
|
613
|
+
# Re-raise known application errors
|
|
614
|
+
raise
|
|
615
|
+
except Exception as e:
|
|
616
|
+
# Log unexpected errors
|
|
617
|
+
logger.exception(f"Unexpected error processing order {order_id}")
|
|
618
|
+
raise ApplicationError(
|
|
619
|
+
"Order processing failed",
|
|
620
|
+
code="INTERNAL_ERROR"
|
|
621
|
+
) from e
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
## Common Pitfalls
|
|
625
|
+
|
|
626
|
+
- **Catching Too Broadly**: `except Exception` hides bugs
|
|
627
|
+
- **Empty Catch Blocks**: Silently swallowing errors
|
|
628
|
+
- **Logging and Re-throwing**: Creates duplicate log entries
|
|
629
|
+
- **Not Cleaning Up**: Forgetting to close files, connections
|
|
630
|
+
- **Poor Error Messages**: "Error occurred" is not helpful
|
|
631
|
+
- **Returning Error Codes**: Use exceptions or Result types
|
|
632
|
+
- **Ignoring Async Errors**: Unhandled promise rejections
|
|
633
|
+
|
|
634
|
+
## Resources
|
|
635
|
+
|
|
636
|
+
- **references/exception-hierarchy-design.md**: Designing error class hierarchies
|
|
637
|
+
- **references/error-recovery-strategies.md**: Recovery patterns for different scenarios
|
|
638
|
+
- **references/async-error-handling.md**: Handling errors in concurrent code
|
|
639
|
+
- **assets/error-handling-checklist.md**: Review checklist for error handling
|
|
640
|
+
- **assets/error-message-guide.md**: Writing helpful error messages
|
|
641
|
+
- **scripts/error-analyzer.py**: Analyze error patterns in logs
|