@thxgg/steward 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +93 -122
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,175 +1,146 @@
1
1
  # Steward
2
2
 
3
- Steward is a local-first Nuxt app for browsing Product Requirements Documents and tracking implementation state in a global SQLite database.
3
+ Local-first PRD workflow steward for AI agents and developers.
4
+ Nuxt UI + codemode MCP + SQLite state store.
4
5
 
5
- It is published as `@thxgg/steward` and provides the `prd` CLI command.
6
-
7
- This project is intended to be downloaded and run locally on your machine. It is not designed for public internet deployment.
8
-
9
- ## What It Does
10
-
11
- - Scans repositories for `docs/prd/*.md` files and displays them in a focused UI.
12
- - Reads task state (`tasks.json` and `progress.json`) from a global SQLite database.
13
- - Supports legacy `.claude/state/*` migration into the global database.
14
- - Resolves commit references for tasks, including pseudo-monorepo sub-repo contexts.
15
-
16
- ## Local-First Security Model
17
-
18
- Steward exposes local filesystem and git metadata for convenience. Because of that:
19
-
20
- - Run it only on trusted local machines.
21
- - Do not expose it directly to the public internet.
22
- - Treat it as a developer workstation tool, not a hosted multi-user service.
23
-
24
- ## Requirements
6
+ - npm package: `@thxgg/steward`
7
+ - CLI command: `prd`
25
8
 
26
- - Node.js 22+
27
- - npm (or pnpm)
28
- - Git
29
- - Linux/macOS (or compatible environment)
9
+ ## Install
30
10
 
31
- ## Quick Start
11
+ ### Via npm
32
12
 
33
13
  ```bash
34
- npm install
35
- npm run dev
14
+ npm install -g @thxgg/steward
36
15
  ```
37
16
 
38
- With pnpm:
17
+ ### Without global install
39
18
 
40
19
  ```bash
41
- pnpm install
42
- pnpm run dev
20
+ npx -y @thxgg/steward ui
43
21
  ```
44
22
 
45
- Open `http://localhost:3000`, then add a local repository path that contains a `docs/prd/` directory.
23
+ ## Usage
46
24
 
47
- ## Install CLI
25
+ ### MCP Server
48
26
 
49
- ```bash
50
- npm install -g @thxgg/steward
51
- prd ui
27
+ Add to your MCP client config:
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "prd": {
33
+ "command": "npx",
34
+ "args": ["-y", "@thxgg/steward", "mcp"]
35
+ }
36
+ }
37
+ }
52
38
  ```
53
39
 
54
- With pnpm:
40
+ ### CLI
55
41
 
56
42
  ```bash
57
- pnpm add -g @thxgg/steward
58
43
  prd ui
44
+ prd ui --preview
45
+ prd ui --port 3100 --host 127.0.0.1
46
+ prd mcp
59
47
  ```
60
48
 
61
- Without global install:
49
+ ## Architecture
62
50
 
63
- ```bash
64
- npx -y @thxgg/steward ui
65
51
  ```
66
-
67
- You can also run the app through the project CLI:
68
-
69
- ```bash
70
- npm run ui
52
+ ┌─────────────────────────────────────────┐
53
+ │ Steward CLI (Node) │
54
+ │ - `prd ui` launches Nuxt app │
55
+ │ - `prd mcp` starts MCP over stdio │
56
+ └─────────────────────────────────────────┘
57
+
58
+
59
+ ┌─────────────────────────────────────────┐
60
+ │ Codemode MCP (`execute`) │
61
+ │ - VM sandbox │
62
+ │ - APIs: repos, prds, git, state │
63
+ └─────────────────────────────────────────┘
64
+
65
+
66
+ ┌─────────────────────────────────────────┐
67
+ │ Local SQLite PRD State │
68
+ │ - Global store shared across repos │
69
+ └─────────────────────────────────────────┘
71
70
  ```
72
71
 
73
- ## Scripts
72
+ ## Codemode Pattern
74
73
 
75
- - `npm run dev` - Start local dev server
76
- - `npm run typecheck` - Run Nuxt type checking
77
- - `npm run build` - Build production bundle
78
- - `npm run preview` - Preview the production build locally
79
- - `npm run ui` - Launch `prd ui` (dev mode)
80
- - `npm run mcp` - Start MCP server over stdio
74
+ Steward exposes one MCP tool: `execute`.
81
75
 
