emberflow-skills 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/install.js CHANGED
@@ -7,7 +7,7 @@ const http = require('http');
7
7
  const readline = require('readline');
8
8
  const os = require('os');
9
9
 
10
- const SKILL_NAMES = ['ember-publish', 'ember-publish-json', 'ember-publish-space'];
10
+ const SKILL_NAMES = ['ember-publish', 'ember-publish-doc', 'ember-publish-json', 'ember-publish-space'];
11
11
  const SKILLS_DIR = path.join(__dirname, '..', 'skills');
12
12
  const EMBERFLOW_URL = 'https://www.emberflow.ai';
13
13
  const TOKEN_PATH = path.join(os.homedir(), '.emberflow', 'token.json');
@@ -227,7 +227,8 @@ async function main() {
227
227
 
228
228
  if (installed > 0) {
229
229
  console.log();
230
- console.log(` Use: ${cyan('/ember-publish')} ${dim('[topic]')} or ${cyan('/ember-publish-json')} ${dim('[data]')} or ${cyan('/ember-publish-space')} ${dim('[directory]')}`);
230
+ console.log(` Use: ${cyan('/ember-publish')} ${dim('[topic]')} — auto-picks format (doc, JSON, or Space)`);
231
+ console.log(` ${cyan('/ember-publish-doc')} ${dim('[topic]')} ${cyan('/ember-publish-json')} ${dim('[data]')} ${cyan('/ember-publish-space')} ${dim('[directory]')}`);
231
232
  }
232
233
  }
