@thxgg/steward 0.1.14 → 0.1.16

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 (55) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{C_NevjZD.js → BSA0RJ-H.js} +1 -1
  3. package/.output/public/_nuxt/{BubpH_wW.js → BWVTacYj.js} +1 -1
  4. package/.output/public/_nuxt/{CMu9GKTH.js → Bibm_IDv.js} +2 -2
  5. package/.output/public/_nuxt/{wbj-mIhK.js → CVJh28bx.js} +1 -1
  6. package/.output/public/_nuxt/{BDqHART1.js → CxHOXVf6.js} +1 -1
  7. package/.output/public/_nuxt/CyZuidLG.js +60 -0
  8. package/.output/public/_nuxt/{qt5OEWHC.js → D0op9E2g.js} +1 -1
  9. package/.output/public/_nuxt/{CVvrkZkq.js → DX8awZaa.js} +1 -1
  10. package/.output/public/_nuxt/Detail.z33AHKev.css +1 -0
  11. package/.output/public/_nuxt/{C2HGkiSP.js → DiTJUZOC.js} +1 -1
  12. package/.output/public/_nuxt/{nYTZJhvT.js → Dum5qplW.js} +1 -1
  13. package/.output/public/_nuxt/{BPeTf9dd.js → T_3JE9C-.js} +1 -1
  14. package/.output/public/_nuxt/WOI2tLsR.js +42 -0
  15. package/.output/public/_nuxt/builds/latest.json +1 -1
  16. package/.output/public/_nuxt/builds/meta/029070b0-b8e2-4988-84f4-d0c9ff55c998.json +1 -0
  17. package/.output/public/_nuxt/{B-5VWizU.js → odRGDGwj.js} +1 -1
  18. package/.output/public/_nuxt/{qKRNa41x.js → wbjFvimm.js} +1 -1
  19. package/.output/public/_nuxt/{uTyw4SRK.js → ynmyrfyT.js} +1 -1
  20. package/.output/server/chunks/build/{Detail-DC-KJQ1f.mjs → Detail-CUfU85GY.mjs} +26 -26
  21. package/.output/server/chunks/build/Detail-CUfU85GY.mjs.map +1 -0
  22. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs +4 -0
  23. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs.map +1 -0
  24. package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs +10 -0
  25. package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs.map +1 -0
  26. package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs +8 -0
  27. package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs.map +1 -0
  28. package/.output/server/chunks/build/{_prd_-C1C4GAhW.mjs → _prd_-CeVnQzOV.mjs} +3 -3
  29. package/.output/server/chunks/build/_prd_-CeVnQzOV.mjs.map +1 -0
  30. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  31. package/.output/server/chunks/build/{repo-graph-CTEkxiYd.mjs → repo-graph-CHNl58mY.mjs} +3 -3
  32. package/.output/server/chunks/build/repo-graph-CHNl58mY.mjs.map +1 -0
  33. package/.output/server/chunks/build/server.mjs +2 -2
  34. package/.output/server/chunks/build/styles.mjs +2 -2
  35. package/.output/server/chunks/nitro/nitro.mjs +598 -598
  36. package/.output/server/package.json +1 -1
  37. package/README.md +10 -1
  38. package/dist/host/src/mcp.js +2 -0
  39. package/dist/host/src/prompts.js +127 -0
  40. package/docs/MCP.md +13 -1
  41. package/package.json +1 -1
  42. package/.output/public/_nuxt/-k8zG74W.js +0 -61
  43. package/.output/public/_nuxt/BMAq0QVD.js +0 -42
  44. package/.output/public/_nuxt/Detail.CzXXlavD.css +0 -1
  45. package/.output/public/_nuxt/builds/meta/b57a8fc3-6a38-4f58-b2ae-54768412ea40.json +0 -1
  46. package/.output/server/chunks/build/Detail-DC-KJQ1f.mjs.map +0 -1
  47. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-D0sb4vsK.mjs +0 -4
  48. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-D0sb4vsK.mjs.map +0 -1
  49. package/.output/server/chunks/build/DiffViewer-styles.CkSjCQ0r.mjs +0 -10
  50. package/.output/server/chunks/build/DiffViewer-styles.CkSjCQ0r.mjs.map +0 -1
  51. package/.output/server/chunks/build/DiffViewer-styles.FJJuYjYB.mjs +0 -8
  52. package/.output/server/chunks/build/DiffViewer-styles.FJJuYjYB.mjs.map +0 -1
  53. package/.output/server/chunks/build/_prd_-C1C4GAhW.mjs.map +0 -1
  54. package/.output/server/chunks/build/repo-graph-CTEkxiYd.mjs.map +0 -1
  55. package/.output/server/node_modules/shiki/dist/bundle-web.mjs +0 -366
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thxgg/steward-prod",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
package/README.md CHANGED
@@ -69,9 +69,10 @@ prd mcp
69
69
 
70
70
 
71
71
  ┌─────────────────────────────────────────┐
72
- Codemode MCP (`execute`)
72
+ Codemode MCP (`execute` + prompts)
73
73
  │ - VM sandbox │
