@kinqs/brainrouter-mcp-server 0.3.4
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/.env.example +144 -0
- package/README.md +56 -0
- package/agents/README.md +120 -0
- package/agents/code-reviewer.md +97 -0
- package/agents/security-auditor.md +101 -0
- package/agents/test-engineer.md +95 -0
- package/dist/__tests__/agent_mode.test.d.ts +1 -0
- package/dist/__tests__/api-routes.test.d.ts +1 -0
- package/dist/__tests__/api-routes.test.js +170 -0
- package/dist/__tests__/crypto.test.d.ts +1 -0
- package/dist/__tests__/crypto.test.js +28 -0
- package/dist/__tests__/host-integrations.test.d.ts +1 -0
- package/dist/__tests__/host-integrations.test.js +82 -0
- package/dist/__tests__/integration.test.d.ts +1 -0
- package/dist/__tests__/integration.test.js +50 -0
- package/dist/__tests__/loader.test.d.ts +1 -0
- package/dist/__tests__/loader.test.js +89 -0
- package/dist/__tests__/neural-spark.test.d.ts +1 -0
- package/dist/__tests__/neural-spark.test.js +112 -0
- package/dist/__tests__/pagination.test.d.ts +1 -0
- package/dist/__tests__/pagination.test.js +23 -0
- package/dist/__tests__/redaction.test.d.ts +1 -0
- package/dist/__tests__/redaction.test.js +17 -0
- package/dist/__tests__/registry.test.d.ts +1 -0
- package/dist/__tests__/registry.test.js +56 -0
- package/dist/__tests__/retry.test.d.ts +1 -0
- package/dist/__tests__/retry.test.js +30 -0
- package/dist/__tests__/skill-activation.test.d.ts +1 -0
- package/dist/__tests__/skill-activation.test.js +112 -0
- package/dist/__tests__/working-memory.test.d.ts +1 -0
- package/dist/__tests__/working-memory.test.js +200 -0
- package/dist/__tests__/workspace-paths.test.d.ts +1 -0
- package/dist/__tests__/workspace-paths.test.js +56 -0
- package/dist/__tests__/writer.test.d.ts +1 -0
- package/dist/__tests__/writer.test.js +94 -0
- package/dist/api/auth/crypto.d.ts +4 -0
- package/dist/api/auth/crypto.js +54 -0
- package/dist/api/middleware/auth.d.ts +12 -0
- package/dist/api/middleware/auth.js +90 -0
- package/dist/api/pagination.d.ts +18 -0
- package/dist/api/pagination.js +32 -0
- package/dist/api/routes/auth.d.ts +1 -0
- package/dist/api/routes/auth.js +130 -0
- package/dist/api/routes/chat-completions.d.ts +7 -0
- package/dist/api/routes/chat-completions.js +474 -0
- package/dist/api/routes/contradictions.d.ts +1 -0
- package/dist/api/routes/contradictions.js +28 -0
- package/dist/api/routes/evidence.d.ts +1 -0
- package/dist/api/routes/evidence.js +59 -0
- package/dist/api/routes/governance.d.ts +1 -0
- package/dist/api/routes/governance.js +95 -0
- package/dist/api/routes/graph.d.ts +1 -0
- package/dist/api/routes/graph.js +25 -0
- package/dist/api/routes/hooks.d.ts +1 -0
- package/dist/api/routes/hooks.js +88 -0
- package/dist/api/routes/memories.d.ts +1 -0
- package/dist/api/routes/memories.js +92 -0
- package/dist/api/routes/persona.d.ts +1 -0
- package/dist/api/routes/persona.js +9 -0
- package/dist/api/routes/scenes.d.ts +1 -0
- package/dist/api/routes/scenes.js +35 -0
- package/dist/api/routes/skills.d.ts +1 -0
- package/dist/api/routes/skills.js +14 -0
- package/dist/api/routes/stats.d.ts +1 -0
- package/dist/api/routes/stats.js +8 -0
- package/dist/api/routes/users.d.ts +1 -0
- package/dist/api/routes/users.js +82 -0
- package/dist/api/routes/working.d.ts +1 -0
- package/dist/api/routes/working.js +88 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +492 -0
- package/dist/integrations/claude-code.d.ts +12 -0
- package/dist/integrations/claude-code.js +35 -0
- package/dist/integrations/codex.d.ts +12 -0
- package/dist/integrations/codex.js +34 -0
- package/dist/integrations/generic-mcp.d.ts +52 -0
- package/dist/integrations/generic-mcp.js +118 -0
- package/dist/loader.d.ts +29 -0
- package/dist/loader.js +200 -0
- package/dist/memory/capture.d.ts +35 -0
- package/dist/memory/capture.js +230 -0
- package/dist/memory/config.d.ts +2 -0
- package/dist/memory/config.js +3 -0
- package/dist/memory/engine.d.ts +203 -0
- package/dist/memory/engine.js +626 -0
- package/dist/memory/llm-semaphore.d.ts +41 -0
- package/dist/memory/llm-semaphore.js +81 -0
- package/dist/memory/memory-type-config.d.ts +11 -0
- package/dist/memory/memory-type-config.js +65 -0
- package/dist/memory/pipeline/cognitive-contradiction.d.ts +7 -0
- package/dist/memory/pipeline/cognitive-contradiction.js +59 -0
- package/dist/memory/pipeline/cognitive-dedup.d.ts +23 -0
- package/dist/memory/pipeline/cognitive-dedup.js +38 -0
- package/dist/memory/pipeline/cognitive-extractor.d.ts +21 -0
- package/dist/memory/pipeline/cognitive-extractor.js +183 -0
- package/dist/memory/pipeline/contextual-focus-builder.d.ts +13 -0
- package/dist/memory/pipeline/contextual-focus-builder.js +135 -0
- package/dist/memory/pipeline/focus-direction-shift.d.ts +10 -0
- package/dist/memory/pipeline/focus-direction-shift.js +27 -0
- package/dist/memory/pipeline/graph-builder.d.ts +11 -0
- package/dist/memory/pipeline/graph-builder.js +88 -0
- package/dist/memory/pipeline/graph-recall.d.ts +13 -0
- package/dist/memory/pipeline/graph-recall.js +55 -0
- package/dist/memory/pipeline/identity-distiller.d.ts +15 -0
- package/dist/memory/pipeline/identity-distiller.js +40 -0
- package/dist/memory/pipeline/l1-contradiction.d.ts +7 -0
- package/dist/memory/pipeline/l1-contradiction.js +66 -0
- package/dist/memory/pipeline/l1-dedup.d.ts +23 -0
- package/dist/memory/pipeline/l1-dedup.js +39 -0
- package/dist/memory/pipeline/l1-extractor.d.ts +21 -0
- package/dist/memory/pipeline/l1-extractor.js +180 -0
- package/dist/memory/pipeline/l2-direction-shift.d.ts +10 -0
- package/dist/memory/pipeline/l2-direction-shift.js +27 -0
- package/dist/memory/pipeline/l2-scene.d.ts +15 -0
- package/dist/memory/pipeline/l2-scene.js +140 -0
- package/dist/memory/pipeline/l3-distiller.d.ts +15 -0
- package/dist/memory/pipeline/l3-distiller.js +40 -0
- package/dist/memory/pipeline/neural-spark.d.ts +27 -0
- package/dist/memory/pipeline/neural-spark.js +78 -0
- package/dist/memory/pipeline/skill-prewarm.d.ts +63 -0
- package/dist/memory/pipeline/skill-prewarm.js +127 -0
- package/dist/memory/pipeline/task-queue.d.ts +54 -0
- package/dist/memory/pipeline/task-queue.js +117 -0
- package/dist/memory/prompts/cognitive-contradiction.d.ts +1 -0
- package/dist/memory/prompts/cognitive-contradiction.js +25 -0
- package/dist/memory/prompts/cognitive-extraction.d.ts +10 -0
- package/dist/memory/prompts/cognitive-extraction.js +114 -0
- package/dist/memory/prompts/core-identity.d.ts +6 -0
- package/dist/memory/prompts/core-identity.js +60 -0
- package/dist/memory/prompts/focus-direction-shift.d.ts +5 -0
- package/dist/memory/prompts/focus-direction-shift.js +32 -0
- package/dist/memory/prompts/focus-scene-cluster.d.ts +2 -0
- package/dist/memory/prompts/focus-scene-cluster.js +33 -0
- package/dist/memory/prompts/focus-scene.d.ts +7 -0
- package/dist/memory/prompts/focus-scene.js +40 -0
- package/dist/memory/prompts/graph-extraction-batch.d.ts +14 -0
- package/dist/memory/prompts/graph-extraction-batch.js +54 -0
- package/dist/memory/prompts/graph-extraction.d.ts +2 -0
- package/dist/memory/prompts/graph-extraction.js +53 -0
- package/dist/memory/prompts/l1-contradiction-batch.d.ts +16 -0
- package/dist/memory/prompts/l1-contradiction-batch.js +47 -0
- package/dist/memory/prompts/l1-contradiction.d.ts +1 -0
- package/dist/memory/prompts/l1-contradiction.js +25 -0
- package/dist/memory/prompts/l1-extraction.d.ts +10 -0
- package/dist/memory/prompts/l1-extraction.js +114 -0
- package/dist/memory/prompts/l2-direction-shift.d.ts +5 -0
- package/dist/memory/prompts/l2-direction-shift.js +32 -0
- package/dist/memory/prompts/l2-scene-cluster.d.ts +2 -0
- package/dist/memory/prompts/l2-scene-cluster.js +33 -0
- package/dist/memory/prompts/l2-scene.d.ts +7 -0
- package/dist/memory/prompts/l2-scene.js +40 -0
- package/dist/memory/prompts/l3-persona.d.ts +6 -0
- package/dist/memory/prompts/l3-persona.js +60 -0
- package/dist/memory/recall.d.ts +47 -0
- package/dist/memory/recall.js +427 -0
- package/dist/memory/redaction.d.ts +1 -0
- package/dist/memory/redaction.js +24 -0
- package/dist/memory/retry.d.ts +13 -0
- package/dist/memory/retry.js +53 -0
- package/dist/memory/scheduler.d.ts +9 -0
- package/dist/memory/scheduler.js +16 -0
- package/dist/memory/skill-hints-loader.d.ts +30 -0
- package/dist/memory/skill-hints-loader.js +100 -0
- package/dist/memory/store/embedding.d.ts +16 -0
- package/dist/memory/store/embedding.js +68 -0
- package/dist/memory/store/reranker.d.ts +24 -0
- package/dist/memory/store/reranker.js +83 -0
- package/dist/memory/store/sqlite.d.ts +167 -0
- package/dist/memory/store/sqlite.js +1816 -0
- package/dist/memory/store/types.d.ts +101 -0
- package/dist/memory/store/types.js +1 -0
- package/dist/memory/types.d.ts +207 -0
- package/dist/memory/types.js +7 -0
- package/dist/memory/validation.d.ts +441 -0
- package/dist/memory/validation.js +129 -0
- package/dist/memory/working/canvas.d.ts +5 -0
- package/dist/memory/working/canvas.js +43 -0
- package/dist/memory/working/offload.d.ts +71 -0
- package/dist/memory/working/offload.js +211 -0
- package/dist/memory/working/step-log.d.ts +16 -0
- package/dist/memory/working/step-log.js +35 -0
- package/dist/registry.d.ts +34 -0
- package/dist/registry.js +305 -0
- package/dist/resolver.d.ts +17 -0
- package/dist/resolver.js +126 -0
- package/dist/scripts/validate-foreign-workspace-path.d.ts +1 -0
- package/dist/scripts/validate-foreign-workspace-path.js +39 -0
- package/dist/tools/agent_memory_tools.d.ts +485 -0
- package/dist/tools/agent_memory_tools.js +793 -0
- package/dist/tools/create_skill.d.ts +46 -0
- package/dist/tools/create_skill.js +46 -0
- package/dist/tools/get_doc.d.ts +21 -0
- package/dist/tools/get_doc.js +24 -0
- package/dist/tools/get_persona.d.ts +15 -0
- package/dist/tools/get_persona.js +20 -0
- package/dist/tools/get_reference.d.ts +15 -0
- package/dist/tools/get_reference.js +20 -0
- package/dist/tools/get_skill.d.ts +34 -0
- package/dist/tools/get_skill.js +65 -0
- package/dist/tools/get_template_doc.d.ts +21 -0
- package/dist/tools/get_template_doc.js +24 -0
- package/dist/tools/list_docs.d.ts +15 -0
- package/dist/tools/list_docs.js +16 -0
- package/dist/tools/list_skills.d.ts +18 -0
- package/dist/tools/list_skills.js +17 -0
- package/dist/tools/list_template_docs.d.ts +15 -0
- package/dist/tools/list_template_docs.js +16 -0
- package/dist/tools/memory-engineering.d.ts +225 -0
- package/dist/tools/memory-engineering.js +284 -0
- package/dist/tools/memory-explain.d.ts +34 -0
- package/dist/tools/memory-explain.js +109 -0
- package/dist/tools/memory-governance.d.ts +171 -0
- package/dist/tools/memory-governance.js +224 -0
- package/dist/tools/memory-hooks.d.ts +67 -0
- package/dist/tools/memory-hooks.js +102 -0
- package/dist/tools/memory-working.d.ts +98 -0
- package/dist/tools/memory-working.js +101 -0
- package/dist/tools/memory_capture_turn.d.ts +66 -0
- package/dist/tools/memory_capture_turn.js +85 -0
- package/dist/tools/memory_consolidate.d.ts +55 -0
- package/dist/tools/memory_consolidate.js +176 -0
- package/dist/tools/memory_contradictions.d.ts +53 -0
- package/dist/tools/memory_contradictions.js +52 -0
- package/dist/tools/memory_graph_query.d.ts +51 -0
- package/dist/tools/memory_graph_query.js +35 -0
- package/dist/tools/memory_mark_cited.d.ts +43 -0
- package/dist/tools/memory_mark_cited.js +63 -0
- package/dist/tools/memory_recall.d.ts +77 -0
- package/dist/tools/memory_recall.js +81 -0
- package/dist/tools/memory_register_skill_hints.d.ts +49 -0
- package/dist/tools/memory_register_skill_hints.js +55 -0
- package/dist/tools/memory_resolve_session.d.ts +24 -0
- package/dist/tools/memory_resolve_session.js +133 -0
- package/dist/tools/memory_search.d.ts +146 -0
- package/dist/tools/memory_search.js +84 -0
- package/dist/tools/search_skills.d.ts +18 -0
- package/dist/tools/search_skills.js +17 -0
- package/dist/tools/update_doc.d.ts +24 -0
- package/dist/tools/update_doc.js +35 -0
- package/dist/tools/update_skill.d.ts +30 -0
- package/dist/tools/update_skill.js +80 -0
- package/dist/types.d.ts +81 -0
- package/dist/types.js +4 -0
- package/dist/writer.d.ts +30 -0
- package/dist/writer.js +220 -0
- package/docs/TEMPLATE ONLY +1 -0
- package/docs/api/API.md +64 -0
- package/docs/api/security/SECURITY.md +58 -0
- package/docs/deployment/DockerDeployment.md +30 -0
- package/docs/design/Design.md +59 -0
- package/docs/design/themes/apple.md +101 -0
- package/docs/design/themes/dieter-grid.md +100 -0
- package/docs/design/themes/gallery-white.md +100 -0
- package/docs/design/themes/pinterest.md +101 -0
- package/docs/design/themes/realty-open-house.md +101 -0
- package/docs/design/themes/vodafone.md +101 -0
- package/docs/hooks/Hooks.md +30 -0
- package/docs/schema/Schema.md +35 -0
- package/docs/strategy/ScalingStrategy.md +19 -0
- package/package.json +88 -0
- package/references/accessibility-checklist.md +160 -0
- package/references/orchestration-patterns.md +370 -0
- package/references/performance-checklist.md +153 -0
- package/references/security-checklist.md +134 -0
- package/references/testing-patterns.md +236 -0
- package/skills/agent/adr-skill/SKILL.md +299 -0
- package/skills/agent/agentic-engineering-workflow/SKILL.md +95 -0
- package/skills/agent/bootstrap-skill/SKILL.md +103 -0
- package/skills/agent/context-engineering/SKILL.md +307 -0
- package/skills/agent/debugging-and-error-recovery/SKILL.md +308 -0
- package/skills/agent/developer-growth-analysis/SKILL.md +328 -0
- package/skills/agent/doubt-driven-skill/SKILL.md +249 -0
- package/skills/agent/handover-skill/SKILL.md +112 -0
- package/skills/agent/idea-refine-skill/SKILL.md +185 -0
- package/skills/agent/idea-refine-skill/examples.md +238 -0
- package/skills/agent/idea-refine-skill/frameworks.md +99 -0
- package/skills/agent/idea-refine-skill/refinement-criteria.md +113 -0
- package/skills/agent/interview-skill/SKILL.md +226 -0
- package/skills/agent/planning-skill/SKILL.md +270 -0
- package/skills/agent/skill-authoring/SKILL.md +189 -0
- package/skills/agent/source-driven-skill/SKILL.md +197 -0
- package/skills/agent/spec-driven-skill/SKILL.md +221 -0
- package/skills/agent/sync-skill/SKILL.md +92 -0
- package/skills/agent/using-agent-skills/SKILL.md +189 -0
- package/skills/api/a11y-skill/SKILL.md +88 -0
- package/skills/api/api-skill/SKILL.md +123 -0
- package/skills/api/auth-skill/SKILL.md +80 -0
- package/skills/api/debug-skill/SKILL.md +535 -0
- package/skills/api/performance-skill/SKILL.md +100 -0
- package/skills/api/testing-skill/SKILL.md +100 -0
- package/skills/codebase/code-review-and-quality/SKILL.md +228 -0
- package/skills/codebase/code-simplification/SKILL.md +352 -0
- package/skills/codebase/code-structure-cleanup/SKILL.md +142 -0
- package/skills/codebase/concerns-skill/SKILL.md +89 -0
- package/skills/codebase/conventions-skill/SKILL.md +95 -0
- package/skills/codebase/doc-management-skill/SKILL.md +47 -0
- package/skills/codebase/git-workflow-skill/SKILL.md +312 -0
- package/skills/communication/1-3-1-rule/SKILL.md +120 -0
- package/skills/design/brutalist-skill/SKILL.md +131 -0
- package/skills/design/concept-diagrams/SKILL.md +387 -0
- package/skills/design/concept-diagrams/examples/apartment-floor-plan-conversion.md +244 -0
- package/skills/design/concept-diagrams/examples/automated-password-reset-flow.md +276 -0
- package/skills/design/concept-diagrams/examples/autonomous-llm-research-agent-flow.md +240 -0
- package/skills/design/concept-diagrams/examples/banana-journey-tree-to-smoothie.md +161 -0
- package/skills/design/concept-diagrams/examples/commercial-aircraft-structure.md +209 -0
- package/skills/design/concept-diagrams/examples/cpu-ooo-microarchitecture.md +236 -0
- package/skills/design/concept-diagrams/examples/electricity-grid-flow.md +182 -0
- package/skills/design/concept-diagrams/examples/feature-film-production-pipeline.md +172 -0
- package/skills/design/concept-diagrams/examples/hospital-emergency-department-flow.md +165 -0
- package/skills/design/concept-diagrams/examples/ml-benchmark-grouped-bar-chart.md +114 -0
- package/skills/design/concept-diagrams/examples/place-order-uml-sequence.md +325 -0
- package/skills/design/concept-diagrams/examples/smart-city-infrastructure.md +173 -0
- package/skills/design/concept-diagrams/examples/smartphone-layer-anatomy.md +154 -0
- package/skills/design/concept-diagrams/examples/sn2-reaction-mechanism.md +247 -0
- package/skills/design/concept-diagrams/examples/wind-turbine-structure.md +338 -0
- package/skills/design/concept-diagrams/references/dashboard-patterns.md +43 -0
- package/skills/design/concept-diagrams/references/infrastructure-patterns.md +144 -0
- package/skills/design/concept-diagrams/references/physical-shape-cookbook.md +42 -0
- package/skills/design/concept-diagrams/templates/template.html +174 -0
- package/skills/design/gpt-tasteskill/SKILL.md +114 -0
- package/skills/design/minimalist-skill/SKILL.md +116 -0
- package/skills/design/output-skill/SKILL.md +87 -0
- package/skills/design/redesign-skill/SKILL.md +213 -0
- package/skills/design/soft-skill/SKILL.md +132 -0
- package/skills/design/stitch-skill/EXAMPLE.md +121 -0
- package/skills/design/stitch-skill/SKILL.md +222 -0
- package/skills/design/taste-skill/SKILL.md +269 -0
- package/skills/devops/ci-cd-skill/SKILL.md +402 -0
- package/skills/devops/docker-skill/SKILL.md +297 -0
- package/skills/devops/domain-skill/SKILL.md +234 -0
- package/skills/lifecycle/changelog-generator/SKILL.md +135 -0
- package/skills/lifecycle/incremental-skill/SKILL.md +257 -0
- package/skills/lifecycle/migration-skill/SKILL.md +218 -0
- package/skills/lifecycle/shipping-skill/SKILL.md +321 -0
- package/skills/memory/agent-memory/SKILL.md +122 -0
- package/skills/qa/browser-testing-skill/SKILL.md +314 -0
- package/skills/ux/adversarial-ux-skill/SKILL.md +168 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 1-3-1-rule
|
|
3
|
+
description: Professional communication for high-agency engineers. Enforces the 1-3-1 rule to turn problems into decisions and minimizes synchronous friction.
|
|
4
|
+
hints:
|
|
5
|
+
- Frame the core issue in exactly one concise sentence (the '1' in 1-3-1).
|
|
6
|
+
- Provide exactly three distinct, viable options with structured pros and cons (the '3' in 1-3-1).
|
|
7
|
+
- Explicitly recommend exactly one option with a clear professional rationale (the '1' in 1-3-1).
|
|
8
|
+
- Detail a concrete, testable Definition of Done and step-by-step implementation plan for the recommendation.
|
|
9
|
+
- Revise the recommendation, DoD, and implementation plan dynamically if the user chooses a different option.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 1-3-1 Communication Rule
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
Structured decision-making format for when a task has multiple viable approaches and the user needs a clear recommendation. Produces a concise problem framing, three options with trade-offs, and an actionable plan for the recommended path.
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
- The user explicitly asks for a "1-3-1" response.
|
|
21
|
+
- The user says "give me options" or "what are my choices" for a technical decision.
|
|
22
|
+
- A task has multiple viable approaches with meaningful trade-offs (architecture, tooling, migration strategy).
|
|
23
|
+
- The user needs a proposal they can forward to a team or stakeholder.
|
|
24
|
+
|
|
25
|
+
Do NOT use for simple questions with one obvious answer, debugging sessions, or tasks where the user has already decided on an approach.
|
|
26
|
+
|
|
27
|
+
## Workflow
|
|
28
|
+
|
|
29
|
+
1. **Problem** (one sentence)
|
|
30
|
+
- State the core decision or desired outcome in a single concise sentence.
|
|
31
|
+
- Focus on the *what*, not the *how* — no implementation details, tool names, or specific technologies.
|
|
32
|
+
- Keep it tight. If you need "and", you're describing two problems.
|
|
33
|
+
|
|
34
|
+
2. **Options** (exactly three)
|
|
35
|
+
- Present three distinct, viable approaches labeled A, B, C.
|
|
36
|
+
- Each option gets a brief description, pros, and cons.
|
|
37
|
+
- Options should represent genuinely different strategies, not minor variations of the same approach.
|
|
38
|
+
|
|
39
|
+
3. **Recommendation** (one option)
|
|
40
|
+
- State which option you recommend and why, based on the user's context and priorities.
|
|
41
|
+
- Be direct — this is your professional judgment, not a hedge.
|
|
42
|
+
|
|
43
|
+
4. **Definition of Done**
|
|
44
|
+
- List the specific success criteria for the recommended option.
|
|
45
|
+
- These are concrete, verifiable outcomes — not vague aspirations.
|
|
46
|
+
- If the user picks a different option, revise this section to match.
|
|
47
|
+
|
|
48
|
+
5. **Implementation Plan**
|
|
49
|
+
- Concrete steps to execute the recommended option.
|
|
50
|
+
- Include specific commands, tools, or actions where applicable.
|
|
51
|
+
- If the user picks a different option, revise this section to match.
|
|
52
|
+
|
|
53
|
+
## Required Checks
|
|
54
|
+
|
|
55
|
+
- Response has exactly one Problem sentence.
|
|
56
|
+
- Response has exactly three Options (A, B, C) with pros and cons for each.
|
|
57
|
+
- Response has a single Recommendation that picks one option with reasoning.
|
|
58
|
+
- Definition of Done and Implementation Plan align with the recommended option.
|
|
59
|
+
- If the user selects a different option, Recommendation, DoD, and Implementation Plan update accordingly.
|
|
60
|
+
|
|
61
|
+
## Example
|
|
62
|
+
|
|
63
|
+
User: "Give me a 1-3-1 for adding retry logic to our API client."
|
|
64
|
+
|
|
65
|
+
Agent:
|
|
66
|
+
|
|
67
|
+
**Problem:** API calls to external services fail intermittently under load and need graceful retry handling.
|
|
68
|
+
|
|
69
|
+
**Options:**
|
|
70
|
+
|
|
71
|
+
- **Option A: Exponential backoff with jitter in a shared utility.**
|
|
72
|
+
Pros: Simple, well-understood pattern; single implementation shared across all callers.
|
|
73
|
+
Cons: No circuit-breaking; callers still block during retries.
|
|
74
|
+
|
|
75
|
+
- **Option B: Retry library (tenacity) as a decorator on each endpoint call.**
|
|
76
|
+
Pros: Configurable per-endpoint; built-in support for circuit breakers and rate limits.
|
|
77
|
+
Cons: Adds a dependency; decorator pattern can obscure control flow.
|
|
78
|
+
|
|
79
|
+
- **Option C: Queue-based async retry with dead letter handling.**
|
|
80
|
+
Pros: Non-blocking; failed calls are tracked and replayable; scales well.
|
|
81
|
+
Cons: Significant complexity increase; requires a queue backend; overkill for low-volume services.
|
|
82
|
+
|
|
83
|
+
**Recommendation:** Option A. The call volume doesn't justify queue infrastructure, and a shared utility with exponential backoff + jitter covers the failure mode cleanly without new dependencies.
|
|
84
|
+
|
|
85
|
+
**Definition of Done:**
|
|
86
|
+
- `api_retry()` utility handles transient HTTP errors (429, 502, 503, 504).
|
|
87
|
+
- Retries up to 3 times with exponential backoff and jitter.
|
|
88
|
+
- All external API calls route through the retry utility.
|
|
89
|
+
- Logs each retry attempt with endpoint and attempt number.
|
|
90
|
+
- Tests cover retry exhaustion, immediate success, and transient-then-success scenarios.
|
|
91
|
+
|
|
92
|
+
**Implementation Plan:**
|
|
93
|
+
1. Create `utils/api_retry.py` with configurable max retries, base delay, and retryable status codes.
|
|
94
|
+
2. Add jitter using `random.uniform(0, base_delay)` to prevent thundering herd.
|
|
95
|
+
3. Wrap existing API calls in `api_client.py` with the retry utility.
|
|
96
|
+
4. Add unit tests mocking HTTP responses for each retry scenario.
|
|
97
|
+
5. Verify under load with a simple stress test against a flaky endpoint mock.
|
|
98
|
+
|
|
99
|
+
## Common Rationalizations
|
|
100
|
+
|
|
101
|
+
| Rationalization | Reality |
|
|
102
|
+
|---|---|
|
|
103
|
+
| "The options are too similar to list three distinct paths." | There are always different dimensions: speed of implementation, operational complexity, security/reliability, or third-party dependencies. Find the genuine trade-offs. |
|
|
104
|
+
| "I'll just ask the user what they want instead of giving a recommendation." | High-agency professionals do not offload decision-making. Presenting raw options without a recommendation wastes user time. |
|
|
105
|
+
| "This decision is too simple to need a 1-3-1 response." | A simplified 1-3-1 can be extremely short (e.g. 1 sentence problem, 3 bullet options, 1 sentence recommendation). It forces clarity and consensus. |
|
|
106
|
+
|
|
107
|
+
## Red Flags
|
|
108
|
+
|
|
109
|
+
- Listing more or fewer than three options.
|
|
110
|
+
- The "Problem" statement is multiple sentences or describes implementation details instead of the core goal.
|
|
111
|
+
- Giving a vague recommendation (e.g. "it depends on what you prefer" or "either option works").
|
|
112
|
+
- Implementation plan and DoD do not align with the recommended option.
|
|
113
|
+
|
|
114
|
+
## Verification
|
|
115
|
+
|
|
116
|
+
After completing this skill, confirm:
|
|
117
|
+
- [ ] The response contains exactly one single-sentence problem framing.
|
|
118
|
+
- [ ] Exactly three distinct options (A, B, C) are presented with explicit pros/cons.
|
|
119
|
+
- [ ] A definitive, professional recommendation is stated.
|
|
120
|
+
- [ ] The Definition of Done and Implementation Plan are fully tailored to the chosen option.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brutalist-skill
|
|
3
|
+
description: Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
|
|
4
|
+
hints:
|
|
5
|
+
- "Select exactly ONE substrate: Swiss Industrial Print (light) or CRT Terminal (dark); never mix them."
|
|
6
|
+
- "Enforce absolute 90-degree corners; border-radius is strictly prohibited."
|
|
7
|
+
- "Construct a strict CSS Grid where lines are generated using gaps rather than thick borders."
|
|
8
|
+
- "Utilize massive fluid typography for headers, and clean, tracked monospace for micro data."
|
|
9
|
+
- "Integrate ASCII indicators, crosshairs, and industrial symbols as pure structural geometry."
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SKILL: Industrial Brutalism & Tactical Telemetry UI
|
|
13
|
+
|
|
14
|
+
## 1. Skill Meta
|
|
15
|
+
**Name:** Industrial Brutalism & Tactical Telemetry Interface Engineering
|
|
16
|
+
**Description:** Advanced proficiency in architecting web interfaces that synthesize mid-century Swiss Typographic design, industrial manufacturing manuals, and retro-futuristic aerospace/military terminal interfaces. This discipline requires absolute mastery over rigid modular grids, extreme typographic scale contrast, purely utilitarian color palettes, and the programmatic simulation of analog degradation (halftones, CRT scanlines, bitmap dithering). The objective is to construct digital environments that project raw functionality, mechanical precision, and high data density, deliberately discarding conventional consumer UI patterns.
|
|
17
|
+
|
|
18
|
+
## 2. Visual Archetypes
|
|
19
|
+
The design system operates by merging two distinct but highly compatible visual paradigms. **Pick ONE per project and commit to it. Do not alternate or mix both modes within the same interface.**
|
|
20
|
+
|
|
21
|
+
### 2.1 Swiss Industrial Print
|
|
22
|
+
Derived from 1960s corporate identity systems and heavy machinery blueprints.
|
|
23
|
+
* **Characteristics:** High-contrast light modes (newsprint/off-white substrates). Reliance on monolithic, heavy sans-serif typography. Unforgiving structural grids outlined by visible dividing lines. Aggressive, asymmetric use of negative space punctuated by oversized, viewport-bleeding numerals or letterforms. Heavy use of primary red as an alert/accent color.
|
|
24
|
+
|
|
25
|
+
### 2.2 Tactical Telemetry & CRT Terminal
|
|
26
|
+
Derived from classified military databases, legacy mainframes, and aerospace Heads-Up Displays (HUDs).
|
|
27
|
+
* **Characteristics:** Dark mode exclusivity. High-density tabular data presentation. Absolute dominance of monospaced typography. Integration of technical framing devices (ASCII brackets, crosshairs). Application of simulated hardware limitations (phosphor glow, scanlines, low bit-depth rendering).
|
|
28
|
+
|
|
29
|
+
## 3. Typographic Architecture
|
|
30
|
+
Typography is the primary structural and decorative infrastructure. Imagery is secondary. The system demands extreme variance in scale, weight, and spacing.
|
|
31
|
+
|
|
32
|
+
### 3.1 Macro-Typography (Structural Headers)
|
|
33
|
+
* **Classification:** Neo-Grotesque / Heavy Sans-Serif.
|
|
34
|
+
* **Optimal Web Fonts:** Neue Haas Grotesk (Black), Inter (Extra Bold/Black), Archivo Black, Roboto Flex (Heavy), Monument Extended.
|
|
35
|
+
* **Implementation Parameters:**
|
|
36
|
+
* **Scale:** Deployed at massive scales using fluid typography (e.g., `clamp(4rem, 10vw, 15rem)`).
|
|
37
|
+
* **Tracking (Letter-spacing):** Extremely tight, often negative (`-0.03em` to `-0.06em`), forcing glyphs to form solid architectural blocks.
|
|
38
|
+
* **Leading (Line-height):** Highly compressed (`0.85` to `0.95`).
|
|
39
|
+
* **Casing:** Exclusively uppercase for structural impact.
|
|
40
|
+
|
|
41
|
+
### 3.2 Micro-Typography (Data & Telemetry)
|
|
42
|
+
* **Classification:** Monospace / Technical Sans.
|
|
43
|
+
* **Optimal Web Fonts:** JetBrains Mono, IBM Plex Mono, Space Mono, VT323, Courier Prime.
|
|
44
|
+
* **Implementation Parameters:**
|
|
45
|
+
* **Scale:** Fixed and small (`10px` to `14px` / `0.7rem` to `0.875rem`).
|
|
46
|
+
* **Tracking:** Generous (`0.05em` to `0.1em`) to simulate mechanical typewriter spacing or terminal matrices.
|
|
47
|
+
* **Leading:** Standard to tight (`1.2` to `1.4`).
|
|
48
|
+
* **Casing:** Exclusively uppercase. Used for all metadata, navigation, unit IDs, and coordinates.
|
|
49
|
+
|
|
50
|
+
### 3.3 Textural Contrast (Artistic Disruption)
|
|
51
|
+
* **Classification:** High-Contrast Serif.
|
|
52
|
+
* **Optimal Web Fonts:** Playfair Display, EB Garamond, Times New Roman.
|
|
53
|
+
* **Implementation Parameters:** Used exceedingly sparingly. Must be subjected to heavy post-processing (halftone filters, 1-bit dithering) to degrade vector perfection and create textural juxtaposition against the clean sans-serifs.
|
|
54
|
+
|
|
55
|
+
## 4. Color System
|
|
56
|
+
The color architecture is uncompromising. Gradients, soft drop shadows, and modern translucency are strictly prohibited. Colors simulate physical media or primitive emissive displays.
|
|
57
|
+
|
|
58
|
+
**CRITICAL: Choose ONE substrate palette per project and use it consistently. Never mix light and dark substrates within the same interface.**
|
|
59
|
+
|
|
60
|
+
### If Swiss Industrial Print (Light):
|
|
61
|
+
* **Background:** `#F4F4F0` or `#EAE8E3` (Matte, unbleached documentation paper).
|
|
62
|
+
* **Foreground:** `#050505` to `#111111` (Carbon Ink).
|
|
63
|
+
* **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). This is the ONLY accent color. Used for strike-throughs, thick structural dividing lines, or vital data highlights.
|
|
64
|
+
|
|
65
|
+
### If Tactical Telemetry (Dark):
|
|
66
|
+
* **Background:** `#0A0A0A` or `#121212` (Deactivated CRT. Avoid pure `#000000`).
|
|
67
|
+
* **Foreground:** `#EAEAEA` (White phosphor). This is the primary text color.
|
|
68
|
+
* **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). Same red, same rules.
|
|
69
|
+
* **Terminal Green (`#4AF626`):** Optional. Use ONLY for a single specific UI element (e.g., one status indicator or one data readout) — never as a general text color. If it doesn't serve a clear purpose, omit it entirely.
|
|
70
|
+
|
|
71
|
+
## 5. Layout and Spatial Engineering
|
|
72
|
+
The layout must appear mathematically engineered. It rejects conventional web padding in favor of visible compartmentalization.
|
|
73
|
+
|
|
74
|
+
* **The Blueprint Grid:** Strict adherence to CSS Grid architectures. Elements do not float; they are anchored precisely to grid tracks and intersections.
|
|
75
|
+
* **Visible Compartmentalization:** Extensive utilization of solid borders (`1px` or `2px solid`) to delineate distinct zones of information. Horizontal rules (`<hr>`) frequently span the entire container width to segregate operational units.
|
|
76
|
+
* **Bimodal Density:** Layouts oscillate between extreme data density (tightly packed monospace metadata clustered together) and vast expanses of calculated negative space framing macro-typography.
|
|
77
|
+
* **Geometry:** Absolute rejection of `border-radius`. All corners must be exactly 90 degrees to enforce mechanical rigidity.
|
|
78
|
+
|
|
79
|
+
## 6. UI Components and Symbology
|
|
80
|
+
Standard web UI conventions are replaced with utilitarian, industrial graphic elements.
|
|
81
|
+
|
|
82
|
+
* **Syntax Decoration:** Utilization of ASCII characters to frame data points.
|
|
83
|
+
* *Framing:* `[ DELIVERY SYSTEMS ]`, `< RE-IND >`
|
|
84
|
+
* *Directional:* `>>>`, `///`, `\\\\`
|
|
85
|
+
* **Industrial Markers:** Prominent integration of registration (`®`), copyright (`©`), and trademark (`™`) symbols functioning as structural geometric elements rather than legal text.
|
|
86
|
+
* **Technical Assets:** Integration of crosshairs (`+`) at grid intersections, repeating vertical lines (barcodes), thick horizontal warning stripes, and randomized string data (e.g., `REV 2.6`, `UNIT / D-01`) to simulate active mechanical processes.
|
|
87
|
+
|
|
88
|
+
## 7. Textural and Post-Processing Effects
|
|
89
|
+
To prevent the design from appearing purely digital, simulated analog degradation is engineered into the frontend via CSS and SVG filters.
|
|
90
|
+
|
|
91
|
+
* **Halftone and 1-Bit Dithering:** Transforming continuous-tone images or large serif typography into dot-matrix patterns. Achieved via pre-processing or CSS `mix-blend-mode: multiply` overlays combined with SVG radial dot patterns.
|
|
92
|
+
* **CRT Scanlines:** For terminal interfaces, applying a `repeating-linear-gradient` to the background to simulate horizontal electron beam sweeps (e.g., `repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px)`).
|
|
93
|
+
* **Mechanical Noise:** A global, low-opacity SVG static/noise filter applied to the DOM root to introduce a unified physical grain across both dark and light modes.
|
|
94
|
+
|
|
95
|
+
## 8. Web Engineering Directives
|
|
96
|
+
1. **Grid Determinism:** Utilize `display: grid; gap: 1px;` with contrasting parent/child background colors to generate mathematically perfect, razor-thin dividing lines without complex border declarations.
|
|
97
|
+
2. **Semantic Rigidity:** Construct the DOM using precise semantic tags (`<data>`, `<samp>`, `<kbd>`, `<output>`, `<dl>`) to accurately reflect the technical nature of the telemetry.
|
|
98
|
+
3. **Typography Clamping:** Implement CSS `clamp()` functions exclusively for macro-typography to ensure massive text scales aggressively while maintaining structural integrity across viewports.
|
|
99
|
+
|
|
100
|
+
## Overview
|
|
101
|
+
This skill governs the execution of Industrial Brutalism and Tactical Telemetry UIs. It rejects modern consumer-centric visual cliches (rounded corners, soft dropshadows, complex gradients) in favor of high-contrast Swiss printing and terminal interface styles.
|
|
102
|
+
|
|
103
|
+
## When to Use
|
|
104
|
+
- **Use when:** Building telemetry dashboards, software dev tools, visual portfolios, dense terminal views, or raw editorial layouts.
|
|
105
|
+
- **NOT for:** standard consumer SaaS, friendly marketing pages, or e-commerce checkouts where high user conversion relies on soft, warm aesthetics.
|
|
106
|
+
|
|
107
|
+
## Workflow
|
|
108
|
+
1. **Establish Substrate:** Select either Swiss Industrial Print (light substrate, off-white/carbon ink) or CRT Terminal (dark substrate, deactivated CRT/white phosphor).
|
|
109
|
+
2. **Setup Mathematical Grid:** Architect layouts with strict CSS Grid. Outline dividing lines cleanly.
|
|
110
|
+
3. **Draft Typographic Scale:** Define massive macro-typography headers (`clamp()`) and highly legible, small monospace text for subheaders and telemetry details.
|
|
111
|
+
4. **Decorate Structurally:** Add ASCII framing indicators, industrial symbols, crosshairs, or repeating barcodes to construct mechanical layouts.
|
|
112
|
+
|
|
113
|
+
## Common Rationalizations
|
|
114
|
+
| Rationalization | Reality |
|
|
115
|
+
|---|---|
|
|
116
|
+
| A tiny border-radius will soften it | Softening compromises the raw, mechanical integrity of industrial brutalism. All corners must be exactly 90 degrees. |
|
|
117
|
+
| Gradients and blurs look more futuristic | Classic retro-futuristic telemetry relies on strict hardware limitations. Flat colors are mandatory. |
|
|
118
|
+
| Mixed substrate modes look organic | Mixing light and dark themes on the same screen breaks visual cohesion and physical substrate logic. |
|
|
119
|
+
|
|
120
|
+
## Red Flags
|
|
121
|
+
- Mixing warm paper tones with harsh pure dark mode colors on a single viewport.
|
|
122
|
+
- Unintentional use of standard browser-default or consumer SaaS fonts (like Inter or Open Sans) for display.
|
|
123
|
+
- Rounded corners (`border-radius`) sneaking into buttons or cards.
|
|
124
|
+
|
|
125
|
+
## Verification
|
|
126
|
+
After completing the skill, confirm:
|
|
127
|
+
- [ ] Only a single substrate mode (Swiss Print or CRT Terminal) is active on the page.
|
|
128
|
+
- [ ] No `border-radius` exists on any elements.
|
|
129
|
+
- [ ] All elements are aligned to a deterministic grid.
|
|
130
|
+
- [ ] Text uses high type contrast (monolithic sans-serif vs small tracked monospace).
|
|
131
|
+
- [ ] All icons and graphics align with the raw, structural telemetry aesthetic.
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: concept-diagrams
|
|
3
|
+
description: Generate flat, minimal light/dark-aware SVG diagrams. Unified visual language with semantic colors and automatic dark mode.
|
|
4
|
+
hints:
|
|
5
|
+
- "Always output semantic color classes (c-purple, c-teal, etc.) on <g> or shape elements, never on line connectors."
|
|
6
|
+
- "Ensure every <text> element carries a class (th, ts, or t) and uses sentence case."
|
|
7
|
+
- "Verify box widths mathematically: width >= (char_count * px_per_char) + 48."
|
|
8
|
+
- "Include the standard arrow marker <defs> block in every SVG."
|
|
9
|
+
- "Serve local diagrams on 127.0.0.1 for security; never expose on 0.0.0.0."
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Concept Diagrams
|
|
13
|
+
|
|
14
|
+
Generate production-quality SVG diagrams with a unified flat, minimal design system. Output is a single self-contained HTML file that renders identically in any modern browser, with automatic light/dark mode.
|
|
15
|
+
|
|
16
|
+
## Scope
|
|
17
|
+
|
|
18
|
+
**Best suited for:**
|
|
19
|
+
- Physics setups, chemistry mechanisms, math curves, biology
|
|
20
|
+
- Physical objects (aircraft, turbines, smartphones, mechanical watches, cells)
|
|
21
|
+
- Anatomy, cross-sections, exploded layer views
|
|
22
|
+
- Floor plans, architectural conversions
|
|
23
|
+
- Narrative journeys (lifecycle of X, process of Y)
|
|
24
|
+
- Hub-spoke system integrations (smart city, IoT networks, electricity grids)
|
|
25
|
+
- Educational / textbook-style visuals in any domain
|
|
26
|
+
- Quantitative charts (grouped bars, energy profiles)
|
|
27
|
+
|
|
28
|
+
**Look elsewhere first for:**
|
|
29
|
+
- Dedicated software / cloud infrastructure architecture with a dark tech aesthetic (consider `architecture-diagram` if available)
|
|
30
|
+
- Hand-drawn whiteboard sketches (consider `excalidraw` if available)
|
|
31
|
+
- Animated explainers or video output (consider an animation skill)
|
|
32
|
+
|
|
33
|
+
If a more specialized skill is available for the subject, prefer that. If none fits, this skill can serve as a general-purpose SVG diagram fallback — the output will carry the clean educational aesthetic described below, which is a reasonable default for almost any subject.
|
|
34
|
+
|
|
35
|
+
## Workflow
|
|
36
|
+
|
|
37
|
+
1. Decide on the diagram type (see Diagram Types below).
|
|
38
|
+
2. Lay out components using the Design System rules.
|
|
39
|
+
3. Write the full HTML page using `templates/template.html` as the wrapper — paste your SVG where the template says `<!-- PASTE SVG HERE -->`.
|
|
40
|
+
4. Save as a standalone `.html` file (for example `~/my-diagram.html` or `./my-diagram.html`).
|
|
41
|
+
5. User opens it directly in a browser — no server, no dependencies.
|
|
42
|
+
|
|
43
|
+
Optional: if the user wants a browsable gallery of multiple diagrams, see "Local Preview Server" at the bottom.
|
|
44
|
+
|
|
45
|
+
Load the HTML template:
|
|
46
|
+
```
|
|
47
|
+
skill_view(name="concept-diagrams", file_path="templates/template.html")
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The template embeds the full CSS design system (`c-*` color classes, text classes, light/dark variables, arrow marker styles). The SVG you generate relies on these classes being present on the hosting page.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Design System
|
|
55
|
+
|
|
56
|
+
### Philosophy
|
|
57
|
+
|
|
58
|
+
- **Flat**: no gradients, drop shadows, blur, glow, or neon effects.
|
|
59
|
+
- **Minimal**: show the essential. No decorative icons inside boxes.
|
|
60
|
+
- **Consistent**: same colors, spacing, typography, and stroke widths across every diagram.
|
|
61
|
+
- **Dark-mode ready**: all colors auto-adapt via CSS classes — no per-mode SVG.
|
|
62
|
+
|
|
63
|
+
### Color Palette
|
|
64
|
+
|
|
65
|
+
9 color ramps, each with 7 stops. Put the class name on a `<g>` or shape element; the template CSS handles both modes.
|
|
66
|
+
|
|
67
|
+
| Class | 50 (lightest) | 100 | 200 | 400 | 600 | 800 | 900 (darkest) |
|
|
68
|
+
|------------|---------------|---------|---------|---------|---------|---------|---------------|
|
|
69
|
+
| `c-purple` | #EEEDFE | #CECBF6 | #AFA9EC | #7F77DD | #534AB7 | #3C3489 | #26215C |
|
|
70
|
+
| `c-teal` | #E1F5EE | #9FE1CB | #5DCAA5 | #1D9E75 | #0F6E56 | #085041 | #04342C |
|
|
71
|
+
| `c-coral` | #FAECE7 | #F5C4B3 | #F0997B | #D85A30 | #993C1D | #712B13 | #4A1B0C |
|
|
72
|
+
| `c-pink` | #FBEAF0 | #F4C0D1 | #ED93B1 | #D4537E | #993556 | #72243E | #4B1528 |
|
|
73
|
+
| `c-gray` | #F1EFE8 | #D3D1C7 | #B4B2A9 | #888780 | #5F5E5A | #444441 | #2C2C2A |
|
|
74
|
+
| `c-blue` | #E6F1FB | #B5D4F4 | #85B7EB | #378ADD | #185FA5 | #0C447C | #042C53 |
|
|
75
|
+
| `c-green` | #EAF3DE | #C0DD97 | #97C459 | #639922 | #3B6D11 | #27500A | #173404 |
|
|
76
|
+
| `c-amber` | #FAEEDA | #FAC775 | #EF9F27 | #BA7517 | #854F0B | #633806 | #412402 |
|
|
77
|
+
| `c-red` | #FCEBEB | #F7C1C1 | #F09595 | #E24B4A | #A32D2D | #791F1F | #501313 |
|
|
78
|
+
|
|
79
|
+
#### Color Assignment Rules
|
|
80
|
+
|
|
81
|
+
Color encodes **meaning**, not sequence. Never cycle through colors like a rainbow.
|
|
82
|
+
|
|
83
|
+
- Group nodes by **category** — all nodes of the same type share one color.
|
|
84
|
+
- Use `c-gray` for neutral/structural nodes (start, end, generic steps, users).
|
|
85
|
+
- Use **2-3 colors per diagram**, not 6+.
|
|
86
|
+
- Prefer `c-purple`, `c-teal`, `c-coral`, `c-pink` for general categories.
|
|
87
|
+
- Reserve `c-blue`, `c-green`, `c-amber`, `c-red` for semantic meaning (info, success, warning, error).
|
|
88
|
+
|
|
89
|
+
Light/dark stop mapping (handled by the template CSS — just use the class):
|
|
90
|
+
- Light mode: 50 fill + 600 stroke + 800 title / 600 subtitle
|
|
91
|
+
- Dark mode: 800 fill + 200 stroke + 100 title / 200 subtitle
|
|
92
|
+
|
|
93
|
+
### Typography
|
|
94
|
+
|
|
95
|
+
Only two font sizes. No exceptions.
|
|
96
|
+
|
|
97
|
+
| Class | Size | Weight | Use |
|
|
98
|
+
|-------|------|--------|-----|
|
|
99
|
+
| `th` | 14px | 500 | Node titles, region labels |
|
|
100
|
+
| `ts` | 12px | 400 | Subtitles, descriptions, arrow labels |
|
|
101
|
+
| `t` | 14px | 400 | General text |
|
|
102
|
+
|
|
103
|
+
- **Sentence case always.** Never Title Case, never ALL CAPS.
|
|
104
|
+
- Every `<text>` MUST carry a class (`t`, `ts`, or `th`). No unclassed text.
|
|
105
|
+
- `dominant-baseline="central"` on all text inside boxes.
|
|
106
|
+
- `text-anchor="middle"` for centered text in boxes.
|
|
107
|
+
|
|
108
|
+
**Width estimation (approx):**
|
|
109
|
+
- 14px weight 500: ~8px per character
|
|
110
|
+
- 12px weight 400: ~6.5px per character
|
|
111
|
+
- Always verify: `box_width >= (char_count × px_per_char) + 48` (24px padding each side)
|
|
112
|
+
|
|
113
|
+
### Spacing & Layout
|
|
114
|
+
|
|
115
|
+
- **ViewBox**: `viewBox="0 0 680 H"` where H = content height + 40px buffer.
|
|
116
|
+
- **Safe area**: x=40 to x=640, y=40 to y=(H-40).
|
|
117
|
+
- **Between boxes**: 60px minimum gap.
|
|
118
|
+
- **Inside boxes**: 24px horizontal padding, 12px vertical padding.
|
|
119
|
+
- **Arrowhead gap**: 10px between arrowhead and box edge.
|
|
120
|
+
- **Single-line box**: 44px height.
|
|
121
|
+
- **Two-line box**: 56px height, 18px between title and subtitle baselines.
|
|
122
|
+
- **Container padding**: 20px minimum inside every container.
|
|
123
|
+
- **Max nesting**: 2-3 levels deep. Deeper gets unreadable at 680px width.
|
|
124
|
+
|
|
125
|
+
### Stroke & Shape
|
|
126
|
+
|
|
127
|
+
- **Stroke width**: 0.5px on all node borders. Not 1px, not 2px.
|
|
128
|
+
- **Rect rounding**: `rx="8"` for nodes, `rx="12"` for inner containers, `rx="16"` to `rx="20"` for outer containers.
|
|
129
|
+
- **Connector paths**: MUST have `fill="none"`. SVG defaults to `fill: black` otherwise.
|
|
130
|
+
|
|
131
|
+
### Arrow Marker
|
|
132
|
+
|
|
133
|
+
Include this `<defs>` block at the start of **every** SVG:
|
|
134
|
+
|
|
135
|
+
```xml
|
|
136
|
+
<defs>
|
|
137
|
+
<marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5"
|
|
138
|
+
markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
|
139
|
+
<path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke"
|
|
140
|
+
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
141
|
+
</marker>
|
|
142
|
+
</defs>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Use `marker-end="url(#arrow)"` on lines. The arrowhead inherits the line color via `context-stroke`.
|
|
146
|
+
|
|
147
|
+
### CSS Classes (Provided by the Template)
|
|
148
|
+
|
|
149
|
+
The template page provides:
|
|
150
|
+
|
|
151
|
+
- Text: `.t`, `.ts`, `.th`
|
|
152
|
+
- Neutral: `.box`, `.arr`, `.leader`, `.node`
|
|
153
|
+
- Color ramps: `.c-purple`, `.c-teal`, `.c-coral`, `.c-pink`, `.c-gray`, `.c-blue`, `.c-green`, `.c-amber`, `.c-red` (all with automatic light/dark mode)
|
|
154
|
+
|
|
155
|
+
You do **not** need to redefine these — just apply them in your SVG. The template file contains the full CSS definitions.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## SVG Boilerplate
|
|
160
|
+
|
|
161
|
+
Every SVG inside the template page starts with this exact structure:
|
|
162
|
+
|
|
163
|
+
```xml
|
|
164
|
+
<svg width="100%" viewBox="0 0 680 {HEIGHT}" xmlns="http://www.w3.org/2000/svg">
|
|
165
|
+
<defs>
|
|
166
|
+
<marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5"
|
|
167
|
+
markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
|
168
|
+
<path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke"
|
|
169
|
+
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
170
|
+
</marker>
|
|
171
|
+
</defs>
|
|
172
|
+
|
|
173
|
+
<!-- Diagram content here -->
|
|
174
|
+
|
|
175
|
+
</svg>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Replace `{HEIGHT}` with the actual computed height (last element bottom + 40px).
|
|
179
|
+
|
|
180
|
+
### Node Patterns
|
|
181
|
+
|
|
182
|
+
**Single-line node (44px):**
|
|
183
|
+
```xml
|
|
184
|
+
<g class="node c-blue">
|
|
185
|
+
<rect x="100" y="20" width="180" height="44" rx="8" stroke-width="0.5"/>
|
|
186
|
+
<text class="th" x="190" y="42" text-anchor="middle" dominant-baseline="central">Service name</text>
|
|
187
|
+
</g>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Two-line node (56px):**
|
|
191
|
+
```xml
|
|
192
|
+
<g class="node c-teal">
|
|
193
|
+
<rect x="100" y="20" width="200" height="56" rx="8" stroke-width="0.5"/>
|
|
194
|
+
<text class="th" x="200" y="38" text-anchor="middle" dominant-baseline="central">Service name</text>
|
|
195
|
+
<text class="ts" x="200" y="56" text-anchor="middle" dominant-baseline="central">Short description</text>
|
|
196
|
+
</g>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Connector (no label):**
|
|
200
|
+
```xml
|
|
201
|
+
<line x1="200" y1="76" x2="200" y2="120" class="arr" marker-end="url(#arrow)"/>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Container (dashed or solid):**
|
|
205
|
+
```xml
|
|
206
|
+
<g class="c-purple">
|
|
207
|
+
<rect x="40" y="92" width="600" height="300" rx="16" stroke-width="0.5"/>
|
|
208
|
+
<text class="th" x="66" y="116">Container label</text>
|
|
209
|
+
<text class="ts" x="66" y="134">Subtitle info</text>
|
|
210
|
+
</g>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Diagram Types
|
|
216
|
+
|
|
217
|
+
Choose the layout that fits the subject:
|
|
218
|
+
|
|
219
|
+
1. **Flowchart** — CI/CD pipelines, request lifecycles, approval workflows, data processing. Single-direction flow (top-down or left-right). Max 4-5 nodes per row.
|
|
220
|
+
2. **Structural / Containment** — Cloud infrastructure nesting, system architecture with layers. Large outer containers with inner regions. Dashed rects for logical groupings.
|
|
221
|
+
3. **API / Endpoint Map** — REST routes, GraphQL schemas. Tree from root, branching to resource groups, each containing endpoint nodes.
|
|
222
|
+
4. **Microservice Topology** — Service mesh, event-driven systems. Services as nodes, arrows for communication patterns, message queues between.
|
|
223
|
+
5. **Data Flow** — ETL pipelines, streaming architectures. Left-to-right flow from sources through processing to sinks.
|
|
224
|
+
6. **Physical / Structural** — Vehicles, buildings, hardware, anatomy. Use shapes that match the physical form — `<path>` for curved bodies, `<polygon>` for tapered shapes, `<ellipse>`/`<circle>` for cylindrical parts, nested `<rect>` for compartments. See `references/physical-shape-cookbook.md`.
|
|
225
|
+
7. **Infrastructure / Systems Integration** — Smart cities, IoT networks, multi-domain systems. Hub-spoke layout with central platform connecting subsystems. Semantic line styles (`.data-line`, `.power-line`, `.water-pipe`, `.road`). See `references/infrastructure-patterns.md`.
|
|
226
|
+
8. **UI / Dashboard Mockups** — Admin panels, monitoring dashboards. Screen frame with nested chart/gauge/indicator elements. See `references/dashboard-patterns.md`.
|
|
227
|
+
|
|
228
|
+
For physical, infrastructure, and dashboard diagrams, load the matching reference file before generating — each one provides ready-made CSS classes and shape primitives.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Validation Checklist
|
|
233
|
+
|
|
234
|
+
Before finalizing any SVG, verify ALL of the following:
|
|
235
|
+
|
|
236
|
+
1. Every `<text>` has class `t`, `ts`, or `th`.
|
|
237
|
+
2. Every `<text>` inside a box has `dominant-baseline="central"`.
|
|
238
|
+
3. Every connector `<path>` or `<line>` used as arrow has `fill="none"`.
|
|
239
|
+
4. No arrow line crosses through an unrelated box.
|
|
240
|
+
5. `box_width >= (longest_label_chars × 8) + 48` for 14px text.
|
|
241
|
+
6. `box_width >= (longest_label_chars × 6.5) + 48` for 12px text.
|
|
242
|
+
7. ViewBox height = bottom-most element + 40px.
|
|
243
|
+
8. All content stays within x=40 to x=640.
|
|
244
|
+
9. Color classes (`c-*`) are on `<g>` or shape elements, never on `<path>` connectors.
|
|
245
|
+
10. Arrow `<defs>` block is present.
|
|
246
|
+
11. No gradients, shadows, blur, or glow effects.
|
|
247
|
+
12. Stroke width is 0.5px on all node borders.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Output & Preview
|
|
252
|
+
|
|
253
|
+
### Default: standalone HTML file
|
|
254
|
+
|
|
255
|
+
Write a single `.html` file the user can open directly. No server, no dependencies, works offline. Pattern:
|
|
256
|
+
|
|
257
|
+
```python
|
|
258
|
+
# 1. Load the template
|
|
259
|
+
template = skill_view("concept-diagrams", "templates/template.html")
|
|
260
|
+
|
|
261
|
+
# 2. Fill in title, subtitle, and paste your SVG
|
|
262
|
+
html = template.replace(
|
|
263
|
+
"<!-- DIAGRAM TITLE HERE -->", "SN2 reaction mechanism"
|
|
264
|
+
).replace(
|
|
265
|
+
"<!-- OPTIONAL SUBTITLE HERE -->", "Bimolecular nucleophilic substitution"
|
|
266
|
+
).replace(
|
|
267
|
+
"<!-- PASTE SVG HERE -->", svg_content
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
# 3. Write to a user-chosen path (or ./ by default)
|
|
271
|
+
write_file("./sn2-mechanism.html", html)
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Tell the user how to open it:
|
|
275
|
+
|
|
276
|
+
```
|
|
277
|
+
# macOS
|
|
278
|
+
open ./sn2-mechanism.html
|
|
279
|
+
# Linux
|
|
280
|
+
xdg-open ./sn2-mechanism.html
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Optional: local preview server (multi-diagram gallery)
|
|
284
|
+
|
|
285
|
+
Only use this when the user explicitly wants a browsable gallery of multiple diagrams.
|
|
286
|
+
|
|
287
|
+
**Rules:**
|
|
288
|
+
- Bind to `127.0.0.1` only. Never `0.0.0.0`. Exposing diagrams on all network interfaces is a security hazard on shared networks.
|
|
289
|
+
- Pick a free port (do NOT hard-code one) and tell the user the chosen URL.
|
|
290
|
+
- The server is optional and opt-in — prefer the standalone HTML file first.
|
|
291
|
+
|
|
292
|
+
Recommended pattern (lets the OS pick a free ephemeral port):
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# Put each diagram in its own folder under .diagrams/
|
|
296
|
+
mkdir -p .diagrams/sn2-mechanism
|
|
297
|
+
# ...write .diagrams/sn2-mechanism/index.html...
|
|
298
|
+
|
|
299
|
+
# Serve on loopback only, free port
|
|
300
|
+
cd .diagrams && python3 -c "
|
|
301
|
+
import http.server, socketserver
|
|
302
|
+
with socketserver.TCPServer(('127.0.0.1', 0), http.server.SimpleHTTPRequestHandler) as s:
|
|
303
|
+
print(f'Serving at http://127.0.0.1:{s.server_address[1]}/')
|
|
304
|
+
s.serve_forever()
|
|
305
|
+
" &
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
If the user insists on a fixed port, use `127.0.0.1:<port>` — still never `0.0.0.0`. Document how to stop the server (`kill %1` or `pkill -f "http.server"`).
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Examples Reference
|
|
313
|
+
|
|
314
|
+
The `examples/` directory ships 15 complete, tested diagrams. Browse them for working patterns before writing a new diagram of a similar type:
|
|
315
|
+
|
|
316
|
+
| File | Type | Demonstrates |
|
|
317
|
+
|------|------|--------------|
|
|
318
|
+
| `hospital-emergency-department-flow.md` | Flowchart | Priority routing with semantic colors |
|
|
319
|
+
| `feature-film-production-pipeline.md` | Flowchart | Phased workflow, horizontal sub-flows |
|
|
320
|
+
| `automated-password-reset-flow.md` | Flowchart | Auth flow with error branches |
|
|
321
|
+
| `autonomous-llm-research-agent-flow.md` | Flowchart | Loop-back arrows, decision branches |
|
|
322
|
+
| `place-order-uml-sequence.md` | Sequence | UML sequence diagram style |
|
|
323
|
+
| `commercial-aircraft-structure.md` | Physical | Paths, polygons, ellipses for realistic shapes |
|
|
324
|
+
| `wind-turbine-structure.md` | Physical cross-section | Underground/above-ground separation, color coding |
|
|
325
|
+
| `smartphone-layer-anatomy.md` | Exploded view | Alternating left/right labels, layered components |
|
|
326
|
+
| `apartment-floor-plan-conversion.md` | Floor plan | Walls, doors, proposed changes in dotted red |
|
|
327
|
+
| `banana-journey-tree-to-smoothie.md` | Narrative journey | Winding path, progressive state changes |
|
|
328
|
+
| `cpu-ooo-microarchitecture.md` | Hardware pipeline | Fan-out, memory hierarchy sidebar |
|
|
329
|
+
| `sn2-reaction-mechanism.md` | Chemistry | Molecules, curved arrows, energy profile |
|
|
330
|
+
| `smart-city-infrastructure.md` | Hub-spoke | Semantic line styles per system |
|
|
331
|
+
| `electricity-grid-flow.md` | Multi-stage flow | Voltage hierarchy, flow markers |
|
|
332
|
+
| `ml-benchmark-grouped-bar-chart.md` | Chart | Grouped bars, dual axis |
|
|
333
|
+
|
|
334
|
+
Load any example with:
|
|
335
|
+
```
|
|
336
|
+
skill_view(name="concept-diagrams", file_path="examples/<filename>")
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## Quick Reference: What to Use When
|
|
342
|
+
|
|
343
|
+
| User says | Diagram type | Suggested colors |
|
|
344
|
+
|-----------|--------------|------------------|
|
|
345
|
+
| "show the pipeline" | Flowchart | gray start/end, purple steps, red errors, teal deploy |
|
|
346
|
+
| "draw the data flow" | Data pipeline (left-right) | gray sources, purple processing, teal sinks |
|
|
347
|
+
| "visualize the system" | Structural (containment) | purple container, teal services, coral data |
|
|
348
|
+
| "map the endpoints" | API tree | purple root, one ramp per resource group |
|
|
349
|
+
| "show the services" | Microservice topology | gray ingress, teal services, purple bus, coral workers |
|
|
350
|
+
| "draw the aircraft/vehicle" | Physical | paths, polygons, ellipses for realistic shapes |
|
|
351
|
+
| "smart city / IoT" | Hub-spoke integration | semantic line styles per subsystem |
|
|
352
|
+
| "show the dashboard" | UI mockup | dark screen, chart colors: teal, purple, coral for alerts |
|
|
353
|
+
| "power grid / electricity" | Multi-stage flow | voltage hierarchy (HV/MV/LV line weights) |
|
|
354
|
+
| "wind turbine / turbine" | Physical cross-section | foundation + tower cutaway + nacelle color-coded |
|
|
355
|
+
| "journey of X / lifecycle" | Narrative journey | winding path, progressive state changes |
|
|
356
|
+
| "layers of X / exploded" | Exploded layer view | vertical stack, alternating labels |
|
|
357
|
+
| "CPU / pipeline" | Hardware pipeline | vertical stages, fan-out to execution ports |
|
|
358
|
+
| "floor plan / apartment" | Floor plan | walls, doors, proposed changes in dotted red |
|
|
359
|
+
| "reaction mechanism" | Chemistry | atoms, bonds, curved arrows, transition state, energy profile |
|
|
360
|
+
|
|
361
|
+
## Overview
|
|
362
|
+
This skill governs the generation of flat, minimal, light/dark-aware SVG diagrams. It provides a standardized visual design system that ensures diagrams render beautifully, scale fluidly, and adapt automatically to light and dark themes using semantic color categories.
|
|
363
|
+
|
|
364
|
+
## When to Use
|
|
365
|
+
- **Use when:** Building technical documentation, explaining architectural setups, illustrating science/physics/chemistry mechanisms, flowcharts, API endpoints, or user journeys.
|
|
366
|
+
- **NOT for:** Complex 3D modeling, hand-drawn wireframes, or high-fidelity UI mockup pages (use dedicated UI or mock design systems instead).
|
|
367
|
+
|
|
368
|
+
## Common Rationalizations
|
|
369
|
+
| Rationalization | Reality |
|
|
370
|
+
|---|---|
|
|
371
|
+
| I can use CSS inline styles for custom colors | Using inline styles breaks automatic dark-mode adjustments. Only semantic classes (e.g., `c-purple`, `c-teal`) adapt. |
|
|
372
|
+
| Eyeballing box width is fine | Eyeballing causes text overflow or ugly padding on different screens. Always calculate: width >= (chars * multiplier) + 48. |
|
|
373
|
+
| It's easier to serve on 0.0.0.0 | Exposing local design work on 0.0.0.0 opens access to your local files on the local network. Always bind to 127.0.0.1. |
|
|
374
|
+
|
|
375
|
+
## Red Flags
|
|
376
|
+
- Absence of class tags (`th`, `ts`, or `t`) on `<text>` elements.
|
|
377
|
+
- Connector `<line>` or `<path>` elements missing `fill="none"`.
|
|
378
|
+
- Use of drop-shadows, gradients, or heavy neon glow filters in elements.
|
|
379
|
+
- Text strings using Title Case or all-caps instead of sentence case.
|
|
380
|
+
|
|
381
|
+
## Verification
|
|
382
|
+
After completing the skill, confirm:
|
|
383
|
+
- [ ] Every `<text>` has an assigned font class (`th`, `ts`, or `t`).
|
|
384
|
+
- [ ] Every connector line has `fill="none"` and references the arrow marker.
|
|
385
|
+
- [ ] The `marker` block is defined within `<defs>` inside the `<svg>` node.
|
|
386
|
+
- [ ] Diagram viewBox has clean bounds containing all elements with 40px safe margins.
|
|
387
|
+
- [ ] Automatic dark mode works properly when classes shift.
|