silvermoon 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -0
- package/README.zh-CN.md +19 -4
- package/docs/core-concepts.md +14 -12
- package/docs/getting-started.md +53 -27
- package/docs/maintaining.md +11 -2
- package/docs/operations.md +77 -30
- package/docs/reference.md +197 -37
- package/docs/repository-tasks.md +25 -13
- package/package.json +2 -2
- package/schema/v1/idea-status.schema.json +3 -3
- package/skills/silvermoon/SKILL.md +142 -187
- package/skills/silvermoon/references/adoption.md +34 -20
- package/src/adoption.js +136 -260
- package/src/cli.js +86 -113
- package/src/create-idea.js +222 -110
- package/src/dialogue.js +303 -0
- package/src/git.js +172 -97
- package/src/idea-layout.js +59 -123
- package/src/index.js +203 -170
- package/src/observation.js +305 -0
- package/src/trace.js +171 -0
- package/src/whatsnext.js +529 -378
|
@@ -1,111 +1,106 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: silvermoon
|
|
3
|
-
description: "Navigate or create repository-owned ideas
|
|
3
|
+
description: "Navigate or create repository-owned ideas from layered observations and ordered safe instructions."
|
|
4
4
|
argument-hint: "[new | idea ULID or alias]"
|
|
5
5
|
user-invocable: true
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Silvermoon
|
|
9
9
|
|
|
10
|
-
Use Silvermoon to navigate or
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
10
|
+
Use Silvermoon to navigate or create ideas against the configured primary.
|
|
11
|
+
The CLI observes repository and lifecycle state; the Agent performs instructed
|
|
12
|
+
repository or external actions with ordinary tools and Git.
|
|
13
|
+
|
|
14
|
+
## Choose And Run The Command
|
|
15
|
+
|
|
16
|
+
- `/silvermoon new` and other explicit new-idea requests use
|
|
17
|
+
`silvermoon create-idea`. Otherwise use `silvermoon whats-next [idea]`, passing
|
|
18
|
+
a selector only when the user supplied or previously selected it.
|
|
19
|
+
- Bare `whats-next` lists active ideas and offers creation, even when exactly one idea is active.
|
|
20
|
+
Never infer selection; require an explicit ULID or alias.
|
|
21
|
+
- Use `--json` only when a programmatic consumer needs the envelope.
|
|
22
|
+
- Treat each command's `intention`, `observation`, `outcomes`, and `instructions`
|
|
23
|
+
as one report. Read every problem and all ordered instructions; never combine
|
|
24
|
+
reports.
|
|
25
|
+
`project-setup-required` blocks repository work, `repository-sync-required`
|
|
26
|
+
blocks idea routing, and `repository-preparation-required` blocks creation.
|
|
27
|
+
Reobserve after resolving a blocker or making an expected change.
|
|
28
|
+
- Markdown is a rendering of the report, not a second decision model. A
|
|
29
|
+
selected idea reports its lifecycle state; creation reports its new identity.
|
|
30
|
+
|
|
31
|
+
`whats-next` may fetch and inspect but never changes files, branches, index, or
|
|
32
|
+
refs. `create-idea` requires the configured primary branch and upstream plus a
|
|
33
|
+
clean worktree; it does not fetch or compare ancestry. The target does not need
|
|
34
|
+
a package manifest, package manager, Silvermoon dependency, or `node_modules`.
|
|
35
|
+
The packaged skill is canonical; register it at `.agents/skills/silvermoon`
|
|
36
|
+
with the supported `npx skills add` universal target. Silvermoon reports setup
|
|
37
|
+
problems but does not repair them.
|
|
38
|
+
|
|
39
|
+
`check` validates only a project snapshot; it does not navigate ideas or check
|
|
40
|
+
repository synchronization. Default `check` validates committed `HEAD`;
|
|
41
|
+
`--worktree` validates the full candidate and `--staged` the index. Its JSON
|
|
42
|
+
contains `intention` and `observation` only. Exit `0` means valid, `1` invalid
|
|
43
|
+
or unavailable, and `2` invalid usage. Never commit unless the relevant check
|
|
44
|
+
exits `0`.
|
|
45
45
|
|
|
46
46
|
## Preserve Work
|
|
47
47
|
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
`idealRevision`
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- `review-completed`: revise the existing idea definition or create a new idea.
|
|
105
|
-
|
|
106
|
-
## Author The Three Worlds
|
|
107
|
-
|
|
108
|
-
Every idea uses this fixed structure:
|
|
48
|
+
- Inspect all staged, unstaged, and untracked changes before acting. Preserve
|
|
49
|
+
unknown, unrelated, or user-authored work; isolate it or use only an
|
|
50
|
+
explicitly described stash when necessary.
|
|
51
|
+
- Never use force-push, reset, broad clean, or silent history rewrites. Delete
|
|
52
|
+
only operation-owned paths or paths the user explicitly names.
|
|
53
|
+
- Follow reported synchronization steps in order and use the reported primary
|
|
54
|
+
tip as the expected remote tip. On rejection or concurrent movement, preserve
|
|
55
|
+
both histories and reobserve; never replay a stale decision.
|
|
56
|
+
|
|
57
|
+
## Create And Publish An Idea
|
|
58
|
+
|
|
59
|
+
`create-idea` creates only the scaffold: `Idea.md`, `Implementation.md`,
|
|
60
|
+
`Deployment.md`, `ledger.md`, and `status.yaml`. It never stages, commits,
|
|
61
|
+
pushes, or records a decision. Preserve explicit creation intent through
|
|
62
|
+
hygiene retries: retry `create-idea`, not bare `whats-next`.
|
|
63
|
+
|
|
64
|
+
During preparation, complete the `Idea.md` ideal contract. Keep the
|
|
65
|
+
Implementation, Deployment, and matching ledger placeholders synchronized
|
|
66
|
+
until their lifecycle actions. Review every generated path and validate the
|
|
67
|
+
candidate, then commit and publish it to configured primary through the normal
|
|
68
|
+
non-force path before asking the user to review or approve it. Verify the commit
|
|
69
|
+
is reachable from refreshed primary and reobserve the exact `idealRevision`.
|
|
70
|
+
If publication requires a pull request, wait until it reaches primary. If
|
|
71
|
+
publication is blocked, say the candidate is not yet available for cross-device
|
|
72
|
+
review; never ask for approval of unpublished content. Publication is not
|
|
73
|
+
approval and must not change `status.yaml`.
|
|
74
|
+
|
|
75
|
+
An Agent may derive a concise, unique alias; do not ask for a name solely for
|
|
76
|
+
the alias. Pass `--language <tag>` only when the user explicitly requests a
|
|
77
|
+
stable language override. Do not use that option with `whats-next` or `check`.
|
|
78
|
+
|
|
79
|
+
## Continue The Selected Idea
|
|
80
|
+
|
|
81
|
+
Use the reported `ledgerPath` after lifecycle hygiene and continue only the
|
|
82
|
+
selected world's unfinished work:
|
|
83
|
+
|
|
84
|
+
- **Preparing:** Edit `Idea.md` and supporting Ideal World (理想世界) files.
|
|
85
|
+
Supporting files serve the contract, not replace it. After explicit approval,
|
|
86
|
+
record the reported `idealRevision` as `approvedRevision`.
|
|
87
|
+
- **Implementing:** Edit `Implementation.md`, supporting Inner World (主体世界)
|
|
88
|
+
files, and repository deliverables. Change the ideal only if it truly changed
|
|
89
|
+
and the idea must return to preparing. After explicit acceptance, record the
|
|
90
|
+
reported `implementationRevision` as `implementationAcceptedRevision`.
|
|
91
|
+
- **Deploying:** Use `Deployment.md` and supporting Outer World (现实世界) files
|
|
92
|
+
to drive and verify external outcomes; do not change repository deliverables.
|
|
93
|
+
Publish a new or materially changed deployment contract first, reobserve its
|
|
94
|
+
stable `deploymentRevision`, then run checks against it and record evidence
|
|
95
|
+
in the ledger. After explicit acceptance, record the reported
|
|
96
|
+
`deploymentRevision` as `deploymentAcceptedRevision`.
|
|
97
|
+
- **Abandoned:** Keep canonical `abandoned: true`, remove it only after an
|
|
98
|
+
explicit reversal, or choose another idea.
|
|
99
|
+
- **Completed:** Revise its definition or create a different idea.
|
|
100
|
+
|
|
101
|
+
## Author Contracts And Continue From The Ledger
|
|
102
|
+
|
|
103
|
+
Each idea has three canonical entries:
|
|
109
104
|
|
|
110
105
|
```text
|
|
111
106
|
.silvermoon/ideas/<ULID>/
|
|
@@ -119,98 +114,58 @@ Every idea uses this fixed structure:
|
|
|
119
114
|
└── Idea.md
|
|
120
115
|
```
|
|
121
116
|
|
|
122
|
-
`Idea.md` is the
|
|
123
|
-
|
|
124
|
-
World (
|
|
125
|
-
|
|
126
|
-
|
|
117
|
+
`Idea.md` is the Ideal World (理想世界) ideal contract, `Implementation.md` is
|
|
118
|
+
the Inner World (主体世界) inner implementation contract, and `Deployment.md`
|
|
119
|
+
is the Outer World (现实世界) real-world deployment contract. Each world may
|
|
120
|
+
contain supporting files, but those artifacts serve the same-world entry and
|
|
121
|
+
never define a second contract.
|
|
127
122
|
|
|
128
123
|
In `Implementation.md` and `Deployment.md`, put plans under `## Steps` and
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
method changes materially, reset its checkbox and re-run the work or proof.
|
|
175
|
-
Infer the next action from `whats-next`, the world contracts, and unchecked
|
|
176
|
-
ledger entries; do not maintain duplicate Current or Next summaries.
|
|
177
|
-
If relevant ledger entries remain unchecked, continue the reported world
|
|
178
|
-
action. If all relevant entries are checked, their evidence remains valid, and
|
|
179
|
-
the candidate is published, stop editing and request explicit acceptance for
|
|
180
|
-
the exact revision reported by `whats-next`.
|
|
181
|
-
|
|
182
|
-
`[x]` means only that the Agent recorded work or a check as complete. It never
|
|
183
|
-
approves an Ideal World, accepts implementation or deployment, changes
|
|
184
|
-
`status.yaml`, or authorizes publication. Record test names, commands,
|
|
185
|
-
artifacts, and results in the corresponding world criterion or concise ledger
|
|
186
|
-
notes without creating a separate evidence schema or public API contract.
|
|
187
|
-
|
|
188
|
-
## Write Status Facts
|
|
189
|
-
|
|
190
|
-
Silvermoon has no approval, acceptance, or abandonment mutation commands.
|
|
191
|
-
Update the idea's `status.yaml` with ordinary file editing:
|
|
192
|
-
|
|
193
|
-
1. Reconfirm the decision applies to the selected idea and current
|
|
194
|
-
world revision reported by `whats-next`.
|
|
195
|
-
2. Add or update only the corresponding revision field, or add/remove canonical
|
|
196
|
-
`abandoned: true` after an explicit human decision.
|
|
197
|
-
3. Run `silvermoon check --worktree --json` while reviewing the complete
|
|
198
|
-
candidate, then stage it and run `silvermoon check --staged --json`.
|
|
199
|
-
4. Commit the status decision separately when practical, then non-force push
|
|
200
|
-
with the observation's `observedPrimaryCommit` as expected tip.
|
|
201
|
-
|
|
202
|
-
Never infer a human decision from silence, prose, Git activity, or an outer
|
|
203
|
-
command. Old revision values remain as history and become inactive naturally
|
|
204
|
-
when the idea folder changes.
|
|
205
|
-
|
|
206
|
-
## Advance The Loop
|
|
207
|
-
|
|
208
|
-
Re-run the intent-preserving entry command only after an expected repository
|
|
209
|
-
delta, an unexpected input change, or a newly arrived external result: use
|
|
210
|
-
`create-idea` for a pending explicit creation and `whats-next` otherwise. End
|
|
211
|
-
the current turn when waiting for human/external input. Report an actionable
|
|
212
|
-
error with its recovery condition, or report no progress and stop if guidance
|
|
213
|
-
completed without a delta. Never poll the same observation.
|
|
124
|
+
outcomes under `## Acceptance criteria`. Use stable level-three IDs: `I-Sxx`,
|
|
125
|
+
`I-ACxx`, `D-Sxx`, and `D-ACxx`. Each criterion states an observable outcome
|
|
126
|
+
and how to prove it. Do not put checkboxes in world contracts. World content
|
|
127
|
+
changes its world revision and containing revisions; `status.yaml` and
|
|
128
|
+
`ledger.md` are outside those trees.
|
|
129
|
+
|
|
130
|
+
The required idea-root `ledger.md` is operational memory, not a fourth world,
|
|
131
|
+
contract, or human decision. Mirror the stable IDs and short titles for
|
|
132
|
+
Implementation and Deployment steps and criteria. Update ledger entries with
|
|
133
|
+
their contract changes; add new items unchecked and reset completed items when
|
|
134
|
+
requirements or proof change materially. If relevant entries remain unchecked,
|
|
135
|
+
continue the reported work. If they are all checked, evidence remains valid,
|
|
136
|
+
and the candidate is published, stop and request the appropriate explicit
|
|
137
|
+
acceptance. A checked box records Agent work only; it never approves, accepts,
|
|
138
|
+
changes status, or authorizes publication.
|
|
139
|
+
|
|
140
|
+
## Record Decisions And Request Review
|
|
141
|
+
|
|
142
|
+
Silvermoon has no approval, acceptance, or abandonment mutation commands. After
|
|
143
|
+
an explicit human decision, reconfirm it applies to the selected idea and exact
|
|
144
|
+
revision from `whats-next`; change only the corresponding status fact. Never
|
|
145
|
+
infer a decision from silence, prose, Git activity, ledger checkboxes, or an
|
|
146
|
+
outer command.
|
|
147
|
+
|
|
148
|
+
Before requesting approval or acceptance, identify the idea by alias and ULID,
|
|
149
|
+
state the decision and exact reported world revision, and include a clickable
|
|
150
|
+
permalink to the canonical entry at the published primary commit: `Idea.md`
|
|
151
|
+
for ideal approval, `Implementation.md` for implementation acceptance, or
|
|
152
|
+
`Deployment.md` for deployment acceptance. Prefer a commit-pinned web URL (for
|
|
153
|
+
GitHub, `/blob/<commit>/<path>`), not a local path or moving branch link.
|
|
154
|
+
Confirm the commit is reachable from refreshed primary. If no reliable
|
|
155
|
+
permalink can be formed, give the commit and repository-relative path and
|
|
156
|
+
explain why; never provide a misleading link. Publication and links enable
|
|
157
|
+
review but do not constitute the user's decision.
|
|
158
|
+
|
|
159
|
+
For status changes, validate with `silvermoon check --worktree`, stage the
|
|
160
|
+
candidate, then run `silvermoon check --staged`. Commit separately when
|
|
161
|
+
practical and publish non-force using the latest reported primary tip.
|
|
162
|
+
|
|
163
|
+
## Advance Safely
|
|
164
|
+
|
|
165
|
+
Rerun the intent-preserving command only after an expected repository change,
|
|
166
|
+
unexpected input, or new external result. Stop when waiting for a human or
|
|
167
|
+
external result; do not poll an unchanged observation. Report actionable
|
|
168
|
+
blockers and their recovery condition.
|
|
214
169
|
|
|
215
170
|
Follow [adoption.md](./references/adoption.md) when creating or explicitly
|
|
216
171
|
converting a repository to Silvermoon.
|
|
@@ -2,28 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
## New repositories
|
|
4
4
|
|
|
5
|
-
Start with a complete
|
|
5
|
+
Start with a complete diagnosis, even in an unfamiliar repository:
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npx silvermoon@<version> whats-next
|
|
8
|
+
npx silvermoon@<version> whats-next
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
The
|
|
12
|
-
and
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
The dialogue uses lightweight Markdown headings for intention, observation,
|
|
12
|
+
and ordered instructions. It includes actions and outcomes only if side
|
|
13
|
+
effects were attempted. Add `--json` only when a programmatic consumer needs
|
|
14
|
+
the `intention / observation / outcomes / instructions` envelope (including
|
|
15
|
+
`outcomes: []` when none were attempted).
|
|
16
|
+
The command may fetch after local readiness passes, but it does not move the
|
|
17
|
+
worktree, index, branches, or named refs.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
The target repository may use any language or build ecosystem. It does not
|
|
20
|
+
need `package.json`, a package manager, a Silvermoon dependency, or
|
|
21
|
+
`node_modules`. Use any compatible Silvermoon installation, and register the
|
|
22
|
+
canonical skill bundled with that running installation:
|
|
18
23
|
|
|
19
24
|
```sh
|
|
20
|
-
|
|
21
|
-
npx skills add ./node_modules/silvermoon/skills --skill silvermoon --agent github-copilot --yes --copy
|
|
25
|
+
npx skills add <path-to-running-silvermoon>/skills --skill silvermoon --agent universal --yes --copy
|
|
22
26
|
```
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
This writes the single repository-local registration at
|
|
29
|
+
`.agents/skills/silvermoon`. Registration and updates belong to `npx skills`;
|
|
30
|
+
Silvermoon compares that path with its bundled canonical skill but never
|
|
31
|
+
overwrites it.
|
|
27
32
|
|
|
28
33
|
Create `.silvermoon/config.yaml` with the fixed version 1 contract:
|
|
29
34
|
|
|
@@ -41,10 +46,18 @@ Commit the configuration, then run:
|
|
|
41
46
|
```sh
|
|
42
47
|
silvermoon check --commit HEAD
|
|
43
48
|
silvermoon check --remote
|
|
44
|
-
silvermoon create-idea
|
|
45
|
-
silvermoon whats-next <ULID>
|
|
49
|
+
silvermoon create-idea
|
|
50
|
+
silvermoon whats-next <ULID>
|
|
46
51
|
```
|
|
47
52
|
|
|
53
|
+
`check` validates the selected project snapshot only; it does not navigate
|
|
54
|
+
ideas or check worktree hygiene and upstream. Default `check` validates
|
|
55
|
+
committed `HEAD`, whereas `check --staged` validates the index for pre-commit
|
|
56
|
+
hooks. Its JSON contains only `intention` and `observation`; it does not
|
|
57
|
+
include dialogue `outcomes` or `instructions`. Exit code `0` means valid,
|
|
58
|
+
`1` means invalid or unavailable, and `2` means invalid CLI usage. A failed
|
|
59
|
+
or unavailable check must not allow a commit.
|
|
60
|
+
|
|
48
61
|
Create or repair configuration through ordinary reviewed file editing.
|
|
49
62
|
Silvermoon reports every configuration finding but has no init or setup command.
|
|
50
63
|
|
|
@@ -64,10 +77,11 @@ Each idea is self-contained:
|
|
|
64
77
|
`-- Idea.md
|
|
65
78
|
```
|
|
66
79
|
|
|
67
|
-
Ideal World (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
80
|
+
Ideal World (理想世界) uses the `Idea.md` ideal contract.
|
|
81
|
+
Inner World (主体世界) uses the `Implementation.md` inner implementation
|
|
82
|
+
contract. Outer World (现实世界) uses the `Deployment.md` real-world
|
|
83
|
+
deployment contract. Each world may have supporting files and directories, but
|
|
84
|
+
they serve rather than replace the canonical same-world entry.
|
|
71
85
|
|
|
72
86
|
The nested opaque Git trees produce `idealRevision`,
|
|
73
87
|
`implementationRevision`, and `deploymentRevision`. Inner World includes Ideal
|
|
@@ -98,7 +112,7 @@ Status may additionally contain canonical `abandoned: true`,
|
|
|
98
112
|
`deploymentAcceptedRevision` in that order. Decisions must bind to their
|
|
99
113
|
corresponding current world revision.
|
|
100
114
|
|
|
101
|
-
For a new scaffold, run `silvermoon create-idea
|
|
115
|
+
For a new scaffold, run `silvermoon create-idea`. It generates the ULID,
|
|
102
116
|
four structured documents and alias-less status; it does not stage, commit,
|
|
103
117
|
push, approve, or accept. During initial preparation, complete `Idea.md` while
|
|
104
118
|
keeping the Implementation, Deployment, and ledger placeholders synchronized
|