aiden-runtime 3.19.5 → 3.19.7

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 (107) hide show
  1. package/README.md +1 -1
  2. package/dist/api/server.js +24 -25
  3. package/dist/core/agentLoop.js +8 -6
  4. package/dist/core/aidenPersonality.js +20 -3
  5. package/dist/core/protectedContext.js +15 -2
  6. package/dist/core/skillLoader.js +2 -0
  7. package/dist/core/skillTeacher.js +18 -5
  8. package/dist/core/version.js +1 -1
  9. package/dist-bundle/cli.js +50 -18
  10. package/dist-bundle/index.js +73 -35
  11. package/package.json +2 -1
  12. package/scripts/postinstall.js +70 -1
  13. package/workspace-templates/HEARTBEAT.md +16 -0
  14. package/workspace-templates/SOUL.md +267 -0
  15. package/workspace-templates/STANDING_ORDERS.md +21 -0
  16. package/workspace-templates/permissions.yaml +180 -0
  17. package/workspace-templates/skills/architecture-diagram/SKILL.md +126 -0
  18. package/workspace-templates/skills/architecture-diagram/skill.json +25 -0
  19. package/workspace-templates/skills/arxiv/SKILL.md +124 -0
  20. package/workspace-templates/skills/arxiv/skill.json +26 -0
  21. package/workspace-templates/skills/ascii-art/SKILL.md +142 -0
  22. package/workspace-templates/skills/ascii-art/skill.json +26 -0
  23. package/workspace-templates/skills/blogwatcher/SKILL.md +147 -0
  24. package/workspace-templates/skills/blogwatcher/skill.json +26 -0
  25. package/workspace-templates/skills/censys/SKILL.md +104 -0
  26. package/workspace-templates/skills/censys/index.ts +133 -0
  27. package/workspace-templates/skills/censys/skill.json +25 -0
  28. package/workspace-templates/skills/clipboard-history/SKILL.md +101 -0
  29. package/workspace-templates/skills/clipboard-history/skill.json +23 -0
  30. package/workspace-templates/skills/crt-sh/SKILL.md +102 -0
  31. package/workspace-templates/skills/crt-sh/index.ts +59 -0
  32. package/workspace-templates/skills/crt-sh/skill.json +25 -0
  33. package/workspace-templates/skills/cveapi/SKILL.md +114 -0
  34. package/workspace-templates/skills/cveapi/index.ts +249 -0
  35. package/workspace-templates/skills/cveapi/skill.json +25 -0
  36. package/workspace-templates/skills/docker-management/SKILL.md +156 -0
  37. package/workspace-templates/skills/docker-management/skill.json +25 -0
  38. package/workspace-templates/skills/excalidraw/SKILL.md +148 -0
  39. package/workspace-templates/skills/excalidraw/skill.json +25 -0
  40. package/workspace-templates/skills/explainshell/SKILL.md +93 -0
  41. package/workspace-templates/skills/explainshell/index.ts +132 -0
  42. package/workspace-templates/skills/explainshell/skill.json +25 -0
  43. package/workspace-templates/skills/financial_research/SKILL.md +21 -0
  44. package/workspace-templates/skills/financial_research/skill.json +24 -0
  45. package/workspace-templates/skills/gif-search/SKILL.md +122 -0
  46. package/workspace-templates/skills/gif-search/skill.json +25 -0
  47. package/workspace-templates/skills/github-auth/SKILL.md +134 -0
  48. package/workspace-templates/skills/github-auth/skill.json +26 -0
  49. package/workspace-templates/skills/github-issues/SKILL.md +130 -0
  50. package/workspace-templates/skills/github-issues/skill.json +25 -0
  51. package/workspace-templates/skills/github-pr-workflow/SKILL.md +143 -0
  52. package/workspace-templates/skills/github-pr-workflow/skill.json +26 -0
  53. package/workspace-templates/skills/github-repo-management/SKILL.md +147 -0
  54. package/workspace-templates/skills/github-repo-management/skill.json +26 -0
  55. package/workspace-templates/skills/google-workspace/SKILL.md +110 -0
  56. package/workspace-templates/skills/google-workspace/skill.json +26 -0
  57. package/workspace-templates/skills/greynoise/SKILL.md +96 -0
  58. package/workspace-templates/skills/greynoise/index.ts +107 -0
  59. package/workspace-templates/skills/greynoise/skill.json +25 -0
  60. package/workspace-templates/skills/haveibeenpwned/SKILL.md +100 -0
  61. package/workspace-templates/skills/haveibeenpwned/index.ts +72 -0
  62. package/workspace-templates/skills/haveibeenpwned/skill.json +24 -0
  63. package/workspace-templates/skills/jupyter-live-kernel/SKILL.md +116 -0
  64. package/workspace-templates/skills/jupyter-live-kernel/skill.json +25 -0
  65. package/workspace-templates/skills/linear/SKILL.md +107 -0
  66. package/workspace-templates/skills/linear/skill.json +25 -0
  67. package/workspace-templates/skills/nano-pdf/SKILL.md +113 -0
  68. package/workspace-templates/skills/nano-pdf/skill.json +26 -0
  69. package/workspace-templates/skills/notion/SKILL.md +108 -0
  70. package/workspace-templates/skills/notion/skill.json +24 -0
  71. package/workspace-templates/skills/obsidian/SKILL.md +115 -0
  72. package/workspace-templates/skills/obsidian/skill.json +24 -0
  73. package/workspace-templates/skills/ocr-and-documents/SKILL.md +125 -0
  74. package/workspace-templates/skills/ocr-and-documents/skill.json +26 -0
  75. package/workspace-templates/skills/p5js/SKILL.md +163 -0
  76. package/workspace-templates/skills/p5js/skill.json +24 -0
  77. package/workspace-templates/skills/research-paper-writing/SKILL.md +158 -0
  78. package/workspace-templates/skills/research-paper-writing/skill.json +26 -0
  79. package/workspace-templates/skills/securityheaders/SKILL.md +99 -0
  80. package/workspace-templates/skills/securityheaders/index.ts +213 -0
  81. package/workspace-templates/skills/securityheaders/skill.json +26 -0
  82. package/workspace-templates/skills/shodan/SKILL.md +113 -0
  83. package/workspace-templates/skills/shodan/index.ts +94 -0
  84. package/workspace-templates/skills/shodan/skill.json +26 -0
  85. package/workspace-templates/skills/songsee/SKILL.md +152 -0
  86. package/workspace-templates/skills/songsee/skill.json +25 -0
  87. package/workspace-templates/skills/ssllabs/SKILL.md +107 -0
  88. package/workspace-templates/skills/ssllabs/index.ts +208 -0
  89. package/workspace-templates/skills/ssllabs/skill.json +27 -0
  90. package/workspace-templates/skills/stable-diffusion-image-generation/SKILL.md +136 -0
  91. package/workspace-templates/skills/stable-diffusion-image-generation/skill.json +24 -0
  92. package/workspace-templates/skills/systematic-debugging/SKILL.md +131 -0
  93. package/workspace-templates/skills/systematic-debugging/skill.json +25 -0
  94. package/workspace-templates/skills/test-driven-development/SKILL.md +164 -0
  95. package/workspace-templates/skills/test-driven-development/skill.json +25 -0
  96. package/workspace-templates/skills/urlscan/SKILL.md +118 -0
  97. package/workspace-templates/skills/urlscan/index.ts +94 -0
  98. package/workspace-templates/skills/urlscan/skill.json +24 -0
  99. package/workspace-templates/skills/virustotal/SKILL.md +120 -0
  100. package/workspace-templates/skills/virustotal/index.ts +124 -0
  101. package/workspace-templates/skills/virustotal/skill.json +26 -0
  102. package/workspace-templates/skills/web_research/SKILL.md +18 -0
  103. package/workspace-templates/skills/web_research/skill.json +20 -0
  104. package/workspace-templates/skills/xitter/SKILL.md +148 -0
  105. package/workspace-templates/skills/xitter/skill.json +26 -0
  106. package/workspace-templates/skills/youtube-content/SKILL.md +121 -0
  107. package/workspace-templates/skills/youtube-content/skill.json +25 -0
