Built-in tools and skills
Besides the tools an integration offers,
Spotlight has tools and skills of its own. An agent calls a tool with
spotlight tools call <tool>; see Agent commands.
Built-in tools
| Tool | Enabled for | Also enables the skill |
|---|---|---|
pull-request | Runs at a station that lists it in tools. | spotlight-pull-request |
checks | Runs at a station that lists it in tools. | none |
open-tasks | Runs at a station that lists it in tools. | none |
review-comment | Runs at a station that lists it in tools. | spotlight-review |
review | Runs at a station that lists it in tools. | spotlight-review |
propose-task | Every chat run. A station cannot enable it. | none |
open-pull-request | Every run of a chat that is not a setup chat. A station cannot enable it. | none |
setup-pull-request | Every run of a setup chat. A station cannot enable it. | none |
test-station-change | Every run of a chat that improves a station. A station cannot enable it. | none |
In the input tables, an input with stdin may come from standard input, as described
under spotlight tools call.
pull-request
Opens a pull request for the task's branch in one
repository, into the task's base branch,
or, for a task with no base, into the repository's default branch (main if GitHub names none).
It answers with {"url": "<address>"}. The task then has a git.pull-request
mark with that address.
A task has one pull request in each repository. When a run changes files in
two repositories, the agent calls pull-request once for each, and names each
repository with repository.
If the task already has a pull request in that repository, the call opens no
other. It changes the title and body of that pull request to the ones given,
and answers with its address. Without repository, the call changes the task's
first pull request. Without body, the body stays as it is.
| Input | Type | Required | Stdin | Description |
|---|---|---|---|---|
title | string | yes | no | What it does. |
body | string | no | yes | The detail, as Markdown. |
repository | string | no | no | Which of the line's repositories, where it works several. |
The pull-request.opening hook runs before a pull
request is opened. It does not run before a change to the title and body.
checks
Lists the failed checks on the latest commit of each pull request of the task. It has no inputs. The task must have a pull request.
It answers with pullRequests, one entry for each pull request, the first
opened first. Each entry has the pullRequest address, the commit it read,
and failed, one entry for each failed check:
| Field | Description | null when |
|---|---|---|
name | The name of the check, as in web / build. | never |
conclusion | failure, timed_out or startup_failure. | never |
url | The check on GitHub. | GitHub gives no address. |
step | The name of the step that failed. | The check is not one of the first five GitHub Actions jobs, no step failed, or GitHub does not give the job. |
summary | The title and summary the check reported, as for a CodeQL alert. | The check reported neither. GitHub Actions jobs usually report neither. |
log | The last 200 lines of the job's log, up to its last ##[error] line, without terminal colour and control codes. | The check is not one of the first five GitHub Actions jobs, or GitHub does not give the log. |
When GitHub does not answer for one pull request, its entry has error, the
reason, in place of commit and failed. When GitHub answers for none, the call
fails.
GitHub gives the step and the log only if the App has Actions: read; see Connect GitHub.
open-tasks
Lists the other open tasks on the line of the task: every task at a station
that is not of kind completed, except the task itself and the setup task.
It has no inputs. A station that triages new tasks uses it to find a duplicate
before work starts.
It answers with tasks, the newest first, at most 50, and more, which is
true when the line has more open tasks than it lists:
| Field | Description | null when |
|---|---|---|
id | The task's ID. | never |
title | The task's title. | never |
station | The key of the station the task is at. | never |
createdAt | When the task was created, as an ISO 8601 time. | never |
description | The description without blank space at its ends. A longer one is cut at 600 characters and ends with …. | The task has no description, or only blank space. |
lastNote | The task's last note, cut in the same way. | The task has no note, or only blank space. |
review-comment
Leaves a comment on a line of the pull request the task reviews. Spotlight keeps the comment until the review is submitted.
| Input | Type | Required | Stdin | Description |
|---|---|---|---|---|
path | string | yes | no | The file, from the root of the repository. |
line | number | yes | no | The line it is about, or the last of several. |
start-line | number | no | no | The first line, where it is about several. |
side | string | no | no | new for a line the pull request leaves, old for one it removes. |
body | string | yes | yes | What is wrong and what would fix it, as Markdown. |
review
Submits the comments left so far as one review of the pull request the task reviews.
| Input | Type | Required | Stdin | Description |
|---|---|---|---|---|
verdict | string | no | no | comment, approve or request-changes. |
body | string | no | yes | What the review comes down to, as Markdown. |
propose-task
Proposes a task in the chat the run works for. Nothing is created until the
person accepts the proposal. It answers with the task's title as proposed,
the line and station keys it was given, and what happens next. See
Proposals.
| Input | Type | Required | Stdin | Description |
|---|---|---|---|---|
line | string | yes | no | The key of the line it belongs on. |
station | string | yes | no | The key of the station on that line to start it at. |
title | string | yes | no | What the task is, in a line. |
description | string | no | yes | What whoever works it needs to know, as Markdown. |
base | string | no | no | The branch the task starts from and opens its pull request into, as in release/1.x or the branch of the task it builds on. Left out for the default branch. See Base branch. |
attach | list of text | no | no | A file attached to the chat that the task needs, by its path, as in .spotlight/attachments/<id>/<name>, or by its id. Give --attach once for each file. |
Each file in attach must be attached to a message a person sent in the
chat, or the tool proposes nothing. The proposal keeps its own copy of each file, and the task
gets its own copy when the person accepts the proposal. The task's runs then
find the files in the working copy, as described under
Attachments.
open-pull-request
Opens a pull request from a branch the agent pushed in one of the chat's
repositories, into base, or into the repository's default branch when base
is left out. A task on the line tracks
it: the task starts at the station that has the
pull-request tool, on hold for the chat, with the branch and
the pull request's git.pull-request mark. It answers with the pull request
url, the task id and what happens next. See
Pull requests from a chat.
Each branch has one task. A second call for the same branch and repository opens no other pull request, and answers the first. For more changes to the same work, push to the same branch. For new work, push a new branch and call the tool again. A call for the same branch in another repository of the line opens a second pull request on the same task.
The tool opens nothing from a branch that belongs to another task, or to a
task that is completed or was handed to the line. On the branch of a task the
chat holds, base must be left out or name the task's own
base: a chat cannot
open a pull request into another base than its task's.
Spotlight also refuses such a push, and a push to the default branch. See
What a chat may push.
| Input | Type | Required | Stdin | Description |
|---|---|---|---|---|
repository | string | no | no | The repository, as owner/name or name. Required when the chat has more than one repository. |
branch | string | yes | no | The branch pushed, as in fix/video-icons. |
base | string | no | no | The branch the change goes into, as in release/1.x. Left out for the default branch. It is also the task's base. |
title | string | yes | no | What it does. It is also the task's title. |
body | string | no | yes | What changed and why, as Markdown. It is also the task's description. |
line | string | no | no | The key of the line to track it on. Required when more than one line works on the repository. |
The tool opens nothing and creates no task when:
- No line names the repository and has a station with the
pull-requesttool. - More than one line does, and
linenames none. - The line that
linenames does not work on the repository. - The branch is the repository's default branch.
- The branch has no changes from
base, or from the repository's default branch whenbaseis left out, or GitHub does not know the branch.
The tool runs the pull-request.opening hook, as
for a pull request the line opens, then opens the pull request, then creates
the task. When the hook denies the pull request, or GitHub does not open it,
the tool creates no task. Call the tool again after you fix what the hook asks
for.
setup-pull-request
Opens the pull request with the team's configuration, from a branch the agent
pushed to the setup chat's configuration repository, into its default branch.
Give the branch a name of its own, as in spotlight-configuration. A branch
with the name of a task's branch
sends that branch's GitHub events to the task.
It answers with {"url": "<address>"}. The chat keeps the pull request, and
the setup task's "Set up configuration as code" step is then done. A second
call answers the pull request the chat already opened. See
Let the agent write your team's first Terraform.
| Input | Type | Required | Stdin | Description |
|---|---|---|---|---|
branch | string | yes | no | The branch pushed, as in spotlight-configuration. |
title | string | yes | no | What it does. |
body | string | no | yes | The decisions and the plan, as Markdown. |
The pull-request.opening hook does not run for it.
test-station-change
Measures a change to the station that the chat improves. Spotlight replays the change against the station's live config on its replay set. When the change becomes a config pull request, the team gets the usual inbox notice. When it does not, the person who started the chat gets a notice that says why. A chat improves a station when it was opened with the station attached, as from "Ask the agent" on the station's Activity tab. See Ask the agent for a change.
| Input | Type | Required | Stdin | Description |
|---|---|---|---|---|
name | string | yes | no | A slug that names the change, as shorter-prompt: up to 63 lowercase letters, digits and hyphens, not starting with a hyphen, and not seed. It must differ from the names of the other candidates of the search. |
hypothesis | string | yes | no | What the change should improve, 1 to 4,000 characters. |
config | string | yes | yes | The station fields you change, as JSON with the names the line resource uses. Spotlight takes every other field from the station's current config, or from the running search's starting config. null removes a field. |
mode | string | no | no | test, the default, or search. |
line | string | no | no | The line of the station, by its key. Another line than the chat's is refused. |
station | string | no | no | The station, by its key. Another station than the chat's is refused. |
spotlight tools call test-station-change --name shorter-prompt \
--hypothesis "A shorter prompt keeps the agent on the task." < station.jsonWhat the call starts:
| Mode | Starts |
|---|---|
test | A search of one iteration whose only candidate is the change, against the live config, with the request trigger. It runs no search agent. |
search | A search that starts from the change: its first candidate is the change, and the search agent can refine it in the iterations of the station's search policy. |
When a search of the station is running and still takes candidates, the change
joins it as one candidate of its current or next iteration, whatever the mode.
In mode search, a change that joins gets no search and no refinement of its
own. A running search takes as many changes as it proposes candidates in one
iteration.
A station takes at most 3 requested starts or joins in one UTC day. A call again with the same name and the same change answers as the earlier call did, and starts nothing.
The change may differ from the live config only in the fields a search may
change: prompt, harness, model, effort, profile, skills, tools,
decisions, memories and description. A search the tool starts keeps to the
station's search ceiling and the line's monthly ceiling, one search at a time
and one open config pull request for each station, and the
health of the replay set. It does
not wait for the period or the cooldown of the search policy, and it does not
move them: the next automatic search of the station is due as before. Its
searched tasks count as used, so later searches do not hold them out.
The call answers with JSON:
| Field | Description |
|---|---|
started | true when the change was taken, else false. |
outcome | started when the call started a search, joined when the change joined a running search. |
mode | test or search, as called. |
next | What happens next, for the agent to tell the person. A start reads Spotlight replays the live config and the change on <n> searched tasks. If the change does better, Spotlight replays it on <n> held-out tasks., then in mode search Then the search agent can refine the change in up to <n> more iterations. A join reads A search of the station is running. The change joined it as one candidate of iteration <n> of <m>., then in mode search The change gets no search of its own, and no refinement of its own. Both end with If the change passes the gates of the line, Spotlight opens a config pull request. The result arrives in the inbox of the person. Tell them what happens next. Do not show a Terraform diff. |
refusal | Why the change was not taken, as a code. See Test refusals. |
reason | The refusal in words. |
problems | For invalid-change: each problem with the change, as <field>: <reason>. |
After a refusal, next reads Tell the person the reason. Then show the change as a Terraform diff for a person to apply., and after invalid-change, Fix the change and call the tool again.
Built-in skills
Spotlight adds its own skills wherever they apply. A station may not name a
skill starting spotlight-.
| Skill | Enabled for |
|---|---|
spotlight-handover | Every run at a station. |
spotlight-pull-request | Runs with the pull-request tool enabled. |
spotlight-review | Runs with the review-comment or review tool enabled. |
spotlight-tools | Runs with a tool enabled from an integration or the catalog that Spotlight can describe. |
spotlight-tools says how to find a tool with spotlight tools search, read
it with spotlight tools describe, give inputs as flags or as one JSON object,
pipe a tool's JSON answer into the next call, use a tool that requires
approval, and stop when a tool waits for a person to connect. It also explains
inferred answers: describe prints what a tool answered before as an inferred
type. See Inferred output.
Such a run's briefing also has a ## Tools section naming each
integration it has tools enabled from, with how many, and the search and
describe commands. Catalog tools are named there as the Spotlight catalog.
A replay has only the integration tools that change nothing, so its skill and
section name those tools alone. A replay has no built-in tools: checks and
open-tasks read the task as it is now, with the work of the run it replays.
A run also has the tools listed in the tools of each team skill its
station enables. See spotlight_skill.
Catalog
Spotlight publishes catalog tools and skills, named
catalog.<name>@<version>. A station enables one by that exact name in its
tools or skills.
| Item | Kind | Plan | Inputs or uses |
|---|---|---|---|
catalog.web-search@1.0.0 | tool | team | query (string, required) |
catalog.web-search@1.1.0 | tool | team | query (string, required), limit (number) |
catalog.fetch-page@1.0.0 | tool | free | url (string, required) |
catalog.research@1.0.0 | skill | team | uses catalog.web-search@1.1.0 and catalog.fetch-page@1.0.0 |
A workspace's plan is free, team or enterprise, and each plan includes
the ones before it. A workspace with no plan set, or whose plan has expired,
is on free.
- A line that enables a catalog item the workspace's plan does not include is rejected when it is written.
- A run at such a station fails with the code
refused. - A catalog skill is laid out in the folder
spotlight-catalog-<name>. The run also gets the catalog tools that the skill uses. - Spotlight records each call that a run makes to a catalog tool: when the call started, how long it took and whether it succeeded.