74
74
  │ - APIs: repos, prds, git, state │
75
+ │ - Prompts: create/break/complete flow │
75
76
  └─────────────────────────────────────────┘
76
77
 
77
78
 
@@ -85,6 +86,14 @@ prd mcp
85
86
 
86
87
  Steward exposes one MCP tool: `execute`.
87
88
 
89
+ It also exposes workflow prompts:
90
+
91
+ - `create_prd(feature_request)`
92
+ - `break_into_tasks(prd_slug)`
93
+ - `complete_next_task(prd_slug)`
94
+
95
+ In OpenCode these are shown as MCP slash entries like `/prd:create_prd:mcp`.
96
+
88
97
  ```js
89
98
  const repo = await repos.current()
90
99
 
@@ -4,6 +4,7 @@ import { z } from 'zod';
4
4
  import { assertSqliteRuntimeSupport } from '../../server/utils/db.js';
5
5
  import { execute } from './executor.js';
6
6
  import { getExecuteToolDescription } from './help.js';
7
+ import { registerStewardPrompts } from './prompts.js';
7
8
  function serializeEnvelope(envelope) {
8
9
  try {
9
10
  return JSON.stringify(envelope, null, 2);
@@ -55,6 +56,7 @@ export async function runMcpServer() {
55
56
  name: 'steward',
56
57
  version: '0.1.0'
57
58
  });
59
+ registerStewardPrompts(server);
58
60
  server.tool('execute', getExecuteToolDescription(), {
59
61
  code: z.string().optional()
60
62
  }, async ({ code }) => {
@@ -0,0 +1,127 @@
1
+ import { z } from 'zod';
2
+ function textMessage(text) {
3
+ return {
4
+ role: 'user',
5
+ content: {
6
+ type: 'text',
7
+ text
8
+ }
9
+ };
10
+ }
11
+ function createPrdPrompt(featureRequest) {
12
+ return [
13
+ 'You are using Steward MCP to create a new Product Requirements Document (PRD).',
14
+ '',
15
+ 'User request:',
16
+ featureRequest,
17
+ '',
18
+ 'Workflow:',
19
+ '1. Clarify any major ambiguities with targeted questions before writing the PRD.',
20
+ '2. Derive a kebab-case slug and create docs/prd/<slug>.md.',
21
+ '3. Use this PRD structure at minimum:',
22
+ ' - # PRD: <Feature Name>',
23
+ ' - **Author:** Generated',
24
+ ' - **Date:** <YYYY-MM-DD>',
25
+ ' - **Status:** Draft',
26
+ ' - Problem Statement, Users, Proposed Solution, Scope, Technical Considerations, Success Criteria, Risks.',
27
+ '4. Before finishing, verify Steward repository registration with the execute tool:',
28
+ ' const existing = await repos.list()',
29
+ ' return existing.map((repo) => ({ id: repo.id, name: repo.name, path: repo.path }))',
30
+ ' If no repository is registered, register this repository with repos.add(<absolute_path>, <optional_name>).',
31
+ '5. Do not generate tasks in this step.',
32
+ '6. End with:',
33
+ ' - created PRD path',
34
+ ' - chosen slug',
35
+ ' - key product decisions and open questions',
36
+ ' - recommended next command: /prd:break_into_tasks <slug> (shown as :mcp in autocomplete).'
37
+ ].join('\n');
38
+ }
39
+ function breakIntoTasksPrompt(prdSlug) {
40
+ return [
41
+ 'You are converting a PRD into structured Steward task state.',
42
+ '',
43
+ 'PRD slug:',
44
+ prdSlug,
45
+ '',
46
+ 'Workflow:',
47
+ '1. Load docs/prd/<slug>.md. If not found, list available PRDs and stop with a clear correction.',
48
+ '2. Update PRD status from Draft to Approved in the markdown file.',
49
+ '3. Build tasks JSON with this shape:',
50
+ ' { prd: { name, source, createdAt }, tasks: [{ id, category, title, description, steps, passes, dependencies, priority, status }] }',
51
+ '4. Use these category values only: setup, feature, integration, testing, documentation.',
52
+ '5. Use these priority values only: critical, high, medium, low.',
53
+ '6. Set every generated task status to pending and make passes an array of testable criteria.',
54
+ '7. Build progress JSON with this shape:',
55
+ ' { prdName, totalTasks, completed, inProgress, blocked, startedAt, lastUpdated, patterns, taskLogs }',
56
+ ' Initialize with completed=0, inProgress=0, blocked=0, startedAt=null, patterns=[], taskLogs=[].',
57
+ '8. Persist state through execute tool:',
58
+ ` await state.upsertCurrent("${prdSlug}", { tasks: <tasksJson>, progress: <progressJson> })`,
59
+ ` return await state.getCurrent("${prdSlug}")`,
60
+ '9. Report task count, category breakdown, critical path, and recommended next command:',
61
+ ` /prd:complete_next_task ${prdSlug} (shown as :mcp in autocomplete).`
62
+ ].join('\n');
63
+ }
64
+ function completeNextTaskPrompt(prdSlug) {
65
+ return [
66
+ 'You are completing the next PRD task with Steward state tracking and commits.',
67
+ '',
68
+ 'PRD slug:',
69
+ prdSlug,
70
+ '',
71
+ 'Workflow:',
72
+ `1. Load PRD state using execute tool: state.getCurrent("${prdSlug}").`,
73
+ ` If tasks are missing, stop and instruct to run /prd:break_into_tasks ${prdSlug}.`,
74
+ '2. Select the next task:',
75
+ ' - first task with status=in_progress, otherwise',
76
+ ' - first pending task whose dependencies are all completed.',
77
+ '3. Immediately mark the task in progress and save with state.upsertCurrent:',
78
+ ' - task.status = in_progress',
79
+ ' - task.startedAt = ISO timestamp (if absent)',
80
+ ' - progress.inProgress updated',
81
+ ' - progress.lastUpdated updated',
82
+ ' - taskLogs entry exists with { taskId, status: in_progress, startedAt }',
83
+ '4. Implement only this task in repository files.',
84
+ '5. Run validation loops relevant to the project before commit (typecheck, tests, lint, format/build where applicable).',
85
+ '6. Commit task-related changes with a concise conventional commit message.',
86
+ '7. Capture commit SHAs and update taskLogs[].commits (use { sha, repo } objects for nested repos when needed).',
87
+ '8. Mark task completed and save with state.upsertCurrent:',
88
+ ' - task.status = completed',
89
+ ' - task.completedAt = ISO timestamp',
90
+ ' - progress.completed / progress.inProgress / progress.lastUpdated updated',
91
+ ' - taskLogs entry updated with completedAt, implemented, filesChanged, learnings, commits',
92
+ '9. If all tasks are completed, output exactly: <tasks>COMPLETE</tasks>.',
93
+ '10. Report what changed, which commit(s) were created, and the next pending task if any.'
94
+ ].join('\n');
95
+ }
96
+ export function registerStewardPrompts(server) {
97
+ server.registerPrompt('create_prd', {
98
+ title: 'Create PRD',
99
+ description: 'Create a PRD markdown document and prepare Steward workflow context.',
100
+ argsSchema: {
101
+ feature_request: z.string().describe('Feature request, idea, or problem statement for the PRD')
102
+ }
103
+ }, async ({ feature_request }) => ({
104
+ description: 'Guided workflow for creating a PRD file.',
105
+ messages: [textMessage(createPrdPrompt(feature_request))]
106
+ }));
107
+ server.registerPrompt('break_into_tasks', {
108
+ title: 'Break Into Tasks',
109
+ description: 'Convert a PRD into tasks.json/progress.json style state and save it.',
110
+ argsSchema: {
111
+ prd_slug: z.string().describe('PRD slug, usually the filename in docs/prd without .md')
112
+ }
113
+ }, async ({ prd_slug }) => ({
114
+ description: 'Workflow for converting an approved PRD into task state.',
115
+ messages: [textMessage(breakIntoTasksPrompt(prd_slug))]
116
+ }));
117
+ server.registerPrompt('complete_next_task', {
118
+ title: 'Complete Next Task',
119
+ description: 'Complete the next in-progress/pending task and persist state updates.',
120
+ argsSchema: {
121
+ prd_slug: z.string().describe('PRD slug whose next task should be completed')
122
+ }
123
+ }, async ({ prd_slug }) => ({
124
+ description: 'Workflow for task execution, verification, commit capture, and state persistence.',
125
+ messages: [textMessage(completeNextTaskPrompt(prd_slug))]
126
+ }));
127
+ }
package/docs/MCP.md CHANGED
@@ -4,7 +4,9 @@ Steward ships a codemode MCP server.
4
4
 
5
5
  - Command: `prd mcp`
6
6
  - Transport: stdio
7
- - Tool surface: one tool, `execute`
7
+ - MCP surface:
8
+ - Tool: `execute`
9
+ - Prompts: `create_prd`, `break_into_tasks`, `complete_next_task`
8
10
 
9
11
  The `execute` tool runs JavaScript in a VM sandbox with these APIs in scope:
10
12
 
@@ -98,6 +100,16 @@ In-sandbox discovery helper:
98
100
 
99
101
  - `steward.help()`
100
102
 
103
+ ## MCP Prompts
104
+
105
+ Steward also exposes MCP prompts so MCP clients can surface command-like workflows.
106
+
107
+ - `create_prd(feature_request)`
108
+ - `break_into_tasks(prd_slug)`
109
+ - `complete_next_task(prd_slug)`
110
+
111
+ In OpenCode, these appear in slash-command autocomplete as MCP commands (for example `/prd:create_prd:mcp`) and insert as `/prd:create_prd` when selected.
112
+
101
113
  ## Available APIs
102
114
 
103
115
  ### `repos`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thxgg/steward",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Local-first PRD workflow steward with codemode MCP and web UI.",
5
5
  "type": "module",
6
6
  "author": "thxgg",