@alterset/alterspec-client 0.4.1 → 0.4.4
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 +178 -0
- package/assets/prompts/_shared.md +4 -2
- package/developer-guide.md +228 -0
- package/dist/cli.js +133 -19
- package/dist/cli.js.map +1 -1
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# alterspec client
|
|
2
|
+
|
|
3
|
+
`@alterset/alterspec-client` brings the work of an [alterspec](https://github.com/altersetigor/alterspec) product
|
|
4
|
+
spec into the repositories that build the product. With it, a developer working in Claude Code takes a task from the
|
|
5
|
+
alterspec dispatcher, reads only the part of the spec that task needs, builds it, and reports progress and completion
|
|
6
|
+
back. The client never edits the spec.
|
|
7
|
+
|
|
8
|
+
It also carries the format of the export's `work.json` (`@alterset/alterspec-client/work`) for the dispatcher.
|
|
9
|
+
|
|
10
|
+
New to the dispatcher? Start with the step-by-step [developer guide](developer-guide.md) (`developer-guide.md` in
|
|
11
|
+
this package): the SSH key, setting a repository up, signing in, and a task from start to finish. This README is the
|
|
12
|
+
reference.
|
|
13
|
+
|
|
14
|
+
## What you need
|
|
15
|
+
|
|
16
|
+
- Node.js 20 or later, git, and [Claude Code](https://code.claude.com).
|
|
17
|
+
- The dispatcher's URL from your admin.
|
|
18
|
+
- A clone of the **export** repository: the signed-off product spec your team builds from. The client pulls it.
|
|
19
|
+
Never edit it by hand.
|
|
20
|
+
- An `ssh-ed25519` key: in ssh-agent, or at `~/.ssh/id_ed25519`. Signing in to the dispatcher uses it. There is no
|
|
21
|
+
password or token to manage.
|
|
22
|
+
|
|
23
|
+
## Words
|
|
24
|
+
|
|
25
|
+
- **Task**: one signed-off change on one track, written `CHG-012/BE`.
|
|
26
|
+
- **Track**: a stream of build work. It is not a channel. `BE` is the backend (every API channel included). Every
|
|
27
|
+
other track is one design, named by the code of the channel that owns it (`BO`, `MOB`). A channel that shares
|
|
28
|
+
another's design is built in that channel's track.
|
|
29
|
+
- **Checklist**: a task's items, such as acceptance criteria (`CAP-CAT-001-AC-03`), screen actions (`SCR-PRC-01.A02`)
|
|
30
|
+
and experience states (`UX-SCR-PRC-01-WEB#error`). Progress counts the items your commits cover.
|
|
31
|
+
|
|
32
|
+
## Set up a repository
|
|
33
|
+
|
|
34
|
+
In the root of the repository that builds one or more tracks:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx @alterset/alterspec-client init --dispatcher https://<dispatcher> --export ../<export-clone> --track BE
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| Option | Meaning |
|
|
41
|
+
| -------------------- | --------------------------------------------------------------------------- |
|
|
42
|
+
| `--dispatcher <url>` | The dispatcher's URL. |
|
|
43
|
+
| `--export <path>` | Your clone of the export repository, relative to this repository or absolute. |
|
|
44
|
+
| `--track <code...>` | The tracks this repository builds (`BE`, `BO`, …). Several are allowed: `--track BE BO`. |
|
|
45
|
+
| `--worktrees <path>` | Where task worktrees go. Default: `../<repo>-tasks`. |
|
|
46
|
+
| `--key <key>` | The public key to sign with, as a `.pub` path or the key line. Default: the first `ssh-ed25519` key in ssh-agent, then `~/.ssh/id_ed25519.pub`. |
|
|
47
|
+
| `--branch <name>` | The track's main branch. Default: the remote's `HEAD`, else `main`. |
|
|
48
|
+
| `--force` | Replace skills you modified. |
|
|
49
|
+
|
|
50
|
+
`init` writes:
|
|
51
|
+
|
|
52
|
+
- `.alterspec-client.json`: the configuration above.
|
|
53
|
+
- `.mcp.json`: the `dispatcher` MCP server (`npx @alterset/alterspec-client mcp`).
|
|
54
|
+
- `.claude/settings.json`: a hook that reports progress after each `git commit`.
|
|
55
|
+
- `.claude/settings.local.json`: your approval of the `dispatcher` server (`"enabledMcpjsonServers": ["dispatcher"]`),
|
|
56
|
+
merged with whatever else the file holds. Claude Code loads a server from a project's `.mcp.json` only once it is
|
|
57
|
+
approved, and honours this approval only while git doesn't track the file, so `init` adds the file to `.gitignore`
|
|
58
|
+
when git doesn't ignore it yet.
|
|
59
|
+
- `.claude/skills/alterspec-*`: the skills, which are thin wrappers.
|
|
60
|
+
- `.alterspec-client/prompts/`: the full instructions behind the skills.
|
|
61
|
+
|
|
62
|
+
It is safe to run again. Running it again also updates the client: it adds the skills of the new version, removes
|
|
63
|
+
the ones it dropped, and keeps any skill you edited unless you pass `--force`. Commit everything it writes except
|
|
64
|
+
`.claude/settings.local.json`, so task worktrees have it too. `worktree` writes the approval into each new task
|
|
65
|
+
worktree itself. If you keep the setup out of git instead, as top-level symlinks into another repository (`.claude`,
|
|
66
|
+
`.mcp.json`, `.alterspec-client`), git-ignored, `worktree` links each of them into the new worktree too. If such a link is committed with a relative target, so that
|
|
67
|
+
it would point nowhere from a worktree one folder deeper, `worktree` links the folder it misses in the worktrees'
|
|
68
|
+
folder to the one beside your checkout (`../<repo>-tasks/ops` → `../ops`), which all task worktrees share; git sees
|
|
69
|
+
no change.
|
|
70
|
+
|
|
71
|
+
When `.claude` is a symlink to another repository, git can't tell whether the file is ignored there: `init` says so,
|
|
72
|
+
and you add `.claude/settings.local.json` to that repository's `.gitignore`.
|
|
73
|
+
|
|
74
|
+
At the end it prints your public key and fingerprint. **Send both to the dispatcher's admin.** Nothing works until
|
|
75
|
+
the admin adds your key. To print them again:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx @alterset/alterspec-client key
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The dispatcher's tools appear in the next Claude Code session started in the repository.
|
|
82
|
+
|
|
83
|
+
## Working day
|
|
84
|
+
|
|
85
|
+
You talk to Claude Code; the skills call the dispatcher and the CLI for you.
|
|
86
|
+
|
|
87
|
+
1. **Take work.** `/alterspec-task-next`, or just "give me the next task". Name a track or ask for several at once:
|
|
88
|
+
`/alterspec-task-next BE 2`. With one task, the client makes its branch `task/<chg>-<track>` in this checkout and
|
|
89
|
+
continues with the brief. With several, it makes a worktree for each. Start a Claude Code session in each folder
|
|
90
|
+
and type `/alterspec-task-context <task>` there.
|
|
91
|
+
2. **Build from the brief.** `/alterspec-task-context [task]` reads the task's brief from the export:
|
|
92
|
+
- the checklist, with the items the dispatcher already holds covered;
|
|
93
|
+
- why the change was made;
|
|
94
|
+
- the before and after of each object;
|
|
95
|
+
- for `BE`: the acceptance criteria, rules, events and operations;
|
|
96
|
+
- for a UI track: the screens, their experience contracts, the mockup pages and the design system.
|
|
97
|
+
|
|
98
|
+
You build it in your own technology. When the spec is silent or disagrees with the code, Claude asks you; it does
|
|
99
|
+
not invent business rules. A mockup page shows the agreed look and behaviour. It is not code to copy.
|
|
100
|
+
3. **Commit with trailers.** Every commit of the task ends with:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
Alterspec-Task: CHG-012/BE
|
|
104
|
+
Alterspec-Covers: CAP-CAT-001-AC-03, CAP-CAT-002
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`Alterspec-Task` goes on every commit. `Alterspec-Covers` goes only on the commit that makes an item's tests pass,
|
|
108
|
+
naming items exactly as the checklist writes them. Name each item once; a commit that covers nothing has no
|
|
109
|
+
`Alterspec-Covers` line. After each commit the hook reports the covered items to the dispatcher. It works in the
|
|
110
|
+
background and never blocks you. It skips the report when nothing changed or the last report is under 15 minutes
|
|
111
|
+
old.
|
|
112
|
+
4. **Merge, then report done.** Once the task's work is on the track's main branch on the remote, type
|
|
113
|
+
`/alterspec-task-done CHG-012/BE`. It sends the last progress, finds the commit that brought the task in, and
|
|
114
|
+
reports it done. It refuses while the work is not merged.
|
|
115
|
+
|
|
116
|
+
Other skills:
|
|
117
|
+
|
|
118
|
+
| Skill | What it does |
|
|
119
|
+
| ----------------------------------------- | ---------------------------------------------------------------------------- |
|
|
120
|
+
| `/alterspec-task-status [track]` | Your tasks with progress and ETA, what is available, what is blocked and by what, and the open changes per level. |
|
|
121
|
+
| `/alterspec-task-eta <task> <YYYY-MM-DD\|clear> <reason>` | Set your own date for a task, or `clear` it so the dispatcher's computed ETA applies again. |
|
|
122
|
+
| `/alterspec-task-release <task> [reason]` | Give a task back. Its branch and worktree stay. |
|
|
123
|
+
| `/alterspec-spec-ask <question>` | Answer a question about the product from the export, citing IDs. Read-only. |
|
|
124
|
+
|
|
125
|
+
You only ever type `task-done`, `task-eta` and `task-release` yourself, because each is your word. Claude starts
|
|
126
|
+
the others from plain language as well.
|
|
127
|
+
|
|
128
|
+
## Commands
|
|
129
|
+
|
|
130
|
+
The skills run these; you rarely need them yourself. Run them in the repository or in a task worktree. In a task
|
|
131
|
+
worktree, the configuration is read from the main checkout.
|
|
132
|
+
|
|
133
|
+
| Command | What it does |
|
|
134
|
+
| ----------------------------------------- | ----------------------------------------------------------------------------- |
|
|
135
|
+
| `init [options]` | Set the repository up (see above). |
|
|
136
|
+
| `key` | Print the public key and fingerprint you sign with. |
|
|
137
|
+
| `open dispatcher` | Sign in and open the dispatcher's pages in the browser. The link works once, for a minute. |
|
|
138
|
+
| `context <task> [--json]` | Print the task's brief from the export, starting with its checklist. |
|
|
139
|
+
| `worktree <task> [--here]` | Create the branch `task/<chg>-<track>` from `origin/<main>` in its own worktree, with the checkout's git-ignored top-level symlinks linked in and its committed relative ones made to resolve. `--here` uses this checkout instead. |
|
|
140
|
+
| `progress [task] [--json]` | Report the items your commits cover. Default: the task of the current branch. |
|
|
141
|
+
| `merged <task>` | Print the commit on `origin/<main>` that brought the task in. |
|
|
142
|
+
| `export-head [--latest <sha>]` | Pull the export clone and print the commit to send to the dispatcher. |
|
|
143
|
+
| `mcp` | The MCP server Claude Code starts from `.mcp.json`. It forwards to the dispatcher. |
|
|
144
|
+
|
|
145
|
+
Each runs as `npx @alterset/alterspec-client <command>`.
|
|
146
|
+
|
|
147
|
+
## Troubleshooting
|
|
148
|
+
|
|
149
|
+
- **"The dispatcher refused your SSH key"**: the admin hasn't added your key yet, or you are signing with a
|
|
150
|
+
different key. Send the two lines it prints (or the output of `key`) to the admin.
|
|
151
|
+
- **"No SSH key to sign with"**: add an `ssh-ed25519` key to ssh-agent, create `~/.ssh/id_ed25519`, or set `key` in
|
|
152
|
+
`.alterspec-client.json`.
|
|
153
|
+
- **"ssh-agent doesn't hold the key"**: run `ssh-add` for the configured key.
|
|
154
|
+
- **No dispatcher tools in Claude Code**: the `dispatcher` server isn't approved or loaded. Run `init` again (it
|
|
155
|
+
approves it in `.claude/settings.local.json`), make sure git doesn't track that file (`git rm --cached` it if
|
|
156
|
+
`init` says it is committed), then start a new session. In an interactive `claude` terminal, `/mcp` shows the
|
|
157
|
+
server's state and approves it too.
|
|
158
|
+
- **"No .alterspec-client.json here"**: run `init` in this repository, or commit the configuration so worktrees
|
|
159
|
+
find it.
|
|
160
|
+
- **"The export is N commits behind"**: the clone couldn't catch up. The task's change is already in it, so work
|
|
161
|
+
goes on. Check the clone's remote if it keeps happening.
|
|
162
|
+
- **An item reported as unknown**: an `Alterspec-Covers` line named something the checklist lacks. A pushed commit
|
|
163
|
+
can't be corrected; name the right item on a later commit.
|
|
164
|
+
- **`task-done` says the work isn't merged**: merge the task's branch into the main branch, or push the commits that
|
|
165
|
+
carry its `Alterspec-Task` trailer, then run it again.
|
|
166
|
+
|
|
167
|
+
## For the dispatcher: the `work.json` format
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
import { parseWork, WorkSchema, AnyWorkSchema, WorkError } from '@alterset/alterspec-client/work';
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
`parseWork(text)` reads a `work.json` in format 1 or 2 and throws `WorkError` when it isn't one. The JSON Schema is
|
|
174
|
+
at `@alterset/alterspec-client/work.schema.json`.
|
|
175
|
+
|
|
176
|
+
## License
|
|
177
|
+
|
|
178
|
+
MIT, Alterset d.o.o.
|
|
@@ -34,8 +34,10 @@ dispatcher's pages.
|
|
|
34
34
|
too, so use the newest one.
|
|
35
35
|
- The call fails with "The dispatcher refused your SSH key": say that sentence in one line and show the two lines
|
|
36
36
|
that follow (the public key and its fingerprint) exactly, for the developer to send to an admin. Stop.
|
|
37
|
-
- There is no `whoami` tool: the `dispatcher` MCP server isn't
|
|
38
|
-
|
|
37
|
+
- There is no `whoami` tool: the `dispatcher` MCP server isn't loaded. Tell the developer to run
|
|
38
|
+
`npx @alterset/alterspec-client init` here (it writes the server to `.mcp.json` and approves it in the
|
|
39
|
+
git-ignored `.claude/settings.local.json`; in a task worktree `alterspec-client worktree` did that), or to approve
|
|
40
|
+
it with `/mcp` in an interactive `claude` terminal, and then to start a new session. Stop.
|
|
39
41
|
2. Run `alterspec-client export-head --latest <latest_export.commit>` (without `--latest` while it is null). Its JSON
|
|
40
42
|
has `send`, the commit to give the dispatcher as `export`, and `behind`:
|
|
41
43
|
- `behind` above 0: say in one line "The export is <behind> commits behind the dispatcher; working with what is
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Taking tasks from the alterspec dispatcher: developer guide
|
|
2
|
+
|
|
3
|
+
Your team's work is handed out by the **alterspec dispatcher**. It reads the signed-off product spec (the **export**
|
|
4
|
+
repository), splits every change into tasks and gives them to you through Claude Code. It records who works on what,
|
|
5
|
+
how far along each task is and when it is done. You don't track any of this by hand.
|
|
6
|
+
|
|
7
|
+
You connect to it with the **alterspec client** (`@alterset/alterspec-client`, public on npm). Setting up takes about
|
|
8
|
+
15 minutes, once per machine and repository. Follow the steps in order.
|
|
9
|
+
|
|
10
|
+
## How it works, in six lines
|
|
11
|
+
|
|
12
|
+
- A **change** is one signed-off piece of the spec, e.g. `CHG-023`.
|
|
13
|
+
- A **track** is a stream of build work, usually built in one repository. `BE` is the backend (APIs included); every
|
|
14
|
+
other track is a UI design, named by its channel code (`WEB`, `MOB`, …).
|
|
15
|
+
- A **task** is one change on one track, written `CHG-023/BE`. A UI task opens only once the `BE` task of the same
|
|
16
|
+
change is done.
|
|
17
|
+
- A task's **checklist** lists what it must deliver: acceptance criteria (`CAP-CAT-001-AC-03`), screen actions
|
|
18
|
+
(`SCR-PRC-01.A02`), experience states (`UX-SCR-PRC-01-WEB#error`). Progress counts the items your commits cover;
|
|
19
|
+
nobody types percentages.
|
|
20
|
+
- When you take a task it is yours until you report it **done** or **release** it; nobody else can.
|
|
21
|
+
- A task is **done** when its work is merged into the track's main branch on the remote.
|
|
22
|
+
|
|
23
|
+
## Before you start
|
|
24
|
+
|
|
25
|
+
You need:
|
|
26
|
+
|
|
27
|
+
- macOS or Linux, `git`, **Node 20 or later** (`node -v`) and **Claude Code**.
|
|
28
|
+
- From your admin (the person who runs the dispatcher):
|
|
29
|
+
- the **dispatcher URL**, e.g. `https://dispatcher.example.com`;
|
|
30
|
+
- the **export repository** to clone;
|
|
31
|
+
- your **track(s)** and the code repository each is built in;
|
|
32
|
+
- the track's **main branch** (`main`, `master`, …) if it isn't the remote's default.
|
|
33
|
+
- Read access to the export repository and access to your code repository.
|
|
34
|
+
|
|
35
|
+
In the steps below, replace `<dispatcher-url>`, `<export-repo>`, `<code-repo>`, `<TRACK>` and `<branch>` with these
|
|
36
|
+
values.
|
|
37
|
+
|
|
38
|
+
## Step 1: An Ed25519 SSH key
|
|
39
|
+
|
|
40
|
+
The dispatcher has no passwords: you sign in with an SSH key that your admin adds for you. It must be **Ed25519**;
|
|
41
|
+
RSA keys (`id_rsa`) are not accepted. Check whether you have one:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
ls ~/.ssh/id_ed25519.pub
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If it says "No such file", create one (press Enter for the default location; a passphrase is recommended):
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
ssh-keygen -t ed25519 -C "you@example.com"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If the key has a passphrase, add it to ssh-agent so the client can sign without asking. On macOS:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
On Linux:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
ssh-add ~/.ssh/id_ed25519
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Step 2: Send your admin your public key
|
|
66
|
+
|
|
67
|
+
Print it with its fingerprint:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cat ~/.ssh/id_ed25519.pub
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
ssh-keygen -lf ~/.ssh/id_ed25519.pub
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Send your admin:
|
|
78
|
+
|
|
79
|
+
1. your name and email,
|
|
80
|
+
2. the whole line starting with `ssh-ed25519 AAAA…`,
|
|
81
|
+
3. the fingerprint (`SHA256:…`), so they can check it arrived intact,
|
|
82
|
+
4. your track(s).
|
|
83
|
+
|
|
84
|
+
Send only the `.pub` line. **Never send `~/.ssh/id_ed25519`** (the file without `.pub`): that is your private key, and
|
|
85
|
+
it never leaves your machine.
|
|
86
|
+
|
|
87
|
+
Continue with steps 3 and 4 while you wait. Step 5 needs your admin's confirmation.
|
|
88
|
+
|
|
89
|
+
## Step 3: Clone the repositories side by side
|
|
90
|
+
|
|
91
|
+
Put your code repository and the export next to each other in one folder:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
mkdir -p ~/Projects/<product> && cd ~/Projects/<product>
|
|
95
|
+
git clone <export-repo> <product>-export
|
|
96
|
+
git clone <code-repo>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The export is **read-only**: never edit, commit or switch branches in it. The client pulls it for you.
|
|
100
|
+
|
|
101
|
+
Task worktrees (step 6, "Several tasks at once") are created next to your code repository, in `<code-repo>-tasks/`.
|
|
102
|
+
|
|
103
|
+
## Step 4: Set the client up in your code repository
|
|
104
|
+
|
|
105
|
+
In the root of your code repository:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
cd ~/Projects/<product>/<code-repo>
|
|
109
|
+
npx @alterset/alterspec-client init --dispatcher <dispatcher-url> --export ../<product>-export --track <TRACK> --branch <branch>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Answer `y` if npx asks to install the package. Leave out `--branch` when the track's main branch is the remote's
|
|
113
|
+
default. A repository that builds several tracks takes them all: `--track BE WEB`. If you sign with another key than
|
|
114
|
+
`~/.ssh/id_ed25519`, add `--key <path-to-.pub>`.
|
|
115
|
+
|
|
116
|
+
`init` writes:
|
|
117
|
+
|
|
118
|
+
| File | What it is | Commit it? |
|
|
119
|
+
| ----------------------------- | -------------------------------------------------------------------------- | -------------------------------------- |
|
|
120
|
+
| `.alterspec-client.json` | the dispatcher URL, the export path, your tracks, the main branch | if the whole team shares these values |
|
|
121
|
+
| `.mcp.json` | the `dispatcher` MCP server for Claude Code | yes |
|
|
122
|
+
| `.claude/settings.json` | a hook that reports progress after each `git commit` | yes |
|
|
123
|
+
| `.claude/skills/alterspec-*` | the skills | yes |
|
|
124
|
+
| `.alterspec-client/prompts/` | the instructions behind the skills | yes |
|
|
125
|
+
| `.claude/settings.local.json` | your approval of the `dispatcher` server; `init` adds it to `.gitignore` | **never** |
|
|
126
|
+
|
|
127
|
+
It ends by printing your public key and fingerprint: the same ones as in step 2. It is safe to run again, and running
|
|
128
|
+
it again with a newer client updates the skills.
|
|
129
|
+
|
|
130
|
+
If a teammate has already committed the setup, run `init` anyway: it reports the shared files as unchanged and writes
|
|
131
|
+
your approval.
|
|
132
|
+
|
|
133
|
+
### If your team keeps the Claude Code setup in another repository
|
|
134
|
+
|
|
135
|
+
Some teams don't commit `.claude`, `.mcp.json` or `.alterspec-client` in the code repository, but keep them in a
|
|
136
|
+
shared repository next to it and link them in with symlinks. That works:
|
|
137
|
+
|
|
138
|
+
- Keep the links out of git on your machine: add each one to `.git/info/exclude` (never committed), e.g.
|
|
139
|
+
`echo "/.mcp.json" >> .git/info/exclude`. `git status` should not list them.
|
|
140
|
+
- Run `init` as above. Because `.claude` is a link, it may say it can't tell whether `.claude/settings.local.json` is
|
|
141
|
+
ignored: make sure the shared repository ignores that file.
|
|
142
|
+
- If `init` reports skills or `.claude/settings.json` as created or updated, the shared repository is behind the
|
|
143
|
+
client: tell whoever maintains it rather than committing there yourself.
|
|
144
|
+
|
|
145
|
+
Task worktrees get these links too: git-ignored links are linked into each new worktree, and a link committed with a
|
|
146
|
+
relative target is made to resolve there. This needs client 0.4.4 or later.
|
|
147
|
+
|
|
148
|
+
## Step 5: Check that you can sign in
|
|
149
|
+
|
|
150
|
+
Once your admin confirms your key is added:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npx @alterset/alterspec-client open dispatcher
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
It opens the dispatcher in your browser, signed in as you: the dashboard, the changes and tasks, the graph of what
|
|
157
|
+
waits for what. If it says the dispatcher refused your SSH key, send your admin the two lines it prints.
|
|
158
|
+
|
|
159
|
+
## Step 6: Working with Claude Code
|
|
160
|
+
|
|
161
|
+
**Start a new Claude Code session** in your code repository: a session that was already open doesn't see the new
|
|
162
|
+
server. Then talk to it in plain words; the skills do the rest.
|
|
163
|
+
|
|
164
|
+
| You say or type | What happens |
|
|
165
|
+
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
166
|
+
| "give me work" / `/alterspec-task-next` | takes the next available task on your track, creates its branch `task/chg-023-be` from `origin/<branch>` here, and shows the brief |
|
|
167
|
+
| "let's work on my task" / `/alterspec-task-context` | the task's brief from the spec: why, the checklist, the objects it changes (before and after), rules, acceptance criteria; for a UI track also the screens, their contracts, mockups and design system |
|
|
168
|
+
| "what am I on?" / `/alterspec-task-status` | your tasks with progress and ETA, what's available on your tracks, what is blocked and by what |
|
|
169
|
+
| "what does RULE-… say?" / `/alterspec-spec-ask` | answers about the product from the spec, citing IDs; reads only |
|
|
170
|
+
| `/alterspec-task-done CHG-023/BE` | after your branch is merged: reports the task done with the commit that brought it in; refused while the work isn't merged |
|
|
171
|
+
| `/alterspec-task-release CHG-023/BE <reason>` | gives the task back so someone else can take it; its branch stays |
|
|
172
|
+
| `/alterspec-task-eta CHG-023/BE <YYYY-MM-DD> <reason>` | sets your own date when the computed ETA is wrong; `clear` instead of the date removes it |
|
|
173
|
+
|
|
174
|
+
**done**, **release** and **eta** happen only when you type them; Claude never does them on its own.
|
|
175
|
+
|
|
176
|
+
### A task, start to finish
|
|
177
|
+
|
|
178
|
+
1. "Give me work." Claude takes a task, creates its branch and shows the brief and its checklist.
|
|
179
|
+
2. Build it with Claude in your own technology. The spec says what, never how; a mockup shows the agreed look and
|
|
180
|
+
behaviour, it is not code to copy. When the spec is silent or disagrees with the code, Claude asks you.
|
|
181
|
+
3. Claude ends every commit of the task with a trailer:
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
Alterspec-Task: CHG-023/BE
|
|
185
|
+
Alterspec-Covers: CAP-CAT-001-AC-03, CAP-CAT-002
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
`Alterspec-Covers` names the checklist items whose tests pass with that commit, never items that aren't tested yet.
|
|
189
|
+
After each commit a hook reports them in the background, and the task's progress on the dashboard moves.
|
|
190
|
+
|
|
191
|
+
4. Push the branch, open a pull request into the main branch as usual, get it reviewed and merged.
|
|
192
|
+
5. Type `/alterspec-task-done CHG-023/BE`.
|
|
193
|
+
|
|
194
|
+
### Several tasks at once
|
|
195
|
+
|
|
196
|
+
Ask for more than one: `/alterspec-task-next BE 2`. The client creates a worktree and branch for each task in
|
|
197
|
+
`../<code-repo>-tasks/` and lists their folders. Start a separate Claude Code session in each folder and type
|
|
198
|
+
`/alterspec-task-context <task>` there. The dispatcher never gives you two tasks on the same track that change the same
|
|
199
|
+
objects, so the worktrees don't conflict.
|
|
200
|
+
|
|
201
|
+
### Good to know
|
|
202
|
+
|
|
203
|
+
- **Start from a clean checkout.** Taking a single task switches this checkout to its branch, which is refused while you
|
|
204
|
+
have uncommitted changes to tracked files; commit or stash them first.
|
|
205
|
+
- **A UI task waits for its `BE` task.** "Nothing available" on a UI track usually means the backend part isn't done
|
|
206
|
+
yet; `/alterspec-task-status` says what blocks what.
|
|
207
|
+
- **The scope is the spec's.** If the brief and the code disagree, or something in the spec looks wrong, ask whoever
|
|
208
|
+
owns the spec; don't widen or narrow the task yourself.
|
|
209
|
+
- **Only you move your task on.** Going away for a while? Release it. An admin can force a release only when you are
|
|
210
|
+
gone, and that is logged.
|
|
211
|
+
- **Keep the client current.** Run `init` again now and then (or when your admin says so); it updates the skills.
|
|
212
|
+
|
|
213
|
+
## When something goes wrong
|
|
214
|
+
|
|
215
|
+
| You see | Do |
|
|
216
|
+
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
217
|
+
| "The dispatcher refused your SSH key" | your key isn't added yet, or you sign with another key: send your admin the two lines it prints (or `npx @alterset/alterspec-client key`) |
|
|
218
|
+
| "That is not a public key the dispatcher accepts" | you used an RSA key: make an Ed25519 key (step 1) and send it |
|
|
219
|
+
| "No SSH key to sign with" | create `~/.ssh/id_ed25519` (step 1), or point `--key` at your key and run `init` again |
|
|
220
|
+
| "ssh-agent doesn't hold the key" | `ssh-add` your key (step 1) |
|
|
221
|
+
| `E401` or `E404` running `npx @alterset/...` | npm is set to a private registry that doesn't have the client. The client is on the public registry: add `registry=https://registry.npmjs.org/` to the repository's `.npmrc`, or fix your registry login |
|
|
222
|
+
| Claude has no `dispatcher` tools | run `init` again (it approves the server), make sure git doesn't track `.claude/settings.local.json`, and start a new session. In a terminal `claude` session, `/mcp` shows and approves the server too |
|
|
223
|
+
| "No .alterspec-client.json here" | run `init` in this repository (step 4) |
|
|
224
|
+
| "The export is N commits behind the dispatcher" | your export clone couldn't be pulled: `git -C ../<product>-export pull`, and check its remote if it keeps happening |
|
|
225
|
+
| an item reported as unknown | a commit's `Alterspec-Covers` named something the checklist lacks. A pushed commit can't be corrected; name the right item on a later commit |
|
|
226
|
+
| `task-done` refused: not merged | merge the pull request into the main branch first, then run it again |
|
|
227
|
+
| a worktree link "points nowhere", or `worktree` refuses | a symlink in your repository doesn't resolve from the task worktree; the message says which and what to do. Update the client to 0.4.4 or later first |
|
|
228
|
+
| anything else | send your admin the message exactly as it appears |
|