silvermoon 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,236 +1,149 @@
1
- <p align="center">
2
- <img src="./assets/silvermoon.svg" width="960" alt="Silvermoon, the spirit of your project">
3
- </p>
4
-
5
- <p align="center">
6
- English | <a href="./README.zh-CN.md">简体中文</a>
7
- </p>
8
-
9
- # Silvermoon(银月)
10
-
11
- **The spirit of your project.**
12
-
13
- > *Silvermoon (银月) is named after the artifact spirit and steadfast companion
14
- > in **A Record of a Mortal's Journey to Immortality** (RMJI; 凡人修仙传).
15
- > Like her, this Silvermoon lives with the artifacts, understands their state,
16
- > and helps its companions navigate what comes next: the spirit of your
17
- > project.*
18
-
19
- Silvermoon is a shared tool for humans and agents. It checks the repository's
20
- real state, preserves facts both can understand, guards decision boundaries,
21
- and answers one question: **what's next?**
22
-
23
- It does not act as a personal assistant or make human decisions. Silvermoon
24
- belongs to the project itself, so every collaborator observes the same state
25
- and the same highest-priority next action.
26
-
27
- Silvermoon has three public commands:
28
-
29
- ```sh
30
- silvermoon whats-next [idea]
31
- silvermoon create-idea
32
- silvermoon check [--remote | --commit <revision> | --staged | --worktree]
33
- ```
34
-
35
- `whats-next` first emits a complete doctor-style adoption report and routes
36
- idea work only after every blocking requirement is satisfied. It fetches and
37
- observes but never edits, checks out, merges, commits,
38
- stashes, deletes, resets, fast-forwards, or pushes. It returns one
39
- highest-priority action. `check` validates storage and Git facts for humans,
40
- hooks, and CI. `create-idea` runs the same hygiene preflight, then creates one
41
- structured idea scaffold without staging, committing, pushing, or recording
42
- approval.
43
-
44
- ## Install
45
-
46
- ```sh
47
- npm install --save-dev silvermoon
48
- npx skills add ./node_modules/silvermoon/skills --skill silvermoon --agent github-copilot --yes --copy
49
- ```
50
-
51
- Requires Node.js 22 or newer and Git access to the configured primary branch.
52
- The npm package contains the canonical skill. Skill registration and updates
53
- belong to `npx skills`; Silvermoon only diagnoses exact content alignment and
54
- never changes the registered skill.
55
-
56
- ## Configure
57
-
58
- Create `.silvermoon/config.yaml`:
59
-
60
- ```yaml
61
- version: 1
62
- primaryRepository: https://github.com/example/repository.git
63
- primaryBranch: main
64
- ```
65
-
66
- Repository URLs are canonical credential-free HTTPS shared state. Credentials,
67
- named remotes, and URL rewrites remain local Git concerns. Metadata paths are
68
- fixed and cannot be overridden by configuration.
69
-
70
- Create or repair this file with ordinary repository editing tools. Silvermoon
71
- reports configuration findings but does not own an onboarding mutation command.
72
-
73
- ## Store Ideas
74
-
75
- Each idea is self-contained under one canonical uppercase ULID folder:
76
-
77
- ```text
78
- .silvermoon/
79
- |-- config.yaml
80
- `-- ideas/
81
- `-- 01M36QGPNTXEPP61DA4KP4AVZF/
82
- |-- status.yaml
83
- |-- ledger.md
84
- `-- outer/
85
- |-- Deployment.md
86
- `-- inner/
87
- |-- Implementation.md
88
- `-- ideal/
89
- `-- Idea.md
90
- ```
91
-
92
- The three nested worlds have canonical English and Chinese names:
93
-
94
- - **Ideal World (道心):** `Idea.md` defines the ideal.
95
- - **Inner World (内景):** `Implementation.md` defines implementation.
96
- - **Outer World (现世):** `Deployment.md` defines deployment.
97
-
98
- 道心立意,内景成形,现世验真。
99
-
100
- Every world may contain additional files or directories. Ideal World artifacts
101
- support `Idea.md`, Inner World artifacts support `Implementation.md`, and Outer
102
- World artifacts support `Deployment.md`; supporting material never replaces
103
- the canonical same-world entry.
104
-
105
- Each world is an opaque Git tree. `idealRevision` identifies `ideal/`,
106
- `implementationRevision` identifies `inner/` and therefore includes the Ideal
107
- World, and `deploymentRevision` identifies `outer/` and therefore includes both
108
- nested worlds. This creates deterministic cascading invalidation. `status.yaml`
109
- and required `ledger.md` are outside all three world trees.
110
-
111
- The Silvermoon Agent skill authors implementation and deployment plans under
112
- `## Steps` and outcome contracts under `## Acceptance criteria`. Every item
113
- uses a stable level-three `I-Sxx`, `I-ACxx`, `D-Sxx`, or `D-ACxx` heading.
114
- Each criterion contains both its observable outcome and the method that proves
115
- it. World contracts never use task-list checkboxes.
116
-
117
- The required idea-root `ledger.md` mirrors stable IDs and short titles under
118
- Implementation and Deployment Steps and Acceptance criteria checklists.
119
- Silvermoon requires the regular file but does not parse it, include it in world
120
- revisions, or infer a human decision from `[x]`. Agents update world headings
121
- and ledger entries together, reset materially changed completed items, and
122
- derive the next work from `whats-next`, the contracts, and unchecked entries.
123
-
124
- ```yaml
125
- version: 1
126
- id: 01M36QGPNTXEPP61DA4KP4AVZF
127
- alias: publish-documentation
128
- approvedRevision: 0123456789abcdef0123456789abcdef01234567
129
- implementationAcceptedRevision: 0123456789abcdef0123456789abcdef01234567
130
- deploymentAcceptedRevision: 0123456789abcdef0123456789abcdef01234567
131
- ```
132
-
133
- `version` and `id` are required. `alias` is optional; when present it is an
134
- exact, unique, case-sensitive selector. Other optional fields, in canonical
135
- order, are `abandoned: true` and the three revision fields shown above. Explicit
136
- `abandoned: false`, derived state, criteria mirrors, source locators, unknown
137
- keys, aliases/anchors, comments, and noncanonical YAML are rejected.
138
-
139
- State is derived in order:
140
-
141
- 1. `abandoned` when `abandoned: true`.
142
- 2. `preparing` when `approvedRevision` differs from `idealRevision`.
143
- 3. `implementing` when `implementationAcceptedRevision` differs from
144
- `implementationRevision`.
145
- 4. `deploying` when `deploymentAcceptedRevision` differs from
146
- `deploymentRevision`.
147
- 5. `completed` when all three revisions match.
148
-
149
- ## Navigate
150
-
151
- ```sh
152
- silvermoon whats-next
153
- silvermoon whats-next 01M36QGPNTXEPP61DA4KP4AVZF
154
- silvermoon whats-next publish-documentation --json
155
- ```
156
-
157
- Without a selector, Silvermoon asks you to choose among multiple active ideas,
158
- continue one active idea, or create a new idea. With a ULID or exact unique
159
- alias, it renders state guidance. Every invocation first checks the configured
160
- primary branch, conflicts, dirty worktree, and local/remote primary ancestry.
161
-
162
- JSON reports contain `observedPrimaryCommit`, `selectedIdea`, and exactly one
163
- `action`. They also contain `onboarding`, whose requirements carry stable IDs,
164
- statuses, blocking flags, dependencies, observed facts, structured remediation,
165
- a recommended action, and a recheck command. Execution source is
166
- `source-checkout`, `project-local`, `temporary`, `global`, or `unknown`.
167
- Temporary execution can bootstrap diagnosis; normal idea work requires the
168
- exact project dependency, installed package, and matching repository skill.
169
- Use the observed commit as the expected remote tip for later writes.
170
- If primary moves, fetch and reobserve rather than replaying a stale decision.
171
-
172
- ## Create An Idea
173
-
174
- ```sh
175
- silvermoon create-idea --json
176
- ```
177
-
178
- After branch, conflict, dirty-worktree, and primary-ancestry hygiene passes, the
179
- command generates a canonical ULID, structured `Idea.md`, `Implementation.md`,
180
- `Deployment.md`, and `ledger.md` documents, plus a canonical `status.yaml`
181
- containing only `version` and `id`. It does not require or invent an alias. The
182
- new files are intentionally untracked, so the next `whats-next <ULID>` reports
183
- `inspect-worktree-changes` until you complete the initial `Idea.md`, review the
184
- candidate, and publish it through ordinary Git. An Agent may add a concise,
185
- unique alias derived from the user's request while preparing the idea; users
186
- need not stop to name it.
187
-
188
- Silvermoon has no approval or acceptance mutation commands. After an explicit
189
- decision, edit the idea's status file, run `silvermoon check --staged`, commit
190
- the status fact, and non-force push through ordinary Git.
191
-
192
- ## Validate
193
-
194
- - `check` validates only the committed `HEAD` snapshot and reads primary
195
- coordinates from that snapshot.
196
- - `check --worktree` validates the hypothetical commit containing HEAD, the
197
- index, unstaged changes, and nonignored untracked files. It reads primary
198
- coordinates from that complete candidate.
199
- - `check --staged` validates the index snapshot.
200
- - `check --commit <revision>` validates one local commit snapshot.
201
- - `check --remote` uses committed HEAD coordinates to fetch primary, validates
202
- its immutable tip, and proves retained revision facts against complete
203
- reachable primary history.
204
-
205
- Targets are mutually exclusive and never change the caller's branch, index, or
206
- worktree. Exit status `0` means success, `1` means validation or operational
207
- failure, and `2` means invalid CLI usage. Use `--json` for the complete stable
208
- report envelope.
209
-
210
- The repository configuration schema is
211
- [schema/v1/config.schema.json](schema/v1/config.schema.json), and the idea
212
- status schema is
213
- [schema/v1/idea-status.schema.json](schema/v1/idea-status.schema.json). Both
214
- use the shared definitions in
215
- [schema/v1/definitions.schema.json](schema/v1/definitions.schema.json).
216
- Runtime checks additionally verify canonical YAML, regular fixed metadata
217
- paths, three world entries, unique aliases, current Git object format, tree
218
- object types, per-world candidate revision binding, and acceptance history.
219
-
220
- ## Adopt Silvermoon
221
-
222
- Silvermoon is a direct breaking cutover from the previous product. It recognizes
223
- only `.silvermoon/config.yaml` version 1 and does not read, convert, or diagnose
224
- previous layouts. Preserve Git history and record only acceptance facts
225
- supported by explicit review. See the installed skill's `references/adoption.md` for
226
- the adoption sequence.
227
-
228
- ## Development
229
-
230
- ```sh
231
- pnpm install --frozen-lockfile
232
- pnpm test # fast unit and repository contract tests
233
- pnpm test:integration # real filesystem and Git behavior
234
- pnpm test:e2e # packed and installed CLI behavior
235
- pnpm check # complete release-grade validation
236
- ```
1
+ <!-- markdownlint-disable-file MD041 -->
2
+
3
+ <p align="center">
4
+ <!-- markdownlint-disable-next-line MD013 -->
5
+ <img src="https://raw.githubusercontent.com/shazhou-ww/silvermoon/95f48bd2cd07fd43267f7b6a0c9471d2a8d0ca95/assets/silvermoon.svg" width="960" alt="Silvermoon, the artifact spirit of the project">
6
+ </p>
7
+
8
+ <p align="center">
9
+ <!-- markdownlint-disable-next-line MD013 -->
10
+ <a href="https://npmx.dev/package/silvermoon"><img src="https://img.shields.io/npm/v/silvermoon?style=flat-square" alt="npm version"></a>
11
+ <!-- markdownlint-disable-next-line MD013 -->
12
+ <a href="https://npmx.dev/package/silvermoon"><img src="https://img.shields.io/node/v/silvermoon?style=flat-square" alt="Node.js version"></a>
13
+ <!-- markdownlint-disable-next-line MD013 -->
14
+ <a href="https://npmx.dev/package/silvermoon"><img src="https://img.shields.io/npm/unpacked-size/silvermoon?style=flat-square" alt="npm unpacked size"></a>
15
+ <!-- markdownlint-disable-next-line MD013 -->
16
+ <a href="https://github.com/shazhou-ww/silvermoon/actions/workflows/ci.yml?query=branch%3Amain"><img src="https://img.shields.io/github/actions/workflow/status/shazhou-ww/silvermoon/ci.yml?branch=main&style=flat-square&label=CI" alt="CI status"></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ English | <a href="https://github.com/shazhou-ww/silvermoon/blob/95f48bd2cd07fd43267f7b6a0c9471d2a8d0ca95/README.zh-CN.md">简体中文</a>
21
+ </p>
22
+
23
+ # Silvermoon
24
+
25
+ **The artifact spirit of the project.**
26
+
27
+ ## Quick Start
28
+
29
+ Silvermoon needs Node.js 22 or newer and Git access to the repository's primary
30
+ branch.
31
+
32
+ ```sh
33
+ npm install --save-dev silvermoon
34
+ npx skills add ./node_modules/silvermoon/skills --skill silvermoon --agent github-copilot --yes --copy
35
+ ```
36
+
37
+ Create `.silvermoon/config.yaml`:
38
+
39
+ ```yaml
40
+ version: 1
41
+ primaryRepository: https://github.com/example/repository.git
42
+ primaryBranch: main
43
+ preferredLanguage: en
44
+ ```
45
+
46
+ `preferredLanguage` is optional. A specific idea can override it with
47
+ `language` in `status.yaml`, and `create-idea --language <tag>` can set that
48
+ override when the idea is created. Otherwise Silvermoon checks
49
+ `~/.config/silvermoon/config.yaml` and finally defaults to `en-US`.
50
+
51
+ Then create an idea and let the registered Silvermoon skill guide one safe
52
+ next action at a time:
53
+
54
+ ```sh
55
+ npx silvermoon create-idea --json
56
+ npx silvermoon whats-next <idea> --json
57
+ ```
58
+
59
+ Describe the desired world in the generated `Idea.md`, review it, and approve
60
+ that exact revision. From then on, Silvermoon keeps the goal, implementation,
61
+ repository state, and real-world result connected. See
62
+ [Getting Started](https://github.com/shazhou-ww/silvermoon/blob/95f48bd2cd07fd43267f7b6a0c9471d2a8d0ca95/docs/getting-started.md) for the complete first workflow.
63
+
64
+ ## Why Silvermoon
65
+
66
+ Long-running Agent work usually asks people to carry too much invisible state.
67
+ Someone must remember what was intended, whether the code still matches the
68
+ task, and which conversation or machine knows the latest truth. Silvermoon
69
+ makes those concerns part of the project instead.
70
+
71
+ It lets people step back from continuous supervision and return at the
72
+ decisions that belong to them: approving the intended outcome, accepting the
73
+ implementation, and accepting that the result is true in the outside world.
74
+ Between those boundaries, an Agent can inspect repository facts and continue
75
+ the highest-priority safe action.
76
+
77
+ It also refuses to let a detached task card declare success. Current artifacts
78
+ and explicit decisions jointly determine state, so a changed goal or
79
+ implementation naturally invalidates conclusions that depended on the older
80
+ revision. Because those facts live in Git, work can continue across devices,
81
+ sessions, Agents, and hosting platforms.
82
+
83
+ ## The Project's Artifact Spirit
84
+
85
+ > Fellow Daoist, you wouldn't want your lifebound project to be without an
86
+ > artifact spirit, would you?
87
+
88
+ <table>
89
+ <tr>
90
+ <td width="160" align="center" valign="top">
91
+ <!-- markdownlint-disable-next-line MD013 -->
92
+ <img src="https://raw.githubusercontent.com/shazhou-ww/silvermoon/95f48bd2cd07fd43267f7b6a0c9471d2a8d0ca95/docs/assets/silvermoon-avatar.svg" width="128" alt="Line portrait of Silvermoon, the project's artifact spirit">
93
+ </td>
94
+ <td valign="top">
95
+ Silvermoon is named after a character in <em>A Record of a Mortal's
96
+ Journey to Immortality</em>. She comes from the Silvermoon Wolf Clan in
97
+ the Spirit Realm and is one of the split souls of Ling Long. After losing
98
+ part of her memory in the human realm, she lives as an artifact spirit
99
+ first in a wolf-headed jade scepter and later in Han Li's Bamboo
100
+ Cloudswarm Swords.
101
+ <br><br>
102
+ That image fits this project: Silvermoon does not belong to one operator
103
+ or one chat. It lives with the project's artifacts, understands their
104
+ state, and helps each companion find what comes next. The biography is
105
+ inspiration, not a prerequisite for using the tool.
106
+ </td>
107
+ </tr>
108
+ </table>
109
+
110
+ Watch *A Record of a Mortal's Journey to Immortality*:
111
+
112
+ <!-- markdownlint-disable-next-line MD013 -->
113
+ - YouTube: [Episode 150: Overseas Turmoil 26](https://www.youtube.com/watch?v=GJgezoCBIHM "A Record of a Mortal's Journey to Immortality — Episode 150: Overseas Turmoil 26")
114
+ <!-- markdownlint-disable-next-line MD013 -->
115
+ - Bilibili: [Episode 150: Overseas Turmoil 26](https://www.bilibili.com/bangumi/play/ep1231558 "A Record of a Mortal's Journey to Immortality — Episode 150: Overseas Turmoil 26")
116
+
117
+ ## From Ideal To Real
118
+
119
+ A project is more than a task list or a transcript. It is an ideal becoming
120
+ real through three nested worlds.
121
+
122
+ **Ideal World (道心)** names the outcome worth pursuing. **Inner World (内景)**
123
+ gives that intent shape in repository artifacts. **Outer World (现世)** asks
124
+ whether the shaped work is true where it must actually operate.
125
+
126
+ > 道心立意,内景成形,现世验真。
127
+
128
+ The worlds nest from the inside out. Implementation contains the ideal it
129
+ serves, and deployment contains both. This is an engineering relationship, not
130
+ just a metaphor: when an inner world changes, conclusions from an outer world
131
+ no longer have the same foundation and must be proven again.
132
+
133
+ Humans own approval and acceptance. Agents own continuation: they read the
134
+ contracts, the ledger, and Git facts; preserve concurrent work; execute one
135
+ safe action; and reobserve only after something changes. The context belongs to
136
+ the project, not to a fleeting conversation.
137
+
138
+ ## Further Reading
139
+
140
+ - [Getting Started](https://github.com/shazhou-ww/silvermoon/blob/95f48bd2cd07fd43267f7b6a0c9471d2a8d0ca95/docs/getting-started.md) — installation, configuration,
141
+ and the first idea.
142
+ - [Core Concepts](https://github.com/shazhou-ww/silvermoon/blob/95f48bd2cd07fd43267f7b6a0c9471d2a8d0ca95/docs/core-concepts.md) — project ownership, the three
143
+ worlds, revisions, and decision boundaries.
144
+ - [Operating Silvermoon](https://github.com/shazhou-ww/silvermoon/blob/95f48bd2cd07fd43267f7b6a0c9471d2a8d0ca95/docs/operations.md) — navigation, creation,
145
+ publication, hygiene, and continuation.
146
+ - [Technical Reference](https://github.com/shazhou-ww/silvermoon/blob/95f48bd2cd07fd43267f7b6a0c9471d2a8d0ca95/docs/reference.md) — storage, derived state, CLI
147
+ reports, validation targets, and schemas.
148
+ - [Maintaining Silvermoon](https://github.com/shazhou-ww/silvermoon/blob/95f48bd2cd07fd43267f7b6a0c9471d2a8d0ca95/docs/maintaining.md) — development checks,
149
+ documentation ownership, and release guidance.