Business Blueprint

👤 kaisersong 📦 v0.13.0 ⭐ 4.6 ⬇️ 596 下載
📈 商業運營 免費

📖 技能介紹


name: kai-business-blueprint description: Use when turning presales requirements, meeting notes, or solution materials into editable business capability blueprints, swimlane flows, and application architecture diagrams. Use when generating blueprint JSON, static HTML viewers, or exporting to SVG, draw.io, Excalidraw, or Mermaid formats. When no standard export template applies, default to free-flow output.


Business Blueprint Skill

Use the Python scripts in this repository as the execution surface.

Output Directory

All generated files (blueprint JSON, viewers, exports) go into projects/workspace/ — not the repository root.

python scripts/business_blueprint/cli.py --plan projects/workspace/solution.blueprint.json --from "..."
python scripts/business_blueprint/cli.py --project projects/workspace/solution.blueprint.json
python scripts/business_blueprint/cli.py --export projects/workspace/solution.blueprint.json

Industry Selection

Choose --industry from exactly one of: "common", "finance", "manufacturing", "retail". Select the closest match based on the user's domain and materials; do not invent other values.

Industry Hints content
common No hints — generic domains
finance Risk control, credit, compliance, customer profile, etc.
manufacturing Production planning, quality, warehouse, supply chain, etc.
retail Store operations, membership, POS, order fulfillment, etc.

How to Generate a Blueprint

The AI agent is responsible for entity extraction. The Python tool handles JSON writing, visualization, and export.

Step 1: Read industry hints

Read the seed template at business_blueprint/templates/{industry}/seed.json and get the industryHints.checklist.

Step 2: Extract entities from source text

Using the user's source material AND the industry hints checklist, extract: - capabilities: business capability areas (name, description) - actors: roles/people involved (name) - flowSteps: business process steps (name, actorId, capabilityIds, stepType) - systems: IT systems that support capabilities - See references/entities-schema.md for all entity field definitions - See references/systems-schema.md for systems category/layer rules - See scripts/business_blueprint/templates/common/seed.json for field examples

Step 3: Write the blueprint JSON

Write the JSON file directly to the output path. Use this schema:

{
  "version": "1.0",
  "meta": {
    "title": "...",
    "industry": "retail",
    "revisionId": "rev-YYYYMMDD-NN",
    "parentRevisionId": null,
    "lastModifiedAt": "ISO8601",
    "lastModifiedBy": "ai"
  },
  "context": {
    "goals": [],
    "scope": [],
    "assumptions": [],
    "constraints": [],
    "sourceRefs": [{"type": "inline-text", "excerpt": "..."}],
    "clarifyRequests": [],
    "clarifications": []
  },
  "library": {
    "capabilities": [
      {"id": "cap-xxx", "name": "...", "level": 1, "description": "...", "ownerActorIds": [], "supportingSystemIds": []}
    ],
    "actors": [
      {"id": "actor-xxx", "name": "..."}
    ],
    "flowSteps": [
      {"id": "flow-xxx", "name": "...", "actorId": "actor-xxx", "capabilityIds": ["cap-xxx"], "systemIds": [], "stepType": "task", "inputRefs": [], "outputRefs": []}
    ],
    "systems": [
      {"id": "sys-xxx", "kind": "system", "name": "...", "aliases": [], "description": "...", "resolution": {"status": "canonical", "canonicalName": "..."}, "capabilityIds": ["cap-xxx"]}
    ]
  },
  "relations": [
    {"id": "rel-xxx", "type": "supports", "from": "sys-xxx", "to": "cap-xxx", "label": "支撐"}
  ],
  "views": [],
  "editor": {"fieldLocks": {}, "theme": "enterprise-default"},
  "artifacts": {}
}

Step 4: Generate visualizations

python scripts/business_blueprint/cli.py --export <blueprint.json>

This generates SVG + HTML viewer by default. Use --format drawio|excalidraw|mermaid for other formats.

Export View Selection Policy

