aimship 0.1.0-preview.7 → 0.1.0-preview.9

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 (36) hide show
  1. package/CONTRIBUTING.md +52 -1
  2. package/README.md +120 -58
  3. package/README.zh-CN.md +120 -58
  4. package/docs/cli.md +32 -2
  5. package/docs/guide.md +187 -187
  6. package/docs/guide.zh-CN.md +187 -187
  7. package/docs/installation.md +12 -8
  8. package/lib/approvals.mjs +153 -0
  9. package/lib/cli.mjs +11 -7
  10. package/lib/delivery.mjs +76 -0
  11. package/lib/documents.mjs +5 -4
  12. package/lib/state.mjs +39 -9
  13. package/lib/view.mjs +13 -2
  14. package/package.json +1 -1
  15. package/skills/aimship/SKILL.md +3 -3
  16. package/skills/aimship/references/artifact-map.json +21 -12
  17. package/skills/aimship/references/core.md +25 -5
  18. package/skills/aimship/references/document-patterns.md +4 -2
  19. package/skills/aimship/references/document-review.md +28 -0
  20. package/skills/aimship/references/recovery.md +8 -0
  21. package/skills/aimship/references/sources-and-changes.md +2 -0
  22. package/skills/aimship/references/stages/contract.md +7 -3
  23. package/skills/aimship/references/stages/diagnose.md +4 -0
  24. package/skills/aimship/references/stages/handoff.md +2 -0
  25. package/skills/aimship/references/stages/plan.md +6 -2
  26. package/skills/aimship/references/stages/prototype.md +4 -0
  27. package/skills/aimship/references/stages/requirements.md +4 -0
  28. package/skills/aimship/references/stages/review.md +2 -0
  29. package/skills/aimship/references/stages/scope.md +4 -0
  30. package/skills/aimship/references/stages/tech-design.md +6 -2
  31. package/skills/aimship/references/stages/test-design.md +5 -1
  32. package/skills/aimship/references/templates/plan.md +1 -0
  33. package/skills/aimship/references/templates/prd.md +2 -0
  34. package/skills/aimship/references/templates/scope.md +2 -0
  35. package/skills/aimship/references/templates/tech-design.md +1 -0
  36. package/skills/aimship/references/templates/testing.md +1 -0
package/CONTRIBUTING.md CHANGED
@@ -12,13 +12,50 @@ Use GitHub Issues for bugs and feature suggestions. Provide the version, host de
12
12
 
13
13
  ## Documentation
14
14
 
