@xmindltd/xmind-cli 0.2.1

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.
@@ -0,0 +1,117 @@
1
+ # Task Overlay
2
+
3
+ Optional layer for maps that represent work to be executed: projects, OKRs,
4
+ tasks, schedules, WBS, roadmaps, progress tracking, or team plans. Do not load
5
+ for ordinary knowledge maps or brainstorms.
6
+
7
+ ## Load When
8
+
9
+ Use this layer when the request mentions, or the content clearly implies:
10
+
11
+ - project / OKR / task / checklist execution
12
+ - schedule / deadline / progress / roadmap
13
+ - owner / assignee / team / WBS
14
+ - dependency / blocker / status tracking
15
+
16
+ Equivalent terms in other languages count.
17
+
18
+ ## Xmind Task Model Rule
19
+
20
+ Xmind has one task-extension slot per topic. It is either:
21
+
22
+ - checkbox task: `{status: "todo" | "done"}`;
23
+ - scheduled task: `{duration, progress, due?, start?}`.
24
+
25
+ Do not mix `status` with `due`, `progress`, or `duration` in the same task
26
+ extension. For deadline + completion tracking, use a visible state marker plus a
27
+ scheduled `todo`.
28
+
29
+ ## Capabilities
30
+
31
+ ### Priority
32
+
33
+ ```json
34
+ {"op": "marker", "topic": "User Research", "marker": "priority-1"}
35
+ ```
36
+
37
+ P1 is highest; use `priority-1` through `priority-9`.
38
+
39
+ ### State
40
+
41
+ | State | Marker |
42
+ |---|---|
43
+ | To do | `task-start` |
44
+ | In progress | `task` |
45
+ | Paused / blocked | `task-pause` |
46
+ | Done | `task-done` |
47
+
48
+ State markers can stack with priority markers and scheduled `todo` data.
49
+
50
+ ### Owner / Effort
51
+
52
+ ```json
53
+ {"op": "label", "topic": "User Research", "labels": ["@Lily", "effort:3d"]}
54
+ ```
55
+
56
+ Use `@Name` for owners. Effort labels follow `effort:Nd`, `effort:Nh`, or
57
+ `effort:Nw`.
58
+
59
+ ### Due Date / Progress
60
+
61
+ ```json
62
+ {"op": "todo", "topic": "User Research", "due": "2026-04-22", "progress": 0.4}
63
+ ```
64
+
65
+ Dates must be ISO `YYYY-MM-DD`. `progress` is `0..1`. Do not add a bare checkbox
66
+ todo to a topic that already has scheduled task data.
67
+
68
+ ### Dependency
69
+
70
+ ```json
71
+ {"op": "relation", "from": "User Research", "to": "Prototype Design", "title": "blocks"}
72
+ ```
73
+
74
+ `from` is the prerequisite; `to` is the dependent outcome.
75
+
76
+ ## Where To Apply
77
+
78
+ Apply task metadata only to work nodes:
79
+
80
+ - phase / milestone / release: owner, due, priority, dependency;
81
+ - action / checklist item: state, due, optional owner/effort;
82
+ - review / gate / exam / capstone: priority plus due;
83
+ - concept / reference / explanation: no task metadata unless it is explicitly a
84
+ deliverable.
85
+
86
+ Do not invent due dates when the map has no date signal. Use state, priority,
87
+ owner, or effort unless the user asks for scheduling.
88
+
89
+ ## Overlay Quality Gate
90
+
91
+ Before applying task metadata:
92
+
93
+ - Each target is work to be executed, not a concept or explanatory note.
94
+ - Owners, dates, and progress come from the user or explicit context.
95
+ - Dependencies point from prerequisite to dependent outcome.
96
+ - Priority marks relative urgency or importance, not visual emphasis.
97
+ - Existing knowledge-map semantics remain readable without the overlay.
98
+
99
+ ## Common Composition
100
+
101
+ ```json
102
+ [
103
+ {"op": "marker", "topic": "User Research", "marker": "priority-1"},
104
+ {"op": "marker", "topic": "User Research", "marker": "task"},
105
+ {"op": "label", "topic": "User Research", "labels": ["@Lily", "effort:3d"]},
106
+ {"op": "todo", "topic": "User Research", "due": "2026-04-22", "progress": 0.4}
107
+ ]
108
+ ```
109
+
110
+ Clear metadata:
111
+
112
+ ```json
113
+ {"op": "marker", "topic": "User Research", "marker": "task", "remove": true}
114
+ {"op": "todo", "topic": "User Research", "remove": true}
115
+ ```
116
+
117
+ Batch repeated metadata with `topics: [...]` when appropriate.
@@ -0,0 +1 @@
1
+ []
@@ -0,0 +1,109 @@
1
+ # Visual
2
+
3
+ Semantic visual planner. Load with `markdown-grammar` and the chosen recipe for
4
+ rich generation.
5
+
6
+ Visual does not write content. It helps the Agent declare `baseline` and
7
+ `anchors` in the `xmind generate` spec. The CLI executes and validates.
8
+
9
+ ## Boundaries
10
+
11
+ - Recipe owns markdown, density, and semantic signals.
12
+ - Agent owns semantic visual judgment.
13
+ - `xmind generate` owns route measurement, skeleton/color selection, anchor
14
+ execution, images, billing, downgrade, and validation.
15
+ - `visual/layout-style` and `visual/node-style` are low-level references for
16
+ repair or post-generate edits.
17
+ - Task status, owner, dates, progress, and dependencies belong to
18
+ `task-overlay`.
19
+
20
+ ## Baseline
21
+
22
+ Default to:
23
+
24
+ ```json
25
+ "baseline": { "skeleton": "auto", "color": "auto", "diversify": true, "seed": "<stable id>" }
26
+ ```
27
+
28
+ Use explicit skeleton/color only when the user requests it or there is a strong
29
+ recorded reason. Route fields in the spec carry the semantic intent:
30
+
31
+ - `structuralType`: root relation family.
32
+ - `structureCommitment`: required / preferred / optional.
33
+ - `toneTag`: palette character.
34
+ - `density`: recipe density.
35
+
36
+ ## Anchors
37
+
38
+ Use anchors only when they render real semantics:
39
+
40
+ 1. `layout`: local relation at `###` or deeper.
41
+ 2. `group`: `boundary` or `summary` for contiguous siblings or synthesis.
42
+ 3. `focus`: emphasis, relation, callout, or numbering for exceptional meaning.
43
+ 4. `image`: concrete local file, stable raster URL, or Wikipedia image anchors.
44
+
45
+ When there is a concrete primary subject, attach the primary image to the root
46
+ topic by default.
47
+
48
+ Most nodes stay theme-default. If many nodes need per-node styling, the content
49
+ hierarchy or baseline is probably doing the wrong job.
50
+
51
+ ## Anchor Quality Gate
52
+
53
+ Before writing anchors into the generate spec:
54
+
55
+ - Target titles must already exist in the markdown and be specific enough to
56
+ find.
57
+ - `layout` targets should have a real local relation, not just a large subtree.
58
+ - `group` topics must be siblings under the same parent.
59
+ - `focus` should mark rare meaning: decision, contrast, risk, turning point, or
60
+ takeaway.
61
+ - `image` should attach to concrete entities, artifacts, places, products, or
62
+ works.
63
+
64
+ If an anchor requires inventing a wrapper, revise content first or omit it.
65
+
66
+ ## Default Recipe Obligations
67
+
68
+ For `recipe/default`, normally provide at least one real target for:
69
+
70
+ ```json
71
+ {"layout": "required", "group": "required", "focus": "required", "image": "required"}
72
+ ```
73
+
74
+ Reject an empty required family only when the user explicitly asks for
75
+ text-only/no-images or the subject has no honest target. Do not invent wrappers
76
+ or decorative anchors to satisfy the contract.
77
+
78
+ ## Generate Spec Anchor Shape
79
+
80
+ ```json
81
+ {
82
+ "anchors": {
83
+ "layout": [
84
+ {"topic": "Timeline", "layout": "timeline-vertical"}
85
+ ],
86
+ "group": [
87
+ {"kind": "boundary", "parent": "Risks", "topics": ["Risk A", "Risk B"], "title": "Critical risks"}
88
+ ],
89
+ "focus": [
90
+ {"kind": "callout", "topic": "Key Takeaway", "text": "Main implication"},
91
+ {"kind": "relation", "from": "Cause", "to": "Effect", "title": "drives"}
92
+ ],
93
+ "image": [
94
+ {"topic": "Product", "wiki": "Product", "width": 320},
95
+ {"topic": "Logo", "url": "https://example.com/logo.png"}
96
+ ]
97
+ }
98
+ }
99
+ ```
100
+
101
+ ## Final Checks
102
+
103
+ - Baseline is `auto` or explicitly justified.
104
+ - Layout targets are `###` or deeper.
105
+ - Boundary/summary ranges are sibling groups.
106
+ - Anchor titles are present in the markdown.
107
+ - Focus anchors are rare and meaningful.
108
+ - Images are concrete and attached last by `generate`.
109
+ - Task semantics did not leak into visual anchors.
@@ -0,0 +1,116 @@
1
+ # Visual: Layout Style
2
+
3
+ Op contract for `anchorPlan.layout` and `anchorPlan.group`. Load only when
4
+ second look has non-empty `layout` or `group` items.
5
+
6
+ Layout changes local structure. Boundary and summary mark sibling ranges. None
7
+ of these are decoration.
8
+
9
+ ## Contract
10
+
11
+ - Every op maps to an `anchorPlan.layout` or `anchorPlan.group` item.
12
+ - `layout` targets must be `###` or deeper.
13
+ - Layout choices must respect the chosen skeleton's structure card.
14
+ - `boundary` and `summary` ranges must be contiguous siblings under one parent.
15
+ - A sibling range gets either boundary or summary, not both.
16
+
17
+ ## Depth Rule
18
+
19
+ Root (`#`) and direct children (`##`) are controlled by the root skeleton. XMind
20
+ ignores subtree layout overrides there.
21
+
22
+ When a `##` branch needs local layout, create or move content under a real `###`
23
+ wrapper:
24
+
25
+ ```json
26
+ [
27
+ {"op": "add", "parent": "Resources", "topic": "Resource Index"},
28
+ {"op": "move", "topics": ["Book A", "Book B"], "parent": "Resource Index"},
29
+ {"op": "layout", "topic": "Resource Index", "layout": "grid"}
30
+ ]
31
+ ```
32
+
33
+ Order matters: add wrapper, move children, then apply layout.
34
+
35
+ ## `layout`
36
+
37
+ ```json
38
+ {"op": "layout", "topic": "Chronology", "layout": "timeline-horizontal"}
39
+ ```
40
+
41
+ Batch form:
42
+
43
+ ```json
44
+ {"op": "layout", "topics": ["Phase 1", "Phase 2"], "layout": "timeline-horizontal"}
45
+ ```
46
+
47
+ Available layouts:
48
+
49
+ | Layout | Use |
50
+ |---|---|
51
+ | `timeline-horizontal` | ordered time sequence, roadmap, or workflow spine where left-to-right flow matters |
52
+ | `timeline-vertical` | ordered time sequence where vertical stacking is safer |
53
+ | `spreadsheet` | comparison across dimensions |
54
+ | `spreadsheet-column` | comparison with column-header emphasis |
55
+ | `grid` | equivalent resource/index/card items |
56
+ | `tree-table` | tabular tree |
57
+ | `logic-right` / `logic-left` | ordered process or flow |
58
+ | `org-chart-down` / `org-chart-up` | role/team/org relation |
59
+ | `tree-right` / `tree-left` | local hierarchy |
60
+ | `fishbone-right` / `fishbone-left` | cause families pointing to effect |
61
+ | `brace-right` / `brace-left` | part-whole grouping |
62
+
63
+ Semantic routing:
64
+
65
+ | Subtree role | Layout |
66
+ |---|---|
67
+ | Resources / Materials / References / Sources / Index | `grid` |
68
+ | Phases / Weeks / Roadmap / Schedule / Chronology | `timeline-horizontal` or `timeline-vertical` |
69
+ | Compare / Vs / Versus / Comparison / Tradeoff | `spreadsheet` |
70
+ | Steps / Flow / Pipeline / Process | `logic-right`, or `timeline-horizontal` for a workflow spine that must read left-to-right |
71
+ | Causes / Reasons / Root causes | `fishbone-right` |
72
+ | Roles / Team / Org | `org-chart-down` |
73
+ | Components / Parts / Breakdown | `brace-right` |
74
+
75
+ Reject layout when the title keyword is present but the relation is not real, or
76
+ when the structure card says the layout will disappear inside the parent texture.
77
+ If the structure card only warns about width, treat it as a verification risk,
78
+ not an automatic rejection. A `Workflow Spine` may intentionally use
79
+ `timeline-horizontal` to preserve left-to-right execution flow; verify the
80
+ rendered width before switching it to `timeline-vertical`.
81
+
82
+ ## `boundary`
83
+
84
+ Wrap consecutive siblings in a frame.
85
+
86
+ ```json
87
+ {"op": "boundary", "parent": "Findings", "topics": ["Risk A", "Risk B", "Risk C"], "title": "Critical risks"}
88
+ ```
89
+
90
+ Index fallback:
91
+
92
+ ```json
93
+ {"op": "boundary", "parent": "Findings", "range": [0, 2], "title": "Critical risks"}
94
+ ```
95
+
96
+ Use when 3+ consecutive siblings form a real group: risks, constraints,
97
+ exceptions, phase items, evidence cluster. Do not use as general emphasis.
98
+
99
+ ## `summary`
100
+
101
+ Add a synthesis node over a consecutive sibling range.
102
+
103
+ ```json
104
+ {"op": "summary", "parent": "Findings", "range": [0, 2], "text": "Key insights"}
105
+ ```
106
+
107
+ Use summary when the synthesis is itself a concept worth a node. Use boundary
108
+ when only a frame is needed.
109
+
110
+ ## Range Safety
111
+
112
+ - Prefer `topics` plus `parent` for boundary when titles are unique under the
113
+ parent.
114
+ - Use `range` only when title resolution is ambiguous or summary requires it.
115
+ - `range` is `[startIndex, endIndex]`, zero-based and inclusive.
116
+ - After any range op, run `xmind validate <file>.xmind --quiet`.
@@ -0,0 +1,181 @@
1
+ # Visual: Node Style
2
+
3
+ Op contract for `anchorPlan.focus`, `anchorPlan.image`, and visual overrides.
4
+ Load only when the visual planner has a non-empty focus or image plan, or the
5
+ user supplied brand colors / background colors.
6
+
7
+ Most nodes keep the theme default. Per-node style is a semantic exception.
8
+
9
+ ## Contract
10
+
11
+ - Every style op must map to an `anchorPlan` item or a user override.
12
+ - Per-node emphasis must answer: "why this node and not its siblings?"
13
+ - Image ops should be last in the batch unless explicit size is supplied.
14
+ - Task status, priority, assignee, deadline, and dependency belong to
15
+ `task-overlay`.
16
+ - Decorative markers belong to `decoration`.
17
+
18
+ ## `emphasis`
19
+
20
+ Use for key conclusions, risks, exceptions, or interpretation-control nodes.
21
+ Keep under about 15% of nodes.
22
+
23
+ Single topic:
24
+
25
+ ```json
26
+ {"op": "emphasis", "topic": "Critical Finding", "fillColor": "#E32C2D", "fontColor": "#FFFFFF", "fontWeight": "bold"}
27
+ ```
28
+
29
+ Batch:
30
+
31
+ ```json
32
+ {"op": "emphasis", "topics": ["Finding A", "Finding B", "Finding C"], "fillColor": "#E32C2D"}
33
+ ```
34
+
35
+ Fields:
36
+
37
+ | Field | Type | Description |
38
+ |---|---|---|
39
+ | `topic` | string | Single target title |
40
+ | `topics` | string[] | Multiple target titles |
41
+ | `fillColor` | hex or null | Topic background fill |
42
+ | `fontColor` | hex or null | Title text color |
43
+ | `fontWeight` | `"bold"` / `"normal"` / number / null | Title weight |
44
+ | `fontSize` | number / string / null | Title size in pt |
45
+ | `borderColor` | hex or null | Topic border color |
46
+
47
+ Unspecified fields are left untouched. Pass `null` to clear a field.
48
+
49
+ Avoid emphasizing branch headers just to make the map colorful. If many nodes
50
+ need emphasis, the baseline or hierarchy is probably wrong.
51
+
52
+ ## `image`
53
+
54
+ Use when `anchorPlan.image` names a concrete visual topic. Images may come from
55
+ a user-provided local file, a stable direct raster image URL, or a Wikipedia
56
+ page image. Do not use AI-generated images in this skill.
57
+
58
+ ```json
59
+ {"op": "image", "topic": "Queen", "input": "/path/to/local/image.jpg"}
60
+ ```
61
+
62
+ ```json
63
+ {"op": "image", "topic": "Queen", "wiki": "Queen (band)"}
64
+ ```
65
+
66
+ ```json
67
+ {"op": "image", "topic": "Logo", "url": "https://example.com/logo.png"}
68
+ ```
69
+
70
+ Auto-fit happens at attach time. The long-edge budget grows with map size and
71
+ shrinks with depth; images are never upscaled. Override only when needed:
72
+
73
+ ```json
74
+ {"op": "image", "topic": "Queen", "input": "/path/to/local/image.jpg", "width": 260}
75
+ ```
76
+
77
+ Remove:
78
+
79
+ ```json
80
+ {"op": "image", "topic": "Queen", "remove": true}
81
+ ```
82
+
83
+ Choose the simplest reliable source: `input` for user files, `wiki` for concrete
84
+ encyclopedic entities, and `url` for known stable direct raster image URLs.
85
+ For web-search results that need screening or may be unstable, download to the
86
+ working directory first and attach via `input`. Prefer official, Wikimedia, or
87
+ other stable sources when available. Avoid abstract mood images.
88
+
89
+ Security: do not use SVG images. Remote image downloads reject private/local
90
+ network targets and non-image payloads. Batch local `input` paths must live
91
+ inside the `.xmind` directory or current working directory unless
92
+ `xmind batch --allow-image-input` is used.
93
+
94
+ Use low counts. Images compete for attention; attach the few that carry the
95
+ subject's identity or structure.
96
+
97
+ ## `relation`
98
+
99
+ Use for explicit cross-tree non-task associations: influence, contrast, shared
100
+ concept, evidence-to-claim, recurring theme.
101
+
102
+ ```json
103
+ {"op": "relation", "from": "Topic A", "to": "Topic B", "title": "influences"}
104
+ ```
105
+
106
+ Multiple sources to one target:
107
+
108
+ ```json
109
+ {"op": "relation", "from": ["User Research", "Surveys"], "to": "Prototype Design"}
110
+ ```
111
+
112
+ Do not use for executable dependency. Use `task-overlay` for "blocks",
113
+ "depends on", owner, status, due date, or priority.
114
+
115
+ ## `callout`
116
+
117
+ Use for rare high-priority annotations that should sit beside a topic. Use
118
+ markdown notes (`>`) when the annotation is normal explanatory content.
119
+
120
+ ```json
121
+ {"op": "callout", "topic": "Risk Item", "text": "Needs architecture review"}
122
+ ```
123
+
124
+ Batch:
125
+
126
+ ```json
127
+ {"op": "callout", "topics": ["Risk A", "Risk B"], "text": "Pending review"}
128
+ ```
129
+
130
+ Limit to 1-2 callouts in most maps.
131
+
132
+ ## `numbering`
133
+
134
+ Use for ordered procedures, ranked lists, or stable outline references. Do not
135
+ number unordered categories.
136
+
137
+ ```json
138
+ {"op": "numbering", "topic": "Steps", "pattern": "numeral-arabic", "tiered": true}
139
+ ```
140
+
141
+ Patterns:
142
+
143
+ | Pattern | Use |
144
+ |---|---|
145
+ | `numeral-arabic` | 1, 2, 3 |
146
+ | `numeral-roman` | I, II, III |
147
+ | `alphabet-uppercase` | A, B, C |
148
+ | `alphabet-lowercase` | a, b, c |
149
+
150
+ `tiered: true` is for nested outlines where children need stable references.
151
+
152
+ ## User Override Ops
153
+
154
+ Use only when the user provides explicit colors or brand constraints.
155
+
156
+ Canvas background:
157
+
158
+ ```json
159
+ {"op": "background", "color": "#F7F2EA"}
160
+ ```
161
+
162
+ Strict theme colors:
163
+
164
+ ```json
165
+ {"op": "themeColor", "branchColor": "#223A5E", "fontColor": "#FFFFFF", "lineColor": "#223A5E", "borderColor": "#223A5E"}
166
+ ```
167
+
168
+ `themeColor` disables the normal rainbow palette. Use it for brand-strict maps,
169
+ not ordinary palette selection.
170
+
171
+ ## Mutual Exclusion
172
+
173
+ - `image` on text-dense nodes competes with notes.
174
+ - `emphasis` plus marker on the same topic can overload.
175
+ - Multiple `emphasis` ops on the same topic merge fields; avoid duplicates.
176
+ - `relation` for task dependency duplicates `task-overlay`; use the task layer.
177
+
178
+ ## Skip Rule
179
+
180
+ Skip this sub-skill when `anchorPlan.focus` and `anchorPlan.image` are empty and
181
+ there are no visual overrides.
@@ -0,0 +1,11 @@
1
+ # Visual: Subtree Layout
2
+
3
+ Legacy alias. Prefer:
4
+
5
+ ```bash
6
+ xmind skill show visual/layout-style
7
+ ```
8
+
9
+ `visual/layout-style` now owns `layout`, `boundary`, and `summary` op contracts.
10
+ This alias is kept so older skill text that requests `visual/subtree-layout`
11
+ does not fail.