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 +149 -236
- package/README.zh-CN.md +114 -199
- package/assets/silvermoon.svg +176 -175
- package/bin/silvermoon.js +0 -0
- package/docs/assets/silvermoon-avatar.svg +395 -0
- package/docs/core-concepts.md +69 -0
- package/docs/getting-started.md +115 -0
- package/docs/maintaining.md +56 -0
- package/docs/npm-package-releases.md +139 -0
- package/docs/operations.md +110 -0
- package/docs/reference.md +138 -0
- package/docs/repository-tasks.md +61 -0
- package/package.json +69 -65
- package/schema/v1/config.schema.json +27 -24
- package/schema/v1/definitions.schema.json +30 -25
- package/schema/v1/idea-status.schema.json +44 -41
- package/schema/v1/user-config.schema.json +19 -0
- package/skills/silvermoon/SKILL.md +216 -209
- package/skills/silvermoon/references/adoption.md +122 -122
- package/src/adoption.js +313 -313
- package/src/cli.js +200 -196
- package/src/config.js +193 -176
- package/src/create-idea.js +272 -235
- package/src/git.js +284 -284
- package/src/idea-layout.js +439 -439
- package/src/idea-templates.js +109 -109
- package/src/ideas.js +140 -131
- package/src/index.js +260 -260
- package/src/language.js +29 -0
- package/src/layout.js +21 -21
- package/src/repository.js +87 -87
- package/src/user-config.js +135 -0
- package/src/whatsnext.js +453 -378
- package/src/yaml.js +66 -66
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# npm package releases
|
|
2
|
+
|
|
3
|
+
This repository publishes an allowlisted package when an authorized
|
|
4
|
+
tag under `npm/` reaches GitHub. The tag is a release instruction; the package
|
|
5
|
+
manifest at the tagged commit remains authoritative for the package name and
|
|
6
|
+
version.
|
|
7
|
+
|
|
8
|
+
The current release mapping is:
|
|
9
|
+
|
|
10
|
+
| Release key | Package | Directory |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| `silvermoon` | `silvermoon` | `.` |
|
|
13
|
+
|
|
14
|
+
A stable tag such as `npm/silvermoon/v0.1.1` publishes with the npm `latest`
|
|
15
|
+
dist-tag. A named prerelease such as `npm/silvermoon/v0.2.0-beta.1` publishes
|
|
16
|
+
with the `beta` dist-tag. Numeric-only prerelease channels are intentionally
|
|
17
|
+
rejected.
|
|
18
|
+
|
|
19
|
+
## One-time configuration
|
|
20
|
+
|
|
21
|
+
### npm trusted publisher
|
|
22
|
+
|
|
23
|
+
In the npm package settings, add a GitHub Actions trusted publisher with these
|
|
24
|
+
exact values:
|
|
25
|
+
|
|
26
|
+
- Organization or user: `shazhou-ww`
|
|
27
|
+
- Repository: `silvermoon`
|
|
28
|
+
- Workflow filename: `publish-npm.yml`
|
|
29
|
+
- Environment: `npm`
|
|
30
|
+
- Allowed action: direct `npm publish`
|
|
31
|
+
|
|
32
|
+
The workflow filename is identity-sensitive on npm. If it changes, update the
|
|
33
|
+
npm trusted-publisher configuration before attempting another release. Do not
|
|
34
|
+
create an npm automation token or store `NPM_TOKEN` or `NODE_AUTH_TOKEN` in
|
|
35
|
+
GitHub secrets; the workflow uses GitHub OIDC with `id-token: write`.
|
|
36
|
+
|
|
37
|
+
### GitHub environment
|
|
38
|
+
|
|
39
|
+
Create an environment named `npm`. Limit deployments to protected tags in the
|
|
40
|
+
`npm/**` namespace. Add required reviewers when the repository needs a manual
|
|
41
|
+
release approval; the workflow itself does not require a repository secret.
|
|
42
|
+
|
|
43
|
+
The npm trusted publisher and the workflow environment name must remain the
|
|
44
|
+
same. A mismatch prevents npm from accepting the OIDC identity.
|
|
45
|
+
|
|
46
|
+
The workflow uses a GitHub-hosted runner, `id-token: write`, Node 24,
|
|
47
|
+
`actions/setup-node` with `registry-url: https://registry.npmjs.org`, and a
|
|
48
|
+
pinned npm CLI version at or above `11.5.1`. These are source-controlled OIDC
|
|
49
|
+
preconditions; do not replace them with a write token.
|
|
50
|
+
|
|
51
|
+
### Tag ruleset
|
|
52
|
+
|
|
53
|
+
Create an active GitHub tag ruleset targeting `npm/**`. Restrict tag creation,
|
|
54
|
+
update, and deletion to the release maintainers or a dedicated release team.
|
|
55
|
+
Do not allow release tags to be moved after creation. The workflow independently
|
|
56
|
+
fetches `origin/main` and rejects a tagged commit that is not reachable from
|
|
57
|
+
that refreshed branch.
|
|
58
|
+
|
|
59
|
+
Tag protection is part of the trust boundary: GitHub loads a workflow from the
|
|
60
|
+
tagged commit, so only authorized maintainers should be able to create tags in
|
|
61
|
+
the release namespace.
|
|
62
|
+
|
|
63
|
+
## Publish a version
|
|
64
|
+
|
|
65
|
+
1. Update the selected package's `version` in its committed `package.json`.
|
|
66
|
+
2. Run `pnpm install --frozen-lockfile` and `pnpm check`. The complete check
|
|
67
|
+
includes unit, contract, integration, package contents, installed-package
|
|
68
|
+
E2E, and skill discovery.
|
|
69
|
+
3. Merge the version change to `main`; do not tag an unmerged branch or local
|
|
70
|
+
working tree.
|
|
71
|
+
4. When the release is a deployment criterion of an active Silvermoon idea,
|
|
72
|
+
record implementation acceptance for the approved current idea revision,
|
|
73
|
+
publish that status-only commit, and require `silvermoon whats-next <idea>` to
|
|
74
|
+
return `deploy-idea`. Never create the release tag while the idea still
|
|
75
|
+
derives `implementing`.
|
|
76
|
+
5. Fetch the current primary branch and tags.
|
|
77
|
+
6. Create the package-specific tag at `origin/main` and push that exact tag.
|
|
78
|
+
|
|
79
|
+
For `silvermoon@0.1.1`:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
git fetch origin main --tags
|
|
83
|
+
git tag npm/silvermoon/v0.1.1 origin/main
|
|
84
|
+
git push origin refs/tags/npm/silvermoon/v0.1.1
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The tag version must exactly equal [`package.json`](../package.json). The
|
|
88
|
+
workflow never edits a manifest or chooses a version.
|
|
89
|
+
|
|
90
|
+
The [`publish-npm.yml`](../.github/workflows/publish-npm.yml) workflow then:
|
|
91
|
+
|
|
92
|
+
1. verifies the tagged commit is reachable from refreshed `origin/main`;
|
|
93
|
+
2. installs the frozen pnpm dependencies;
|
|
94
|
+
3. runs the allowlisted release planner and confirms the version is absent
|
|
95
|
+
from npm;
|
|
96
|
+
4. runs `pnpm test:unit`, `pnpm test:contract`, `pnpm test:integration`, and
|
|
97
|
+
`pnpm check:skills`;
|
|
98
|
+
5. runs the selected package's `npm run pack:check` and
|
|
99
|
+
`npm run test:e2e`; and
|
|
100
|
+
6. publishes only the selected directory with provenance and the derived npm
|
|
101
|
+
dist-tag.
|
|
102
|
+
|
|
103
|
+
Release runs are serialized within this repository. The registry preflight and
|
|
104
|
+
`npm publish` cannot form one cross-system transaction, so an external
|
|
105
|
+
publisher could still win that interval; npm then atomically rejects the
|
|
106
|
+
duplicate publication without replacing the existing version.
|
|
107
|
+
|
|
108
|
+
## Failure behavior
|
|
109
|
+
|
|
110
|
+
Publication stops before `npm publish` when the tag is malformed, the release
|
|
111
|
+
key is unknown, the package is private, the package name or version differs
|
|
112
|
+
from the mapping and tag, the npm publish configuration is not public npmjs,
|
|
113
|
+
the commit is outside `origin/main`, the version already exists, registry state
|
|
114
|
+
cannot be verified, or validation fails.
|
|
115
|
+
|
|
116
|
+
For a transient GitHub or registry failure before publication, rerun the same
|
|
117
|
+
workflow run. Do not move or recreate the tag. For a source, manifest, or
|
|
118
|
+
validation failure, make a new commit on `main`, choose a new version, and push
|
|
119
|
+
a new tag after the fix is merged. npm versions and release tags are immutable.
|
|
120
|
+
|
|
121
|
+
## Add another package
|
|
122
|
+
|
|
123
|
+
1. Give the package a committed canonical `name`, SemVer `version`, and
|
|
124
|
+
`publishConfig` with `access: public` and registry
|
|
125
|
+
`https://registry.npmjs.org/`.
|
|
126
|
+
2. Add a fixed release-key entry to `RELEASE_PACKAGES` in
|
|
127
|
+
[`prepare-npm-release.mjs`](../scripts/prepare-npm-release.mjs). Never derive
|
|
128
|
+
a filesystem path directly from tag text.
|
|
129
|
+
3. Extend the release tests with the package selection, identity, version, and
|
|
130
|
+
dist-tag cases.
|
|
131
|
+
4. Add the same `publish-npm.yml` trusted publisher to that npm package, using
|
|
132
|
+
the `npm` environment.
|
|
133
|
+
5. Keep its tags under the protected `npm/<release-key>/v<semver>` convention.
|
|
134
|
+
|
|
135
|
+
Run `node --test test/unit/prepare-npm-release.test.mjs
|
|
136
|
+
test/integration/prepare-npm-release.test.mjs
|
|
137
|
+
test/contract/npm-release.test.mjs` for focused release validation and
|
|
138
|
+
`pnpm check` for the complete repository suite before merging the mapping
|
|
139
|
+
change.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Operating Silvermoon
|
|
2
|
+
|
|
3
|
+
This guide is the authoritative routine workflow for navigating, changing, and
|
|
4
|
+
publishing Silvermoon ideas.
|
|
5
|
+
|
|
6
|
+
## Navigate
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npx silvermoon whats-next
|
|
10
|
+
npx silvermoon whats-next 01M36QGPNTXEPP61DA4KP4AVZF
|
|
11
|
+
npx silvermoon whats-next publish-documentation --json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Without a selector, Silvermoon asks for a choice among multiple active ideas,
|
|
15
|
+
continues a single active idea, or reports that a new idea can be created. A
|
|
16
|
+
selector is either a canonical uppercase ULID or an exact, unique,
|
|
17
|
+
case-sensitive alias.
|
|
18
|
+
|
|
19
|
+
Each successful report includes the effective `language` tag and its `idea`,
|
|
20
|
+
`project`, `global`, or `default` source. Its action guidance requires the
|
|
21
|
+
Agent to use that language for world entries, same-world supporting artifacts,
|
|
22
|
+
the ledger, and user-facing explanations. Commands, identifiers, schema fields,
|
|
23
|
+
protocol markers, and verbatim tool output retain their original form.
|
|
24
|
+
|
|
25
|
+
Every invocation first checks the configured primary branch, merge conflicts,
|
|
26
|
+
worktree changes, and local/remote primary ancestry. It may fetch and inspect,
|
|
27
|
+
but it never edits, checks out, merges, commits, stashes, deletes, resets,
|
|
28
|
+
fast-forwards, or pushes.
|
|
29
|
+
|
|
30
|
+
## Create An Idea
|
|
31
|
+
|
|
32
|
+
Explicit creation uses:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npx silvermoon create-idea --json
|
|
36
|
+
npx silvermoon create-idea --language zh-cn --json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Creation intent is distinct from active-idea selection. If hygiene blocks the
|
|
40
|
+
command, perform only the reported remediation and retry `create-idea`; do not
|
|
41
|
+
replace the request with selector-less navigation.
|
|
42
|
+
|
|
43
|
+
`--language` is the only command-level language override. It normalizes a valid
|
|
44
|
+
BCP 47 tag and writes it to the new idea's `status.yaml`. Without the option,
|
|
45
|
+
creation writes no language field and the idea dynamically inherits project,
|
|
46
|
+
user, or `en-US` defaults. `whats-next` and `check` do not accept the option.
|
|
47
|
+
|
|
48
|
+
The generated files remain untracked for review. Complete `Idea.md`, optionally
|
|
49
|
+
add a concise unique alias, inspect every path, and publish the initial idea
|
|
50
|
+
through ordinary Git.
|
|
51
|
+
|
|
52
|
+
## Execute One Action
|
|
53
|
+
|
|
54
|
+
Treat the command, request, `observedPrimaryCommit`, selected idea, and action
|
|
55
|
+
as one immutable observation. Execute only the highest-priority action.
|
|
56
|
+
|
|
57
|
+
Repository hygiene actions take precedence over lifecycle work. Inspect exact
|
|
58
|
+
staged, unstaged, untracked, and conflicted paths; preserve unknown and
|
|
59
|
+
concurrent work. Never force-push, use `reset --hard`, broadly clean the
|
|
60
|
+
worktree, or silently rewrite history to satisfy guidance.
|
|
61
|
+
|
|
62
|
+
After an observable change, run `whats-next` again. Do not poll an unchanged
|
|
63
|
+
observation.
|
|
64
|
+
|
|
65
|
+
## Author World Contracts
|
|
66
|
+
|
|
67
|
+
`Idea.md` is the Ideal World entry. `Implementation.md` and `Deployment.md`
|
|
68
|
+
contain `## Steps` and `## Acceptance criteria`. Every item uses a stable
|
|
69
|
+
level-three heading:
|
|
70
|
+
|
|
71
|
+
- implementation steps: `I-Sxx`
|
|
72
|
+
- implementation criteria: `I-ACxx`
|
|
73
|
+
- deployment steps: `D-Sxx`
|
|
74
|
+
- deployment criteria: `D-ACxx`
|
|
75
|
+
|
|
76
|
+
Each criterion states both the observable outcome and how an Agent can prove
|
|
77
|
+
it. World contracts do not use task-list checkboxes.
|
|
78
|
+
|
|
79
|
+
The required idea-root `ledger.md` mirrors those IDs and short titles as
|
|
80
|
+
checkboxes under Implementation and Deployment. Update a world heading and its
|
|
81
|
+
ledger entry together. Add new items unchecked, and reset a completed item when
|
|
82
|
+
its requirement or proof changes materially.
|
|
83
|
+
|
|
84
|
+
## Record A Human Decision
|
|
85
|
+
|
|
86
|
+
After an explicit decision, reconfirm that it applies to the selected idea and
|
|
87
|
+
the current reported world revision. Edit only the corresponding status fact:
|
|
88
|
+
|
|
89
|
+
- `approvedRevision`
|
|
90
|
+
- `implementationAcceptedRevision`
|
|
91
|
+
- `deploymentAcceptedRevision`
|
|
92
|
+
- canonical `abandoned: true`, or remove it after an explicit reversal
|
|
93
|
+
|
|
94
|
+
Validate the complete candidate:
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
npx silvermoon check --worktree --json
|
|
98
|
+
git add .silvermoon/ideas/<ULID>/status.yaml
|
|
99
|
+
npx silvermoon check --staged --json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Prefer a status-only decision commit, publish through the repository's normal
|
|
103
|
+
non-force path, and verify the commit is reachable from refreshed primary.
|
|
104
|
+
|
|
105
|
+
## Publish Work
|
|
106
|
+
|
|
107
|
+
Before publication, compare with the observed primary tip, run checks focused
|
|
108
|
+
on the change, and inspect the exact diff. On push rejection, branch movement,
|
|
109
|
+
or a newly discovered conflict, preserve both histories, fetch, and reobserve.
|
|
110
|
+
Never replay approval or acceptance automatically against a new revision.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Technical Reference
|
|
2
|
+
|
|
3
|
+
This page is the authoritative reference for Silvermoon storage, revisions,
|
|
4
|
+
derived state, CLI reports, and validation.
|
|
5
|
+
|
|
6
|
+
## Fixed Storage Layout
|
|
7
|
+
|
|
8
|
+
Each idea is self-contained under one canonical uppercase ULID:
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
.silvermoon/
|
|
12
|
+
|-- config.yaml
|
|
13
|
+
`-- ideas/
|
|
14
|
+
`-- 01M36QGPNTXEPP61DA4KP4AVZF/
|
|
15
|
+
|-- status.yaml
|
|
16
|
+
|-- ledger.md
|
|
17
|
+
`-- outer/
|
|
18
|
+
|-- Deployment.md
|
|
19
|
+
`-- inner/
|
|
20
|
+
|-- Implementation.md
|
|
21
|
+
`-- ideal/
|
|
22
|
+
`-- Idea.md
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Every world may contain supporting files and directories, but they serve the
|
|
26
|
+
canonical same-world entry and never define another contract. Metadata paths
|
|
27
|
+
are fixed regular files and directories.
|
|
28
|
+
|
|
29
|
+
The optional user configuration is always
|
|
30
|
+
`~/.config/silvermoon/config.yaml`, on every platform. It is outside the
|
|
31
|
+
repository and contains version 1 plus an optional `preferredLanguage`.
|
|
32
|
+
Missing user configuration means no user preference; an invalid or unreadable
|
|
33
|
+
explicit file is an error rather than a silent fallback.
|
|
34
|
+
|
|
35
|
+
The repository configuration accepts optional `preferredLanguage` after
|
|
36
|
+
`primaryBranch`. Stored language values are canonical BCP 47 tags.
|
|
37
|
+
|
|
38
|
+
## World Revisions
|
|
39
|
+
|
|
40
|
+
Each world is an opaque Git tree:
|
|
41
|
+
|
|
42
|
+
- `idealRevision` identifies `ideal/`.
|
|
43
|
+
- `implementationRevision` identifies `inner/` and includes the Ideal World.
|
|
44
|
+
- `deploymentRevision` identifies `outer/` and includes both nested worlds.
|
|
45
|
+
|
|
46
|
+
`status.yaml` and `ledger.md` are outside all three world trees. The repository
|
|
47
|
+
object format in use determines revision shape; Silvermoon validates object
|
|
48
|
+
types and candidate bindings rather than interpreting world contents.
|
|
49
|
+
|
|
50
|
+
## Status File
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
version: 1
|
|
54
|
+
id: 01M36QGPNTXEPP61DA4KP4AVZF
|
|
55
|
+
alias: publish-documentation
|
|
56
|
+
language: zh-CN
|
|
57
|
+
approvedRevision: 0123456789abcdef0123456789abcdef01234567
|
|
58
|
+
implementationAcceptedRevision: 0123456789abcdef0123456789abcdef01234567
|
|
59
|
+
deploymentAcceptedRevision: 0123456789abcdef0123456789abcdef01234567
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`version` and `id` are required. `alias` and canonical BCP 47 `language` are
|
|
63
|
+
optional. Other optional keys, in canonical order, are `abandoned: true` and
|
|
64
|
+
the three revision fields shown above. `language` is status outside every
|
|
65
|
+
world revision and does not change lifecycle decisions. Explicit
|
|
66
|
+
`abandoned: false`, derived state, criteria mirrors, source locators, unknown
|
|
67
|
+
keys, YAML aliases or anchors, comments, and noncanonical YAML are rejected.
|
|
68
|
+
|
|
69
|
+
Effective language resolves as `idea language > project preferredLanguage >
|
|
70
|
+
user preferredLanguage > en-US`. JSON reports expose
|
|
71
|
+
`language: { tag, source }`; human output shows the same values. Missing idea
|
|
72
|
+
language remains dynamically inherited and is never written back.
|
|
73
|
+
|
|
74
|
+
State is derived in order:
|
|
75
|
+
|
|
76
|
+
1. `abandoned` when `abandoned: true`.
|
|
77
|
+
2. `preparing` when `approvedRevision` differs from `idealRevision`.
|
|
78
|
+
3. `implementing` when `implementationAcceptedRevision` differs from
|
|
79
|
+
`implementationRevision`.
|
|
80
|
+
4. `deploying` when `deploymentAcceptedRevision` differs from
|
|
81
|
+
`deploymentRevision`.
|
|
82
|
+
5. `completed` when all three revisions match.
|
|
83
|
+
|
|
84
|
+
## Public Commands
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
silvermoon whats-next [idea]
|
|
88
|
+
silvermoon create-idea [--language <tag>]
|
|
89
|
+
silvermoon check [--remote | --commit <revision> | --staged | --worktree]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`whats-next` returns one highest-priority action after repository and onboarding
|
|
93
|
+
diagnosis. JSON reports include `observedPrimaryCommit`, `language`,
|
|
94
|
+
`selectedIdea`, and exactly one `action`. When onboarding passes without gaps,
|
|
95
|
+
the report omits `onboarding`. Otherwise `onboarding.gaps` contains only unmet,
|
|
96
|
+
conflicting, or unknown requirements, preserving their stable IDs, statuses,
|
|
97
|
+
blocking flags, dependencies, observed facts, and structured remediation. The
|
|
98
|
+
compact onboarding report also includes a recommended action and recheck
|
|
99
|
+
command. Human-readable output follows the same quiet-success, actionable-gap
|
|
100
|
+
semantics. Use `check` when a complete repository diagnostic is required.
|
|
101
|
+
|
|
102
|
+
Execution source is classified as `source-checkout`, `project-local`,
|
|
103
|
+
`temporary`, `global`, or `unknown`. Temporary execution can bootstrap
|
|
104
|
+
diagnosis; normal idea work requires the exact project dependency, installed
|
|
105
|
+
package, and matching repository-local skill.
|
|
106
|
+
|
|
107
|
+
`create-idea` applies the same hygiene preflight and then creates one canonical
|
|
108
|
+
scaffold. Its optional language override is normalized before preflight and is
|
|
109
|
+
the only command override; without it the status remains dynamically
|
|
110
|
+
inherited. It does not stage, commit, push, or record approval.
|
|
111
|
+
|
|
112
|
+
## Validation Targets
|
|
113
|
+
|
|
114
|
+
- `check` validates only the committed `HEAD` snapshot and reads primary
|
|
115
|
+
coordinates from that snapshot.
|
|
116
|
+
- `check --worktree` validates the hypothetical commit formed from `HEAD`, the
|
|
117
|
+
index, unstaged changes, and nonignored untracked files.
|
|
118
|
+
- `check --staged` validates the index snapshot.
|
|
119
|
+
- `check --commit <revision>` validates one local commit snapshot.
|
|
120
|
+
- `check --remote` fetches primary using committed coordinates, validates its
|
|
121
|
+
immutable tip, and proves retained revision facts against complete reachable
|
|
122
|
+
primary history.
|
|
123
|
+
|
|
124
|
+
Targets are mutually exclusive and never change the caller's branch, index, or
|
|
125
|
+
worktree. Exit status `0` means success, `1` means validation or operational
|
|
126
|
+
failure, and `2` means invalid CLI usage. `--json` emits the stable report
|
|
127
|
+
envelope.
|
|
128
|
+
|
|
129
|
+
Runtime checks verify canonical YAML, fixed paths, the three world entries,
|
|
130
|
+
unique aliases, Git object format, tree object types, per-world candidate
|
|
131
|
+
revision binding, and acceptance history.
|
|
132
|
+
|
|
133
|
+
## Schemas
|
|
134
|
+
|
|
135
|
+
- [Repository configuration](../schema/v1/config.schema.json)
|
|
136
|
+
- [User configuration](../schema/v1/user-config.schema.json)
|
|
137
|
+
- [Idea status](../schema/v1/idea-status.schema.json)
|
|
138
|
+
- [Shared definitions](../schema/v1/definitions.schema.json)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Repository idea workflow
|
|
2
|
+
|
|
3
|
+
This repository uses the local [Silvermoon skill](/skills/silvermoon/SKILL.md)
|
|
4
|
+
and the fixed `.silvermoon/` metadata layout.
|
|
5
|
+
|
|
6
|
+
## Authority
|
|
7
|
+
|
|
8
|
+
The shared authority is `https://github.com/shazhou-ww/silvermoon.git` on
|
|
9
|
+
`main`. Fetch and observe that primary before idea work. Feature branches are
|
|
10
|
+
optional transport and are not protocol state.
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
silvermoon whats-next [idea] --json
|
|
14
|
+
silvermoon create-idea --json
|
|
15
|
+
silvermoon check
|
|
16
|
+
silvermoon check --worktree
|
|
17
|
+
silvermoon check --staged
|
|
18
|
+
silvermoon check --commit HEAD
|
|
19
|
+
silvermoon check --remote
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use the report's `observedPrimaryCommit` as the expected remote tip. When
|
|
23
|
+
primary moves, reobserve instead of replaying approval or acceptance.
|
|
24
|
+
|
|
25
|
+
Choose the entry command from the user's intent. Explicit new-idea requests use
|
|
26
|
+
`silvermoon create-idea --json` even when unrelated active ideas exist; all
|
|
27
|
+
navigation uses `silvermoon whats-next [idea] --json`. Both commands apply the
|
|
28
|
+
same branch, conflict, worktree, and ancestry hygiene. If hygiene blocks an
|
|
29
|
+
explicit creation, perform only that blocking action and then retry
|
|
30
|
+
`create-idea` so active-idea selection cannot replace the pending create intent.
|
|
31
|
+
|
|
32
|
+
## Decisions And Publication
|
|
33
|
+
|
|
34
|
+
`whats-next` is read-only. Human approvals, implementation acceptance,
|
|
35
|
+
deployment acceptance, and abandonment are ordinary edits to one idea
|
|
36
|
+
`status.yaml` after an explicit decision. Validate the candidate and publish a
|
|
37
|
+
normal non-force commit. Prefer status-only decision commits when practical.
|
|
38
|
+
|
|
39
|
+
The required idea-root `ledger.md` is the Agent continuation surface. After
|
|
40
|
+
repository hygiene and lifecycle routing, combine the reported action, world
|
|
41
|
+
contracts, and unchecked Implementation or Deployment ledger entries to infer
|
|
42
|
+
the next work. Update matching world headings and ledger entries together, and
|
|
43
|
+
reset a checked item when its requirement or proof changes materially. Ledger
|
|
44
|
+
checkboxes are Agent notes only and never imply approval or acceptance.
|
|
45
|
+
|
|
46
|
+
Preserve unknown changes, concurrent history, and previous revision facts.
|
|
47
|
+
Never force-push, reset, broadly clean, or automatically delete feature
|
|
48
|
+
branches.
|
|
49
|
+
|
|
50
|
+
## Repository Checks
|
|
51
|
+
|
|
52
|
+
- Run `pnpm test` for the fast unit-and-contract developer suite.
|
|
53
|
+
- Run `pnpm test:integration` for real filesystem and Git behavior, and
|
|
54
|
+
`pnpm test:e2e` for the installed package.
|
|
55
|
+
- Run `pnpm check` after CLI, schema, repository model, release, or skill
|
|
56
|
+
changes; it remains the complete release-grade validation entrypoint.
|
|
57
|
+
- Run `pnpm check:skills` after skill changes.
|
|
58
|
+
- Validate package contents, installed-package smoke behavior, Markdown links,
|
|
59
|
+
and `git diff --check` before delivery review.
|
|
60
|
+
- Use `silvermoon check --commit HEAD` for checked-out CI and
|
|
61
|
+
`silvermoon check --remote` for complete primary-history evidence.
|
package/package.json
CHANGED
|
@@ -1,65 +1,69 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "silvermoon",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "The project spirit that checks repository state and answers what's next.",
|
|
5
|
-
"packageManager": "pnpm@11.22.0",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"silvermoon": "bin/silvermoon.js"
|
|
9
|
-
},
|
|
10
|
-
"exports": {
|
|
11
|
-
".": "./src/index.js"
|
|
12
|
-
},
|
|
13
|
-
"files": [
|
|
14
|
-
"assets
|
|
15
|
-
"bin",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"README.
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"check
|
|
25
|
-
"check:
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"test
|
|
32
|
-
"test:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
},
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "silvermoon",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "The project spirit that checks repository state and answers what's next.",
|
|
5
|
+
"packageManager": "pnpm@11.22.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"silvermoon": "bin/silvermoon.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/index.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"assets",
|
|
15
|
+
"bin",
|
|
16
|
+
"docs",
|
|
17
|
+
"skills/silvermoon",
|
|
18
|
+
"src",
|
|
19
|
+
"README.md",
|
|
20
|
+
"README.zh-CN.md",
|
|
21
|
+
"schema"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"check": "npm run lint:markdown && npm run check:quick && npm run test:integration && npm run pack:check && npm run test:e2e && npm run check:skills",
|
|
25
|
+
"check:quick": "node --check bin/silvermoon.js && npm test",
|
|
26
|
+
"check:skills": "node scripts/sync-skills.mjs --check && npx skills add . --list",
|
|
27
|
+
"lint:markdown": "markdownlint-cli2",
|
|
28
|
+
"pack:check": "node scripts/check-pack.js",
|
|
29
|
+
"prepare:npm-release": "node scripts/prepare-npm-release.mjs",
|
|
30
|
+
"sync:skills": "node scripts/sync-skills.mjs",
|
|
31
|
+
"test": "npm run test:unit && npm run test:contract",
|
|
32
|
+
"test:contract": "node --test \"test/contract/*.test.*\"",
|
|
33
|
+
"test:e2e": "node --test \"test/e2e/*.test.*\"",
|
|
34
|
+
"test:integration": "node --test \"test/integration/*.test.*\"",
|
|
35
|
+
"test:unit": "node --test \"test/unit/*.test.*\""
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=22"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"agent-skills",
|
|
42
|
+
"cli",
|
|
43
|
+
"project-state",
|
|
44
|
+
"repository",
|
|
45
|
+
"validation",
|
|
46
|
+
"whats-next"
|
|
47
|
+
],
|
|
48
|
+
"license": "UNLICENSED",
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"registry": "https://registry.npmjs.org/"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/shazhou-ww/silvermoon.git"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"ajv": "^8.20.0",
|
|
59
|
+
"markdownlint-cli2": "^0.23.3",
|
|
60
|
+
"semver": "^7.8.5"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"commander": "^14.0.3",
|
|
64
|
+
"marked": "^18.0.13",
|
|
65
|
+
"mdast-util-from-markdown": "^2.0.3",
|
|
66
|
+
"mdast-util-to-markdown": "^2.1.2",
|
|
67
|
+
"yaml": "^2.9.1"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/shazhou-ww/silvermoon/raw/refs/heads/main/schema/v1/config.schema.json",
|
|
4
|
-
"title": "Silvermoon repository configuration v1",
|
|
5
|
-
"description": "The repository-owned .silvermoon/config.yaml contract.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"required": [
|
|
9
|
-
"version",
|
|
10
|
-
"primaryRepository",
|
|
11
|
-
"primaryBranch"
|
|
12
|
-
],
|
|
13
|
-
"properties": {
|
|
14
|
-
"version": {
|
|
15
|
-
"const": 1
|
|
16
|
-
},
|
|
17
|
-
"primaryRepository": {
|
|
18
|
-
"$ref": "definitions.schema.json#/$defs/repository"
|
|
19
|
-
},
|
|
20
|
-
"primaryBranch": {
|
|
21
|
-
"$ref": "definitions.schema.json#/$defs/branch"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/shazhou-ww/silvermoon/raw/refs/heads/main/schema/v1/config.schema.json",
|
|
4
|
+
"title": "Silvermoon repository configuration v1",
|
|
5
|
+
"description": "The repository-owned .silvermoon/config.yaml contract.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"version",
|
|
10
|
+
"primaryRepository",
|
|
11
|
+
"primaryBranch"
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"version": {
|
|
15
|
+
"const": 1
|
|
16
|
+
},
|
|
17
|
+
"primaryRepository": {
|
|
18
|
+
"$ref": "definitions.schema.json#/$defs/repository"
|
|
19
|
+
},
|
|
20
|
+
"primaryBranch": {
|
|
21
|
+
"$ref": "definitions.schema.json#/$defs/branch"
|
|
22
|
+
},
|
|
23
|
+
"preferredLanguage": {
|
|
24
|
+
"$ref": "definitions.schema.json#/$defs/languageTag"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|