@miroshnik/elves 0.0.0 → 2026.1018.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/AGENTS.md +310 -0
- package/README.md +344 -0
- package/bin/ai-dev.ts +7 -0
- package/bin/elves.ts +2847 -0
- package/bin/shims/timeout +113 -0
- package/claude/CLAUDE.md +71 -0
- package/dist/github/scripts/github.js +3428 -0
- package/dist/spec/scripts/architecture.js +628 -0
- package/dist/spec/scripts/eslint-config.js +54 -0
- package/dist/spec/scripts/harness-qzb932c8.js +959 -0
- package/dist/spec/scripts/harness-v9s1v9w3.js +16045 -0
- package/dist/spec/scripts/harness.js +53 -0
- package/dist/spec/scripts/knip-hints.cjs +34 -0
- package/docs/ci-concurrency.md +82 -0
- package/docs/cloud-sessions.md +203 -0
- package/docs/judgment.md +81 -0
- package/docs/parallel-checkouts.md +220 -0
- package/docs/pr-checks.md +117 -0
- package/docs/testing.md +304 -0
- package/package.json +70 -1
- package/skills/ci-wait/SKILL.md +180 -0
- package/skills/ci-wait/scripts/wait-ci.sh +377 -0
- package/skills/dashboard/SKILL.md +212 -0
- package/skills/dashboard/scripts/dashboard.ts +912 -0
- package/skills/dashboard/scripts/sessions.ts +772 -0
- package/skills/est/SKILL.md +221 -0
- package/skills/est/reference.md +381 -0
- package/skills/est/scripts/est.ts +4854 -0
- package/skills/github/SKILL.md +206 -0
- package/skills/github/locales/en.json +449 -0
- package/skills/github/locales/ru.json +449 -0
- package/skills/github/reference.md +1073 -0
- package/skills/github/scripts/github.ts +4390 -0
- package/skills/github/scripts/locale.ts +495 -0
- package/skills/github/scripts/package.json +3 -0
- package/skills/slot/SKILL.md +145 -0
- package/skills/slot/scripts/package.json +3 -0
- package/skills/slot/scripts/slot.ts +279 -0
- package/skills/spec/SKILL.md +247 -0
- package/skills/spec/canon.md +219 -0
- package/skills/spec/checks.md +709 -0
- package/skills/spec/ci.md +378 -0
- package/skills/spec/migration.md +125 -0
- package/skills/spec/reference.md +889 -0
- package/skills/spec/scripts/architecture.ts +839 -0
- package/skills/spec/scripts/c4.ts +184 -0
- package/skills/spec/scripts/eslint-config.ts +82 -0
- package/skills/spec/scripts/harness.ts +1483 -0
- package/skills/spec/scripts/knip-hints.cjs +34 -0
- package/skills/spec/scripts/knip-hints.d.cts +17 -0
- package/skills/spec/scripts/package-run.ts +22 -0
- package/skills/spec/scripts/package.json +3 -0
- package/skills/spec/scripts/spec-break.ts +232 -0
- package/skills/spec/scripts/spec-claims.ts +198 -0
- package/skills/spec/scripts/spec-diff.ts +1111 -0
- package/skills/spec/scripts/spec-doc.ts +744 -0
- package/skills/spec/scripts/spec-exceptions.ts +233 -0
- package/skills/spec/scripts/spec-publish.ts +214 -0
- package/skills/spec/scripts/spec-run.ts +235 -0
- package/skills/spec/scripts/spec-shard.ts +267 -0
- package/skills/spec/scripts/speclib.ts +826 -0
- package/skills/spec/scripts/vendor/babel-parser.LICENSE +19 -0
- package/skills/spec/scripts/vendor/babel-parser.cjs +14615 -0
- package/skills/spec/scripts/vendor/babel-parser.d.cts +3 -0
- package/skills/task-env/SKILL.md +231 -0
- package/skills/task-env/proxy/compose.yaml +51 -0
- package/skills/task-env/reference.md +254 -0
- package/skills/task-env/scripts/task-env.ts +1017 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: github
|
|
3
|
+
description: "GitHub project and tasks by the AGENTS.md canon in one command — `project check` and `project fix` (the project, the default-branch rule, rebase-only merge); `task new` (a task with all its fields and the estimate); `task show` (not `gh issue view`) and `task answer` (not `gh issue edit`); `task status`, `task drop`; `task actualize` and `task close` after a merge; `task queue` for a dispatcher session; `pr labels`, `pr premerge` (a red PR or a red base). When — once per session before task work; creating a task or subtask; a PR opened, green or merged; taking, reading, finishing, reopening or cancelling a task; an answer to a task's question; 'do all tasks of epic #M', 'fix all High bugs'; asked whether the project is set up, why a task isn't in Done or on the board, why GitHub won't merge a PR — even if 'project' and 'task' weren't said."
|
|
4
|
+
allowed-tools: Bash(bun *skills/github/scripts/github.ts *) Bash(git remote get-url *)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# github — project and tasks by the canon, not from memory
|
|
8
|
+
|
|
9
|
+
Principles — `AGENTS.md`, section "Task tracking"; the full rules (types,
|
|
10
|
+
decision labels, epics, dependencies, the project, milestones, the five
|
|
11
|
+
epic-refresh checks) and what each command below checks, sets and prints —
|
|
12
|
+
`reference.md` next to this file. Done by hand from the reference, projects
|
|
13
|
+
drift apart and a task gets created without a status, priority or epic link.
|
|
14
|
+
The script `scripts/github.ts` next to this file checks the project
|
|
15
|
+
against the canon, fixes what the API can, and does each task step in one
|
|
16
|
+
command; the agent goes through the UI steps and asks for confirmation on
|
|
17
|
+
anything destructive. Syntax and a summary of a command —
|
|
18
|
+
`github <command> --help`. Editing an existing task (Priority, links) and
|
|
19
|
+
milestones — `reference.md`, section "Manual commands".
|
|
20
|
+
|
|
21
|
+
**In Claude Code — at once a separate unsandboxed call**
|
|
22
|
+
(`dangerouslyDisableSandbox`): `gh` fails on TLS in the sandbox, `task close`
|
|
23
|
+
also calls Docker for the task's stacks — the sandbox denies its socket, and
|
|
24
|
+
no `excludedCommands` entry takes a script run by `bun` out — checked with
|
|
25
|
+
`bun <path>/github.ts project check` too (`claude/CLAUDE.md`; `SKILL.md` of the
|
|
26
|
+
task-env skill, "Checked on the machine").
|
|
27
|
+
|
|
28
|
+
## Project — check and fix
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
bun --no-env-file <skill dir>/scripts/github.ts project check [--repo owner/repo]
|
|
32
|
+
bun --no-env-file <skill dir>/scripts/github.ts project fix [--repo owner/repo] [--confirm] [--template owner/N | none]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The repository — from `git remote get-url origin` or `--repo`, under its
|
|
36
|
+
current name: a renamed repository's former name resolves to it. Needs `gh` with
|
|
37
|
+
the `project` scope (`gh auth refresh -s project`); the organization's issue
|
|
38
|
+
types — `admin:org`.
|
|
39
|
+
|
|
40
|
+
| Moment | Action |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Session start, before working with tasks | `project check` — once per session |
|
|
43
|
+
| `check` gave ❌ | `project fix` → UI steps → confirmations → `check` again |
|
|
44
|
+
| Repository without a project | `project fix`: links the owner's project of the same name, otherwise copies the template, otherwise creates one |
|
|
45
|
+
| Cloud session | `task show`, `task answer`, `task new` — REST, no project (`docs/cloud-sessions.md`); others — code 2 |
|
|
46
|
+
|
|
47
|
+
Codes: `0` — everything per the canon (for `fix` — and no steps left), `1` —
|
|
48
|
+
there are ❌, steps or errors, `2` — a call or access error, or a cloud session.
|
|
49
|
+
|
|
50
|
+
`fix` prints `+` lines — done via the API; **UI steps** — calling `fix` is
|
|
51
|
+
permission to configure this repository's project: the agent goes through the
|
|
52
|
+
steps itself, in a browser where the user is signed in to GitHub, without
|
|
53
|
+
asking separately; no browser or sign-in — a list of steps with links for the
|
|
54
|
+
user; the agent doesn't enter a password; after the steps — `check` again;
|
|
55
|
+
**Confirmation needed** — show the list to the user, after a "yes" —
|
|
56
|
+
`fix --confirm`; `!` — an error with the reason, most often `gh` lacks a
|
|
57
|
+
scope. The eleven items checked, who does what, how to go through the UI steps
|
|
58
|
+
and the API's gaps — `reference.md`, "Project check and fix".
|
|
59
|
+
|
|
60
|
+
## Tasks and PRs
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
bun --no-env-file <skill dir>/scripts/github.ts task new --title "…" --branch-type <type> [--body-file F | --body "…"] [--type Task|Bug|Epic] \
|
|
64
|
+
[--epic N] [--milestone "…"] [--blocked-by N,N] [--priority Urgent|High|Medium|Low] \
|
|
65
|
+
[--labels <decision>,<kind>:<new decision>,<label>] [--repo owner/repo]
|
|
66
|
+
bun --no-env-file <skill dir>/scripts/github.ts task show <N>
|
|
67
|
+
bun --no-env-file <skill dir>/scripts/github.ts task answer <N> <k> "<answer>" [--auto]
|
|
68
|
+
bun --no-env-file <skill dir>/scripts/github.ts task status <N> "In progress" [--branch <type>/<N>-<slug>] # Backlog | In progress | Done
|
|
69
|
+
bun --no-env-file <skill dir>/scripts/github.ts task drop <N> [--duplicate-of M]
|
|
70
|
+
bun --no-env-file <skill dir>/scripts/github.ts task actualize <N>
|
|
71
|
+
bun --no-env-file <skill dir>/scripts/github.ts task close <N> [--no-git]
|
|
72
|
+
bun --no-env-file <skill dir>/scripts/github.ts task resume
|
|
73
|
+
bun --no-env-file <skill dir>/scripts/github.ts task queue [--epic N] [--type Task|Bug] [--priority Urgent,High]
|
|
74
|
+
bun --no-env-file <skill dir>/scripts/github.ts task queue --assignment <N>
|
|
75
|
+
bun --no-env-file <skill dir>/scripts/github.ts pr labels <PR>
|
|
76
|
+
bun --no-env-file <skill dir>/scripts/github.ts pr premerge <PR>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
| Moment | Action |
|
|
80
|
+
|---|---|
|
|
81
|
+
| New task, an epic's subtask, an epic | first — whether one already exists (`gh issue list --search`); `task new --branch-type <type>` — it sets the estimate itself (an epic isn't estimated: its estimate is the sum of its subtasks, `reference.md`) |
|
|
82
|
+
| Took into work · reopened | `task show N` — the task, its epic's open questions and tasks, the PR, in one call; a task without an estimate (created in the GitHub UI) — first `est estimate N --type <branch type> --write`; `task status N "In progress" --branch <type>/N-<slug>` — a separate call, no pipeline (`tail` hides the refusal code): it renames the worktree tool's branch into the task branch |
|
|
83
|
+
| An answer to a question (chat, a comment, the code; in auto mode — the recommendation) | `task answer N k "<answer>"` (auto — `--auto`), before the code it changes |
|
|
84
|
+
| PR merged | in one turn — `task actualize N` and in the background `wait-ci.sh merged <PR>` (it takes the merge SHA itself); a refresh is needed — next turn, in the background, a subagent with the printed two-line prompt; after both — `task close N` (exit code 0 from the wait — right away, don't read the output) |
|
|
85
|
+
| Task closed without a PR | `task actualize N`, the subagent; then `task close N` |
|
|
86
|
+
| Session resumed after the app restarted | the `SessionStart` hook runs `task resume` itself — its line is in the context: run the named command, a background wait died with the process |
|
|
87
|
+
| "Do all tasks of epic #M", "fix all High bugs", a new epic — the owner's "yes" | the session is a dispatcher, its own task stays: `task queue --epic M` (or `--type`, `--priority`), executors — background subagents; below, "Dispatcher" |
|
|
88
|
+
| Another task: work outside the task, a red-main bug, a flow copy's move | `task new`, then the question to the owner «queue #N?»; "yes" — its executor at once, the same as a dispatcher's (`task new` and `task status` in a session with a task print its prompt) |
|
|
89
|
+
| Won't do, duplicate, replaced by others | `task drop N [--duplicate-of M]` |
|
|
90
|
+
| PR ready (and after new commits) | `pr labels <PR>` — decision labels for the task and the epic |
|
|
91
|
+
| PR's CI green (`ci-wait` PASS), before `gh pr merge` | `pr premerge <PR>` — a separate call; code `0` — merge, `3` — `main` is red: don't merge, wait for the bug |
|
|
92
|
+
|
|
93
|
+
What the agent gets wrong without the details (all of them — `reference.md`,
|
|
94
|
+
"Task and PR commands"):
|
|
95
|
+
|
|
96
|
+
- **`task new`** — `--branch-type` (`feat fix docs refactor perf test chore
|
|
97
|
+
ci build research`) is required for a task, a bug without it is `fix`, an
|
|
98
|
+
epic gets none. The estimate — `task new` itself: the agent has no step and
|
|
99
|
+
doesn't open the `est` skill.
|
|
100
|
+
`--labels`: a decision from the default branch — by name (`billing`), a new
|
|
101
|
+
decision — `kind:name` (`capability:export`), a regular or slice label — by
|
|
102
|
+
name, it must exist. The `questions` label — `task new` itself, when the
|
|
103
|
+
description has a question without ✅. Everything is checked before
|
|
104
|
+
creating: an error (code 2) leaves no half-made task.
|
|
105
|
+
- **`task answer`** — not a rewrite of the description by hand
|
|
106
|
+
(`gh issue edit --body-file`); a question that already has ✅ is refused — a
|
|
107
|
+
changed answer is edited by hand.
|
|
108
|
+
- **`task status`** — In progress pins the task to the session: another task
|
|
109
|
+
In progress in the same session is refused (code 2) with the question
|
|
110
|
+
«queue #M?» and its executor's prompt; a task handed out to an executor of
|
|
111
|
+
this session isn't pinned; a mistaken pin — a human deletes its
|
|
112
|
+
file. `--branch` — only
|
|
113
|
+
with In progress, not for an epic; it renames the branch together with its
|
|
114
|
+
`.git/config` section — not a bare `git branch -m`; the lock still held —
|
|
115
|
+
a `!` line with the command that finishes the rename, code 1.
|
|
116
|
+
- **`pr premerge`** — from a repository checkout. Codes: `0` — merge; `1` —
|
|
117
|
+
don't merge: fix the root cause in the PR (rebase onto `origin/<base>`, edit,
|
|
118
|
+
`push --force-with-lease`, `ci-wait` again); `2` — couldn't check: don't
|
|
119
|
+
merge either, investigate; `3` — **`main` is red, not this PR**: don't merge
|
|
120
|
+
and don't fix it in the PR — one bug for everyone: the printed wait
|
|
121
|
+
`wait-ci.sh issue <N>` (the `ci-wait` skill, as a background command), or
|
|
122
|
+
the printed `task new --type Bug` command and «queue it?», then `premerge` again
|
|
123
|
+
(`reference.md`, "Red main").
|
|
124
|
+
- **`task actualize`** — right after the merge, in parallel with the deploy:
|
|
125
|
+
the mechanics itself, then the subagent's prompt — the two lines after
|
|
126
|
+
`Next:`, pass them as is; its assignment the subagent prints itself
|
|
127
|
+
(`task actualize N --assignment`, outside the sandbox). `○ refresh not
|
|
128
|
+
needed` — no subagent. In Claude Code in the same turn — also `ToolSearch`
|
|
129
|
+
for the `archive_session` schema if it isn't loaded yet.
|
|
130
|
+
- **`task close`** — only after the PR is merged (or a close without a PR):
|
|
131
|
+
an open PR is refused before any changes, a merged PR GitHub didn't link is
|
|
132
|
+
found by itself — no manual `gh issue close`. Refused until the refresh
|
|
133
|
+
subagent reports on the epic. A wait with a code other than
|
|
134
|
+
0 — the `RESULT:` line in its output file. It doesn't delete the session's worktree; `--no-git`
|
|
135
|
+
— without the git step. Its last output line — the end-of-session steps;
|
|
136
|
+
then the last line of the answer, one of three (wording in the project
|
|
137
|
+
language — `AGENTS.md`, "Language"): `All done. The session can be closed.`;
|
|
138
|
+
the owner has something to decide — `All done, but there are questions: …`
|
|
139
|
+
with the questions themselves; something remains — `Remaining: …`. In auto
|
|
140
|
+
mode after the first — archiving the session where the agent has the tool,
|
|
141
|
+
after the other two — no; information without a decision isn't a question.
|
|
142
|
+
A cloud session — a refusal (`docs/cloud-sessions.md`).
|
|
143
|
+
|
|
144
|
+
### Dispatcher
|
|
145
|
+
|
|
146
|
+
"Do all tasks of epic #M", "fix all High bugs", a "yes" to «run the
|
|
147
|
+
dispatcher on epic #M?» (`AGENTS.md`, "Session and branch — one task"): any
|
|
148
|
+
session, its own task stays pinned; one started for it — in the project
|
|
149
|
+
folder, not a worktree: executors (subagents, cloud sessions) start from
|
|
150
|
+
`main`. `task queue` prints ready
|
|
151
|
+
tasks, each with an indented line — its executor's prompt. In Claude Code: an executor — `Agent` with
|
|
152
|
+
`isolation: "worktree"` and `run_in_background: true`, the prompt — the
|
|
153
|
+
indented line as is; at most 3 subagents and 5 cloud sessions at once, the
|
|
154
|
+
owner's number replaces either;
|
|
155
|
+
`=` — a task in work (In progress, an open PR, handed out to an executor of
|
|
156
|
+
this session), not launched again. Before each launch — `get_usage`: the 5-hour limit at 85% and more —
|
|
157
|
+
no new executors, the running ones finish, then `Remaining: N tasks, the
|
|
158
|
+
limit`. After each executor's answer — `task queue` again: it also removes
|
|
159
|
+
finished executors' worktrees (`+`), not by hand. A question — to the
|
|
160
|
+
owner in text; the answer — ✅ in the task's questions section and to the same
|
|
161
|
+
executor with `SendMessage`. After the app restarts — each stopped executor
|
|
162
|
+
is continued with `SendMessage` by its id, not a new one (`task resume`). Waits for subagents — it answers again. Failed — a
|
|
163
|
+
task comment with what stopped, no restart (the owner's restart:
|
|
164
|
+
`--assignment` refuses while the previous executor lives); on an external
|
|
165
|
+
blocker — *blocked by* on its issue or
|
|
166
|
+
the `external blocker` label with the reason (`reference.md`,
|
|
167
|
+
"Dependencies"). Queue empty and nothing running — the summary, the last
|
|
168
|
+
line (a session with its own task — after it) and, in auto mode, archiving. The executor's side (`--assignment`,
|
|
169
|
+
a cloud one's: `--cloud`) — `reference.md`, "task queue".
|
|
170
|
+
|
|
171
|
+
## Git, PRs and merging — mechanics
|
|
172
|
+
|
|
173
|
+
Principles — `AGENTS.md`, section "Git, PRs and merging"; the full rules —
|
|
174
|
+
`reference.md`, "Git, PRs and merging — full rules". Waiting for checks, the
|
|
175
|
+
full SHA and a merge that deploys — `docs/pr-checks.md`.
|
|
176
|
+
|
|
177
|
+
- **Merge — rebase only:** `gh pr merge <N> --rebase`; each commit of the
|
|
178
|
+
branch lands in `main` — a conventional commit with `Refs #N`.
|
|
179
|
+
- **Merge without a queue:** as soon as the PR's own CI is green and GitHub
|
|
180
|
+
merges it without a conflict, a branch that fell behind too. Rebase onto
|
|
181
|
+
`origin/main` and `git push --force-with-lease` (not `--force`) — only on a
|
|
182
|
+
textual conflict or my own changes; someone else's branch rule with strict —
|
|
183
|
+
rebase, not `gh pr merge --admin`. **Before merging — `github pr premerge
|
|
184
|
+
<N>`** (after `ci-wait` PASS).
|
|
185
|
+
- **Before a push** — `git branch --show-current`: my own branch, not the
|
|
186
|
+
local `main`.
|
|
187
|
+
- **Merge in auto mode in Claude Code — as a separate call:**
|
|
188
|
+
`gh pr merge <N> --rebase` — the whole command, without `cd`, a pipeline,
|
|
189
|
+
`;` or `&&`: the owner's rule `Bash(gh pr merge *)` must match each part.
|
|
190
|
+
Exit code `0` — merged. Refused even as a separate call — I don't retry the
|
|
191
|
+
merge or push it through in another form; `Remaining: merge — from the
|
|
192
|
+
owner`. The agent doesn't widen its own permission settings.
|
|
193
|
+
- **After such a merge `gh pr view` isn't needed:** the merge SHA is taken by
|
|
194
|
+
`wait-ci.sh merged <N>`, `task close <N>` reads the PR itself; a read still
|
|
195
|
+
needed — a narrow `gh pr view <N> --json state` as a separate call; after a
|
|
196
|
+
refusal I don't repeat the command or get the same thing in another form.
|
|
197
|
+
- **Right after a PR merge — I delete what was merged entirely, without
|
|
198
|
+
asking** (a `github task close` step): the checkout moves off the merged
|
|
199
|
+
branch to `origin/main` detached, the local and remote branches, the task's
|
|
200
|
+
Compose stacks with their volumes, my own worktrees. "Merged" — by the PR or
|
|
201
|
+
`git cherry origin/main <branch>`, not `git branch --merged`. Others'
|
|
202
|
+
branches, worktrees of live sessions, unmerged work — never. The next task —
|
|
203
|
+
not in this session.
|
|
204
|
+
- `gh pr merge --delete-branch` from a worktree doesn't delete the local branch
|
|
205
|
+
— this isn't a merge error: I check `gh pr view <N> --json state`, I don't
|
|
206
|
+
repeat the merge.
|