15
- Users enter through the English/Chinese README and Guide. Keep both languages equivalent when changing installation, workflow or artifact rules. The Guide owns installation, usage, continuation, lifecycle and troubleshooting; old installation/example URLs retain short compatibility pointers. The [CLI protocol](docs/cli.md) serves agents and contributors.
15
+ The English/Chinese README introduces the software delivery workflow, its value and outputs, and owns installation, upgrades, host management, version/health queries and uninstallation. The Guide owns the annotated delivery directory and document overview, and explains usage by scenario: starting from an idea, adopting materials, changing existing code, reading results, changing requirements, continuing and completing delivery. Avoid generic prompt tutorials; a contextual continuation entry belongs in the Guide. Keep detailed artifact, stage and identifier rules in the bilingual [Guide appendix](docs/guide.md#document-details). Keep both languages equivalent. Put source development and isolated validation procedures here, and agent/tool details in the [CLI protocol](docs/cli.md). Old installation/example URLs retain short compatibility pointers rather than duplicate command instructions.
16
16
 
17
17
  Validate public links and the shared stage/template mapping with `npm run check:docs`. Treat [artifact-map.json](skills/aimship/references/artifact-map.json) and the [document rules](skills/aimship/references/document-patterns.md) as the mapping to check against; update user-facing explanations when that mapping changes.
18
18
 
19
+ <a id="isolated-installation-check"></a>
20
+ ## Isolated installation lifecycle check
21
+
22
+ This is a contributor check of a package's installer and fixed launcher, not a required user setup sequence. For source development, run `npm pack` from the checkout to obtain a local tarball. Use a new candidate version when distributed content changes; do not replace an already released or installed version with different contents.
23
+
24
+ Place the package in the current directory and replace `VERSION` below. This POSIX shell example creates a disposable home and npm cache, runs from a separate consumer directory so npm cannot select the source checkout, and removes its temporary files on exit. Capture stdout outside the temporary directory if you need to retain evidence.
25
+
26
+ ```sh
27
+ (
28
+ set -eu
29
+ package_file="file:$(pwd -P)/aimship-VERSION.tgz"
30
+ trial=$(mktemp -d)
31
+ trial=$(cd "$trial" && pwd -P)
32
+ trap 'rm -rf "$trial"' EXIT
33
+ mkdir "$trial/consumer"
34
+ cd "$trial/consumer"
35
+ run_package() {
36
+ npx --yes --offline --cache "$trial/npm-cache" "$package_file" "$@" --home "$trial/home"
37
+ }
38
+
39
+ run_package install --host codex
40
+ node "$trial/home/.aimship/bin/aimship.mjs" --version
41
+ node "$trial/home/.aimship/bin/aimship.mjs" status
42
+ run_package install --host cursor
43
+ run_package uninstall --host cursor
44
+ run_package status
45
+ run_package uninstall
46
+ run_package status
47
+ )
48
+ ```
49
+
50
+ Inspect the JSON results: installation should activate the package version; the fixed launcher should report that same installed version and healthy files; adding Cursor should retain Codex; disconnecting Cursor should retain Codex and the core; full uninstall should leave no active release or registered hosts. The two `node` calls deliberately exercise the installed launcher independently of npx. Delivery data, custom files, modified files and upgrade/recovery behavior require separate fixtures and assertions; this smoke check does not cover them.
51
+
52
+ `--home` redirects managed installation files only. It does not make a running host discover that home or grant directory permissions. Never replace the disposable home with a real user home for validation. A successful lifecycle check does not establish real host discovery or cross-host continuation.
53
+
19
54
  <a id="executable-examples"></a>
20
55
  ## Executable examples
21
56
 
57
+ The harness records explicitly labeled synthetic self-checks and approvals, exercises review stops before automatic continuation, and preserves CHG/reapproval history. These are deterministic tool checks, not real user decisions or host E2E evidence.
58
+
22
59
  From a source checkout, run:
23
60
 
24
61
  ```sh
@@ -31,3 +68,17 @@ The output directory must not exist. The harness creates isolated code and deliv
31
68
  - **Adopted, multiple batches:** preserved catalog PRD/prototype inputs, Scope mappings, shared price validation and quoting with each batch reviewed. A discount change keeps case v1 and adds v2, updates earlier review applicability and binds exact code hashes. A deliberate rounding fault produces a failed RUN, followed by repair review and a successful retest while retaining failure history. Shared business rules, role restrictions and performance requirements have independent identities and acceptance.
32
69
 
33
70
  These examples check local document/state behavior. They do not establish automatic Skill discovery, real cross-host continuation, UI interaction or HTTP acceptance. Run output records assertions and limitations. Results from older schemas do not establish current behavior.
71
+
72
+ ## Preview releases
73
+
74
+ The [Publish preview workflow](.github/workflows/publish-preview.yml) is manually dispatched in `clsx/aimship`. It does not publish on push. Review and commit the versioned source, run tests and documentation/package checks, push the default branch and an exact `vX.Y.Z-preview.N` tag, then select that same tag as both the workflow ref and its `tag` input. The tagged commit must contain the workflow and matching `package.json` version. For example, with the GitHub CLI:
75
+
76
+ ```sh
77
+ gh workflow run publish-preview.yml --repo clsx/aimship --ref vX.Y.Z-preview.N -f tag=vX.Y.Z-preview.N
78
+ ```
79
+
80
+ Validation runs on a GitHub-hosted runner without OIDC permission. It checks the release context, runs the full tests and documentation/package checks, and packs once. Every tarball member is compared with the source. The publishing job receives that exact artifact, rechecks its source and digest, and publishes `aimship` publicly to `https://registry.npmjs.org` with the `preview` tag. It verifies the downloaded bytes, provenance and unchanged `latest` tag. Actions and runner Node/npm versions are pinned in the workflow; these CI versions are not a replacement for the package's stated runtime requirements or a claim of cross-platform validation.
81
+
82
+ The npm package's trusted publisher must identify GitHub Actions, owner `clsx`, repository `aimship`, workflow filename `publish-preview.yml`, no environment, and allow direct `npm publish`. Staged publishing is not used. No long-lived npm token is stored. Only the publishing job has `id-token: write`; both jobs have `contents: read`. This is an ongoing publishing permission for that workflow, so changes to it deserve release-security review. A newly created npm trust must complete its first successful publication within npm's required window; see [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/).
83
+
84
+ On any uncertain publish result, inspect the registry and run logs before retrying. An existing version with different integrity stops the workflow; an identical version is verified without republishing. Missing provenance or unexpected dist-tags also stops verification rather than silently changing settings. Preserve the run URL, commit, artifact digest and registry outcome. Create the GitHub prerelease separately after successful npm verification, using the same tag and validated package; the publishing workflow has no repository write permission. Do not reuse a released version for changed package contents.
package/README.md CHANGED
@@ -2,89 +2,151 @@
2
2
 
3
3
  [中文](README.zh-CN.md) · [Guide](docs/guide.md)
4
4
 
5
- **A development workflow for AI coding tools, connecting requirements, implementation and verification.**
5
+ **A software delivery workflow for AI tools, connecting requirements, design, implementation, review and verification.**
6
6
 
7
- Aimship supports feature development, defect fixes, technical refactoring and solution design. It arranges stages around the delivery goal, maintains requirements, design, implementation and verification records, and supports continuation from existing materials.
7
+ For developers responsible for delivering a requirement. You provide the goal, existing materials and code locations. Aimship helps the agent turn them into a clear scope, a reasoned design, an implementation plan and verified results. It connects these stages so that you can follow the work, understand key decisions and assess what has actually been delivered.
8
8
 
9
- Each request has an independent delivery directory under `~/Aimship/`, while code remains in its repositories. A commission can cover the full development workflow or specific outputs such as requirements analysis or technical design.
9
+ <a id="what-a-delivery-contains"></a>
10
+ <a id="delivery-structure-and-documents"></a>
11
+ <a id="delivery-artifacts"></a>
12
+ Standard document outlines, identifiers and references connect requirements and acceptance criteria to designs, implementation tasks, reviews and test results. Documents are produced as needed for the delivery goal, giving you a consistent basis for review without requiring an empty template for every stage.
13
+
14
+ <a id="delivery-workflow"></a>
15
+ By default, you review documents individually after the agent's self-check. The agent presents current status, the document and review focus, then waits. After explicit approval is saved, work continues within the group; at a suggested session boundary it provides next work and a continuation entry, with the option to continue here; requested changes lead to revision, self-check and another review. Document approval remains separate from final delivery acceptance; an explicitly limited partial result is not presented as standard complete delivery.
16
+
17
+ Documents and state are saved throughout the work, keeping progress, decisions and verification evidence traceable and reducing the need to repeat background or reconstruct earlier work.
18
+
19
+ [Install](#install) · [Guide](docs/guide.md) · [Upgrade and AI tools](#update) · [Uninstall](#uninstall)
10
20
 
11
- ## Quick start
21
+ <a id="quick-start"></a>
22
+ <a id="install"></a>
23
+ ## Installation
12
24
 
13
- Requires **Node.js 22+ and npm**. Choose `codex`, `cursor` or `claude-code`:
25
+ Requires **Node.js 22+ and npm**. Command examples use a POSIX shell.
26
+
27
+ ### Published preview
14
28
 
15
29
  ```sh
16
30
  npx aimship@preview install --host codex
17
31
  ```
18
32
 
19
- Start a new host session and select Aimship: `$aimship` in Codex CLI, or `/aimship` in Cursor and Claude Code. Authorize access to the delivery folder and relevant repositories when needed, then describe the work:
33
+ Choose `codex`, `cursor` or `claude-code`. To connect several tools, repeat the option:
20
34
 
21
- > Use Aimship to add Excel export to the order list. The code is in my existing repository. Complete implementation and verification; leave deployment for later.
35
+ ```sh
36
+ npx aimship@preview install --host codex --host claude-code
37
+ ```
22
38
 
23
- The npm command installs the published preview channel. For a specific version, source checkout or local package, see the [installation instructions](docs/guide.md#install).
39
+ Confirm npm's package installation prompt. `@preview` selects the published preview channel; an exact published version, such as `@0.1.0-preview.7`, can be used instead. The preview channel is experimental and does not imply a stable release.
24
40
 
25
- One installation serves your projects and selected hosts. Host integrations are experimental: actual Skill discovery and cross-host continuation still need validation. See [host setup](docs/guide.md#hosts) if Aimship does not appear.
41
+ ### A specific version or local package
26
42
 
27
- ## Delivery workflow
43
+ To install an exact published version, for example:
28
44
 
29
- 1. **Establish the requirements.** Preserve original inputs, author a PRD or adopt existing requirements through Scope, and agree on the outcome and execution order.
30
- 2. **Prepare the work.** Produce the needed prototype, technical design, contracts, implementation plan and test cases.
31
- 3. **Implement and review.** Implement each batch and review it, then review the integrated change.
32
- 4. **Verify and hand off.** Execute the cases against the actual result, preserve failures and retests, and record the outcome and remaining work.
45
+ ```sh
46
+ npx aimship@0.1.0-preview.7 install --host codex
47
+ ```
33
48
 
34
- This outlines the development delivery process; not every request requires every stage. Design-only, review-only and verification-only commissions stop at their agreed endpoint. Ordinary debugging stays in the current workflow; a separate investigation stage is used only when explicitly arranged.
49
+ If you already have an Aimship `.tgz` package, replace `VERSION` with its actual version and run from the directory containing it:
35
50
 
36
- <a id="what-a-delivery-contains"></a>
37
- ## Delivery structure and documents
38
-
39
- **`status.md`** is the delivery overview, with the current stage, blockers, next actions and document links. The tree below lists delivery artifacts and their purposes. Files are generated according to the selected stages and input conditions; unselected stages produce no empty documents. `prd.md` and `scope.md` are alternative requirement entries, not two files required for every delivery.
40
-
41
- ```text
42
- ~/Aimship/
43
- ├── 20261023-order-export/ # One request, one delivery folder
44
- │ ├── status.md # Generated overview and reading entry
45
- │ ├── prd.md # Authored requirements, scope and acceptance
46
- │ ├── scope.md # Used instead of PRD when adopting authoritative inputs
47
- │ ├── tech-design.md # Architecture, changes, data, risks and requirement coverage
48
- │ ├── plan.md # Implementation batches, tasks and actual execution
49
- │ ├── testing.md # Test cases, coverage, runs and retest results
50
- │ ├── review.md # Batch/overall reviews, findings and follow-up
51
- │ ├── handoff.md # Delivered result, usage, validation and remaining work
52
- │ ├── diagnosis.md # Only for an independent investigation
53
- │ ├── change-log.md # Meaningful changes, decisions and affected work
54
- │ ├── openapi.yaml # New HTTP contract; reuse an existing authority when available
55
- │ ├── database.sql # SQL for one database; multiple targets use database-<id>.sql
56
- │ ├── prototype/ # Newly authored prototypes when required
57
- │ │ └── index.html # Entry for an HTML prototype; its assets stay here
58
- │ ├── source/ # Preserved original request and adopted input versions
59
- │ │ ├── request.md # Original commission or source entry
60
- │ │ └── … # External PRD, prototype, screenshots and other inputs
61
- │ └── .aimship/ # Managed state and supporting evidence
62
- │ ├── state.json # Stages, references, versions and repository/worktree links
63
- │ ├── state.previous.json # Previous state for recovery after writes
64
- │ ├── view.json # Metadata for the generated status view
65
- │ └── evidence/ # Evidence retained when needed
66
- └── 20261024-another-request/ # Independent request and progress
51
+ ```sh
52
+ npx --offline file:./aimship-VERSION.tgz install --host codex
67
53
  ```
68
54
 
69
- Formal documents are directly in the request folder. `source/` preserves adopted originals; `.aimship/` holds internal records. The software itself is installed separately in `~/.aimship/`.
55
+ Choose one installation method. No global npm installation, administrator privilege or npm login is required; the npm cache must be writable. For source development and isolated installation checks, see [Contributing](CONTRIBUTING.md#isolated-installation-check).
70
56
 
71
- Filenames, outlines and identifier rules come from shared templates. Requirements and acceptance criteria link to implementation tasks, reviews and versioned test cases/results. The [Guide](docs/guide.md#artifacts) explains exactly when each artifact is produced and what it contains.
57
+ ### Optional: choose a delivery material location
72
58
 
73
- ## Use cases and examples
59
+ The default delivery material root is `~/Aimship/`. On the first installation, use `--data-root` to choose another location:
74
60
 
75
- | Use case | Example request |
76
- | --- | --- |
77
- | Existing PRD and prototype | “Use these materials for order export. Preserve the originals and confirm the scope before implementation.” |
78
- | Feature requirements and design | “Help define notification preferences and produce a prototype and technical design. Stop before implementation.” |
79
- | Refactor | “Refactor the pricing module without changing observable behavior. Implement and verify it.” |
80
- | Investigate a failure | “Investigate this intermittent timeout and report the cause and evidence. Do not implement a fix yet.” |
61
+ ```sh
62
+ npx aimship@preview install --host codex --data-root "$HOME/MyDeliveries"
63
+ ```
64
+
65
+ This sets the default material location for new deliveries. It is not a code repository location and does not move existing materials. Later installations retain the configuration; no per-project installation is needed.
66
+
67
+ After installation, follow the [Guide](docs/guide.md#hosts) to select Aimship in your tool. AI tool integrations are experimental: actual Skill discovery and continuation across AI tools still need validation.
68
+
69
+ <a id="update"></a>
70
+ <a id="update-or-stop-using-aimship"></a>
71
+ <a id="upgrades-and-host-management"></a>
72
+ <a id="upgrades-and-ai-development-tools"></a>
73
+ ## Upgrades and AI tools
74
+
75
+ For the published preview channel:
76
+
77
+ ```sh
78
+ npx aimship@preview install
79
+ ```
80
+
81
+ Installation and upgrades use the same `install` command. Existing tool registrations, configuration, custom content and deliveries are retained. The installer reports previous/target versions, results and conflicts; no background updater or resident process runs. For a specific version or local package, use the [installation commands](#install) against the original installation home.
82
+
83
+ <a id="add-a-host"></a>
84
+ <a id="add-an-ai-development-tool"></a>
85
+ ### Add an AI tool
86
+
87
+ For example, connect Cursor after installing for Codex:
88
+
89
+ ```sh
90
+ npx aimship@preview install --host cursor
91
+ ```
81
92
 
82
- Independent deliveries can progress at the same time, with one writing session per delivery. When they share code, arrange sequential implementation or separate checkouts/worktrees. See [parallel work](docs/guide.md#parallel).
93
+ This retains existing tools and installs the selected preview version; it also upgrades the software if the preview channel has advanced. Then refresh the relevant session as described in [tool setup](docs/guide.md#hosts).
94
+
95
+ ### Check the installed version
96
+
97
+ ```sh
98
+ npx aimship@preview --version
99
+ ```
100
+
101
+ In the output, `installedActiveVersion` is the active installed version and `toolVersion` is the package npx is running. They may differ. This query does not upgrade the installation.
102
+
103
+ ### Check installation health
104
+
105
+ ```sh
106
+ npx aimship@preview status
107
+ ```
108
+
109
+ This checks the software installation, tool registrations and managed files, reporting health and pending problems. It cannot confirm that a tool loaded the Skill. For delivery progress, open that delivery's `status.md`.
110
+
111
+ These commands use npx to obtain and run the selected package. During delivery work, the agent uses the fixed local launcher and rules without repeated package downloads.
112
+
113
+ After an upgrade, save current work and follow [session continuation](docs/guide.md#continue) to reconcile rules and delivery state. Upgrading the software does not automatically migrate existing deliveries.
114
+
115
+ <a id="uninstall"></a>
116
+ ## Uninstallation
117
+
118
+ Disconnect one tool while retaining the core and other registrations:
119
+
120
+ ```sh
121
+ npx aimship@preview uninstall --host cursor
122
+ ```
123
+
124
+ Shared entries remain when another registered tool needs them. Disconnecting the last tool still retains the core for diagnostics or reconnection; compatible tools might continue discovering a remaining shared entry.
125
+
126
+ Remove all managed software and tool entries:
127
+
128
+ ```sh
129
+ npx aimship@preview uninstall
130
+ ```
131
+
132
+ Full uninstall retains delivery materials, user code, custom files and necessary configuration. Modified/unowned files are preserved and reported. The launcher is removed on complete removal. Restart tool sessions to discard cached rules. Deleting delivery history is a separate explicit action.
133
+
134
+ <a id="installation-troubleshooting"></a>
135
+ ## Installation and upgrade problems
136
+
137
+ | Symptom | What to do |
138
+ | --- | --- |
139
+ | Aimship is absent or duplicated | Refresh the session and inspect entries using [tool setup](docs/guide.md#hosts); installation health does not prove the tool loaded the Skill. |
140
+ | A managed path is modified or occupied by other files | Preserve the contents, inspect ownership and explicitly reconcile customizations before retrying. |
141
+ | Installation was interrupted or the launcher is damaged | Use the `status` command above, resolve the cause, then rerun the exact pending version against the same home. Do not switch versions during recovery. Append `--home <installation-home>` when checking a custom installation home. |
142
+ | Unexpected version | Compare `installedActiveVersion` and `toolVersion`, then refresh the session's rules before continuing delivery work. |
143
+ | Package/version unavailable or download failed | Check the package, exact version and registry; a failed download is not a completed installation. |
83
144
 
84
145
  ## Documentation and contributions
85
146
 
86
- The **[Guide](docs/guide.md)** covers installation, daily use, document rules, continuation, updates and troubleshooting. For contributors, [CONTRIBUTING](CONTRIBUTING.md) covers development and checks; the [CLI protocol](docs/cli.md) is the agent/tool reference.
147
+ <a id="use-cases-and-examples"></a>
148
+ The **[Guide](docs/guide.md)** explains how to start work, review documents, inspect results, handle changes and resume. Artifact and traceability details are also in the Guide; [CONTRIBUTING](CONTRIBUTING.md) covers development and isolated validation; the [CLI protocol](docs/cli.md) serves agents and tool developers.
87
149
 
88
- Report bugs and feature requests through [GitHub Issues](https://github.com/clsx/aimship/issues). Aimship is a preview; completed work, user acceptance, merge and deployment are recorded separately.
150
+ Aimship is in preview, with ongoing improvements to the workflow, usability and compatibility. Share problems and suggestions from actual use through [GitHub Issues](https://github.com/clsx/aimship/issues); read the contribution guide before contributing to development.
89
151
 
90
152
  Released under the [MIT License](LICENSE).
package/README.zh-CN.md CHANGED
@@ -2,89 +2,151 @@
2
2
 
3
3
  [English](README.md) · [使用指南](docs/guide.zh-CN.md)
4
4
 
5
- **面向 AI 编程工具的开发交付流程,贯通需求、实施与验证。**
5
+ **面向 AI 工具的软件交付流程,贯通需求、设计、实施、审核与验证。**
6
6
 
7
- Aimship 适用于功能开发、缺陷修复、技术重构和方案设计。根据交付目标安排所需阶段,维护需求、设计、实施和验证记录,并支持基于已有资料接续工作。
7
+ 面向有开发基础、对一项需求交付负责的开发者。你提供目标、已有资料和代码位置,Aimship 帮助 Agent 将需求整理为清晰的范围、有依据的设计、可执行的计划和经过验证的成果,并衔接各阶段的工作,让你能了解推进过程、理解关键决定、判断实际交付结果。
8
8
 
9
- 每个需求在 `~/Aimship/` 下使用独立交付目录,代码保留在原仓库。交付范围可以覆盖完整开发流程,也可以限定为需求分析、技术方案等指定成果。
9
+ <a id="一个需求会留下哪些文档"></a>
10
+ <a id="交付目录与文档"></a>
11
+ <a id="交付成果"></a>
12
+ 统一的文档大纲、编号和引用,将需求与验收标准关联到设计、实施任务、审核和测试结果。文档按交付目标和实际需要生成,既提供一致的阅读与核对依据,也不要求每个阶段都填一份空模板。
13
+
14
+ <a id="交付流程"></a>
15
+ 默认由你逐份审核经过 Agent 自检的文档。Agent 给出当前状态、文档和审核重点,等待你审核;明确通过后保存批准,组内直接衔接,到建议会话边界提供下一步和续接入口,也可选择当前会话继续。提出修改意见时,Agent 修订、自检后重新送审。文档通过与最终交付验收分别记录;明确缩减范围的阶段性成果不会被当作标准完整交付。
16
+
17
+ 文档与状态在工作过程中持续保存,使进度、决定和验证依据可追溯,减少重复交代背景和重新梳理已有工作的负担。
18
+
19
+ [安装](#install) · [使用指南](docs/guide.zh-CN.md) · [升级与 AI 工具管理](#update) · [卸载](#uninstall)
10
20
 
11
- ## 快速开始
21
+ <a id="快速开始"></a>
22
+ <a id="install"></a>
23
+ ## 安装
12
24
 
13
- 需要 **Node.js 22+ 和 npm**。宿主可选 `codex`、`cursor` 或 `claude-code`:
25
+ 需要 **Node.js 22+ 和 npm**。以下命令使用 POSIX shell 写法。
26
+
27
+ ### 安装已发布的预览版
14
28
 
15
29
  ```sh
16
30
  npx aimship@preview install --host codex
17
31
  ```
18
32
 
19
- 安装后开启新的宿主会话,选择 Aimship:Codex CLI 使用 `$aimship`,Cursor 和 Claude Code 使用 `/aimship`。在需要时授权访问交付目录和相关代码仓库,然后描述任务:
33
+ AI 工具可选 `codex`、`cursor` 或 `claude-code`。连接多个 AI 工具时重复该选项:
20
34
 
21
- > 使用 Aimship 给订单列表增加 Excel 导出功能。代码在我现有的仓库中。本次完成实施和验证,部署留待后续处理。
35
+ ```sh
36
+ npx aimship@preview install --host codex --host claude-code
37
+ ```
22
38
 
23
- 该 npm 命令安装已发布的预览通道版本。指定版本、源码或本地包的安装方式,参见[安装说明](docs/guide.zh-CN.md#install)。
39
+ 按 npm 提示确认获取安装包。`@preview` 表示已发布的预览通道,也可以替换为明确版本号,例如 `@0.1.0-preview.7`。预览通道用于实验性版本,不代表稳定版。
24
40
 
25
- 安装一次即可用于多个项目和已选择的宿主。宿主集成仍处于实验阶段,真实 Skill 发现和跨宿主接续仍需验证。宿主未显示 Aimship 时,请参阅[宿主设置](docs/guide.zh-CN.md#hosts)。
41
+ ### 指定版本或本地包
26
42
 
27
- ## 交付流程
43
+ 安装指定的已发布版本,例如:
28
44
 
29
- 1. **明确需求。** 保留原始资料,自编 PRD 或通过 Scope 承接已有需求,确认本次目标和执行顺序。
30
- 2. **准备实施。** 按确定的条件产出原型、技术方案、契约、实施计划和测试用例。
31
- 3. **实施与审核。** 每批实施后进行 review,全部完成后再做整体 review。
32
- 4. **验证与交接。** 对实际成果执行用例,保留失败和重测记录,说明交付结果与遗留事项。
45
+ ```sh
46
+ npx aimship@0.1.0-preview.7 install --host codex
47
+ ```
33
48
 
34
- 这是开发交付的基本过程,并非每个需求都要执行全部阶段。只做设计、review 或验证的委托,在约定的终点结束。普通调试在当前流程中处理;只有明确安排独立调查时才加入调查阶段。
49
+ 如果已有 Aimship 的 `.tgz` 安装包,将 `VERSION` 替换为实际版本号,在包所在目录执行:
35
50
 
36
- <a id="一个需求会留下哪些文档"></a>
37
- ## 交付目录与文档
38
-
39
- **`status.md`** 是交付进度的统一阅读入口,包含当前阶段、阻塞事项、后续操作和文档链接。下方列出交付产物及其用途;实际生成范围由所选阶段和输入条件确定,未选阶段不生成空文档。`prd.md` 与 `scope.md` 是需求入口的两种选择,并非每个需求都要同时生成。
40
-
41
- ```text
42
- ~/Aimship/
43
- ├── 20261023-订单导出/ # 每个需求一个独立交付目录
44
- │ ├── status.md # 自动生成的进度总览和阅读入口
45
- │ ├── prd.md # 自编需求:目标、范围、需求和验收标准
46
- │ ├── scope.md # 采用权威外部资料时使用,替代自编 PRD
47
- │ ├── tech-design.md # 技术方案:架构、改动、数据、风险和需求覆盖
48
- │ ├── plan.md # 实施计划:批次、任务及实际执行记录
49
- │ ├── testing.md # 测试用例、覆盖关系、执行与重测结果
50
- │ ├── review.md # 各批及整体审核、发现的问题和处理结论
51
- │ ├── handoff.md # 交付结果、使用方式、验证结论和遗留事项
52
- │ ├── diagnosis.md # 仅独立调查时生成的定位与证据记录
53
- │ ├── change-log.md # 重要变更、决定及受影响的工作
54
- │ ├── openapi.yaml # 新建 HTTP 契约;已有权威契约优先复用
55
- │ ├── database.sql # 单数据库 SQL;多目标为 database-<id>.sql
56
- │ ├── prototype/ # 符合生成条件时新建的原型
57
- │ │ └── index.html # HTML 原型入口,相关资源也放在此目录
58
- │ ├── source/ # 保留原始需求和采用的外部资料版本
59
- │ │ ├── request.md # 原始委托或来源入口
60
- │ │ └── … # 外部 PRD、原型、截图及其他输入
61
- │ └── .aimship/ # 工具维护的内部状态与辅助证据
62
- │ ├── state.json # 阶段、引用、版本及仓库/worktree 关联
63
- │ ├── state.previous.json # 写入后用于恢复的上一版状态
64
- │ ├── view.json # 进度视图的生成元信息
65
- │ └── evidence/ # 按需保留的验证等证据
66
- └── 20261024-另一个需求/ # 独立的资料与进度
51
+ ```sh
52
+ npx --offline file:./aimship-VERSION.tgz install --host codex
67
53
  ```
68
54
 
69
- 正式文档直接放在需求目录下;`source/` 保留采用的原件,`.aimship/` 保存内部记录。软件安装目录为 `~/.aimship/`,与各需求目录内的 `.aimship/` 分别管理。
55
+ 选择一种安装方式即可。不需要全局 npm 安装、管理员权限或 npm 登录;npm 缓存需要可写。源码开发和隔离安装验证见[贡献指南](CONTRIBUTING.md#isolated-installation-check)。
70
56
 
71
- 文档名称、大纲和编号遵循统一模板。需求与验收标准关联到实施任务、审核、带版本的测试用例及执行结果。[使用指南](docs/guide.zh-CN.md#artifacts)进一步说明每种文档的生成条件和具体内容。
57
+ ### 可选:指定交付资料位置
72
58
 
73
- ## 适用场景与示例
59
+ 默认交付资料根目录为 `~/Aimship/`。首次安装时,可以用 `--data-root` 指定其他位置:
74
60
 
75
- | 场景 | 委托示例 |
76
- | --- | --- |
77
- | 已有 PRD 和原型 | “根据这些资料开发订单导出,保留原件,实施前先确认本次范围。” |
78
- | 功能需求分析与设计 | “梳理通知偏好功能,完成原型和技术方案,本次先不实施。” |
79
- | 技术重构 | “重构计价模块,不改变对外行为,完成实施和验证。” |
80
- | 故障调查 | “调查偶发超时的原因,给出证据和结论,本次先不修复。” |
61
+ ```sh
62
+ npx aimship@preview install --host codex --data-root "$HOME/MyDeliveries"
63
+ ```
64
+
65
+ 此选项设置后续新交付的默认资料位置,不是代码仓库位置,也不会搬迁已有资料。后续安装保留已有配置;无需逐项目安装。
66
+
67
+ 安装后,按[使用指南](docs/guide.zh-CN.md#hosts)在 AI 工具中选择 Aimship。AI 工具集成仍处于实验阶段,真实 Skill 发现和跨工具接续仍需验证。
68
+
69
+ <a id="update"></a>
70
+ <a id="update-or-stop-using-aimship"></a>
71
+ <a id="升级与宿主管理"></a>
72
+ <a id="升级与-ai-开发工具管理"></a>
73
+ ## 升级与 AI 工具管理
74
+
75
+ 升级到已发布的预览通道版本:
76
+
77
+ ```sh
78
+ npx aimship@preview install
79
+ ```
80
+
81
+ 安装和升级使用同一个 `install` 命令。已有 AI 工具登记、配置、自定义内容和交付资料都会保留。安装器报告旧/目标版本、结果及冲突;没有后台自动升级或常驻进程。指定版本或本地包也使用[安装说明](#install)中的命令,指向原来的安装目录。
82
+
83
+ <a id="添加宿主"></a>
84
+ <a id="添加-ai-开发工具"></a>
85
+ ### 添加 AI 工具
86
+
87
+ 例如,已有 Codex 安装后再接入 Cursor:
88
+
89
+ ```sh
90
+ npx aimship@preview install --host cursor
91
+ ```
81
92
 
82
- 多个独立需求可以同时推进,每个交付只保留一个写入会话。共享代码时,安排串行实施或使用独立 checkout/worktree,详见[并行需求](docs/guide.zh-CN.md#parallel)。
93
+ 该命令保留已有 AI 工具,同时安装所选预览版本;如果预览通道有更新,也会升级软件。随后按[AI 工具设置](docs/guide.zh-CN.md#hosts)刷新对应会话。
94
+
95
+ ### 查询已安装版本
96
+
97
+ ```sh
98
+ npx aimship@preview --version
99
+ ```
100
+
101
+ 输出中的 `installedActiveVersion` 是当前已安装版本,`toolVersion` 是此次 npx 运行的包版本,两者可能不同。查询本身不会升级安装。
102
+
103
+ ### 检查安装状态
104
+
105
+ ```sh
106
+ npx aimship@preview status
107
+ ```
108
+
109
+ 此命令检查软件安装、AI 工具登记和受管理文件,报告是否健康及待处理问题;它不能确认 AI 工具已加载 Skill。查看需求进度请打开交付目录的 `status.md`。
110
+
111
+ 以上命令由 npx 获取并运行所选包;日常交付由 Agent 使用固定的本地入口和规则,无需反复下载包。
112
+
113
+ 升级后,先保存当前工作,再按[会话接续](docs/guide.zh-CN.md#continue)核对规则和交付状态;已有交付不会因为软件升级自动完成迁移。
114
+
115
+ <a id="uninstall"></a>
116
+ ## 卸载
117
+
118
+ 只断开一个 AI 工具,保留核心和其他 AI 工具登记:
119
+
120
+ ```sh
121
+ npx aimship@preview uninstall --host cursor
122
+ ```
123
+
124
+ 其他已登记 AI 工具还需要的共享入口会保留。断开最后一个 AI 工具也保留核心,以便诊断或重新连接;兼容 AI 工具仍可能发现剩余的共享入口。
125
+
126
+ 移除所有受管理的软件和 AI 工具入口:
127
+
128
+ ```sh
129
+ npx aimship@preview uninstall
130
+ ```
131
+
132
+ 完整卸载保留交付资料、用户代码、自定义文件和必要配置。修改过或不属于它管理的文件会保留并报告。完全移除后,稳定入口也会移除;重启 AI 工具会话以清除缓存规则。删除交付历史是另一项需要明确提出的操作。
133
+
134
+ <a id="installation-troubleshooting"></a>
135
+ ## 安装与升级问题
136
+
137
+ | 现象 | 处理方式 |
138
+ | --- | --- |
139
+ | 找不到 Aimship 或出现重复项 | 按[AI 工具设置](docs/guide.zh-CN.md#hosts)刷新会话并检查入口;安装健康不代表 AI 工具已经加载 Skill。 |
140
+ | 管理位置被修改或被其他文件占用 | 保留内容,检查归属,明确合并定制内容后再重试。 |
141
+ | 安装中断或稳定入口损坏 | 使用上面的 `status` 命令检查安装,排除原因后在同一目录重跑完全相同的待恢复版本;不要在恢复途中换版本。自定义安装用户目录可追加 `--home <安装用户目录>` 进行检查。 |
142
+ | 版本与预期不一致 | 核对版本查询中的 `installedActiveVersion` 和 `toolVersion`,继续交付前刷新会话中的规则。 |
143
+ | 包/版本不存在或下载失败 | 核对包名、明确版本和 registry;下载失败不算安装完成。 |
83
144
 
84
145
  ## 文档与贡献
85
146
 
86
- **[使用指南](docs/guide.zh-CN.md)**涵盖安装、日常使用、文档规则、进度接续、升级和排障。[CONTRIBUTING](CONTRIBUTING.md)说明开发与贡献要求;[CLI 协议](docs/cli.md)供 Agent 和工具开发者查阅。
147
+ <a id="适用场景与示例"></a>
148
+ **[使用指南](docs/guide.zh-CN.md)**说明如何开始需求、审核文档、查看成果、处理变更和接续。产物与追溯细则也在指南中;[CONTRIBUTING](CONTRIBUTING.md)说明开发和隔离验证;[CLI 协议](docs/cli.md)供 Agent 和工具开发者查阅。
87
149
 
88
- 通过 [GitHub Issues](https://github.com/clsx/aimship/issues)反馈问题和建议。Aimship 目前为预览版;目标完成、用户验收、合并和部署分别记录。
150
+ Aimship 目前处于预览阶段,流程、使用体验和兼容性仍在完善。欢迎通过 [GitHub Issues](https://github.com/clsx/aimship/issues)反馈实际使用中遇到的问题和改进建议;参与开发请先阅读贡献指南。
89
151
 
90
152
  采用 [MIT 许可证](LICENSE)。
package/docs/cli.md CHANGED
@@ -28,7 +28,7 @@ init allocates deliveryId and revision 0, creates `.aimship/state.json`, and gen
28
28
 
29
29
  `documentPolicy.authority`: authored → prd.md; adopted → scope.md; editable → an explicitly authorized existing PRD containing this commission's complete scope/authorization/endpoint. `legacy` is migration-only. `interaction`, `prototypeCovered`, `interface` (none/http/other) and target `databases` IDs record artifact conditions. They do not select a preset route.
30
30
 
31
- Register documents as `{kind,path,mode,version}`. Kinds: prd, scope, tech-design, plan, testing, review, diagnosis, handoff, change-log, prototype, contract, sql, source. New formal Markdown follows the artifact map's root filename and ordered anchors. Reused files additionally need `basisRef` recording location/version/coverage/gaps and editability; unsupported content is explicitly not checked. New HTML prototype is prototype/index.html; register other agreed formats. HTTP contracts use openapi.yaml unless reused. SQL filenames follow database count. Source files are immutable adopted versions by workflow, not OS access controls.
31
+ Register documents as `{kind,path,mode,version,assetRefs?}`. List local/repository prototype images, scripts and other review-relevant assets in assetRefs so their bytes participate in the document fingerprint; the Agent must identify the complete asset set. Kinds: prd, scope, tech-design, plan, testing, review, diagnosis, handoff, change-log, prototype, contract, sql, source. New formal Markdown follows the artifact map's root filename and ordered anchors. Reused files additionally need `basisRef` recording location/version/coverage/gaps and editability; unsupported content is explicitly not checked. New HTML prototype is prototype/index.html; register other agreed formats. HTTP contracts use openapi.yaml unless reused. SQL filenames follow database count. Source files are immutable adopted versions by workflow, not OS access controls.
32
32
 
33
33
  ## Update and inspect
34
34
 
@@ -79,4 +79,34 @@ Reconcile legacy documents by role, preserve original text/results/version basis
79
79
 
80
80
  A compatible old fixed tool can checkpoint only next/checkpoint facts during version mismatch, once per active version. It cannot complete stages. Save before migration, reload new rules, migrate then adopt. Old tools must not write migrated schema 2. No DeliveryArc migration is provided.
81
81
 
82
- Goal changes need a new goal.decisionRef; prior goals/outcomes are retained. A met goal requires goalConclusionRef; acceptance needs its own acceptanceRef. Merge and deployment refs remain independent. Reopening increments cycle, appends closureRefs and resets acceptance. See the [user guide](guide.md#update) for lifecycle operations and their separate host-discovery limits.
82
+ Goal changes need a new goal.decisionRef; prior goals/outcomes are retained. A met goal requires goalConclusionRef; acceptance needs its own acceptanceRef. Merge and deployment refs remain independent. Reopening increments cycle, appends closureRefs and resets acceptance. See the [README](../README.md#update) for software lifecycle operations and the [Guide](guide.md#hosts) for host-discovery limits.
83
+
84
+ ## Document review protocol
85
+
86
+ Schema 2 now includes `reviewPolicy: 1` and append-only `reviewHistory` (new deliveries default to both). Old states remain readable with `review-adoption-required`; at the recorded compatibility point enable the policy with an empty history, without inventing historical approval. Rule adoption and document approval remain separate. This additive protocol requires the current rules version; keep old tools bound to their old rules.
87
+
88
+ Each record has `{id, kind, document, version, digest, sourceRef, summary}`. Kinds are `self-check`, `approved`, `changes-requested`, and `editorial`. `self-check` requires `result: "passed"` or `"failed"`; only a passing self-check can support approval. `approved` additionally requires `decision: "explicit-approval"`; `editorial` requires `previousDigest`. Use unique local review-record IDs (for example `approval-1`); these are state record identifiers, not a replacement for REQ/AC/CHG. Send the complete preserved history plus new records through revision-checked `update`. Existing records cannot be edited, removed or reordered. The tool records `sourceDigest` from readable local or repo-relative evidence; keep it unchanged when sending history back. Evidence files are versioned/immutable: changed or missing evidence produces evidence-changed and does not release dependencies; preserve the original bytes and add new decisions in new evidence files. Evidence fragments use explicit anchors. A remote source must have a local preserved decision excerpt with its original locator and date.
89
+
90
+ `read`, `check`, and `resume` return `review.documents` with current `path`, `version`, `digest`, `selfCheck`, `approval` and status. First append a self-check of those exact bytes; after presenting the document and receiving explicit approval, append an approved record binding the same version/digest and the actual user message. Questions, silence, and “show the result” cannot be recorded as approval. A hash/source reference validates the record's content basis, **not user identity or authenticity**. Never synthesize a real approval to make an update pass.
91
+
92
+ Production `progress: done` may be saved while approval is pending. Starting/completing dependent runs is blocked until prerequisite completion and document approval are current. Runs default to depending on their predecessor; explicit `dependsOn: [preceding-run-ids]` supports recorded independent branches, while input/output producers and earlier selected development prerequisites also apply. The initial applicable development order is requirements/Scope, technical design, interface/SQL, test-design, plan, implement. Unselected stages are not created. Contract can produce only SQL when no interface change applies; technical design no longer requires SQL files before completion.
93
+
94
+ For new `plan.md` and `testing.md`, fingerprints cover the content before the fixed `execution` and `runs` anchors respectively. Append implementation and RUN/conclusion evidence after those boundaries. Reused formats and other documents use whole-file content; remote/binary or linked-asset semantic inspection still belongs to the host/Agent. `done`, matching hashes and structural checks do not prove semantic quality.
95
+
96
+ A material change needs an open CHG with impact/decision evidence, a revised document version, a new self-check and explicit reapproval. Old review records remain. Affected producer/dependent runs become `needs-review`; update currentRun/next to the re-review stop and restore applicability after evidence-backed rechecking in dependency order. Independent branches are preserved. An `editorial` record carries a prior approval only after a same-version self-check explains a formatting/typo change and references its previous digest; it is not a new user approval. Do not hide changed design in excluded result sections. Final `outcome.acceptance` stays independent.
97
+
98
+ See the [Agent review workflow](../skills/aimship/references/document-review.md) for presentation, automatic continuation after approval and compatibility responsibilities.
99
+
100
+ ## Standard completeness and session suggestions
101
+
102
+ New state defaults to `deliveryPolicy: {version: 1}`. The standard main sequence is requirements/acceptance, technical and applicable contract/interaction artifacts, cases, plan, implementation with batch review, overall review, verification, handoff/acceptance. Do not present stageRuns as an arbitrary menu of core stages. Preserve existing materials and inspect them before adoption; reuse does not imply approval.
103
+
104
+ An explicit limited-scope decision (including no cases and testing) is referenced by `deliveryPolicy.partialRef` in existing PRD/Scope/change material. Such a scope may reach `outcome.goal: met` and have a real acceptance decision, but derived `completion.status` remains `partial-scope`, never `standard-complete`. Adding/changing/removing this basis needs a new goal.decisionRef, preserving goal history; set partialRef to null to restore standard scope. Standard goal completion checks recorded stages/approvals, passing batch and overall review, passing independent verification, handoff and resolvable evidence; standard-complete additionally requires recorded acceptance. These checks cannot prove actual execution or semantic quality. Failed or omitted checks must never be labeled passed.
105
+
106
+ Reviews identify their actual implementation coverage with `reviewOf: [implementationRunId, ...]`; overall review has `overall: true`. For a single batch one review may explicitly cover both. An unresolved failed review prevents standard completion even if an earlier overall review passed. A passing repair review or retest may list the superseded review/RUN result references in its existing `historyResultRefs`, preserving old failures; the Agent must verify that it actually resolves or covers them on current objects. Verification must follow the applicable overall review. Merely setting a link is not semantic evidence.
107
+
108
+ `run.sessionGroup` is an advisory group ID persisted when a new policy-enabled run is saved: requirements; technical/contract/prototype; cases; plan; each implementation batch with its batch review; overall review; each verify batch. Adjusting groups does not change document approval, add a stage, or block work. `read/check/resume` expose `session.action`, groups and a concise continuation entry; pending review and unconfirmed saves do not return a next-stage entry. `writeResult.session` becomes reconcile-save with no entry if view saving fails, even when stateSaved is true. Repair at the returned revision; do not repeat the approval update. At a confirmed saved group boundary, the Agent suggests a new session without executing the next group in that response. A user request to continue here proceeds with the normal authorized update.
109
+
110
+ `read` and `resume` accept optional `--delivery-id <known-id>` to reject a wrong directory binding. A directory remains required; no implicit latest-delivery lookup exists. Resume is read-only and inspects actual state, approval/content versions, references and view diagnostics; old prompts grant no approval. The Agent must additionally inspect relevant complete formal documents, actual artifacts and unfinished effects before acting.
111
+
112
+ Old states without deliveryPolicy stay valid and report `historical-unassessed`; existing goal/acceptance is not rewritten. After active-rule adoption if needed, explicitly update deliveryPolicy together with a readable `compatibilityRef` assessing scope and evidence, without inventing old approvals or runs. A preserved historical met value is not automatically a new standard-complete claim. Reconcile gaps before claiming new completion; explicit limited scope remains distinguishable. Unknown future delivery policies are read-only and cannot be recovered over.