@andorra-labs/code 0.1.5 → 0.1.6

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 (164) hide show
  1. package/dist/src/account-presentation.js +3 -3
  2. package/dist/src/agent-execution.d.ts +2 -0
  3. package/dist/src/agent-execution.js +126 -20
  4. package/dist/src/agent-mcp.d.ts +18 -1
  5. package/dist/src/agent-mcp.js +103 -8
  6. package/dist/src/app-server/protocol.d.ts +33 -3
  7. package/dist/src/app-server/protocol.js +14 -1
  8. package/dist/src/app-server/workspace.d.ts +1 -0
  9. package/dist/src/app-server/workspace.js +7 -1
  10. package/dist/src/app-server.d.ts +115 -41
  11. package/dist/src/app-server.js +1229 -219
  12. package/dist/src/automation-runner.d.ts +9 -0
  13. package/dist/src/automation-runner.js +22 -1
  14. package/dist/src/automation-tool.js +8 -1
  15. package/dist/src/automations.js +1 -1
  16. package/dist/src/browser-captcha-tool.d.ts +54 -0
  17. package/dist/src/browser-captcha-tool.js +374 -0
  18. package/dist/src/browser-panel-tool.d.ts +7 -0
  19. package/dist/src/browser-panel-tool.js +74 -3
  20. package/dist/src/browser-runner.js +19 -4
  21. package/dist/src/browser-server.js +21 -1
  22. package/dist/src/browser-session.d.ts +16 -0
  23. package/dist/src/browser-session.js +35 -0
  24. package/dist/src/browser-ui/app.js +193 -3
  25. package/dist/src/browser-ui/style.css +15 -1
  26. package/dist/src/browser-view.d.ts +72 -4
  27. package/dist/src/browser-view.js +229 -17
  28. package/dist/src/capabilities.js +13 -2
  29. package/dist/src/capsolver.d.ts +60 -0
  30. package/dist/src/capsolver.js +101 -0
  31. package/dist/src/claude-provider.d.ts +6 -0
  32. package/dist/src/claude-provider.js +34 -3
  33. package/dist/src/cli-executable.d.ts +33 -0
  34. package/dist/src/cli-executable.js +64 -0
  35. package/dist/src/cli-process.d.ts +47 -0
  36. package/dist/src/cli-process.js +113 -0
  37. package/dist/src/cli-sign-in.d.ts +68 -0
  38. package/dist/src/cli-sign-in.js +224 -0
  39. package/dist/src/cli.js +53 -22
  40. package/dist/src/code-intelligence/CodeIntelligenceManager.d.ts +1 -1
  41. package/dist/src/code-intelligence/CodeIntelligenceManager.js +5 -5
  42. package/dist/src/coding-tools.js +44 -5
  43. package/dist/src/command-output-tap.d.ts +16 -0
  44. package/dist/src/command-output-tap.js +45 -0
  45. package/dist/src/command-screens.js +3 -3
  46. package/dist/src/commands.d.ts +10 -1
  47. package/dist/src/commands.js +7 -7
  48. package/dist/src/completion.d.ts +23 -5
  49. package/dist/src/completion.js +334 -17
  50. package/dist/src/config.d.ts +13 -0
  51. package/dist/src/config.js +28 -2
  52. package/dist/src/deadline.js +6 -0
  53. package/dist/src/extensions.d.ts +1 -0
  54. package/dist/src/extensions.js +16 -3
  55. package/dist/src/graph-provider-portability.js +2 -2
  56. package/dist/src/graph-quota.d.ts +1 -1
  57. package/dist/src/graph-quota.js +1 -1
  58. package/dist/src/graph-runner.js +35 -21
  59. package/dist/src/graph-selection.d.ts +6 -0
  60. package/dist/src/graph-selection.js +10 -0
  61. package/dist/src/graph-server.d.ts +7 -0
  62. package/dist/src/graph-server.js +61 -3
  63. package/dist/src/graph-sync.d.ts +50 -0
  64. package/dist/src/graph-sync.js +383 -12
  65. package/dist/src/graph-ui/app.js +61 -8
  66. package/dist/src/graph-ui/icons.js +1 -0
  67. package/dist/src/graph-ui/index.html +1 -1
  68. package/dist/src/graph-ui/skill-picker.js +242 -0
  69. package/dist/src/graph-ui/style.css +19 -0
  70. package/dist/src/graphs.d.ts +46 -4
  71. package/dist/src/graphs.js +152 -27
  72. package/dist/src/grok-provider.d.ts +50 -0
  73. package/dist/src/grok-provider.js +186 -0
  74. package/dist/src/handoffs.d.ts +13 -0
  75. package/dist/src/handoffs.js +31 -1
  76. package/dist/src/managed-sign-in.d.ts +38 -0
  77. package/dist/src/managed-sign-in.js +169 -0
  78. package/dist/src/markdown.d.ts +5 -0
  79. package/dist/src/markdown.js +5 -2
  80. package/dist/src/mcp.js +11 -0
  81. package/dist/src/membership.d.ts +8 -1
  82. package/dist/src/membership.js +15 -5
  83. package/dist/src/model-metadata.js +14 -2
  84. package/dist/src/model-override.d.ts +10 -0
  85. package/dist/src/model-override.js +20 -0
  86. package/dist/src/opencode-cli-provider.d.ts +122 -0
  87. package/dist/src/opencode-cli-provider.js +415 -0
  88. package/dist/src/opencode-provider.js +23 -8
  89. package/dist/src/palette.d.ts +2 -0
  90. package/dist/src/palette.js +2 -0
  91. package/dist/src/permissions.d.ts +19 -1
  92. package/dist/src/permissions.js +30 -1
  93. package/dist/src/powershell-pool.d.ts +2 -2
  94. package/dist/src/powershell-pool.js +18 -5
  95. package/dist/src/provider-connection.js +36 -0
  96. package/dist/src/provider-engine.d.ts +2 -1
  97. package/dist/src/provider-engine.js +64 -13
  98. package/dist/src/provider-import.js +6 -1
  99. package/dist/src/provider-settings.js +22 -3
  100. package/dist/src/providers.d.ts +12 -1
  101. package/dist/src/providers.js +27 -8
  102. package/dist/src/pull-requests.d.ts +111 -17
  103. package/dist/src/pull-requests.js +308 -76
  104. package/dist/src/qa/qa-authorize.js +9 -1
  105. package/dist/src/react-runtime.js +76 -5
  106. package/dist/src/remote/engine-pool.js +1 -1
  107. package/dist/src/run-progress.js +6 -1
  108. package/dist/src/run-records.d.ts +133 -27
  109. package/dist/src/run-records.js +320 -40
  110. package/dist/src/runtime.d.ts +38 -1
  111. package/dist/src/runtime.js +27 -4
  112. package/dist/src/save-lock.d.ts +11 -0
  113. package/dist/src/save-lock.js +29 -2
  114. package/dist/src/sessions.js +4 -1
  115. package/dist/src/shell.js +4 -1
  116. package/dist/src/side-panel.d.ts +1 -1
  117. package/dist/src/side-panel.js +1 -1
  118. package/dist/src/skill-commands.d.ts +2 -0
  119. package/dist/src/skill-commands.js +2 -0
  120. package/dist/src/skills/bundled/create-agent/SKILL.md +81 -0
  121. package/dist/src/skills/bundled/create-skill/SKILL.md +81 -0
  122. package/dist/src/skills/bundled/doctor/SKILL.md +43 -0
  123. package/dist/src/skills/bundled/graph-manager/SKILL.md +97 -0
  124. package/dist/src/skills/bundled/graph-manager/errors.md +38 -0
  125. package/dist/src/skills/bundled/graph-manager/patterns.md +78 -0
  126. package/dist/src/skills/bundled/manage-mcp/SKILL.md +75 -0
  127. package/dist/src/skills/bundled/manage-mcp/probe.md +165 -0
  128. package/dist/src/skills/bundled/manage-skills/SKILL.md +67 -0
  129. package/dist/src/skills/bundled/provenance.json +50 -0
  130. package/dist/src/skills/bundled/write-instructions/SKILL.md +42 -0
  131. package/dist/src/skills/invocable-skills.d.ts +41 -0
  132. package/dist/src/skills/invocable-skills.js +49 -0
  133. package/dist/src/skills/prompt-skills.d.ts +1 -0
  134. package/dist/src/skills/prompt-skills.js +33 -0
  135. package/dist/src/skills/runtime-skills.d.ts +4 -0
  136. package/dist/src/skills/runtime-skills.js +21 -0
  137. package/dist/src/structured-step.d.ts +55 -0
  138. package/dist/src/structured-step.js +85 -0
  139. package/dist/src/subagent-run.d.ts +1 -1
  140. package/dist/src/subagent-run.js +29 -33
  141. package/dist/src/telemetry/schema.d.ts +2 -2
  142. package/dist/src/telemetry/schema.js +3 -2
  143. package/dist/src/terminal-ui.d.ts +29 -0
  144. package/dist/src/terminal-ui.js +112 -28
  145. package/dist/src/timers.d.ts +21 -2
  146. package/dist/src/timers.js +12 -4
  147. package/dist/src/tool-names.d.ts +18 -0
  148. package/dist/src/tool-names.js +26 -0
  149. package/dist/src/tools.js +45 -11
  150. package/dist/src/trajectory.js +32 -12
  151. package/dist/src/types.d.ts +23 -0
  152. package/docs/agents/mcp-server.md +13 -1
  153. package/docs/agents/subagent-mode.md +7 -4
  154. package/docs/concepts/security.md +2 -0
  155. package/docs/getting-started/configure-providers.md +29 -2
  156. package/docs/guides/browser.md +12 -0
  157. package/docs/guides/desktop-app.md +10 -3
  158. package/docs/guides/graph-builder.md +8 -0
  159. package/docs/reference/config.md +2 -2
  160. package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +125 -0
  161. package/docs/superpowers/specs/2026-11-01-pr-section-design.md +7 -0
  162. package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +206 -0
  163. package/package.json +1 -1
  164. package/tests/permissions-test-plan.md +2 -1
