@sjawhar/opencode-legion-envoy 8.30.0 → 8.30.2
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/package.json +1 -1
- package/skills/envoy/SKILL.md +47 -286
- package/skills/envoy/references/check-settlement.md +62 -0
- package/skills/envoy/references/deliveries.md +62 -0
- package/skills/envoy/references/legion.md +12 -0
- package/skills/envoy/references/roles.md +10 -0
- package/skills/envoy/references/sources.md +41 -0
- package/skills/legion-architect/SKILL.md +41 -419
- package/skills/legion-architect/references/acceptance.md +153 -0
- package/skills/legion-architect/references/decomposition.md +77 -0
- package/skills/legion-architect/references/design-gate.md +148 -0
- package/skills/legion-architect/references/wake-routing.md +11 -6
- package/skills/legion-controller/SKILL.md +96 -469
- package/skills/legion-controller/references/admission.md +7 -6
- package/skills/legion-controller/references/backlog-stewardship.md +32 -27
- package/skills/legion-controller/references/daily-report.md +72 -0
- package/skills/legion-controller/references/escalation.md +37 -0
- package/skills/legion-controller/references/finding-asks.md +32 -14
- package/skills/legion-controller/references/session.md +98 -0
- package/skills/legion-controller/references/slack-mentions.md +10 -9
- package/skills/legion-controller/references/triage.md +81 -0
- package/skills/legion-controller/references/wakes.md +90 -0
- package/skills/legion-oracle/SKILL.md +26 -57
- package/skills/legion-retro/SKILL.md +116 -240
- package/skills/legion-retro/references/learnings.md +58 -0
- package/skills/legion-retro/references/pr-body-content.md +78 -0
- package/skills/legion-worker/SKILL.md +40 -462
- package/skills/legion-worker/references/conflicts-and-rewrites.md +2 -2
- package/skills/legion-worker/references/default-branch-check.md +16 -0
- package/skills/legion-worker/references/findings.md +2 -2
- package/skills/legion-worker/references/pr-body.md +1 -1
- package/skills/legion-worker/references/review-threads.md +1 -1
- package/skills/thermonuclear-code-quality/SKILL.md +34 -82
- package/skills/thermonuclear-deep-review/SKILL.md +34 -33
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Writing a retro learning under `docs/solutions/`
|
|
2
|
+
|
|
3
|
+
Read this at step 3 of `skill://legion-retro`, when you write a learning document. Organize by
|
|
4
|
+
reusable topic, not by pull request, so a worker on another issue finds it by its subject.
|
|
5
|
+
|
|
6
|
+
## Never edit a document you did not write this retro
|
|
7
|
+
|
|
8
|
+
Not its front matter, not its body. Two issues' retros can land within the same hour, and an
|
|
9
|
+
in-place edit (another `related_issues` entry, a sharpened sentence, a `status` flip) conflicts
|
|
10
|
+
with the other retro's edit to the same lines.
|
|
11
|
+
|
|
12
|
+
## Find what already covers the topic
|
|
13
|
+
|
|
14
|
+
1. Search `docs/solutions/` with the `grep` tool, case-insensitive, for two or three words naming
|
|
15
|
+
the topic, and read each hit's H1 and rule.
|
|
16
|
+
2. For each file you found, search `docs/solutions/` for its path (`docs/solutions/<its-path>`).
|
|
17
|
+
A file that lists that path under `supersedes:` (on that line, or as an item of the list below
|
|
18
|
+
it) replaces it: read that file instead, and repeat this search for it. A file whose first line
|
|
19
|
+
under the H1 is `Extends docs/solutions/<its-path>.md.` adds to it: read both. Legion runs no
|
|
20
|
+
pass that reconciles these links, so this search is the only way to reach the newer file.
|
|
21
|
+
|
|
22
|
+
## Write a new file of your own
|
|
23
|
+
|
|
24
|
+
Name it `docs/solutions/<category>/<slug>-<LEGION_ISSUE>.md`, so two issues' retros never choose
|
|
25
|
+
the same path. `<category>` is an existing subdirectory of `docs/solutions/`; make a new one only
|
|
26
|
+
when none fits. `<slug>` is the title in lowercase words joined by `-`.
|
|
27
|
+
|
|
28
|
+
- **A fresh topic:** state the rule in a few imperative lines. The incident goes under a
|
|
29
|
+
`## Evidence` heading below the rule, never in the rule, because a reader takes a story as an
|
|
30
|
+
instruction.
|
|
31
|
+
- **A topic an existing document already covers:** the first line under the H1 reads
|
|
32
|
+
`Extends docs/solutions/<existing-path>.md.`, and the rule states only what is new.
|
|
33
|
+
- **A topic an existing document states wrongly:** front matter adds
|
|
34
|
+
`supersedes: docs/solutions/<existing-path>.md`, or a `supersedes:` list with one
|
|
35
|
+
`- docs/solutions/<existing-path>.md` item each, and the first line under the H1 says why. Leave
|
|
36
|
+
the old file untouched. A reader reaches your correction from it only through the search in step
|
|
37
|
+
2 above, so the path in your `supersedes:` must be exact.
|
|
38
|
+
|
|
39
|
+
Front matter (`status: active` for a new file; `module:` the package or directory the rule is
|
|
40
|
+
about, as `packages/daemon` or `skills/legion-worker`):
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
---
|
|
44
|
+
title: "Descriptive title matching the H1"
|
|
45
|
+
category: subdirectory-name
|
|
46
|
+
tags:
|
|
47
|
+
- searchable-topic
|
|
48
|
+
date: YYYY-MM-DD
|
|
49
|
+
status: active
|
|
50
|
+
module: affected-module
|
|
51
|
+
related_issues:
|
|
52
|
+
- "LEGION-123" # the Dispatch issue
|
|
53
|
+
- "owner/repo#456" # the pull request
|
|
54
|
+
---
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Commit it on the existing issue branch before the removal commit (step 4), so the removal stays
|
|
58
|
+
the last commit.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# The PR body lines the changed paths require, and a pushed head that carries `skip-checks`
|
|
2
|
+
|
|
3
|
+
Read this at steps 5 and 6 of `skill://legion-retro`. A failure here stops retro as its
|
|
4
|
+
*When retro stops* section says.
|
|
5
|
+
|
|
6
|
+
## Bring the body up to date before the push
|
|
7
|
+
|
|
8
|
+
A repository can require body lines derived from the pull request's changed paths (for example one
|
|
9
|
+
checklist line when `src/**` changed and another when `docs/**` changed) and have a required check
|
|
10
|
+
read them from the body. Your commits add `docs/solutions/` paths the approved body never
|
|
11
|
+
accounted for and take away the `.legion/` paths it did, so that check fails at your head. The
|
|
12
|
+
merger reports a stale body rather than rewriting it, and GitHub will not merge a head whose
|
|
13
|
+
required check failed, so the merge waits.
|
|
14
|
+
|
|
15
|
+
`<owner>/<repo>` and `<n>` are the pull request's repository and number in every command below.
|
|
16
|
+
|
|
17
|
+
1. Read your system prompt's deployment instructions, the repository's agent guide (`AGENTS.md`,
|
|
18
|
+
`CLAUDE.md`), its pull request template (`.github/pull_request_template.md` or
|
|
19
|
+
`.github/PULL_REQUEST_TEMPLATE/`), and the workflow under `.github/workflows/` that reads the
|
|
20
|
+
body, for lines they require per changed path. When they require none, skip to the push.
|
|
21
|
+
2. List the paths the pull request will change once you push `<head>`, your removal commit:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
base=$(gh pr view <n> -R <owner>/<repo> --json baseRefName -q '.baseRefName | @json') && cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" git fetch && jj -R "$LEGION_WORKSPACE" diff --from "fork_point(${base}@origin | <head>)" --to <head> --name-only
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`@json` makes `base` a quoted jj string literal; never paste a branch name between quotes
|
|
28
|
+
yourself, because a name with a quote or revset character then breaks the command. For each
|
|
29
|
+
path pattern the step 1 sources name, write the line they require when a listed path matches
|
|
30
|
+
it. Before you write a line that says work was done, do that work for the paths your commits
|
|
31
|
+
add, because the required check reads the line and does not redo the work. That work may
|
|
32
|
+
change files under `docs/solutions/` only, since any other path after the approved head voids
|
|
33
|
+
the approval. Commit it below the removal, which must stay last:
|
|
34
|
+
`jj -R "$LEGION_WORKSPACE" split -m "<message>" <paths> && jj -R "$LEGION_WORKSPACE" rebase -r @- -B <head>`.
|
|
35
|
+
3. Make a directory outside `$LEGION_WORKSPACE` with `dir=$(mktemp -d)`, the one place you write
|
|
36
|
+
outside it: jj would commit a file inside it, and a fixed name in a shared `/tmp` can hold
|
|
37
|
+
another session's body. Save the live body as `$dir/before.md` (to restore on failure) and
|
|
38
|
+
`$dir/body.md` (to edit), and stop unless the read succeeded and is not empty:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cd -- "$LEGION_WORKSPACE" && ( set -o pipefail && gh api repos/<owner>/<repo>/pulls/<n> --jq .body | tee "$dir/before.md" "$dir/body.md" ) && test -s "$dir/before.md"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Without `pipefail` a failed read exits with `tee`'s status and leaves two empty files. The
|
|
45
|
+
parentheses keep `pipefail` to this line, since your shell persists and a later `cmd | head`
|
|
46
|
+
would exit 141 under it. In `$dir/body.md`, change only the lines the step 1 sources derive
|
|
47
|
+
from paths, adding a missing one where they place it. Leave every other line byte for byte,
|
|
48
|
+
the `E2E (implementer)` and `E2E (tester)` lines included.
|
|
49
|
+
4. Write it back before the push:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cd -- "$LEGION_WORKSPACE" && gh api --method PATCH repos/<owner>/<repo>/pulls/<n> -F body=@"$dir/body.md"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The checks your push starts read the body as it stands then, and READY reads the head your
|
|
56
|
+
push makes. An edit after the push re-runs only checks triggered by an edited body, and they
|
|
57
|
+
run at the approved head, without your commits, where they may fail.
|
|
58
|
+
|
|
59
|
+
When the push is refused after step 4 wrote the body, write `$dir/before.md` back with the same
|
|
60
|
+
command before you report the refusal, so the body matches the head GitHub has.
|
|
61
|
+
|
|
62
|
+
## A pushed head that carries skip-checks
|
|
63
|
+
|
|
64
|
+
For a head you already pushed whose message carries a `skip-checks: true` line or one of the
|
|
65
|
+
bracket keywords in step 6 of `skill://legion-retro`. Read that head's message first and confirm
|
|
66
|
+
it does:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" log -r "legion/${LEGION_ISSUE:?}@origin" --no-graph -T description
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Describe that same commit again without the line and push it once, as
|
|
73
|
+
`skill://legion-worker/references/conflicts-and-rewrites.md#rewriting-pushed-commits` says. Run
|
|
74
|
+
that section's guard first: a non-empty result means another issue's work is built on the commit,
|
|
75
|
+
so do not rewrite it; report the listed commits to the architect instead. Once the guard is clear,
|
|
76
|
+
move the bookmark with `--allow-backwards` and push once. That is the only non-fast-forward push
|
|
77
|
+
retro makes; never `--force`. GitHub runs the base branch's required checks on the rewritten head
|
|
78
|
+
from scratch, and the merge waits for them.
|