@haaaiawd/anws 1.2.4 → 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.
Files changed (71) hide show
  1. package/README.md +208 -173
  2. package/bin/cli.js +22 -9
  3. package/lib/adapters/index.js +157 -0
  4. package/lib/agents.js +185 -0
  5. package/lib/changelog.js +187 -0
  6. package/lib/copy.js +72 -1
  7. package/lib/diff.js +270 -0
  8. package/lib/init.js +238 -174
  9. package/lib/install-state.js +195 -0
  10. package/lib/manifest.js +184 -42
  11. package/lib/output.js +185 -13
  12. package/lib/prompt.js +284 -0
  13. package/lib/resources/index.js +27 -0
  14. package/lib/update.js +355 -149
  15. package/package.json +10 -6
  16. package/templates/.agents/skills/concept-modeler/SKILL.md +176 -0
  17. package/templates/{.agent → .agents}/skills/design-reviewer/SKILL.md +6 -6
  18. package/templates/.agents/skills/nexus-mapper/SKILL.md +306 -0
  19. package/templates/.agents/skills/nexus-mapper/references/language-customization.md +164 -0
  20. package/templates/.agents/skills/nexus-mapper/references/output-schema.md +298 -0
  21. package/templates/.agents/skills/nexus-mapper/references/probe-protocol.md +246 -0
  22. package/templates/.agents/skills/nexus-mapper/scripts/extract_ast.py +706 -0
  23. package/templates/.agents/skills/nexus-mapper/scripts/git_detective.py +194 -0
  24. package/templates/.agents/skills/nexus-mapper/scripts/languages.json +127 -0
  25. package/templates/.agents/skills/nexus-mapper/scripts/query_graph.py +556 -0
  26. package/templates/.agents/skills/nexus-mapper/scripts/requirements.txt +6 -0
  27. package/templates/{.agent → .agents}/skills/report-template/SKILL.md +11 -14
  28. package/templates/.agents/skills/report-template/references/REPORT_TEMPLATE.md +100 -0
  29. package/templates/{.agent → .agents}/skills/runtime-inspector/SKILL.md +1 -1
  30. package/templates/.agents/skills/sequential-thinking/SKILL.md +166 -0
  31. package/templates/.agents/skills/spec-writer/SKILL.md +108 -0
  32. package/templates/{.agent → .agents}/skills/spec-writer/references/prd_template.md +1 -1
  33. package/templates/{.agent → .agents}/skills/system-architect/SKILL.md +3 -3
  34. package/templates/.agents/skills/system-architect/references/rfc_template.md +59 -0
  35. package/templates/{.agent → .agents}/skills/system-designer/SKILL.md +6 -6
  36. package/templates/{.agent → .agents}/skills/system-designer/references/system-design-template.md +75 -25
  37. package/templates/{.agent → .agents}/skills/task-planner/SKILL.md +1 -1
  38. package/templates/.agents/skills/task-planner/references/TASK_TEMPLATE.md +144 -0
  39. package/templates/{.agent → .agents}/skills/task-reviewer/SKILL.md +4 -3
  40. package/templates/{.agent → .agents}/skills/tech-evaluator/SKILL.md +2 -2
  41. package/templates/{.agent → .agents}/skills/tech-evaluator/references/ADR_TEMPLATE.md +10 -0
  42. package/templates/{.agent → .agents}/workflows/blueprint.md +38 -33
  43. package/templates/{.agent → .agents}/workflows/challenge.md +21 -15
  44. package/templates/{.agent → .agents}/workflows/change.md +24 -15
  45. package/templates/{.agent → .agents}/workflows/craft.md +9 -20
  46. package/templates/{.agent → .agents}/workflows/design-system.md +83 -56
  47. package/templates/{.agent → .agents}/workflows/explore.md +6 -19
  48. package/templates/{.agent → .agents}/workflows/forge.md +36 -38
  49. package/templates/{.agent → .agents}/workflows/genesis.md +76 -64
  50. package/templates/.agents/workflows/probe.md +168 -0
  51. package/templates/{.agent → .agents}/workflows/quickstart.md +7 -12
  52. package/templates/.agents/workflows/upgrade.md +192 -0
  53. package/templates/AGENTS.md +134 -113
  54. package/templates/.agent/skills/build-inspector/SKILL.md +0 -83
  55. package/templates/.agent/skills/complexity-guard/SKILL.md +0 -71
  56. package/templates/.agent/skills/complexity-guard/references/anti_patterns.md +0 -21
  57. package/templates/.agent/skills/concept-modeler/SKILL.md +0 -112
  58. package/templates/.agent/skills/concept-modeler/prompts/GLOSSARY_PROMPT.md +0 -40
  59. package/templates/.agent/skills/concept-modeler/references/ENTITY_EXTRACTION_PROMPT.md +0 -299
  60. package/templates/.agent/skills/concept-modeler/scripts/glossary_gen.py +0 -66
  61. package/templates/.agent/skills/git-forensics/SKILL.md +0 -74
  62. package/templates/.agent/skills/git-forensics/references/ANALYSIS_METHODOLOGY.md +0 -193
  63. package/templates/.agent/skills/git-forensics/scripts/__pycache__/git_forensics.cpython-313.pyc +0 -0
  64. package/templates/.agent/skills/git-forensics/scripts/git_forensics.py +0 -615
  65. package/templates/.agent/skills/git-forensics/scripts/git_hotspots.py +0 -118
  66. package/templates/.agent/skills/report-template/references/REPORT_TEMPLATE.md +0 -100
  67. package/templates/.agent/skills/spec-writer/SKILL.md +0 -108
  68. package/templates/.agent/skills/system-architect/references/rfc_template.md +0 -59
  69. package/templates/.agent/skills/task-planner/references/TASK_TEMPLATE.md +0 -144
  70. package/templates/.agent/workflows/scout.md +0 -139
  71. /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="200" alt="Antigravity Workflow System">
