arkaos 4.32.0 → 4.34.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.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/THE-ARKAOS-GUIDE.md +1 -1
  3. package/VERSION +1 -1
  4. package/arka/SKILL.md +1 -1
  5. package/arka/skills/forge/references/workflows.md +10 -0
  6. package/config/claude-agents/architect.md +1 -1
  7. package/config/claude-agents/backend-dev.md +1 -1
  8. package/config/claude-agents/devops-eng.md +1 -1
  9. package/config/claude-agents/frontend-dev.md +1 -1
  10. package/config/claude-agents/ops-lead.md +1 -1
  11. package/config/claude-agents/pm-director.md +1 -1
  12. package/config/claude-agents/strategy-director.md +1 -1
  13. package/config/hooks/session-start.sh +1 -1
  14. package/config/skills-curated.yaml +2 -2
  15. package/config/skills-provenance.yaml +7 -0
  16. package/config/statusline.sh +6 -1
  17. package/core/hooks/session_start.py +69 -28
  18. package/departments/dev/agents/architect.yaml +1 -0
  19. package/departments/dev/agents/backend-dev.yaml +1 -0
  20. package/departments/dev/agents/devops-eng.yaml +1 -0
  21. package/departments/dev/agents/frontend-dev.yaml +1 -0
  22. package/departments/dev/agents/tech-lead.yaml +1 -0
  23. package/departments/dev/skills/diagram/SKILL.md +175 -0
  24. package/departments/dev/skills/diagram/examples/archify-repo-grid.architecture.json +57 -0
  25. package/departments/dev/skills/diagram/vendor/LICENSE +22 -0
  26. package/departments/dev/skills/diagram/vendor/SKILL.md +367 -0
  27. package/departments/dev/skills/diagram/vendor/assets/template.html +11470 -0
  28. package/departments/dev/skills/diagram/vendor/bin/archify.mjs +600 -0
  29. package/departments/dev/skills/diagram/vendor/bin/open-artifact.mjs +67 -0
  30. package/departments/dev/skills/diagram/vendor/examples/agent-run.lifecycle.json +71 -0
  31. package/departments/dev/skills/diagram/vendor/examples/agent-tool-call.workflow.json +111 -0
  32. package/departments/dev/skills/diagram/vendor/examples/async-job-roundtrip.sequence.json +62 -0
  33. package/departments/dev/skills/diagram/vendor/examples/cache-miss-request.sequence.json +82 -0
  34. package/departments/dev/skills/diagram/vendor/examples/deployment-release.lifecycle.json +50 -0
  35. package/departments/dev/skills/diagram/vendor/examples/event-stream.dataflow.json +58 -0
  36. package/departments/dev/skills/diagram/vendor/examples/incident-response.workflow.json +65 -0
  37. package/departments/dev/skills/diagram/vendor/examples/product-analytics.dataflow.json +77 -0
  38. package/departments/dev/skills/diagram/vendor/examples/production-deployment.architecture.json +70 -0
  39. package/departments/dev/skills/diagram/vendor/examples/release-delivery.workflow.json +63 -0
  40. package/departments/dev/skills/diagram/vendor/examples/web-app.architecture.json +47 -0
  41. package/departments/dev/skills/diagram/vendor/package-lock.json +80 -0
  42. package/departments/dev/skills/diagram/vendor/package.json +28 -0
  43. package/departments/dev/skills/diagram/vendor/recipes/scenarios.mjs +350 -0
  44. package/departments/dev/skills/diagram/vendor/renderers/architecture/grid.mjs +62 -0
  45. package/departments/dev/skills/diagram/vendor/renderers/architecture/render-architecture.mjs +490 -0
  46. package/departments/dev/skills/diagram/vendor/renderers/dataflow/README.md +93 -0
  47. package/departments/dev/skills/diagram/vendor/renderers/dataflow/render-dataflow.mjs +396 -0
  48. package/departments/dev/skills/diagram/vendor/renderers/lifecycle/README.md +103 -0
  49. package/departments/dev/skills/diagram/vendor/renderers/lifecycle/render-lifecycle.mjs +482 -0
  50. package/departments/dev/skills/diagram/vendor/renderers/sequence/README.md +96 -0
  51. package/departments/dev/skills/diagram/vendor/renderers/sequence/render-sequence.mjs +357 -0
  52. package/departments/dev/skills/diagram/vendor/renderers/shared/cli.mjs +176 -0
  53. package/departments/dev/skills/diagram/vendor/renderers/shared/generated-validators.mjs +13 -0
  54. package/departments/dev/skills/diagram/vendor/renderers/shared/geometry.mjs +992 -0
  55. package/departments/dev/skills/diagram/vendor/renderers/shared/layout-report.mjs +40 -0
  56. package/departments/dev/skills/diagram/vendor/renderers/shared/utils.mjs +156 -0
  57. package/departments/dev/skills/diagram/vendor/renderers/shared/validator.mjs +40 -0
  58. package/departments/dev/skills/diagram/vendor/renderers/workflow/README.md +114 -0
  59. package/departments/dev/skills/diagram/vendor/renderers/workflow/render-workflow.mjs +598 -0
  60. package/departments/dev/skills/diagram/vendor/schemas/README.md +93 -0
  61. package/departments/dev/skills/diagram/vendor/schemas/architecture.schema.json +125 -0
  62. package/departments/dev/skills/diagram/vendor/schemas/common.schema.json +62 -0
  63. package/departments/dev/skills/diagram/vendor/schemas/dataflow.schema.json +240 -0
  64. package/departments/dev/skills/diagram/vendor/schemas/lifecycle.schema.json +260 -0
  65. package/departments/dev/skills/diagram/vendor/schemas/sequence.schema.json +205 -0
  66. package/departments/dev/skills/diagram/vendor/schemas/workflow.schema.json +351 -0
  67. package/departments/dev/skills/diagram/vendor/scripts/check-render-output.mjs +774 -0
  68. package/departments/dev/skills/diagram/vendor/scripts/generate-validators.mjs +66 -0
  69. package/departments/dev/skills/diagram/vendor/scripts/render-examples.mjs +26 -0
  70. package/departments/dev/skills/spec/SKILL.md +19 -0
  71. package/departments/ops/agents/ops-lead.yaml +1 -0
  72. package/departments/pm/agents/pm-director.yaml +1 -0
  73. package/departments/strategy/agents/strategy-director.yaml +1 -0
  74. package/harness/codex/AGENTS.md +1 -1
  75. package/harness/copilot/copilot-instructions.md +1 -1
  76. package/harness/cursor/rules/arkaos.mdc +2 -2
  77. package/harness/gemini/GEMINI.md +1 -1
  78. package/harness/opencode/AGENTS.md +1 -1
  79. package/harness/zed/.rules +1 -1
  80. package/installer/autoupdate.js +249 -0
  81. package/installer/cli.js +7 -0
  82. package/installer/core-snapshot.js +5 -1
  83. package/installer/doctor.js +11 -0
  84. package/installer/index.js +11 -0
  85. package/installer/update.js +11 -0
  86. package/knowledge/agents-registry-v2.json +9 -1
  87. package/knowledge/skills-manifest.json +14 -1
  88. package/package.json +3 -2
  89. package/pyproject.toml +1 -1
  90. package/scripts/auto-update.sh +188 -0
  91. package/scripts/skill_validator.py +10 -2
  92. package/scripts/tools/docs_stats.py +8 -2
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **The Operating System for AI Agent Teams.**
4
4
 
