agent-method 1.5.1 → 1.5.5

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/lib/cli/check.js CHANGED
@@ -1,71 +1,71 @@
1
- /** agent-method check — validate entry point and project setup. */
2
-
3
- import { dirname, resolve } from "node:path";
4
- import {
5
- findEntryPoint,
6
- resolveProjectType,
7
- getPipeline,
8
- loadRegistryData,
9
- } from "./helpers.js";
10
-
11
- export function register(program) {
12
- program
13
- .command("check [entry-point]")
14
- .description("Validate your entry point and project setup")
15
- .option(
16
- "-p, --project-type <type>",
17
- "Project type: code, context, data, mix, general (auto-detected if omitted)"
18
- )
19
- .option("--registry <path>", "Path to feature-registry.yaml")
20
- .option("--json", "Output as JSON")
21
- .action(async (entryPoint, opts) => {
22
- const { validateEntryPoint, detectProjectType } = await getPipeline();
23
- const reg = await loadRegistryData(opts.registry);
24
-
25
- if (!entryPoint) {
26
- entryPoint = findEntryPoint(".");
27
- if (!entryPoint) {
28
- console.error(
29
- "No entry point found in current directory " +
30
- "(looked for CLAUDE.md, .cursorrules, AGENT.md).\n" +
31
- "Specify a path: npx agent-method check path/to/CLAUDE.md"
32
- );
33
- process.exit(1);
34
- }
35
- }
36
-
37
- let projectType;
38
- if (opts.projectType) {
39
- projectType = resolveProjectType(opts.projectType);
40
- } else {
41
- const detected = detectProjectType(dirname(resolve(entryPoint)));
42
- projectType = detected.project_type || "general";
43
- }
44
-
45
- const result = validateEntryPoint(entryPoint, projectType, reg);
46
- console.log(`Checking: ${entryPoint} (type: ${projectType})`);
47
-
48
- if (opts.json) {
49
- console.log(JSON.stringify(result, null, 2));
50
- } else {
51
- const overall = result.valid ? "PASS" : "FAIL";
52
- console.log(` Overall: ${overall}`);
53
- for (const [checkId, chk] of Object.entries(result.checks)) {
54
- const cStatus = chk.pass ? "PASS" : "FAIL";
55
- let extra = "";
56
- if (chk.missing && chk.missing.length > 0) {
57
- extra = ` (missing: ${chk.missing.join(", ")})`;
58
- }
59
- console.log(` ${checkId}: ${cStatus}${extra}`);
60
- }
61
- if (result.issues && result.issues.length > 0) {
62
- console.log("\n Issues:");
63
- for (const issue of result.issues) {
64
- console.log(
65
- ` [${issue.severity}] ${issue.check}: ${issue.description}`
66
- );
67
- }
68
- }
69
- }
70
- });
71
- }
1
+ /** wwa check — validate entry point and project setup. */
2
+
3
+ import { dirname, resolve } from "node:path";
4
+ import {
5
+ findEntryPoint,
6
+ resolveProjectType,
7
+ getPipeline,
8
+ loadRegistryData,
9
+ } from "./helpers.js";
10
+
11
+ export function register(program) {
12
+ program
13
+ .command("check [entry-point]")
14
+ .description("Validate your entry point and project setup")
15
+ .option(
16
+ "-p, --project-type <type>",
17
+ "Project type: code, context, data, mix, general (auto-detected if omitted)"
18
+ )
19
+ .option("--registry <path>", "Path to feature-registry.yaml")
20
+ .option("--json", "Output as JSON")
21
+ .action(async (entryPoint, opts) => {
22
+ const { validateEntryPoint, detectProjectType } = await getPipeline();
23
+ const reg = await loadRegistryData(opts.registry);
24
+
25
+ if (!entryPoint) {
26
+ entryPoint = findEntryPoint(".");
27
+ if (!entryPoint) {
28
+ console.error(
29
+ "No entry point found in current directory " +
30
+ "(looked for CLAUDE.md, .cursorrules, AGENT.md).\n" +
31
+ "Specify a path: npx agent-method check path/to/CLAUDE.md"
32
+ );
33
+ process.exit(1);
34
+ }
35
+ }
36
+
37
+ let projectType;
38
+ if (opts.projectType) {
39
+ projectType = resolveProjectType(opts.projectType);
40
+ } else {
41
+ const detected = detectProjectType(dirname(resolve(entryPoint)));
42
+ projectType = detected.project_type || "general";
43
+ }
44
+
45
+ const result = validateEntryPoint(entryPoint, projectType, reg);
46
+ console.log(`Checking: ${entryPoint} (type: ${projectType})`);
47
+
48
+ if (opts.json) {
49
+ console.log(JSON.stringify(result, null, 2));
50
+ } else {
51
+ const overall = result.valid ? "PASS" : "FAIL";
52
+ console.log(` Overall: ${overall}`);
53
+ for (const [checkId, chk] of Object.entries(result.checks)) {
54
+ const cStatus = chk.pass ? "PASS" : "FAIL";
55
+ let extra = "";
56
+ if (chk.missing && chk.missing.length > 0) {
57
+ extra = ` (missing: ${chk.missing.join(", ")})`;
58
+ }
59
+ console.log(` ${checkId}: ${cStatus}${extra}`);
60
+ }
61
+ if (result.issues && result.issues.length > 0) {
62
+ console.log("\n Issues:");
63
+ for (const issue of result.issues) {
64
+ console.log(
65
+ ` [${issue.severity}] ${issue.check}: ${issue.description}`
66
+ );
67
+ }
68
+ }
69
+ }
70
+ });
71
+ }
package/lib/cli/init.js CHANGED
@@ -1,4 +1,4 @@
1
- /** agent-method init — set up a new project or describe entry point contents. */
1
+ /** wwa init — set up a new project with methodology templates. */
2
2
 