Treat export view choice as a routing decision, not a styling preference.

  • If a request matches a supported, standard export template, use that template.
  • If there is no standard export template for the requested diagram, fall back to freeflow.
  • Do not substitute swimlane, matrix, product tree, or other generic views just because they are available.
  • When embedding a blueprint diagram into a report or ad hoc analysis, freeflow is the safe default unless the user explicitly asks for a supported standard template.

Step 5: Generate downstream projection

python scripts/business_blueprint/cli.py --project <blueprint.json>

This generates solution.projection.json, the canonical machine projection consumed by downstream report/slide workflows.

Workflow Decision Tree

User provides raw requirements / meeting notes?
  → AI agent reads hints, extracts entities, writes blueprint JSON
  → Optionally run --project for downstream machine handoff
  → Then run --export for visualization

User needs diagram files (SVG, draw.io, etc.)?
  → --export (default: SVG + HTML viewer)

User unsure about blueprint quality?
  → --validate

User wants downstream report / slide generation?
  → --project

訪問小蔥技能站7w4.net,解鎖更多實用的AI技能外掛。

Commands

Command Description
--plan <path> --from <text> Generate empty blueprint JSON from source text (AI should prefer writing JSON directly)
--project <path> Generate canonical projection JSON for downstream skills
--export <path> Export SVG + HTML viewer (default), or use --format for other formats
--validate <path> Validate a blueprint and print JSON results

Execution: Run directly as scripts:

python scripts/business_blueprint/cli.py --plan ...
python scripts/business_blueprint/cli.py --export ...

Export Formats

Format File Use Case
svg (default) solution.exports/solution.svg + HTML viewer Quick preview, embedding
drawio solution.exports/solution.drawio Editable diagrams
excalidraw solution.exports/solution.excalidraw Whiteboard-style diagrams
mermaid solution.exports/solution.mermaid.md GitHub-native rendering

Collaboration Boundary

This skill produces semantic intermediate artifacts. Downstream skills consume them:

  • report-creator consumes solution.projection.json → assembles reports
  • slide-creator consumes solution.projection.json → assembles presentations
  • Other skills may consume relations → generate PlantUML or other diagram syntax
  • Downstream skills should never directly edit solution.blueprint.json
  • solution.handoff.json is viewer-only metadata, not a downstream narrative input

Sandbox Execution

When running in an isolated Python sandbox (Jupyter, notebook, cloud REPL) that auto-installs dependencies:

  1. The sandbox uses scripts directly. Run execution scripts from the repository root: python import subprocess subprocess.run(["python", "scripts/business_blueprint/cli.py", "--export", "solution.blueprint.json"])
  2. sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) — will raise NameError
  3. subprocess.run(["business-blueprint", ...]) — sandbox runs Python cells, not shell
  4. os.system() — same reason

Architecture Diagram Generation

When user requests an architecture diagram (keywords: "架構圖", "architecture diagram", "--export", "diagram"):

  1. Read references/architecture-design-system.md for the complete design system.
  2. Read the appropriate template from references/architecture-templates/ based on the user's domain:
  3. AWS/Serverless/Lambda → serverless.md
  4. Microservices/Kubernetes/微服務 → microservices.md
  5. Other → use serverless.md as a structural reference
  6. Read the blueprint JSON to extract entities and flow steps.
  7. Generate a self-contained HTML file with inline SVG following the design system rules.
  8. Write the output file to the same directory as the blueprint JSON.

If the request does not match one of the supported standard templates above, stay on the default freeflow export path. Do not switch to another generic view type as a fallback. If a standard template would create a squeezed, clipped, or overcrowded diagram, stop using the fixed template geometry and fall back to freeflow or a wrapped multi-row layout.

Route eligibility matrix

Use an explicit route contract before rendering:

