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

ToolEnabled forAlso enables the skill
pull-requestRuns at a station that lists it in tools.spotlight-pull-request
checksRuns at a station that lists it in tools.none
open-tasksRuns at a station that lists it in tools.none
review-commentRuns at a station that lists it in tools.spotlight-review
reviewRuns at a station that lists it in tools.spotlight-review
propose-taskEvery chat run. A station cannot enable it.none
open-pull-requestEvery run of a chat that is not a setup chat. A station cannot enable it.none
setup-pull-requestEvery run of a setup chat. A station cannot enable it.none
test-station-changeEvery 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.

InputTypeRequiredStdinDescription
titlestringyesnoWhat it does.
bodystringnoyesThe detail, as Markdown.
repositorystringnonoWhich 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:

FieldDescriptionnull when
nameThe name of the check, as in web / build.never
conclusionfailure, timed_out or startup_failure.never
urlThe check on GitHub.GitHub gives no address.
stepThe 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.
summaryThe title and summary the check reported, as for a CodeQL alert.The check reported neither. GitHub Actions jobs usually report neither.
logThe 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:

FieldDescriptionnull when
idThe task's ID.never
titleThe task's title.never
stationThe key of the station the task is at.never
createdAtWhen the task was created, as an ISO 8601 time.never
descriptionThe 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.
lastNoteThe 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.

InputTypeRequiredStdinDescription
pathstringyesnoThe file, from the root of the repository.
linenumberyesnoThe line it is about, or the last of several.
start-linenumbernonoThe first line, where it is about several.
sidestringnononew for a line the pull request leaves, old for one it removes.
bodystringyesyesWhat 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.

InputTypeRequiredStdinDescription
verdictstringnonocomment, approve or request-changes.
bodystringnoyesWhat 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.

InputTypeRequiredStdinDescription
linestringyesnoThe key of the line it belongs on.
stationstringyesnoThe key of the station on that line to start it at.
titlestringyesnoWhat the task is, in a line.
descriptionstringnoyesWhat whoever works it needs to know, as Markdown.
basestringnonoThe 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.
attachlist of textnonoA 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.

InputTypeRequiredStdinDescription
repositorystringnonoThe repository, as owner/name or name. Required when the chat has more than one repository.
branchstringyesnoThe branch pushed, as in fix/video-icons.
basestringnonoThe branch the change goes into, as in release/1.x. Left out for the default branch. It is also the task's base.
titlestringyesnoWhat it does. It is also the task's title.
bodystringnoyesWhat changed and why, as Markdown. It is also the task's description.
linestringnonoThe 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-request tool.
  • More than one line does, and line names none.
  • The line that line names 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 when base is 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.

InputTypeRequiredStdinDescription
branchstringyesnoThe branch pushed, as in spotlight-configuration.
titlestringyesnoWhat it does.
bodystringnoyesThe 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.

InputTypeRequiredStdinDescription
namestringyesnoA 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.
hypothesisstringyesnoWhat the change should improve, 1 to 4,000 characters.
configstringyesyesThe 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.
modestringnonotest, the default, or search.
linestringnonoThe line of the station, by its key. Another line than the chat's is refused.
stationstringnonoThe 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.json

What the call starts:

ModeStarts
testA search of one iteration whose only candidate is the change, against the live config, with the request trigger. It runs no search agent.
searchA 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:

FieldDescription
startedtrue when the change was taken, else false.
outcomestarted when the call started a search, joined when the change joined a running search.
modetest or search, as called.
nextWhat 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.
refusalWhy the change was not taken, as a code. See Test refusals.
reasonThe refusal in words.
problemsFor 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-.

SkillEnabled for
spotlight-handoverEvery run at a station.
spotlight-pull-requestRuns with the pull-request tool enabled.
spotlight-reviewRuns with the review-comment or review tool enabled.
spotlight-toolsRuns 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.

ItemKindPlanInputs or uses
catalog.web-search@1.0.0toolteamquery (string, required)
catalog.web-search@1.1.0toolteamquery (string, required), limit (number)
catalog.fetch-page@1.0.0toolfreeurl (string, required)
catalog.research@1.0.0skillteamuses 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.

On this page