@@ -0,0 +1,249 @@
1
+ // skills/cveapi/index.ts
2
+ // Programmatic handler — CVE lookup via MITRE CVE API with NVD fallback.
3
+
4
+ import { ApiSkill } from '../../core/apiSkillBase'
5
+
6
+ // Primary: MITRE CVE API (cveawg.mitre.org)
7
+ const mitre = new ApiSkill({
8
+ name: 'cveapi-mitre',
9
+ baseUrl: 'https://cveawg.mitre.org/api',
10
+ authType: 'none',
11
+ rateLimit: { requests: 10, windowMs: 1_000 },
12
+ timeout: 20_000,
13
+ retries: 2,
14
+ })
15
+
16
+ // Fallback: NVD (nvd.nist.gov) — optional API key for higher rate limits
17
+ function makeNvd(): ApiSkill {
18
+ const nvdKey = process.env['NVD_API_KEY']
19
+ if (nvdKey) {
20
+ return new ApiSkill({
21
+ name: 'cveapi-nvd',
22
+ baseUrl: 'https://services.nvd.nist.gov/rest/json',
23
+ authType: 'header',
24
+ authHeader: 'apiKey',
25
+ apiKey: nvdKey,
26
+ rateLimit: { requests: 50, windowMs: 30_000 },
27
+ timeout: 25_000,
28
+ retries: 2,
29
+ })
30
+ }
31
+ return new ApiSkill({
32
+ name: 'cveapi-nvd',
33
+ baseUrl: 'https://services.nvd.nist.gov/rest/json',
34
+ authType: 'none',
35
+ rateLimit: { requests: 5, windowMs: 30_000 },
36
+ timeout: 25_000,
37
+ retries: 2,
38
+ })
39
+ }
40
+
41
+ // ── Normalised output shape ───────────────────────────────────
42
+
43
+ export interface CveReport {
44
+ id: string
45
+ state: string
46
+ description: string
47
+ severity: string // CRITICAL / HIGH / MEDIUM / LOW / NONE / UNKNOWN
48
+ cvssScore: number | null
49
+ cvssVector: string
50
+ publishedDate: string
51
+ references: string[]
52
+ affected: string[] // "vendor product version" strings
53
+ source: 'mitre' | 'nvd'
54
+ }
55
+
56
+ // ── MITRE parser ──────────────────────────────────────────────
57
+
58
+ /** Extract CVSS score from a metrics array (cna or adp). */
59
+ function extractCvss(metrics: any[]): { score: number | null; vector: string; severity: string } {
60
+ for (const metric of (metrics ?? [])) {
61
+ // Prefer cvssV3_1, then cvssV3_0, then cvssV2_0
62
+ for (const key of ['cvssV3_1', 'cvssV3_0', 'cvssV2_0']) {
63
+ if (metric[key]) {
64
+ const m = metric[key]
65
+ return {
66
+ score: m.baseScore ?? null,
67
+ vector: m.vectorString ?? '',
68
+ severity: m.baseSeverity ?? 'UNKNOWN',
69
+ }
70
+ }
71
+ }
72
+ // Also catch any key that starts with cvssV3 (future proofing)
73
+ for (const key of Object.keys(metric)) {
74
+ if (key.startsWith('cvssV3')) {
75
+ const m = metric[key]
76
+ return {
77
+ score: m.baseScore ?? null,
78
+ vector: m.vectorString ?? '',
79
+ severity: m.baseSeverity ?? 'UNKNOWN',
80
+ }
81
+ }
82
+ }
83
+ }
84
+ return { score: null, vector: '', severity: 'UNKNOWN' }
85
+ }
86
+
87
+ function parseMitre(raw: any): CveReport {
88
+ const meta = raw.cveMetadata ?? {}
89
+ const cna = raw.containers?.cna ?? {}
90
+ const adps = raw.containers?.adp ?? [] // Additional Data Providers (e.g. NIST)
91
+
92
+ const description =
93
+ (cna.descriptions ?? []).find((d: any) => d.lang === 'en')?.value ?? ''
94
+
95
+ // Try CNA metrics first; fall back to any ADP that has CVSS
96
+ let cvssScore: number | null = null
97
+ let cvssVector = ''
98
+ let severity = 'UNKNOWN'
99
+
100
+ const cnaResult = extractCvss(cna.metrics ?? [])
101
+ if (cnaResult.score !== null) {
102
+ cvssScore = cnaResult.score
103
+ cvssVector = cnaResult.vector
104
+ severity = cnaResult.severity
105
+ } else {
106
+ for (const adp of adps) {
107
+ const adpResult = extractCvss(adp.metrics ?? [])
108
+ if (adpResult.score !== null) {
109
+ cvssScore = adpResult.score
110
+ cvssVector = adpResult.vector
111
+ severity = adpResult.severity
112
+ break
113
+ }
114
+ }
115
+ }
116
+
117
+ const references = (cna.references ?? [])
118
+ .map((r: any) => r.url as string)
119
+ .filter(Boolean)
120
+ .slice(0, 10)
121
+
122
+ const affected: string[] = []
123
+ for (const aff of (cna.affected ?? [])) {
124
+ const vendor = aff.vendor ?? ''
125
+ const product = aff.product ?? ''
126
+ for (const ver of (aff.versions ?? [])) {
127
+ if (ver.status === 'affected') {
128
+ affected.push(`${vendor} ${product} ${ver.version}`.trim())
129
+ }
130
+ }
131
+ if ((aff.versions ?? []).length === 0 && (vendor || product)) {
132
+ affected.push(`${vendor} ${product}`.trim())
133
+ }
134
+ }
135
+
136
+ return {
137
+ id: meta.cveId ?? '',
138
+ state: meta.state ?? '',
139
+ description,
140
+ severity,
141
+ cvssScore,
142
+ cvssVector,
143
+ publishedDate: meta.datePublished ?? '',
144
+ references,
145
+ affected: [...new Set(affected)].slice(0, 20),
146
+ source: 'mitre',
147
+ }
148
+ }
149
+
150
+ // ── NVD parser ────────────────────────────────────────────────
151
+
152
+ function parseNvd(raw: any): CveReport {
153
+ const cve = raw.vulnerabilities?.[0]?.cve ?? {}
154
+ const metrics = cve.metrics ?? {}
155
+
156
+ const description =
157
+ (cve.descriptions ?? []).find((d: any) => d.lang === 'en')?.value ?? ''
158
+
159
+ let cvssScore: number | null = null
160
+ let cvssVector = ''
161
+ let severity = 'UNKNOWN'
162
+
163
+ // Prefer V3.1, then V3.0, then V2.0
164
+ const v31 = metrics.cvssMetricV31?.[0]?.cvssData
165
+ const v30 = metrics.cvssMetricV30?.[0]?.cvssData
166
+ const v2 = metrics.cvssMetricV2?.[0]?.cvssData
167
+
168
+ const chosen = v31 ?? v30 ?? v2
169
+ if (chosen) {
170
+ cvssScore = chosen.baseScore ?? null
171
+ cvssVector = chosen.vectorString ?? ''
172
+ severity = chosen.baseSeverity ?? (v2 ? (chosen.baseScore >= 7 ? 'HIGH' : chosen.baseScore >= 4 ? 'MEDIUM' : 'LOW') : 'UNKNOWN')
173
+ }
174
+
175
+ const references = (cve.references ?? [])
176
+ .map((r: any) => r.url as string)
177
+ .filter(Boolean)
178
+ .slice(0, 10)
179
+
180
+ return {
181
+ id: cve.id ?? '',
182
+ state: cve.vulnStatus ?? '',
183
+ description,
184
+ severity,
185
+ cvssScore,
186
+ cvssVector,
187
+ publishedDate: cve.published ?? '',
188
+ references,
189
+ affected: [], // NVD configuration data is complex — omit for brevity
190
+ source: 'nvd',
191
+ }
192
+ }
193
+
194
+ // ── Public API ────────────────────────────────────────────────
195
+
196
+ /**
197
+ * Look up a CVE by ID (e.g. "CVE-2021-44228").
198
+ *
199
+ * Tries MITRE CVE API first; falls back to NVD if that fails.
200
+ * Returns a normalised CveReport regardless of source.
201
+ */
202
+ export async function lookupCve(cveId: string): Promise<CveReport> {
203
+ const id = cveId.trim().toUpperCase()
204
+
205
+ // Validate format
206
+ if (!/^CVE-\d{4}-\d{4,}$/i.test(id)) {
207
+ throw new Error(`Invalid CVE ID format: "${cveId}". Expected CVE-YYYY-NNNNN`)
208
+ }
209
+
210
+ // Try MITRE first
211
+ try {
212
+ const raw = await mitre.get(`/cve/${encodeURIComponent(id)}`)
213
+ return parseMitre(raw)
214
+ } catch (mitreErr: any) {
215
+ // Fall through to NVD on any error
216
+ }
217
+
218
+ // NVD fallback
219
+ const nvd = makeNvd()
220
+ const raw = await nvd.get('/cves/2.0', { cveId: id })
221
+ return parseNvd(raw)
222
+ }
223
+
224
+ /** Format a CveReport as a human-readable summary string. */
225
+ export function formatCve(report: CveReport): string {
226
+ const scoreStr = report.cvssScore !== null ? String(report.cvssScore) : 'N/A'
227
+ const lines = [
228
+ `CVE ID: ${report.id}`,
229
+ `Severity: ${report.severity} (CVSS ${scoreStr})`,
230
+ `State: ${report.state}`,
231
+ `Published: ${report.publishedDate}`,
232
+ `Source: ${report.source.toUpperCase()}`,
233
+ '',
234
+ `Description: ${report.description}`,
235
+ ]
236
+
237
+ if (report.affected.length > 0) {
238
+ lines.push('', 'Affected:')
239
+ report.affected.slice(0, 5).forEach(a => lines.push(` • ${a}`))
240
+ if (report.affected.length > 5) lines.push(` … and ${report.affected.length - 5} more`)
241
+ }
242
+
243
+ if (report.references.length > 0) {
244
+ lines.push('', 'References:')
245
+ report.references.slice(0, 5).forEach(r => lines.push(` ${r}`))
246
+ }
247
+
248
+ return lines.join('\n')
249
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "cveapi",
3
+ "version": "1.0.0",
4
+ "description": "Look up CVE vulnerability details by ID via MITRE CVE API with NVD fallback — severity, CVSS score, affected products, and references",
5
+ "author": "aiden",
6
+ "license": "MIT",
7
+ "tools": [],
8
+ "trigger_phrases": [],
9
+ "compatible_agents": [
10
+ "aiden"
11
+ ],
12
+ "min_agent_version": "3.0.0",
13
+ "tags": [
14
+ "security",
15
+ "cve",
16
+ "vulnerability",
17
+ "nvd",
18
+ "mitre",
19
+ "cvss",
20
+ "patch",
21
+ "incident-response",
22
+ "compliance"
23
+ ],
24
+ "created": "2026-04-27T17:11:39.429Z"
25
+ }
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: docker-management
3
+ description: Manage Docker containers, images, volumes, and networks via the Docker CLI and Dockerode API
4
+ category: developer
5
+ version: 1.0.0
6
+ origin: aiden
7
+ license: Apache-2.0
8
+ tags: docker, containers, images, volumes, networks, compose, dockerode, devops, deployment
9
+ ---
10
+
11
+ # Docker Container Management
12
+
13
+ Manage Docker containers, images, volumes, and networks using the Docker CLI or Dockerode (Node.js Docker API client already in DevOS).
14
+
15
+ ## When to Use
16
+
17
+ - User wants to list running or stopped containers
18
+ - User wants to start, stop, or restart a container
19
+ - User wants to pull, build, or remove Docker images
20
+ - User wants to view container logs
21
+ - User wants to inspect container resource usage
22
+
23
+ ## How to Use
24
+
25
+ ### 1. List containers
26
+
27
+ ```powershell
28
+ # Running containers
29
+ docker ps
30
+
31
+ # All containers including stopped
32
+ docker ps -a --format "table {{.Names}}\t{{.Status}}\t{{.Image}}\t{{.Ports}}"
33
+ ```
34
+
35
+ ### 2. Start, stop, and restart containers
36
+
37
+ ```powershell
38
+ docker start my-container
39
+ docker stop my-container
40
+ docker restart my-container
41
+
42
+ # Stop all running containers
43
+ docker stop $(docker ps -q)
44
+ ```
45
+
46
+ ### 3. View container logs
47
+
48
+ ```powershell
49
+ # Last 100 lines
50
+ docker logs my-container --tail 100
51
+
52
+ # Follow live output
53
+ docker logs my-container --follow --tail 50
54
+ ```
55
+
56
+ ### 4. Manage images
57
+
58
+ ```powershell
59
+ # List images
60
+ docker images
61
+
62
+ # Pull latest image
63
+ docker pull nginx:latest
64
+
65
+ # Remove image
66
+ docker rmi nginx:latest
67
+
68
+ # Build from Dockerfile in current directory
69
+ docker build -t my-app:v1 .
70
+ ```
71
+
72
+ ### 5. Container resource usage
73
+
74
+ ```powershell
75
+ # Live resource stats (CPU, memory, network)
76
+ docker stats --no-stream
77
+
78
+ # Inspect a specific container
79
+ docker inspect my-container | python -m json.tool
80
+ ```
81
+
82
+ ### 6. Manage volumes and networks
83
+
84
+ ```powershell
85
+ # List volumes
86
+ docker volume ls
87
+
88
+ # List networks
89
+ docker network ls
90
+
91
+ # Remove unused volumes (reclaim disk)
92
+ docker volume prune -f
93
+
94
+ # Remove stopped containers, unused images, and networks
95
+ docker system prune -f
96
+ ```
97
+
98
+ ### 7. Execute commands inside a container
99
+
100
+ ```powershell
101
+ # Interactive shell
102
+ docker exec -it my-container /bin/bash
103
+
104
+ # Run a single command
105
+ docker exec my-container cat /etc/nginx/nginx.conf
106
+ ```
107
+
108
+ ### 8. Docker Compose operations
109
+
110
+ ```powershell
111
+ # Start all services defined in docker-compose.yml
112
+ docker compose up -d
113
+
114
+ # View logs for all services
115
+ docker compose logs -f
116
+
117
+ # Stop and remove containers
118
+ docker compose down
119
+
120
+ # Rebuild and restart a specific service
121
+ docker compose up -d --build api
122
+ ```
123
+
124
+ ### 9. Use Dockerode API (Node.js)
125
+
126
+ ```javascript
127
+ // Already available in DevOS dependencies
128
+ const Dockerode = require('dockerode')
129
+ const docker = new Dockerode()
130
+
131
+ const containers = await docker.listContainers({ all: true })
132
+ containers.forEach(c => console.log(c.Names[0], c.State, c.Image))
133
+
134
+ const container = docker.getContainer('my-container')
135
+ await container.restart()
136
+ console.log('Restarted')
137
+ ```
138
+
139
+ ## Examples
140
+
141
+ **"Show me all running containers and their ports"**
142
+ → Use step 1 with `docker ps` and the format string.
143
+
144
+ **"The nginx container seems slow — show me its CPU and memory usage"**
145
+ → Use step 5 with `docker stats --no-stream` filtered to the nginx container.
146
+
147
+ **"Rebuild and restart the API service after my code change"**
148
+ → Use step 8: `docker compose up -d --build api`.
149
+
150
+ ## Cautions
151
+
152
+ - `docker system prune` removes ALL stopped containers, unused images, and networks — confirm with the user first
153
+ - `docker stop $(docker ps -q)` stops ALL running containers — confirm which containers to stop
154
+ - Bind mounts expose host filesystem paths to containers — check paths before mounting
155
+ - For production deployments, prefer `docker compose` or Kubernetes over direct `docker run` commands
156
+ - Container logs can grow very large — use `--tail` to limit output for inspection
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "docker-management",
3
+ "version": "1.0.0",
4
+ "description": "Manage Docker containers, images, volumes, and networks via the Docker CLI and Dockerode API",
5
+ "author": "aiden",
6
+ "license": "MIT",
7
+ "tools": [],
8
+ "trigger_phrases": [],
9
+ "compatible_agents": [
10
+ "aiden"
11
+ ],
12
+ "min_agent_version": "3.0.0",
13
+ "tags": [
14
+ "docker",
15
+ "containers",
16
+ "images",
17
+ "volumes",
18
+ "networks",
19
+ "compose",
20
+ "dockerode",
21
+ "devops",
22
+ "deployment"
23
+ ],
24
+ "created": "2026-04-27T17:11:39.484Z"
25
+ }
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: excalidraw
3
+ description: Create hand-drawn style diagrams and sketches in Excalidraw JSON format for architecture, flowcharts, and system design
4
+ category: productivity
5
+ version: 1.0.0
6
+ origin: aiden
7
+ license: Apache-2.0
8
+ tags: excalidraw, diagram, architecture, flowchart, sketch, visualization, json, drawing, design
9
+ ---
10
+
11
+ # Excalidraw Diagram Creation
12
+
13
+ Generate Excalidraw scene files (`.excalidraw`) by writing JSON that the Excalidraw app can open directly. Ideal for architecture diagrams, flowcharts, mind maps, and system design sketches in the characteristic hand-drawn style.
14
+
15
+ ## When to Use
16
+
17
+ - User wants a system architecture or component diagram
18
+ - User wants a flowchart or decision tree
19
+ - User wants a sequence or interaction diagram
20
+ - User wants a mind map or concept map
21
+ - User wants any visual sketch they can open and edit in Excalidraw
22
+
23
+ ## How to Use
24
+
25
+ ### 1. Understand the Excalidraw JSON schema
26
+
27
+ An Excalidraw file is a JSON object with this top-level structure:
28
+
29
+ ```json
30
+ {
31
+ "type": "excalidraw",
32
+ "version": 2,
33
+ "source": "https://excalidraw.com",
34
+ "elements": [],
35
+ "appState": { "viewBackgroundColor": "#ffffff" },
36
+ "files": {}
37
+ }
38
+ ```
39
+
40
+ Each element in `"elements"` is a shape with a common set of fields:
41
+
42
+ ```json
43
+ {
44
+ "id": "unique-id",
45
+ "type": "rectangle",
46
+ "x": 100, "y": 100,
47
+ "width": 200, "height": 80,
48
+ "angle": 0,
49
+ "strokeColor": "#1e1e1e",
50
+ "backgroundColor": "#a5d8ff",
51
+ "fillStyle": "hachure",
52
+ "strokeWidth": 2,
53
+ "roughness": 1,
54
+ "opacity": 100
55
+ }
56
+ ```
57
+
58
+ Common element types: `rectangle`, `ellipse`, `diamond`, `arrow`, `line`, `text`, `freedraw`.
59
+
60
+ ### 2. Add text labels
61
+
62
+ Use a `text` element positioned over or near shapes:
63
+
64
+ ```json
65
+ {
66
+ "id": "txt-1",
67
+ "type": "text",
68
+ "x": 130, "y": 130,
69
+ "width": 140, "height": 25,
70
+ "text": "Web Server",
71
+ "fontSize": 16,
72
+ "fontFamily": 1,
73
+ "textAlign": "center",
74
+ "verticalAlign": "middle"
75
+ }
76
+ ```
77
+
78
+ ### 3. Connect shapes with arrows
79
+
80
+ ```json
81
+ {
82
+ "id": "arrow-1",
83
+ "type": "arrow",
84
+ "x": 300, "y": 140,
85
+ "width": 100, "height": 0,
86
+ "points": [[0, 0], [100, 0]],
87
+ "startArrowhead": null,
88
+ "endArrowhead": "arrow",
89
+ "strokeColor": "#1e1e1e",
90
+ "strokeWidth": 2,
91
+ "roughness": 1
92
+ }
93
+ ```
94
+
95
+ ### 4. Generate and save the file
96
+
97
+ ```python
98
+ import json, uuid
99
+
100
+ def make_rect(x, y, w, h, label, bg="#a5d8ff"):
101
+ eid = str(uuid.uuid4())[:8]
102
+ return [
103
+ { "id": eid, "type": "rectangle", "x": x, "y": y, "width": w, "height": h,
104
+ "angle": 0, "strokeColor": "#1e1e1e", "backgroundColor": bg,
105
+ "fillStyle": "hachure", "strokeWidth": 2, "roughness": 1, "opacity": 100 },
106
+ { "id": eid+"t", "type": "text", "x": x+10, "y": y+(h//2)-10,
107
+ "width": w-20, "height": 20, "text": label, "fontSize": 16,
108
+ "fontFamily": 1, "textAlign": "center", "verticalAlign": "middle",
109
+ "strokeColor": "#1e1e1e", "opacity": 100 }
110
+ ]
111
+
112
+ elements = []
113
+ elements += make_rect(100, 100, 160, 60, "Browser", "#ffd43b")
114
+ elements += make_rect(350, 100, 160, 60, "API Server", "#a5d8ff")
115
+ elements += make_rect(600, 100, 160, 60, "Database", "#b2f2bb")
116
+
117
+ scene = { "type": "excalidraw", "version": 2, "source": "https://excalidraw.com",
118
+ "elements": elements, "appState": { "viewBackgroundColor": "#ffffff" }, "files": {} }
119
+
120
+ with open("architecture.excalidraw", "w") as f:
121
+ json.dump(scene, f, indent=2)
122
+ print("Saved architecture.excalidraw — open in https://excalidraw.com")
123
+ ```
124
+
125
+ ### 5. Open the file
126
+
127
+ The user can open the `.excalidraw` file by:
128
+ - Dragging it into https://excalidraw.com in a browser
129
+ - Opening it via File → Open in the Excalidraw desktop app
130
+
131
+ ## Examples
132
+
133
+ **"Draw a simple 3-tier web architecture diagram"**
134
+ → Use step 4 to generate three rectangles (Browser → API Server → Database) with connecting arrows. Save as `architecture.excalidraw`.
135
+
136
+ **"Create a flowchart for a login process"**
137
+ → Use rectangles for steps, diamonds for decisions, arrows for flow. Generate JSON and save.
138
+
139
+ **"Make a mind map about machine learning concepts"**
140
+ → Place a central ellipse, surround with connected sub-topic ellipses using short arrows.
141
+
142
+ ## Cautions
143
+
144
+ - All coordinates are in pixels — plan layout with approximate x/y offsets before generating
145
+ - Excalidraw IDs must be unique per element — always use `uuid.uuid4()` or similar
146
+ - The `roughness` property (0–2) controls the hand-drawn effect: 0=clean, 1=normal, 2=very rough
147
+ - Very large diagrams (> 200 elements) may be slow to render in the browser
148
+ - Excalidraw JSON format may evolve — use `"version": 2` which is the stable current format
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "excalidraw",
3
+ "version": "1.0.0",
4
+ "description": "Create hand-drawn style diagrams and sketches in Excalidraw JSON format for architecture, flowcharts, and system design",
5
+ "author": "aiden",
6
+ "license": "MIT",
7
+ "tools": [],
8
+ "trigger_phrases": [],
9
+ "compatible_agents": [
10
+ "aiden"
11
+ ],
12
+ "min_agent_version": "3.0.0",
13
+ "tags": [
14
+ "excalidraw",
15
+ "diagram",
16
+ "architecture",
17
+ "flowchart",
18
+ "sketch",
19
+ "visualization",
20
+ "json",
21
+ "drawing",
22
+ "design"
23
+ ],
24
+ "created": "2026-04-27T17:11:39.517Z"
25
+ }