CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

tessleng/schedule-management

Create and migrate repo-defined Tessl schedules in a project's tessl.json. Turns a plain-language task and cadence into a validated schedules entry, optionally authors its repo-local skill, and moves an existing schedule made in Tessl into version control, keeping its Loop id and history. Needs a Tessl CLI whose tessl loop commands read the Loop API.

1.03x
Quality

98%

Does it follow best practices?

Impact

99%

1.03x

2 of 3 eval scenarios. Add 1 more for a full score.

SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

SKILL.mdskills/schedule-migrate/

name:
schedule-migrate
description:
Move an existing schedule made in Tessl into the project's tessl.json, keeping the same Loop, its id and its runs. Use when the user wants to move a schedule into version control ("put my schedule in the repo", "migrate this schedule to tessl.json", "make my scheduled run repo-defined"), or convert an app-defined schedule to a repo-defined one. The skill previews what the move writes, has Tessl open the pull request, and checks after merge that the original Loop, with its id, settings and sandbox history, is now defined by the repository. Not for creating a schedule from scratch (use schedule-setup).

Move a schedule into tessl.json

Tessl's move opens a pull request that adds a stored Loop to its project's tessl.json. When it merges and Tessl syncs the default branch, the same Loop, with the same id and runs, is defined by the file.

This skill needs a Tessl CLI whose tessl loop list and tessl loop view read the Loop API and whose tessl loop pause and tessl loop delete are native Loop commands. Before step 1, ask the user to upgrade the Tessl CLI to the latest release if they have not recently; when a command this skill uses is missing or rejects its flags, tell them to upgrade and stop.

Read finding the Loop before step 1, the move preview reference before showing a preview, and sandbox history before steps 2 and 6.

Communication rules

  • Ask about one decision at a time.
  • Explain each concept in one or two plain sentences.
  • Never merge the pull request. The user reviews and merges it.
  • Never pause or delete a Loop without the user's say.
  • Never send a move request before the user agrees to it, and never send one again on your own.

1. Find the Loop

  1. Work from the repository root. Note the origin repository.
  2. Run tessl loop list --all --json, with --project-id <project id> when the user names a project.
  3. Pick the candidates and show them as the reference says. Ask which public Loop id to move.
  4. When it is one of a project's Ticket to PR or Learn from past work Loops, it moves with the project's other app-defined Loops: go to section 4 instead of section 3.

2. Preview the move

  1. Save each Loop's status and pausedReason from the listing, and a history baseline for each Loop the user wants checked, as the sandbox history reference says. A missing baseline does not block the move.
  2. Read tessl api /experimental/loops/<loop id>/manifest-entries. It writes nothing. A 409 means the Loop cannot move: give the user the message and stop.
  3. Show the entries, the repoKey and every warning, as the reference says.
  4. Ask whether the entries' inputs, instructions and trigger overrides are safe to commit. If they carry a credential or personal data, stop.
  5. Ask the user to confirm the move and each renamed warning.

3. Move one Loop

Use either path; both open the same pull request.

  • Web app: on the Loop's page, Move to tessl.json, then Open pull request.
  • API: write {"renames": [...]} to a .json file outside the repository, one {"block", "from", "to"} for each accepted renamed warning (an empty list when there is none), then tessl api --include -X POST /experimental/loops/<loop id>/move-to-repo --input <file>. Read the status from the first line and the body after the headers.
    • 201 opened a pull request. 200 returns the pull request link an earlier move recorded, before any fresh check. Tessl returns it while that pull request is open, or while the default branch declares the recorded key, and the declaration there can be an unrelated entry left by a pull request closed without merging. Open the link, report its state, and check its actual diff as the preview reference says. Adoption is a separate check, after sync (step 6).
    • data.id must be the Loop id you sent; when it is not, stop and tell the user. data.attributes.repoKey is its key in the file and data.attributes.pullRequestUrl the pull request.
    • A 409 whose message says the file changed since the preview is recoverable: preview again, show what changed and ask again. Any other 409, and a 404, ends the attempt: show the message and stop.

Give the user the link, the receipt's warnings and the preview's adoption warnings, and check the pull request as the preview reference says.

4. Move a project's Loops together

The factory-setup skill owns the project-wide move; this skill sends no project-wide request.

  1. Load the factory-setup skill the project resolves and read its references/set-up-in-tessl.md, section "Move a Loop into tessl.json". Record the reference's path, the plugin's version, the checkout's commit and the file's sha256.
  2. When that section is missing or lists Loops with anything other than tessl loop list, stop before any write and tell the user the bulk move waits for a factory-setup that uses the Loop API.
  3. From section 1's listing, take every candidate of the project, paused ones included. Do section 2 for each. If any carries a credential or personal data, move nothing.
  4. Name each Loop in order and ask the user to agree to the set and the order.
  5. Hand off to that section with the project id, the agreed Loop ids in order, and each Loop's preview, saved status and history baseline. Its request is sent once, only after the agreement.
  6. Check its receipt: data.id is the project, and data.attributes.loops[] holds exactly the agreed ids. Match each entry by id for its repoKey and warnings, and check the pull request as the preview reference says. When the receipt does not match, tell the user before they merge.
  7. A refusal moves nothing. Do not move the Loops one by one instead. To try a smaller set, even where factory-setup says to call again without a Loop, preview it and agree that set with the user first.

5. Merge and sync

  1. The user reviews the diff and merges the pull request into the default branch. Before merge, the keys it wrote stay as they are: a changed key makes sync add a second Loop while the original keeps running.
  2. Tessl syncs the file on the push. When the Loop is not adopted within a few minutes, the user starts sync with Sync loops on the project's Loops tab.

When a move reply is lost, do not send it again. Read tessl loop view <loop id> --json: pendingMove names the pull request the Loop waits on, if any.

6. Check it is the same Loop

For each moved Loop, single or project move, check tessl loop view <original loop id> --json as the adoption reference says, then repeat the history read. Report identity, settings and history as separate results. An original that still shows source.kind app keeps running with its stored definition.

A replacement instead of a move

When the user wants a new entry rather than the move, write it with the schedule-setup skill. A new entry is a different Loop with a new id, and the original keeps running. Before the new Loop's first fire, ask the user to pause the original (tessl loop pause <loop id>). Delete it (tessl loop delete <loop id>) only when the user asks, after the new Loop has run. Only a Loop made in Tessl can be deleted.

README.md

tile.json