agent-method 1.5.12
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.
- package/README.md +343 -0
- package/bin/wwa.js +115 -0
- package/docs/internal/cli-commands.yaml +259 -0
- package/docs/internal/doc-tokens.yaml +1103 -0
- package/docs/internal/feature-registry.yaml +1643 -0
- package/lib/boundaries.js +247 -0
- package/lib/cli/add.js +170 -0
- package/lib/cli/casestudy.js +1000 -0
- package/lib/cli/check.js +323 -0
- package/lib/cli/close.js +838 -0
- package/lib/cli/completion.js +735 -0
- package/lib/cli/deps.js +234 -0
- package/lib/cli/digest.js +73 -0
- package/lib/cli/doc-review.js +486 -0
- package/lib/cli/docs.js +315 -0
- package/lib/cli/helpers.js +198 -0
- package/lib/cli/implement.js +169 -0
- package/lib/cli/init.js +280 -0
- package/lib/cli/pipeline.js +206 -0
- package/lib/cli/plan.js +140 -0
- package/lib/cli/record.js +98 -0
- package/lib/cli/refine.js +202 -0
- package/lib/cli/report-helpers.js +113 -0
- package/lib/cli/review.js +76 -0
- package/lib/cli/routable.js +109 -0
- package/lib/cli/route.js +101 -0
- package/lib/cli/scan.js +133 -0
- package/lib/cli/serve.js +23 -0
- package/lib/cli/status.js +65 -0
- package/lib/cli/update-docs.js +574 -0
- package/lib/cli/upgrade.js +222 -0
- package/lib/cli/watch.js +32 -0
- package/lib/dependencies.js +196 -0
- package/lib/init.js +692 -0
- package/lib/mcp-server.js +612 -0
- package/lib/pipeline.js +907 -0
- package/lib/registry.js +132 -0
- package/lib/watcher.js +165 -0
- package/package.json +54 -0
- package/templates/README.md +363 -0
- package/templates/entry-points/.cursorrules +90 -0
- package/templates/entry-points/AGENT.md +90 -0
- package/templates/entry-points/CLAUDE.md +88 -0
- package/templates/extensions/MANIFEST.md +110 -0
- package/templates/extensions/analytical-system.md +96 -0
- package/templates/extensions/code-project.md +77 -0
- package/templates/extensions/data-exploration.md +117 -0
- package/templates/full/.context/BASE.md +101 -0
- package/templates/full/.context/COMPOSITION.md +47 -0
- package/templates/full/.context/INDEX.yaml +56 -0
- package/templates/full/.context/METHODOLOGY.md +246 -0
- package/templates/full/.context/PROTOCOL.yaml +169 -0
- package/templates/full/.context/REGISTRY.md +75 -0
- package/templates/full/.cursorrules +90 -0
- package/templates/full/AGENT.md +90 -0
- package/templates/full/CLAUDE.md +90 -0
- package/templates/full/Management/DIGEST.md +23 -0
- package/templates/full/Management/STATUS.md +46 -0
- package/templates/full/PLAN.md +67 -0
- package/templates/full/PROJECT-PROFILE.md +61 -0
- package/templates/full/PROJECT.md +80 -0
- package/templates/full/REQUIREMENTS.md +30 -0
- package/templates/full/ROADMAP.md +39 -0
- package/templates/full/Reviews/INDEX.md +41 -0
- package/templates/full/Reviews/backlog.md +52 -0
- package/templates/full/Reviews/plan.md +43 -0
- package/templates/full/Reviews/project.md +41 -0
- package/templates/full/Reviews/requirements.md +42 -0
- package/templates/full/Reviews/roadmap.md +41 -0
- package/templates/full/Reviews/state.md +56 -0
- package/templates/full/SESSION-LOG.md +102 -0
- package/templates/full/STATE.md +42 -0
- package/templates/full/SUMMARY.md +27 -0
- package/templates/full/agentWorkflows/INDEX.md +42 -0
- package/templates/full/agentWorkflows/observations.md +65 -0
- package/templates/full/agentWorkflows/patterns.md +68 -0
- package/templates/full/agentWorkflows/sessions.md +92 -0
- package/templates/full/intro/README.md +39 -0
- package/templates/full/registry/feature-registry.yaml +25 -0
- package/templates/full/registry/features/catalog.yaml +743 -0
- package/templates/full/registry/features/protocol.yaml +121 -0
- package/templates/full/registry/features/routing.yaml +358 -0
- package/templates/full/registry/features/workflows.yaml +404 -0
- package/templates/full/todos/backlog.md +19 -0
- package/templates/starter/.context/BASE.md +66 -0
- package/templates/starter/.context/INDEX.yaml +51 -0
- package/templates/starter/.context/METHODOLOGY.md +228 -0
- package/templates/starter/.context/PROTOCOL.yaml +165 -0
- package/templates/starter/.cursorrules +90 -0
- package/templates/starter/AGENT.md +90 -0
- package/templates/starter/CLAUDE.md +90 -0
- package/templates/starter/Management/DIGEST.md +23 -0
- package/templates/starter/Management/STATUS.md +46 -0
- package/templates/starter/PLAN.md +67 -0
- package/templates/starter/PROJECT-PROFILE.md +44 -0
- package/templates/starter/PROJECT.md +80 -0
- package/templates/starter/ROADMAP.md +39 -0
- package/templates/starter/Reviews/INDEX.md +75 -0
- package/templates/starter/SESSION-LOG.md +102 -0
- package/templates/starter/STATE.md +42 -0
- package/templates/starter/SUMMARY.md +27 -0
- package/templates/starter/agentWorkflows/INDEX.md +61 -0
- package/templates/starter/intro/README.md +37 -0
- package/templates/starter/registry/feature-registry.yaml +25 -0
- package/templates/starter/registry/features/catalog.yaml +743 -0
- package/templates/starter/registry/features/protocol.yaml +121 -0
- package/templates/starter/registry/features/routing.yaml +358 -0
- package/templates/starter/registry/features/workflows.yaml +404 -0
package/lib/cli/scan.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/** wwa scan — detect project type from directory contents; optional overview (doc structure, methodology files, dependency summary). */
|
|
2
|
+
|
|
3
|
+
import { resolve, join } from "node:path";
|
|
4
|
+
import { existsSync, statSync } from "node:fs";
|
|
5
|
+
import { getPipeline, outputData } from "./helpers.js";
|
|
6
|
+
import { loadDocGraph } from "../boundaries.js";
|
|
7
|
+
import { buildDefaultNodes } from "../dependencies.js";
|
|
8
|
+
import { printCliReport, writeLastRunSummary } from "./report-helpers.js";
|
|
9
|
+
|
|
10
|
+
// Key methodology directories (structure summary)
|
|
11
|
+
const OVERVIEW_DIRS = ["docs", ".context", "registry", "Management", "todos", "intro"];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Build overview: doc structure, methodology file inventory, dependency summary (Phase 7r §5.5).
|
|
15
|
+
* @param {string} dir - Resolved project root
|
|
16
|
+
* @returns {Promise<{ doc_structure: { present: string[], missing: string[] }, methodology_files: { present: string[], missing: string[] }, dependency_summary: object | null, deps_hint?: string }>}
|
|
17
|
+
*/
|
|
18
|
+
async function buildScanOverview(dir) {
|
|
19
|
+
const d = resolve(dir);
|
|
20
|
+
const doc_structure = { present: [], missing: [] };
|
|
21
|
+
for (const name of OVERVIEW_DIRS) {
|
|
22
|
+
const p = join(d, name);
|
|
23
|
+
try {
|
|
24
|
+
if (existsSync(p) && statSync(p).isDirectory()) {
|
|
25
|
+
doc_structure.present.push(name + "/");
|
|
26
|
+
} else {
|
|
27
|
+
doc_structure.missing.push(name + "/");
|
|
28
|
+
}
|
|
29
|
+
} catch {
|
|
30
|
+
doc_structure.missing.push(name + "/");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const methodology_files = { present: [], missing: [] };
|
|
35
|
+
const allNodes = buildDefaultNodes("full");
|
|
36
|
+
const paths = [...new Set(allNodes.map((n) => n.path))];
|
|
37
|
+
for (const path of paths) {
|
|
38
|
+
const p = join(d, path);
|
|
39
|
+
if (existsSync(p)) {
|
|
40
|
+
methodology_files.present.push(path);
|
|
41
|
+
} else {
|
|
42
|
+
methodology_files.missing.push(path);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const docGraph = await loadDocGraph(d);
|
|
47
|
+
let dependency_summary = null;
|
|
48
|
+
let deps_hint;
|
|
49
|
+
if (docGraph && docGraph.nodes && docGraph.edges) {
|
|
50
|
+
const nodes = docGraph.nodes.length;
|
|
51
|
+
const edges = docGraph.edges.length;
|
|
52
|
+
const byType = {};
|
|
53
|
+
for (const e of docGraph.edges) {
|
|
54
|
+
byType[e.type] = (byType[e.type] || 0) + 1;
|
|
55
|
+
}
|
|
56
|
+
dependency_summary = {
|
|
57
|
+
nodes,
|
|
58
|
+
edges,
|
|
59
|
+
edge_types: byType,
|
|
60
|
+
last_scan: docGraph.last_scan || null,
|
|
61
|
+
};
|
|
62
|
+
deps_hint = "Run `wwa deps` for full dependency graph.";
|
|
63
|
+
} else {
|
|
64
|
+
deps_hint = "Run `wwa init` then `wwa deps` for dependency graph.";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
doc_structure,
|
|
69
|
+
methodology_files,
|
|
70
|
+
dependency_summary,
|
|
71
|
+
deps_hint,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function register(program) {
|
|
76
|
+
program
|
|
77
|
+
.command("scan [directory]")
|
|
78
|
+
.description("Detect project type from directory contents; with overview: doc structure, methodology file inventory, key dependency summary (see wwa deps)")
|
|
79
|
+
.option("--registry <path>", "Path to feature-registry.yaml")
|
|
80
|
+
.option("--json", "Output as JSON")
|
|
81
|
+
.option("--no-overview", "Skip overview (doc structure, methodology files, dependency summary)")
|
|
82
|
+
.action(async (directory, opts) => {
|
|
83
|
+
directory = directory || ".";
|
|
84
|
+
const { detectProjectType } = await getPipeline();
|
|
85
|
+
const result = detectProjectType(directory);
|
|
86
|
+
|
|
87
|
+
const ptype = result.project_type || "general";
|
|
88
|
+
const friendlyMap = { analytical: "context", mixed: "mix" };
|
|
89
|
+
if (ptype in friendlyMap) {
|
|
90
|
+
result.friendly_name = friendlyMap[ptype];
|
|
91
|
+
result.init_command = `wwa init ${friendlyMap[ptype]}`;
|
|
92
|
+
} else {
|
|
93
|
+
result.init_command = `wwa init ${ptype}`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (opts.overview !== false) {
|
|
97
|
+
const overview = await buildScanOverview(directory);
|
|
98
|
+
result.overview = {
|
|
99
|
+
doc_structure: overview.doc_structure,
|
|
100
|
+
methodology_files: overview.methodology_files,
|
|
101
|
+
dependency_summary: overview.dependency_summary,
|
|
102
|
+
};
|
|
103
|
+
result.deps_hint = overview.deps_hint;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (opts.json) {
|
|
107
|
+
console.log(`Scanning: ${directory}`);
|
|
108
|
+
outputData(result, true);
|
|
109
|
+
} else {
|
|
110
|
+
const ptype = result.project_type || "general";
|
|
111
|
+
const initCmd = result.init_command || `wwa init ${ptype}`;
|
|
112
|
+
const ov = result.overview;
|
|
113
|
+
const dirCount = ov?.doc_structure?.present?.length ?? 0;
|
|
114
|
+
const filePresent = ov?.methodology_files?.present?.length ?? 0;
|
|
115
|
+
const fileMissing = ov?.methodology_files?.missing?.length ?? 0;
|
|
116
|
+
const depLine = result.deps_hint || "";
|
|
117
|
+
const summary = [
|
|
118
|
+
`Project type: ${ptype}. Init: ${initCmd}.`,
|
|
119
|
+
ov
|
|
120
|
+
? `${dirCount} methodology dirs present, ${filePresent} methodology files present, ${fileMissing} missing.`
|
|
121
|
+
: "Overview skipped (use without --no-overview for details).",
|
|
122
|
+
depLine,
|
|
123
|
+
]
|
|
124
|
+
.filter(Boolean)
|
|
125
|
+
.join(" ");
|
|
126
|
+
const inputRef = `directory=${directory}`;
|
|
127
|
+
printCliReport({ command: "scan", inputRef, summary });
|
|
128
|
+
console.log(` Detail — Scanning: ${directory}`);
|
|
129
|
+
outputData(result, false);
|
|
130
|
+
writeLastRunSummary(resolve(directory), { command: "scan", inputRef, summary });
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
package/lib/cli/serve.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** wwa serve — start MCP server on stdio transport. */
|
|
2
|
+
|
|
3
|
+
export function register(program) {
|
|
4
|
+
program
|
|
5
|
+
.command("serve")
|
|
6
|
+
.description("Start MCP server exposing methodology tools via stdio transport")
|
|
7
|
+
.option("--registry <path>", "Path to feature-registry.yaml")
|
|
8
|
+
.action(async (opts) => {
|
|
9
|
+
// Redirect all non-MCP output to stderr so stdout stays clean for JSON-RPC
|
|
10
|
+
const info = (msg) => process.stderr.write(msg + "\n");
|
|
11
|
+
|
|
12
|
+
info("wwa MCP server starting...");
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const { startServer } = await import("../mcp-server.js");
|
|
16
|
+
await startServer(opts.registry || undefined);
|
|
17
|
+
info("wwa MCP server running on stdio. Press Ctrl+C to stop.");
|
|
18
|
+
} catch (err) {
|
|
19
|
+
info(`Error: ${err.message}`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** wwa status — check if methodology version is current. */
|
|
2
|
+
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { findEntryPoint, readMethodVersion, basename_of, pkg } from "./helpers.js";
|
|
5
|
+
import { printCliReport, writeLastRunSummary } from "./report-helpers.js";
|
|
6
|
+
|
|
7
|
+
export function register(program) {
|
|
8
|
+
program
|
|
9
|
+
.command("status [directory]")
|
|
10
|
+
.description("Check if your methodology version is current")
|
|
11
|
+
.option("--json", "Output as JSON")
|
|
12
|
+
.action(async (directory, opts) => {
|
|
13
|
+
directory = directory || ".";
|
|
14
|
+
const ep = findEntryPoint(directory);
|
|
15
|
+
if (!ep) {
|
|
16
|
+
console.error(
|
|
17
|
+
`No entry point found in ${directory} ` +
|
|
18
|
+
"(looked for CLAUDE.md, .cursorrules, AGENT.md)"
|
|
19
|
+
);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const epVersion = readMethodVersion(ep);
|
|
24
|
+
const installed = pkg.version;
|
|
25
|
+
|
|
26
|
+
let verStatus, message;
|
|
27
|
+
if (!epVersion) {
|
|
28
|
+
verStatus = "no_version";
|
|
29
|
+
message =
|
|
30
|
+
`Entry point ${basename_of(ep)} has no method_version setting. ` +
|
|
31
|
+
`Add 'method_version: ${installed.split(".").slice(0, 2).join(".")}' ` +
|
|
32
|
+
`to enable version tracking.`;
|
|
33
|
+
} else if (epVersion === installed.split(".").slice(0, 2).join(".")) {
|
|
34
|
+
verStatus = "current";
|
|
35
|
+
message =
|
|
36
|
+
`Entry point ${basename_of(ep)} is current ` +
|
|
37
|
+
`(method_version: ${epVersion}, installed: ${installed})`;
|
|
38
|
+
} else {
|
|
39
|
+
verStatus = "outdated";
|
|
40
|
+
message =
|
|
41
|
+
`Entry point ${basename_of(ep)} is outdated ` +
|
|
42
|
+
`(method_version: ${epVersion}, installed: ${installed}). ` +
|
|
43
|
+
`Run \`wwa upgrade ${directory}\` to update.`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (opts.json) {
|
|
47
|
+
console.log(
|
|
48
|
+
JSON.stringify(
|
|
49
|
+
{
|
|
50
|
+
entry_point: ep,
|
|
51
|
+
entry_point_version: epVersion,
|
|
52
|
+
installed_version: installed,
|
|
53
|
+
status: verStatus,
|
|
54
|
+
},
|
|
55
|
+
null,
|
|
56
|
+
2
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
} else {
|
|
60
|
+
const inputRef = `directory=${directory}`;
|
|
61
|
+
printCliReport({ command: "status", inputRef, summary: message });
|
|
62
|
+
writeLastRunSummary(resolve(directory || "."), { command: "status", inputRef, summary: message });
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|