3
3
  import {
4
4
  resolveProjectType,
@@ -10,9 +10,11 @@ import {
10
10
 
11
11
  export function register(program) {
12
12
  program
13
- .command("init <project-type> [directory]")
13
+ .command("init [project-type] [directory]")
14
14
  .description("Set up a new project with methodology templates")
15
- .option("--tier <tier>", "Template tier (starter/full)", "starter")
15
+ .option("--tier <tier>", "Template tier (starter/full)")
16
+ .option("--runtime <runtime>", "Agent runtime (claude/cursor/all)")
17
+ .option("--profile <profile>", "Integration profile (lite/standard/full)")
16
18
  .option("--registry <path>", "Path to feature-registry.yaml")
17
19
  .option("--json", "Output as JSON")
18
20
  .option(
@@ -20,15 +22,13 @@ export function register(program) {
20
22
  "Only describe what the entry point should contain (no file creation)"
21
23
  )
22
24
  .action(async (projectTypeArg, directory, opts) => {
23
- const projectType = resolveProjectType(projectTypeArg);
24
-
25
- if (opts.describe || !directory) {
26
- // Describe mode
25
+ // If describe mode with a type, show entry point spec
26
+ if (opts.describe && projectTypeArg) {
27
+ const projectType = resolveProjectType(projectTypeArg);
27
28
  const { generateEntryPoint } = await getPipeline();
28
29
  const reg = await loadRegistryData(opts.registry);
29
- const result = generateEntryPoint(projectType, opts.tier, reg);
30
+ const result = generateEntryPoint(projectType, opts.tier || "starter", reg);
30
31
 
31
- // Show friendly name
32
32
  let friendly = projectType;
33
33
  for (const [alias, internal] of Object.entries(PROJECT_TYPE_ALIASES)) {
34
34
  if (internal === projectType && alias !== projectType) {
@@ -38,22 +38,112 @@ export function register(program) {
38
38
  }
39
39
 
40
40
  console.log(
41
- `Entry point specification for: ${friendly} (${opts.tier})`
41
+ `Entry point specification for: ${friendly} (${opts.tier || "starter"})`
42
42
  );
43
43
  outputData(result, opts.json);
44
+ return;
45
+ }
46
+
47
+ // Interactive mode — prompt for missing values
48
+ if (!projectTypeArg || !directory) {
49
+ const inquirer = (await import("inquirer")).default;
50
+
51
+ console.log("\n wwa — Set up AI-agent-assisted development\n");
52
+
53
+ const answers = {};
54
+
55
+ if (!projectTypeArg) {
56
+ const { type } = await inquirer.prompt([
57
+ {
58
+ type: "list",
59
+ name: "type",
60
+ message: "Project type:",
61
+ choices: [
62
+ { name: "Code — software project", value: "code" },
63
+ { name: "Data — data index/querying", value: "data" },
64
+ { name: "Analytical — prompts, chains, evaluation", value: "context" },
65
+ { name: "Mixed — multiple types combined", value: "mix" },
66
+ { name: "General — universal rules only", value: "general" },
67
+ ],
68
+ },
69
+ ]);
70
+ answers.type = type;
71
+ }
72
+
44
73
  if (!directory) {
45
- console.log(
46
- "\nTo create a project, specify a directory:\n" +
47
- ` npx agent-method init ${projectTypeArg} ~/my-project`
48
- );
74
+ const { dir } = await inquirer.prompt([
75
+ {
76
+ type: "input",
77
+ name: "dir",
78
+ message: "Project directory:",
79
+ default: ".",
80
+ },
81
+ ]);
82
+ answers.dir = dir;
49
83
  }
50
- return;
84
+
85
+ if (!opts.runtime) {
86
+ const { runtime } = await inquirer.prompt([
87
+ {
88
+ type: "list",
89
+ name: "runtime",
90
+ message: "Agent runtime:",
91
+ choices: [
92
+ { name: "Claude Code — creates CLAUDE.md", value: "claude" },
93
+ { name: "Cursor — creates .cursorrules", value: "cursor" },
94
+ { name: "Other / All — keeps all entry points", value: "all" },
95
+ ],
96
+ },
97
+ ]);
98
+ answers.runtime = runtime;
99
+ }
100
+
101
+ if (!opts.tier) {
102
+ const { tier } = await inquirer.prompt([
103
+ {
104
+ type: "list",
105
+ name: "tier",
106
+ message: "Template tier:",
107
+ choices: [
108
+ { name: "Starter (7 files) — recommended for most projects", value: "starter" },
109
+ { name: "Full (11+ files) — complex or long-running projects", value: "full" },
110
+ ],
111
+ },
112
+ ]);
113
+ answers.tier = tier;
114
+ }
115
+
116
+ if (!opts.profile) {
117
+ const { profile } = await inquirer.prompt([
118
+ {
119
+ type: "list",
120
+ name: "profile",
121
+ message: "Integration profile:",
122
+ choices: [
123
+ { name: "Standard (Sonnet) — recommended", value: "standard" },
124
+ { name: "Lite (Haiku) — minimal rules, simple projects", value: "lite" },
125
+ { name: "Full (Opus) — all rules inline, complex projects", value: "full" },
126
+ ],
127
+ },
128
+ ]);
129
+ answers.profile = profile;
130
+ }
131
+
132
+ projectTypeArg = projectTypeArg || answers.type;
133
+ directory = directory || answers.dir;
134
+ opts.runtime = opts.runtime || answers.runtime;
135
+ opts.tier = opts.tier || answers.tier;
136
+ opts.profile = opts.profile || answers.profile;
51
137
  }
52
138
 
53
- // Interactive setup mode
139
+ const projectType = resolveProjectType(projectTypeArg);
140
+
141
+ // Setup mode
54
142
  const { initProject } = await import("../init.js");
55
143
  await initProject(projectType, directory, {
56
- tier: opts.tier,
144
+ tier: opts.tier || "starter",
145
+ runtime: opts.runtime || "all",
146
+ profile: opts.profile || "standard",
57
147
  registryPath: opts.registry,
58
148
  });
59
149
  });
@@ -1,4 +1,4 @@
1
- /** agent-method pipeline — advanced subcommands for debugging and testing. */
1
+ /** wwa pipeline — advanced subcommands for debugging and testing. */
2
2
 
3
3
  import { resolve, dirname, join } from "node:path";
4
4
  import { existsSync, readdirSync } from "node:fs";