recursive-board 0.1.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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +145 -0
  3. package/dist/wi/wi.js +1551 -0
  4. package/package.json +38 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 vic-cio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,145 @@
1
+ # Recursive Board
2
+
3
+ Recursive Board turns a folder of Markdown files in an Obsidian vault into a hierarchical work board. Each work item is one Markdown file. Its parent link defines where it belongs.
4
+
5
+ **Markdown is canonical. The plugin is a view, never the database.** The plugin renders and edits work items in Obsidian. The `wi` command-line tool supports scripts and agents. Both use the same schema and rules.
6
+
7
+ Recursive Board works with local vaults and vaults synchronized by Obsidian Sync or another sync client. Install the plugin files in the vault's `.obsidian` folder, and install `wi` wherever you run commands. Sync clients can then synchronize the Markdown and plugin files according to their settings.
8
+
9
+ ## Work items
10
+
11
+ Each work item is a Markdown file in the configured work-item folder. The default folder is `Boards/`. Frontmatter contains these core fields:
12
+
13
+ | Field | Purpose |
14
+ | --- | --- |
15
+ | `type` | Identifies the file as a `work-item`. |
16
+ | `id` | Stable, unique work-item identifier. |
17
+ | `title` | Work-item title. |
18
+ | `status` | One of `backlog`, `options`, `doing`, or `done`. Child items have a status; root items do not. |
19
+ | `parent` | Obsidian wikilink to the parent item. Root items omit this field. |
20
+ | `created` | Creation date in `YYYY-MM-DD` form. |
21
+ | `updated` | Last-updated date in `YYYY-MM-DD` form. |
22
+ | `board` | Set to `true` to render this item's children as a board. Otherwise omit it. |
23
+ | `prev_status` | Previous status recorded when an item moves to `done`; cleared when it leaves `done`. |
24
+
25
+ Optional fields include `owner`, `agent`, `priority`, `due`, `blocked`, `depends_on`, `tags`, and `archived`. Unknown frontmatter keys are preserved. `wi validate` reports them as warnings.
26
+
27
+ An item with `board: true` renders its children in status columns. Any other item renders its children as a checklist. The plugin reads the item's frontmatter and generates the view; the Markdown files remain the source of truth.
28
+
29
+ ## Vault configuration
30
+
31
+ Place an optional `.wi.json` file at the vault root to choose the work-item folder, default parent, and extra sections for new items:
32
+
33
+ ```json
34
+ {
35
+ "workItemFolder": "Boards",
36
+ "defaultRoot": "Project",
37
+ "extraSections": ["References", "Risks"]
38
+ }
39
+ ```
40
+
41
+ `workItemFolder` is a vault-relative folder path. It defaults to `Boards`. `defaultRoot` is the filename stem of a root work item. It defaults to `null`, which means `wi new` needs an explicit `--parent`. `extraSections` is an array of non-empty, single-line headings. It defaults to `[]`. Each heading is added after the built-in template sections with an empty `- ` starter. The setting applies to `wi new`, `wi template write`, and items created in the plugin. Invalid values make `.wi.json` fail to load.
42
+
43
+ `wi` finds the vault from `--vault <path>`, then `$WI_VAULT`, then the nearest folder with `.wi.json` or `Boards/`.
44
+
45
+ ## Start a board
46
+
47
+ 1. Create the file `Boards/Project.md` with this content. A root item has no `parent` and no `status`:
48
+
49
+ ```markdown
50
+ ---
51
+ type: work-item
52
+ id: wi-0001
53
+ title: Project
54
+ created: 2026-01-01
55
+ updated: 2026-01-01
56
+ board: true
57
+ ---
58
+ ```
59
+
60
+ 2. Create `.wi.json` at the vault root with `{"defaultRoot": "Project"}`.
61
+ 3. Add a card with `wi new "Write the first card"`.
62
+ 4. Open `Project` in Obsidian. The plugin shows its children as a board.
63
+
64
+ ## Install the Obsidian plugin
65
+
66
+ Once the plugin is listed in the Community plugins directory, open **Settings → Community plugins → Browse**, find **Recursive Board**, select **Install**, then enable it.
67
+
68
+ Before listing, you can install a release manually:
69
+
70
+ 1. Download a release or build the project with `npm run build`.
71
+ 2. Create a folder under the vault's plugin directory using the `id` in `manifest.json` as its name.
72
+ 3. Copy `main.js`, `manifest.json`, and `styles.css` from that release or the matching `dist/` folder into it.
73
+ 4. In Obsidian, open **Settings → Community plugins** and enable **Recursive Board**.
74
+
75
+ Reload Obsidian after replacing plugin files. If your vault syncs its `.obsidian` folder, the sync client can copy the installed plugin to your other devices. Sync behavior depends on that client's settings.
76
+
77
+ ## Install `wi`
78
+
79
+ `wi` is the CLI package `recursive-board`. It requires Node.js 20.12 or later and installs the `wi` binary:
80
+
81
+ ```sh
82
+ npm install --global recursive-board
83
+ wi --help
84
+ ```
85
+
86
+ Run `wi` inside a vault, pass `--vault <path>`, or set `WI_VAULT`. Commands accept a work-item id, filename, or title as a reference. An id takes precedence when references are ambiguous. Add `--json` for machine-readable output. The `--vault <path>` and `--json` flags apply to all commands.
87
+
88
+ ## Use with coding agents
89
+
90
+ `skills/recursive-board/SKILL.md` teaches an agent to read and change a vault through `wi`. Copy that folder into your agent's skills folder, for example `~/.claude/skills/` for Claude Code or `~/.agents/skills/`. From a source checkout, `npm run install:skill` links it there and links `wi` into `~/.local/bin`.
91
+
92
+ ## Install the Git validation hook
93
+
94
+ Git is optional. Recursive Board works without it, and the hook only adds a check for vaults that are Git repositories.
95
+
96
+ If your vault is a Git repository, use the installed `wi` command:
97
+
98
+ ```sh
99
+ wi hook install --vault <vault-path>
100
+ ```
101
+
102
+ The pre-commit hook runs `wi validate` and stops a commit when the vault has errors. It calls the Node binary and `wi` entry point used to install it, so keep that `wi` installation available. Use `wi hook status --vault <vault-path>` to inspect the hook and `wi hook uninstall --vault <vault-path>` to remove it. Installation refuses to replace another pre-commit hook unless you pass `--force`.
103
+
104
+ ## Commands
105
+
106
+ | Command | What it does |
107
+ | --- | --- |
108
+ | `wi new <title> [--parent <ref>] [--status <status>] [--template <name>] [--owner <name>] [--agent <name>] [--priority <number>]` | Creates a work item under the given parent. If `--parent` is omitted, uses `defaultRoot` from `.wi.json`. |
109
+ | `wi status <ref> <status>` | Changes an item's status. Use `backlog`, `options`, `doing`, or `done`. Leaving `done` clears the recorded previous status. |
110
+ | `wi move <ref> --to <ref>` | Changes the item's parent. Its status stays the same, and its children move with it. |
111
+ | `wi archive <ref> [--undo]` | Archives an item. `--undo` unarchives it. Archived items are hidden from normal reads; descendants are hidden with an archived parent. |
112
+ | `wi rm <ref> [--recursive] [--dry-run]` | Moves an item to the vault's `.trash` folder. Use `--dry-run` to preview. Items with children require `--recursive`. |
113
+ | `wi children <ref> [--status <status>] [--tree] [--archived]` | Lists an item's children. `--status` filters by status, `--tree` shows descendants, and `--archived` includes archived items. |
114
+ | `wi validate` | Checks work-item structure and reports errors and warnings. Exits with code 1 when it finds errors. |
115
+ | `wi hook install\|uninstall\|status [--vault <path>]` | Installs, removes, or inspects the Git pre-commit validation hook. `install --force` replaces an unrelated hook. |
116
+ | `wi template [list\|write]` | Lists available templates, or writes the code's templates into `Templates/` with `wi template write`. Defaults to `list`. |
117
+ | `wi --help` or `wi help` | Prints usage, options, and notes. |
118
+ | `wi --version` | Prints the installed CLI version. |
119
+
120
+ `wi move`, `wi rm`, and `wi archive` refuse to run when a hidden non-Markdown file is in the work-item folder. The index cannot read that file, so it may be missing a work item. Let the sync client finish downloading it or remove the stray file, then retry. There is no force option. `wi new` still creates the item and warns on stderr because a new id or filename may clash with an unread file. `wi validate` reports a warning if `defaultRoot` names no root item.
121
+
122
+ ## For agents
123
+
124
+ Use `wi` for work-item changes. Do not edit work-item Markdown directly with scripts or bulk text tools. Use `wi validate` to check the vault after changes. `wi rm` moves items into `.trash`; removing a parent requires `--recursive`. Use `wi rm <ref> --dry-run` to review the affected items first.
125
+
126
+ ## Development
127
+
128
+ Requirements: Node.js 23.6 or later and npm. The tests run the TypeScript source directly, which needs type stripping. The built `wi` runs on Node.js 20.12 or later.
129
+
130
+ ```sh
131
+ npm install
132
+ npm test
133
+ npm run build
134
+ npm run fixture
135
+ ```
136
+
137
+ `npm test` typechecks the CLI and plugin, then runs the test suite. `npm run build` builds the plugin and CLI. `npm run fixture` generates the development vault fixture in `test/Boards/`.
138
+
139
+ ## Decisions
140
+
141
+ See [`docs/adr/`](docs/adr/) for the project's decision record.
142
+
143
+ ## License
144
+
145
+ MIT. See [LICENSE](LICENSE).