233
234
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emberflow-skills",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Install Emberflow skills for AI coding tools",
5
5
  "bin": {
6
6
  "emberflow-skills": "./bin/install.js"
@@ -1,120 +1,40 @@
1
1
  ---
2
2
  name: ember-publish
3
- description: Create a markdown document with Mermaid diagrams and publish it to Emberflow for hosted viewing with comments
4
- argument-hint: [topic or description of what to document]
3
+ description: Publish content to Emberflow automatically picks the right format (document, JSON explorer, or Space) based on your content
4
+ argument-hint: [topic, file path, directory, or description of what to publish]
5
5
  ---
6
6
 
7
- # Emberflow Document Publisher
7
+ # Emberflow Publisher
8
8
 
9
- Create a polished markdown document and publish it to Emberflow — a hosted viewer at **https://emberflow.ai** with Mermaid diagram rendering (zoom/pan/fullscreen), dark mode, font selection, and per-block commenting.
9
+ Publish content to Emberflow at **https://emberflow.ai**. This skill automatically determines the best format based on what you're publishing:
10
10
 
11
- ## Step 1: Create the Markdown File
11
+ | Content | Published as | Equivalent skill |
12
+ |---------|-------------|-----------------|
13
+ | A topic or markdown description | Markdown document with Mermaid diagrams | `/ember-publish-doc` |
14
+ | JSON data or a `.json` file | Interactive JSON explorer with tree + graph | `/ember-publish-json` |
15
+ | A directory of `.md` files | Multi-page docs site (Space) with sidebar nav | `/ember-publish-space` |
12
16
 
13
- Write a `.md` file in the current project. The document should follow these conventions:
17
+ ## How to Decide
14
18
 
15
- ### Structure
16
- - Start with a single `# Title` as the first line (this becomes the document title and slug)
17
- - Use `##` and `###` for sections these become commentable blocks in the viewer
18
- - Keep paragraphs concise — each paragraph, list, table, blockquote, and heading is independently commentable by readers
19
+ 1. **If the user provides a directory path** or mentions "docs site", "space", or "multi-page" → use the `/ember-publish-space` workflow
20
+ 2. **If the user provides a `.json` file**, JSON data, or asks to publish JSON/API responses use the `/ember-publish-json` workflow
21
+ 3. **Otherwise** (topic description, markdown file, or general documentation request) use the `/ember-publish-doc` workflow
19
22
 
20
- ### Mermaid Diagrams
23
+ ## Delegation
21
24
 
22
- Use fenced code blocks with the `mermaid` language tag. The viewer renders them with zoom, pan, and fullscreen controls.
25
+ Once you've determined the content type, follow the full instructions from the appropriate specific skill:
23
26
 
24
- ````markdown
25
- ```mermaid
26
- graph LR
27
- A[Start] --> B{Decision}
28
- B -->|Yes| C[Action]
29
- B -->|No| D[Other Action]
30
- ```
31
- ````
32
-
33
- Supported diagram types:
34
- - `graph` / `flowchart` — flow diagrams (LR, TD, etc.)
35
- - `sequenceDiagram` — interaction sequences
36
- - `classDiagram` — class relationships
37
- - `stateDiagram-v2` — state machines
38
- - `erDiagram` — entity relationships
39
- - `gantt` — project timelines
40
- - `pie` — pie charts
41
- - `gitgraph` — git branch visualizations
42
- - `mindmap` — mind maps
43
- - `timeline` — chronological events
44
-
45
- #### Dark Mode Color Palette
46
-
47
- The viewer auto-remaps these light colors to dark equivalents. Use them for best cross-theme rendering:
48
-
49
- | Color | Use For |
50
- |---|---|
51
- | `#e1f5fe` | Blue backgrounds |
52
- | `#e8f5e9` | Green backgrounds |
53
- | `#fff3e0` | Orange backgrounds |
54
- | `#fce4ec` | Red backgrounds |
55
- | `#f3e5f5` | Purple backgrounds |
56
- | `#fff9c4` | Yellow backgrounds |
57
-
58
- ### Tables, Code, Blockquotes
59
-
60
- Standard GFM (GitHub Flavored Markdown) is fully supported:
61
-
62
- ```markdown
63
- | Column A | Column B |
64
- |----------|----------|
65
- | value | value |
27
+ - **Markdown documents** → Follow `/ember-publish-doc` instructions exactly
28
+ - **JSON data** → Follow `/ember-publish-json` instructions exactly
29
+ - **Directory / Space** → Follow `/ember-publish-space` instructions exactly
66
30
 
67
- > Blockquotes render with a blue left border
31
+ > **Tip:** If you're unsure, default to `/ember-publish-doc` — it's the most common use case.
68
32
 
69
- `inline code` and fenced code blocks with syntax highlighting
70
- ```
71
-
72
- ### Example Document
73
-
74
- ````markdown
75
- # API Architecture Overview
76
-
77
- Brief introduction to the system.
33
+ ## Quick Reference
78
34
 
79
- ## Components
80
-
81
- ```mermaid
82
- graph TD
83
- Client[Web Client] --> API[API Gateway]
84
- API --> Auth[Auth Service]
85
- API --> Docs[Doc Service]
86
- Docs --> DB[(PostgreSQL)]
87
- ```
88
-
89
- ## Request Flow
90
-
91
- ```mermaid
92
- sequenceDiagram
93
- participant C as Client
94
- participant G as Gateway
95
- participant S as Service
96
- C->>G: Request
97
- G->>S: Forward
98
- S->>G: Response
99
- G->>C: Response
100
- ```
35
+ ### Authentication
101
36
 
102
- ## Data Model
103
-
104
- | Entity | Purpose |
105
- |--------|---------|
106
- | Users | Account management |
107
- | Documents | Published content |
108
- | Comments | Discussion threads |
109
-
110
- ## Design Notes
111
-
112
- > We chose event sourcing to maintain a complete audit trail of all state changes.
113
- ````
114
-
115
- ## Step 2: Authenticate (if needed)
116
-
117
- Session tokens are stored at `~/.emberflow/token.json`. Check if a valid session exists:
37
+ All three workflows use the same auth. Session tokens are stored at `~/.emberflow/token.json`. Check if a valid session exists:
118
38
 
119
39
  ```bash
120
40
  cat ~/.emberflow/token.json 2>/dev/null
@@ -159,39 +79,12 @@ while true; do
159
79
  done
160
80
  ```
161
81
 
162
- ## Step 3: Publish
82
+ ### Publish Endpoints
163
83
 
164
- Generate a slug from the document title and publish using the API:
84
+ - **Markdown / JSON**: `POST /api/docs` with `{ slug, title, content, visibility, content_type? }`
85
+ - **Spaces**: `POST /api/spaces` then `POST /api/spaces/{id}/publish` with `{ documents, nav }`
165
86
 
166
- ```bash
167
- # Read the file, extract title, generate slug, and publish
168
- EMBERFLOW_URL="https://emberflow.ai"
169
- FILE_PATH="/absolute/path/to/document.md"
170
- TITLE=$(head -1 "$FILE_PATH" | sed 's/^#\s*//')
171
- SLUG=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | tr -cs 'a-z0-9' '-' | sed 's/^-//;s/-$//')
172
- TOKEN=$(jq -r .token ~/.emberflow/token.json)
173
-
174
- curl -s -X POST "$EMBERFLOW_URL/api/docs" \
175
- -H 'Content-Type: application/json' \
176
- -H "Authorization: Bearer $TOKEN" \
177
- -d "$(jq -n --arg slug "$SLUG" --arg title "$TITLE" --rawfile content "$FILE_PATH" \
178
- '{slug: $slug, title: $title, content: $content, visibility: "public"}')"
179
- ```
87
+ ### Document URLs
180
88
 
181
- The response JSON includes the URL. Documents are viewable at:
182
- - Public: `https://emberflow.ai/d/<slug>`
183
- - Private: `https://emberflow.ai/d/<slug>?key=<private-key>`
184
-
185
- To **update** an existing document, publish again with the same slug — the API upserts for the same author.
186
-
187
- > **JSON documents**: You can also publish JSON data by passing `content_type: "json"` in the API payload. The content should be valid JSON (either raw data or the multi-payload format `{"payloads": [{"label": "...", "data": ...}]}`). Use the `/ember-publish-json` skill for a dedicated JSON publishing workflow.
188
-
189
- ### Other Operations
190
-
191
- ```bash
192
- # List all your documents
193
- curl -s -H "Authorization: Bearer $TOKEN" "$EMBERFLOW_URL/api/docs"
194
-
195
- # Delete a document
196
- curl -s -X DELETE -H "Authorization: Bearer $TOKEN" "$EMBERFLOW_URL/api/docs/SLUG_HERE"
197
- ```
89
+ - Documents: `https://emberflow.ai/d/<shortId>/<slug>`
90
+ - Spaces: `https://emberflow.ai/s/<author_short_id>/<space_slug>`
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: ember-publish-doc
3
+ description: Publish a markdown document with Mermaid diagrams to Emberflow for hosted viewing with comments
4
+ argument-hint: [topic or description of what to document]
5
+ ---
6
+
7
+ # Emberflow Document Publisher
8
+
9
+ Create a polished markdown document and publish it to Emberflow — a hosted viewer at **https://emberflow.ai** with Mermaid diagram rendering (zoom/pan/fullscreen), dark mode, font selection, and per-block commenting.
10
+
11
+ ## Step 1: Create the Markdown File
12
+
13
+ Write a `.md` file in the current project. The document should follow these conventions:
14
+
15
+ ### Structure
16
+ - Start with a single `# Title` as the first line (this becomes the document title and slug)
17
+ - Use `##` and `###` for sections — these become commentable blocks in the viewer
18
+ - Keep paragraphs concise — each paragraph, list, table, blockquote, and heading is independently commentable by readers
19
+
20
+ ### Mermaid Diagrams
21
+
22
+ Use fenced code blocks with the `mermaid` language tag. The viewer renders them with zoom, pan, and fullscreen controls.
23
+
24
+ ````markdown
25
+ ```mermaid
26
+ graph LR
27
+ A[Start] --> B{Decision}
28
+ B -->|Yes| C[Action]
29
+ B -->|No| D[Other Action]
30
+ ```
31
+ ````
32
+
33
+ Supported diagram types:
34
+ - `graph` / `flowchart` — flow diagrams (LR, TD, etc.)
35
+ - `sequenceDiagram` — interaction sequences
36
+ - `classDiagram` — class relationships
37
+ - `stateDiagram-v2` — state machines
38
+ - `erDiagram` — entity relationships
39
+ - `gantt` — project timelines
40
+ - `pie` — pie charts
41
+ - `gitgraph` — git branch visualizations
42
+ - `mindmap` — mind maps
43
+ - `timeline` — chronological events
44
+
45
+ #### Dark Mode Color Palette
46
+
47
+ The viewer auto-remaps these light colors to dark equivalents. Use them for best cross-theme rendering:
48
+
49
+ | Color | Use For |
50
+ |---|---|
51
+ | `#e1f5fe` | Blue backgrounds |
52
+ | `#e8f5e9` | Green backgrounds |
53
+ | `#fff3e0` | Orange backgrounds |
54
+ | `#fce4ec` | Red backgrounds |
55
+ | `#f3e5f5` | Purple backgrounds |
56
+ | `#fff9c4` | Yellow backgrounds |
57
+
58
+ ### Tables, Code, Blockquotes
59
+
60
+ Standard GFM (GitHub Flavored Markdown) is fully supported:
61
+
62
+ ```markdown
63
+ | Column A | Column B |
64
+ |----------|----------|
65
+ | value | value |
66
+
67
+ > Blockquotes render with a blue left border
68
+
69
+ `inline code` and fenced code blocks with syntax highlighting
70
+ ```
71
+
72
+ ### Example Document
73
+
74
+ ````markdown
75
+ # API Architecture Overview
76
+
77
+ Brief introduction to the system.
78
+
79
+ ## Components
80
+
81
+ ```mermaid
82
+ graph TD
83
+ Client[Web Client] --> API[API Gateway]
84
+ API --> Auth[Auth Service]
85
+ API --> Docs[Doc Service]
86
+ Docs --> DB[(PostgreSQL)]
87
+ ```
88
+
89
+ ## Request Flow
90
+
91
+ ```mermaid
92
+ sequenceDiagram
93
+ participant C as Client
94
+ participant G as Gateway
95
+ participant S as Service
96
+ C->>G: Request
97
+ G->>S: Forward
98
+ S->>G: Response
99
+ G->>C: Response
100
+ ```
101
+
102
+ ## Data Model
103
+
104
+ | Entity | Purpose |
105
+ |--------|---------|
106
+ | Users | Account management |
107
+ | Documents | Published content |
108
+ | Comments | Discussion threads |
109
+
110
+ ## Design Notes
111
+
112
+ > We chose event sourcing to maintain a complete audit trail of all state changes.
113
+ ````
114
+
115
+ ## Step 2: Authenticate (if needed)
116
+
117
+ Session tokens are stored at `~/.emberflow/token.json`. Check if a valid session exists:
118
+
119
+ ```bash
120
+ cat ~/.emberflow/token.json 2>/dev/null
121
+ ```
122
+
123
+ If the file exists, verify the token still works:
124
+
125
+ ```bash
126
+ curl -s -H "Authorization: Bearer $(jq -r .token ~/.emberflow/token.json)" \
127
+ https://emberflow.ai/api/docs
128
+ ```
129
+
130
+ If no session exists, it's expired, or the verify call returns 401, authenticate using the device flow:
131
+
132
+ ```bash
133
+ EMBERFLOW_URL="https://emberflow.ai"
134
+
135
+ # Step 1: Request a device code
136
+ RESP=$(curl -s -X POST "$EMBERFLOW_URL/api/device-code")
137
+ CODE=$(echo "$RESP" | jq -r .code)
138
+ URL=$(echo "$RESP" | jq -r .verification_url)
139
+ ```
140
+
141
+ Tell the user to open the URL in their browser to sign in and approve the device. Then poll until approved:
142
+
143
+ ```bash
144
+ # Step 2: Poll until approved (every 3s)
145
+ while true; do
146
+ STATUS=$(curl -s "$EMBERFLOW_URL/api/device-code/$CODE")
147
+ S=$(echo "$STATUS" | jq -r .status)
148
+ if [ "$S" = "approved" ]; then
149
+ TOKEN=$(echo "$STATUS" | jq -r .session_token)
150
+ mkdir -p ~/.emberflow
151
+ echo "{\"token\":\"$TOKEN\"}" > ~/.emberflow/token.json
152
+ break
153
+ fi
154
+ if [ "$S" = "expired" ]; then
155
+ echo "Code expired. Please try again."
156
+ break
157
+ fi
158
+ sleep 3
159
+ done
160
+ ```
161
+
162
+ ## Step 3: Publish
163
+
164
+ Generate a slug from the document title and publish using the API:
165
+
166
+ ```bash
167
+ # Read the file, extract title, generate slug, and publish
168
+ EMBERFLOW_URL="https://emberflow.ai"
169
+ FILE_PATH="/absolute/path/to/document.md"
170
+ TITLE=$(head -1 "$FILE_PATH" | sed 's/^#\s*//')
171
+ SLUG=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | tr -cs 'a-z0-9' '-' | sed 's/^-//;s/-$//')
172
+ TOKEN=$(jq -r .token ~/.emberflow/token.json)
173
+
174
+ curl -s -X POST "$EMBERFLOW_URL/api/docs" \
175
+ -H 'Content-Type: application/json' \
176
+ -H "Authorization: Bearer $TOKEN" \
177
+ -d "$(jq -n --arg slug "$SLUG" --arg title "$TITLE" --rawfile content "$FILE_PATH" \
178
+ '{slug: $slug, title: $title, content: $content, visibility: "public"}')"
179
+ ```
180
+
181
+ The response JSON includes the URL. Documents are viewable at:
182
+ - Public: `https://emberflow.ai/d/<slug>`
183
+ - Private: `https://emberflow.ai/d/<slug>?key=<private-key>`
184
+
185
+ To **update** an existing document, publish again with the same slug — the API upserts for the same author.
186
+
187
+ > **JSON documents**: You can also publish JSON data by passing `content_type: "json"` in the API payload. The content should be valid JSON (either raw data or the multi-payload format `{"payloads": [{"label": "...", "data": ...}]}`). Use the `/ember-publish-json` skill for a dedicated JSON publishing workflow.
188
+
189
+ ### Other Operations
190
+
191
+ ```bash
192
+ # List all your documents
193
+ curl -s -H "Authorization: Bearer $TOKEN" "$EMBERFLOW_URL/api/docs"
194
+
195
+ # Delete a document
196
+ curl -s -X DELETE -H "Authorization: Bearer $TOKEN" "$EMBERFLOW_URL/api/docs/SLUG_HERE"
197
+ ```