# Cortex Takeoff

> >

- **Type:** Skill
- **Install:** `agentstack add skill-xbluesky-cortexes-cortex-takeoff`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [XBlueSky](https://agentstack.voostack.com/s/xbluesky)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [XBlueSky](https://github.com/XBlueSky)
- **Source:** https://github.com/XBlueSky/cortexes/tree/plugin/skills/cortex-takeoff
- **Website:** https://cortexes.pages.dev

## Install

```sh
agentstack add skill-xbluesky-cortexes-cortex-takeoff
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Cortex Takeoff — Session Hand-off Baton

A baton is a curated continuation note for ONE work line (topic) in ONE repo.
It lives at `/.takeoff//.md`, is git-ignored, and is
consumed by a later session. A repo may hold several batons at once — one per
work line. Batons are independent of the Raw session dump (which SessionEnd
writes automatically). Do NOT commit them, distill them, broadcast them, index
them with `cortex-vec`, or log them to `log.md`.

Legacy layout: `/.takeoff/.md` (single-baton era, no topic
key). Legacy batons still list, resume, and clear (via `--legacy`), and are
retired to the new layout on their next hand-off. Never create new ones.

## Locating takeoff.sh

The repo slug and git-safety are handled by `takeoff.sh`, bundled in this plugin
at `hooks/scripts/takeoff.sh`. In every mode below, FIRST set `TK` to that helper,
resolved relative to THIS skill's base directory. The skill-load message announces
the base directory as `/cortex//skills/cortex-takeoff`; `takeoff.sh`
sits two levels up. Substitute the actual announced base-dir path:

```bash
TK="/../../hooks/scripts/takeoff.sh"
test -f "$TK" || { echo "cortex: takeoff.sh not found at $TK" >&2; exit 1; }
```

Do NOT use `claude plugin root` (no such subcommand) or `$CLAUDE_PLUGIN_ROOT`
(unset for skill-run bash).

## Resolving the repo root

Every `bash "$TK" …` call takes an EXPLICIT cwd argument — there is no $PWD
fallback (a drifted shell cwd once deleted the wrong repo's baton). Resolve
the repo root ONCE per mode and reuse it verbatim in every call:

```bash
cwd="$(git rev-parse --show-toplevel)"
```

If your shell may have cd'ed to another repo earlier in the session, resolve
from a path you KNOW belongs to this repo (e.g. a file you have been editing)
instead of trusting the shell's current directory.

## Mode

Determined by the command argument:

| Argument | Mode |
|----------|------|
| (none) or `` | **create** — write/overwrite one work line's baton |
| `resume [topic]`    | **resume** — load a baton (do not delete) |
| `done [topic]`      | **done** — clear a baton (soft-delete to trash) |

## Create (`/cortex:takeoff [topic]`)

1. Set `TK`, resolve `cwd`, then survey the existing work lines:

   ```bash
   bash "$TK" list "$cwd"
   ```

   Output: one baton per line, `topicsummarypath`, newest first.

2. Decide the topic — kebab-case `[a-z0-9-]`, max 64 chars, not
   `resume`/`done`/`legacy`:
   - The user passed one explicitly → use it verbatim.
   - This session earlier RESUMED a baton → reuse that topic. A continuation
     is the same work line; do not mint a new name. (Hard rule.)
   - Otherwise: if a listed baton is clearly this same work line, propose
     reusing its topic; else derive a short new topic from the work line and
     ANNOUNCE it to the user before writing.

3. Run the preflight (git-safety; also derives the slug):

   ```bash
   bash "$TK" prepare "$cwd" ""
   ```

   Output is TWO lines: line 1 = `baton_path`, line 2 = `workdir`. If it
   exits non-zero, STOP and relay the message — do not write anything.
   (Exit 2 = no vault / no repo; exit 3 = `.takeoff/` not git-ignored;
   exit 64 = invalid topic.)

4. Curate the current session into a hand-off. Content is free-form — write
   whatever genuinely lets a fresh session continue without re-deriving
   context. Typically worth capturing: the goal, what's done so far, the
   immediate next step, key files and locations (`path:line`), open questions,
   and gotchas. Omit anything not useful; do not pad to a template.

5. Compose one `summary` line (used verbatim as the SessionStart menu preview):
   a single sentence naming the work line and the next step.

6. Write the baton to `baton_path` with the Write tool. `workdir` is line 2
   of the prepare output, verbatim — do NOT re-derive it yourself:

   ```markdown
   ---
   repo: 
   topic: 
   workdir: 
   created: 
   summary: 
   ---
   
   ```

   If a baton already exists for this (repo, topic), this overwrites it (one
   active baton per work line, new replaces old).

7. If this work line previously lived in the legacy single-baton file (you
   resumed from topic `legacy`, or `list` shows a legacy entry that is this
   same line), retire it now that the new-format baton exists:

   ```bash
   bash "$TK" clear "$cwd" --legacy
   ```

8. Confirm to the user: baton written to ``, topic ``,
   not committed.

## Resume (`resume [topic]`, or chosen from the SessionStart menu)

1. Set `TK`, resolve `cwd`, run `bash "$TK" list "$cwd"`.
2. No batons → tell the user there is nothing pending for this repo and stop.
3. Pick the target: the explicit / menu-chosen topic if given; a single
   listed baton is used directly; multiple batons with no topic given → show
   the list (topic + summary) and ask which one.
4. `Read` the baton in full (path from the list output) and adopt it as
   continuation context. REMEMBER the resumed topic for the rest of the
   session — it is the default target of a later create or done.
5. **Do NOT delete it** — loading is not completion; this session may itself
   need to hand off again.

## Done (`done [topic]`)

1. Set `TK`, resolve `cwd`. Determine the target: the explicit topic if
   given, else the topic this session resumed. Neither exists → REFUSE to
   guess: run `bash "$TK" list "$cwd"`, show it, and ask the user to name
   the target.
2. Clear it (use `--legacy` in place of the topic when the target is the
   legacy baton):

   ```bash
   bash "$TK" clear "$cwd" ""
   ```

   Exit 4 = the baton belongs to a different working directory (its
   `workdir` does not match this repo's toplevel). Relay both paths to the
   user and let THEM decide — never retry with `--force` on your own.
   Exit 5 = no such baton; re-run `list` and re-check the target.
3. Confirm to the user: the baton was moved to the trash path printed by the
   command (recoverable for 30 days, then pruned).

## Overwrite vs done

- Re-running create replaces that topic's baton (normal re-hand-off).
- `done` is the explicit "this work line is finished" exit — the baton is
  soft-deleted into `/.takeoff/.trash/` and pruned after 30 days.
- Merely loading via `resume` never clears anything.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [XBlueSky](https://github.com/XBlueSky)
- **Source:** [XBlueSky/cortexes](https://github.com/XBlueSky/cortexes)
- **License:** Apache-2.0
- **Homepage:** https://cortexes.pages.dev

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-xbluesky-cortexes-cortex-takeoff
- Seller: https://agentstack.voostack.com/s/xbluesky
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
