@waycraft/waypoint-mcp 0.1.0 → 0.1.2

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.
@@ -1,101 +0,0 @@
1
- import { getBaseContext, getArtifact, saveArtifact } from "../context.js";
2
- export const definition = {
3
- name: "waypoint_measure",
4
- description: "Evaluate overall project success against defined goals.",
5
- inputSchema: {
6
- type: "object",
7
- properties: {
8
- workspacePath: {
9
- type: "string",
10
- description: "Absolute path to the workspace root.",
11
- },
12
- },
13
- required: ["workspacePath"],
14
- },
15
- };
16
- export async function run(args) {
17
- const { workspacePath } = args;
18
- const ctx = await getBaseContext(workspacePath);
19
- const goalArtifact = await getArtifact(workspacePath, "goal.md");
20
- const buildArtifact = await getArtifact(workspacePath, "build.md");
21
- const testArtifact = await getArtifact(workspacePath, "test.md");
22
- if (!goalArtifact) {
23
- return [
24
- "## waypoint_measure — No goal found",
25
- "",
26
- "Run `waypoint_goal` first — measurement requires a defined goal to evaluate against.",
27
- ].join("\n");
28
- }
29
- const goalLine = goalArtifact.match(/^# Goal\n+(.+)/m)?.[1] ?? "(goal not parsed)";
30
- const successCriteriaBlock = goalArtifact.match(/## Success criteria\n([\s\S]*?)(?=\n##|$)/)?.[1]?.trim() ?? "";
31
- const criteriaLines = successCriteriaBlock
32
- .split("\n")
33
- .filter((l) => l.trim().startsWith("- ["))
34
- .map((l) => l.trim());
35
- const criteriaRows = criteriaLines.length > 0
36
- ? criteriaLines.map((c) => `| ${c} | | |`)
37
- : ["| - (no criteria defined in goal.md) | | |"];
38
- const missing = [
39
- !buildArtifact && "build.md",
40
- !testArtifact && "test.md",
41
- ].filter(Boolean);
42
- const artifact = [
43
- "# Measure",
44
- "",
45
- `**Goal:** ${goalLine}`,
46
- missing.length > 0
47
- ? `\n> ⚠️ Missing: ${missing.join(", ")} — measurement may be incomplete.`
48
- : "",
49
- "",
50
- "## Success criteria scorecard",
51
- "| Criterion | Status | Evidence |",
52
- "|-----------|--------|----------|",
53
- ...criteriaRows,
54
- "",
55
- "## Overall verdict",
56
- "<!-- One of: ✅ Goal met | ⚠️ Partially met | ❌ Not met -->",
57
- "**Verdict:** ",
58
- "**Summary:** ",
59
- "",
60
- "## What worked well",
61
- "- ",
62
- "",
63
- "## What fell short",
64
- "- ",
65
- "",
66
- "## Quantitative signals",
67
- "<!-- Add any measurable data: test pass rate, latency, bundle size, etc. -->",
68
- "| Metric | Target | Actual | Pass? |",
69
- "|--------|--------|--------|-------|",
70
- "| | | | |",
71
- "",
72
- `_Generated by waypoint_measure — ${new Date().toISOString()}_`,
73
- ]
74
- .filter((l) => l !== undefined)
75
- .join("\n");
76
- await saveArtifact(workspacePath, "measure.md", artifact);
77
- return [
78
- "## waypoint_measure — Measurement framework generated",
79
- "",
80
- `**Goal:** ${goalLine}`,
81
- missing.length > 0 ? `\n> Missing: ${missing.join(", ")} — add these for fuller measurement.` : "",
82
- "",
83
- criteriaLines.length > 0
84
- ? `**${criteriaLines.length} success criteria** pulled from goal.md into scorecard.`
85
- : "**No success criteria found in goal.md.** Fill in the scorecard manually.",
86
- "",
87
- "### How to use measure.md",
88
- "1. Score each criterion: ✅ met / ⚠️ partial / ❌ not met",
89
- "2. Add evidence for each",
90
- "3. Record quantitative signals where available",
91
- "4. Write the overall verdict",
92
- "",
93
- "### Artifact saved",
94
- "`measure.md` written to `.waypoint/measure.md`.",
95
- "",
96
- "### Suggested next step",
97
- "Run `waypoint_improve` to identify refinements based on what fell short.",
98
- ]
99
- .filter((l) => l !== undefined)
100
- .join("\n");
101
- }
@@ -1,107 +0,0 @@
1
- import { getBaseContext, getArtifact, saveArtifact } from "../context.js";
2
- export const definition = {
3
- name: "waypoint_plan",
4
- description: "Create a structured plan for new features or significant changes only.",
5
- inputSchema: {
6
- type: "object",
7
- properties: {
8
- workspacePath: {
9
- type: "string",
10
- description: "Absolute path to the workspace root.",
11
- },
12
- scope: {
13
- type: "string",
14
- description: "Specific scope or milestone to plan (optional). Omit to plan the full goal.",
15
- },
16
- },
17
- required: ["workspacePath"],
18
- },
19
- };
20
- export async function run(args) {
21
- const { workspacePath, scope } = args;
22
- const ctx = await getBaseContext(workspacePath);
23
- const goalArtifact = await getArtifact(workspacePath, "goal.md");
24
- const optionsArtifact = await getArtifact(workspacePath, "compare.md");
25
- const researchArtifact = await getArtifact(workspacePath, "research.md");
26
- if (!goalArtifact) {
27
- return [
28
- "## waypoint_plan — No goal found",
29
- "",
30
- "Run `waypoint_goal` before planning.",
31
- ].join("\n");
32
- }
33
- const goalLine = goalArtifact.match(/^# Goal\n+(.+)/m)?.[1] ?? "(goal not parsed)";
34
- const missing = [
35
- !researchArtifact && "research.md",
36
- !optionsArtifact && "compare.md",
37
- ].filter(Boolean);
38
- const artifact = [
39
- "# Plan",
40
- "",
41
- `**Goal:** ${goalLine}`,
42
- scope ? `**Scope:** ${scope}` : "",
43
- missing.length > 0
44
- ? `\n> ⚠️ Missing prior artifacts: ${missing.join(", ")}. Plan may be incomplete.`
45
- : "",
46
- "",
47
- "## Milestones",
48
- "<!-- Break the work into 2–5 ordered milestones -->",
49
- "",
50
- "### Milestone 1 — Foundation",
51
- "**Deliverable:** ",
52
- "**Done when:** ",
53
- "**Steps:**",
54
- "- [ ] ",
55
- "",
56
- "### Milestone 2 — Core feature",
57
- "**Deliverable:** ",
58
- "**Done when:** ",
59
- "**Steps:**",
60
- "- [ ] ",
61
- "",
62
- "### Milestone 3 — Polish & ship",
63
- "**Deliverable:** ",
64
- "**Done when:** ",
65
- "**Steps:**",
66
- "- [ ] ",
67
- "",
68
- "## Dependencies",
69
- "<!-- External dependencies or blockers between milestones -->",
70
- "- ",
71
- "",
72
- "## Out of scope for this plan",
73
- "- ",
74
- "",
75
- "## Risk register",
76
- "| Risk | Likelihood | Impact | Mitigation |",
77
- "|------|-----------|--------|------------|",
78
- "| | | | |",
79
- "",
80
- `_Generated by waypoint_plan — ${new Date().toISOString()}_`,
81
- ]
82
- .filter((l) => l !== undefined)
83
- .join("\n");
84
- await saveArtifact(workspacePath, "plan.md", artifact);
85
- return [
86
- "## waypoint_plan — Plan generated",
87
- "",
88
- `**Goal:** ${goalLine}`,
89
- scope ? `**Scope:** ${scope}` : "",
90
- missing.length > 0
91
- ? `\n> Missing: ${missing.join(", ")} — plan may be incomplete.`
92
- : "",
93
- "",
94
- "### Structure",
95
- "- **3 milestones** scaffolded — fill in deliverables, done-when criteria, and steps",
96
- "- **Risk register** — add any known risks before building",
97
- "- **Dependencies** — note anything that must be resolved first",
98
- "",
99
- "### Artifact saved",
100
- "`plan.md` written to `.waypoint/plan.md`.",
101
- "",
102
- "### Suggested next step",
103
- "Run `waypoint_build` to scaffold implementation from this plan.",
104
- ]
105
- .filter((l) => l !== undefined)
106
- .join("\n");
107
- }
@@ -1,104 +0,0 @@
1
- import { getBaseContext, getArtifact, saveArtifact } from "../context.js";
2
- export const definition = {
3
- name: "waypoint_research",
4
- description: "Gather best practices, surface the right questions, explore the solution space.",
5
- inputSchema: {
6
- type: "object",
7
- properties: {
8
- workspacePath: {
9
- type: "string",
10
- description: "Absolute path to the workspace root.",
11
- },
12
- topic: {
13
- type: "string",
14
- description: "Specific research focus (optional). Omit to research the full goal.",
15
- },
16
- },
17
- required: ["workspacePath"],
18
- },
19
- };
20
- export async function run(args) {
21
- const { workspacePath, topic } = args;
22
- const ctx = await getBaseContext(workspacePath);
23
- const goalArtifact = await getArtifact(workspacePath, "goal.md");
24
- if (!goalArtifact) {
25
- return [
26
- "## waypoint_research — No goal found",
27
- "",
28
- "Run `waypoint_goal` first to define the project goal before researching.",
29
- ].join("\n");
30
- }
31
- const goalLine = goalArtifact.match(/^# Goal\n+(.+)/m)?.[1] ?? "(goal not parsed)";
32
- const focus = topic ?? goalLine;
33
- const artifact = [
34
- "# Research",
35
- "",
36
- `**Goal:** ${goalLine}`,
37
- topic ? `**Focus:** ${topic}` : "",
38
- "",
39
- "## Key questions to answer",
40
- "<!-- What must be understood before committing to a design? -->",
41
- "- What existing solutions or libraries handle this well?",
42
- "- What constraints (performance, security, compatibility) apply?",
43
- "- What has failed in similar past attempts?",
44
- "- What unknowns could invalidate the plan?",
45
- "",
46
- "## Areas to investigate",
47
- "",
48
- "### Prior art & libraries",
49
- "- [ ] Survey existing libraries and tools relevant to the goal",
50
- "- [ ] Review documentation and known limitations",
51
- "",
52
- "### Architecture & patterns",
53
- "- [ ] Identify applicable design patterns",
54
- "- [ ] Assess integration points with existing code",
55
- "",
56
- "### Risks & constraints",
57
- "- [ ] List technical risks",
58
- "- [ ] Note hard constraints (runtime, platform, team)",
59
- "",
60
- "### Open decisions",
61
- "<!-- Questions that will need to be resolved in waypoint_compare -->",
62
- "- [ ] ",
63
- "",
64
- "## Workspace observations",
65
- `**Path:** ${workspacePath}`,
66
- ctx.packageJson
67
- ? (() => {
68
- try {
69
- const p = JSON.parse(ctx.packageJson);
70
- return `**Package:** ${p.name ?? "unnamed"} v${p.version ?? "?"}`;
71
- }
72
- catch {
73
- return "**Package:** present (unparseable)";
74
- }
75
- })()
76
- : "**Package:** none detected",
77
- "",
78
- `_Generated by waypoint_research — ${new Date().toISOString()}_`,
79
- ]
80
- .filter((l) => l !== undefined)
81
- .join("\n");
82
- await saveArtifact(workspacePath, "research.md", artifact);
83
- return [
84
- "## waypoint_research — Research brief generated",
85
- "",
86
- `**Goal:** ${goalLine}`,
87
- topic ? `**Focus:** ${topic}` : "",
88
- "",
89
- "### What to investigate",
90
- "1. **Prior art & libraries** — survey what exists, note limitations",
91
- "2. **Architecture & patterns** — find applicable patterns, assess fit",
92
- "3. **Risks & constraints** — surface blockers early",
93
- "4. **Open decisions** — list what must be resolved before planning",
94
- "",
95
- "### Artifact saved",
96
- "`research.md` written to `.waypoint/research.md`.",
97
- "Fill in findings before moving forward.",
98
- "",
99
- "### Suggested next step",
100
- "Run `waypoint_compare` to turn research findings into concrete decision tradeoffs.",
101
- ]
102
- .filter((l) => l !== undefined)
103
- .join("\n");
104
- }
@@ -1,123 +0,0 @@
1
- import { getBaseContext, getArtifact, saveArtifact } from "../context.js";
2
- export const definition = {
3
- name: "waypoint_review",
4
- description: "Final quality check before shipping or handoff. Reads all prior artifacts.",
5
- inputSchema: {
6
- type: "object",
7
- properties: {
8
- workspacePath: {
9
- type: "string",
10
- description: "Absolute path to the workspace root.",
11
- },
12
- },
13
- required: ["workspacePath"],
14
- },
15
- };
16
- const ALL_ARTIFACTS = [
17
- "goal.md",
18
- "research.md",
19
- "compare.md",
20
- "plan.md",
21
- "design.md",
22
- "build.md",
23
- "test.md",
24
- "fix.md",
25
- "debug.md",
26
- "audit.md",
27
- "measure.md",
28
- "improve.md",
29
- "docs.md",
30
- ];
31
- export async function run(args) {
32
- const { workspacePath } = args;
33
- const ctx = await getBaseContext(workspacePath);
34
- const goalArtifact = await getArtifact(workspacePath, "goal.md");
35
- if (!goalArtifact) {
36
- return [
37
- "## waypoint_review — No goal found",
38
- "",
39
- "Run `waypoint_goal` first — review requires a defined goal to evaluate against.",
40
- ].join("\n");
41
- }
42
- const goalLine = goalArtifact.match(/^# Goal\n+(.+)/m)?.[1] ?? "(goal not parsed)";
43
- // inventory all artifacts
44
- const inventory = [];
45
- for (const name of ALL_ARTIFACTS) {
46
- const content = await getArtifact(workspacePath, name);
47
- inventory.push({ name, present: !!content });
48
- }
49
- const present = inventory.filter((a) => a.present);
50
- const missing = inventory.filter((a) => !a.present);
51
- const inventoryRows = inventory.map((a) => `| ${a.name} | ${a.present ? "✅" : "❌"} |`);
52
- const artifact = [
53
- "# Review",
54
- "",
55
- `**Goal:** ${goalLine}`,
56
- "",
57
- "## Artifact inventory",
58
- "| Artifact | Present |",
59
- "|----------|---------|",
60
- ...inventoryRows,
61
- "",
62
- `**${present.length} of ${ALL_ARTIFACTS.length} artifacts present.**`,
63
- missing.length > 0
64
- ? `Missing: ${missing.map((a) => a.name).join(", ")}`
65
- : "All artifacts present.",
66
- "",
67
- "## Pre-ship checklist",
68
- "<!-- Work through these before marking done -->",
69
- "",
70
- "### Goal",
71
- "- [ ] Goal is clearly stated and success criteria are defined",
72
- "- [ ] All success criteria are met (see measure.md)",
73
- "",
74
- "### Code quality",
75
- "- [ ] No dead code or commented-out blocks",
76
- "- [ ] No hardcoded values that should be configuration",
77
- "- [ ] Error states produce safe, clear output",
78
- "",
79
- "### Tests",
80
- "- [ ] Happy path tested",
81
- "- [ ] Edge cases tested",
82
- "- [ ] No known failing tests",
83
- "",
84
- "### Documentation",
85
- "- [ ] README or docs.md reflects current state",
86
- "- [ ] Breaking changes documented",
87
- "",
88
- "### Security",
89
- "- [ ] No secrets or credentials in code or artifacts",
90
- "- [ ] Input validation at system boundaries",
91
- "",
92
- "## Reviewer notes",
93
- "<!-- Open issues, questions for the team, or follow-up items -->",
94
- "- ",
95
- "",
96
- "## Verdict",
97
- "<!-- ✅ Ready to ship | ⚠️ Ship with caveats | ❌ Not ready -->",
98
- "**Verdict:** ",
99
- "**Rationale:** ",
100
- "",
101
- `_Generated by waypoint_review — ${new Date().toISOString()}_`,
102
- ].join("\n");
103
- await saveArtifact(workspacePath, "review.md", artifact);
104
- return [
105
- "## waypoint_review — Final review generated",
106
- "",
107
- `**Goal:** ${goalLine}`,
108
- "",
109
- `### Artifact inventory: ${present.length}/${ALL_ARTIFACTS.length} present`,
110
- ...inventory.map((a) => `- ${a.present ? "✅" : "❌"} ${a.name}`),
111
- "",
112
- "### Pre-ship checklist covers",
113
- "Goal, code quality, tests, documentation, security",
114
- "",
115
- "### Artifact saved",
116
- "`review.md` written to `.waypoint/review.md`.",
117
- "Complete the checklist and record your verdict.",
118
- "",
119
- missing.length > 0
120
- ? `### Missing artifacts\nConsider running: ${missing.map((a) => `\`waypoint_${a.name.replace(".md", "")}\``).join(", ")}`
121
- : "### All artifacts present — ready for final checklist.",
122
- ].join("\n");
123
- }
@@ -1,107 +0,0 @@
1
- import { getBaseContext, getArtifact, saveArtifact } from "../context.js";
2
- export const definition = {
3
- name: "waypoint_test",
4
- description: "Verify feature-level requirements. Generate test checklists and prompts.",
5
- inputSchema: {
6
- type: "object",
7
- properties: {
8
- workspacePath: {
9
- type: "string",
10
- description: "Absolute path to the workspace root.",
11
- },
12
- feature: {
13
- type: "string",
14
- description: "Specific feature or behavior to test (optional). Omit to test all built features.",
15
- },
16
- },
17
- required: ["workspacePath"],
18
- },
19
- };
20
- export async function run(args) {
21
- const { workspacePath, feature } = args;
22
- const ctx = await getBaseContext(workspacePath);
23
- const buildArtifact = await getArtifact(workspacePath, "build.md");
24
- const goalArtifact = await getArtifact(workspacePath, "goal.md");
25
- if (!buildArtifact && !goalArtifact) {
26
- return [
27
- "## waypoint_test — No build or goal found",
28
- "",
29
- "Run `waypoint_build` before testing.",
30
- ].join("\n");
31
- }
32
- const goalLine = goalArtifact?.match(/^# Goal\n+(.+)/m)?.[1] ?? "(goal not parsed)";
33
- const hasBuild = !!buildArtifact;
34
- const focus = feature ?? goalLine;
35
- const artifact = [
36
- "# Test",
37
- "",
38
- `**Goal:** ${goalLine}`,
39
- feature ? `**Feature under test:** ${feature}` : "",
40
- !hasBuild ? "\n> ⚠️ No build.md found — test coverage may be incomplete." : "",
41
- "",
42
- "## Feature checklist",
43
- "<!-- Verify each feature works as intended from a user perspective -->",
44
- `- [ ] ${focus} — happy path works end to end`,
45
- "- [ ] Edge cases handled correctly",
46
- "- [ ] Error states produce clear, safe output",
47
- "- [ ] No regressions in adjacent functionality",
48
- "",
49
- "## Test prompts for AI coding tools",
50
- "",
51
- "### Unit test prompt",
52
- "```",
53
- `Write unit tests for: ${focus}`,
54
- "Requirements:",
55
- "- Test the happy path",
56
- "- Test at least 2 edge cases",
57
- "- Test error/failure paths",
58
- "- No mocks unless absolutely necessary",
59
- "```",
60
- "",
61
- "### Integration test prompt",
62
- "```",
63
- `Write integration tests for: ${focus}`,
64
- "Requirements:",
65
- "- Exercise the full stack from entry point to output",
66
- "- Verify against real data or fixtures, not mocks",
67
- "- Assert on observable behavior, not implementation details",
68
- "```",
69
- "",
70
- "## Manual test cases",
71
- "<!-- Scenarios that are hard to automate -->",
72
- "| Scenario | Steps | Expected | Actual | Pass? |",
73
- "|----------|-------|----------|--------|-------|",
74
- "| Happy path | | | | |",
75
- "| Empty input | | | | |",
76
- "| Invalid input | | | | |",
77
- "",
78
- "## Known gaps",
79
- "<!-- Tests not written yet and why -->",
80
- "- ",
81
- "",
82
- `_Generated by waypoint_test — ${new Date().toISOString()}_`,
83
- ]
84
- .filter((l) => l !== undefined)
85
- .join("\n");
86
- await saveArtifact(workspacePath, "test.md", artifact);
87
- return [
88
- "## waypoint_test — Test plan generated",
89
- "",
90
- `**Goal:** ${goalLine}`,
91
- feature ? `**Feature:** ${feature}` : "",
92
- !hasBuild ? "\n> No build.md found — test plan may be incomplete." : "",
93
- "",
94
- "### Coverage areas",
95
- "- **Feature checklist** — happy path, edge cases, errors, regressions",
96
- "- **AI test prompts** — unit and integration test generation",
97
- "- **Manual test cases** — scenarios needing human verification",
98
- "",
99
- "### Artifact saved",
100
- "`test.md` written to `.waypoint/test.md`.",
101
- "",
102
- "### Suggested next step",
103
- "If tests reveal bugs, run `waypoint_fix`. Otherwise run `waypoint_measure` to evaluate overall success.",
104
- ]
105
- .filter((l) => l !== undefined)
106
- .join("\n");
107
- }