mindforge-cc 10.0.2 → 10.7.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/.mindforge/config.json +73 -2
- package/.mindforge/engine/autonomous/cross-iteration-bridge.md +96 -0
- package/.mindforge/engine/cost-tracking/budget-enforcer.md +68 -0
- package/.mindforge/engine/cost-tracking/router.md +58 -0
- package/.mindforge/engine/cost-tracking/token-ledger.md +77 -0
- package/.mindforge/engine/council/council-protocol.md +96 -0
- package/.mindforge/engine/council/council-templates.md +85 -0
- package/.mindforge/engine/council/synthesis-engine.md +71 -0
- package/.mindforge/engine/cross-model-eval.md +74 -0
- package/.mindforge/engine/instincts/capture-engine.md +63 -0
- package/.mindforge/engine/instincts/instinct-schema.md +76 -0
- package/.mindforge/engine/instincts/promotion-engine.md +77 -0
- package/.mindforge/engine/proactive/signal-detector.md +60 -0
- package/.mindforge/engine/proactive/suggestion-engine.md +100 -0
- package/.mindforge/engine/skills/composition.md +83 -0
- package/.mindforge/engine/skills/loader.md +16 -0
- package/.mindforge/personas/agent-architect.md +57 -0
- package/.mindforge/personas/agent-evaluator.md +162 -0
- package/.mindforge/personas/agent-memory-designer.md +157 -0
- package/.mindforge/personas/agent-ops-engineer.md +120 -0
- package/.mindforge/personas/agent-orchestrator.md +112 -0
- package/.mindforge/personas/ai-economist.md +57 -0
- package/.mindforge/personas/ai-safety-engineer.md +57 -0
- package/.mindforge/personas/analytics-engineer.md +57 -0
- package/.mindforge/personas/anti-pattern-hunter.md +61 -0
- package/.mindforge/personas/api-gateway-designer.md +132 -0
- package/.mindforge/personas/auth-engineer.md +112 -0
- package/.mindforge/personas/build-engineer.md +57 -0
- package/.mindforge/personas/business-analyst.md +56 -0
- package/.mindforge/personas/cache-architect.md +100 -0
- package/.mindforge/personas/causal-scientist.md +57 -0
- package/.mindforge/personas/cdn-architect.md +118 -0
- package/.mindforge/personas/change-agent.md +104 -0
- package/.mindforge/personas/code-narrator.md +52 -0
- package/.mindforge/personas/codegen-specialist.md +68 -0
- package/.mindforge/personas/communication-architect.md +102 -0
- package/.mindforge/personas/compliance-engineer.md +96 -0
- package/.mindforge/personas/consensus-engineer.md +116 -0
- package/.mindforge/personas/contract-tester.md +60 -192
- package/.mindforge/personas/cost-optimizer.md +71 -0
- package/.mindforge/personas/council-architect.md +66 -0
- package/.mindforge/personas/council-critic.md +67 -0
- package/.mindforge/personas/council-pragmatist.md +71 -0
- package/.mindforge/personas/council-skeptic.md +73 -0
- package/.mindforge/personas/data-architect.md +108 -0
- package/.mindforge/personas/data-mesh-architect.md +57 -0
- package/.mindforge/personas/data-pipeline-architect.md +120 -0
- package/.mindforge/personas/de-sloppifier.md +60 -0
- package/.mindforge/personas/debt-manager.md +66 -0
- package/.mindforge/personas/decision-architect.md +82 -51
- package/.mindforge/personas/deployment-captain.md +74 -0
- package/.mindforge/personas/design-system-lead.md +112 -0
- package/.mindforge/personas/dmux-orchestrator.md +75 -0
- package/.mindforge/personas/doc-auditor.md +84 -0
- package/.mindforge/personas/dx-engineer.md +96 -0
- package/.mindforge/personas/ecommerce-engineer.md +57 -0
- package/.mindforge/personas/edge-engineer.md +94 -0
- package/.mindforge/personas/edtech-architect.md +106 -0
- package/.mindforge/personas/embedding-architect.md +57 -0
- package/.mindforge/personas/environment-engineer.md +57 -0
- package/.mindforge/personas/eval-judge.md +55 -0
- package/.mindforge/personas/event-architect.md +102 -0
- package/.mindforge/personas/experiment-designer.md +138 -0
- package/.mindforge/personas/feature-store-engineer.md +57 -0
- package/.mindforge/personas/finops-analyst.md +66 -0
- package/.mindforge/personas/fintech-architect.md +57 -0
- package/.mindforge/personas/flutter-engineer.md +104 -0
- package/.mindforge/personas/gaming-engineer.md +57 -0
- package/.mindforge/personas/graphql-designer.md +73 -0
- package/.mindforge/personas/healthcare-engineer.md +57 -0
- package/.mindforge/personas/hiring-strategist.md +105 -0
- package/.mindforge/personas/hitl-architect.md +165 -0
- package/.mindforge/personas/i18n-architect.md +69 -0
- package/.mindforge/personas/instinct-curator.md +83 -0
- package/.mindforge/personas/iot-architect.md +105 -0
- package/.mindforge/personas/knowledge-curator.md +139 -0
- package/.mindforge/personas/knowledge-engineer.md +57 -0
- package/.mindforge/personas/lakehouse-architect.md +57 -0
- package/.mindforge/personas/llm-orchestrator.md +57 -0
- package/.mindforge/personas/logistics-architect.md +106 -0
- package/.mindforge/personas/market-analyst.md +53 -0
- package/.mindforge/personas/marketplace-engineer.md +105 -0
- package/.mindforge/personas/mcp-designer.md +54 -0
- package/.mindforge/personas/meeting-designer.md +104 -0
- package/.mindforge/personas/mentorship-lead.md +106 -0
- package/.mindforge/personas/migration-architect.md +57 -0
- package/.mindforge/personas/ml-ops-engineer.md +101 -0
- package/.mindforge/personas/mobile-architect.md +105 -0
- package/.mindforge/personas/mobile-security-engineer.md +106 -0
- package/.mindforge/personas/multi-model-bridge.md +86 -0
- package/.mindforge/personas/multi-tenancy-architect.md +71 -0
- package/.mindforge/personas/multimodal-engineer.md +57 -0
- package/.mindforge/personas/offline-specialist.md +105 -0
- package/.mindforge/personas/onboarding-navigator.md +63 -0
- package/.mindforge/personas/payments-engineer.md +135 -0
- package/.mindforge/personas/pipeline-engineer.md +115 -0
- package/.mindforge/personas/platform-engineer.md +97 -0
- package/.mindforge/personas/platform-lead.md +57 -0
- package/.mindforge/personas/privacy-engineer.md +57 -0
- package/.mindforge/personas/product-owner.md +56 -0
- package/.mindforge/personas/productivity-analyst.md +57 -0
- package/.mindforge/personas/prompt-architect.md +101 -0
- package/.mindforge/personas/proofreader.md +53 -0
- package/.mindforge/personas/pwa-architect.md +105 -0
- package/.mindforge/personas/quality-scorer.md +63 -0
- package/.mindforge/personas/react-native-engineer.md +106 -0
- package/.mindforge/personas/resilience-engineer.md +69 -0
- package/.mindforge/personas/rfc-architect.md +64 -0
- package/.mindforge/personas/saga-orchestrator.md +80 -0
- package/.mindforge/personas/secrets-engineer.md +57 -0
- package/.mindforge/personas/skill-smith.md +79 -0
- package/.mindforge/personas/sre-lead.md +107 -0
- package/.mindforge/personas/stream-engineer.md +57 -0
- package/.mindforge/personas/streaming-engineer.md +64 -0
- package/.mindforge/personas/swarm-templates.json +695 -38
- package/.mindforge/personas/system-designer.md +57 -0
- package/.mindforge/personas/team-coach.md +120 -0
- package/.mindforge/personas/tech-lead-coach.md +103 -0
- package/.mindforge/personas/technical-writer-lead.md +111 -0
- package/.mindforge/personas/threat-modeler.md +82 -0
- package/.mindforge/personas/vibe-checker.md +75 -0
- package/.mindforge/personas/worktree-manager.md +56 -0
- package/.mindforge/personas/zero-trust-engineer.md +113 -0
- package/.mindforge/skills/a11y-testing/SKILL.md +143 -0
- package/.mindforge/skills/agent-evaluation-framework/SKILL.md +227 -0
- package/.mindforge/skills/agent-introspection-debugging/SKILL.md +88 -0
- package/.mindforge/skills/agent-loops/SKILL.md +84 -0
- package/.mindforge/skills/agent-memory-design/SKILL.md +199 -0
- package/.mindforge/skills/agent-orchestration-patterns/SKILL.md +129 -0
- package/.mindforge/skills/agent-tool-selection/SKILL.md +204 -0
- package/.mindforge/skills/ai-agent-deployment/SKILL.md +176 -0
- package/.mindforge/skills/ai-cost-management/SKILL.md +57 -0
- package/.mindforge/skills/ai-safety-alignment/SKILL.md +53 -0
- package/.mindforge/skills/analytics-instrumentation/SKILL.md +172 -0
- package/.mindforge/skills/api-gateway-patterns/SKILL.md +177 -0
- package/.mindforge/skills/api-marketplace/SKILL.md +56 -0
- package/.mindforge/skills/api-versioning/SKILL.md +100 -0
- package/.mindforge/skills/app-store-deployment/SKILL.md +44 -0
- package/.mindforge/skills/architecture-tradeoff-analysis/SKILL.md +97 -0
- package/.mindforge/skills/audit-logging/SKILL.md +140 -0
- package/.mindforge/skills/auth-patterns/SKILL.md +148 -0
- package/.mindforge/skills/autonomous-agent-harness/SKILL.md +218 -0
- package/.mindforge/skills/autonomous-agents/SKILL.md +59 -0
- package/.mindforge/skills/autonomous-loops/SKILL.md +105 -0
- package/.mindforge/skills/build-system-optimization/SKILL.md +54 -0
- package/.mindforge/skills/build-vs-buy/SKILL.md +80 -0
- package/.mindforge/skills/bundle-optimization/SKILL.md +174 -0
- package/.mindforge/skills/business-analyst/SKILL.md +82 -0
- package/.mindforge/skills/caching-strategies/SKILL.md +132 -0
- package/.mindforge/skills/capacity-planning/SKILL.md +96 -0
- package/.mindforge/skills/causal-inference/SKILL.md +42 -0
- package/.mindforge/skills/cdn-optimization/SKILL.md +212 -0
- package/.mindforge/skills/change-management/SKILL.md +106 -0
- package/.mindforge/skills/chaos-engineering/SKILL.md +99 -0
- package/.mindforge/skills/ci-cd-pipeline/SKILL.md +118 -0
- package/.mindforge/skills/cli-design/SKILL.md +118 -0
- package/.mindforge/skills/code-generation-patterns/SKILL.md +92 -0
- package/.mindforge/skills/code-review-methodology/SKILL.md +180 -0
- package/.mindforge/skills/code-tour/SKILL.md +145 -0
- package/.mindforge/skills/codebase-onboarding/SKILL.md +95 -0
- package/.mindforge/skills/compliance-as-code/SKILL.md +195 -0
- package/.mindforge/skills/conflict-resolution/SKILL.md +87 -0
- package/.mindforge/skills/connection-pooling/SKILL.md +151 -0
- package/.mindforge/skills/container-security/SKILL.md +151 -0
- package/.mindforge/skills/context-engineering/SKILL.md +114 -0
- package/.mindforge/skills/continuous-learning/SKILL.md +84 -0
- package/.mindforge/skills/contract-testing/SKILL.md +85 -0
- package/.mindforge/skills/cost-aware-routing/SKILL.md +83 -0
- package/.mindforge/skills/cost-estimation/SKILL.md +82 -0
- package/.mindforge/skills/council/SKILL.md +68 -0
- package/.mindforge/skills/cqrs-event-sourcing/SKILL.md +95 -0
- package/.mindforge/skills/cross-platform-testing/SKILL.md +43 -0
- package/.mindforge/skills/data-governance/SKILL.md +42 -0
- package/.mindforge/skills/data-lakehouse/SKILL.md +42 -0
- package/.mindforge/skills/data-mesh/SKILL.md +42 -0
- package/.mindforge/skills/data-modeling/SKILL.md +107 -0
- package/.mindforge/skills/data-pipeline-design/SKILL.md +171 -0
- package/.mindforge/skills/data-privacy-engineering/SKILL.md +42 -0
- package/.mindforge/skills/database-performance/SKILL.md +174 -0
- package/.mindforge/skills/database-sharding-advanced/SKILL.md +206 -0
- package/.mindforge/skills/de-sloppify/SKILL.md +120 -0
- package/.mindforge/skills/defense-in-depth/SKILL.md +84 -0
- package/.mindforge/skills/delegation-patterns/SKILL.md +123 -0
- package/.mindforge/skills/dependency-management/SKILL.md +94 -0
- package/.mindforge/skills/deployment-workflow/SKILL.md +135 -0
- package/.mindforge/skills/design-system/SKILL.md +113 -0
- package/.mindforge/skills/developer-onboarding/SKILL.md +99 -0
- package/.mindforge/skills/developer-productivity-metrics/SKILL.md +59 -0
- package/.mindforge/skills/distributed-consensus/SKILL.md +141 -0
- package/.mindforge/skills/dmux-workflows/SKILL.md +141 -0
- package/.mindforge/skills/dns-architecture/SKILL.md +167 -0
- package/.mindforge/skills/doc-health-audit/SKILL.md +102 -0
- package/.mindforge/skills/ecommerce-architecture/SKILL.md +41 -0
- package/.mindforge/skills/edge-computing/SKILL.md +91 -0
- package/.mindforge/skills/edtech-platform/SKILL.md +41 -0
- package/.mindforge/skills/email-deliverability/SKILL.md +177 -0
- package/.mindforge/skills/embedding-systems/SKILL.md +55 -0
- package/.mindforge/skills/environment-management/SKILL.md +54 -0
- package/.mindforge/skills/error-handling-architecture/SKILL.md +118 -0
- package/.mindforge/skills/estimation-techniques/SKILL.md +113 -0
- package/.mindforge/skills/eval-harness/SKILL.md +180 -0
- package/.mindforge/skills/event-driven-architecture/SKILL.md +162 -0
- package/.mindforge/skills/experiment-design/SKILL.md +139 -0
- package/.mindforge/skills/experiment-platform/SKILL.md +43 -0
- package/.mindforge/skills/feature-engineering/SKILL.md +42 -0
- package/.mindforge/skills/feature-flag-management/SKILL.md +183 -0
- package/.mindforge/skills/fine-tuning-workflow/SKILL.md +189 -0
- package/.mindforge/skills/fintech-patterns/SKILL.md +41 -0
- package/.mindforge/skills/flutter-architecture/SKILL.md +42 -0
- package/.mindforge/skills/gaming-backend/SKILL.md +41 -0
- package/.mindforge/skills/git-workflow-design/SKILL.md +129 -0
- package/.mindforge/skills/graceful-degradation/SKILL.md +95 -0
- package/.mindforge/skills/graphql-patterns/SKILL.md +243 -0
- package/.mindforge/skills/guardrails-and-safety/SKILL.md +137 -0
- package/.mindforge/skills/healthcare-systems/SKILL.md +40 -0
- package/.mindforge/skills/hiring-engineering/SKILL.md +119 -0
- package/.mindforge/skills/human-in-the-loop-design/SKILL.md +234 -0
- package/.mindforge/skills/i18n-architecture/SKILL.md +147 -0
- package/.mindforge/skills/idempotency-patterns/SKILL.md +84 -0
- package/.mindforge/skills/incident-communication/SKILL.md +96 -0
- package/.mindforge/skills/incident-management/SKILL.md +97 -0
- package/.mindforge/skills/infrastructure-as-code/SKILL.md +98 -0
- package/.mindforge/skills/instinct-clustering/SKILL.md +190 -0
- package/.mindforge/skills/internal-developer-platform/SKILL.md +51 -0
- package/.mindforge/skills/iot-platform/SKILL.md +41 -0
- package/.mindforge/skills/k8s-deployment/SKILL.md +358 -0
- package/.mindforge/skills/knowledge-graphs/SKILL.md +56 -0
- package/.mindforge/skills/knowledge-sharing-systems/SKILL.md +112 -0
- package/.mindforge/skills/llm-cost-optimization/SKILL.md +198 -0
- package/.mindforge/skills/llm-orchestration/SKILL.md +56 -0
- package/.mindforge/skills/load-testing/SKILL.md +84 -0
- package/.mindforge/skills/logistics-optimization/SKILL.md +40 -0
- package/.mindforge/skills/market-researcher/SKILL.md +99 -0
- package/.mindforge/skills/marketplace-trust/SKILL.md +40 -0
- package/.mindforge/skills/mcp-server-patterns/SKILL.md +264 -0
- package/.mindforge/skills/media-streaming/SKILL.md +41 -0
- package/.mindforge/skills/meeting-architecture/SKILL.md +146 -0
- package/.mindforge/skills/mentoring-patterns/SKILL.md +77 -0
- package/.mindforge/skills/microservices-patterns/SKILL.md +83 -0
- package/.mindforge/skills/migration-platform/SKILL.md +61 -0
- package/.mindforge/skills/migration-strategies/SKILL.md +129 -0
- package/.mindforge/skills/ml-feature-store/SKILL.md +56 -0
- package/.mindforge/skills/ml-monitoring/SKILL.md +42 -0
- package/.mindforge/skills/mobile-performance/SKILL.md +44 -0
- package/.mindforge/skills/mobile-security/SKILL.md +45 -0
- package/.mindforge/skills/model-evaluation/SKILL.md +53 -0
- package/.mindforge/skills/monorepo-management/SKILL.md +100 -0
- package/.mindforge/skills/multi-llm-consult/SKILL.md +75 -0
- package/.mindforge/skills/multi-tenancy-patterns/SKILL.md +145 -0
- package/.mindforge/skills/multi-turn-conversation-design/SKILL.md +206 -0
- package/.mindforge/skills/multimodal-ai/SKILL.md +51 -0
- package/.mindforge/skills/mutation-testing/SKILL.md +97 -0
- package/.mindforge/skills/notification-system-design/SKILL.md +168 -0
- package/.mindforge/skills/observability-stack/SKILL.md +136 -0
- package/.mindforge/skills/offline-first-design/SKILL.md +43 -0
- package/.mindforge/skills/on-call-design/SKILL.md +111 -0
- package/.mindforge/skills/pagination-patterns/SKILL.md +230 -0
- package/.mindforge/skills/payment-integration/SKILL.md +176 -0
- package/.mindforge/skills/performance-reviews/SKILL.md +140 -0
- package/.mindforge/skills/platform-observability/SKILL.md +58 -0
- package/.mindforge/skills/platform-reliability/SKILL.md +52 -0
- package/.mindforge/skills/post-incident-learning/SKILL.md +96 -0
- package/.mindforge/skills/product-manager/SKILL.md +104 -0
- package/.mindforge/skills/progressive-web-app/SKILL.md +44 -0
- package/.mindforge/skills/prompt-engineering/SKILL.md +94 -0
- package/.mindforge/skills/proofreader/SKILL.md +158 -0
- package/.mindforge/skills/push-notification-architecture/SKILL.md +45 -0
- package/.mindforge/skills/python-performance/SKILL.md +183 -0
- package/.mindforge/skills/quality-audit/SKILL.md +171 -0
- package/.mindforge/skills/queue-design/SKILL.md +85 -0
- package/.mindforge/skills/rag-architecture/SKILL.md +176 -0
- package/.mindforge/skills/rate-limiting-design/SKILL.md +94 -0
- package/.mindforge/skills/react-native-patterns/SKILL.md +42 -0
- package/.mindforge/skills/react-performance/SKILL.md +229 -0
- package/.mindforge/skills/real-time-analytics/SKILL.md +42 -0
- package/.mindforge/skills/real-time-sync/SKILL.md +83 -0
- package/.mindforge/skills/responsive-native/SKILL.md +44 -0
- package/.mindforge/skills/responsive-patterns/SKILL.md +141 -0
- package/.mindforge/skills/rfc-pipeline/SKILL.md +114 -0
- package/.mindforge/skills/saas-multi-tenant/SKILL.md +41 -0
- package/.mindforge/skills/santa-method/SKILL.md +134 -0
- package/.mindforge/skills/search-implementation/SKILL.md +98 -0
- package/.mindforge/skills/secrets-platform/SKILL.md +56 -0
- package/.mindforge/skills/secrets-rotation/SKILL.md +173 -0
- package/.mindforge/skills/self-serve-infrastructure/SKILL.md +51 -0
- package/.mindforge/skills/serverless-patterns/SKILL.md +119 -0
- package/.mindforge/skills/skill-creator-meta/SKILL.md +146 -0
- package/.mindforge/skills/sprint-retrospective-facilitation/SKILL.md +112 -0
- package/.mindforge/skills/stakeholder-communication/SKILL.md +85 -0
- package/.mindforge/skills/state-management/SKILL.md +104 -0
- package/.mindforge/skills/stream-processing/SKILL.md +43 -0
- package/.mindforge/skills/streaming-architecture/SKILL.md +81 -0
- package/.mindforge/skills/supply-chain-security/SKILL.md +145 -0
- package/.mindforge/skills/synthetic-data-generation/SKILL.md +52 -0
- package/.mindforge/skills/system-design/SKILL.md +88 -0
- package/.mindforge/skills/team-topology-design/SKILL.md +107 -0
- package/.mindforge/skills/technical-debt-management/SKILL.md +86 -0
- package/.mindforge/skills/technical-interview-design/SKILL.md +98 -0
- package/.mindforge/skills/technical-leadership/SKILL.md +75 -0
- package/.mindforge/skills/technical-writing/SKILL.md +237 -0
- package/.mindforge/skills/technology-radar/SKILL.md +88 -0
- package/.mindforge/skills/testing-anti-patterns/SKILL.md +288 -0
- package/.mindforge/skills/threat-modeling/SKILL.md +109 -0
- package/.mindforge/skills/tool-design/SKILL.md +138 -0
- package/.mindforge/skills/typescript-advanced/SKILL.md +198 -0
- package/.mindforge/skills/using-git-worktrees/SKILL.md +139 -0
- package/.mindforge/skills/verification-loop/SKILL.md +97 -0
- package/.mindforge/skills/vibe-security/SKILL.md +165 -0
- package/.mindforge/skills/visual-regression-testing/SKILL.md +97 -0
- package/.mindforge/skills/websocket-patterns/SKILL.md +203 -0
- package/.mindforge/skills/writing-plans/SKILL.md +170 -0
- package/.mindforge/skills/writing-skills/SKILL.md +216 -0
- package/.mindforge/skills/zero-trust-architecture/SKILL.md +166 -0
- package/CHANGELOG.md +195 -0
- package/MINDFORGE.md +4 -4
- package/README.md +2 -2
- package/RELEASENOTES.md +66 -0
- package/bin/installer-core.js +1 -1
- package/bin/wizard/theme.js +2 -2
- package/docs/commands-reference.md +18 -1
- package/package.json +2 -2
- package/.mindforge/personas/data-privacy-engineer.md +0 -187
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: graceful-degradation
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.0.9
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: graceful degradation, circuit breaker cascade, fallback hierarchy, reduced functionality mode, health-based routing, partial availability, degraded response, feature shedding, load shedding, priority-based degradation, degradation strategy, availability tier
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Skill — Graceful Degradation
|
|
10
|
+
|
|
11
|
+
## When this skill activates
|
|
12
|
+
Any task involving resilience under failure, circuit breakers, fallback hierarchies,
|
|
13
|
+
load shedding, feature shedding, or priority-based degradation design.
|
|
14
|
+
|
|
15
|
+
## Mandatory actions when this skill is active
|
|
16
|
+
|
|
17
|
+
### Before writing any code
|
|
18
|
+
1. Classify all features into availability tiers (critical/important/nice-to-have).
|
|
19
|
+
2. Define fallback hierarchy for each external dependency.
|
|
20
|
+
3. Identify degradation triggers and corresponding responses.
|
|
21
|
+
|
|
22
|
+
### During implementation
|
|
23
|
+
- Circuit breakers on all external service calls.
|
|
24
|
+
- Fallback responses for every dependency (cache → static → error).
|
|
25
|
+
- Feature flags to disable non-critical features under load.
|
|
26
|
+
- Load shedding with priority-based request classification.
|
|
27
|
+
|
|
28
|
+
### After implementation
|
|
29
|
+
- Chaos test: kill dependencies, spike load, verify partial functionality.
|
|
30
|
+
- Verify system remains usable when any single dependency fails.
|
|
31
|
+
- Document degradation playbook for on-call.
|
|
32
|
+
|
|
33
|
+
## Availability Tiers
|
|
34
|
+
|
|
35
|
+
| Tier | Policy | Examples |
|
|
36
|
+
|------|--------|----------|
|
|
37
|
+
| Tier 1: Critical | Never shed | Auth, payments, data persistence, core API |
|
|
38
|
+
| Tier 2: Important | Shed under extreme load | Search, recommendations, notifications |
|
|
39
|
+
| Tier 3: Nice-to-have | Shed early | Personalization, A/B tracking, social features |
|
|
40
|
+
|
|
41
|
+
## Load Shedding
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Priority 1 (Critical): Health checks, auth, payment finalization
|
|
45
|
+
Priority 2 (High): Core reads/writes, search
|
|
46
|
+
Priority 3 (Normal): Recommendations, analytics, batch
|
|
47
|
+
Priority 4 (Low): Prefetching, enrichment, non-critical webhooks
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- At 80% capacity: reject P4. At 90%: reject P3+P4. At 95%: P1 only.
|
|
51
|
+
- Return 503 with `Retry-After`. Never reject P1 (that means full outage).
|
|
52
|
+
|
|
53
|
+
## Fallback Hierarchies
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Live data → Cached (recent) → Static default → Graceful error (hide widget)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
- Each level independently deployable and testable.
|
|
60
|
+
- Fallback data pre-computed and stored close to consumer.
|
|
61
|
+
- Never let fallback failure cascade. Log fallback frequency as health signal.
|
|
62
|
+
|
|
63
|
+
## Circuit Breaker Design
|
|
64
|
+
|
|
65
|
+
- **Closed** (normal): requests flow, track failure rate.
|
|
66
|
+
- **Open** (tripped): return fallback immediately, no calls to dependency.
|
|
67
|
+
- **Half-Open** (probing): allow 1 request to test recovery.
|
|
68
|
+
- Config: 5 failures/30s → OPEN, 30s timeout → HALF-OPEN, 3 successes → CLOSED.
|
|
69
|
+
|
|
70
|
+
### Cascade Prevention
|
|
71
|
+
- Timeout hierarchy: A→B=2s, B→C=500ms. When C trips in B, B returns fallback to A.
|
|
72
|
+
- A never sees C's failure — only potentially degraded but fast responses from B.
|
|
73
|
+
|
|
74
|
+
## Health-Based Routing
|
|
75
|
+
- Each instance reports health score (0-100) based on CPU, errors, latency, memory.
|
|
76
|
+
- Score >80: full traffic. 50-80: reduced traffic. <50: no new traffic, drain.
|
|
77
|
+
|
|
78
|
+
## Feature Shedding (Shed First)
|
|
79
|
+
1. Search-as-you-type / autocomplete.
|
|
80
|
+
2. Personalized recommendations (ML model calls).
|
|
81
|
+
3. Real-time analytics / activity feeds.
|
|
82
|
+
4. Image/video transcoding.
|
|
83
|
+
5. Non-critical webhooks.
|
|
84
|
+
|
|
85
|
+
Automated via feature flags tied to system load. Re-enable gradually after recovery.
|
|
86
|
+
|
|
87
|
+
## Self-check before task completion
|
|
88
|
+
|
|
89
|
+
- [ ] Are all features classified into availability tiers?
|
|
90
|
+
- [ ] Is there a fallback for every dependency (cache → static → error)?
|
|
91
|
+
- [ ] Are circuit breakers on all external calls?
|
|
92
|
+
- [ ] Is load shedding priority-based with correct request classification?
|
|
93
|
+
- [ ] Does the system remain usable when any single dependency fails?
|
|
94
|
+
- [ ] Are feature flags in place for non-critical shedding?
|
|
95
|
+
- [ ] Is the degradation playbook documented for on-call?
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: graphql-patterns
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 0.3.0
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: graphql pattern, schema design graphql, resolver architecture, N+1 dataloader, graphql subscription, graphql federation, persisted query, graphql pagination, graphql error handling, schema stitching, graphql caching, type-safe graphql
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Skill — GraphQL Patterns
|
|
10
|
+
|
|
11
|
+
## When this skill activates
|
|
12
|
+
Any task involving GraphQL schema design, resolver implementation, DataLoader usage,
|
|
13
|
+
subscriptions, federation, or GraphQL performance optimization.
|
|
14
|
+
|
|
15
|
+
## Mandatory actions when this skill is active
|
|
16
|
+
|
|
17
|
+
### Before designing a GraphQL API
|
|
18
|
+
1. Identify the domain entities and their relationships.
|
|
19
|
+
2. Consider consumer needs (what data do clients actually fetch together?).
|
|
20
|
+
3. Plan the pagination strategy for all list fields.
|
|
21
|
+
|
|
22
|
+
### Schema design principles
|
|
23
|
+
|
|
24
|
+
**Entity types:**
|
|
25
|
+
```graphql
|
|
26
|
+
type User {
|
|
27
|
+
id: ID!
|
|
28
|
+
email: String!
|
|
29
|
+
name: String!
|
|
30
|
+
createdAt: DateTime!
|
|
31
|
+
orders(first: Int, after: String): OrderConnection!
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Input types for mutations:**
|
|
36
|
+
```graphql
|
|
37
|
+
input CreateUserInput {
|
|
38
|
+
email: String!
|
|
39
|
+
name: String!
|
|
40
|
+
password: String!
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
type CreateUserPayload {
|
|
44
|
+
user: User
|
|
45
|
+
errors: [ValidationError!]!
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Enum for fixed sets:**
|
|
50
|
+
```graphql
|
|
51
|
+
enum OrderStatus {
|
|
52
|
+
PENDING
|
|
53
|
+
PROCESSING
|
|
54
|
+
SHIPPED
|
|
55
|
+
DELIVERED
|
|
56
|
+
CANCELLED
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Rules:**
|
|
61
|
+
- Never expose database columns directly (abstract the data model).
|
|
62
|
+
- Use non-nullable (!) for fields that always have a value.
|
|
63
|
+
- Mutations return the modified entity (not just success/failure).
|
|
64
|
+
- Input types are separate from output types (different validation needs).
|
|
65
|
+
- Use Connections (not arrays) for all list fields.
|
|
66
|
+
|
|
67
|
+
### N+1 problem and DataLoader
|
|
68
|
+
|
|
69
|
+
**The problem:**
|
|
70
|
+
```
|
|
71
|
+
Query: { users { orders { items } } }
|
|
72
|
+
1 query for users
|
|
73
|
+
N queries for orders (one per user)
|
|
74
|
+
N*M queries for items (one per order)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**The solution — DataLoader:**
|
|
78
|
+
```javascript
|
|
79
|
+
const orderLoader = new DataLoader(async (userIds) => {
|
|
80
|
+
// ONE query for ALL user IDs
|
|
81
|
+
const orders = await db.orders.findMany({ where: { userId: { in: userIds } } });
|
|
82
|
+
// Map results back to the correct user
|
|
83
|
+
return userIds.map(id => orders.filter(o => o.userId === id));
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// In resolver
|
|
87
|
+
resolve(user) {
|
|
88
|
+
return orderLoader.load(user.id);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Rules:**
|
|
93
|
+
- Use DataLoader for ALL nested resolvers that fetch from a data source.
|
|
94
|
+
- Create a new DataLoader instance per request (request-scoped caching).
|
|
95
|
+
- Batch window is one tick of the event loop.
|
|
96
|
+
- DataLoader handles both batching AND per-request caching.
|
|
97
|
+
|
|
98
|
+
### Pagination (Relay Connection spec)
|
|
99
|
+
|
|
100
|
+
```graphql
|
|
101
|
+
type OrderConnection {
|
|
102
|
+
edges: [OrderEdge!]!
|
|
103
|
+
pageInfo: PageInfo!
|
|
104
|
+
totalCount: Int
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
type OrderEdge {
|
|
108
|
+
node: Order!
|
|
109
|
+
cursor: String!
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
type PageInfo {
|
|
113
|
+
hasNextPage: Boolean!
|
|
114
|
+
hasPreviousPage: Boolean!
|
|
115
|
+
startCursor: String
|
|
116
|
+
endCursor: String
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Implementation:**
|
|
121
|
+
- Cursor = opaque base64-encoded value (e.g., `base64(id:123)`).
|
|
122
|
+
- Forward pagination: `first` + `after` (cursor).
|
|
123
|
+
- Backward pagination: `last` + `before` (cursor).
|
|
124
|
+
- totalCount is optional (expensive on large tables — make nullable).
|
|
125
|
+
|
|
126
|
+
### Subscriptions
|
|
127
|
+
|
|
128
|
+
**Transport:** WebSocket (graphql-ws protocol).
|
|
129
|
+
|
|
130
|
+
**Design rules:**
|
|
131
|
+
- Filter server-side, not client-side (don't push all events to all clients).
|
|
132
|
+
- Rate-limit expensive subscriptions (e.g., max 1 update per second).
|
|
133
|
+
- Include subscription-specific authentication (WebSocket auth on connection_init).
|
|
134
|
+
- Handle reconnection gracefully (client should re-subscribe on disconnect).
|
|
135
|
+
|
|
136
|
+
**Example:**
|
|
137
|
+
```graphql
|
|
138
|
+
type Subscription {
|
|
139
|
+
orderStatusChanged(orderId: ID!): Order!
|
|
140
|
+
newMessage(channelId: ID!): Message!
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Backend:**
|
|
145
|
+
- Use pub/sub (Redis, Kafka) for horizontal scaling.
|
|
146
|
+
- Single server: in-memory EventEmitter is fine for development.
|
|
147
|
+
- Production: external pub/sub so any server instance can publish.
|
|
148
|
+
|
|
149
|
+
### Federation (microservices)
|
|
150
|
+
|
|
151
|
+
**Split schema by domain team:**
|
|
152
|
+
```graphql
|
|
153
|
+
# Users service
|
|
154
|
+
type User @key(fields: "id") {
|
|
155
|
+
id: ID!
|
|
156
|
+
email: String!
|
|
157
|
+
name: String!
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
# Orders service (extends User from users service)
|
|
161
|
+
extend type User @key(fields: "id") {
|
|
162
|
+
id: ID! @external
|
|
163
|
+
orders: [Order!]!
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Rules:**
|
|
168
|
+
- Each service owns its types and resolvers.
|
|
169
|
+
- `@key` directive defines how entities are referenced across services.
|
|
170
|
+
- Gateway (Apollo Router, Cosmo) composes the supergraph.
|
|
171
|
+
- Services must resolve `__resolveReference` for federated entities.
|
|
172
|
+
- Schema changes require composition check in CI (schema registry).
|
|
173
|
+
|
|
174
|
+
### Persisted queries
|
|
175
|
+
|
|
176
|
+
**How it works:**
|
|
177
|
+
- Build time: extract all queries from client code, hash each one.
|
|
178
|
+
- Client sends hash (not full query text) in production.
|
|
179
|
+
- Server looks up query by hash from allowlist.
|
|
180
|
+
|
|
181
|
+
**Benefits:**
|
|
182
|
+
- Smaller request payloads (hash vs full query text).
|
|
183
|
+
- Prevents arbitrary queries (only allowlisted hashes accepted).
|
|
184
|
+
- CDN caching possible (GET requests with query hash as key).
|
|
185
|
+
|
|
186
|
+
**Implementation:**
|
|
187
|
+
- Use `graphql-codegen` or `relay-compiler` to extract and hash.
|
|
188
|
+
- Reject unknown hashes in production (security hardening).
|
|
189
|
+
- Allow full queries in development for iteration speed.
|
|
190
|
+
|
|
191
|
+
### Error handling
|
|
192
|
+
|
|
193
|
+
```graphql
|
|
194
|
+
type Mutation {
|
|
195
|
+
createOrder(input: CreateOrderInput!): CreateOrderPayload!
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
type CreateOrderPayload {
|
|
199
|
+
order: Order
|
|
200
|
+
errors: [UserError!]!
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
type UserError {
|
|
204
|
+
field: [String!]
|
|
205
|
+
message: String!
|
|
206
|
+
code: ErrorCode!
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Rules:**
|
|
211
|
+
- Use payload types with `errors` field for expected user errors (validation, business logic).
|
|
212
|
+
- Use GraphQL errors (top-level `errors` array) only for unexpected failures.
|
|
213
|
+
- Never expose internal error details (stack traces, SQL errors) to clients.
|
|
214
|
+
- Include error codes (enum) for programmatic client handling.
|
|
215
|
+
|
|
216
|
+
### Caching
|
|
217
|
+
|
|
218
|
+
**HTTP caching (persisted queries via GET):**
|
|
219
|
+
- Cache-Control headers on responses.
|
|
220
|
+
- CDN caching for public, non-personalized queries.
|
|
221
|
+
|
|
222
|
+
**Normalized client cache (Apollo Client, urql):**
|
|
223
|
+
- Entities cached by `__typename + id`.
|
|
224
|
+
- Mutations automatically update cache when returning modified entities.
|
|
225
|
+
- Use `cache.evict()` for deletions.
|
|
226
|
+
|
|
227
|
+
**Server-side (DataLoader per-request + Redis):**
|
|
228
|
+
- DataLoader: automatic per-request deduplication.
|
|
229
|
+
- Redis: cross-request caching for expensive computations.
|
|
230
|
+
- Set appropriate TTL based on data freshness requirements.
|
|
231
|
+
|
|
232
|
+
### Type safety (end-to-end)
|
|
233
|
+
|
|
234
|
+
- Generate TypeScript types from schema: `graphql-codegen`.
|
|
235
|
+
- Generate typed hooks for client queries: `@graphql-codegen/typescript-react-apollo`.
|
|
236
|
+
- Schema-first development: change schema → regenerate types → compiler catches mismatches.
|
|
237
|
+
- CI check: generated types must be up to date (no uncommitted codegen changes).
|
|
238
|
+
|
|
239
|
+
## Self-check before task completion
|
|
240
|
+
- [ ] Did I follow the mandatory actions for this skill?
|
|
241
|
+
- [ ] Did I apply the patterns appropriate to the context?
|
|
242
|
+
- [ ] Did I verify the implementation meets the criteria above?
|
|
243
|
+
- [ ] Did I document decisions and trade-offs made?
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: guardrails-and-safety
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.0.7
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: guardrails, ai safety layer, hallucination detection, output validation layer, content filtering, ai boundary enforcement, graceful degradation pattern, confidence calibration, refusal pattern, safety guardrail, output quality gate, ai output control
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Guardrails and Safety
|
|
10
|
+
|
|
11
|
+
## When this skill activates
|
|
12
|
+
|
|
13
|
+
This skill activates when designing safety layers for AI systems, validating AI outputs, detecting hallucinations, filtering harmful content, enforcing behavioral boundaries, or implementing graceful degradation. Use this skill whenever AI-generated output is consumed by users or downstream systems and correctness, safety, or trustworthiness is a requirement.
|
|
14
|
+
|
|
15
|
+
## Mandatory actions when this skill is active
|
|
16
|
+
|
|
17
|
+
### Before
|
|
18
|
+
|
|
19
|
+
1. **Risk assessment** — Classify the risk level of the AI output. High risk: medical/legal/financial advice, code that handles money/auth, user-facing claims. Low risk: internal summaries, creative brainstorming, non-critical formatting.
|
|
20
|
+
2. **Define failure modes** — Enumerate what can go wrong: hallucinated facts, malformed output, harmful content, scope creep, leaked system prompts, confidently wrong answers.
|
|
21
|
+
3. **Identify stakeholders** — Who consumes this output? End users, other AI agents, automated systems? Each requires different guardrail approaches.
|
|
22
|
+
4. **Establish ground truth** — Determine what sources can be used to verify AI claims. No verification source = higher hallucination risk.
|
|
23
|
+
|
|
24
|
+
### During
|
|
25
|
+
|
|
26
|
+
#### Output Validation (Schema Check, Reference Grounding, Claim Verification)
|
|
27
|
+
|
|
28
|
+
**Schema validation:**
|
|
29
|
+
- Parse all structured outputs through a schema validator (Zod, Pydantic, JSON Schema).
|
|
30
|
+
- Reject outputs that don't conform. Never silently accept malformed data.
|
|
31
|
+
- Validate semantic constraints beyond syntax: dates in the past, IDs that exist, values within valid ranges.
|
|
32
|
+
|
|
33
|
+
**Reference grounding:**
|
|
34
|
+
- For factual claims, require the AI to cite specific sources from the provided context.
|
|
35
|
+
- Verify citations actually exist in the context window. Reject fabricated references.
|
|
36
|
+
- Cross-reference extracted facts against the source document. Flag discrepancies.
|
|
37
|
+
|
|
38
|
+
**Claim verification pipeline:**
|
|
39
|
+
```
|
|
40
|
+
AI Output → Extract claims → Match claims to source → Score confidence → Flag ungrounded claims
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- Claims with no source match receive a "unverified" flag.
|
|
44
|
+
- Claims contradicting source receive a "contradicted" flag.
|
|
45
|
+
- Only claims with verified source matches pass without flags.
|
|
46
|
+
|
|
47
|
+
#### Hallucination Detection
|
|
48
|
+
|
|
49
|
+
- **Citation requirement** — For factual tasks, require inline citations: "[from file.ts:42]". Absence of citations on factual claims is a hallucination signal.
|
|
50
|
+
- **Self-consistency check** — Ask the same question multiple times (temperature > 0). If answers diverge significantly, confidence should be low.
|
|
51
|
+
- **Source comparison** — Compare AI output against retrieved context. Claims not present in context are hallucination candidates.
|
|
52
|
+
- **Knowledge boundary awareness** — Train the system to say "I don't have information about X" rather than fabricate. Reward refusal over confabulation.
|
|
53
|
+
- **Confidence scoring** — Implement a scoring function:
|
|
54
|
+
- 1.0: Directly quoted from source
|
|
55
|
+
- 0.8: Clearly supported by source
|
|
56
|
+
- 0.5: Plausible inference from source
|
|
57
|
+
- 0.2: Not supported, model's general knowledge
|
|
58
|
+
- 0.0: Contradicts available evidence
|
|
59
|
+
|
|
60
|
+
#### Content Filtering
|
|
61
|
+
|
|
62
|
+
**PII detection:**
|
|
63
|
+
- Scan outputs for patterns: email addresses, phone numbers, SSNs, credit card numbers, physical addresses.
|
|
64
|
+
- Use regex for structured PII + NER models for unstructured PII (names, locations in context).
|
|
65
|
+
- Action: redact, mask, or block output containing PII not explicitly requested.
|
|
66
|
+
|
|
67
|
+
**Toxicity filtering:**
|
|
68
|
+
- Apply toxicity classifiers to AI outputs before delivery.
|
|
69
|
+
- Threshold: block outputs scoring above toxicity threshold (adjust per use case).
|
|
70
|
+
- Log blocked outputs for review and model improvement.
|
|
71
|
+
|
|
72
|
+
**Off-topic detection:**
|
|
73
|
+
- Compare output topic to the requested task.
|
|
74
|
+
- If the AI produces content unrelated to the request, it may be following injected instructions.
|
|
75
|
+
- Action: flag for review, re-generate with stronger constraints.
|
|
76
|
+
|
|
77
|
+
#### Boundary Enforcement (Scope Limits, Capability Declaration)
|
|
78
|
+
|
|
79
|
+
- **Capability declaration** — The system prompt must explicitly state what the AI can and cannot do. This is not optional.
|
|
80
|
+
- **Scope fencing** — Define topics/actions that are in-scope vs out-of-scope. Out-of-scope requests receive a structured refusal, not an attempt.
|
|
81
|
+
- **Action restrictions** — List dangerous actions the AI must never take (delete production data, send emails without confirmation, execute unreviewed code).
|
|
82
|
+
- **Escalation triggers** — Define conditions that require human review before proceeding: confidence below threshold, ambiguous instructions, high-impact actions.
|
|
83
|
+
|
|
84
|
+
**Boundary enforcement template:**
|
|
85
|
+
```
|
|
86
|
+
You CAN: [list of permitted capabilities]
|
|
87
|
+
You CANNOT: [list of restricted capabilities]
|
|
88
|
+
When uncertain: [escalation procedure]
|
|
89
|
+
When asked to do something restricted: [refusal response]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### Graceful Degradation
|
|
93
|
+
|
|
94
|
+
- **Partial answer over no answer** — If the AI can answer part of the question confidently, provide that part and explicitly flag what it cannot answer.
|
|
95
|
+
- **Confidence flagging** — Prefix uncertain claims with qualifiers: "Based on the provided context...", "I'm not certain, but...", "This may be incomplete because..."
|
|
96
|
+
- **Fallback hierarchy:**
|
|
97
|
+
1. Full confident answer (ideal)
|
|
98
|
+
2. Partial answer with uncertainty flags (acceptable)
|
|
99
|
+
3. Structured "I cannot answer because..." (acceptable)
|
|
100
|
+
4. Silent failure or confident wrong answer (unacceptable)
|
|
101
|
+
- **Degradation transparency** — Always tell the user what information is missing and why the answer may be incomplete.
|
|
102
|
+
|
|
103
|
+
#### Confidence Calibration
|
|
104
|
+
|
|
105
|
+
- **Calibration principle** — Expressed confidence must match actual accuracy. "Definitely" = right >95% of the time.
|
|
106
|
+
- **Banned phrases when uncertain** — "certainly", "definitely", "obviously", "without doubt" unless grounded in verified source.
|
|
107
|
+
- **Required phrases when uncertain** — "likely", "based on available information", "this appears to be", "I'm not certain but".
|
|
108
|
+
- **Metacognitive awareness** — The AI must identify gaps in its knowledge: "I don't have enough context to answer this part."
|
|
109
|
+
|
|
110
|
+
#### Refusal Patterns (When to Refuse)
|
|
111
|
+
|
|
112
|
+
**Refuse when:** harmful content requested, clearly out of scope, insufficient context with high stakes, capabilities not available, or safety boundaries would be violated.
|
|
113
|
+
|
|
114
|
+
**Refusal format:** "I cannot [action] because [reason]. What I can do instead: [alternative]."
|
|
115
|
+
|
|
116
|
+
- **Never refuse without explanation.** Always state why and offer alternatives.
|
|
117
|
+
- **Never refuse legitimate requests.** Overly cautious refusals degrade trust and usability.
|
|
118
|
+
|
|
119
|
+
### After
|
|
120
|
+
|
|
121
|
+
1. **Audit guardrail triggers** — Review what was blocked/flagged. High false-positive rate means guardrails are too aggressive.
|
|
122
|
+
2. **Measure hallucination rate** — Sample outputs and verify claims against sources. Track rate over time.
|
|
123
|
+
3. **Test adversarially** — Attempt to bypass guardrails with injection, social engineering, and edge cases. Patch gaps.
|
|
124
|
+
4. **User feedback loop** — Collect reports of incorrect outputs that passed guardrails. These are the most valuable signals.
|
|
125
|
+
|
|
126
|
+
## Self-check before task completion
|
|
127
|
+
|
|
128
|
+
- [ ] Output validation schema is defined and enforced programmatically
|
|
129
|
+
- [ ] Hallucination detection is active for factual claims (citation requirement or source comparison)
|
|
130
|
+
- [ ] PII filtering scans all user-facing outputs
|
|
131
|
+
- [ ] Capability boundaries are explicitly declared in system prompt
|
|
132
|
+
- [ ] Graceful degradation is implemented (partial answers > silent failures)
|
|
133
|
+
- [ ] Confidence calibration prevents false certainty on ungrounded claims
|
|
134
|
+
- [ ] Refusal patterns provide clear explanation and alternatives
|
|
135
|
+
- [ ] Guardrails have been tested adversarially with bypass attempts
|
|
136
|
+
- [ ] False positive rate is monitored and acceptable
|
|
137
|
+
- [ ] Escalation path exists for edge cases guardrails cannot resolve
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: healthcare-systems
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.2.0
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: healthcare system, HIPAA compliance, HL7 FHIR, PHI handling, clinical workflow, EHR integration, health data exchange, medical record system, healthcare interoperability, patient data protection, health information exchange, clinical data model
|
|
7
|
+
compose: compliance-as-code
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Skill — Healthcare Systems
|
|
11
|
+
|
|
12
|
+
## When this skill activates
|
|
13
|
+
This skill activates when designing, building, or auditing healthcare systems that handle Protected Health Information (PHI), integrate with Electronic Health Records (EHR), implement clinical workflows, or require HIPAA compliance and healthcare interoperability standards.
|
|
14
|
+
|
|
15
|
+
## Mandatory actions when this skill is active
|
|
16
|
+
|
|
17
|
+
### Before writing any code
|
|
18
|
+
1. Conduct HIPAA compliance audit: identify all PHI touchpoints (patient names, DOB, SSN, medical records, diagnoses, prescriptions) and document encryption requirements (AES-256 at rest, TLS 1.3 in transit)
|
|
19
|
+
2. Review HL7 FHIR resource specifications for all clinical data models (Patient, Observation, Condition, MedicationRequest, Encounter) and validate against FHIR R4 or R5 conformance requirements
|
|
20
|
+
3. Map clinical workflows to business requirements: patient registration, provider authentication, order entry (CPOE), medication administration records (MAR), clinical notes (SOAP), discharge summaries, and continuity of care documents (CCD)
|
|
21
|
+
|
|
22
|
+
### During implementation
|
|
23
|
+
- Implement BAA-compliant audit logging for all PHI access: capture user identity, timestamp, action type, resource accessed, IP address, and store logs in WORM (write-once-read-many) storage with 7-year retention
|
|
24
|
+
- Enforce role-based access control (RBAC) with principle of least privilege: separate roles for physicians, nurses, pharmacists, billing staff, and patients, with explicit consent workflows for data sharing between organizations
|
|
25
|
+
- Use FHIR-native authentication (SMART on FHIR) with OAuth 2.0 authorization code flow, patient-level scopes (patient/*.read), and refresh token rotation for mobile health apps
|
|
26
|
+
- Implement de-identification pipelines for research datasets: remove 18 HIPAA identifiers (names, dates, geocodes, phone numbers, medical record numbers) using regex patterns and NLP entity recognition
|
|
27
|
+
- Design interoperability interfaces using FHIR REST APIs with proper content negotiation (application/fhir+json), search parameters (?patient=123&category=vital-signs), and batch/transaction bundles for atomic operations
|
|
28
|
+
|
|
29
|
+
### After implementation
|
|
30
|
+
- Execute security testing: penetration testing for OWASP Top 10 healthcare vulnerabilities (SQL injection in patient search, XSS in clinical notes, broken authentication), vulnerability scanning, and threat modeling for ransomware/data exfiltration scenarios
|
|
31
|
+
- Validate FHIR conformance using HL7 validation tools: check resource structure, cardinality constraints, required terminology bindings (LOINC for labs, SNOMED CT for diagnoses, RxNorm for medications), and profile compliance
|
|
32
|
+
- Conduct end-to-end clinical workflow testing with real provider scenarios: patient check-in, vital signs capture, order placement, results review, prescription writing, and documentation with audit trail verification
|
|
33
|
+
|
|
34
|
+
## Self-check before task completion
|
|
35
|
+
- [ ] All PHI is encrypted at rest (AES-256) and in transit (TLS 1.3), with key management via HSM or cloud KMS
|
|
36
|
+
- [ ] Audit logs capture all PHI access events with user attribution and are tamper-evident (cryptographic hashing or blockchain anchoring)
|
|
37
|
+
- [ ] FHIR resources validate against published profiles, use standard terminologies (LOINC/SNOMED/RxNorm), and implement proper search parameters
|
|
38
|
+
- [ ] Access control enforces least privilege, requires MFA for administrative access, and implements automatic session timeouts (15 minutes idle)
|
|
39
|
+
- [ ] Business Associate Agreement (BAA) requirements are documented, including breach notification procedures and subprocessor agreements
|
|
40
|
+
- [ ] Clinical workflows have been validated by domain experts (physicians, nurses) for safety and usability
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hiring-engineering
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.3.0
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: hiring engineer, technical interview design, coding challenge creation, system design interview rubric, candidate evaluation rubric, hiring pipeline engineering, technical assessment, technical interview scorecard, take-home assignment design, hiring committee, engineering recruitment, technical screen design
|
|
7
|
+
compose:
|
|
8
|
+
- technical-interview-design
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Hiring Engineering
|
|
12
|
+
|
|
13
|
+
## When this skill activates
|
|
14
|
+
|
|
15
|
+
This skill activates when designing technical interviews, creating coding challenges, evaluating engineering candidates, building interview scorecards, designing take-home assignments, or participating in hiring committees. It applies to senior engineers, tech leads, and engineering managers responsible for growing their teams.
|
|
16
|
+
|
|
17
|
+
## Mandatory actions when this skill is active
|
|
18
|
+
|
|
19
|
+
### Before starting the hiring process
|
|
20
|
+
|
|
21
|
+
1. **Define the role requirements explicitly** — List must-have skills (e.g., 3+ years backend Go, experience with Postgres, strong testing discipline) and nice-to-have skills (e.g., distributed systems, Kubernetes). Vague requirements attract the wrong candidates.
|
|
22
|
+
2. **Identify assessment dimensions** — What are you evaluating? Common dimensions: coding ability, system design, debugging, communication, collaboration, problem-solving, learning agility. Map each interview stage to 1-2 dimensions.
|
|
23
|
+
3. **Calibrate the bar** — Look at your current top performers. What skills/behaviors do they exhibit? Use that as the hiring bar. Don't hire people you wouldn't be excited to work with.
|
|
24
|
+
4. **Design the interview pipeline** — Typical stages: recruiter screen → technical phone screen → take-home or live coding → system design → behavioral → hiring committee. Each stage filters for different signals.
|
|
25
|
+
|
|
26
|
+
### During interview design
|
|
27
|
+
|
|
28
|
+
#### Technical Phone Screen (30-45 minutes)
|
|
29
|
+
|
|
30
|
+
- **Goal** — Validate basic coding competency before investing in longer interviews. Filter out candidates who can't code at all.
|
|
31
|
+
- **Format** — 1-2 small problems (e.g., manipulate a string, traverse a tree). Real-time coding in a shared editor (CoderPad, Replit).
|
|
32
|
+
- **Pitfall** — Don't make it a LeetCode grind. Focus on practical problems similar to your day-to-day work, not algorithmic olympiad questions.
|
|
33
|
+
- **Scoring** — Pass/Fail. Pass if candidate writes working code with prompting. Fail if they can't produce a solution even with hints.
|
|
34
|
+
|
|
35
|
+
#### Coding Challenge (Take-Home or Live Coding)
|
|
36
|
+
|
|
37
|
+
**Take-Home Assignment Design:**
|
|
38
|
+
- **Scope** — Should take 2-4 hours. Respect candidate's time. Projects that take 8+ hours are disrespectful.
|
|
39
|
+
- **Realism** — Design problems that resemble actual work. Building a mini REST API is better than "implement quicksort."
|
|
40
|
+
- **Evaluation criteria** — Code correctness, test coverage, edge case handling, documentation, architecture. Provide a rubric upfront.
|
|
41
|
+
- **Pitfall** — Don't make it too open-ended. Candidates will over-engineer. Give constraints: "Use language X, don't spend more than Y hours."
|
|
42
|
+
|
|
43
|
+
**Live Coding Session:**
|
|
44
|
+
- **Duration** — 45-60 minutes. One medium-difficulty problem.
|
|
45
|
+
- **Interactivity** — Treat it as pair programming, not an exam. Ask clarifying questions, give hints if stuck, discuss tradeoffs.
|
|
46
|
+
- **What to look for** — Can they break down the problem? Write clean code? Test edge cases? Communicate their thought process?
|
|
47
|
+
- **Pitfall** — Don't stay silent while they code. Engage. The goal is to simulate real collaboration.
|
|
48
|
+
|
|
49
|
+
#### System Design Interview (60 minutes)
|
|
50
|
+
|
|
51
|
+
- **Goal** — Assess candidate's ability to design scalable, maintainable systems. Evaluates architectural thinking, tradeoff analysis, and communication.
|
|
52
|
+
- **Format** — Open-ended problem: "Design a URL shortener" or "Design a chat system." Candidate drives the conversation.
|
|
53
|
+
- **What to evaluate** — Requirements gathering, high-level architecture, component design, data model, API design, scale considerations, tradeoffs.
|
|
54
|
+
- **Pitfall** — Don't expect candidates to know your exact tech stack. If they propose Redis but you use Memcached, that's fine. The pattern matters, not the tool.
|
|
55
|
+
- **Hints to look for strength** — Do they ask clarifying questions? Do they consider scale and failure modes? Do they make tradeoffs explicit?
|
|
56
|
+
|
|
57
|
+
#### Behavioral Interview (45 minutes)
|
|
58
|
+
|
|
59
|
+
- **Goal** — Assess collaboration, communication, adaptability, conflict resolution, and learning agility.
|
|
60
|
+
- **Format** — STAR questions (Situation, Task, Action, Result): "Tell me about a time you disagreed with a teammate. How did you resolve it?"
|
|
61
|
+
- **What to evaluate** — Self-awareness, ownership, growth mindset, team orientation, handling of ambiguity.
|
|
62
|
+
- **Pitfall** — Don't accept vague answers. Probe: "What specifically did you do?" "What was the outcome?" "What would you do differently next time?"
|
|
63
|
+
|
|
64
|
+
#### Debugging/Troubleshooting Interview (Optional, 45 minutes)
|
|
65
|
+
|
|
66
|
+
- **Goal** — Assess candidate's ability to diagnose and fix production issues. Especially valuable for senior hires.
|
|
67
|
+
- **Format** — Give candidate a broken codebase or system. Ask them to identify the issue and fix it.
|
|
68
|
+
- **What to evaluate** — Debugging process, use of tools (logs, debuggers, metrics), hypothesis testing, communication.
|
|
69
|
+
- **Pitfall** — Don't make it obscure. The bug should be findable with reasonable effort (30-40 minutes).
|
|
70
|
+
|
|
71
|
+
### During candidate evaluation
|
|
72
|
+
|
|
73
|
+
#### Scorecard Design
|
|
74
|
+
|
|
75
|
+
- **Use a consistent rubric** — Each dimension (coding, system design, communication) gets a 1-4 score: 1 = Strong No, 2 = No, 3 = Yes, 4 = Strong Yes. Define what each score means.
|
|
76
|
+
- **Provide evidence, not just scores** — Don't write "Communication: 3." Write "Communication: 3 – Candidate clearly explained their architecture choices and responded well to probing questions."
|
|
77
|
+
- **Avoid bias** — Don't let the candidate's similarity to you inflate scores. Evaluate against the rubric, not your personal preferences.
|
|
78
|
+
- **Distinguish between "not demonstrated" and "weak"** — If the candidate didn't have a chance to show a skill (e.g., debugging wasn't tested), mark it as "N/A," not a low score.
|
|
79
|
+
|
|
80
|
+
#### Hiring Committee Best Practices
|
|
81
|
+
|
|
82
|
+
- **All interviewers submit scorecards before the meeting** — Prevents groupthink. If everyone reads each other's feedback first, later voters anchor on early opinions.
|
|
83
|
+
- **Discuss discrepancies first** — If one interviewer gave a Strong Yes and another gave a No, discuss why before discussing the overall hire/no-hire decision.
|
|
84
|
+
- **Avoid "they're not a culture fit" as a veto reason** — That phrase often masks unconscious bias. Be specific: what behavior or value misalignment did you observe?
|
|
85
|
+
- **Use the "would you want this person on your team?" test** — If the answer is no, it's a no-hire. Hiring mediocre engineers lowers the bar and demoralizes high performers.
|
|
86
|
+
|
|
87
|
+
#### Red Flags in Candidates
|
|
88
|
+
|
|
89
|
+
- **Can't explain their own code** — If they wrote it but can't articulate the reasoning, they likely copy-pasted.
|
|
90
|
+
- **Blames teammates for failures** — "My team was slow, so the project failed." Red flag for collaboration and ownership.
|
|
91
|
+
- **Doesn't ask clarifying questions** — Jumps into coding without understanding requirements. Shows poor communication and product sense.
|
|
92
|
+
- **Over-engineers simple problems** — Proposes microservices for a CRUD app. Shows lack of pragmatism.
|
|
93
|
+
- **Dismissive of feedback** — When given a hint or suggestion, becomes defensive. Shows poor learning agility.
|
|
94
|
+
|
|
95
|
+
#### Green Flags in Candidates
|
|
96
|
+
|
|
97
|
+
- **Admits when they don't know** — "I haven't used Kubernetes, but here's how I'd approach learning it." Shows humility and learning agility.
|
|
98
|
+
- **Communicates tradeoffs clearly** — "Option A is faster but harder to maintain. Option B is slower but more reliable." Shows architectural maturity.
|
|
99
|
+
- **Writes tests without prompting** — Shows quality-first mindset.
|
|
100
|
+
- **Asks insightful questions** — About architecture, team culture, technical challenges. Shows genuine interest.
|
|
101
|
+
- **Handles ambiguity well** — When the problem is open-ended, they ask clarifying questions and propose a structured approach.
|
|
102
|
+
|
|
103
|
+
### After interviews
|
|
104
|
+
|
|
105
|
+
- **Debrief immediately** — Submit scorecards within 24 hours while memory is fresh. Delayed feedback loses fidelity.
|
|
106
|
+
- **Provide candidate feedback (if rejected)** — Not legally required, but considerate. Keep it high-level: "We were looking for more depth in system design." Don't critique their personality.
|
|
107
|
+
- **Track hiring pipeline metrics** — Pass rates at each stage, time to hire, offer acceptance rate, source of hire (referrals, LinkedIn, etc.). Optimize the bottlenecks.
|
|
108
|
+
- **Improve interview questions over time** — If a question doesn't differentiate strong vs weak candidates, retire it. Iterate based on hiring outcomes.
|
|
109
|
+
|
|
110
|
+
## Self-check before task completion
|
|
111
|
+
|
|
112
|
+
- [ ] Role requirements are explicit with must-have and nice-to-have skills
|
|
113
|
+
- [ ] Assessment dimensions are mapped to specific interview stages
|
|
114
|
+
- [ ] Interview pipeline is designed with clear goals for each stage
|
|
115
|
+
- [ ] Take-home assignments are scoped to 2-4 hours with clear evaluation criteria
|
|
116
|
+
- [ ] System design interviews focus on tradeoff analysis, not memorized solutions
|
|
117
|
+
- [ ] Scorecards use a consistent rubric with evidence, not just scores
|
|
118
|
+
- [ ] Hiring committee reviews scorecards independently before group discussion
|
|
119
|
+
- [ ] Red flags (can't explain own code, blames teammates) are documented and weighted appropriately
|