@alan-ai-hq/agent-manager-linux-x64 0.1.199 → 0.1.201

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.
Files changed (96) hide show
  1. package/alan-agent.cjs +8928 -5241
  2. package/alan-holder.cjs +5364 -3401
  3. package/alan-lease.cjs +808 -200
  4. package/builtin-skills/agent-desktop/SKILL.md +94 -0
  5. package/builtin-skills/alan-artifact/SKILL.md +128 -0
  6. package/builtin-skills/alan-artifact/examples/interactive-diagram.md +50 -0
  7. package/builtin-skills/alan-artifact/examples/prototype.md +53 -0
  8. package/builtin-skills/alan-artifact/examples/test-report.md +55 -0
  9. package/builtin-skills/alan-artifact/references/design.md +39 -0
  10. package/builtin-skills/alan-artifact/references/diagrams.md +20 -0
  11. package/builtin-skills/alan-deck/SKILL.md +189 -0
  12. package/builtin-skills/alan-diagrams/SKILL.md +105 -0
  13. package/builtin-skills/alan-diagrams/references/diagram-catalogue.md +847 -0
  14. package/builtin-skills/alan-docs/SKILL.md +143 -0
  15. package/builtin-skills/alan-docs/references/administration/members-and-teams.md +48 -0
  16. package/builtin-skills/alan-docs/references/administration/org-dashboard.md +19 -0
  17. package/builtin-skills/alan-docs/references/administration/organisation-settings.md +41 -0
  18. package/builtin-skills/alan-docs/references/agents-and-sessions/code-context.md +60 -0
  19. package/builtin-skills/alan-docs/references/agents-and-sessions/coding-agents-and-models.md +78 -0
  20. package/builtin-skills/alan-docs/references/agents-and-sessions/session-lifecycle.md +62 -0
  21. package/builtin-skills/alan-docs/references/agents-and-sessions/start-a-session.md +110 -0
  22. package/builtin-skills/alan-docs/references/automations/automation-runs.md +69 -0
  23. package/builtin-skills/alan-docs/references/automations/create-an-automation.md +143 -0
  24. package/builtin-skills/alan-docs/references/automations/overview.md +77 -0
  25. package/builtin-skills/alan-docs/references/cloud-and-local/cloud-images.md +64 -0
  26. package/builtin-skills/alan-docs/references/cloud-and-local/cloud-sessions-and-execution.md +89 -0
  27. package/builtin-skills/alan-docs/references/cloud-and-local/cloud-setup.md +128 -0
  28. package/builtin-skills/alan-docs/references/cloud-and-local/codex-cli-connector.md +92 -0
  29. package/builtin-skills/alan-docs/references/cloud-and-local/local-execution.md +213 -0
  30. package/builtin-skills/alan-docs/references/cloud-and-local/runtime-recovery.md +60 -0
  31. package/builtin-skills/alan-docs/references/cloud-and-local/sandboxes.md +74 -0
  32. package/builtin-skills/alan-docs/references/cloud-and-local/troubleshooting-and-faq.md +102 -0
  33. package/builtin-skills/alan-docs/references/get-started/connect-azure-devops.md +89 -0
  34. package/builtin-skills/alan-docs/references/get-started/connect-bitbucket.md +86 -0
  35. package/builtin-skills/alan-docs/references/get-started/connect-github.md +114 -0
  36. package/builtin-skills/alan-docs/references/get-started/join-a-team.md +114 -0
  37. package/builtin-skills/alan-docs/references/get-started/product-map.md +96 -0
  38. package/builtin-skills/alan-docs/references/get-started/quickstart.md +158 -0
  39. package/builtin-skills/alan-docs/references/get-started/set-up-your-team.md +200 -0
  40. package/builtin-skills/alan-docs/references/get-started/sign-in.md +104 -0
  41. package/builtin-skills/alan-docs/references/get-started/welcome.md +39 -0
  42. package/builtin-skills/alan-docs/references/integrations/connect-microsoft-teams.md +116 -0
  43. package/builtin-skills/alan-docs/references/integrations/connect-slack.md +164 -0
  44. package/builtin-skills/alan-docs/references/integrations/import-from-linear.md +172 -0
  45. package/builtin-skills/alan-docs/references/plans-and-billing/plans-and-limits.md +115 -0
  46. package/builtin-skills/alan-docs/references/plans-and-billing/usage-and-credits.md +47 -0
  47. package/builtin-skills/alan-docs/references/reference/documents-and-artifacts.md +52 -0
  48. package/builtin-skills/alan-docs/references/reference/faq.md +89 -0
  49. package/builtin-skills/alan-docs/references/reference/feature-catalog.md +89 -0
  50. package/builtin-skills/alan-docs/references/reference/glossary.md +96 -0
  51. package/builtin-skills/alan-docs/references/reference/links-and-ids.md +80 -0
  52. package/builtin-skills/alan-docs/references/reference/roles-and-permissions.md +64 -0
  53. package/builtin-skills/alan-docs/references/reference/statuses.md +86 -0
  54. package/builtin-skills/alan-docs/references/reviews-testing-deploys/deployments.md +28 -0
  55. package/builtin-skills/alan-docs/references/reviews-testing-deploys/pull-requests.md +85 -0
  56. package/builtin-skills/alan-docs/references/reviews-testing-deploys/review-work.md +55 -0
  57. package/builtin-skills/alan-docs/references/reviews-testing-deploys/testing-evidence.md +52 -0
  58. package/builtin-skills/alan-docs/references/skills/plugins-and-mcp.md +24 -0
  59. package/builtin-skills/alan-docs/references/skills/skills.md +103 -0
  60. package/builtin-skills/alan-docs/references/tasks/complete-a-task.md +79 -0
  61. package/builtin-skills/alan-docs/references/tasks/create-a-task.md +67 -0
  62. package/builtin-skills/alan-docs/references/tasks/subtasks-and-status.md +55 -0
  63. package/builtin-skills/alan-docs/references/tasks/task-artifacts.md +56 -0
  64. package/builtin-skills/alan-docs/references/tasks/task-detail.md +65 -0
  65. package/builtin-skills/alan-docs/references/teams-and-planning/cycles.md +93 -0
  66. package/builtin-skills/alan-docs/references/teams-and-planning/documents.md +66 -0
  67. package/builtin-skills/alan-docs/references/teams-and-planning/epics.md +95 -0
  68. package/builtin-skills/alan-docs/references/teams-and-planning/whiteboard.md +52 -0
  69. package/builtin-skills/alan-docs/references/troubleshooting/agent-blocked.md +38 -0
  70. package/builtin-skills/alan-docs/references/troubleshooting/common-problems.md +118 -0
  71. package/builtin-skills/alan-docs/references/troubleshooting/github-access.md +41 -0
  72. package/builtin-skills/alan-docs/references/troubleshooting/missing-artifact.md +47 -0
  73. package/builtin-skills/alan-docs/references/troubleshooting/report-an-issue.md +74 -0
  74. package/builtin-skills/alan-docs/references/troubleshooting/runtime-unavailable.md +49 -0
  75. package/builtin-skills/alan-docs/scripts/generate-references.mjs +363 -0
  76. package/builtin-skills/alan-environment-setup/SKILL.md +368 -0
  77. package/builtin-skills/alan-environment-setup/references/android.md +118 -0
  78. package/builtin-skills/alan-environment-setup/references/troubleshooting.md +38 -0
  79. package/builtin-skills/alan-skill-authoring/SKILL.md +83 -0
  80. package/builtin-skills/alan-tasks/SKILL.md +195 -0
  81. package/builtin-skills/alan-test-android/SKILL.md +224 -0
  82. package/builtin-skills/alan-test-android/scripts/android-up.sh +227 -0
  83. package/builtin-skills/alan-test-android/scripts/install-launch.sh +38 -0
  84. package/builtin-skills/alan-test-android/scripts/record.sh +64 -0
  85. package/builtin-skills/alan-test-android/scripts/ui.py +367 -0
  86. package/builtin-skills/alan-test-desktop/SKILL.md +107 -0
  87. package/builtin-skills/alan-test-desktop/references/linux-recording.md +31 -0
  88. package/builtin-skills/alan-test-feature/SKILL.md +243 -0
  89. package/builtin-skills/alan-test-mobile/SKILL.md +65 -0
  90. package/builtin-skills/alan-test-web/SKILL.md +113 -0
  91. package/builtin-skills/alan-walkthrough/SKILL.md +152 -0
  92. package/builtin-skills/alan-walkthrough/scripts/mark-changes.js +419 -0
  93. package/builtin-skills/alan-walkthrough/scripts/publish-capture.mjs +288 -0
  94. package/builtin-skills/alan-workflows/SKILL.md +235 -0
  95. package/builtin-skills/manifest.json +19 -0
  96. package/package.json +3 -2
