@haaaiawd/anws 1.2.5 → 2.0.0
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 +208 -172
- package/bin/cli.js +22 -9
- package/lib/adapters/index.js +157 -0
- package/lib/agents.js +136 -1
- package/lib/changelog.js +187 -0
- package/lib/copy.js +72 -1
- package/lib/diff.js +270 -0
- package/lib/init.js +143 -125
- package/lib/install-state.js +195 -0
- package/lib/manifest.js +184 -42
- package/lib/output.js +185 -13
- package/lib/prompt.js +284 -0
- package/lib/resources/index.js +27 -0
- package/lib/update.js +291 -83
- package/package.json +10 -6
- package/templates/.agents/skills/concept-modeler/SKILL.md +176 -0
- package/templates/{.agent → .agents}/skills/design-reviewer/SKILL.md +6 -6
- package/templates/.agents/skills/nexus-mapper/SKILL.md +306 -0
- package/templates/.agents/skills/nexus-mapper/references/language-customization.md +164 -0
- package/templates/.agents/skills/nexus-mapper/references/output-schema.md +298 -0
- package/templates/.agents/skills/nexus-mapper/references/probe-protocol.md +246 -0
- package/templates/.agents/skills/nexus-mapper/scripts/extract_ast.py +706 -0
- package/templates/.agents/skills/nexus-mapper/scripts/git_detective.py +194 -0
- package/templates/.agents/skills/nexus-mapper/scripts/languages.json +127 -0
- package/templates/.agents/skills/nexus-mapper/scripts/query_graph.py +556 -0
- package/templates/.agents/skills/nexus-mapper/scripts/requirements.txt +6 -0
- package/templates/{.agent → .agents}/skills/report-template/SKILL.md +11 -14
- package/templates/.agents/skills/report-template/references/REPORT_TEMPLATE.md +100 -0
- package/templates/{.agent → .agents}/skills/runtime-inspector/SKILL.md +1 -1
- package/templates/.agents/skills/sequential-thinking/SKILL.md +166 -0
- package/templates/.agents/skills/spec-writer/SKILL.md +108 -0
- package/templates/{.agent → .agents}/skills/spec-writer/references/prd_template.md +1 -1
- package/templates/{.agent → .agents}/skills/system-architect/SKILL.md +3 -3
- package/templates/.agents/skills/system-architect/references/rfc_template.md +59 -0
- package/templates/{.agent → .agents}/skills/system-designer/SKILL.md +6 -6
- package/templates/{.agent → .agents}/skills/system-designer/references/system-design-template.md +75 -25
- package/templates/{.agent → .agents}/skills/task-planner/SKILL.md +1 -1
- package/templates/.agents/skills/task-planner/references/TASK_TEMPLATE.md +144 -0
- package/templates/{.agent → .agents}/skills/task-reviewer/SKILL.md +4 -3
- package/templates/{.agent → .agents}/skills/tech-evaluator/SKILL.md +2 -2
- package/templates/{.agent → .agents}/skills/tech-evaluator/references/ADR_TEMPLATE.md +10 -0
- package/templates/{.agent → .agents}/workflows/blueprint.md +32 -27
- package/templates/{.agent → .agents}/workflows/challenge.md +21 -15
- package/templates/{.agent → .agents}/workflows/change.md +23 -14
- package/templates/{.agent → .agents}/workflows/craft.md +8 -19
- package/templates/{.agent → .agents}/workflows/design-system.md +81 -54
- package/templates/{.agent → .agents}/workflows/explore.md +6 -19
- package/templates/{.agent → .agents}/workflows/forge.md +30 -32
- package/templates/{.agent → .agents}/workflows/genesis.md +68 -56
- package/templates/.agents/workflows/probe.md +168 -0
- package/templates/{.agent → .agents}/workflows/quickstart.md +7 -12
- package/templates/.agents/workflows/upgrade.md +192 -0
- package/templates/AGENTS.md +66 -45
- package/templates/.agent/skills/build-inspector/SKILL.md +0 -83
- package/templates/.agent/skills/complexity-guard/SKILL.md +0 -71
- package/templates/.agent/skills/complexity-guard/references/anti_patterns.md +0 -21
- package/templates/.agent/skills/concept-modeler/SKILL.md +0 -112
- package/templates/.agent/skills/concept-modeler/prompts/GLOSSARY_PROMPT.md +0 -40
- package/templates/.agent/skills/concept-modeler/references/ENTITY_EXTRACTION_PROMPT.md +0 -299
- package/templates/.agent/skills/concept-modeler/scripts/glossary_gen.py +0 -66
- package/templates/.agent/skills/git-forensics/SKILL.md +0 -74
- package/templates/.agent/skills/git-forensics/references/ANALYSIS_METHODOLOGY.md +0 -193
- package/templates/.agent/skills/git-forensics/scripts/__pycache__/git_forensics.cpython-313.pyc +0 -0
- package/templates/.agent/skills/git-forensics/scripts/git_forensics.py +0 -615
- package/templates/.agent/skills/git-forensics/scripts/git_hotspots.py +0 -118
- package/templates/.agent/skills/report-template/references/REPORT_TEMPLATE.md +0 -100
- package/templates/.agent/skills/spec-writer/SKILL.md +0 -108
- package/templates/.agent/skills/system-architect/references/rfc_template.md +0 -59
- package/templates/.agent/skills/task-planner/references/TASK_TEMPLATE.md +0 -144
- package/templates/.agent/workflows/scout.md +0 -139
- /package/templates/{.agent → .agents}/skills/system-designer/references/system-design-detail-template.md +0 -0
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="assets/logo.png" width="
|
|
3
|
+
<img src="assets/logo-cli.png" width="260" alt="Anws">
|
|
4
4
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://github.com/Haaaiawd/Anws/releases)
|
|
7
|
+
[](https://github.com/Haaaiawd/Anws)
|
|
8
8
|
|
|
9
9
|
[English](./README.md) | [中文](./README_CN.md)
|
|
10
10
|
|
|
@@ -12,26 +12,102 @@
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
# Anws
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
**Anws** is a spec-driven workflow framework for AI-assisted software development.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
It gives coding agents a disciplined path:
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
`PRD -> Architecture -> ADR -> Tasks -> Review -> Code -> Upgrade`
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
Instead of letting AI jump straight into implementation, Anws forces design, preserves context in files, and projects the right workflow assets into the native layout of your target AI IDE.
|
|
24
|
+
|
|
25
|
+
> **TL;DR**: stop treating AI like an autocomplete toy. Give it architecture, constraints, and a lifecycle.
|
|
26
|
+
|
|
27
|
+
## ANWS
|
|
28
|
+
|
|
29
|
+
- **Axiom** — principle before implementation
|
|
30
|
+
- **Nexus** — connection before fragmentation
|
|
31
|
+
- **Weave** — coherence before accumulation
|
|
32
|
+
- **Sovereignty** — human judgment before automation
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Why Anws Exists
|
|
37
|
+
|
|
38
|
+
Modern AI coding sessions fail in predictable ways:
|
|
39
|
+
|
|
40
|
+
- **Architecture drift**
|
|
41
|
+
- different sessions generate incompatible structures
|
|
42
|
+
|
|
43
|
+
- **Context amnesia**
|
|
44
|
+
- a fresh chat loses system decisions, trade-offs, and task state
|
|
45
|
+
|
|
46
|
+
- **Planning collapse**
|
|
47
|
+
- code gets written before requirements and interfaces are stabilized
|
|
48
|
+
|
|
49
|
+
- **Unsafe upgrades**
|
|
50
|
+
- workflow files change over time, but existing projects cannot be updated cleanly
|
|
51
|
+
|
|
52
|
+
Anws addresses those problems with:
|
|
53
|
+
|
|
54
|
+
- **Versioned architecture docs** under `.anws/v{N}/`
|
|
55
|
+
- **A root anchor file** via `AGENTS.md`
|
|
56
|
+
- **Workflow-first execution** instead of prompt-only improvisation
|
|
57
|
+
- **Controlled update semantics** for `AGENTS.md`, installed targets, and upgrade history
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## What's New in v2.0.0
|
|
62
|
+
|
|
63
|
+
`v2.0.0` is a **major release**. It is not just a template refresh; it upgrades the project protocol.
|
|
64
|
+
|
|
65
|
+
- **Unified architecture root**
|
|
66
|
+
- move from split legacy roots to `.anws/`
|
|
67
|
+
- standardize versioned docs and changelog storage
|
|
68
|
+
|
|
69
|
+
- **Controlled `AGENTS.md` updates**
|
|
70
|
+
- marker-based merge for modern files
|
|
71
|
+
- automatic migration for recognized legacy files
|
|
72
|
+
- safe preservation for unrecognized legacy files
|
|
73
|
+
|
|
74
|
+
- **Multi-target projection model**
|
|
75
|
+
- one canonical source
|
|
76
|
+
- multiple target IDE layouts
|
|
77
|
+
- no fake sharing of physical files across targets
|
|
78
|
+
|
|
79
|
+
- **Codex projection strategy update**
|
|
80
|
+
- Codex is now treated as **Preview**
|
|
81
|
+
- because Codex prompts are no longer available, Anws now packages workflow guidance into `.codex/skills/anws-system/`
|
|
82
|
+
- `/quickstart` maps to `SKILL.md`
|
|
83
|
+
- the rest of the workflow docs are exposed as `references/*.md` under the same aggregated skill
|
|
84
|
+
|
|
85
|
+
- **OpenCode support**
|
|
86
|
+
- adds native projection support for `.opencode/commands/` and `.opencode/skills/`
|
|
87
|
+
- `init`, `update`, manifest ownership, drift detection, and diff flows all understand OpenCode
|
|
88
|
+
|
|
89
|
+
- **Stronger `anws update` semantics**
|
|
90
|
+
- install-lock aware
|
|
91
|
+
- directory-scan fallback
|
|
92
|
+
- drift detection
|
|
93
|
+
- target-by-target update summary
|
|
94
|
+
|
|
95
|
+
- **Built-in ecosystem integration**
|
|
96
|
+
- integrates `nexus-skills`
|
|
97
|
+
- adopts `nexus-mapper` as the structural analysis backbone for `/probe`
|
|
98
|
+
- completes the workflow rename from legacy `/scout` to `/probe`
|
|
99
|
+
|
|
100
|
+
- **Branded CLI experience**
|
|
101
|
+
- unified logo
|
|
102
|
+
- confirmation UI
|
|
103
|
+
- changelog generation
|
|
104
|
+
- release-oriented terminal output
|
|
29
105
|
|
|
30
106
|
---
|
|
31
107
|
|
|
32
|
-
##
|
|
108
|
+
## Quick Start
|
|
33
109
|
|
|
34
|
-
###
|
|
110
|
+
### Install via npm
|
|
35
111
|
|
|
36
112
|
```bash
|
|
37
113
|
npm install -g @haaaiawd/anws
|
|
@@ -39,217 +115,177 @@ cd your-project
|
|
|
39
115
|
anws init
|
|
40
116
|
```
|
|
41
117
|
|
|
42
|
-
|
|
118
|
+
- **Requirement**
|
|
119
|
+
- Node.js `>= 18`
|
|
43
120
|
|
|
44
|
-
|
|
121
|
+
- **Install behavior**
|
|
122
|
+
- `anws init` installs one or more target projections into their native folders
|
|
123
|
+
- example: `anws init --target windsurf,opencode`
|
|
45
124
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### 📦 Update Existing Installation
|
|
125
|
+
### Update an Existing Project
|
|
49
126
|
|
|
50
127
|
```bash
|
|
51
128
|
cd your-project
|
|
52
129
|
anws update
|
|
53
130
|
```
|
|
54
131
|
|
|
55
|
-
|
|
56
|
-
|
|
132
|
+
- **Preview mode**
|
|
133
|
+
- `anws update --check` previews grouped diffs without writing files
|
|
57
134
|
|
|
58
|
-
|
|
135
|
+
- **State source**
|
|
136
|
+
- `anws update` reads `.anws/install-lock.json`
|
|
137
|
+
- if the lock is missing or invalid, it falls back to directory scan
|
|
59
138
|
|
|
60
|
-
|
|
139
|
+
- **`AGENTS.md` behavior**
|
|
140
|
+
- marker-based file -> update stable sections, preserve `AUTO` block
|
|
141
|
+
- recognized legacy file -> migrate into new marker-based structure
|
|
142
|
+
- unrecognized legacy file -> warn and preserve unchanged
|
|
61
143
|
|
|
62
|
-
|
|
144
|
+
- **Legacy migration**
|
|
145
|
+
- if a project still has `.agent/`, the CLI can guide migration to `.agents/`
|
|
146
|
+
- after successful migration, interactive mode can also ask whether to delete the old `.agent/`
|
|
63
147
|
|
|
64
|
-
|
|
148
|
+
- **Upgrade record**
|
|
149
|
+
- every successful update refreshes `.anws/changelog/`
|
|
150
|
+
- target state is written back to `.anws/install-lock.json`
|
|
65
151
|
|
|
66
|
-
|
|
67
|
-
We used the `/genesis` workflow to design the CLI's architecture, and the `/forge` workflow to implement the code. This project serves as a live demonstration of what Antigravity Workflow System can achieve.
|
|
152
|
+
---
|
|
68
153
|
|
|
69
|
-
|
|
70
|
-
<img src="assets/genesis工作流演示.jpg" width="800" alt="Genesis Workflow">
|
|
154
|
+
## Migration Notes for Existing Users
|
|
71
155
|
|
|
72
|
-
|
|
73
|
-
<img src="assets/与人类交互确认细节.jpg" width="800" alt="Human Interaction">
|
|
156
|
+
If you used older Anws / Antigravity layouts, `v2.0.0` matters because:
|
|
74
157
|
|
|
75
|
-
|
|
76
|
-
|
|
158
|
+
- **Directory protocol changed**
|
|
159
|
+
- old references to `genesis/` and `anws/changelog/` are replaced by `.anws/`
|
|
77
160
|
|
|
78
|
-
|
|
161
|
+
- **`AGENTS.md` is no longer “always skip”**
|
|
162
|
+
- it is now a controlled managed file with merge / migrate / preserve semantics
|
|
79
163
|
|
|
80
|
-
|
|
164
|
+
- **Target installation is explicit**
|
|
165
|
+
- Anws now models target IDEs as first-class projections
|
|
81
166
|
|
|
82
|
-
|
|
83
|
-
┌─────────────────┐
|
|
84
|
-
│ Where are you? │
|
|
85
|
-
└────────┬────────┘
|
|
86
|
-
┌─────────────────┼─────────────────┐
|
|
87
|
-
▼ ▼ ▼
|
|
88
|
-
┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
89
|
-
│ New │ │ Legacy │ │ Existing │
|
|
90
|
-
│ Project │ │ Takeover │ │ Change │
|
|
91
|
-
└────┬─────┘ └────┬─────┘ └────┬─────┘
|
|
92
|
-
│ │ │
|
|
93
|
-
▼ ▼ ▼
|
|
94
|
-
/genesis /scout Tweak existing task?
|
|
95
|
-
│ │ / \
|
|
96
|
-
│ │ / \
|
|
97
|
-
└────────┬────────┘ /change /genesis
|
|
98
|
-
│ (modify only) (new tasks)
|
|
99
|
-
▼ │ │
|
|
100
|
-
/design-system <--------+------------+
|
|
101
|
-
(optional, recommended)
|
|
102
|
-
|
|
|
103
|
-
v
|
|
104
|
-
/challenge
|
|
105
|
-
(design review)
|
|
106
|
-
|
|
|
107
|
-
v
|
|
108
|
-
/blueprint
|
|
109
|
-
|
|
|
110
|
-
v
|
|
111
|
-
/challenge
|
|
112
|
-
(task review)
|
|
113
|
-
|
|
|
114
|
-
v
|
|
115
|
-
/forge
|
|
116
|
-
(code delivery)
|
|
117
|
-
```
|
|
167
|
+
If you maintain old docs or release notes, update those references before publishing new project templates.
|
|
118
168
|
|
|
119
169
|
---
|
|
120
170
|
|
|
121
|
-
##
|
|
171
|
+
## Compatibility
|
|
122
172
|
|
|
123
|
-
|
|
124
|
-
> Don't "fix" architecture docs. **Evolve** them.
|
|
173
|
+
Anws keeps a **single canonical workflow / skill source**, then projects it into the native directory structure expected by each tool.
|
|
125
174
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
175
|
+
| Environment | Status | Layout |
|
|
176
|
+
| --- | --- | --- |
|
|
177
|
+
| **Windsurf** | ✅ Full Support | `.windsurf/workflows/` + `.windsurf/skills/` |
|
|
178
|
+
| **Antigravity** | ✅ Full Support | `.agents/workflows/` + `.agents/skills/` + `AGENTS.md` |
|
|
179
|
+
| **Claude Code** | ✅ Full Support | `.claude/commands/` |
|
|
180
|
+
| **GitHub Copilot** | ✅ Full Support | `.github/agents/` + `.github/prompts/` |
|
|
181
|
+
| **Cursor** | ✅ Supported | `.cursor/commands/` |
|
|
182
|
+
| **Codex** | ⚠️ Preview | `.codex/skills/anws-system/` + `.codex/skills/<skill>/` |
|
|
183
|
+
| **OpenCode** | ✅ Supported | `.opencode/commands/` + `.opencode/skills/` |
|
|
129
184
|
|
|
130
|
-
|
|
131
|
-
> AI must think before it writes.
|
|
185
|
+
---
|
|
132
186
|
|
|
133
|
-
|
|
134
|
-
- `[!IMPORTANT]` blocks as guardrails
|
|
135
|
-
- No shallow, scan-and-output responses
|
|
187
|
+
## Recommended Workflow
|
|
136
188
|
|
|
137
|
-
|
|
138
|
-
> Chat is ephemeral. Files are eternal.
|
|
189
|
+
Use Anws as a lifecycle, not just a folder pack.
|
|
139
190
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
-
|
|
191
|
+
| Command | Purpose | Input | Output |
|
|
192
|
+
| --- | --- | --- | --- |
|
|
193
|
+
| **`/quickstart`** | Route the user through the correct workflow path | Auto-detected state | Full orchestration |
|
|
194
|
+
| `/genesis` | Start from zero with PRD and architecture | Vague idea | PRD, architecture, ADRs |
|
|
195
|
+
| `/probe` | Analyze a legacy codebase before change | Existing code | Risk report |
|
|
196
|
+
| `/design-system` | Design one system in depth | Architecture overview | System design doc |
|
|
197
|
+
| `/challenge` | Review design or tasks with adversarial pressure | Docs / tasks | Challenge report |
|
|
198
|
+
| `/blueprint` | Break architecture into executable work | PRD + architecture | `05_TASKS.md` |
|
|
199
|
+
| `/forge` | Turn approved tasks into code | Tasks | Working implementation |
|
|
200
|
+
| `/change` | Modify an existing task only | Small scoped change | Updated task/design docs |
|
|
201
|
+
| `/explore` | Research ambiguous or strategic topics | Topic | Exploration report |
|
|
202
|
+
| `/craft` | Create workflows, skills, and prompts | Creation request | Reusable assets |
|
|
203
|
+
| `/upgrade` | Route post-update upgrade work | Update changelog | Change or genesis path |
|
|
143
204
|
|
|
144
205
|
---
|
|
145
206
|
|
|
146
|
-
##
|
|
147
|
-
|
|
148
|
-
| Command | Purpose | Input | Output |
|
|
149
|
-
| ----------------- | ------------------------------------------------------- | ----------------- | ------------------------------------------ |
|
|
150
|
-
| **`/quickstart`** | **One-command entry: orchestrates the whole lifecycle** | Auto-detected | Full pipeline orchestration |
|
|
151
|
-
| `/genesis` | Start from zero, create PRD & architecture | Vague idea | PRD, Architecture, ADRs |
|
|
152
|
-
| `/scout` | Analyze legacy codebase risks | Existing code | Risk report, Gap analysis |
|
|
153
|
-
| `/design-system` | Detailed design for a system | Architecture | System Design doc |
|
|
154
|
-
| `/challenge` | Review Design & Tasks (intelligent detection) | Full Docs / TASKS | Challenge Report (Graded) |
|
|
155
|
-
| `/blueprint` | Break architecture into tasks | PRD + Arch | TASKS.md (WBS) |
|
|
156
|
-
| `/forge` | Execute tasks — architecture to code | TASKS.md | Working code, verified |
|
|
157
|
-
| `/change` | Tweak existing tasks (no new tasks) | Minor tweak | Updated TASKS + Design files (modify only) |
|
|
158
|
-
| `/explore` | Deep research & brainstorm | Topic/Question | Exploration report |
|
|
159
|
-
| `/craft` | Create workflows/skills/prompts | Creation request | Workflow / Skill / Prompt docs |
|
|
207
|
+
## Core Principles
|
|
160
208
|
|
|
161
|
-
|
|
209
|
+
### 1. Versioned Architecture
|
|
162
210
|
|
|
163
|
-
|
|
211
|
+
- architecture is **evolved**, not silently edited
|
|
212
|
+
- major structural changes move from `.anws/v1` to `.anws/v2`
|
|
213
|
+
- ADRs preserve the reason behind the shape of the system
|
|
164
214
|
|
|
165
|
-
|
|
215
|
+
### 2. Filesystem as Memory
|
|
166
216
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
| Claude Code | ❌ No native workflow support | |
|
|
171
|
-
| Cursor | ❌ No workflow support | |
|
|
172
|
-
| GitHub Copilot | ❌ No workflow support | |
|
|
217
|
+
- `AGENTS.md` is the recovery anchor
|
|
218
|
+
- `.anws/v{N}/` stores durable architecture context
|
|
219
|
+
- `.anws/changelog/` records upgrade history for future sessions
|
|
173
220
|
|
|
174
|
-
|
|
221
|
+
### 3. Thinking Before Coding
|
|
175
222
|
|
|
176
|
-
|
|
223
|
+
- workflows force staged reasoning before implementation
|
|
224
|
+
- the built-in `sequential-thinking` skill standardizes deep analysis
|
|
225
|
+
- review steps exist to catch drift before code lands
|
|
177
226
|
|
|
178
|
-
|
|
227
|
+
---
|
|
179
228
|
|
|
180
|
-
|
|
229
|
+
## Project Layout
|
|
181
230
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
231
|
+
```bash
|
|
232
|
+
your-project/
|
|
233
|
+
├── .anws/
|
|
234
|
+
│ ├── install-lock.json
|
|
235
|
+
│ ├── changelog/
|
|
236
|
+
│ └── v{N}/
|
|
237
|
+
├── .windsurf/
|
|
238
|
+
│ ├── workflows/
|
|
239
|
+
│ └── skills/
|
|
240
|
+
├── .agents/
|
|
241
|
+
│ ├── workflows/
|
|
242
|
+
│ └── skills/
|
|
243
|
+
├── AGENTS.md
|
|
244
|
+
├── .cursor/commands/
|
|
245
|
+
├── .claude/commands/
|
|
246
|
+
├── .github/
|
|
247
|
+
│ ├── agents/
|
|
248
|
+
│ └── prompts/
|
|
249
|
+
└── .codex/
|
|
250
|
+
├── prompts/
|
|
251
|
+
└── skills/
|
|
252
|
+
```
|
|
187
253
|
|
|
188
|
-
>
|
|
254
|
+
> One source model. Multiple target layouts. Explicit ownership on disk.
|
|
189
255
|
|
|
190
256
|
---
|
|
191
257
|
|
|
192
|
-
##
|
|
258
|
+
## Built with Itself
|
|
193
259
|
|
|
194
|
-
|
|
260
|
+
Anws is dogfooded on its own development.
|
|
195
261
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
- `/genesis` - Start project creation
|
|
199
|
-
- `/scout` - Analyze existing codebase
|
|
200
|
-
- `/blueprint` - Break down architecture into tasks
|
|
262
|
+
- **Architecture design**
|
|
263
|
+
- the CLI itself was designed through `/genesis`
|
|
201
264
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
- *"I want to start a new project for a todo app"* → Triggers `/genesis`
|
|
205
|
-
- *"Help me understand this legacy code and its risks"* → Triggers `/scout`
|
|
206
|
-
- *"I think there are gaps in this design, challenge it"* → Triggers `/challenge`
|
|
207
|
-
- *"The architecture is ready, let's plan the tasks"* → Triggers `/blueprint`
|
|
208
|
-
- *"Change the error message on the login page"* → Triggers `/change` (tweak existing task)
|
|
209
|
-
- *"I need to add a back-to-top button"* → Triggers `/genesis` (requires new task)
|
|
265
|
+
- **Task decomposition**
|
|
266
|
+
- implementation work was planned through `/blueprint`
|
|
210
267
|
|
|
211
|
-
|
|
268
|
+
- **Execution**
|
|
269
|
+
- code and doc changes were driven through `/forge`
|
|
212
270
|
|
|
213
|
-
|
|
271
|
+
This repository is both the product and a working reference implementation.
|
|
214
272
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
│ │ ├── challenge.md
|
|
224
|
-
│ │ ├── blueprint.md
|
|
225
|
-
│ │ ├── forge.md
|
|
226
|
-
│ │ ├── change.md
|
|
227
|
-
│ │ ├── explore.md
|
|
228
|
-
│ │ └── craft.md
|
|
229
|
-
│ │
|
|
230
|
-
│ └── skills/ # Reusable skills
|
|
231
|
-
│ ├── concept-modeler/
|
|
232
|
-
│ ├── spec-writer/
|
|
233
|
-
│ ├── task-planner/
|
|
234
|
-
│ └── ...
|
|
235
|
-
│
|
|
236
|
-
└── genesis/ # Versioned architecture docs
|
|
237
|
-
├── v1/
|
|
238
|
-
│ ├── 01_PRD.md
|
|
239
|
-
│ ├── 02_ARCHITECTURE.md
|
|
240
|
-
│ ├── 03_ADR/
|
|
241
|
-
│ ├── 05_TASKS.md
|
|
242
|
-
│ └── 07_CHALLENGE_REPORT.md
|
|
243
|
-
└── v2/ # New version on major changes
|
|
244
|
-
```
|
|
273
|
+
**Deep Thinking & Architecture Design**
|
|
274
|
+
<img src="assets/genesis工作流演示.jpg" width="800" alt="Genesis Workflow">
|
|
275
|
+
|
|
276
|
+
**Interactive Requirement Alignment**
|
|
277
|
+
<img src="assets/与人类交互确认细节.jpg" width="800" alt="Human Interaction">
|
|
278
|
+
|
|
279
|
+
**Autonomous Skill Invocation**
|
|
280
|
+
<img src="assets/自主调用skills.jpg" width="800" alt="Skills Execution">
|
|
245
281
|
|
|
246
|
-
##
|
|
282
|
+
## Contributing
|
|
247
283
|
|
|
248
|
-
Contributions are welcome
|
|
284
|
+
Contributions are welcome. Before opening a PR, make sure changes align with the spec-driven workflow and the target projection model.
|
|
249
285
|
|
|
250
286
|
---
|
|
251
287
|
|
|
252
|
-
##
|
|
288
|
+
## License
|
|
253
289
|
|
|
254
290
|
[MIT](LICENSE) © 2026
|
|
255
291
|
|
|
@@ -259,6 +295,6 @@ Contributions are welcome! Please read our contributing guidelines before submit
|
|
|
259
295
|
|
|
260
296
|
**Made for architects who code, and AIs who think.**
|
|
261
297
|
|
|
262
|
-
|
|
298
|
+
*Good architecture isn't written. It's designed.*
|
|
263
299
|
|
|
264
300
|
</div>
|
package/bin/cli.js
CHANGED
|
@@ -3,29 +3,33 @@
|
|
|
3
3
|
|
|
4
4
|
const { parseArgs } = require('node:util');
|
|
5
5
|
const path = require('node:path');
|
|
6
|
-
const {
|
|
6
|
+
const { listTargets, getTarget } = require('../lib/adapters');
|
|
7
|
+
const { blank, error, info, logo } = require('../lib/output');
|
|
7
8
|
|
|
8
9
|
// ─── 版本号从 package.json 读取 ─────────────────────────────────────────────
|
|
9
10
|
const { version } = require(path.join(__dirname, '..', 'package.json'));
|
|
11
|
+
const TARGET_IDS = listTargets().map((target) => target.id);
|
|
10
12
|
|
|
11
13
|
// ─── 帮助文本 ─────────────────────────────────────────────────────────────────
|
|
12
14
|
const HELP = `
|
|
13
|
-
v${version} — Antigravity Workflow System
|
|
14
|
-
|
|
15
15
|
USAGE
|
|
16
16
|
anws <command> [options]
|
|
17
17
|
|
|
18
18
|
COMMANDS
|
|
19
|
-
init
|
|
20
|
-
update
|
|
19
|
+
init Install one or more target AI IDE workflow projections
|
|
20
|
+
update Scan installed targets from install-lock or directory layout and update them
|
|
21
21
|
|
|
22
22
|
OPTIONS
|
|
23
23
|
-v, --version Print version number
|
|
24
24
|
-h, --help Show this help message
|
|
25
|
+
--target Target AI IDE(s) for \`init\`, comma-separated (${TARGET_IDS.join(', ')})
|
|
26
|
+
--check Preview grouped update diffs without writing files or install-lock state
|
|
25
27
|
|
|
26
28
|
EXAMPLES
|
|
27
|
-
anws init
|
|
28
|
-
anws
|
|
29
|
+
anws init # Choose target IDEs and install their managed workflow projections
|
|
30
|
+
anws init --target windsurf,codex
|
|
31
|
+
anws update # Update all matched targets from install-lock or directory scan
|
|
32
|
+
anws update --check # Preview grouped changes per target without writing files
|
|
29
33
|
`.trimStart();
|
|
30
34
|
|
|
31
35
|
// ─── 参数解析 ─────────────────────────────────────────────────────────────────
|
|
@@ -35,6 +39,8 @@ const { values, positionals } = parseArgs({
|
|
|
35
39
|
version: { type: 'boolean', short: 'v', default: false },
|
|
36
40
|
help: { type: 'boolean', short: 'h', default: false },
|
|
37
41
|
yes: { type: 'boolean', short: 'y', default: false },
|
|
42
|
+
target: { type: 'string' },
|
|
43
|
+
check: { type: 'boolean', default: false },
|
|
38
44
|
},
|
|
39
45
|
strict: false,
|
|
40
46
|
allowPositionals: true,
|
|
@@ -44,6 +50,12 @@ if (values.yes) {
|
|
|
44
50
|
global.__ANWS_FORCE_YES = true;
|
|
45
51
|
}
|
|
46
52
|
|
|
53
|
+
if (values.target !== undefined) {
|
|
54
|
+
const targetIds = values.target.split(',').map((item) => item.trim()).filter(Boolean);
|
|
55
|
+
targetIds.forEach((targetId) => getTarget(targetId));
|
|
56
|
+
global.__ANWS_TARGET_IDS = Array.from(new Set(targetIds));
|
|
57
|
+
}
|
|
58
|
+
|
|
47
59
|
// ─── 命令路由 ─────────────────────────────────────────────────────────────────
|
|
48
60
|
async function main() {
|
|
49
61
|
if (values.version) {
|
|
@@ -53,7 +65,8 @@ async function main() {
|
|
|
53
65
|
|
|
54
66
|
if (values.help || positionals.length === 0) {
|
|
55
67
|
logo();
|
|
56
|
-
|
|
68
|
+
blank();
|
|
69
|
+
console.log(HELP.trimEnd());
|
|
57
70
|
process.exit(0);
|
|
58
71
|
}
|
|
59
72
|
|
|
@@ -65,7 +78,7 @@ async function main() {
|
|
|
65
78
|
break;
|
|
66
79
|
|
|
67
80
|
case 'update':
|
|
68
|
-
await require('../lib/update')();
|
|
81
|
+
await require('../lib/update')({ check: values.check });
|
|
69
82
|
break;
|
|
70
83
|
|
|
71
84
|
default:
|