Route Structural prerequisites First fallback Terminal behavior
freeflow Any valid blueprint with at least one renderable node or relation None If integrity still fails, export exits non-zero with a structural diagnostics payload
architecture-template Recognizable L→R architecture shape, categorized systems, limited per-layer density, and no route-breaking overflow risk freeflow Same as above
poster Clear layer/group structure with bounded peer density per row or wrapped-row support wrapped poster or freeflow Same as above
swimlane Actor-owned flow steps with meaningful lane grouping freeflow Same as above
hierarchy Stable tree/group relationship with low ambiguity in parent-child grouping freeflow Same as above
evolution Ordered chronological or staged progression data freeflow Same as above

Do not invent route heuristics ad hoc inside a renderer. Route eligibility must stay explicit and reviewable.

Generation Rules

  • Use dark mode by default (#020617 bg + 40px grid). Only use light mode when the user explicitly asks for it.
  • L→R data flow: Clients(左) → Frontend → Backend → Database(右)
  • Map systems[].category to semantic colors from the design system
  • Map systems[].properties.type == "aws" → AWS Region boundary box
  • Map systems[].properties.type == "k8s" → Kubernetes Cluster boundary box
  • Use flowSteps[].seqIndex for L→R ordering
  • Component sizing: 0-1 cap = small(44px h), 2-4 = medium(80px h), 5+ = large(80px h)
  • Layout must be content-driven. Never force every node in a layer into one fixed row if that creates toothpaste-style squeezing.
  • When a layer has more than 3 peer nodes, or labels/features become tight, wrap into multiple rows or widen the canvas before shrinking the content.
  • Render users/actors as actor labels, badges, or lane headers by default. Do not render them as ordinary system cards unless the user explicitly asks for that visual treatment.
  • Legend must live in a bottom safe area and participate in canvas sizing. Never place the legend as a floating overlay in the top-right corner.
  • Final SVG/HTML height must be derived from the bottom-most node, legend, summary cards, and footer plus padding. Do not use fixed-height wrappers or overflow: hidden that can clip the last row.
  • Z-order: bg → grid → title → region → arrows → nodes → legend → cards → footer
  • Component border: rx="8", stroke-width="2"
  • Region border: rx="16", stroke-dasharray="8,4", opacity="0.4"
  • Geometry-sensitive integrity checks must use the numeric thresholds from evals/export-integrity-thresholds.json, not prose heuristics.

Output

  • Single HTML file: {blueprint_stem}.html alongside the blueprint JSON
  • No external dependencies (except Google Fonts CDN for JetBrains Mono)
  • Opens in any browser, printable to PDF

Error Handling

  • If --validate returns errors: fix structural issues before proceeding to --export.
  • If --validate returns only warnings: proceed but note the warnings in any handoff.
  • If Python version < 3.12: the package will refuse to install. Use python3 -m business_blueprint.cli with system Python as fallback.
  • If a specialized route fails integrity: fall back to its configured fallback route.
  • If freeflow also fails integrity: export exits non-zero with a structural diagnostics payload instead of emitting a silently broken artifact.

Cross-Platform Scope

Phase 2 does not attempt full Windows terminal parity.

Known deferred cases: - PowerShell pipe quirks beyond documented CLI contract tests - console-default encoding issues outside explicit UTF-8 execution paths

Accepted workaround for encoding-sensitive runs:

Use scripts directly (pure Skill, no package structure)

subprocess.run(["python", "scripts/business_blueprint/cli.py", "--export", str(blueprint_path)]) - set PYTHONIOENCODING=utf-8 where needed

🤖 AI 評測

這是一個功能完整的業務藍圖生成工具,能夠將需求文本快速轉換為視覺化的架構圖和流程圖。它支援多種匯出格式,輸出質量穩定,文件清晰易讀。不過在複雜場景下某些匯出功能可能不夠完善,對於新手使用者來說完整的工作流程稍顯繁瑣。總體而言是一個可用性良好但仍有最佳化空間的實用工具。

📊 多維度評分

適應性4.6
規範性4.4
有效性4.7
可靠性4.5
可信度4.7

📁 包含檔案 (115 個)

📄 PURE_SKILL_CLEANUP.md 11 KB
📄 README.md 15 KB
📄 README.zh-CN.md 13.1 KB
📄 REFACTOR_SUMMARY.md 6.3 KB
📄 SKILL.md 12.4 KB
📄 _meta.json 138 B
📄 demos/common.blueprint.json 22.5 KB
📄 demos/finance.blueprint.json 5.9 KB
📄 demos/manufacturing.blueprint.json 6 KB
📄 demos/retail.blueprint.json 4.9 KB
📄 demos/screenshots/retail-arch.svg 9.1 KB
📄 evals/README.md 1 KB
📄 evals/defect-taxonomy.json 313 B
📄 evals/export-integrity-thresholds.json 145 B
📄 evals/export-scoring-schema.json 352 B
📄 evals/fixtures/route-architecture.json 359 B
📄 evals/fixtures/route-evolution.json 381 B
📄 evals/fixtures/route-freeflow.json 234 B
📄 references/architecture-design-system.md 6.8 KB
📄 references/architecture-diagram-design.md 10.9 KB
📄 references/architecture-templates/microservices.md 2.4 KB
📄 references/architecture-templates/serverless.md 2.3 KB
📄 references/authoring-rules.md 256 B
📄 references/blueprint-schema.md 231 B
📄 references/entities-schema.md 5.5 KB
📄 references/implementation-plan.md 12.2 KB
📄 references/industry-packs.md 254 B
📄 references/layout-quality-check.md 2.4 KB
📄 references/prompt-orchestration-templates.md 8.7 KB
📄 references/schema-refactor-proposal.md 15.9 KB
📄 references/schema-refactor-v2-actionable.md 28.4 KB
📄 references/systems-schema.md 3.1 KB
📄 references/test-and-eval-strategy.md 34.1 KB
📄 references/theme-dark.md 4.4 KB
📄 references/visual-enhancement-plan.md 9.5 KB
📄 reports/phase0_final_report.json 1.8 KB
📄 reports/phase0_migration_report.json 215 B
📄 reports/phase1_accuracy_report.json 3.5 KB
📄 reports/phase1_accuracy_report_fixed.json 2.7 KB
📄 reports/phase3_ab_comparison_report.json 3.7 KB
📄 reports/schema-refactor-complete-final-report.md 11.4 KB
📄 reports/schema-refactor-final-evaluation-report.md 12.1 KB
📄 reports/schema-refactor-implementation-report.md 6.9 KB
📄 scripts/business_blueprint/assets/viewer.html 27.8 KB
📄 scripts/business_blueprint/clarify.py 1.8 KB
📄 scripts/business_blueprint/cli.py 7.7 KB
📄 scripts/business_blueprint/export_drawio.py 644 B
📄 scripts/business_blueprint/export_excalidraw.py 710 B
📄 scripts/business_blueprint/export_html.py 8 KB
📄 scripts/business_blueprint/export_integrity.py 5.1 KB
📄 scripts/business_blueprint/export_mermaid.py 4.1 KB
📄 scripts/business_blueprint/export_routes.py 5.2 KB
📄 scripts/business_blueprint/export_svg.py 145.6 KB
📄 scripts/business_blueprint/export_text.py 2.1 KB
📄 scripts/business_blueprint/export_theme.py 4.8 KB
📄 scripts/business_blueprint/fixtures/baseline/common.svg 23.9 KB
📄 scripts/business_blueprint/fixtures/baseline/finance.svg 10.2 KB
📄 scripts/business_blueprint/fixtures/baseline/manufacturing.svg 10.7 KB
📄 scripts/business_blueprint/fixtures/baseline/retail.svg 9.1 KB
📄 scripts/business_blueprint/generate.py 3.2 KB
📄 scripts/business_blueprint/intent_resolver.py 6.7 KB
📄 scripts/business_blueprint/migrations/v1_to_v2.py 4.6 KB
📄 scripts/business_blueprint/model.py 1.6 KB
📄 scripts/business_blueprint/normalize.py 2.6 KB
📄 scripts/business_blueprint/projection.py 6.1 KB
📄 scripts/business_blueprint/prompt_generator.py 3 KB
📄 scripts/business_blueprint/renderers.py 18.4 KB
📄 scripts/business_blueprint/rule_engine.py 10.4 KB
📄 scripts/business_blueprint/strategy_registry/overlays/finance-regulatory.json 732 B
📄 scripts/business_blueprint/strategy_registry/overlays/manufacturing-supply-chain.json 956 B
📄 scripts/business_blueprint/strategy_registry/perspectives/product-capability.json 2.4 KB
📄 scripts/business_blueprint/strategy_registry/perspectives/technical-architecture.json 1.2 KB
📄 scripts/business_blueprint/strategy_registry/registry.json 1.2 KB
📄 scripts/business_blueprint/templates/common/base_blueprint.json 440 B
📄 scripts/business_blueprint/templates/common/seed.json 1.8 KB
📄 scripts/business_blueprint/templates/finance/seed.json 1.2 KB
📄 scripts/business_blueprint/templates/html-viewer.html 9.3 KB
📄 scripts/business_blueprint/templates/manufacturing/seed.json 1.2 KB
📄 scripts/business_blueprint/templates/retail/seed.json 1.2 KB
📄 scripts/business_blueprint/tests/metrics.py 6.5 KB
📄 scripts/business_blueprint/tests/phase0_migration_test.py 6.4 KB
📄 scripts/business_blueprint/tests/phase1_accuracy_test.py 8.1 KB
📄 scripts/business_blueprint/tests/phase1_accuracy_test_fixed.py 7.9 KB
📄 scripts/business_blueprint/tests/phase3_ab_comparison.py 8.4 KB
📄 scripts/business_blueprint/tests/test_utils.py 6.1 KB
📄 scripts/business_blueprint/validate.py 6.9 KB
📄 scripts/business_blueprint/viewer.py 2 KB
📄 scripts/convert_imports.py 1.6 KB
📄 scripts/tests/conftest.py 181 B
📄 scripts/tests/test_architecture_skill_contract.py 3.5 KB
📄 scripts/tests/test_cli_cross_platform.py 2.8 KB
📄 scripts/tests/test_cli_smoke.py 5.7 KB
📄 scripts/tests/test_e2e.py 5.8 KB
📄 scripts/tests/test_export_integrity.py 5.1 KB
📄 scripts/tests/test_export_routes.py 1.9 KB
📄 scripts/tests/test_exporters.py 16.4 KB
📄 scripts/tests/test_generate.py 3.9 KB
📄 scripts/tests/test_normalize.py 1.4 KB
📄 scripts/tests/test_projection.py 3.7 KB
📄 scripts/tests/test_prompt_generation.py 3.4 KB
📄 scripts/tests/test_svg_quality.py 16.9 KB
📄 scripts/tests/test_theme_and_cards.py 13.1 KB
📄 scripts/tests/test_validate.py 5.5 KB
📄 scripts/tests/test_viewer.py 4.3 KB
📄 scripts/tests/test_visual_enhancement.py 25.3 KB
📄 test_data/migrated_blueprints/common.blueprint.json 22.8 KB
📄 test_data/migrated_blueprints/finance.blueprint.json 6.2 KB
📄 test_data/migrated_blueprints/manufacturing.blueprint.json 6.3 KB
📄 test_data/migrated_blueprints/retail.blueprint.json 5.3 KB
📄 test_data/migrated_blueprints/solution.exports/generation-prompt-20260425-232234-657.md 689 B
📄 test_data/migrated_blueprints/solution.exports/generation-prompt-20260425-232307-853.md 692 B
📄 test_data/migrated_blueprints/solution.exports/generation-prompt-20260425-232307-956.md 691 B
📄 test_data/migrated_blueprints/solution.exports/generation-prompt-20260425-232308-068.md 703 B
📄 test_data/migrated_blueprints/solution.exports/generation-prompt-20260425-232308-174.md 689 B
📄 test_data/migrated_blueprints/solution.exports/solution.svg 4.7 KB