@@ -0,0 +1,368 @@
1
+ ---
2
+ name: alan-environment-setup
3
+ version: 7.2.0
4
+ description: Bootstrap, maintain or verify a repository's development environment (system packages, OS libraries, toolchains and runtime services) through the team's Cloud environment build setup. Use for /alan-environment-setup or explicit repository setup. Team Cloud environment creation and saved secrets use Alan MCP tools, not repository setup.
5
+ ---
6
+
7
+ # Environment setup and maintenance
8
+
9
+ Make the authorized development workflow reproducible in future Alan sessions.
10
+ Setup lives only in Alan, as a versioned YAML **build setup** plus a **startup**
11
+ setting. Nothing is committed to the customer's repository and no pull request
12
+ is needed: saving a revision is the change. Alan reads no setup file from the
13
+ repository, but a step that calls a repository script (`bash .alan/setup.sh`)
14
+ still runs whatever that file holds at the built commit, so a saved setup never
15
+ calls one. Follow the mode below; verification without changes needs no revision.
16
+
17
+ ## Choose the mode and scope
18
+
19
+ If the request is to create or reuse the team's Cloud environment, add saved
20
+ secrets, or configure an env file, do not inspect local files or start a computer.
21
+ First call `get_cloud_environment_status` with the requested secret names. If
22
+ there is no environment and creation was requested, call `create_cloud_environment`.
23
+ For missing secrets or env files, call `request` op `environment_setup_actions` and
24
+ end the turn; pass names only and direct env-file setup to Cloud settings. After
25
+ Save, Continue or Skip, recheck status. Do not re-request skipped actions unless
26
+ the user asks. Use the modes below only for repository setup work.
27
+
28
+ | Request or discovery | Mode | Work and completion criteria |
29
+ | --- | --- | --- |
30
+ | Set up / bootstrap an environment | Initial setup | Inspect selected repositories, draft the build setup and startup, pass a draft test build, save the revision, build the image and validate the product. |
31
+ | `read_build_setup` shows `needsReview`, an `attention` line, `source: imported`, or any step or startup node that calls a repository script | Migration | Run **Migrate a legacy or imported setup** before any other setup work. |
32
+ | A task needs a system package, OS library, toolchain or runtime service the image does not provide | Maintenance | Change only the affected step, test the draft, save on the current revision and validate the affected feature. A package added to a manifest and lockfile is not maintenance when `maintenance` already installs from it. |
33
+ | Is this environment running / usable? | Verification | Read the build setup, inspect current startup state and exercise the product. No revision or build is required when nothing changes. |
34
+ | Explicitly verify a clean image build | Build verification | Run `test_environment_build` with the saved build setup and report it separately from startup and product evidence. |
35
+
36
+ Use `<alan_agent_context>` and updates for the selected repositories, configured
37
+ branches, working directories, environment binding and startup state. Do not set
38
+ up every attached repository during a scoped task. Read-only tasks remain
39
+ read-only; report needed changes rather than saving them.
40
+
41
+ An existing setup is whatever `read_build_setup` returns. An imported revision
42
+ (`source: imported`) is a draft copied from the environment's old commands and
43
+ has never been reviewed. Its repository script calls were left out when it was
44
+ imported (`needsSetup: true`; automatic image refreshes stay paused until a
45
+ reviewed revision is saved), or, for a revision imported earlier, are still
46
+ there and listed in `repositoryScripts`. Either way it needs **Migration**.
47
+ "It works" is never a reason to keep a script call: the script can change or
48
+ disappear on any commit, and nobody reviewed what it does.
49
+
50
+ Keep a short plan appropriate to the mode. Resume it after build-result messages;
51
+ do not restart setup because a build result arrived.
52
+
53
+ ## Shared execution contract
54
+
55
+ **The image is not a copy of this sandbox.** A build runs the build setup in a
56
+ clean builder: tools installed by hand or files left in this session never reach
57
+ it. Inspect the live tools before relying on this model in an older environment.
58
+
59
+ - Use this Alan cloud sandbox for development and validation. Verify the target
60
+ application's origin before touching data. Do not substitute another machine
61
+ or bypass a platform tool's authorization through shell, HTTP or browser calls.
62
+ - Tool descriptions and schemas define the supported operations in this session.
63
+ Never pass an unsupported argument.
64
+ - If a tool or environment binding is unavailable, continue independent work and
65
+ name the exact unverified requirement. Building the image replaces the
66
+ environment's image for every later session; request it only when authorized.
67
+ - Keep toolchains pinned to the repository's versions. Prefer distribution
68
+ packages; refresh apt in the same command as installation. Do not replace tools
69
+ already supplied by the base image. Take third-party repository codenames from
70
+ `/etc/os-release`.
71
+ - Use `/home/alan/workspace` and the actual repository paths from context.
72
+ The cloud user's HOME is `/home/alan`; use `~/.local/bin` for user-installed
73
+ executables. Never substitute `/home/user` or `/home/daytona`. Inspect
74
+ `/etc/os-release` and, when available, `/etc/alan/image.json` for actual
75
+ OS/tool versions instead of assuming a fixed inventory.
76
+ - Build steps run without a Docker daemon; session startup has rootless Docker.
77
+ Containers and long-lived services belong in startup, not in the build setup.
78
+
79
+ ### Secrets
80
+
81
+ Never print, bake into an image, put in the build setup, or request secret values
82
+ in chat. A literal credential in a build setup is refused. Check saved variable
83
+ names and verify a credential through the narrow command that needs it.
84
+
85
+ Credentials belong in the environment's saved variables or env files. Every
86
+ environment variable is available to every build step and every session, so a
87
+ step reads `$REGISTRY_TOKEN` directly. Use the token for the command that needs
88
+ it and delete any auth file the command writes; never leave tokens, login state
89
+ or credential helpers in the image.
90
+
91
+ For a missing or expired secret or provider connection, use
92
+ `request` op `environment_setup_actions` with names only and precise instructions;
93
+ never borrow another environment's credentials. Continue work that does not
94
+ require it. A missing variable blocks the step that reads it, not unrelated work.
95
+ After delivery, verify without echoing values and repeat the blocked check.
96
+
97
+ ## The build setup
98
+
99
+ `read_build_setup` returns the revision, the environment build setup,
100
+ each repository's build setup by clone path, and the startup. Build setups are YAML
101
+ with these keys.
102
+
103
+ - `initialize`: tools and system packages. Runs on full builds.
104
+ - `maintenance`: dependencies that follow the lockfiles. Runs every build and is
105
+ shown to the agent so it can rerun it after a pull.
106
+ - `knowledge`: `name` and `contents` notes (how to test, lint, seed). Shown to
107
+ the agent, never run.
108
+ - Environment only: `runs-on` (`default` or `linux`), `shell` (`default` or
109
+ `bash`) and `post-build` checks that run after every repository; nonzero fails
110
+ the build.
111
+ - Repository only: `clone` with `ref` and `submodules`. `path`, `depth`, `tags`
112
+ and `lfs` are not supported yet. `includes` is not supported yet.
113
+ - A step is a command string or a list of `{name, run, env}`. `uses` steps are
114
+ not supported yet: write the command with `run`.
115
+
116
+ Order: the environment's `initialize` and `maintenance` run from `~` before any
117
+ repository; then each repository is copied in and its `initialize` and
118
+ `maintenance` run in its directory; then `post-build`.
119
+
120
+ Each step is a fresh bash shell. To pass a variable to later steps and to
121
+ sessions, append a line to `$ENVRC`:
122
+
123
+ ```bash
124
+ echo "PATH='$HOME/.local/bin:$PATH'" >> "$ENVRC"
125
+ echo "ANDROID_HOME='/opt/android-sdk'" >> "$ENVRC"
126
+ ```
127
+
128
+ Example environment build setup:
129
+
130
+ ```yaml
131
+ initialize:
132
+ - name: System packages
133
+ run: sudo apt-get update && sudo apt-get install -y --no-install-recommends postgresql redis-server
134
+ post-build:
135
+ - name: Tools resolve
136
+ run: psql --version && redis-server --version
137
+ ```
138
+
139
+ Example repository build setup:
140
+
141
+ ```yaml
142
+ initialize:
143
+ - name: Node tooling
144
+ run: corepack enable
145
+ maintenance:
146
+ - name: Dependencies
147
+ run: pnpm install --frozen-lockfile
148
+ knowledge:
149
+ - name: test
150
+ contents: pnpm test --filter api
151
+ ```
152
+
153
+ ## Startup
154
+
155
+ Startup is saved with `update_build_setup` as `startup`, beside the
156
+ build setup and never in it. It replaces the saved startup, so send the full set.
157
+
158
+ - `tasks` run to exit 0 before new agent runs start. `detach: true` launches the
159
+ command in the background and does not wait, like the old start command.
160
+ - `services` stay up and must pass a `ready` probe: `{kind: http, url}`,
161
+ `{kind: tcp, port}` or `{kind: exec, run}`. Always give a service a probe.
162
+ - Each has a `name` (lowercase letters, digits, hyphens), `repository` (a clone
163
+ path from `read_build_setup`, or `null` for the workspace root), `run`,
164
+ optional `timeoutSeconds` and `optional`. `startup: null` clears startup.
165
+
166
+ Startup must tolerate reruns, preserve data, skip healthy services and surface
167
+ bootstrap failures. Run migrations and idempotent seeding as tasks before the
168
+ services that need them.
169
+
170
+ `run_startup` (optional `node`) runs the saved startup, or one task or service,
171
+ in this session's live sandbox and returns each node's status with the redacted
172
+ tail of `~/.alan/start-commands.log`. If startup is already running it returns
173
+ that state; call it again to watch it settle.
174
+
175
+ - Context says `Startup <node> failed with exit code N`: call `read_build_setup`,
176
+ fix that node with `update_build_setup`, call `run_startup` with that `node`,
177
+ read the log it returns, then run it without `node` once it passes.
178
+ - Context says the saved build setup is invalid: startup never ran. Fix the cited
179
+ field with `update_build_setup`, then call `run_startup`.
180
+ - A context line saying the latest image build failed carries its code and
181
+ message; `get_cloud_machine` has the full failure. UI-started and nightly builds
182
+ send no message, so this line is how you learn their result.
183
+
184
+ ## Initial setup
185
+
186
+ 1. Inspect README, AGENTS.md, package manifests/lockfiles, tool-version files,
187
+ CI, existing scripts and service definitions. Identify canonical install,
188
+ generation, migration, start and seed commands from those documented
189
+ sources, and note where each came from. Read a setup script to learn its
190
+ commands; never call it from the build setup or startup. Identify required
191
+ services, secrets and documented test identities.
192
+ 2. Get the smallest required stack running in this sandbox. Fix the first
193
+ concrete failing layer: system tools, project install/generation, local
194
+ configuration, then services. Read the current startup log when context says
195
+ startup failed; compare timestamps before treating an old failure as current.
196
+ 3. Run **Product validation** below. Make its data/auth path repeatable with
197
+ startup tasks. Never bake a generated PAT or session into the image. If the
198
+ repo has no authorized test identity, report the authenticated path as
199
+ unverified rather than inventing credentials.
200
+ 4. Draft the build setup and startup, then follow **Draft, test, save, build**.
201
+
202
+ ## Maintenance
203
+
204
+ 1. Read the build setup and inspect the affected manifest, lockfile and startup.
205
+ Identify what future sessions need beyond this sandbox's state.
206
+ 2. Persist project packages in manifests and lockfiles. If `maintenance` already
207
+ installs from that lockfile, change nothing in the build setup and run the
208
+ affected install and feature checks. A system package, OS library, toolchain
209
+ or runtime service is environment work: change the smallest step.
210
+ 3. Follow **Draft, test, save, build** for the change and the task's feature
211
+ validation for affected runtime flows.
212
+
213
+ ## Verification
214
+
215
+ Read the build setup, inspect the context's current startup result and its log. A
216
+ detached task may have exited successfully while a service later failed; inspect
217
+ live processes and readiness. Run **Product validation** for the requested scope.
218
+
219
+ When nothing needs to change, report the observed result without saving or
220
+ building. Never infer a verified new-session boot from manual startup or an
221
+ image build alone.
222
+
223
+ ## Draft, test, save, build
224
+
225
+ 1. **Read.** Call `read_build_setup`; note `revision`.
226
+ 2. **Draft the smallest change.** Tools and system packages go in `initialize`;
227
+ dependencies that follow lockfiles in `maintenance`; test, lint and seed notes
228
+ in `knowledge`; long-running processes in `startup` services with a probe.
229
+ Environment-wide tools go in the environment build setup; repository work goes
230
+ in that repository's build setup, keyed by clone path. Write each command
231
+ inline; never call a repository setup script (`.alan/*.sh`, `scripts/setup.sh`,
232
+ `start.sh`) and never add one to the repository.
233
+ 3. **Test.** Call `test_environment_build` with the draft (`environmentSetup`
234
+ and `repositories`). It renders the same Dockerfile as an image build and
235
+ builds it on this sandbox's Docker, with the environment's variables, over
236
+ each repository's working tree as a checkout sees it, uncommitted edits
237
+ included. It returns at once with the `log` path; **end your turn**: the
238
+ result arrives as a message in this conversation, so never poll or write an
239
+ until-loop. This is a local builder test, not a hosted build or a new-session
240
+ boot.
241
+ 4. **Fix and retest** the first concrete failure until the test passes: read the
242
+ end of the `log` the failure message names. Read
243
+ [troubleshooting](references/troubleshooting.md).
244
+ 5. **Save.** Call `update_build_setup` with `expectedRevision` from the
245
+ read, the passing scopes and the `startup`. Scopes you leave out keep their
246
+ text. A stale revision is refused: read again, reapply, retest. Fix any
247
+ validation error it returns and save again. Saving builds nothing. Pass
248
+ `optionalRepositories` (clone paths) for repositories a build may leave out
249
+ when Alan cannot read them; it replaces the saved list, `[]` makes every
250
+ repository required, and leaving it out keeps the list.
251
+ 6. **Push, then build.** A hosted build does not see this sandbox: it pins each
252
+ repository's **pushed branch head**, so commit and push the branch first;
253
+ unpushed work is not in the image. Then call `build_environment_image` so new
254
+ sessions boot from the change. It replaces the environment's image when it
255
+ succeeds, and reuses the existing image at once if nothing changed. Request it
256
+ only when authorized. After it is accepted, **end your turn**: the result
257
+ arrives as a message; do not poll or sleep. On the result, check it matches
258
+ the revision you saved. To retry a failed build whose setup did not change,
259
+ call it with `full: true`; with `branch` (and `repository`) it builds that
260
+ pushed branch of one repository.
261
+
262
+ ## Migrate a legacy or imported setup
263
+
264
+ Run this whenever `read_build_setup` returns `needsReview: true`, an `attention`
265
+ line, `source: imported`, or any entry in `repositoryScripts`, before other setup
266
+ work. Do not delete tracked `.alan` files or other scripts from the repository:
267
+ that is the repository owner's call. Only stop depending on them.
268
+
269
+ 1. **Read the sources.** Read every script the old setup called (the
270
+ `repositoryScripts` entries; for `needsSetup`, look for `.alan/setup.sh`,
271
+ `.alan/start.sh`, `.alan/environment.json`, `scripts/setup.sh` and the like)
272
+ and the repository's documented sources: README, AGENTS.md, manifests and
273
+ lockfiles, tool-version files, CI.
274
+ 2. **Translate.** Turn each script into build setup steps: system packages and
275
+ toolchains into the environment `initialize`; lockfile installs into the
276
+ repository `maintenance`; migrations and idempotent seeds into startup tasks;
277
+ long-running processes into startup `services`, each with a `ready` probe;
278
+ test, lint and seed commands into `knowledge`. Give every step a name and
279
+ keep a note of the file and line each command came from.
280
+ 3. **Test** the draft with `test_environment_build` until it passes.
281
+ 4. **Save** with `update_build_setup`. The saved revision has no step or startup
282
+ node that calls a repository script; `read_build_setup` must show
283
+ `repositoryScripts: []` and no script `attention` line.
284
+ 5. **Build** with `build_environment_image` when authorized, and confirm from
285
+ `get_cloud_machine` or the Builds tab that the image was imported to the
286
+ provider and became the current image, not only that the build succeeded.
287
+ 6. **Verify a new session.** Start or ask for a new session and confirm its
288
+ automatic startup succeeded and one product check passed.
289
+ 7. **Report** each old command and the steps that replace it, with sources, and
290
+ list anything that could not be translated as an explicit open item.
291
+
292
+ ## Results, refusals and attempts
293
+
294
+ Both tools and both results are structured so you act on them without guessing.
295
+
296
+ - A refusal is `{code, message, nextStep, admissions?}`. Do what `nextStep`
297
+ says; do not retry the same call unchanged. `admissions` lists every
298
+ repository's verdict (`clonePath`, `branch`, `outcome`, `included`, `code`,
299
+ `nextStep`). Codes: `repository_credential_missing` and `access_denied`
300
+ (`request` op `github_connection` for GitHub, `integration_connection` for
301
+ another host, then end the turn), `build_secret_missing` (`request` op
302
+ `environment_setup_actions` with the names), `branch_not_found` and
303
+ `repository_empty` (fix the branch with `update_environment_repository`, or
304
+ push), `provider_error` (retry once, then report), `unknown_repository`
305
+ (use a clone path from `read_build_setup`) and `build_setup_revision_conflict`
306
+ (read again, reapply, save). A GitHub 404 cannot tell a missing branch from
307
+ an empty or invisible repository, so `branch_not_found` there may be either.
308
+ - If a refusal names a repository that `read_build_setup` does not show, stop
309
+ and report a platform blocker; do not retry or work around it.
310
+ - Never repeat an unchanged call that returned `invalid_build_setup`. After two
311
+ identical refusals, stop and report the message.
312
+ - `read_build_setup` also returns each repository's `optional` flag and its
313
+ `lastAdmission` (what the newest build request decided for it) and
314
+ `lastBuildRequest`, so you see which repositories a build would skip or
315
+ refuse before you build.
316
+ - `test_environment_build`, `build_environment_image` and their refusals carry
317
+ `attempt` (failed test and image builds in this conversation, plus one),
318
+ `failedBuilds` and `repeatedStep` (`{step, times}` when the same step failed
319
+ again, else null). **Stop and report** when `failedBuilds` reaches 5 or
320
+ `repeatedStep.times` reaches 3: give the error, the attempts and the action
321
+ needed. Do not count builds yourself.
322
+
323
+ For maintenance, a passing `test_environment_build` plus a saved revision
324
+ satisfies clean-build validation; build the image when later sessions must pick
325
+ the change up.
326
+
327
+ For the native Android emulator toolchain, which `/alan-test-android` reports
328
+ when it is missing, follow [android](references/android.md): it checks the two
329
+ requirements a build setup cannot provide (KVM and machine size) before adding
330
+ the SDK.
331
+
332
+ ## Product validation
333
+
334
+ Check service readiness first, then one bounded representative journey on the
335
+ actual primary surface. For UI flows, use `alan-test-feature` when installed and
336
+ the repository's testing overlay: reach a protected page through documented test
337
+ auth, perform one safe test-data change, verify it after refresh or an API read,
338
+ and inspect browser errors. Record the route, auth method and evidence/report.
339
+ For an API/CLI, perform a meaningful authorized operation and verify its result;
340
+ a static site needs its main page and any available navigation/interaction.
341
+
342
+ When test data is required, confirm the documented seed/fixture command works
343
+ and can be repeated safely. Distinguish existing-data reruns from fresh-data
344
+ initialization: use an authorized disposable database/fixture target when
345
+ available. Never reset the current database or rotate another session's
346
+ credentials for this check. If fresh initialization cannot be exercised, report
347
+ it unverified. An HTTP 200, login form or screenshot of an empty shell is
348
+ service evidence, not product validation. Do not change application behavior to
349
+ hide setup failures or run broad suites as a substitute for this journey.
350
+
351
+ ## Outcome
352
+
353
+ - Initial setup and migration are **done** only when each of these passed, and
354
+ each is reported separately: the draft test build, the saved revision, the
355
+ image build and its provider import becoming current, a **new** session's
356
+ automatic startup, and the product check. Report per repository **set up
357
+ now**, **already set up** or **blocked**; for a migration, list each old
358
+ command with the steps that replace it.
359
+ - Maintenance: the revision saved, the test result and the affected feature check.
360
+ - Verification: observed state only; report any repair needed separately.
361
+
362
+ Report mode and scope, the revision saved, startup changes, readiness, product
363
+ journey and repeatable auth/seed path, build ID and result if requested, and
364
+ remaining gaps with next actions. Use **complete** only when all requested
365
+ checks have passed; **partially verified** when some evidence is missing;
366
+ **blocked** when a required next action cannot proceed. Name secrets only.
367
+ Distinguish draft test builds, hosted builds, observed startup and actual
368
+ new-session boot evidence.
@@ -0,0 +1,118 @@
1
+ # Native Android toolchain
2
+
3
+ Use this when a repository needs the Android emulator: `/alan-test-android`
4
+ exited 3 with missing Android prerequisites, or the user asks to test a native
5
+ Android app (APK, Gradle, React Native, Expo, Flutter, Kotlin Multiplatform).
6
+
7
+ ## Check the machine first
8
+
9
+ Two requirements come from the environment, not the repository. Check both
10
+ before persisting anything:
11
+
12
+ - **`/dev/kvm` exists.** It is a provider capability. Freestyle environments
13
+ expose it; Daytona and E2B do not, and the emulator cannot run there. On
14
+ Freestyle the image grants `alan` access to the node at every boot, so there
15
+ is no permission step to add. If the node is missing entirely, do not add the
16
+ SDK to the image: report that native Android needs a Freestyle environment,
17
+ which an Alan admin sets for the environment or team.
18
+ - **At least 16 GiB of memory** (`grep MemTotal /proc/meminfo`). The emulator
19
+ takes about 1.7 GB and a Gradle daemon about 1.7 GB on top of the agent and
20
+ any started services; an 8 GiB machine dropped the agent offline. If smaller,
21
+ ask the user to pick **Extra large** in the environment's machine picker
22
+ (Freestyle's default). **2× Extra large** is available on plans with large
23
+ cloud machines and suits builds that run beside the emulator.
24
+
25
+ When both hold, persist the toolchain below as maintenance.
26
+
27
+ ## Build setup
28
+
29
+ Add to the environment build setup's `initialize`, keeping its existing steps. Set
30
+ variables through `$ENVRC`, not `/etc/profile.d`: profile scripts reach login
31
+ shells only, so an agent's shell would see an empty `ANDROID_HOME`.
32
+
33
+ ```yaml
34
+ initialize:
35
+ - name: Android packages
36
+ run: |
37
+ sudo apt-get update
38
+ sudo apt-get install -y --no-install-recommends \
39
+ openjdk-17-jdk-headless unzip libpulse0 libgl1 libnss3 \
40
+ libxcomposite1 libxcursor1 libxi6 libxtst6 libasound2t64
41
+ - name: Android environment
42
+ run: |
43
+ {
44
+ echo "ANDROID_HOME='/opt/android-sdk'"
45
+ echo "ANDROID_SDK_ROOT='/opt/android-sdk'"
46
+ echo "JAVA_HOME='/usr/lib/jvm/java-17-openjdk-amd64'"
47
+ echo "FLUTTER_ROOT='/opt/flutter'"
48
+ } >> "$ENVRC"
49
+ - name: Android SDK
50
+ run: |
51
+ API=34
52
+ BUILD_TOOLS=34.0.0
53
+ ANDROID_HOME=/opt/android-sdk
54
+ sudo mkdir -p "$ANDROID_HOME/cmdline-tools"
55
+ sudo chown -R "$(id -u):$(id -g)" "$ANDROID_HOME"
56
+ curl -fsSL -o /tmp/cmdline-tools.zip \
57
+ https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
58
+ unzip -qo /tmp/cmdline-tools.zip -d "$ANDROID_HOME/cmdline-tools"
59
+ rm -rf "$ANDROID_HOME/cmdline-tools/latest"
60
+ mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest"
61
+ rm -f /tmp/cmdline-tools.zip
62
+ (yes || true) | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses >/dev/null
63
+ "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --install platform-tools emulator \
64
+ "platforms;android-$API" "build-tools;$BUILD_TOOLS" \
65
+ "system-images;android-$API;google_apis;x86_64" >/dev/null
66
+ curl -fsSL -o /tmp/scrcpy.tgz \
67
+ https://github.com/Genymobile/scrcpy/releases/download/v3.3.4/scrcpy-linux-x86_64-v3.3.4.tar.gz
68
+ sudo mkdir -p /opt/scrcpy
69
+ sudo tar xzf /tmp/scrcpy.tgz -C /opt/scrcpy --strip-components=1
70
+ sudo rm -f /opt/scrcpy/adb /tmp/scrcpy.tgz
71
+ printf '#!/bin/sh\nADB="${ADB:-%s/platform-tools/adb}" exec /opt/scrcpy/scrcpy "$@"\n' "$ANDROID_HOME" \
72
+ | sudo tee /usr/local/bin/scrcpy >/dev/null
73
+ sudo chmod +x /usr/local/bin/scrcpy
74
+ ```
75
+
76
+ Take the API level and build-tools from the app's `targetSdk` and `compileSdk`
77
+ (`grep -rn -E 'targetSdk|compileSdk' --include='*.gradle*' .`) and edit `API` and
78
+ `BUILD_TOOLS` to match. The `(yes || true)` form avoids a SIGPIPE failure once
79
+ `sdkmanager` stops reading.
80
+
81
+ Add this step for a Flutter app; leave it out for a plain Android, React Native
82
+ or Kotlin Multiplatform app:
83
+
84
+ ```yaml
85
+ - name: Flutter SDK
86
+ run: |
87
+ FLUTTER_ROOT=/opt/flutter
88
+ releases="$(curl -fsSL https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json)"
89
+ hash="$(jq -r '.current_release.stable' <<<"${releases}")"
90
+ archive="$(jq -r --arg h "${hash}" '.releases[] | select(.hash == $h) | .archive' <<<"${releases}")"
91
+ sudo mkdir -p "$FLUTTER_ROOT"
92
+ sudo chown -R "$(id -u):$(id -g)" "$FLUTTER_ROOT"
93
+ curl -fsSL -o /tmp/flutter.tar.xz \
94
+ "https://storage.googleapis.com/flutter_infra_release/releases/${archive}"
95
+ tar xJf /tmp/flutter.tar.xz -C "$FLUTTER_ROOT" --strip-components=1
96
+ rm -f /tmp/flutter.tar.xz
97
+ sudo ln -sf "$FLUTTER_ROOT/bin/flutter" /usr/local/bin/flutter
98
+ sudo ln -sf "$FLUTTER_ROOT/bin/dart" /usr/local/bin/dart
99
+ flutter --version >/dev/null
100
+ ```
101
+
102
+ The image carries no Flutter, so this resolves the current stable SDK from
103
+ Google's release metadata. `/usr/local/bin` is on `PATH` for non-login shells.
104
+
105
+ The SDK, system image and JDK add about 5.8 GB to the image, Flutter about 1 GB.
106
+ KVM needs no step of your own: the image grants `alan` access to `/dev/kvm` at
107
+ boot, and the node lives in the container's own `/dev`, so it survives a memory
108
+ pause.
109
+
110
+ Test the draft with `test_environment_build`, then save it with
111
+ `update_build_setup` on the current `expectedRevision`.
112
+
113
+ ## Validation
114
+
115
+ After the draft test passes and the image is built, run `/alan-test-android`'s device readiness
116
+ step (`scripts/android-up.sh --api <level>` from that skill's package) in a
117
+ session on the new image. Exit 0 with `SERIAL=` and `SCREENSHOT=` lines is a
118
+ pass; exit 3 lists what is still missing. A cold boot takes 30 to 110 seconds.
@@ -0,0 +1,38 @@
1
+ # Environment build troubleshooting
2
+
3
+ Read the failing step and its first concrete error before a package-manager epilogue.
4
+ Use the live tool schema; do not pass unsupported arguments. Fix the draft, rerun
5
+ `test_environment_build` (its result arrives as a message), then save with `update_build_setup`.
6
+
7
+ | Error in the build failure | Usual cause |
8
+ | --- | --- |
9
+ | `Unable to locate package …` | no `apt-get update` before that install |
10
+ | `command not found` / exit 127 | installed by hand in this sandbox but not by a step, or not on `PATH`; append the path to `$ENVRC` |
11
+ | a variable set in an earlier step is empty | each step is a fresh shell; append `KEY='value'` to `"$ENVRC"` |
12
+ | `error while loading shared libraries` | hand-installed binary missing a library apt would have pulled in |
13
+ | `NAME: … required` / empty variable | the variable is not saved on the environment; add it in Cloud settings (every variable reaches every step) |
14
+ | literal credential refused | a token or password is written in the build setup; read it from an environment variable instead |
15
+ | `Cannot connect to the Docker daemon` | Docker in a build step; move it to a startup task or service |
16
+ | `Depends: … but it is not installable` / `unmet dependencies` | a third-party apt repository for another Ubuntu release; use `$VERSION_CODENAME`, or the distribution's package |
17
+ | `pkgProblemResolver … held packages` / `Conflicts:` | reinstalling something the image ships (`docker.io` against Docker Engine); drop that package |
18
+ | `No such file or directory` for a repository file | a step ran before the repository was copied in; move it into that repository's build setup |
19
+ | `No such file or directory` for another repository | that repository is copied in later; move the step to its build setup, or reach only repositories listed before it |
20
+ | `git checkout` / `git fetch` / `pathspec … did not match` | the builder has one shallow, detached commit per repository and no credentials; never switch branches in a step, set `clone.ref` in the repository build setup |
21
+ | `unknown key; allowed keys are …` / `unknown step field` | a typo or an unsupported key; the message names the path |
22
+ | `'uses' … not supported` / `includes` / `clone.path` | not supported yet; write the command with `run`, or drop the key |
23
+ | `only an environment build setup can define post-build` / `only a repository build setup can set clone` | the key is in the wrong scope |
24
+ | `YAML anchors and aliases are not supported` | write the value out in full |
25
+ | stale `expectedRevision` (`build_setup_revision_conflict`) | someone saved first; read again, reapply, retest |
26
+ | a `post-build` check fails | a tool is missing or not on `PATH` after every repository ran; fix the step that installs it |
27
+ | `… is not on a supported git host` / `must be a credential-free https URL` | a repository on a self-hosted or unknown host is attached; report it as a blocker |
28
+ | `repository_credential_missing` / `access_denied` | neither the organization nor the member building can read the repository; follow `nextStep` (`request` op `github_connection` or `integration_connection`) |
29
+ | `branch_not_found` / `repository_empty` | the branch is not pushed, is misspelled, or the repository has no commits; push it or fix it with `update_environment_repository`; a GitHub 404 may also mean an empty or invisible repository |
30
+ | `provider_error` | the git host failed (the message carries its text); retry once, then report |
31
+ | `Set NAME on the environment before building` / `build_secret_missing` | a build secret is not saved; `request` op `environment_setup_actions` with the names, end the turn, then build again |
32
+ | a hosted build lacks a change that works in `test_environment_build` | the test uses this sandbox's working tree and the hosted build uses the pushed branch head; push first |
33
+ | `Setup left credentials in the image` | a step logged in or wrote a token; remove the persistent credential output and delete temporary auth files |
34
+ | `read_build_setup` lists `repositoryScripts`, or `attention` says the revision is imported | the setup still depends on a repository script or is an unreviewed import; follow **Migrate a legacy or imported setup** and save a revision with no script calls |
35
+ | `needsSetup: true` and nothing in the image works | the import left out the repository scripts the old setup ran; read them and write their commands as build setup steps |
36
+ | a refusal names a repository `read_build_setup` does not show (`unknown_repository`) | platform state; stop and report it instead of retrying |
37
+ | the same `invalid_build_setup` twice | change what the message names; after two identical refusals stop and report |
38
+ | build succeeded but sessions boot the old image | the provider import is still running or failed (Builds tab shows **Importing** or **Import failed**); wait for it or report the provider error |
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: alan-skill-authoring
3
+ version: 1.0.3
4
+ description: Use in a local or cloud Alan session when the user asks to create a Skill without specifying its location, create or edit a team-owned Alan Skill, or turn a repeated procedure into a Skill. Alan platform Skills are the default. Do not use when the user explicitly requests a repository or filesystem Skill, imports a Skill, or only asks how Skills work.
5
+ ---
6
+
7
+ # Skill authoring
8
+
9
+ Run this workflow in an Alan session on a local computer or in a cloud sandbox.
10
+ Both use Alan's Skill MCP tools for platform authoring. If a required tool is
11
+ unavailable, keep the draft in the conversation and report the missing capability;
12
+ do not write a repository or filesystem Skill as a substitute.
13
+
14
+ Create and update team-owned cloud Skills through Alan's Skill MCP tools. Keep the draft in the conversation. The write tools publish immutable versions immediately, so never call them before the user approves the complete package or update diff.
15
+
16
+ ## Choose the owner
17
+
18
+ - An unqualified request to create a Skill means a team-owned Alan platform Skill, even when the procedure uses repository code or the agent is working in a checkout or local session.
19
+ - If repeated user work suggests a Skill, explain the observed pattern and offer a team-owned platform Skill. Do not start an authoring interview or publish one until the user accepts the suggestion.
20
+ - Use a repository or personal filesystem Skill only when the user explicitly asks for that location. Follow that scope's authoring workflow instead of this one.
21
+ - If the user refers to an existing Skill, inspect its actual owner before updating it. Never move an existing Skill between owners as an incidental update.
22
+
23
+ ## When not to use
24
+
25
+ - For GitHub or local runtime imports, use the Skills import flow.
26
+ - For explicitly requested repository or personal filesystem Skills, use the matching filesystem authoring workflow.
27
+ - For general questions about Skills, answer without starting an authoring interview.
28
+ - For Alan's repository-owned built-in Skills, change and review their source in the Alan repository instead of calling the team Skill tools.
29
+ - For personal filesystem Skills, use the runtime's filesystem skill workflow.
30
+
31
+ ## Confirm the target
32
+
33
+ 1. Use the active Alan team context. Do not ask the user for a team ID when the session already supplies one.
34
+ 2. For an update, require the exact Skill ID supplied by the product context or returned by `skill` op `list`. Never guess an ID from a name.
35
+ 3. Confirm that `skill` op `list`, `skill` op `get`, `skill` op `create`, and `skill` op `update` are available before promising publication. If a required tool is absent, keep the draft in chat and report the missing tool.
36
+
37
+ ## Create a Skill
38
+
39
+ 1. Understand the real procedure before drafting. Ask one question at a time and only for facts the user has not already supplied:
40
+ - what outcome the Skill should produce;
41
+ - three to five phrases that should trigger it;
42
+ - similar requests that should not trigger it;
43
+ - the actual ordered procedure and decision points;
44
+ - common failures and the concrete response to each;
45
+ - files, records, messages, or other artifacts that prove success.
46
+ 2. Derive a lowercase hyphenated name and search `skill` op `list` using that name and the core purpose. If an existing Skill overlaps, show the match and ask whether to update it or create a distinct Skill. Do not silently create a duplicate.
47
+ 3. Draft a complete `SKILL.md`. Use third-person trigger language in `description`, imperative steps, explicit branches, concrete failure handling, and a validation section. Do not leave `TODO`, `TBD`, placeholder instructions, or generic phrases such as "handle errors gracefully."
48
+ 4. Add supporting files only when the procedure needs reusable scripts, long reference material, templates, or examples. Keep simple Skills to one `SKILL.md`.
49
+ 5. Show the proposed name, description, and complete package contents. State that approval will publish immutable Version 1 and enable it for the team.
50
+ 6. Ask one explicit question: "Publish this Skill?" Do not call a write tool until the user clearly approves this exact draft.
51
+ 7. Call `skill` op `create` once with the complete package and `enabled: true`.
52
+ 8. Call `skill` op `get` with the returned Skill ID and Version ID. Report the read-back name, version, enabled state, validation diagnostics, and any invalidation dispatch failure. Desired-state invalidation is not proof that every runtime installed the Skill.
53
+
54
+ ## Update a Skill
55
+
56
+ 1. Call `skill` op `get` for the exact Skill ID before proposing a change. Use its latest Version ID as the update base.
57
+ 2. Read every package file needed to understand the requested change. Preserve untouched files and executable flags.
58
+ 3. Ask only for missing intent, then show the exact upserted files and deleted paths. Explain the behavioral change in plain language.
59
+ 4. Ask one explicit question: "Publish this new Skill version?" Do not call `skill` op `update` before approval.
60
+ 5. Call `skill` op `update` once with the latest base Version ID and only the required upserts and deletions.
61
+ 6. Read the returned version with `skill` op `get` and report the same read-back evidence as creation.
62
+
63
+ ## Failure handling
64
+
65
+ - `SKILL_VERSION_CONFLICT`: call `skill` op `get` again, rebuild the proposed diff on the new latest version, show the revised diff, and request approval again. Never auto-merge or retry the stale write.
66
+ - Duplicate or reserved name: return to the naming step and show the conflicting Skill before proposing a new name.
67
+ - Validation failure: correct the draft in chat and show the corrected package. Do not describe the Skill as published.
68
+ - Permission failure: preserve the draft in the conversation and state which team action was refused. Do not substitute another team.
69
+ - Runtime invalidation failure: report the Skill version as published but rollout as unconfirmed. Do not retry publication to repair delivery.
70
+
71
+ ## Validation
72
+
73
+ Success requires all of the following:
74
+
75
+ - no placeholder content remains;
76
+ - the description contains specific triggers and anti-triggers;
77
+ - procedure branches and failure actions are explicit;
78
+ - the user approved the exact package or diff that was written;
79
+ - `skill` op `get` confirms the expected immutable version after the write.
80
+
81
+ ## Artifacts
82
+
83
+ The durable output is a team-owned cloud Skill and immutable Skill Version. The conversation retains the approved preview and read-back evidence.