···11----
22-name: tang
33-description: |
44- Use this skill when the user asks about this repo on Tangled, Tangled issues,
55- Tangled pull requests, or Tangled operations. The current git remote is a
66- Tangled repo, so `tang` can usually infer the repository from the worktree.
77----
88-99-# tang — Tangled repo workflow
1010-1111-This repo packages [`tang`](https://tangled.org/onev.cat/tang) in `devenv`.
1212-Use it for Tangled operations.
1313-1414-## Repository selection
1515-1616-Prefer the current git worktree. `tang` discovers the repo from `.git` remotes,
1717-so in this repo use commands without `--repo` / `-R` by default:
1818-1919-```bash
2020-tang status
2121-tang repo view
2222-tang issue list
2323-tang pr list
2424-```
2525-2626-Only add `-R <owner>/<repo>` when the user explicitly asks about a different
2727-Tangled repo.
2828-2929-## Auth
3030-3131-Reads often work without auth. Writes require login:
3232-3333-```bash
3434-bash .agents/skills/tang/auth.sh
3535-```
3636-3737-The bootstrap uses `ATPROTO_HANDLE` / `ATPROTO_APP_PASSWORD`, falling back to
3838-`BSKY_HANDLE` / `BSKY_APP_PASSWORD`. App passwords are created at
3939-<https://bsky.app/settings/app-passwords>. Never use the main account password.
4040-4141-## Common commands for this repo
4242-4343-```bash
4444-# Inspect
4545-tang status
4646-tang repo view
4747-tang issue list
4848-tang issue view <number-or-rkey>
4949-tang pr list
5050-tang pr view <number-or-rkey>
5151-tang pr diff <number-or-rkey>
5252-5353-# Issues
5454-tang issue create "Title" --body "Body"
5555-tang issue comment <number-or-rkey> --body "Comment"
5656-tang issue close <number-or-rkey>
5757-tang issue reopen <number-or-rkey>
5858-5959-# Pull requests
6060-tang pr create --base main --head <branch> --title "Title"
6161-tang pr comment <number-or-rkey> --body "Comment"
6262-tang pr checkout <number-or-rkey>
6363-tang pr merge <number-or-rkey> --subject "Merge pull request #N"
6464-```
6565-6666-## Identifiers
6767-6868-Numeric issue and PR IDs match Tangled web URLs. For raw protocol records, use
6969-`--atproto` with an AT URI, rkey, or unique rkey prefix.
7070-7171-## Safety
7272-7373-Ask before performing writes against a different repo than the current worktree,
7474-or when auth is unavailable.
-37
.agents/skills/tang/auth.sh
···11-#!/usr/bin/env bash
22-# Bootstrap tang auth for agent use.
33-#
44-# Uses tang directly when available, otherwise runs it through devenv.
55-# Logs in only when tang reports unauthenticated.
66-77-set -euo pipefail
88-99-run_tang() {
1010- if command -v tang >/dev/null 2>&1; then
1111- tang "$@"
1212- elif command -v devenv >/dev/null 2>&1; then
1313- devenv shell -- tang "$@"
1414- else
1515- echo "tang is not on PATH and devenv is unavailable" >&2
1616- exit 127
1717- fi
1818-}
1919-2020-status="$(run_tang auth status --json 2>/dev/null || true)"
2121-if printf '%s\n' "$status" | grep -q '"authenticated"[[:space:]]*:[[:space:]]*true'; then
2222- printf '%s\n' "$status"
2323- exit 0
2424-fi
2525-2626-: "${ATPROTO_HANDLE:=${BSKY_HANDLE:-}}"
2727-: "${ATPROTO_APP_PASSWORD:=${BSKY_APP_PASSWORD:-}}"
2828-2929-if [ -z "${ATPROTO_HANDLE:-}" ] || [ -z "${ATPROTO_APP_PASSWORD:-}" ]; then
3030- echo "Not authenticated." >&2
3131- echo "Set ATPROTO_HANDLE / ATPROTO_APP_PASSWORD or BSKY_HANDLE / BSKY_APP_PASSWORD." >&2
3232- echo "Create an app password at https://bsky.app/settings/app-passwords" >&2
3333- exit 1
3434-fi
3535-3636-export ATPROTO_HANDLE ATPROTO_APP_PASSWORD
3737-run_tang auth login --handle "$ATPROTO_HANDLE" <<< "$ATPROTO_APP_PASSWORD"