mindforge-cc 10.0.3 → 11.0.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/MINDFORGE-V2-SCHEMA.json +43 -10
- package/.mindforge/config.json +30 -2
- package/.mindforge/engine/cross-model-eval.md +74 -0
- package/.mindforge/engine/proactive/signal-detector.md +60 -0
- package/.mindforge/engine/proactive/suggestion-engine.md +100 -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/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/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/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-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 +674 -44
- 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/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-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/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/contract-testing/SKILL.md +85 -0
- package/.mindforge/skills/cost-estimation/SKILL.md +82 -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/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-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/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 +13 -1
- 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 +240 -0
- package/MINDFORGE.md +4 -4
- package/README.md +49 -4
- package/RELEASENOTES.md +80 -0
- package/SECURITY.md +20 -8
- package/bin/autonomous/audit-writer.js +13 -0
- package/bin/autonomous/auto-runner.js +74 -16
- package/bin/autonomous/context-refactorer.js +26 -11
- package/bin/autonomous/state-manager.js +62 -6
- package/bin/autonomous/stuck-monitor.js +46 -7
- package/bin/autonomous/wave-executor.js +66 -25
- package/bin/dashboard/api-router.js +43 -0
- package/bin/dashboard/metrics-aggregator.js +28 -1
- package/bin/dashboard/server.js +67 -4
- package/bin/dashboard/sse-bridge.js +4 -4
- package/bin/engine/feedback-loop.js +8 -0
- package/bin/engine/intelligence-interlock.js +32 -15
- package/bin/engine/logic-drift-detector.js +2 -1
- package/bin/engine/nexus-tracer.js +3 -2
- package/bin/engine/remediation-engine.js +155 -32
- package/bin/engine/self-corrective-synthesizer.js +84 -10
- package/bin/engine/sre-manager.js +12 -4
- package/bin/engine/temporal-hub.js +131 -34
- package/bin/governance/approve.js +41 -5
- package/bin/governance/impact-analyzer.js +28 -0
- package/bin/governance/policy-engine.js +10 -3
- package/bin/governance/quantum-crypto.js +32 -19
- package/bin/governance/rbac-manager.js +74 -2
- package/bin/governance/ztai-manager.js +49 -7
- package/bin/hindsight-injector.js +3 -3
- package/bin/memory/eis-client.js +71 -34
- package/bin/memory/embedding-engine.js +61 -0
- package/bin/memory/knowledge-graph.js +58 -5
- package/bin/memory/knowledge-indexer.js +53 -6
- package/bin/memory/knowledge-store.js +22 -0
- package/bin/migrations/10.7.0-to-11.0.0.js +110 -0
- package/bin/migrations/schema-versions.js +13 -0
- package/bin/models/anthropic-provider.js +45 -0
- package/bin/models/cloud-broker.js +68 -20
- package/bin/models/gemini-provider.js +51 -0
- package/bin/models/model-client.js +20 -0
- package/bin/models/model-router.js +28 -8
- package/bin/models/openai-provider.js +44 -0
- package/bin/utils/file-io.js +63 -1
- package/bin/utils/index.js +58 -0
- package/docs/getting-started.md +1 -1
- package/docs/user-guide.md +2 -2
- package/package.json +2 -2
- package/.mindforge/personas/data-privacy-engineer.md +0 -187
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: visual-regression-testing
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.0.8
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: visual regression, screenshot test, pixel diff, visual baseline, chromatic, percy, visual snapshot, component screenshot, visual comparison, layout shift detection, visual approval, screenshot diff
|
|
7
|
+
compose: testing-standards
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Visual Regression Testing
|
|
11
|
+
|
|
12
|
+
## When this skill activates
|
|
13
|
+
|
|
14
|
+
This skill activates when implementing screenshot-based testing, configuring visual diff tools, managing visual baselines, or investigating unexpected UI changes. It applies to component-level visual testing (Storybook), page-level screenshots, and responsive layout verification.
|
|
15
|
+
|
|
16
|
+
## Mandatory actions when this skill is active
|
|
17
|
+
|
|
18
|
+
### Before
|
|
19
|
+
|
|
20
|
+
1. Determine the scope: component-level (individual components in isolation) or page-level (full page renders).
|
|
21
|
+
2. Select the tooling approach (Playwright screenshots, Chromatic, Percy, BackstopJS).
|
|
22
|
+
3. Identify dynamic content that must be stabilized (timestamps, avatars, animations, ads).
|
|
23
|
+
4. Define viewport sizes to capture (mobile: 375px, tablet: 768px, desktop: 1440px minimum).
|
|
24
|
+
5. Establish the pixel diff threshold (recommended: 0.1% for strict, 0.5% for lenient).
|
|
25
|
+
6. Confirm baseline images exist or plan initial baseline capture.
|
|
26
|
+
|
|
27
|
+
### During
|
|
28
|
+
|
|
29
|
+
**Core Workflow:**
|
|
30
|
+
1. Capture baseline screenshots (the "known good" state).
|
|
31
|
+
2. Make code changes (feature, refactor, dependency update).
|
|
32
|
+
3. Capture new screenshots under identical conditions.
|
|
33
|
+
4. Run pixel diff comparison between baseline and new.
|
|
34
|
+
5. Review diffs: approve intentional changes, reject regressions.
|
|
35
|
+
6. Update baselines for approved changes.
|
|
36
|
+
|
|
37
|
+
**Handling Dynamic Content (Critical):**
|
|
38
|
+
- **Timestamps/dates**: Mock to a fixed date (`2024-01-15T10:00:00Z`).
|
|
39
|
+
- **Avatars/images**: Use deterministic placeholder images.
|
|
40
|
+
- **Animations**: Disable CSS animations and transitions during capture.
|
|
41
|
+
- **Cursor blink**: Hide input cursors via CSS override.
|
|
42
|
+
- **Loading states**: Wait for network idle and all images loaded before capture.
|
|
43
|
+
- **Random content**: Seed random generators or use fixed test data.
|
|
44
|
+
- **Third-party widgets**: Hide or mock (chat widgets, analytics banners).
|
|
45
|
+
|
|
46
|
+
**Component-Level Testing (Storybook + Chromatic):**
|
|
47
|
+
- Every component gets a story with representative states (default, loading, error, empty, overflow).
|
|
48
|
+
- Chromatic captures each story as a visual baseline automatically.
|
|
49
|
+
- Review changes in Chromatic UI with side-by-side comparison.
|
|
50
|
+
- Use `args` and `decorators` to control component state deterministically.
|
|
51
|
+
- Group related stories to reduce noise in review.
|
|
52
|
+
|
|
53
|
+
**Page-Level Testing (Playwright/BackstopJS):**
|
|
54
|
+
- Navigate to page, wait for full render (network idle + specific element visible).
|
|
55
|
+
- Capture at multiple viewports for responsive verification.
|
|
56
|
+
- Use `page.screenshot({ fullPage: true })` for scroll content.
|
|
57
|
+
- Clip to specific regions when full-page comparison is too noisy.
|
|
58
|
+
- Set `maxDiffPixelRatio` threshold in Playwright config.
|
|
59
|
+
|
|
60
|
+
**Diff Thresholds:**
|
|
61
|
+
- **0.0%**: Exact match required. Use only for pixel-perfect components (logos, icons).
|
|
62
|
+
- **0.1%**: Strict. Catches anti-aliasing differences across OS/browser combos.
|
|
63
|
+
- **0.5%**: Standard. Tolerates minor rendering engine differences.
|
|
64
|
+
- **1.0%**: Lenient. Use for pages with slight layout flexibility.
|
|
65
|
+
- Above 1%: Likely a real regression — always investigate.
|
|
66
|
+
|
|
67
|
+
**CI Integration:**
|
|
68
|
+
- Run visual tests on every PR (component-level at minimum).
|
|
69
|
+
- Full page-level suite on merge to main or nightly.
|
|
70
|
+
- Store baseline images in version control or dedicated storage (LFS for large sets).
|
|
71
|
+
- Block merge if unapproved visual diffs exist.
|
|
72
|
+
- Provide direct links to diff viewer in PR comments.
|
|
73
|
+
|
|
74
|
+
**Approval Workflow:**
|
|
75
|
+
- Designer or frontend lead reviews visual diffs before approval.
|
|
76
|
+
- Bulk approve when changes are intentional (theme update, design system change).
|
|
77
|
+
- Document WHY a visual change was approved (link to design ticket).
|
|
78
|
+
- Never auto-approve visual diffs — human review is the point.
|
|
79
|
+
|
|
80
|
+
### After
|
|
81
|
+
|
|
82
|
+
1. All visual diffs are reviewed and explicitly approved or rejected.
|
|
83
|
+
2. Baselines are updated to reflect the new approved state.
|
|
84
|
+
3. Dynamic content is fully stabilized (no flaky screenshots).
|
|
85
|
+
4. Responsive breakpoints are covered (minimum 3 viewport widths).
|
|
86
|
+
5. CI pipeline gates merge on unapproved visual changes.
|
|
87
|
+
|
|
88
|
+
## Self-check before task completion
|
|
89
|
+
|
|
90
|
+
- [ ] Dynamic content is fully mocked/frozen (no timestamps, no random data in screenshots).
|
|
91
|
+
- [ ] Screenshots are captured after full render (network idle, fonts loaded, animations disabled).
|
|
92
|
+
- [ ] Diff threshold is explicitly configured and appropriate for the content type.
|
|
93
|
+
- [ ] Multiple viewport sizes are tested (mobile, tablet, desktop at minimum).
|
|
94
|
+
- [ ] Approval workflow is defined (who reviews, how to approve, where to document).
|
|
95
|
+
- [ ] Baseline images are stored durably and versioned with the code.
|
|
96
|
+
- [ ] CI blocks deployment on unapproved visual regressions.
|
|
97
|
+
- [ ] Flakiness is below 1% (re-run same code twice, expect identical screenshots).
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: websocket-patterns
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 0.1.0
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: websocket pattern, websocket connection lifecycle, heartbeat mechanism, reconnection strategy, websocket rooms, channel subscription, websocket scaling, redis pub sub scaling, backpressure handling, websocket authentication, message ordering, binary protocol
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Skill — WebSocket Patterns
|
|
10
|
+
|
|
11
|
+
## When this skill activates
|
|
12
|
+
Any task involving WebSocket connection management, real-time communication,
|
|
13
|
+
heartbeat/keepalive mechanisms, reconnection strategies, room/channel design,
|
|
14
|
+
or WebSocket scaling across multiple server instances.
|
|
15
|
+
|
|
16
|
+
## Mandatory actions when this skill is active
|
|
17
|
+
|
|
18
|
+
### Before writing any code
|
|
19
|
+
1. Define the websocket connection lifecycle (upgrade, auth, message flow, close).
|
|
20
|
+
2. Choose heartbeat interval and reconnection strategy.
|
|
21
|
+
3. Determine scaling approach (Redis pub/sub, sticky sessions, etc.).
|
|
22
|
+
|
|
23
|
+
### During implementation
|
|
24
|
+
- Implement heartbeat mechanism (server ping every 30s).
|
|
25
|
+
- Add exponential backoff with jitter for reconnection.
|
|
26
|
+
- Handle backpressure (buffer limits, overflow policy).
|
|
27
|
+
|
|
28
|
+
### After implementation
|
|
29
|
+
- Load test concurrent connection capacity.
|
|
30
|
+
- Verify reconnection behavior under network partitions.
|
|
31
|
+
- Document WebSocket protocol in ARCHITECTURE.md.
|
|
32
|
+
|
|
33
|
+
## Connection Lifecycle
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
HTTP Upgrade → Open → Authenticate → Subscribe → Message Loop → Ping/Pong → Close
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Upgrade
|
|
40
|
+
- Client sends HTTP Upgrade request with `Sec-WebSocket-Key`.
|
|
41
|
+
- Server responds with 101 Switching Protocols.
|
|
42
|
+
- Connection is now bidirectional full-duplex.
|
|
43
|
+
|
|
44
|
+
### Open
|
|
45
|
+
- Connection established, ready for messages.
|
|
46
|
+
- Server assigns connection ID for tracking.
|
|
47
|
+
- Start heartbeat timer.
|
|
48
|
+
|
|
49
|
+
### Authenticate
|
|
50
|
+
- First message from client must be auth token.
|
|
51
|
+
- Server validates token, associates connection with user.
|
|
52
|
+
- Reject and close if auth fails (close code 4001).
|
|
53
|
+
|
|
54
|
+
### Message Loop
|
|
55
|
+
- Bidirectional message exchange.
|
|
56
|
+
- Messages typed by application protocol (JSON envelope with `type` field).
|
|
57
|
+
- Server processes commands, pushes events.
|
|
58
|
+
|
|
59
|
+
### Close
|
|
60
|
+
- Graceful: client/server sends close frame with reason code.
|
|
61
|
+
- Ungraceful: TCP connection drops (detected by heartbeat timeout).
|
|
62
|
+
- Clean up subscriptions, remove from rooms, release resources.
|
|
63
|
+
|
|
64
|
+
## Heartbeat Mechanism
|
|
65
|
+
|
|
66
|
+
### Server-Initiated Ping
|
|
67
|
+
- Server sends WebSocket ping frame every 30 seconds.
|
|
68
|
+
- Client automatically responds with pong (browser handles this).
|
|
69
|
+
- If no pong received within 60 seconds: connection dead, close it.
|
|
70
|
+
|
|
71
|
+
### Application-Level Heartbeat
|
|
72
|
+
- Send JSON `{"type": "ping", "ts": 1234567890}` every 30s.
|
|
73
|
+
- Client responds with `{"type": "pong", "ts": 1234567890}`.
|
|
74
|
+
- Allows RTT measurement and connection quality monitoring.
|
|
75
|
+
- Required when infrastructure (load balancers) strips WebSocket pings.
|
|
76
|
+
|
|
77
|
+
### Idle Timeout
|
|
78
|
+
- Close connections with no activity for 5 minutes.
|
|
79
|
+
- Heartbeat keeps connection alive during quiet periods.
|
|
80
|
+
- Differentiate: no data vs dead connection.
|
|
81
|
+
|
|
82
|
+
## Reconnection Strategy
|
|
83
|
+
|
|
84
|
+
### Exponential Backoff with Jitter
|
|
85
|
+
```
|
|
86
|
+
attempt 1: wait 1s + random(0-500ms)
|
|
87
|
+
attempt 2: wait 2s + random(0-500ms)
|
|
88
|
+
attempt 3: wait 4s + random(0-500ms)
|
|
89
|
+
attempt 4: wait 8s + random(0-500ms)
|
|
90
|
+
...
|
|
91
|
+
max wait: 30s + random(0-500ms)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Reconnection Behavior
|
|
95
|
+
- On disconnect: immediately attempt reconnect (might be transient).
|
|
96
|
+
- On failure: apply exponential backoff.
|
|
97
|
+
- On reconnect success: re-authenticate, re-subscribe to channels.
|
|
98
|
+
- Resume from last received message sequence number (gap detection).
|
|
99
|
+
|
|
100
|
+
### Client State During Reconnection
|
|
101
|
+
- Show "reconnecting..." indicator to user.
|
|
102
|
+
- Buffer outgoing messages (send after reconnect).
|
|
103
|
+
- Merge missed messages on reconnection (request gap fill from server).
|
|
104
|
+
|
|
105
|
+
## Rooms and Channels
|
|
106
|
+
|
|
107
|
+
### Topic-Based Subscriptions
|
|
108
|
+
```json
|
|
109
|
+
{"type": "subscribe", "channel": "chat:room-123"}
|
|
110
|
+
{"type": "unsubscribe", "channel": "chat:room-123"}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Room Semantics
|
|
114
|
+
- Join: add connection to room's subscriber list.
|
|
115
|
+
- Leave: remove connection from room's subscriber list.
|
|
116
|
+
- Broadcast: send message to all connections in room.
|
|
117
|
+
- Presence: track who is currently in room (online/offline).
|
|
118
|
+
|
|
119
|
+
### Channel Naming Convention
|
|
120
|
+
```
|
|
121
|
+
{domain}:{resource_type}:{resource_id}
|
|
122
|
+
chat:room:abc123
|
|
123
|
+
orders:user:user456
|
|
124
|
+
notifications:global
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Scaling Across Instances
|
|
128
|
+
|
|
129
|
+
### Problem
|
|
130
|
+
- WebSocket connections are stateful (pinned to one server).
|
|
131
|
+
- Broadcasting must reach connections on ALL servers.
|
|
132
|
+
- Server A has user X, Server B has user Y — both in same room.
|
|
133
|
+
|
|
134
|
+
### Solution: Redis Pub/Sub
|
|
135
|
+
```
|
|
136
|
+
Server A publishes → Redis channel → Server B receives → delivers to local connections
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
- Each server subscribes to Redis channels matching its connections' rooms.
|
|
140
|
+
- On broadcast: publish to Redis, all servers deliver to their local connections.
|
|
141
|
+
- Redis Pub/Sub is fire-and-forget (acceptable for real-time messages).
|
|
142
|
+
|
|
143
|
+
### Alternative: Sticky Sessions
|
|
144
|
+
- Route same user to same server (via cookie or IP hash).
|
|
145
|
+
- Simpler but limits horizontal scaling.
|
|
146
|
+
- Fails on server restart (all connections drop).
|
|
147
|
+
|
|
148
|
+
## Authentication
|
|
149
|
+
|
|
150
|
+
### Token in Query Parameter (During Upgrade)
|
|
151
|
+
```
|
|
152
|
+
ws://example.com/ws?token=jwt_token_here
|
|
153
|
+
```
|
|
154
|
+
- Simple, works with browser WebSocket API.
|
|
155
|
+
- Risk: token in URL may appear in logs.
|
|
156
|
+
|
|
157
|
+
### Token in First Message (After Connect)
|
|
158
|
+
```json
|
|
159
|
+
{"type": "auth", "token": "jwt_token_here"}
|
|
160
|
+
```
|
|
161
|
+
- More secure (not in URL/logs).
|
|
162
|
+
- Requires handling unauthenticated state.
|
|
163
|
+
- Close connection if no auth within 5 seconds.
|
|
164
|
+
|
|
165
|
+
### Token Refresh
|
|
166
|
+
- Server sends `{"type": "token_expiring", "expires_in": 60}`.
|
|
167
|
+
- Client sends new token before expiration.
|
|
168
|
+
- If token expires: close connection, client reconnects with fresh token.
|
|
169
|
+
|
|
170
|
+
## Backpressure Handling
|
|
171
|
+
|
|
172
|
+
### Problem
|
|
173
|
+
- Server produces messages faster than client can consume.
|
|
174
|
+
- Client's buffer grows unbounded, eventually crashes.
|
|
175
|
+
|
|
176
|
+
### Solutions
|
|
177
|
+
|
|
178
|
+
#### Buffer with Limit
|
|
179
|
+
- Set maximum buffer size per connection (e.g., 1000 messages).
|
|
180
|
+
- When buffer full: drop oldest messages.
|
|
181
|
+
- Notify client: `{"type": "lag_warning", "dropped": 47}`.
|
|
182
|
+
|
|
183
|
+
#### Flow Control
|
|
184
|
+
- Client sends acknowledgment every N messages.
|
|
185
|
+
- Server pauses sending if no ack received.
|
|
186
|
+
- Similar to TCP flow control at application level.
|
|
187
|
+
|
|
188
|
+
#### Priority Queues
|
|
189
|
+
- Critical messages (errors, auth) never dropped.
|
|
190
|
+
- Real-time data (cursor positions) can be dropped.
|
|
191
|
+
- Batch/compress low-priority messages during lag.
|
|
192
|
+
|
|
193
|
+
## Self-check before task completion
|
|
194
|
+
|
|
195
|
+
Before marking a task done when this skill was active:
|
|
196
|
+
|
|
197
|
+
- [ ] Did I read the full SKILL.md before starting? (Not just the triggers)
|
|
198
|
+
- [ ] Is heartbeat mechanism implemented (30s ping, 60s timeout)?
|
|
199
|
+
- [ ] Is reconnection using exponential backoff with jitter?
|
|
200
|
+
- [ ] Is authentication handled (first message or query param)?
|
|
201
|
+
- [ ] Is backpressure handled (buffer limit, drop policy)?
|
|
202
|
+
- [ ] Is cross-instance scaling addressed (Redis pub/sub or equivalent)?
|
|
203
|
+
- [ ] Are rooms/channels properly implemented with join/leave semantics?
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-plans
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.0.6
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: writing plan, plan writing, task decomposition, implementation plan, step by step plan, plan template, planning guide, plan structure, bite-sized tasks, plan format, plan methodology, plan checklist
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Skill — Writing Plans
|
|
10
|
+
|
|
11
|
+
## When this skill activates
|
|
12
|
+
Any task that requires producing an implementation plan, task decomposition,
|
|
13
|
+
step-by-step instructions, or structured execution guide. This includes feature
|
|
14
|
+
plans, migration plans, refactoring plans, and any multi-step work breakdown.
|
|
15
|
+
|
|
16
|
+
## Mandatory actions when this skill is active
|
|
17
|
+
|
|
18
|
+
### Before writing any plan
|
|
19
|
+
1. **Gather complete context.** Read:
|
|
20
|
+
- The specification or requirement being planned for.
|
|
21
|
+
- The current codebase structure (file paths, existing patterns).
|
|
22
|
+
- Any constraints (tech stack, timeline, dependencies on other work).
|
|
23
|
+
2. **Identify the scope boundary.** What is IN the plan vs OUT of scope?
|
|
24
|
+
3. **Identify dependencies.** Which steps depend on other steps? Which can be parallel?
|
|
25
|
+
|
|
26
|
+
### During plan writing
|
|
27
|
+
|
|
28
|
+
#### Core Principle: NO PLACEHOLDERS
|
|
29
|
+
Every step in the plan must contain **complete, executable instructions**. A plan
|
|
30
|
+
fails its purpose if the executor has to figure out what goes in a placeholder.
|
|
31
|
+
|
|
32
|
+
**Bad (placeholder):**
|
|
33
|
+
```
|
|
34
|
+
3. Add the authentication middleware to the routes.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Good (complete):**
|
|
38
|
+
```
|
|
39
|
+
3. Add authentication middleware to API routes.
|
|
40
|
+
File: src/middleware/auth.ts
|
|
41
|
+
Create a new middleware function:
|
|
42
|
+
- Import `verifyJWT` from `src/lib/jwt.ts`
|
|
43
|
+
- Extract the `Authorization` header, strip "Bearer " prefix
|
|
44
|
+
- Call `verifyJWT(token)` — if it throws, return 401 with `{ error: "Invalid token" }`
|
|
45
|
+
- If valid, attach `req.user = decoded` and call `next()`
|
|
46
|
+
|
|
47
|
+
File: src/routes/api.ts
|
|
48
|
+
- Import `authMiddleware` from `src/middleware/auth.ts`
|
|
49
|
+
- Add `router.use("/api/v1/protected", authMiddleware)` before the route definitions
|
|
50
|
+
on line ~45 (after the public routes, before the protected group)
|
|
51
|
+
|
|
52
|
+
Verify: Run `curl -H "Authorization: Bearer invalid" localhost:3000/api/v1/protected/me`
|
|
53
|
+
Expected: 401 response with `{"error": "Invalid token"}`
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### Plan Structure Template
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
# Plan: [Feature/Task Name]
|
|
60
|
+
|
|
61
|
+
## Context
|
|
62
|
+
[1-3 sentences: WHY this work exists. Link to spec/ticket if applicable.]
|
|
63
|
+
|
|
64
|
+
## Scope
|
|
65
|
+
- IN: [What this plan covers]
|
|
66
|
+
- OUT: [What is explicitly excluded]
|
|
67
|
+
|
|
68
|
+
## Prerequisites
|
|
69
|
+
- [ ] [Anything that must be true before starting step 1]
|
|
70
|
+
|
|
71
|
+
## Steps
|
|
72
|
+
|
|
73
|
+
### Step 1: [Verb + Object] (estimated: Xmin)
|
|
74
|
+
**What**: [One sentence summary]
|
|
75
|
+
**Files**:
|
|
76
|
+
- `path/to/file.ts` — [what changes]
|
|
77
|
+
- `path/to/other.ts` — [what changes]
|
|
78
|
+
|
|
79
|
+
**Details**:
|
|
80
|
+
[Complete instructions with exact code patterns, not pseudocode]
|
|
81
|
+
|
|
82
|
+
**Verify**: [Exact command or check to confirm this step worked]
|
|
83
|
+
Expected: [What success looks like]
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### Step 2: [Verb + Object] (estimated: Xmin)
|
|
88
|
+
**Depends on**: Step 1
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
## Verification (End-to-End)
|
|
92
|
+
[How to verify the entire plan was executed correctly]
|
|
93
|
+
|
|
94
|
+
## Rollback
|
|
95
|
+
[How to undo this work if something goes wrong]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### Step Design Rules
|
|
99
|
+
1. **Bite-sized**: Each step is independently verifiable. If you cannot verify a step
|
|
100
|
+
without completing the next step, merge them or restructure.
|
|
101
|
+
2. **Atomic**: Each step makes one logical change. "Add the model AND the migration
|
|
102
|
+
AND the API route AND the tests" is four steps, not one.
|
|
103
|
+
3. **Ordered by dependency**: Steps that depend on previous steps come after them.
|
|
104
|
+
Independent steps are noted as parallelizable.
|
|
105
|
+
4. **Specific file paths**: Every step names exact files. Never say "the config file"
|
|
106
|
+
when you mean `src/config/database.ts`.
|
|
107
|
+
5. **Include the WHY**: If a step has a non-obvious reason, explain it inline. The
|
|
108
|
+
executor should never wonder "why are we doing this?"
|
|
109
|
+
6. **Verification after every step**: Each step ends with a concrete check. Prefer
|
|
110
|
+
runnable commands (`npm test`, `curl`, `grep`) over subjective checks ("looks right").
|
|
111
|
+
|
|
112
|
+
#### Handling Complexity
|
|
113
|
+
- **If a step has > 10 lines of instructions**: Split it into sub-steps (1a, 1b, 1c).
|
|
114
|
+
- **If a plan has > 15 steps**: Group into phases with phase-level verification gates.
|
|
115
|
+
- **If there are conditional paths** ("if X then do Y, else do Z"): Write both paths
|
|
116
|
+
explicitly. Note the decision criteria clearly.
|
|
117
|
+
- **If a step requires research** ("find the best library for X"): That is a separate
|
|
118
|
+
pre-plan task. Plans should not contain open-ended research.
|
|
119
|
+
|
|
120
|
+
#### Estimations
|
|
121
|
+
- Include time estimates per step (in minutes).
|
|
122
|
+
- Be realistic: include time for verification and debugging.
|
|
123
|
+
- Total plan time = sum of steps + 20% buffer for unexpected issues.
|
|
124
|
+
- If total exceeds 4 hours: break into multiple plans with clear handoff points.
|
|
125
|
+
|
|
126
|
+
#### Dependencies and Parallelism
|
|
127
|
+
- Mark each step with `Depends on: Step N` or `Depends on: None (parallelizable)`.
|
|
128
|
+
- Group parallelizable steps explicitly:
|
|
129
|
+
```
|
|
130
|
+
### Steps 3-5 (parallelizable — no dependencies between them)
|
|
131
|
+
```
|
|
132
|
+
- Never leave implicit dependencies. If step 4 silently requires step 3's output,
|
|
133
|
+
make it explicit.
|
|
134
|
+
|
|
135
|
+
### After writing the plan
|
|
136
|
+
1. **Self-review with the "zero context" test**: Could someone unfamiliar with this
|
|
137
|
+
codebase follow these steps and produce a working result? If any step requires
|
|
138
|
+
knowledge not in the plan, add it.
|
|
139
|
+
2. **Check for placeholder language**: Search for words like "appropriate", "relevant",
|
|
140
|
+
"as needed", "etc.", "similar to". Replace each with specifics.
|
|
141
|
+
3. **Verify file paths exist**: Every path referenced in the plan should be a real file
|
|
142
|
+
(or explicitly marked as "create new file").
|
|
143
|
+
4. **Confirm verification steps are runnable**: Each verify command should work
|
|
144
|
+
copy-pasted into a terminal.
|
|
145
|
+
|
|
146
|
+
## Plan quality anti-patterns to flag
|
|
147
|
+
|
|
148
|
+
- "Update the configuration as appropriate" (what configuration? what value?)
|
|
149
|
+
- "Add error handling" (what errors? what handling? what response?)
|
|
150
|
+
- "Refactor the module" (which module? what pattern? what is the target state?)
|
|
151
|
+
- "Write tests" (what tests? what cases? what assertions?)
|
|
152
|
+
- Steps without verification (how do you know it worked?)
|
|
153
|
+
- Steps that combine 3+ unrelated changes (should be split)
|
|
154
|
+
- Vague time estimates ("a while", "some time") instead of minutes
|
|
155
|
+
- Missing rollback plan (what if step 7 fails and you need to undo steps 1-6?)
|
|
156
|
+
|
|
157
|
+
## Self-check before task completion
|
|
158
|
+
|
|
159
|
+
Before marking a task done when this skill was active:
|
|
160
|
+
|
|
161
|
+
- [ ] Every step has specific file paths (no "the relevant file").
|
|
162
|
+
- [ ] Every step has a verification check with expected output.
|
|
163
|
+
- [ ] No placeholder language ("as needed", "appropriate", "etc.").
|
|
164
|
+
- [ ] Dependencies between steps are explicit.
|
|
165
|
+
- [ ] Time estimates are included per step.
|
|
166
|
+
- [ ] A zero-context reader could follow the plan without asking questions.
|
|
167
|
+
- [ ] Rollback instructions are included.
|
|
168
|
+
- [ ] Plan scope (IN/OUT) is clearly defined.
|
|
169
|
+
- [ ] If > 15 steps, organized into phases with phase-level gates.
|
|
170
|
+
- [ ] All file paths verified to exist (or marked as "new file").
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-skills
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.0.6
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: writing skill, skill authoring, skill format, skill schema, skill template, how to write skill, skill frontmatter, skill structure, skill design, skill best practice, reusable skill, skill guide
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Skill — Writing Skills
|
|
10
|
+
|
|
11
|
+
## When this skill activates
|
|
12
|
+
Any task involving authoring, designing, or reviewing MindForge skill files.
|
|
13
|
+
This includes creating new skills from scratch, refactoring existing skills,
|
|
14
|
+
reviewing skill quality, or understanding the skill schema and conventions.
|
|
15
|
+
|
|
16
|
+
## Mandatory actions when this skill is active
|
|
17
|
+
|
|
18
|
+
### Before writing any skill
|
|
19
|
+
1. **Clarify the skill's purpose.** Answer these three questions:
|
|
20
|
+
- What problem does this skill solve? (One sentence.)
|
|
21
|
+
- When should it activate? (Specific scenarios, not vague categories.)
|
|
22
|
+
- What does it make the agent DO differently? (Observable behavior change.)
|
|
23
|
+
2. **Check for conflicts.** Review existing skills in `.mindforge/skills/` to ensure:
|
|
24
|
+
- No trigger overlap (same keyword activating two different skills).
|
|
25
|
+
- No scope overlap (two skills giving contradictory instructions for the same task).
|
|
26
|
+
- Compose relationship is correct (child skill composes parent, not duplicates it).
|
|
27
|
+
3. **Determine if this is a standalone skill or a composed skill.**
|
|
28
|
+
- Standalone: activates independently, covers a complete domain.
|
|
29
|
+
- Composed (`compose: parent-skill`): extends a parent skill with specialization.
|
|
30
|
+
The parent's instructions apply AND the child's instructions add specificity.
|
|
31
|
+
|
|
32
|
+
### During skill authoring
|
|
33
|
+
|
|
34
|
+
#### Frontmatter Schema (YAML)
|
|
35
|
+
```yaml
|
|
36
|
+
---
|
|
37
|
+
name: skill-name-kebab-case # Required. Unique identifier.
|
|
38
|
+
version: 1.0.0 # Required. SemVer.
|
|
39
|
+
min_mindforge_version: 10.0.6 # Required. Minimum framework version.
|
|
40
|
+
status: stable # Required. One of: draft, beta, stable, deprecated.
|
|
41
|
+
triggers: keyword1, keyword2, compound phrase, another trigger
|
|
42
|
+
# Required. Comma-separated. 12+ recommended.
|
|
43
|
+
compose: parent-skill-name # Optional. Name of parent skill this extends.
|
|
44
|
+
---
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Field rules:**
|
|
48
|
+
- `name`: Must match the directory name. Kebab-case. Globally unique across the registry.
|
|
49
|
+
- `version`: Follows semantic versioning. Bump minor for new content, major for breaking trigger changes.
|
|
50
|
+
- `min_mindforge_version`: The oldest framework version that supports this skill's features.
|
|
51
|
+
- `status`:
|
|
52
|
+
- `draft` — Work in progress, may have incomplete sections.
|
|
53
|
+
- `beta` — Functional but not battle-tested. May change.
|
|
54
|
+
- `stable` — Production-ready. Trigger changes require major version bump.
|
|
55
|
+
- `deprecated` — Superseded by another skill. Include migration note in body.
|
|
56
|
+
- `triggers`: The activation keywords. See "Trigger Design" section below.
|
|
57
|
+
- `compose`: If set, this skill inherits all instructions from the named parent skill.
|
|
58
|
+
The agent applies BOTH the parent and this skill when activated.
|
|
59
|
+
|
|
60
|
+
#### Body Structure
|
|
61
|
+
```markdown
|
|
62
|
+
# Skill — [Human-Readable Name]
|
|
63
|
+
|
|
64
|
+
## When this skill activates
|
|
65
|
+
[1-3 sentences describing the exact scenarios. Be specific enough that an agent
|
|
66
|
+
can determine yes/no whether this skill applies.]
|
|
67
|
+
|
|
68
|
+
## Mandatory actions when this skill is active
|
|
69
|
+
|
|
70
|
+
### Before [writing code / starting the task]
|
|
71
|
+
[Numbered list of preparation steps. What must be checked/read/decided first.]
|
|
72
|
+
|
|
73
|
+
### During [implementation / the task]
|
|
74
|
+
[The core instructions. Checklists, patterns, code examples, decision trees.
|
|
75
|
+
This is the largest section. Organize with sub-headings.]
|
|
76
|
+
|
|
77
|
+
### After [implementation / the task]
|
|
78
|
+
[Verification steps. What to check, run, or validate before marking done.]
|
|
79
|
+
|
|
80
|
+
## [Optional: Domain-specific sections]
|
|
81
|
+
[Tables, reference data, anti-patterns, decision matrices, etc.]
|
|
82
|
+
|
|
83
|
+
## Self-check before task completion
|
|
84
|
+
[Checkbox list. Every skill MUST end with this section. These are the minimum
|
|
85
|
+
criteria that must be true before the agent considers the task complete.]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### Trigger Design (Critical for Activation Accuracy)
|
|
89
|
+
|
|
90
|
+
**Quantity**: Aim for 12-20 triggers per skill. Fewer = missed activations. More = false positives.
|
|
91
|
+
|
|
92
|
+
**Types of triggers to include:**
|
|
93
|
+
1. **Direct name** — The skill's core concept: `kubernetes deployment`, `react performance`.
|
|
94
|
+
2. **Tool/library names** — Specific tools the skill covers: `cProfile`, `React.memo`, `helm chart`.
|
|
95
|
+
3. **Problem descriptions** — How users describe the need: `python bottleneck`, `unnecessary re-render`.
|
|
96
|
+
4. **Action phrases** — What users ask to do: `write a plan`, `create a skill`.
|
|
97
|
+
5. **Compound phrases** — Multi-word to avoid conflicts: `discriminated union` not just `union`.
|
|
98
|
+
|
|
99
|
+
**Trigger design rules:**
|
|
100
|
+
- Use compound phrases (2-3 words) to avoid false positives. `type` alone would fire on
|
|
101
|
+
every TypeScript task. `conditional type` is specific.
|
|
102
|
+
- Include both the noun and verb forms: `profiling` AND `profile python`.
|
|
103
|
+
- Test mentally: "If a user says this trigger phrase in a prompt, should THIS skill activate?"
|
|
104
|
+
If the answer is "maybe" — the trigger is too vague.
|
|
105
|
+
- Never use single common words as triggers (`code`, `fix`, `build`, `test`).
|
|
106
|
+
- Avoid triggers that overlap with other skills. Run a mental diff against similar skills.
|
|
107
|
+
|
|
108
|
+
**Trigger conflict resolution:**
|
|
109
|
+
- If two skills share a trigger, the more specific skill wins.
|
|
110
|
+
- If you cannot determine specificity, add a qualifying word to disambiguate.
|
|
111
|
+
- Example conflict: both `performance` and `react-performance` trigger on "performance".
|
|
112
|
+
Resolution: `react-performance` uses `react performance` (compound), the generic
|
|
113
|
+
`performance` skill handles the unqualified keyword.
|
|
114
|
+
|
|
115
|
+
#### Content Principles
|
|
116
|
+
|
|
117
|
+
1. **Actionable, not advisory.** Say "Do X" not "Consider doing X" or "It's good practice to X".
|
|
118
|
+
- Bad: "You should consider adding error handling."
|
|
119
|
+
- Good: "Add try/catch around the database call. Log the error with context. Return 500."
|
|
120
|
+
|
|
121
|
+
2. **Checklists, not essays.** Agents process structured lists faster than paragraphs.
|
|
122
|
+
- Bad: "When working with generics, it's important to think about constraints because
|
|
123
|
+
without them the type parameter is too broad and you lose type safety."
|
|
124
|
+
- Good: "- Always constrain generic parameters: `<T extends Base>` not bare `<T>`."
|
|
125
|
+
|
|
126
|
+
3. **Complete code examples over descriptions.** Show the pattern, not just name it.
|
|
127
|
+
- Bad: "Use the builder pattern for complex objects."
|
|
128
|
+
- Good: [10-line code example of the builder pattern in the project's language]
|
|
129
|
+
|
|
130
|
+
4. **Under 500 lines.** If a skill exceeds 500 lines, it is trying to cover too much.
|
|
131
|
+
Split into a parent skill + composed children.
|
|
132
|
+
- Example: `performance` (parent, 120 lines of general principles) +
|
|
133
|
+
`python-performance` (child, composes performance, 400 lines of Python specifics).
|
|
134
|
+
|
|
135
|
+
5. **Decision trees for conditional logic.** When the right action depends on context,
|
|
136
|
+
provide explicit if/then:
|
|
137
|
+
```
|
|
138
|
+
- IF the list has > 50 items → use virtualization
|
|
139
|
+
- IF the list has 10-50 items → use React.memo on list items
|
|
140
|
+
- IF the list has < 10 items → no optimization needed
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
6. **Anti-patterns section.** Include a list of common mistakes to flag. Agents benefit
|
|
144
|
+
from knowing what NOT to do as much as what to do.
|
|
145
|
+
|
|
146
|
+
#### Quality Standards for Skill Content
|
|
147
|
+
|
|
148
|
+
- Every code example must be syntactically valid (could be pasted and would compile).
|
|
149
|
+
- All file paths in examples must use the project's actual structure conventions.
|
|
150
|
+
- Version numbers in examples must not be outdated (review annually).
|
|
151
|
+
- Commands must include expected output or success criteria.
|
|
152
|
+
- If a skill references an external tool, include the install command.
|
|
153
|
+
|
|
154
|
+
### After writing the skill
|
|
155
|
+
|
|
156
|
+
1. **Validate frontmatter.** Confirm all required fields present, triggers are comma-separated,
|
|
157
|
+
version is valid SemVer.
|
|
158
|
+
2. **Trigger evaluation test.** For each trigger, mentally construct a user prompt that
|
|
159
|
+
contains it and verify the skill SHOULD activate:
|
|
160
|
+
```
|
|
161
|
+
Trigger: "discriminated union"
|
|
162
|
+
Test prompt: "I need to model payment states as a discriminated union"
|
|
163
|
+
Should activate? YES — this is exactly about TypeScript advanced types.
|
|
164
|
+
```
|
|
165
|
+
3. **Conflict scan.** Compare triggers against all existing skills:
|
|
166
|
+
```bash
|
|
167
|
+
grep -r "^triggers:" .mindforge/skills/*/SKILL.md
|
|
168
|
+
```
|
|
169
|
+
Flag any overlap and resolve per the rules above.
|
|
170
|
+
4. **Register in MANIFEST.md** (if the project maintains one). Add the skill entry
|
|
171
|
+
with name, version, status, and trigger count.
|
|
172
|
+
5. **Test via eval harness** (if available):
|
|
173
|
+
```bash
|
|
174
|
+
mindforge eval-skill --skill=new-skill-name --prompts=20
|
|
175
|
+
```
|
|
176
|
+
Verify activation precision > 90% and recall > 85%.
|
|
177
|
+
|
|
178
|
+
## Skill review checklist (for reviewing others' skills)
|
|
179
|
+
|
|
180
|
+
| Criterion | Pass/Fail |
|
|
181
|
+
|---|---|
|
|
182
|
+
| Frontmatter has all required fields | |
|
|
183
|
+
| 12+ triggers, all compound (2+ words) | |
|
|
184
|
+
| No single-word triggers | |
|
|
185
|
+
| No trigger conflicts with existing skills | |
|
|
186
|
+
| "When this skill activates" is specific (yes/no determinable) | |
|
|
187
|
+
| Mandatory actions cover Before/During/After | |
|
|
188
|
+
| Self-check section present with checkboxes | |
|
|
189
|
+
| Content is actionable (imperatives, not suggestions) | |
|
|
190
|
+
| Code examples are syntactically valid | |
|
|
191
|
+
| Under 500 lines total | |
|
|
192
|
+
| No placeholder language ("as appropriate", "etc.") | |
|
|
193
|
+
|
|
194
|
+
## Skill lifecycle
|
|
195
|
+
|
|
196
|
+
| Status | Meaning | Allowed changes |
|
|
197
|
+
|---|---|---|
|
|
198
|
+
| draft | Under construction | Anything |
|
|
199
|
+
| beta | Functional, being tested | Content changes, trigger additions |
|
|
200
|
+
| stable | Production | Content patches only. Trigger changes = major version bump |
|
|
201
|
+
| deprecated | Being replaced | Only add migration notes pointing to successor |
|
|
202
|
+
|
|
203
|
+
## Self-check before task completion
|
|
204
|
+
|
|
205
|
+
Before marking a task done when this skill was active:
|
|
206
|
+
|
|
207
|
+
- [ ] Frontmatter validates (all required fields, valid SemVer, 12+ triggers).
|
|
208
|
+
- [ ] No trigger conflicts with existing skills (grep verified).
|
|
209
|
+
- [ ] Body follows the standard structure (activation, Before/During/After, self-check).
|
|
210
|
+
- [ ] Content is actionable (imperatives, checklists, code examples).
|
|
211
|
+
- [ ] Under 500 lines total.
|
|
212
|
+
- [ ] At least one code example included for the primary pattern.
|
|
213
|
+
- [ ] Self-check section has 5+ checkboxes covering the skill's key requirements.
|
|
214
|
+
- [ ] Trigger evaluation: 5+ test prompts mentally validated.
|
|
215
|
+
- [ ] Registered in MANIFEST.md (if applicable).
|
|
216
|
+
- [ ] No placeholder language in the body.
|