3
+ <img src="assets/logo-cli.png" width="260" alt="Anws">
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
- [![Target: Antigravity](https://img.shields.io/badge/Environment-Antigravity-blueviolet)](https://github.com/google-deepmind/antigravity)
7
- [![Vibe Coding](https://img.shields.io/badge/Vibe%20Coding-Enabled-ff69b4)](https://github.com/karpathy/vibe-coding)
6
+ [![Version](https://img.shields.io/badge/version-v2.0.0-7FB5B6)](https://github.com/Haaaiawd/Anws/releases)
7
+ [![Targets](https://img.shields.io/badge/Targets-Windsurf%20%7C%20Claude%20Code%20%7C%20Copilot%20%7C%20Cursor%20%7C%20Codex%20Preview%20%7C%20OpenCode-blueviolet)](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
- ## ⚡ What is this?
15
+ # Anws
16
16
 
17
- A **structured workflow framework** for Agentic AI assistants, designed to solve the core pain points of the Vibe Coding era.
17
+ **Anws** is a spec-driven workflow framework for AI-assisted software development.
18
18
 
19
- > 💡 **TL;DR**: Stop letting AI write spaghetti code. Force it to think like an architect first.
19
+ It gives coding agents a disciplined path:
20
20
 
21
- ### 🎯 Problems We Solve
21
+ `PRD -> Architecture -> ADR -> Tasks -> Review -> Code -> Upgrade`
22
22
 
23
- | Pain Point | The Problem | Our Solution |
24
- | ---------------------- | ----------------------------------------------------------- | -------------------------------------------------------------- |
25
- | **Architecture Drift** | AI generates inconsistent patterns across the same codebase | `/genesis` forces PRD & architecture design first |
26
- | **Spaghetti Code** | AI lacks project context, writes code that doesn't fit | Tasks include constraints & acceptance criteria |
27
- | **Context Amnesia** | New session = AI forgets all previous decisions | `.agent/rules/agents.md` + versioned docs as persistent memory |
28
- | **Lack of Planning** | Vibe Coding skips design, creates tech debt | Mandatory design-first workflow |
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
- ## 🚀 Quick Start
108
+ ## Quick Start
33
109
 
34
- ### Option A npm CLI (Recommended)
110
+ ### Install via npm
35
111
 
36
112
  ```bash
37
113
  npm install -g @haaaiawd/anws
@@ -39,218 +115,177 @@ cd your-project
39
115
  anws init
40
116
  ```
41
117
 
42
- > Requires Node.js ≥ 18.
118
+ - **Requirement**
119
+ - Node.js `>= 18`
43
120
 
44
- ### Option B — GitHub Release
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
- Download the latest `.zip` from [Releases](https://github.com/Haaaiawd/Antigravity-Workflow-System/releases), then copy `.agent/` to your project root.
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
- > `anws update` overwrites all managed workflow/skill files to the latest version while **preserving** your `agents.md`.
56
- > If the `agents.md` template has new content, an `agents.md.new` file will be generated for you to merge manually.
132
+ - **Preview mode**
133
+ - `anws update --check` previews grouped diffs without writing files
57
134
 
58
- ### Your First Project 🐣
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
- > **The easiest way to start**: Just run the `/quickstart` command! The AI will automatically analyze your project state and guide you step-by-step through the entire lifecycle (from `/genesis` to `/forge`).
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
- **Looking for inspiration? Alternative prompt**: "I want to build a web-based macOS simulator, including Dock, top bar, and several system apps. Please start this new project from scratch according to the development process."
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
- ### 🔁 Built with Itself (Dogfooding)
148
+ - **Upgrade record**
149
+ - every successful update refreshes `.anws/changelog/`
150
+ - target state is written back to `.anws/install-lock.json`
65
151
 
66
- Fun fact: **This very CLI tool (`anws`) was built using its own workflows!**
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
- **Deep Thinking & Architecture Design**: The AI will automatically execute the `/genesis` workflow, thinking deeply about project requirements and producing the PRD and architecture design.
70
- <img src="assets/genesis工作流演示.jpg" width="800" alt="Genesis Workflow">
154
+ ## Migration Notes for Existing Users
71
155
 
72
- **Interactive Requirement Alignment**: The AI will ask follow-up questions for ambiguous requirements to ensure the design matches your intuition.
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
- **Autonomous Task Breakdown & Execution**: The AI will autonomously call necessary Skills (e.g., `spec-writer`, `task-planner`, etc.) to complete documentation and task decomposition.
76
- <img src="assets/自主调用skills.jpg" width="800" alt="Skills Execution">
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
- ## 🗺️ Decision Flowchart
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
- ## 🔑 Core Principles
171
+ ## Compatibility
122
172
 
123
- ### 1. Versioned Architecture
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
- - `genesis/v1` `genesis/v2` on major changes
127
- - Full traceability of decisions
128
- - No "it was always like this" mystery
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
- ### 2. Deep Thinking First
131
- > AI must think before it writes.
185
+ ---
132
186
 
133
- - Workflows force multi-step reasoning via `sequentialthinking`
134
- - `[!IMPORTANT]` blocks as guardrails
135
- - No shallow, scan-and-output responses
187
+ ## Recommended Workflow
136
188
 
137
- ### 3. Filesystem as Memory
138
- > Chat is ephemeral. Files are eternal.
189
+ Use Anws as a lifecycle, not just a folder pack.
139
190
 
140
- - `AGENTS.md` = AI's anchor
141
- - Architecture docs = persistent decisions
142
- - New session recovery in 30 seconds
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
- ## 📋 Workflows
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
- ## 🛠️ Compatibility & Prerequisites
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
- > ⚠️ **Important**: This framework requires **Antigravity** environment with `.agent/workflows/` support.
215
+ ### 2. Filesystem as Memory
166
216
 
167
- | Environment | Status | Notes |
168
- | --------------- | :--------------------------: | ------------------------------ |
169
- | **Antigravity** | ✅ Supported | Full workflow + skills support |
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
- **What is Antigravity?**
221
+ ### 3. Thinking Before Coding
175
222
 
176
- Antigravity is an Agentic AI coding environment that natively recognizes `.agent/workflows/` directory and can execute slash commands like `/genesis`, `/blueprint`, etc.
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
- ### 🔌 Required: Sequential Thinking MCP Server
227
+ ---
179
228
 
180
- This framework uses `sequentialthinking` for deep reasoning. Install it via MCP Store:
229
+ ## Project Layout
181
230
 
182
- 1. Open **Antigravity Editor**
183
- 2. Click **"..."** (three dots) in the sidebar → **Additional Options**
184
- 3. Select **MCP Servers**
185
- 4. Open **MCP Store** and search for `sequential-thinking`
186
- 5. Click **Add** to install
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
- > 💡 Without this, workflows still work, but deep thinking features will be limited.
254
+ > One source model. Multiple target layouts. Explicit ownership on disk.
189
255
 
190
256
  ---
191
257
 
192
- ## Invoke Workflows
258
+ ## Built with Itself
193
259
 
194
- Antigravity will automatically recognize the intent and trigger the appropriate workflow. You can use it in two ways:
260
+ Anws is dogfooded on its own development.
195
261
 
196
- #### Method A: Slash Protocol (Explicit)
197
- Directly type the command in the chat or editor to trigger the workflow.
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
- #### 🧠 Method B: Intent Protocol (Implicit)
203
- Just speak naturally. Antigravity will automatically select and run the right workflow.
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
- ## 📁 Project Structure
271
+ This repository is both the product and a working reference implementation.
214
272
 
215
- ```
216
- your-project/
217
- ├── .agent/
218
- │ ├── rules/
219
- │ │ └── agents.md # 🧠 AI's anchor point
220
- │ ├── workflows/ # Workflow definitions
221
- │ │ ├── genesis.md
222
- │ │ ├── scout.md
223
- │ │ ├── design-system.md
224
- │ │ ├── challenge.md
225
- │ │ ├── blueprint.md
226
- │ │ ├── forge.md
227
- │ │ ├── change.md
228
- │ │ ├── explore.md
229
- │ │ └── craft.md
230
- │ │
231
- │ └── skills/ # Reusable skills
232
- │ ├── concept-modeler/
233
- │ ├── spec-writer/
234
- │ ├── task-planner/
235
- │ └── ...
236
-
237
- └── genesis/ # Versioned architecture docs
238
- ├── v1/
239
- │ ├── 01_PRD.md
240
- │ ├── 02_ARCHITECTURE.md
241
- │ ├── 03_ADR/
242
- │ ├── 05_TASKS.md
243
- │ └── 07_CHALLENGE_REPORT.md
244
- └── v2/ # New version on major changes
245
- ```
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">
246
281
 
247
- ## 🙌 Contributing
282
+ ## Contributing
248
283
 
249
- Contributions are welcome! Please read our contributing guidelines before submitting PRs.
284
+ Contributions are welcome. Before opening a PR, make sure changes align with the spec-driven workflow and the target projection model.
250
285
 
251
286
  ---
252
287
 
253
- ## 📜 License
288
+ ## License
254
289
 
255
290
  [MIT](LICENSE) © 2026
256
291
 
@@ -260,6 +295,6 @@ Contributions are welcome! Please read our contributing guidelines before submit
260
295
 
261
296
  **Made for architects who code, and AIs who think.**
262
297
 
263
- 🧠 *"Good architecture isn't written. It's designed."*
298
+ *Good architecture isn't written. It's designed.*
264
299
 
265
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 { error, info, logo } = require('../lib/output');
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 Copy .agent/ workflow system into the current project
20
- update Update managed .agent/ files to the latest version
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 # Set up workflow system in current directory
28
- anws update # Update existing workflow files to latest
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
- process.stdout.write(HELP);
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: