agent-method 1.5.1 → 1.5.3
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 +141 -151
- package/bin/{agent-method.js → wwa.js} +12 -4
- package/lib/cli/check.js +2 -2
- package/lib/cli/init.js +107 -17
- package/lib/cli/pipeline.js +1 -1
- package/lib/cli/refine.js +3 -3
- package/lib/cli/route.js +1 -1
- package/lib/cli/scan.js +3 -3
- package/lib/cli/serve.js +23 -0
- package/lib/cli/status.js +2 -2
- package/lib/cli/upgrade.js +8 -7
- package/lib/cli/watch.js +32 -0
- package/lib/init.js +62 -6
- package/lib/mcp-server.js +524 -0
- package/lib/pipeline.js +1 -1
- package/lib/registry.js +1 -1
- package/lib/watcher.js +165 -0
- package/package.json +7 -5
- package/templates/README.md +24 -20
- package/templates/entry-points/.cursorrules +11 -11
- package/templates/entry-points/AGENT.md +11 -11
- package/templates/entry-points/CLAUDE.md +11 -11
- package/templates/full/.cursorrules +11 -11
- package/templates/full/AGENT.md +11 -11
- package/templates/full/CLAUDE.md +11 -11
- package/templates/full/SESSION-LOG.md +37 -5
- package/templates/starter/.cursorrules +11 -11
- package/templates/starter/AGENT.md +11 -11
- package/templates/starter/CLAUDE.md +11 -11
- package/templates/starter/SESSION-LOG.md +37 -5
package/README.md
CHANGED
|
@@ -1,108 +1,149 @@
|
|
|
1
|
-
#
|
|
1
|
+
# wwa
|
|
2
2
|
|
|
3
|
-
A file-structure-first methodology for AI-agent-assisted development. Files are the interface —
|
|
3
|
+
A file-structure-first methodology for AI-agent-assisted development. Files are the interface — no proprietary tools, no vendor lock-in. Works with Claude Code, Cursor, or any agent that reads markdown.
|
|
4
4
|
|
|
5
|
-
`ai-agents` `prompt-engineering` `developer-tools` `context-engineering` `agent-framework` `
|
|
5
|
+
`ai-agents` `prompt-engineering` `developer-tools` `context-engineering` `agent-framework` `mcp` `model-context-protocol` `cursor` `claude-code`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Who This Is For
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
People who want to describe what they want and have it built correctly — without losing context between sessions, re-explaining decisions, or watching the agent drift off scope.
|
|
10
10
|
|
|
11
|
-
AI
|
|
11
|
+
If you've ever had an AI agent forget what you told it yesterday, make the same mistake twice, or change files it shouldn't have touched — this fixes that.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- **Amnesia** — decisions from session N are lost by session N+1
|
|
15
|
-
- **Scope drift** — without structured gates, work sprawls and progress becomes invisible
|
|
16
|
-
|
|
17
|
-
Existing solutions tie you to specific agent runtimes through CLI tools and slash commands. agent-method solves this with **files as the interface** — readable, portable, agent-agnostic.
|
|
13
|
+
## Requirements
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
- **Node.js >= 18**
|
|
16
|
+
- **A supported AI runtime** — [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Cursor](https://cursor.sh), or any agent that reads markdown files
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
## Getting Started
|
|
22
19
|
|
|
23
20
|
```bash
|
|
24
|
-
npx
|
|
21
|
+
npx wwa init
|
|
25
22
|
```
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
The installer guides you through everything:
|
|
25
|
+
|
|
26
|
+
1. **Project type** — Code, Data, Analytical, Mixed, or General
|
|
27
|
+
2. **Directory** — where to set up (default: current directory)
|
|
28
|
+
3. **Runtime** — Claude Code, Cursor, or all (creates the right entry point)
|
|
29
|
+
4. **Template tier** — Starter (7 files, most projects) or Full (11+ files, complex projects)
|
|
30
|
+
5. **Integration profile** — Standard (Sonnet, recommended), Lite (Haiku), or Full (Opus)
|
|
28
31
|
|
|
29
|
-
Done.
|
|
32
|
+
Done. Open `PROJECT.md` and start working with your AI agent.
|
|
30
33
|
|
|
31
|
-
###
|
|
34
|
+
### Verify
|
|
32
35
|
|
|
33
36
|
```bash
|
|
34
|
-
|
|
35
|
-
cd agent-method
|
|
36
|
-
bash setup.sh ~/my-project
|
|
37
|
+
npx wwa check
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
Validates your entry point, auto-detects project type, and reports any issues.
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
## Staying Updated
|
|
42
43
|
|
|
43
|
-
```
|
|
44
|
-
|
|
44
|
+
```bash
|
|
45
|
+
npx wwa upgrade
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
Brownfield-safe — appends new methodology sections without overwriting your customizations. Check your current version with `npx wwa status`.
|
|
48
49
|
|
|
49
|
-
##
|
|
50
|
+
## Non-interactive Install (CI, Scripts, Docker)
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
```bash
|
|
53
|
+
# Specify everything on the command line
|
|
54
|
+
npx wwa init code ~/my-project --runtime claude --tier starter --profile standard
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
# Just the type and directory (defaults for the rest)
|
|
57
|
+
npx wwa init code ~/my-project
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
npx
|
|
59
|
+
# Data project for Cursor
|
|
60
|
+
npx wwa init data ~/my-data --runtime cursor
|
|
61
|
+
|
|
62
|
+
# Analytical project with full methodology
|
|
63
|
+
npx wwa init context ~/my-analysis --tier full --profile full
|
|
57
64
|
```
|
|
58
65
|
|
|
59
|
-
|
|
66
|
+
### Install globally
|
|
67
|
+
|
|
68
|
+
Instead of `npx` each time:
|
|
60
69
|
|
|
61
70
|
```bash
|
|
62
|
-
npm install -g
|
|
63
|
-
pip install agent-method-tools # Python (alternative)
|
|
71
|
+
npm install -g wwa
|
|
64
72
|
```
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
### Python alternative
|
|
67
75
|
|
|
68
|
-
|
|
76
|
+
Same commands, same registry, same templates:
|
|
69
77
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
| `npx agent-method scan` | Detect project type from directory contents |
|
|
74
|
-
| `npx agent-method route "<query>"` | Show how a query routes through the pipeline |
|
|
75
|
-
| `npx agent-method refine` | Extract refinement report from SESSION-LOG.md |
|
|
76
|
-
| `npx agent-method status` | Check if your methodology version is current |
|
|
77
|
-
| `npx agent-method upgrade` | Brownfield-safe methodology update |
|
|
78
|
-
| `npx agent-method init <type>` | Describe entry point contents for a project type |
|
|
78
|
+
```bash
|
|
79
|
+
pip install wwa-tools # requires Python >= 3.9
|
|
80
|
+
```
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
## Development Installation
|
|
81
83
|
|
|
82
|
-
|
|
84
|
+
Clone and run locally for testing or contributing:
|
|
83
85
|
|
|
84
86
|
```bash
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
agent-method route "query" -p context # route with project type
|
|
87
|
+
git clone https://github.com/anthropics/wwa.git
|
|
88
|
+
cd wwa
|
|
89
|
+
npm link
|
|
90
|
+
wwa init code ./test-project --runtime claude
|
|
90
91
|
```
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
Or use the bash setup script directly:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
bash setup.sh ~/my-project
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Interactive — asks project name, type, runtime, tier, lifecycle, and profile.
|
|
100
|
+
|
|
101
|
+
## Commands
|
|
102
|
+
|
|
103
|
+
| Command | What it does |
|
|
104
|
+
|---------|-------------|
|
|
105
|
+
| `wwa init` | Set up a new project (interactive) |
|
|
106
|
+
| `wwa check` | Validate your entry point |
|
|
107
|
+
| `wwa scan` | Detect project type from directory contents |
|
|
108
|
+
| `wwa route "<query>"` | Show how a query routes through the pipeline |
|
|
109
|
+
| `wwa refine` | Extract refinement report from SESSION-LOG.md |
|
|
110
|
+
| `wwa status` | Check if your methodology version is current |
|
|
111
|
+
| `wwa upgrade` | Brownfield-safe methodology update |
|
|
112
|
+
| `wwa serve` | Start MCP server for IDE integration |
|
|
113
|
+
| `wwa watch` | Watch files, validate on save |
|
|
114
|
+
|
|
115
|
+
All commands support `--json` for machine-readable output.
|
|
116
|
+
|
|
117
|
+
### MCP Server (AI tool integration)
|
|
118
|
+
|
|
119
|
+
Expose methodology tools directly to your AI agent via the [Model Context Protocol](https://modelcontextprotocol.io):
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"mcpServers": {
|
|
124
|
+
"wwa": {
|
|
125
|
+
"command": "npx",
|
|
126
|
+
"args": ["wwa", "serve"]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
93
131
|
|
|
94
|
-
|
|
132
|
+
8 tools available. Works with VS Code, Cursor, Claude Code, Cline. See [MCP Integration Guide](docs/guides/mcp-integration.md).
|
|
95
133
|
|
|
96
|
-
###
|
|
134
|
+
### Pipeline commands (advanced)
|
|
97
135
|
|
|
98
|
-
|
|
99
|
-
- **Smart defaults** — auto-finds entry point, session log, and project type
|
|
100
|
-
- **Two distributions** — `npx agent-method` (Node.js, zero-install) or `pip install agent-method-tools` (Python)
|
|
101
|
-
- **CLI is opt-in** — methodology works without it; tools add convenience
|
|
136
|
+
For debugging individual pipeline stages:
|
|
102
137
|
|
|
103
|
-
|
|
138
|
+
```bash
|
|
139
|
+
wwa pipeline classify "<query>" --project-type code
|
|
140
|
+
wwa pipeline select code_change
|
|
141
|
+
wwa pipeline resolve WF-02 --stage execute
|
|
142
|
+
wwa pipeline cascade --trigger phase_completion
|
|
143
|
+
wwa pipeline test fixtures/
|
|
144
|
+
```
|
|
104
145
|
|
|
105
|
-
## What
|
|
146
|
+
## What You Get
|
|
106
147
|
|
|
107
148
|
```
|
|
108
149
|
your-project/
|
|
@@ -114,96 +155,67 @@ your-project/
|
|
|
114
155
|
PLAN.md # Current task with verification criteria
|
|
115
156
|
.context/
|
|
116
157
|
BASE.md # Core context — always loaded with entry point
|
|
117
|
-
METHODOLOGY.md # Workflows, conventions overflow
|
|
158
|
+
METHODOLOGY.md # Workflows, conventions overflow
|
|
118
159
|
```
|
|
119
160
|
|
|
120
161
|
Full tier adds: `REQUIREMENTS.md`, `SUMMARY.md`, `.context/REGISTRY.md`, `docs/`, `todos/backlog.md`.
|
|
121
162
|
|
|
122
163
|
Every file ships with **inline instructions** — the agent reads them and helps you populate each section.
|
|
123
164
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
### Scoping rules
|
|
165
|
+
---
|
|
127
166
|
|
|
128
|
-
|
|
167
|
+
## About
|
|
129
168
|
|
|
130
|
-
|
|
131
|
-
| Query type | Read before acting | Update after acting |
|
|
132
|
-
|---------------------|------------------------------|----------------------------|
|
|
133
|
-
| **Code change** | .context/BASE.md + specialist | Source files, test files |
|
|
134
|
-
| **Planning** | REQUIREMENTS.md, ROADMAP.md | STATE.md, PLAN.md |
|
|
135
|
-
```
|
|
169
|
+
### The problem
|
|
136
170
|
|
|
137
|
-
|
|
171
|
+
AI-agent-assisted development breaks down in three ways:
|
|
138
172
|
|
|
139
|
-
|
|
173
|
+
- **Context rot** — agent quality degrades as context windows fill with irrelevant conversation
|
|
174
|
+
- **Amnesia** — decisions from session N are lost by session N+1
|
|
175
|
+
- **Scope drift** — without structured gates, work sprawls and progress becomes invisible
|
|
140
176
|
|
|
141
|
-
|
|
142
|
-
| When this changes | Also update |
|
|
143
|
-
|----------------------|------------------------------------------------|
|
|
144
|
-
| Database schema | Migrations, type imports, .context/DATABASE.md |
|
|
145
|
-
| Phase completion | SUMMARY.md, STATE.md, ROADMAP.md |
|
|
146
|
-
```
|
|
177
|
+
Existing solutions tie you to specific agent runtimes through CLI tools and slash commands. wwa solves this with **files as the interface** — readable, portable, agent-agnostic.
|
|
147
178
|
|
|
148
|
-
###
|
|
179
|
+
### How it works
|
|
149
180
|
|
|
150
|
-
|
|
181
|
+
**Scoping rules** — The entry point contains a table mapping query types to file sets. The agent loads only the relevant files and constrains its writes. Context windows stay small, responses stay focused.
|
|
151
182
|
|
|
152
|
-
|
|
183
|
+
**Dependency cascade** — "When X changes, also update Y." The agent checks this table after every file change, preventing files from drifting out of sync.
|
|
153
184
|
|
|
154
|
-
|
|
185
|
+
**Context pairing** — Instead of loading all context at once, the agent pairs `.context/BASE.md` with one specialist file per query type. Token usage stays low, relevance stays high.
|
|
155
186
|
|
|
156
|
-
|
|
187
|
+
**Cross-session memory** — `STATE.md` persists decisions, blockers, and current position across sessions. No re-explaining what happened yesterday.
|
|
157
188
|
|
|
158
|
-
|
|
189
|
+
### Integration profiles
|
|
159
190
|
|
|
160
|
-
| Profile | Best for |
|
|
161
|
-
|
|
162
|
-
| **
|
|
163
|
-
| **
|
|
164
|
-
| **
|
|
191
|
+
| Profile | Best for | What's included |
|
|
192
|
+
|---------|----------|-----------------|
|
|
193
|
+
| **Lite** | Haiku, simple projects | STATE.md, minimal rules, 2 cascade rules |
|
|
194
|
+
| **Standard** | Sonnet (recommended) | + PLAN.md, context pairing, 6 cascade rules |
|
|
195
|
+
| **Full** | Opus, complex projects | All rules inline, all intelligence layer files |
|
|
165
196
|
|
|
166
197
|
Three rules followed consistently beat ten rules followed inconsistently.
|
|
167
198
|
|
|
168
|
-
|
|
199
|
+
### Project types
|
|
169
200
|
|
|
170
|
-
| Type | CLI name | What's added
|
|
171
|
-
|
|
201
|
+
| Type | CLI name | What's added |
|
|
202
|
+
|------|----------|-------------|
|
|
203
|
+
| **Code** | `code` | Code change, bug fix, dependency, database, API, deployment |
|
|
204
|
+
| **Data** | `data` | Data ingest, schema, document, entity, relationship, analytics |
|
|
205
|
+
| **Analytical** | `context` | Chain work, evaluation, composition, domain research |
|
|
206
|
+
| **Mixed** | `mix` | Multiple extensions combined |
|
|
172
207
|
| **General** | `general` | Universal scoping and cascade rules only |
|
|
173
|
-
| **Code** | `code` | Code change, bug fix, dependency, database, API, deployment scoping + cascade |
|
|
174
|
-
| **Data** | `data` | Data ingest, schema, document, entity, relationship, analytical query scoping + cascade |
|
|
175
|
-
| **Analytical** | `context` | Chain work, evaluation, composition, domain research scoping + cascade |
|
|
176
|
-
| **Mixed** | `mix` | Multiple extensions combined (code+data, code+analytical, etc.) |
|
|
177
|
-
|
|
178
|
-
Extensions are additive — they add rows to existing tables, never override universal content.
|
|
179
208
|
|
|
180
|
-
|
|
209
|
+
### Brownfield projects
|
|
181
210
|
|
|
182
|
-
|
|
211
|
+
Works with existing codebases:
|
|
183
212
|
|
|
184
|
-
- **Never overwrites** existing files
|
|
185
|
-
- **Appends** methodology sections to your existing entry point
|
|
186
|
-
- **Preserves** all your existing conventions
|
|
187
|
-
- **Suggests** the Discovery workflow
|
|
213
|
+
- **Never overwrites** existing files
|
|
214
|
+
- **Appends** methodology sections to your existing entry point
|
|
215
|
+
- **Preserves** all your existing conventions and rules
|
|
216
|
+
- **Suggests** the Discovery workflow for systematic codebase understanding
|
|
188
217
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
The agent inventories your project, maps dependencies, extracts patterns, and bootstraps `.context/` files — all without modifying your source code.
|
|
192
|
-
|
|
193
|
-
## Lifecycle stages
|
|
194
|
-
|
|
195
|
-
Projects evolve. The methodology adapts.
|
|
196
|
-
|
|
197
|
-
| Stage | When | What activates |
|
|
198
|
-
|-------|------|----------------|
|
|
199
|
-
| **Discovery** | Existing project, agent maps it first | SCAN features, WF-08 discovery workflow |
|
|
200
|
-
| **Design** | New project, defining architecture | Planning workflows, decision recording |
|
|
201
|
-
| **Development** | Building and iterating | Code/data/analytical workflows, full cascade |
|
|
202
|
-
| **Evolution** | Maintaining and extending | Context refresh, drift detection |
|
|
203
|
-
|
|
204
|
-
Transitions happen naturally — update `PROJECT-PROFILE.md` when you're ready to move on.
|
|
205
|
-
|
|
206
|
-
## Supported runtimes
|
|
218
|
+
### Supported runtimes
|
|
207
219
|
|
|
208
220
|
| File | Runtime | Auto-loaded? |
|
|
209
221
|
|------|---------|:------------:|
|
|
@@ -211,45 +223,23 @@ Transitions happen naturally — update `PROJECT-PROFILE.md` when you're ready t
|
|
|
211
223
|
| `.cursorrules` | Cursor | Yes |
|
|
212
224
|
| `AGENT.md` | Any agent | No (paste or reference manually) |
|
|
213
225
|
|
|
214
|
-
All three contain identical scoping rules, cascade structure, and conventions — only the filename and auto-loading behavior differ.
|
|
215
|
-
|
|
216
|
-
## Template tiers
|
|
217
|
-
|
|
218
|
-
**Starter** (7 files) — Cross-session memory, scoped context loading, project profiling, structured execution. Good for most projects.
|
|
219
|
-
|
|
220
|
-
**Full** (11+ files) — Everything in starter, plus requirements tracking, execution history (`SUMMARY.md`), navigation registry, human-facing docs scaffold, and backlog capture. For complex or long-running projects.
|
|
221
|
-
|
|
222
|
-
## Methodology at a glance
|
|
223
|
-
|
|
224
|
-
| Concept | What it does |
|
|
225
|
-
|---------|-------------|
|
|
226
|
-
| **Intelligence layer** | PROJECT / STATE / ROADMAP / PLAN / SUMMARY files provide persistent cross-session memory |
|
|
227
|
-
| **Scoping rules** | Table-driven query routing — agent loads only what's relevant |
|
|
228
|
-
| **Dependency cascade** | "When X changes, also update Y" prevents file drift |
|
|
229
|
-
| **Context pairing** | One specialist file per query type, not everything at once |
|
|
230
|
-
| **Workflow stages** | Initialize → Scope → Plan → Execute → Verify → Close |
|
|
231
|
-
| **Integration profiles** | lite / standard / full — match methodology depth to model capability |
|
|
232
|
-
| **Brownfield merge** | Append-only integration — never overwrites, never deletes |
|
|
233
|
-
| **CLI tools (optional)** | 7 developer commands + pipeline subcommands for debugging |
|
|
234
|
-
| **32 agent capabilities** | Organized across 8 domains, activate behind the scenes |
|
|
235
|
-
|
|
236
226
|
## Documentation
|
|
237
227
|
|
|
238
228
|
| Document | Audience |
|
|
239
229
|
|----------|----------|
|
|
240
|
-
| [Quick start guide](docs/guides/quick-start.md) |
|
|
241
|
-
| [For developers](docs/guides/for-developers.md) |
|
|
242
|
-
| [
|
|
230
|
+
| [Quick start guide](docs/guides/quick-start.md) | Setup and first session |
|
|
231
|
+
| [For developers](docs/guides/for-developers.md) | Workflows, context, troubleshooting |
|
|
232
|
+
| [MCP Integration](docs/guides/mcp-integration.md) | IDE integration (VS Code, Cursor, Claude Code, Cline) |
|
|
233
|
+
| [For managers](docs/guides/for-managers.md) | Reading project status from methodology files |
|
|
243
234
|
| [Template kit](templates/README.md) | Template tiers, extensions, bootstrapping |
|
|
244
|
-
| [CLI tools](https://github.com/anthropics/agent-method#cli-tools-optional) | Command reference (or run `npx agent-method --help`) |
|
|
245
235
|
| [Docs hub](docs/index.md) | Full architecture, workflow, and methodology docs |
|
|
246
236
|
|
|
247
237
|
## Prior art
|
|
248
238
|
|
|
249
239
|
| System | Relationship |
|
|
250
240
|
|--------|-------------|
|
|
251
|
-
| [GSD
|
|
252
|
-
| PromptStudy | Reference implementation.
|
|
241
|
+
| [GSD](https://github.com/gsd-build/get-shit-done) | Inspired the structured agent workflow. wwa adds scoping rules, context pairing, and file-structure-first approach |
|
|
242
|
+
| PromptStudy | Reference implementation. Patterns extracted from real agent-human collaboration |
|
|
253
243
|
|
|
254
244
|
## License
|
|
255
245
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* wwa CLI — methodology tools for AI-agent-assisted development.
|
|
5
5
|
*
|
|
6
6
|
* Thin entry point: each command is registered from lib/cli/*.js modules.
|
|
7
7
|
*
|
|
8
8
|
* Three-tier command structure:
|
|
9
9
|
* Tier 1 (developer): check, scan, route, refine, status, upgrade, init
|
|
10
|
-
* Tier 2 (pipeline):
|
|
10
|
+
* Tier 2 (pipeline): wwa pipeline classify/select/resolve/cascade/test
|
|
11
|
+
* Tier 3 (server): serve (MCP server), watch (file watcher)
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
import { Command } from "commander";
|
|
@@ -21,11 +22,13 @@ import { register as status } from "../lib/cli/status.js";
|
|
|
21
22
|
import { register as upgrade } from "../lib/cli/upgrade.js";
|
|
22
23
|
import { register as init } from "../lib/cli/init.js";
|
|
23
24
|
import { register as pipeline } from "../lib/cli/pipeline.js";
|
|
25
|
+
import { register as serve } from "../lib/cli/serve.js";
|
|
26
|
+
import { register as watchCmd } from "../lib/cli/watch.js";
|
|
24
27
|
|
|
25
28
|
const program = new Command();
|
|
26
29
|
|
|
27
30
|
program
|
|
28
|
-
.name("
|
|
31
|
+
.name("wwa")
|
|
29
32
|
.description(
|
|
30
33
|
"Methodology tools for AI-agent-assisted development.\n\n" +
|
|
31
34
|
"Developer commands:\n" +
|
|
@@ -41,7 +44,10 @@ program
|
|
|
41
44
|
" pipeline select Select workflow for a query type\n" +
|
|
42
45
|
" pipeline resolve Resolve features for a workflow stage\n" +
|
|
43
46
|
" pipeline cascade Compute cascade chain from a trigger\n" +
|
|
44
|
-
" pipeline test Run YAML test fixtures"
|
|
47
|
+
" pipeline test Run YAML test fixtures\n\n" +
|
|
48
|
+
"Server commands:\n" +
|
|
49
|
+
" serve Start MCP server on stdio transport\n" +
|
|
50
|
+
" watch Watch files and validate on change"
|
|
45
51
|
)
|
|
46
52
|
.version(pkg.version, "-V, --version");
|
|
47
53
|
|
|
@@ -54,5 +60,7 @@ status(program);
|
|
|
54
60
|
upgrade(program);
|
|
55
61
|
init(program);
|
|
56
62
|
pipeline(program);
|
|
63
|
+
serve(program);
|
|
64
|
+
watchCmd(program);
|
|
57
65
|
|
|
58
66
|
program.parse();
|
package/lib/cli/check.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** wwa check — validate entry point and project setup. */
|
|
2
2
|
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import {
|
|
@@ -28,7 +28,7 @@ export function register(program) {
|
|
|
28
28
|
console.error(
|
|
29
29
|
"No entry point found in current directory " +
|
|
30
30
|
"(looked for CLAUDE.md, .cursorrules, AGENT.md).\n" +
|
|
31
|
-
"Specify a path: npx
|
|
31
|
+
"Specify a path: npx wwa check path/to/CLAUDE.md"
|
|
32
32
|
);
|
|
33
33
|
process.exit(1);
|
|
34
34
|
}
|
package/lib/cli/init.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
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
|
|
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)"
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
});
|
package/lib/cli/pipeline.js
CHANGED
package/lib/cli/refine.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** wwa refine — extract refinement report from session history. */
|
|
2
2
|
|
|
3
3
|
import { readFileSync, existsSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { findSessionLog } from "./helpers.js";
|
|
@@ -15,7 +15,7 @@ export function register(program) {
|
|
|
15
15
|
if (!sessionLog) {
|
|
16
16
|
console.error(
|
|
17
17
|
"No SESSION-LOG.md found in current directory.\n" +
|
|
18
|
-
"Specify a path: npx
|
|
18
|
+
"Specify a path: npx wwa refine path/to/SESSION-LOG.md"
|
|
19
19
|
);
|
|
20
20
|
process.exit(1);
|
|
21
21
|
}
|
|
@@ -135,7 +135,7 @@ function generateRefinementReport(parsed) {
|
|
|
135
135
|
const lines = [
|
|
136
136
|
`# Refinement Report: ${project}`,
|
|
137
137
|
"",
|
|
138
|
-
"Auto-generated from SESSION-LOG.md by `
|
|
138
|
+
"Auto-generated from SESSION-LOG.md by `wwa refine`.",
|
|
139
139
|
"",
|
|
140
140
|
"## Source",
|
|
141
141
|
"",
|