5
- 89 agents. 17 departments. 330 skills. Enterprise frameworks. Multi-runtime. One install.
5
+ 89 agents. 17 departments. 331 skills. Enterprise frameworks. Multi-runtime. One install.
6
6
 
7
7
  ```bash
8
8
  npx arkaos install
@@ -1,6 +1,6 @@
1
1
  # The ArkaOS Guide
2
2
 
3
- > v4.32.0 — 89 agents, 17 departments, 330 skills, 297 commands, 16 ADRs.
3
+ > v4.34.0 — 89 agents, 17 departments, 331 skills, 297 commands, 16 ADRs.
4
4
  > One file, everything you need to start. Generated by `scripts/guide_gen.py` — never hand-edited.
5
5
 
6
6
  ## What it is
package/VERSION CHANGED
@@ -1 +1 @@
1
- 4.32.0
1
+ 4.34.0
package/arka/SKILL.md CHANGED
@@ -47,7 +47,7 @@ complementary, not alternatives.
47
47
  # ArkaOS — Main Orchestrator
48
48
 
49
49
  > **The Operating System for AI Agent Teams**
50
- > 89 agents. 17 departments. 330 skills. Multi-runtime. Dashboard. Knowledge RAG.
50
+ > 89 agents. 17 departments. 331 skills. Multi-runtime. Dashboard. Knowledge RAG.
51
51
 
52
52
  ## ⛔ Evidence flow — 4 gates (NON-NEGOTIABLE)
53
53
 
@@ -190,6 +190,16 @@ Tell user: "Visual companion available at http://localhost:<port>/forge-<id>.htm
190
190
  Note: For `shallow` tier, companion is not generated (`should_suggest_companion()` returns `"none"`).
191
191
  For `standard`, it is available on request. For `deep`, proactively suggest it.
192
192
 
193
+ **Richer option — plan diagram via `dev/diagram`:** for `standard`/`deep`
194
+ tiers, additionally offer an interactive plan diagram. Load the
195
+ `dev/diagram` skill, author a `workflow` IR from the plan (`plan_phases`
196
+ → lane nodes in execution order, phase dependencies → edges, key
197
+ deliverables → cards), and deliver it to the same `/tmp` directory as
198
+ `/tmp/diagram-forge-<plan_id>.html` — the `http.server` above serves
199
+ both artifacts side by side. The radar remains the default companion
200
+ (zero Node dependency); if Node is unavailable, the radar is the only
201
+ companion — never block the Forge on the diagram.
202
+
193
203
  ### Step 9 — Handoff (on Approve)
194
204
 
195
205
  1. Check for repo drift since the snapshot:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: architect
3
3
  description: >
4
- Gabriel — Software Architect (dev squad). Executes: system design, domain modeling (event storming, bounded contexts), design patterns (GoF, PoEAA), business / domain analysis.
4
+ Gabriel — Software Architect (dev squad). Executes: system design, system visualization via dev/diagram (architecture + dataflow diagrams delivered as browser artifacts), domain modeling (event storming, bounded contexts), design patterns (GoF, PoEAA).
5
5
  model: sonnet
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: backend-dev
3
3
  description: >
4
- Andre — Backend Core Lead (dev squad). Executes: Laravel 11 / PHP 8.3, PostgreSQL / Supabase, REST API design, Service + Repository pattern.
4
+ Andre — Backend Core Lead (dev squad). Executes: Laravel 11 / PHP 8.3, PostgreSQL / Supabase, REST API design, API flow visualization via dev/diagram (sequence diagrams for endpoint contracts and async jobs).
5
5
  model: sonnet
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: devops-eng
3
3
  description: >
4
- Carlos — DevOps Lead (dev squad). Executes: CI/CD pipelines (GitHub Actions, GitLab CI), container orchestration (Docker, Kubernetes), infrastructure as code (Terraform, Pulumi), cloud platforms (Vercel, Azure, AWS).
4
+ Carlos — DevOps Lead (dev squad). Executes: CI/CD pipelines (GitHub Actions, GitLab CI), release visualization via dev/diagram (lifecycle + workflow diagrams for pipelines and rollouts), container orchestration (Docker, Kubernetes), infrastructure as code (Terraform, Pulumi).
5
5
  model: sonnet
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: frontend-dev
3
3
  description: >
4
- Diana — Senior Frontend Developer (dev squad). Executes: Vue 3 (Composition API), motion-reference analysis via dev/watch (scroll/animation benchmarks from frames + transcript before implementing), Nuxt 3, React 19 / Next.js 15.
4
+ Diana — Senior Frontend Developer (dev squad). Executes: Vue 3 (Composition API), motion-reference analysis via dev/watch (scroll/animation benchmarks from frames + transcript before implementing), user-flow visualization via dev/diagram (workflow diagrams for page and interaction flows), Nuxt 3.
5
5
  model: opus
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ops-lead
3
3
  description: >
4
- Daniel — Operations Lead (ops squad). Executes: workflow automation (Zapier, Make, n8n), process mapping & optimization, SOP creation & management, bottleneck analysis.
4
+ Daniel — Operations Lead (ops squad). Executes: workflow automation (Zapier, Make, n8n), SOP/process visualization via dev/diagram (workflow + lifecycle diagrams for automations and runbooks), process mapping & optimization, SOP creation & management.
5
5
  model: sonnet
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: pm-director
3
3
  description: >
4
- Carolina — Product Manager (pm squad). Executes: continuous product discovery (daily habit), weekly customer interviewing, dual-track agile (discovery + delivery), product risk assessment (value/usability/feasibility/viability).
4
+ Carolina — Product Manager (pm squad). Executes: continuous product discovery (daily habit), deliverable visualization via dev/diagram (workflow diagrams so stakeholders see scope before build), weekly customer interviewing, dual-track agile (discovery + delivery).
5
5
  model: sonnet
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: strategy-director
3
3
  description: >
4
- Tomas — Chief Strategist (strategy squad). Executes: competitive strategy, market analysis, business model design, positioning.
4
+ Tomas — Chief Strategist (strategy squad). Executes: competitive strategy, business-flow visualization via dev/diagram (architecture + dataflow diagrams of business models and value chains), market analysis, business model design.
5
5
  model: sonnet
6
6
  ---
7
7
 
@@ -32,6 +32,6 @@ fi
32
32
 
33
33
  # ─── Degraded fallback: static banner, valid JSON, exit 0 ──────────────
34
34
  cat <<'EOF'
35
- {"systemMessage": "\n╔══════════════════════════════════════════════╗\n║ A R K A O S ║\nThe Operating System for AI Teams ║\n╚══════════════════════════════════════════════╝\nOlá, founder (WizardingCode)\nArkaOS (degraded: no usable interpreter — run npx arkaos doctor)"}
35
+ {"systemMessage": "\nA R K A O S\n The Operating System for AI Agent Teams\n\n Olá, founder\n degraded: no usable interpreter — run npx arkaos doctor"}
36
36
  EOF
37
37
  exit 0
@@ -24,8 +24,8 @@ curated_subskills:
24
24
  community: [moderation]
25
25
  content: [calendar, hook-write]
26
26
  dev: [api-design, architecture-design, clean-code-review, code-review,
27
- db-design, refactor-plan, runbook, security-audit, spec, tdd-cycle,
28
- watch]
27
+ db-design, diagram, refactor-plan, runbook, security-audit, spec,
28
+ tdd-cycle, watch]
29
29
  ecom: [cart-recovery, store-audit]
30
30
  finance: [financial-model, unit-economics]
31
31
  kb: [search-kb, zettelkasten-process]
@@ -97,6 +97,13 @@ derived:
97
97
  origin: community
98
98
  source: https://github.com/bradautomates/claude-video
99
99
  license: MIT
100
+ # Diagram absorption campaign — visual spec/plan output derived from
101
+ # tt-a1i/archify v2.11.0 (MIT; portions Cocoon AI), vendored verbatim
102
+ # under vendor/ and maintained natively.
103
+ departments/dev/skills/diagram:
104
+ origin: community
105
+ source: https://github.com/tt-a1i/archify
106
+ license: MIT
100
107
  # Marketing skills integration campaign — derived from
101
108
  # coreyhaines31/marketingskills (MIT). Frontmatter metadata must match
102
109
  # each entry field-for-field (test_registry_matches_frontmatter_field_for_field).
@@ -173,7 +173,12 @@ if [ -f "$ARKA_CONFIG" ]; then
173
173
  fi
174
174
 
175
175
  # ─── Build Line 1: Context bar ───────────────────────────────────────────
176
- LINE1="${C_CYAN}▲ARKA${C_RESET} ${C_WHITE}${DIR_NAME}${C_RESET}"
176
+ # Version from the stable snapshot (one cat, no spawn storm on re-render).
177
+ ARKA_VER=""
178
+ if [ -f "$HOME/.arkaos/lib/VERSION" ]; then
179
+ ARKA_VER=$(tr -d '[:space:]' < "$HOME/.arkaos/lib/VERSION" 2>/dev/null)
180
+ fi
181
+ LINE1="${C_CYAN}▲ARKA${C_RESET}${ARKA_VER:+ ${C_DIM}v${ARKA_VER}${C_RESET}} ${C_WHITE}${DIR_NAME}${C_RESET}"
177
182
 
178
183
  # Git branch (hidden on main/master to reduce noise)
179
184
  if [ -n "$BRANCH" ] && [ "$BRANCH" != "main" ] && [ "$BRANCH" != "master" ]; then
@@ -7,13 +7,15 @@ print) with ONE python process that emits the full ``systemMessage``.
7
7
  Measured baseline before this consolidation: 251ms p50 (isolated floor,
8
8
  benchmarks/results.md); each spawn costs ~20-80ms.
9
9
 
10
- Section order preserved exactly from the shell version:
11
- banner+greeting workflow line version+forge+drift →
12
- evidence-flow contract meta-tag contract Model Fabric directive
13
- [SESSION] rehydrator resume → [SESSION-MEMORY] recap JSON out.
10
+ Presentation contract (Foundation PR-2): the user sees a compact branded
11
+ greeting ``systemMessage`` carries ONLY banner+greeting, workflow/forge
12
+ state, and the drift warning. Everything the MODEL needs but the user
13
+ should not scroll through (evidence-flow contract, meta-tag contract,
14
+ authority brief, Model Fabric directive, [SESSION] resume,
15
+ [SESSION-MEMORY] recap) ships via ``hookSpecificOutput.
16
+ additionalContext`` — same enforcement, zero wall of text.
14
17
  Background side effects (reorganizer trigger, dashboard ensure) stay
15
- detached and are config-gated; the NEW ``cognition.reorganize_on_session``
16
- gate lands here (QG F2-1 follow-up, endorsed for this PR).
18
+ detached and are config-gated (``cognition.reorganize_on_session``).
17
19
 
18
20
  The shell wrapper only resolves the interpreter and ``exec``s this
19
21
  module; with no usable venv it emits a static banner (fail-open).
@@ -35,17 +37,21 @@ _BUDGET_MS = 300
35
37
  _RECAP_ITEMS = 3
36
38
  _SUMMARY_CHARS = 130
37
39
 
38
- _BANNER = (
39
- "\n╔══════════════════════════════════════════════╗\n"
40
- "║ ║\n"
41
- "A R K A O S ║\n"
42
- "║ ║\n"
43
- "║ The Operating System for AI Teams ║\n"
44
- "║ by WizardingCode ║\n"
45
- "║ ║\n"
46
- "╚══════════════════════════════════════════════╝\n"
40
+ # Compact wordmark (Levitation identity: flat apex + floating bar) — the
41
+ # box-drawing wall it replaces read as a default terminal artifact.
42
+ _FALLBACK_BANNER = (
43
+ "\n ▲ A R K A O S\n"
44
+ " The Operating System for AI Agent Teams\n"
47
45
  )
48
46
 
47
+
48
+ def _banner(version: str, name: str, company: str) -> str:
49
+ return (
50
+ f"\n ▲ A R K A O S — v{version}\n"
51
+ f" The Operating System for AI Agent Teams · {company}\n"
52
+ f"\n Olá, {name}\n"
53
+ )
54
+
49
55
  _EVIDENCE_CONTRACT = (
50
56
  "\n\n[ARKA:EVIDENCE-FLOW] NON-NEGOTIABLE. Every non-trivial request runs"
51
57
  " the 4-gate evidence flow (constitution rule evidence-flow; source"
@@ -266,27 +272,52 @@ def _authority_brief(cwd: str) -> str:
266
272
  return f"\n\n{brief}" if brief else ""
267
273
 
268
274
 
269
- def build_message(cwd: str) -> str:
275
+ def build_visible(cwd: str) -> str:
276
+ """User-facing ``systemMessage``: branded greeting + live state only.
277
+
278
+ Owns the background side effects (reorganizer, dashboard ensure) so
279
+ they fire exactly once per session regardless of which builder a
280
+ caller combines.
281
+ """
270
282
  repo = repo_path()
271
283
  config = _config()
272
284
  name, company = _profile()
273
285
  version = _version(repo)
274
- msg = _BANNER + f"\nOlá, {name} ({company})\n"
286
+ msg = _banner(version, name, company)
275
287
  msg += _workflow_line()
276
- msg += f"ArkaOS v{version}"
277
288
  msg += _forge_line()
278
289
  msg += _drift(version)
279
- msg += _EVIDENCE_CONTRACT
280
- msg += _META_TAG_CONTRACT
281
- msg += _authority_brief(cwd)
282
- msg += _model_fabric()
283
290
  _trigger_reorganizer(repo, config)
284
291
  _ensure_dashboard(repo, config)
285
- msg += _session_resume()
292
+ return msg
293
+
294
+
295
+ def build_context(cwd: str) -> str:
296
+ """Model-only ``additionalContext``: the operating contracts.
297
+
298
+ Same text that used to flood the visible banner — the enforcement
299
+ surfaces (PreToolUse gate, Stop hook) read the model's OUTPUT
300
+ markers, so moving the injected contracts off-screen changes nothing
301
+ about enforcement.
302
+ """
303
+ parts = [
304
+ _EVIDENCE_CONTRACT,
305
+ _META_TAG_CONTRACT,
306
+ _authority_brief(cwd),
307
+ _model_fabric(),
308
+ _session_resume(),
309
+ ]
286
310
  recap = build_recap(cwd)
287
311
  if recap:
288
- msg += f"\n\n{recap}"
289
- return msg
312
+ parts.append(f"\n\n{recap}")
313
+ return "".join(parts).lstrip("\n")
314
+
315
+
316
+ def build_message(cwd: str) -> str:
317
+ """Full text (visible + contracts) — legacy single-string view."""
318
+ visible = build_visible(cwd)
319
+ context = build_context(cwd)
320
+ return visible + (f"\n\n{context}" if context else "")
290
321
 
291
322
 
292
323
  def build_recap(cwd: str, budget_ms: int = _BUDGET_MS) -> str:
@@ -336,10 +367,20 @@ def main(stdin_json: dict | None = None) -> int:
336
367
  or os.getcwd()
337
368
  )
338
369
  try:
339
- message = build_message(cwd)
370
+ visible = build_visible(cwd)
340
371
  except Exception: # absolute fail-open: static banner, exit 0
341
- message = _BANNER + "\nOlá, founder (WizardingCode)\nArkaOS"
342
- print(json.dumps({"systemMessage": message}))
372
+ visible = _FALLBACK_BANNER + "\n Olá, founder\n"
373
+ try:
374
+ context = build_context(cwd)
375
+ except Exception: # contracts are best-effort; greeting never breaks
376
+ context = ""
377
+ payload: dict = {"systemMessage": visible}
378
+ if context:
379
+ payload["hookSpecificOutput"] = {
380
+ "hookEventName": "SessionStart",
381
+ "additionalContext": context,
382
+ }
383
+ print(json.dumps(payload))
343
384
  return 0
344
385
 
345
386
 
@@ -50,6 +50,7 @@ authority:
50
50
  expertise:
51
51
  domains:
52
52
  - system design
53
+ - system visualization via dev/diagram (architecture + dataflow diagrams delivered as browser artifacts)
53
54
  - domain modeling (event storming, bounded contexts)
54
55
  - design patterns (GoF, PoEAA)
55
56
  - business / domain analysis
@@ -53,6 +53,7 @@ expertise:
53
53
  - Laravel 11 / PHP 8.3
54
54
  - PostgreSQL / Supabase
55
55
  - REST API design
56
+ - API flow visualization via dev/diagram (sequence diagrams for endpoint contracts and async jobs)
56
57
  - Service + Repository pattern
57
58
  - Database migrations & indexing
58
59
  - Queue systems (Horizon)
@@ -46,6 +46,7 @@ authority:
46
46
  expertise:
47
47
  domains:
48
48
  - CI/CD pipelines (GitHub Actions, GitLab CI)
49
+ - release visualization via dev/diagram (lifecycle + workflow diagrams for pipelines and rollouts)
49
50
  - container orchestration (Docker, Kubernetes)
50
51
  - infrastructure as code (Terraform, Pulumi)
51
52
  - cloud platforms (Vercel, Azure, AWS)
@@ -48,6 +48,7 @@ expertise:
48
48
  domains:
49
49
  - Vue 3 (Composition API)
50
50
  - motion-reference analysis via dev/watch (scroll/animation benchmarks from frames + transcript before implementing)
51
+ - user-flow visualization via dev/diagram (workflow diagrams for page and interaction flows)
51
52
  - Nuxt 3
52
53
  - React 19 / Next.js 15
53
54
  - TypeScript
@@ -50,6 +50,7 @@ authority:
50
50
  expertise:
51
51
  domains:
52
52
  - workflow orchestration
53
+ - visual spec/plan companions via dev/diagram (typed IR -> interactive HTML the user opens before build)
53
54
  - code quality enforcement
54
55
  - sprint/cycle management
55
56
  - technical decision-making
@@ -0,0 +1,175 @@
1
+ ---
2
+ name: dev/diagram
3
+ description: >
4
+ Turn a spec, plan, or system description into an interactive diagram the
5
+ user opens in a browser — one self-contained HTML file, five typed modes
6
+ (architecture, workflow, sequence, dataflow, lifecycle). The agent authors
7
+ a JSON IR, a vendored zero-dependency Node CLI validates it against JSON
8
+ Schemas, renders it, runs semantic gates (clean-flow/clean-label), and
9
+ emits a sha256 receipt. TRIGGER: "diagrama", "desenha a arquitetura",
10
+ "mostra-me visualmente", "visual da spec", "quero ver o fluxo", "diagram
11
+ this", "/dev diagram"; the Visual Spec Companion step in dev/spec; the
12
+ Forge visual-companion option for MEDIUM/HIGH plans. SKIP: DECIDING or
13
+ evaluating the architecture itself -> dev/architecture-design (this
14
+ skill only draws the result); database ERDs -> dev/db-schema (Mermaid
15
+ ERD); page wireframes/sitemaps -> brand/wireframe and
16
+ landing/page-architect; data charts and dashboards -> the dataviz
17
+ skill; the Forge complexity radar -> the Forge's built-in companion
18
+ (core/forge/renderer.py).
19
+ allowed-tools: [Read, Write, Bash, AskUserQuestion]
20
+ metadata:
21
+ origin: community
22
+ source: https://github.com/tt-a1i/archify
23
+ license: MIT
24
+ ---
25
+
26
+ <!-- arka:kb-first-prefix begin -->
27
+ > **KB-first:** query `mcp__obsidian__search_notes` (and
28
+ > `mcp__graphify__query_graph` when configured) and cite `[[wikilinks]]`
29
+ > or graph nodes — or declare the gap — BEFORE any external research.
30
+ > Full doctrine: `arka/SKILL.md` (KB-First Research).
31
+ <!-- arka:kb-first-prefix end -->
32
+
33
+ # /diagram — visual output for specs, plans, and systems
34
+
35
+ > **Agent:** Gabriel (Architect) + Paulo (Tech Lead) | **Framework:** Typed JSON IR, JSON Schema 2020-12, semantic layout gates
36
+
37
+ The user should SEE what will be built before it is built. This skill turns
38
+ a described system into a single self-contained HTML diagram (~530KB) with
39
+ theme switching, focused exploration, guided views, and PNG/SVG/WebM export
40
+ — no runtime dependencies, no telemetry. The only external reference is an
41
+ async Google Fonts stylesheet (JetBrains Mono) that degrades to system
42
+ monospace offline.
43
+
44
+ Absorbed from `tt-a1i/archify` v2.11.0 (MIT; portions Cocoon AI) and
45
+ maintained natively by ArkaOS. The upstream engine lives verbatim under
46
+ `vendor/`; you author the IR, the CLI does everything else. NEVER hand-edit
47
+ the generated HTML — fix the IR and re-deliver.
48
+
49
+ ## Resolve `SKILL_DIR` (before any command)
50
+
51
+ Set `SKILL_DIR` to the absolute path of the directory containing THIS
52
+ SKILL.md (your harness showed it when you Read this file). Guard once:
53
+
54
+ ```bash
55
+ [ -f "$SKILL_DIR/vendor/bin/archify.mjs" ] || { echo "archify.mjs not under $SKILL_DIR" >&2; exit 1; }
56
+ ```
57
+
58
+ ## Step 0 — preflight (silent on success)
59
+
60
+ ```bash
61
+ command -v node >/dev/null && node -e 'process.exit(+process.versions.node.split(".")[0] >= 18 ? 0 : 1)'
62
+ ```
63
+
64
+ Non-zero → stop and tell the user plainly: this skill needs Node.js >= 18
65
+ (`brew install node` on macOS, https://nodejs.org elsewhere). There is no
66
+ auto-install. When in doubt about the vendor payload itself, run
67
+ `node "$SKILL_DIR/vendor/bin/archify.mjs" doctor`.
68
+
69
+ ## Step 1 — choose the diagram type
70
+
71
+ | Type | Best for | IR collections |
72
+ |------|----------|----------------|
73
+ | `architecture` | components, services, storage, trust boundaries | `components` + `connections` |
74
+ | `workflow` | CI/CD, approvals, tool calls, runbooks, plan phases | `nodes` (in `lanes`/`cols`) + `edges` |
75
+ | `sequence` | API calls, cache fallback, auth handshakes, async traces | `participants` + `messages` |
76
+ | `dataflow` | pipelines, lineage, PII paths, consumers | `nodes` + `flows` |
77
+ | `lifecycle` | states, retries, waits, terminal outcomes | `states` + `transitions` |
78
+
79
+ Unsure? Ask the recommender — it returns a bounded recipe:
80
+
81
+ ```bash
82
+ node "$SKILL_DIR/vendor/bin/archify.mjs" guide "<one-line description of the situation>"
83
+ ```
84
+
85
+ `examples` lists the 10 bundled sample IRs (`vendor/examples/*.json`) —
86
+ Read the one closest to your case as a structural reference.
87
+
88
+ ## Step 2 — author the IR
89
+
90
+ Write `<slug>.<type>.json` to `/tmp` (or the session scratchpad). Every IR
91
+ needs `schema_version: 1`, `diagram_type: "<type>"`, and `meta.title`;
92
+ `meta` also takes `subtitle`, `visual_preset` (`classic|signal-flow|
93
+ blueprint`), `views` (max 5 guided views), and `animation: "trace"` (motion
94
+ is opt-in — leave it off unless asked). Keep one bounded view: 8–12 core
95
+ nodes, one primary path, supporting detail in `cards` instead of extra
96
+ edges.
97
+
98
+ For per-mode layout rules (lanes/cols, pinning, sequence ordering,
99
+ architecture `pos` grid), Read ONLY the relevant mode section of the
100
+ upstream deep guide at `$SKILL_DIR/vendor/SKILL.md` — do not load all 61KB.
101
+
102
+ Validate before delivering; error messages carry the offending node
103
+ `id`/`label` so you can fix the IR surgically:
104
+
105
+ ```bash
106
+ node "$SKILL_DIR/vendor/bin/archify.mjs" validate <type> /tmp/<slug>.<type>.json --json
107
+ ```
108
+
109
+ ## Step 3 — deliver
110
+
111
+ ```bash
112
+ node "$SKILL_DIR/vendor/bin/archify.mjs" deliver <type> /tmp/<slug>.<type>.json \
113
+ /tmp/diagram-<slug>.html --json --open --quality standard
114
+ ```
115
+
116
+ Deliver renders to a staging file, runs the artifact checks, atomically
117
+ renames on pass, and emits a JSON receipt. `--open` opens the artifact
118
+ natively; on a headless/remote session drop `--open` and reuse the Forge
119
+ Step 6a convention instead (`python -m http.server 0 --directory /tmp`,
120
+ then `open http://localhost:<port>/diagram-<slug>.html`). Use
121
+ `--quality showcase` only when the user asks for a presentation-grade
122
+ artifact — it fails on dense-but-legal topologies that `standard` accepts.
123
+
124
+ ## Step 4 — read the receipt, report honestly
125
+
126
+ Parse the receipt JSON. On success report: artifact path,
127
+ `validation.checksPassed`/`checkCount`, `compositionProfile`/`Status`, and
128
+ `artifact.sha256`. On failure the receipt carries `ok: false`, a `stage`,
129
+ and the failing check — fix the IR accordingly and re-deliver. Two common
130
+ gates: **clean-flow** (an edge crossing an unrelated node is always a hard
131
+ failure — reroute or move the node) and **clean-label** (label mask too
132
+ close to another route — nudge the label or spread lanes).
133
+
134
+ ## Step 5 — persistence (optional)
135
+
136
+ The HTML is an ephemeral deliverable in `/tmp`. When the diagram belongs to
137
+ a durable deliverable (a spec, a Forge plan, an SOP):
138
+
139
+ - save the IR JSON (small, regenerable source of truth) to the vault next
140
+ to the note, e.g. `Projects/<name>/Specs/visuals/SPEC-<slug>.<type>.json`;
141
+ - record the artifact in the note's frontmatter `visuals:` list as
142
+ `{type, ir, html, sha256}`;
143
+ - copy the HTML itself into the vault only when the user asks.
144
+
145
+ Ask before writing to the vault when the user did not request persistence.
146
+
147
+ ## Output template
148
+
149
+ ```
150
+ Diagram: <type> — <title>
151
+ IR: /tmp/<slug>.<type>.json
152
+ Artifact: /tmp/diagram-<slug>.html (sha256 <first-12>)
153
+ Checks: <checksPassed>/<checkCount> passed · composition <status>
154
+ Opened: <natively | http://localhost:<port>/… | not opened (reason)>
155
+ ```
156
+
157
+ ## Failure modes
158
+
159
+ - Node missing or < 18 → stop with the install hint; never degrade to
160
+ ASCII art silently — say the visual companion is unavailable and why.
161
+ - `validate` fails → fix the IR at the reported `id`/`label`; re-validate.
162
+ - `deliver` fails a gate → the previous artifact (if any) is untouched;
163
+ fix the IR, never the HTML.
164
+ - Dense topology keeps failing `showcase` → deliver with `standard` and
165
+ say so; `standard` keeps renderable-but-dense layouts as warnings.
166
+
167
+ ## Security
168
+
169
+ Local-only: the CLI spawns only `node` subprocesses; the generated HTML
170
+ makes no network calls (no fetch/eval/telemetry) except the optional
171
+ Google Fonts stylesheet, and the footer link (when present) carries only
172
+ the diagram type — never the title, graph, or source. Receipts include the
173
+ artifact sha256 for integrity. Vendored engine: `vendor/` (bin, renderers,
174
+ schemas, recipes, template, examples, test) — byte-identical to upstream
175
+ v2.11.0 except trims listed in `docs/THIRD-PARTY-NOTICES.md`.
@@ -0,0 +1,57 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "architecture",
4
+ "meta": {
5
+ "title": "Archify Pipeline",
6
+ "subtitle": "Grid placement demo — row/col instead of manual pos",
7
+ "output": "examples/archify-repo-grid.html"
8
+ },
9
+ "layout": {
10
+ "mode": "grid",
11
+ "origin": [40, 100],
12
+ "cols": 7,
13
+ "gapX": 24,
14
+ "gapY": 48,
15
+ "cellW": 120,
16
+ "cellH": 60
17
+ },
18
+ "components": [
19
+ { "id": "user", "type": "external", "label": "You", "sublabel": "NL / Mermaid", "row": 1, "col": 0 },
20
+ { "id": "agents", "type": "frontend", "label": "Agent Hosts", "sublabel": "Claude · Codex", "row": 1, "col": 1 },
21
+ { "id": "skill", "type": "frontend", "label": "SKILL.md", "sublabel": "layout rules", "row": 0, "col": 1 },
22
+ { "id": "ir", "type": "messagebus", "label": "JSON IR", "sublabel": "schema v1", "row": 1, "col": 2 },
23
+ { "id": "schemas", "type": "security", "label": "Schema", "sublabel": "ajv", "row": 0, "col": 2 },
24
+ { "id": "renderers", "type": "backend", "label": "Renderers ×5", "row": 1, "col": 3 },
25
+ { "id": "template", "type": "frontend", "label": "template.html", "row": 1, "col": 4 },
26
+ { "id": "checker", "type": "security", "label": "Output Check", "row": 1, "col": 5 },
27
+ { "id": "html", "type": "cloud", "label": "HTML", "sublabel": "artifact", "row": 1, "col": 6 }
28
+ ],
29
+ "boundaries": [
30
+ {
31
+ "kind": "region",
32
+ "label": "archify/ skill package",
33
+ "wraps": ["ir", "schemas", "renderers", "template", "checker"]
34
+ }
35
+ ],
36
+ "connections": [
37
+ { "from": "user", "to": "agents", "variant": "emphasis" },
38
+ { "from": "agents", "to": "skill", "fromSide": "top", "toSide": "bottom" },
39
+ { "from": "agents", "to": "ir", "variant": "emphasis" },
40
+ { "from": "ir", "to": "schemas", "variant": "security", "fromSide": "top", "toSide": "bottom" },
41
+ { "from": "ir", "to": "renderers", "variant": "emphasis" },
42
+ { "from": "renderers", "to": "template", "variant": "emphasis" },
43
+ { "from": "template", "to": "checker", "variant": "emphasis" },
44
+ { "from": "checker", "to": "html", "variant": "emphasis" }
45
+ ],
46
+ "cards": [
47
+ {
48
+ "dot": "cyan",
49
+ "title": "Grid mode",
50
+ "items": [
51
+ "Set layout.mode grid and place components with row/col",
52
+ "pos still overrides a cell when you need fine tuning",
53
+ "Not auto-layout — fixed cell spacing only"
54
+ ]
55
+ }
56
+ ]
57
+ }
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 tt-a1i (Archify)
4
+ Copyright (c) 2025 Cocoon AI (original "architecture-diagram-generator")
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.