82
- ## CLI
76
+ ```js
77
+ const reposList = await repos.list()
78
+ const repo = reposList[0]
79
+ if (!repo) return { error: 'No repos configured' }
83
80
 
84
- This package ships a `prd` command.
81
+ const prdList = await prds.list(repo.id)
82
+ if (prdList.length === 0) return { repo: repo.name, prds: 0 }
85
83
 
86
- - npm package: `@thxgg/steward`
87
-
88
- - `prd ui` - Launch the web app in dev mode (default)
89
- - `prd ui --preview` - Launch the production preview server
90
- - `prd ui --port 3100 --host 127.0.0.1` - Pass Nuxt host/port options
91
- - `prd mcp` - Run the codemode MCP server over stdio
92
-
93
- For local shell usage while developing this repo:
94
-
95
- ```bash
96
- npm link
97
- prd ui
84
+ const slug = prdList[0].slug
85
+ return {
86
+ doc: await prds.getDocument(repo.id, slug),
87
+ tasks: await prds.getTasks(repo.id, slug),
88
+ progress: await prds.getProgress(repo.id, slug)
89
+ }
98
90
  ```
99
91
 
100
- ## MCP Usage
92
+ ## APIs
101
93
 
102
- The MCP server exposes one codemode tool: `execute`.
94
+ Inside `execute`, these APIs are available:
103
95
 
104
- The codemode runtime has these APIs in scope:
96
+ - `repos` - register/list/remove repos and refresh discovered git repos
97
+ - `prds` - list/read PRD docs, tasks, progress, and task commit refs
98
+ - `git` - commit metadata, diffs, file diffs, and file contents
99
+ - `state` - direct PRD state get/upsert by repo id or path
105
100
 
106
- - `repos` - list/add/remove/refresh repository registrations
107
- - `prds` - list/get PRD documents and state-backed task/progress data
108
- - `git` - commit metadata, diffs, and file content lookups
109
- - `state` - direct PRD state reads/writes in SQLite
101
+ Detailed API docs and examples: `docs/MCP.md`
110
102
 
111
- Example MCP client configuration:
103
+ ## Local-First Security Model
112
104
 
113
- ```json
114
- {
115
- "mcpServers": {
116
- "prd": {
117
- "command": "prd",
118
- "args": ["mcp"]
119
- }
120
- }
121
- }
122
- ```
105
+ Steward reads local filesystem and git metadata by design.
123
106
 
124
- For codemode API details and examples, see `docs/MCP.md`.
107
+ - Run only on trusted local machines
108
+ - Do not expose directly to the public internet
109
+ - Treat as a workstation tool, not a hosted multi-user service
125
110
 
126
- ## Global PRD State Storage
111
+ ## Storage
127
112
 
128
- PRD state is system-global and stored in SQLite:
113
+ PRD state is stored in SQLite at:
129
114
 
130
- - Default: `${XDG_DATA_HOME:-~/.local/share}/prd/state.db`
131
- - Override full path: `PRD_STATE_DB_PATH`
132
- - Override base dir: `PRD_STATE_HOME` (resolved to `<PRD_STATE_HOME>/state.db`)
115
+ 1. `PRD_STATE_DB_PATH` (if set)
116
+ 2. `PRD_STATE_HOME/state.db` (if set)
117
+ 3. `${XDG_DATA_HOME:-~/.local/share}/prd/state.db`
133
118
 
134
- This allows multiple local repos to share one PRD state store.
119
+ ## Development
135
120
 
136
- ## Environment Variables
121
+ ```bash
122
+ npm install
123
+ npm run dev
124
+ npm run typecheck
125
+ npm run build
126
+ ```
137
127
 
138
- Copy `.env.example` to `.env` if you want to override defaults.
128
+ ## Environment Variables
139
129
 
140
- | Variable | Required | Description |
141
- | --- | --- | --- |
142
- | `PRD_STATE_DB_PATH` | No | Absolute path to SQLite database file |
143
- | `PRD_STATE_HOME` | No | Directory used for database home (`state.db` inside it) |
144
- | `XDG_DATA_HOME` | No | Used for default global state location |
130
+ | Variable | Description |
131
+ | --- | --- |
132
+ | `PRD_STATE_DB_PATH` | Absolute path to SQLite DB file |
133
+ | `PRD_STATE_HOME` | Base directory for DB (`state.db` inside) |
134
+ | `XDG_DATA_HOME` | Fallback base path for default DB location |
145
135
 
146
- ## OpenCode Bundle Included
136
+ ## OpenCode Bundle
147
137
 
148
- This repository includes a curated OpenCode bundle under `opencode/`:
138
+ This repo includes curated OpenCode assets under `opencode/`:
149
139
 
150
140
  - Commands: `prd`, `prd-task`, `complete-next-task`, `commit`
151
141
  - Skills: `prd`, `prd-task`, `complete-next-task`, `commit`
152
142
  - Script: `prd-db.mjs`
153
143
 
154
- `frontend-design` is intentionally not included.
155
-
156
- To install into a local OpenCode config:
157
-
158
- ```bash
159
- mkdir -p ~/.config/opencode
160
- cp -R opencode/commands ~/.config/opencode/
161
- cp -R opencode/skills ~/.config/opencode/
162
- cp -R opencode/scripts ~/.config/opencode/
163
- ```
164
-
165
- ## CI
166
-
167
- GitHub Actions runs:
168
-
169
- - Typecheck + build validation
170
- - Secret scanning with gitleaks
171
-
172
- ## Roadmap
144
+ ## License
173
145
 
174
- - Continue hardening local-only workflows
175
- - Expand codemode APIs and automation patterns
146
+ MIT
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@thxgg/steward",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Local-first PRD workflow steward with codemode MCP and web UI.",
5
5
  "type": "module",
6
6
  "author": "thxgg",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/thxgg/prd-viewer.git"
10
+ "url": "git+https://github.com/thxgg/steward.git"
11
11
  },
12
12
  "bugs": {
13
- "url": "https://github.com/thxgg/prd-viewer/issues"
13
+ "url": "https://github.com/thxgg/steward/issues"
14
14
  },
15
- "homepage": "https://github.com/thxgg/prd-viewer#readme",
15
+ "homepage": "https://github.com/thxgg/steward#readme",
16
16
  "keywords": [
17
17
  "prd",
18
18
  "mcp",