@@ -1 +1,3 @@
1
+ /** The built-in command names, without their slash. */
2
+ export declare function builtinSlashCommandNames(): string[];
1
3
  export declare function isBuiltinSlashCommand(input: string): boolean;
@@ -6,6 +6,8 @@ const BUILTIN_COMMANDS = new Set([
6
6
  'feedback', 'yolo', 'tools', 'skills', 'plugins', 'mcp', 'logout', 'status',
7
7
  'clear', 'compact', 'help', 'exit', 'quit',
8
8
  ]);
9
+ /** The built-in command names, without their slash. */
10
+ export function builtinSlashCommandNames() { return [...BUILTIN_COMMANDS]; }
9
11
  export function isBuiltinSlashCommand(input) {
10
12
  return BUILTIN_COMMANDS.has(input.trim().split(/\s+/, 1)[0].slice(1));
11
13
  }
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: create-agent
3
+ description: "Design a reusable Andorra Code Agent (a role with its own instructions, model, capabilities and input/output contract) and produce a file the user imports into their Agent library. Use when the user wants a custom reviewer, tester, researcher or other role to reuse across graphs."
4
+ ---
5
+
6
+ # Create an Agent
7
+
8
+ An Agent is one role in Andorra's graphs: instructions, a provider and model, what it may touch, and the
9
+ structured input it takes and output it returns. The library ships three presets (Orchestrator, Software
10
+ Engineer, QA Tester); this skill designs a new one and writes it as a shareable Agent file that the user
11
+ imports, the same format the library's Share action produces.
12
+
13
+ To put an Agent straight into a graph instead, use the `graph-manager` skill: a graph's agent nodes take the
14
+ same fields.
15
+
16
+ ## Steps
17
+
18
+ 1. **Pin down the role.** What it is for, what it receives, what it must hand back, and what it must never
19
+ do. Ask for an example task.
20
+ 2. **Choose the provider and model.** Use a provider id the user has configured (`/providers` in the
21
+ terminal; `config.json` → `providers[].id`). Leave the model out to use that provider's default.
22
+ 3. **Choose capabilities, least first.** Grant only what the role needs (table below). A reviewer usually
23
+ needs `filesystem: "read"`, `shell: "read-only"`, `git: "read"`.
24
+ 4. **Write the contract.** `inputSchema` and `outputSchema` are JSON Schemas (objects with `properties`,
25
+ `required`, `additionalProperties: false`). Keep outputs to what the next step consumes: findings,
26
+ evidence, a verdict.
27
+ 5. **Write the instruction** as a brief to a colleague: the goal, the steps, the rules, what to report.
28
+ 6. **Show the design** (name, model, capabilities, contract, instruction) and adjust it with the user.
29
+ 7. **Write the file** `<name>.andorra-agent.json` in a folder the user chooses (default: the workspace
30
+ root, which they can delete after importing). Do not write into `<home>/agent-definitions` directly:
31
+ the library keeps revisions and locks there.
32
+ 8. **Tell the user how to import it:** open the Graph Builder (`andorra graph`, or `/graph` → Edit Graphs, or
33
+ the desktop's graph editor), choose **Import agent** in the node library, then pick the file.
34
+
35
+ ## The file
36
+
37
+ ```json
38
+ {
39
+ "format": "andorra-code-agent",
40
+ "formatVersion": 1,
41
+ "exportedAt": "2026-01-01T00:00:00.000Z",
42
+ "agent": {
43
+ "name": "Security Reviewer",
44
+ "description": "Review a change for security issues and report findings with evidence.",
45
+ "node": {
46
+ "id": "agent",
47
+ "type": "agent",
48
+ "name": "Security Reviewer",
49
+ "provider": "<configured provider id>",
50
+ "instruction": "Review the change described in the input for injection, path traversal, secret leaks and unsafe permissions. Read the changed files and their callers. Report each finding with the file, the line and why it is exploitable. Do not modify files.",
51
+ "capabilities": { "filesystem": "read", "shell": "read-only", "git": "read", "github": "none", "browser": "disabled", "deployment": "none" },
52
+ "completion": { "mode": "outcomes", "outcomes": ["pass", "fail"], "criteria": { "pass": "No exploitable issue found", "fail": "At least one exploitable issue" } },
53
+ "inputSchema": { "type": "object", "properties": { "changeSummary": { "type": "string" }, "changedFiles": { "type": "array", "items": { "type": "string" } } }, "required": ["changeSummary"], "additionalProperties": false },
54
+ "outputSchema": { "type": "object", "properties": { "findings": { "type": "array", "items": { "type": "string" } }, "evidence": { "type": "array", "items": { "type": "string" } } }, "required": ["findings"], "additionalProperties": false }
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ Fields of `node` you may use:
61
+
62
+ | Field | Meaning |
63
+ | --- | --- |
64
+ | `instruction` | The role's brief (main text). `systemPrompt` and `prompt` also exist; prefer `instruction`. |
65
+ | `provider`, `model` | A configured provider id; the model is optional. |
66
+ | `capabilities` | `filesystem`: none / read / read-write. `shell`: disabled / read-only / allowed. `git`: none / read / write. `github`: none / read / pull-request / review. `browser`: disabled / playwright. `deployment`: none / allowed. |
67
+ | `completion` | `{ "mode": "single", "outcome": "completed" }`, or `{ "mode": "outcomes", "outcomes": [...], "criteria": { outcome: text } }` for routing. |
68
+ | `inputSchema`, `outputSchema` | JSON Schemas for the handoff in and out. |
69
+ | `limits` | `maxIterations`, `maxToolCalls`, `wallTimeMs`, `maxContextChars`. |
70
+ | `tools` | Restrict to named tools; omit to allow what the capabilities permit. |
71
+ | `subagents` | `{ "enabled": true, "maxConcurrent": 3, "roles": [...] }` for an Agent that delegates. |
72
+
73
+ ## Rules
74
+
75
+ - Never put credentials in an instruction or schema.
76
+ - Grant write, shell or GitHub capabilities only when the role needs them, and say why in the design.
77
+ - A child role's capabilities can never exceed its parent's.
78
+
79
+ ## Report
80
+
81
+ The file path, the import steps, and a one-line summary of the role, its model and its capabilities.
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: create-skill
3
+ description: "Write a new Andorra Code skill: a SKILL.md that tells an agent how to do a recurring task. Use when the user wants to capture a workflow, checklist or house style as a reusable /command, or asks how to make a skill."
4
+ ---
5
+
6
+ # Create a skill
7
+
8
+ A skill is a Markdown file written **for an agent**: the person starts it with `/name` (or the agent loads it
9
+ when a request matches its description), and the agent follows it. Write it the way you would brief a capable
10
+ colleague who has never seen this codebase or this team's habits.
11
+
12
+ ## Choose where it lives
13
+
14
+ | Kind | Path | Who gets it |
15
+ | --- | --- | --- |
16
+ | Project skill | `<workspace>/.andorra/skills/<name>/SKILL.md` (or `.agents/skills/`) | Everyone who opens this repository; commit it |
17
+ | Installed skill | `<home>/skills/<name>/SKILL.md` | Only this installation, in every project; typeable as `/name` and listed in Settings → Skills |
18
+
19
+ `<home>` is `$ANDORRACODE_HOME` when set, otherwise `~/.andorracode`. Ask the user which they want when it is
20
+ not obvious: a team process belongs in the repository; a personal habit belongs in the installation.
21
+
22
+ Project-skill limits (discovery skips files that break them):
23
+
24
+ - `<name>`: starts with a letter or digit; letters, digits, `_` and `-`; at most 48 characters.
25
+ - The file is at most 16 KB (16,384 bytes), UTF-8, no NUL bytes; only the first 12,000 characters are read.
26
+ - At most 16 project skills per repository are discovered.
27
+ - Project skills are read as reference material: they cannot grant permissions or override the user, so
28
+ write them as guidance, not as authority.
29
+
30
+ ## Write the description first
31
+
32
+ The `description` is what an agent sees before deciding to load the skill, so it carries the trigger:
33
+
34
+ - Say **what** the skill does and **when** to use it, in one line, at most 300 characters.
35
+ - Name the words a user would actually say ("release notes", "changelog", "what shipped").
36
+ - Do not describe how; that belongs in the body.
37
+
38
+ ## Template
39
+
40
+ ```markdown
41
+ ---
42
+ name: <name>
43
+ description: "<What it does>. Use when <the situations and phrases that should trigger it>."
44
+ ---
45
+
46
+ # <Title>
47
+
48
+ <One paragraph: the goal and what done looks like.>
49
+
50
+ ## Steps
51
+
52
+ 1. <Concrete step: the command, file or tool, and what to look for.>
53
+ 2. ...
54
+
55
+ ## Rules
56
+
57
+ - <Constraints the agent must keep: what never to do, what needs the user's confirmation.>
58
+
59
+ ## Report
60
+
61
+ <What the agent tells the user at the end, including what it could not verify.>
62
+ ```
63
+
64
+ Writing guidance:
65
+
66
+ - Give exact commands, paths and file names. An agent cannot guess a team's conventions.
67
+ - Say what to check after each risky step, and what to do when it fails.
68
+ - Keep secrets out: refer to environment variables by name.
69
+ - Long reference material (API tables, examples) goes in extra files beside `SKILL.md`; say in the body when
70
+ to read them (`read_skill_resource` with the relative path).
71
+
72
+ ## Steps
73
+
74
+ 1. Ask what recurring task the skill covers, an example request, and what a good result looks like.
75
+ 2. Pick the location and the name; check the name is free (`ls` the skills folder).
76
+ 3. Draft the description and the body from the template; show the draft and adjust it with the user.
77
+ 4. Write the file. Check it: the frontmatter starts the file with `---`, `name` and `description` are set,
78
+ the description is one line of at most 300 characters, and the file is under 16 KB
79
+ (`wc -c` / `(Get-Item <path>).Length`).
80
+ 5. Report the path, the command (`/<name>` for an installed skill), and that it is available from the next
81
+ task. For a project skill, remind the user to commit it.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: doctor
3
+ description: "Check that Andorra Code is set up and healthy: Node, sign-in, configuration, providers, MCP servers, disk space. Use when something does not work (no models, tools missing, sign-in errors, tasks failing at start) or the user asks to check their setup."
4
+ ---
5
+
6
+ # Andorra doctor
7
+
8
+ Check each layer in order, because later layers depend on earlier ones. Read and test; change nothing
9
+ unless the user agrees to a specific fix. Never print a credential: an API key, token or `Authorization`
10
+ header is reported only as "set" or "missing".
11
+
12
+ The Andorra home is `$ANDORRACODE_HOME` when that variable is set, otherwise `~/.andorracode`
13
+ (`%USERPROFILE%\.andorracode` on Windows).
14
+
15
+ ## Checks
16
+
17
+ 1. **Node.js.** `node --version`. Andorra needs 22.19.0 or newer. Older: tell the user to
18
+ upgrade Node.
19
+ 2. **The CLI.** `andorra --version` prints the version and `andorra --help` the usage. Not found: the install did not put `andorra` on `PATH`.
20
+ 3. **Account.** `andorra auth status`. Signed out matters only for account features (graphs beyond the
21
+ Default, sync, paid presets); local tasks with a configured provider still work.
22
+ 4. **Configuration.** `<home>/config.json` parses as JSON, has `"version": 1`, a non-empty `providers`
23
+ array, and `provider` naming one of them. A parse error: report the line and column; do not rewrite the
24
+ file.
25
+ 5. **Providers.** For each provider entry, report its `id`, `type` and `model`. Test reachability without
26
+ sending a key in the output:
27
+ - `openai-compatible` with a `baseUrl`: request `<baseUrl>/models` (send the key header if the entry has
28
+ one, from the environment or file, but print only the HTTP status).
29
+ - Hosted providers (Codex, Claude): they sign in through `/providers`; report whether the entry exists and
30
+ suggest re-running its sign-in there when tasks fail with authentication errors.
31
+ 6. **MCP servers.** For each enabled entry in `mcpServers`, check every `${NAME}` reference is set in this
32
+ environment, and probe it with the `manage-mcp` skill's `probe.md` check. Report the tool count or the
33
+ error.
34
+ 7. **Disk space.** Free space on the drive that holds the home (`df -h <home>`, or
35
+ `Get-PSDrive <letter>` on Windows). Under 2 GB: warn; sessions and builds fail when the disk fills.
36
+ 8. **Workspace.** If the problem is in one project: is it a git repository (`git status`), and does its
37
+ `ANDORRA.md` or `AGENTS.md` exist and stay under 16,000 characters (longer guides are cut off)?
38
+
39
+ ## Report
40
+
41
+ A short table, one row per check: OK, Warning or Problem, and what was seen. Then the fixes, in the order to
42
+ apply them (a broken config before a provider, a provider before an MCP server), each as one command or one
43
+ setting. Say plainly which checks could not run and why.
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: graph-manager
3
+ description: "Design, create, edit, delete or restore Andorra Code graphs (multi-agent workflows) from the user's requirements, through Andorra's graph MCP tools. Use when the user wants a new workflow, wants to change how an existing graph routes work, or wants a graph removed or brought back."
4
+ ---
5
+
6
+ # Manage graphs
7
+
8
+ A graph is a workflow of agent nodes connected by outcome routes: a plan step hands to a build step, a review
9
+ routes `pass` to done and `fail` back to the build, and so on. Graphs are created and changed only through
10
+ Andorra's graph MCP tools (`andorra_graph_*`), which validate every change and save immutable revisions that
11
+ sync to the user's account. Never edit graph files on disk.
12
+
13
+ ## 1. Check the tools are available
14
+
15
+ You need the `andorra_graph_*` tools (they may appear with a server prefix, such as
16
+ `mcp__andorra__andorra_graphs_list`). If they are missing, the graph MCP server is not connected. Offer to
17
+ connect it with the `manage-mcp` skill, as a stdio entry with `"command": "andorra"` and
18
+ `"args": ["mcp-server", "--stdio"]`, and continue in a new task once the user agrees and it is connected.
19
+ A stdio server receives only the variables its entry lists, so when Andorra runs with `ANDORRACODE_HOME` set,
20
+ add `"env": { "ANDORRACODE_HOME": "${ANDORRACODE_HOME}" }`: without it the graph server reads `~/.andorracode`
21
+ (another installation's providers and sign-in). Leave it out when the variable is not set, because an unset
22
+ reference fails the connection.
23
+ Graph editing also needs the user to be signed in (`andorra auth status`); a free account may keep one custom
24
+ graph of up to 3 nodes, without an Orchestrator.
25
+
26
+ ## 2. Read the guide first
27
+
28
+ Call `andorra_graph_guide`. It is the authority on node types, ports, loops, limits and error codes, and it
29
+ changes with the product; this skill does not repeat it.
30
+
31
+ ## 3. Understand what the user wants
32
+
33
+ Ask until you can answer each of these:
34
+
35
+ - What the workflow is for, and what finished looks like.
36
+ - The stages, in order, and what each one hands to the next.
37
+ - Where work loops back (a failed review returns to the builder), and how many attempts are allowed.
38
+ - Which provider and model each agent uses: list them with `andorra_providers_list` and use those ids only.
39
+ - What each agent may touch (read only, write files, run shell, open pull requests).
40
+ - What input a run needs beyond the task text.
41
+
42
+ Then draw a text sketch of the nodes and routes, for example:
43
+
44
+ ```
45
+ plan (agent) --completed--> build (agent) --completed--> review (agent)
46
+ review --pass--> done (end)
47
+ review --fail--> build (at most 3 rounds: limits.maxNodeVisits = 3, a per-node ceiling)
48
+ ```
49
+
50
+ Get the user's approval of the sketch before building anything. `patterns.md` in this skill has tested
51
+ shapes for common workflows; read it with `read_skill_resource` (path `patterns.md`) when one fits.
52
+
53
+ ## 4. Build or change it
54
+
55
+ Before starting, `andorra_graphs_list` shows what exists. A free account that already has its one custom graph
56
+ cannot create another.
57
+
58
+ **Create:** `andorra_graph_begin` with `mode: "create"`, a new `id` (letters, digits, `_`, `-`) and a `name`.
59
+ Then `andorra_graph_node_upsert` for each node (every agent node names a `provider`), `andorra_graph_edge_upsert`
60
+ for each route (the `outcome` must be a port of the source node), and `andorra_graph_patch` for the `entry`
61
+ node and `limits`. Any cycle needs a ceiling: `limits.maxNodeVisits` large enough for the loops, or
62
+ `limits.wallTimeMs`.
63
+
64
+ **Edit:** `andorra_graph_get` to read the latest revision, `andorra_graph_begin` with `mode: "edit"`, then change
65
+ only what the request needs: `andorra_graph_node_patch` for a node's instruction, model or completion;
66
+ `andorra_graph_node_remove` / `andorra_graph_edge_remove` to take parts out (the entry node cannot be removed
67
+ until another node is the entry).
68
+
69
+ The built-in `default` graph cannot be edited: create a new graph with the shape you want instead.
70
+
71
+ ## 5. Validate, show, publish
72
+
73
+ 1. `andorra_graph_validate` and fix every issue it reports; `errors.md` in this skill maps each code to its
74
+ fix. Do not publish around an issue.
75
+ 2. Show the user what changed: nodes added, removed or changed, and routes.
76
+ 3. `andorra_graph_publish`. A `REVISION_CONFLICT` means someone saved a newer revision: begin a new edit draft
77
+ from the latest, reapply your changes, validate and publish again.
78
+ 4. If the user stops partway, `andorra_graph_discard` the draft.
79
+
80
+ ## 6. Delete or restore
81
+
82
+ Deleting is a soft delete: the graph leaves every list and new runs refuse it, but every revision is kept and
83
+ it can be restored.
84
+
85
+ 1. Read the graph's latest `revision` (`andorra_graph_get` or `andorra_graphs_list`).
86
+ 2. Ask the user in chat to confirm deleting that graph, naming it. Do not delete without a clear yes.
87
+ 3. `andorra_graph_delete` with `id`, `expectedRevision` and `confirm` set to the same `id`.
88
+ - `GRAPH_IN_USE`: an automation runs this graph; tell the user which ones and stop.
89
+ - A free account's deleted graph still counts as its one custom graph; it can be restored, not replaced.
90
+ 4. To bring one back: `andorra_graphs_list` with `includeDeleted: true` to find it, then
91
+ `andorra_graph_restore` with its `id` and latest `revision`.
92
+
93
+ ## 7. Report
94
+
95
+ The graph id and revision, what changed, how to run it (`/graph` in the terminal to select it, the desktop's
96
+ graph picker, or `andorra --graph <id>`), and that cloud sync may still be pending. Name anything you could not
97
+ validate.
@@ -0,0 +1,38 @@
1
+ # Graph tool errors and their fixes
2
+
3
+ Every `andorra_graph_*` reply is `ok: true` with `data`, or `ok: false` with `error.code`, `error.message` and,
4
+ where it applies, `nodeId`, `port`, `edgeId` and the full `issues` list. Fix the cause; never work around a
5
+ validation error.
6
+
7
+ | Code | Meaning | Fix |
8
+ | --- | --- | --- |
9
+ | `NODE_PROVIDER_MISSING` | An agent node has no `provider`. | Set `provider` to an id from `andorra_providers_list`. |
10
+ | `NODE_PROVIDER_INVALID` | The provider id is not configured. | Pick a configured id, or ask the user to add the provider in `/providers`. |
11
+ | `NODE_ROUTE_MISSING` | An outcome port (`port`) of `nodeId` has no route. | Add an edge from that node with that `outcome`, or set `completion.requireRoutes: false` if the outcome may end the run. |
12
+ | `EDGE_SOURCE_MISSING` / `EDGE_TARGET_MISSING` | The edge names a node that does not exist. | Create the node first, or fix the id. |
13
+ | `EDGE_OUTCOME_INVALID` | The `outcome` is not a port of the source node. | Use a declared outcome (`pass`/`fail`, `true`/`false`, `body`/`done`, ...). |
14
+ | `EDGE_DUPLICATE` | The same route already exists. | Remove the duplicate. |
15
+ | `NODE_NOT_FOUND` / `EDGE_NOT_FOUND` | The id is not in the draft. | Read the draft (`andorra_graph_validate` lists nodes) and use an existing id. |
16
+ | `ENTRY_NODE` | Removing the entry node. | `andorra_graph_patch` another `entry` first. |
17
+ | `ENTRY_NOT_FOUND` | `entry` is not a node. | Set `entry` to an existing node id. |
18
+ | `GRAPH_INVALID` | The structural validator refused the graph (unreachable nodes, an unbounded cycle, a bad join). | Read the message: reach every node from `entry`, set `limits.maxNodeVisits` or `limits.wallTimeMs` for cycles, don't join exclusive branches. |
19
+ | `GRAPH_TOO_LARGE` | Over 512 KiB. | Shorten instructions and schemas. |
20
+ | `GRAPH_EXISTS` | `mode: create` with an id in use. | Use `mode: edit`, or another id. |
21
+ | `GRAPH_NOT_FOUND` | No graph or revision with that id. | `andorra_graphs_list` for valid ids (`includeDeleted: true` shows deleted ones). |
22
+ | `BUNDLED_GRAPH` | The built-in `default` graph cannot be changed. | Create a new graph instead. |
23
+ | `REVISION_CONFLICT` | Someone saved a newer revision. | Begin a new edit draft from the latest, reapply, validate, publish. For delete or restore, re-read the revision and retry. |
24
+ | `DRAFT_NOT_FOUND` / `DRAFT_BUSY` | The draft expired (one hour), was discarded, or is publishing. | Begin a new draft; wait for a publish to finish. |
25
+ | `DRAFT_LIMIT` | 24 drafts are open. | Discard unused drafts. |
26
+ | `FREE_TIER_LIMIT` | A free account's limit: one custom graph, at most 3 nodes, no Orchestrator. | Stay within it, or tell the user a paid plan lifts it. |
27
+ | `AUTH_REQUIRED` / `MEMBERSHIP_REQUIRED` / `AUTH_CHANGED` | Not signed in, no membership, or the account changed mid-edit. | Ask the user to sign in (`andorra login`); retry with the current account. |
28
+ | `DEFAULT_GRAPH` | Deleting or restoring the Default graph or the Andorra preset. | Not allowed. |
29
+ | `CONFIRMATION_MISMATCH` | `confirm` is not the graph id. | Ask the user to confirm, then pass the id in `confirm`. |
30
+ | `GRAPH_IN_USE` | An automation runs the graph (`automations` lists them). | Tell the user; they change or remove the automation first. |
31
+ | `GRAPH_DELETED` | The graph is deleted (editing it, or deleting it again). | `andorra_graph_restore` first if the user wants it back. |
32
+ | `GRAPH_NOT_DELETED` | Restoring a live graph. | Nothing to restore. |
33
+ | `RESERVED_METADATA` | `metadata.deletedAt` was set through a patch. | Delete only with `andorra_graph_delete`. |
34
+ | `INVALID_GRAPH_ID` | The id is not a safe identifier. | Letters, digits, `_` and `-`, at most 80 characters. |
35
+ | `NODE_INVALID` / `EDGE_INVALID` | The node or edge object is malformed (unknown type, unsafe id). | Follow the shapes in `andorra_graph_guide`. |
36
+ | `NODE_LIMIT` | Over the node limit (100, or the free allowance). | Merge steps. |
37
+ | `VALIDATION_FAILED` | The graph grew past 512 KiB once provider identities were recorded. | Shorten instructions and schemas. |
38
+ | `STORAGE_ERROR` / `BACKEND_ERROR` | Reading Andorra's data failed; not a graph problem. | Report it to the user; do not change the graph. |
@@ -0,0 +1,78 @@
1
+ # Graph patterns
2
+
3
+ Shapes that fit common requests. Adapt the names, instructions, providers and limits; validate every result
4
+ with `andorra_graph_validate`. Each agent node below needs a `provider` from `andorra_providers_list`.
5
+
6
+ ## Plan → build → review loop
7
+
8
+ ```
9
+ plan --completed--> build --completed--> review
10
+ review --pass--> done
11
+ review --fail--> build
12
+ ```
13
+
14
+ - `plan`: read-only capabilities; output a `taskInstruction` and `acceptanceCriteria`.
15
+ - `build`: read-write files and shell; input mapped from `plan`'s output.
16
+ - `review`: `completion: { mode: "outcomes", outcomes: ["pass", "fail"], criteria: { pass: "...", fail: "..." } }`,
17
+ read-only capabilities; output `findings`.
18
+ - Limits: `limits.maxNodeVisits` is a ceiling on each node's own visits, not a total across the graph. For
19
+ at most three build/review rounds set it to 3: `build` and `review` may each run three times, and `plan`
20
+ and `done` are counted separately.
21
+
22
+ ## Route by kind of work
23
+
24
+ ```
25
+ triage --frontend--> frontend-dev --completed--> done
26
+ triage --backend--> backend-dev --completed--> done
27
+ triage --devops--> devops-dev --completed--> done
28
+ ```
29
+
30
+ - `triage`: `completion: { mode: "outcomes", outcomes: ["frontend", "backend", "devops"], criteria: {...} }` with
31
+ one written criterion per outcome; read-only.
32
+ - Each specialist gets an instruction for its area and only the capabilities it needs (a DevOps agent may
33
+ need `deployment: "allowed"`; the others do not).
34
+
35
+ ## Parallel read-only reviewers
36
+
37
+ ```
38
+ build --completed--> fan-out (parallel) --completed--> security-review, perf-review, style-review
39
+ security-review, perf-review, style-review --completed--> join (join all) --completed--> summarize --completed--> done
40
+ ```
41
+
42
+ - Reviewers are read-only: copies and parallel branches cannot write to the shared workspace.
43
+ - `join` with `{ mode: "all" }` waits for every reviewer; never join on mutually exclusive branches.
44
+ - `summarize` merges the findings into one report.
45
+
46
+ ## QA retry loop with a cap
47
+
48
+ ```
49
+ implement --completed--> qa
50
+ qa --pass--> done
51
+ qa --fail--> implement
52
+ ```
53
+
54
+ - Use a plain cycle with `limits.maxNodeVisits` (3 for three attempts); running out of attempts stops the run
55
+ rather than reporting success. `qa` declares `completion: { mode: "outcomes", outcomes: ["pass", "fail"] }`.
56
+ - Do not use the agent `loop` modifier here. With `modifiers.loop.until.outcome: "pass"` a node exposes only
57
+ `pass`, so the `fail` edge back to `implement` no longer validates, and the modifier reruns `qa` on its own
58
+ without returning to `implement`.
59
+
60
+ ## Retry one agent until it passes
61
+
62
+ ```
63
+ check (loop modifier) --pass--> done
64
+ ```
65
+
66
+ - `check` with `modifiers.loop: { maxIterations: 3, until: { outcome: "pass" } }` reruns itself until it reports
67
+ `pass` or runs out of attempts. It exposes only the `pass` port; use it when the same agent fixes and
68
+ rechecks its own work.
69
+
70
+ ## Single agent with a human approval
71
+
72
+ ```
73
+ draft --completed--> approve (approval)
74
+ approve --approved--> publish --completed--> done
75
+ approve --rejected--> draft
76
+ ```
77
+
78
+ - `approval` nodes ask the person in the live run before continuing.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: manage-mcp
3
+ description: "Add, change, test, turn off or remove an MCP server in Andorra Code. Use when the user wants to connect a tool server (GitHub, a database, a browser, an internal API), asks why an MCP server's tools are missing, or wants one disconnected."
4
+ ---
5
+
6
+ # Manage MCP servers
7
+
8
+ MCP servers give Andorra's agents extra tools. They are configured in the `mcpServers` object of
9
+ Andorra's `config.json`, and every task started after a change connects to the servers as they are then
10
+ configured. This skill edits that object safely and proves the result works.
11
+
12
+ ## Where the configuration lives
13
+
14
+ - The Andorra home is `$ANDORRACODE_HOME` when that variable is set, otherwise `~/.andorracode`
15
+ (`%USERPROFILE%\.andorracode` on Windows). The file is `<home>/config.json`.
16
+ - It is outside the workspace, so reading and writing it goes through the normal approval prompts.
17
+ - People can do the same by hand: `/mcp` in the terminal, or Settings → MCP in the desktop app.
18
+
19
+ ## The entry format
20
+
21
+ `mcpServers` maps an id (letters, digits, `_` and `-`) to one of two shapes:
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "github": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"],
27
+ "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" } },
28
+ "search": { "transport": "http", "url": "https://mcp.example.com/mcp",
29
+ "headers": { "Authorization": "Bearer ${SEARCH_API_KEY}" } },
30
+ "old-db": { "transport": "stdio", "command": "db-mcp", "enabled": false }
31
+ }
32
+ }
33
+ ```
34
+
35
+ - `stdio`: `command` (required), `args` (strings), `env` (names matching `[A-Za-z_][A-Za-z0-9_]*`). Only the
36
+ variables listed in `env` reach the server, plus the SDK's minimal defaults.
37
+ - `http`: `url` must be `https://`, or `http://` to a private or local host; no user name or password in
38
+ the URL, no `#fragment`. `headers` are strings.
39
+ - `enabled: false` keeps the entry but does not connect it.
40
+ - `${NAME}` inside an `env` or `headers` value is replaced from Andorra's own environment when the server
41
+ connects. A missing variable fails that server with "Missing MCP environment reference".
42
+
43
+ ## Rules
44
+
45
+ - **Never write a secret into `config.json`, and never print one.** Put `${NAME}` in the entry and tell the
46
+ user which environment variable to set, and where (shell profile, or the system environment on Windows).
47
+ If the user pastes a token into chat, do not repeat it back; use the reference instead.
48
+ - Change only the `mcpServers` entries the user asked about. Read the whole file, change that key, and
49
+ write the whole file back, keeping every other setting exactly as it was. If the file does not parse,
50
+ stop and report that instead of rewriting it.
51
+ - Show the user the entry you will write (with references, not values) and get their go-ahead before
52
+ writing. Removing an entry also needs their confirmation; offer `enabled: false` as the reversible option.
53
+ - Prefer the server's published install command (its README) over guessing package names.
54
+
55
+ ## Steps
56
+
57
+ 1. **Understand the request.** Which server, which transport, and what it needs (tokens, a URL, a database
58
+ path). Read the server's README when you can.
59
+ 2. **Read `config.json`** and list the existing `mcpServers` ids, so you neither duplicate nor clobber one.
60
+ 3. **Draft the entry**, with `${NAME}` for every secret, and show it. Wait for approval.
61
+ 4. **Write the file** as described in the rules.
62
+ 5. **Probe the server.** Read `probe.md` in this skill (`read_skill_resource` with path `probe.md`) and run
63
+ its check: it starts a stdio server, or calls an HTTP one, asks for its tools and prints their names.
64
+ Give it the entry's `env` (or `headers`) exactly as written, through `MCP_PROBE_ENV` (`MCP_PROBE_HEADERS`):
65
+ the server then sees only what a task would give it, never the rest of your environment.
66
+ 6. **Report:** the id, the transport, the tools the probe listed (or the exact error and the fix), and that
67
+ the tools are available from the next task. If an environment variable must still be set, say which.
68
+
69
+ ## Turning off, removing, troubleshooting
70
+
71
+ - Turn off: set `"enabled": false`. Turn on: remove that key or set it to `true`.
72
+ - Remove: delete the id from `mcpServers` after the user confirms.
73
+ - Tools missing in a task: check the entry is enabled, every `${NAME}` is set in the environment Andorra
74
+ starts from (a desktop app started from the Start menu does not see variables set only in a terminal),
75
+ the command is on `PATH`, and the probe passes. Report what you found before changing anything.