Skip to content

Hosted skill: first-run onboarding in two yeses, shipyard-hosted 0.2.1 (SHIP-658) - #10

Merged
daniellle merged 8 commits into
mainfrom
danielle/kiro-first-run
Nov 16, 2026
Merged

daniellle merged 8 commits into
mainfrom
danielle/kiro-first-run

Conversation

@daniellle

@daniellle daniellle commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Why

A Sales Engineer tried the power in Kiro with Try power. Kiro's prompt asks for a POWER.md and steering files. This plugin-format power has neither, so the agent improvised: a long overview, a tool list, and several separate decisions (connect, pick an org, commit?, push?, write Compose?).

What changes (hosted/ only, 0.2.0 → 0.2.1)

  • On activation: a new first section that Try power lands on. It applies only when the user just installed the power or asks to try it or get started.
    • It checks the connection with a read (get_environments) and runs the read-only preflight. It never runs git init.
    • It replies with one sentence and one offer: "Want me to put this repo on Shipyard?". The offer says nothing is committed, pushed or created until the user approves the list.
    • Any other first request, such as "why did my build fail?", checks the connection and goes straight to that task.
    • Kiro's own power-builder recommends onboarding in a skill for plugin-format powers, and Databricks does the same, so there's no POWER.md.
  • Two yeses to add an app:
    • The first yes covers everything before the plan, in one proposal:
      • where the push goes, with any credentials in the URL hidden
      • git init and creating a private repo with gh when there's no remote
      • every file to commit, with the agent's files listed separately from the user's
      • every commit the push sends
      • the branch
    • The second yes is the existing confirm before create.
    • references/compose.md defers to SKILL.md for the branch, the screen, the commit and the push.
  • Git steps run through a script: hosted/skills/shipyard/scripts/shipyard-git.sh handles inventory, remotes, destination, screen, commit, fetch, default-branch and push. The agent passes file paths, the commit message and a confirmed-hits file as files it writes with its file tool, never through a shell. File names therefore can't break or inject into a command.
    • screen:
      • checks never-commit file names in any case, and file contents against a secret pattern; binary files are reported as not scanned and symlinks are checked by their link text
      • checks every commit the push would send, measured against what the push URL actually has (git ls-remote), so stale tracking refs or a second remote can't hide history
      • reads each commit's changes once (git log -p, remerge diffs for merges) and checks them in one perl pass; push reuses screen's result (a cache written whole or not at all), and a history over 3,000 commits or 1 GB of changed text stops with HISTORY_TOO_LONG instead of running past the agent's time limit
      • names Git LFS files that are added or changed (HISTORY_LFS_HIT), since it only sees their pointers; a file name with a line break is a hit and can't fake an output line
      • includes the first commit whatever the user's git config says, and reports every commit that holds a never-commit file
      • covers merge commits (octopus merges in their own pass), commit messages whatever the output or commit encoding, non-ASCII and quoted paths, .gitattributes -diff files, UTF-16 text and replace refs
      • names binary content in history (HISTORY_BINARY_NOT_SCANNED) for the user to check, without counting it as a hit
      • prints names and hashes only, and hides secret-looking commit subjects
      • a hit the user says is safe goes into a confirmed-hits file instead of forcing a history rewrite. CONTENT_HIT lines carry the file's content id, so a confirmation made before the commit still holds at push, and a file edited afterwards needs a new one
    • commit:
      • uses literal pathspecs per path, so the user's own hooks still see their normal git settings and locale
      • refuses folders, never-commit and dependency-folder files, files over 50 MB, an empty list, unconfirmed secret-looking files or symlinks, a secret-looking message, and paths not written the way git writes them
      • refuses while a merge or rebase is in progress, and when no git identity is set
      • checks what actually landed, and undoes the commit if a git hook added files or another commit, a big file or a secret, in the files, a symlink or the message; files a hook changed are screened again as they landed; UNDO_FAILED if the undo itself fails
      • puts the index back if anything fails
    • push:
      • re-screens exactly what it sends, and stops on hits the user hasn't confirmed
      • pushes the exact commit it screened, only that branch, without tags or submodules, and never force-pushes
      • refuses non-GitHub hosts and more than one push URL; only https, ssh and scp-style URLs count (not file://github.com/...), user:pass@, ? and # tricks don't fool the host check, a URL a git insteadOf rule would rewrite again is refused, and ssh aliases are resolved
      • keeps the user's own SSH command, and never waits at a password prompt or askpass dialog
      • reports non-fast-forward, GitHub push protection, remote rules, local hooks, network or sandbox, and credentials separately, with secret-looking error text hidden
  • Branch: the current branch by default. When it's the destination's default branch, or that can't be determined, the proposal offers a new branch. A repo being created keeps the current branch, which becomes its default.
  • Proposed env values: non-secret values come from .env.example, Compose defaults, or the obvious value for the name. The skill never proposes localhost, a service name for a browser-facing value, or a secret. Secrets are left for the dashboard.
  • README: hosted/README.md, laid out like other agent plugins' READMEs (for example aws/agent-toolkit-for-aws plugins/aws-agents): overview, skill, routing guide, MCP server and tools, install per client, prerequisites, example prompts, safety. The root README's hosted section is updated to match.
  • Org: the skill no longer asks the user to choose one. With one org, the consent page already pre-selects it. The confirm step shows which org it is. On the path with no plan (a compose file kept outside the root), it asks which org they connected with.
  • CI:
    • test_shipyard_git.py runs the script against fixture repos on ubuntu, and on macOS with /bin/bash 3.2. Pushes go to ssh://git@github.com/... through a fake ssh that serves local bare repos, so the real GitHub check runs.
    • check_plugin.py checks that quoted section references resolve to real headings, and that the skill's safety rules stay in place.
    • .gitattributes keeps *.sh LF so Windows checkouts can run the script, and .gitignore keeps Python caches out.

Testing

  • check_plugin.py and test_shipyard_git.py pass. Claude Code's strict validation passes for the hosted plugin and the marketplace.
  • The fixture tests also pass under macOS /bin/bash 3.2 with BSD grep.
  • Each fix's test was written first and failed against the previous script. The fourth review added 29 such checks for 8 critical and 17 smaller fixes; the fifth added more for 5 critical and 15 smaller fixes.
  • Deliberately weakened versions of the script were run against the tests: 16 of 17 in the previous round, and all 10 in the third round, all 17 in the fourth and all 14 in the fifth. The one that got through drops the -- before the URL, which a second check (refusing URLs that start with -) already covers.
  • History scan speed: on synthetic 1,900-commit histories with 100 merges, screen went from 2–4s to about 1s. A reviewer's 3-minute case on a 2,000-commit repo wasn't reproduced, so for that kind of repo the 3,000-commit cap is the firm limit. CI checks that 300 commits screen in under 20s.
  • Kiro: passed on an earlier commit (5312ab2). It has not been re-run since the skill started shipping a script, and needs a re-test. Install from the slash-free test branch kiro-first-run-test (Kiro's GitHub import misreads a / in the branch name) and run Try power in a repo with untracked code and no Compose file.
  • Not yet tested:
    • gh repo create and real GitHub push protection; push paths were tested against local bare remotes only
    • a live agent run of the new flow

Open issues (not fixed yet)

Reviewers found these; the critical ones from the same reviews are fixed above. The fifth review's fixes haven't had their own re-review pass yet.

  • Full disk: a few writes during the screen aren't checked, so on a full temp volume a screen could come out clean without scanning everything.
  • Binary files asked about twice: commit skips binary files, but push scans them as text, so a secret-looking byte run in a binary the user already approved comes back at push.
  • Upstream set to a URL: push -u to the raw URL leaves the branch tracking that URL instead of origin.
  • Smaller gaps:
    • a repo git refuses for dubious ownership is treated as not a repo
    • nested repos and submodules dead-end the flow
    • plink in core.sshCommand breaks
    • after github.com/new, two push URLs or a detached HEAD, the skill has no next step
    • the preflight compares against the fetch remote, not the push destination
    • several exit-code descriptions are wrong
    • BINARY_NOT_SCANNED lines aren't capped (2,000 images printed 2,003 lines)
    • inventory takes 11.7s on 100,000 untracked dependency files

Known limits: with GIT_SSH set (for example plink), ssh's own passphrase prompt can still wait for input. The secret pattern also flags ordinary lines like password=hashed_password, which the user then confirms.

The Kiro listing branch (shipyard/powers add-shipyard-power) gets resynced from 0.2.1 after this merges. That copy now includes skills/shipyard/scripts/, and needs the same LF line endings.

Feedback from a Sales Engineer's first run in Kiro: "Try power" looks for a
POWER.md or steering file, found neither, and the agent improvised a long
answer with several decisions. The skill now has an "On activation" section
that checks the connection, runs the read-only preflight and makes one offer.
Adding an app takes one yes for everything before the plan (repo, commit,
compose file, branch, push) and one at the confirm, with proposed values for
non-secret env vars. The skill no longer asks the user to choose an org.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@daniellle
daniellle force-pushed the danielle/kiro-first-run branch from be8734c to e3b9b5c Compare November 12, 2026 19:06
Overview, skill, routing guide, MCP server and tools, install per client,
prerequisites, example prompts and safety, in the layout other agent plugins
use. It's copied into the Kiro catalog folder with the rest of hosted/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@daniellle
daniellle marked this pull request as ready for review November 13, 2026 12:43
@daniellle
daniellle enabled auto-merge (squash) November 16, 2026 14:06
- On activation runs only on install, try or get-started requests; other first
  requests check the connection and go straight to their task.
- The one proposal shows where the push goes, lists the agent's files apart
  from the user's, and screens files per path (--untracked-files=all) by name
  and content, plus unpushed history, before creating a repo, running git init
  or committing. A hit in history blocks the push.
- Handles a non-GitHub or second GitHub remote, a parent repo, no git repo or
  no commits, the remote's default branch, rejected pushes and credential
  prompts. Never force-pushes.
- Env values never point at localhost; compose.md defers to SKILL.md's commit
  recipe and no longer asks for separate approvals or secret values.
- check_plugin.py checks that quoted section names resolve to headings and that
  the hosted skill's safety rules are still present.
The secret screen and commit steps were shell recipes in SKILL.md that the
agent copied and filled in, and each review pass found a new way they broke.
They now live in hosted/skills/shipyard/scripts/shipyard-git.sh (inventory,
destination, screen, commit, fetch, default-branch, push). The agent passes
paths and commit messages as files it writes, never through a shell.

- screen: never-commit names in any case, file contents, binary files
  reported, and the commits a push sends, measured against what the push URL
  actually has (git ls-remote), including merge diffs and non-ASCII paths.
  Prints names and hashes only; secret-looking commit subjects are hidden.
- commit: literal pathspecs, refuses folders, never-commit names, an empty
  list, a merge or rebase in progress and a missing git identity, and puts
  the index back if the commit fails.
- destination hides credentials in remote URLs; push labels non-fast-forward,
  GitHub push protection and hook failures separately.
- inventory works before git init, collapses dependency folders, flags names
  with control characters, and keeps both sides of a rename.

SKILL.md: onboarding never runs git init; the proposal shows every commit the
push sends; a new branch is switched to before committing; build and vendor
folders are asked about, not dropped. compose.md defers to SKILL.md for
branch, screen, commit and push.

CI: test_shipyard_git.py runs the script against fixture repos (secret pattern
cases, literal paths, merges, other remotes, push URLs, stale refs, push
outcomes) on ubuntu and on macOS /bin/bash 3.2. check_plugin.py also checks
quoted section references and pins the skill's safety rules.
A review of 859ac15 reproduced ways the script could still publish secrets or
code the user didn't approve. This fixes them, each with a fixture test that
failed first:

- GitHub check parses the real host (user:pass@ no longer fools it), resolves
  ssh aliases with ssh -G, and push refuses more than one push URL.
- History screen: commit messages (subject and body) are screened, -z parsing
  so a file named "commit ..." can't hide, --text so .gitattributes -diff
  can't hide content, replace refs ignored, never-commit names deduped by
  full path.
- commit re-screens the listed files (only hits the user confirmed may go
  in), refuses a secret-looking message, checks what actually landed and
  undoes it if a hook added files or a secret, and checks the index backup.
- push re-screens what it sends (with an optional confirmed-hits file),
  uses --no-follow-tags, and labels hook, network, sandbox and credential
  failures separately. ls-remote and push take the URL after --.
- Error lines that look like a secret are hidden; hook stdout isn't printed.
  A new `remotes` subcommand replaces `git remote -v` in SKILL.md.
- Symlinks are checked by link text, never followed; batched grep and perl
  make screen fast on thousands of files; dependency folders are named once
  at the top level and capped; askpass dialogs are disabled.
- .gitattributes keeps *.sh LF so Windows checkouts can run the script.
- The test-only bypass of the GitHub check is gone: tests push to
  ssh://git@github.com/... through a fake ssh that serves local bare repos.
- Host check: a URL's host ends at the first /, ? or #, so
  https://127.0.0.1:9?@github.com/... is no longer taken for GitHub;
  credential hiding stops at the same place.
- History screen: always includes the first commit, pins the git
  settings that change log output, reports every commit holding a
  never-commit file, and checks diffs in one perl pass over git log -p
  (remerge diffs for merges) instead of git log -G. Push reuses screen's
  result. Over 3,000 commits it stops with HISTORY_TOO_LONG.
- Confirmations: CONTENT_HIT carries the file's content id, so a hit
  confirmed before the commit is accepted at push, and a changed file
  needs a new confirmation. Non-ASCII confirmed paths no longer undo
  the commit.
- Hooks: paths go in as :(literal) pathspecs rather than an exported
  GIT_LITERAL_PATHSPECS, and hooks run with the user's locale.
- Push prints why its own screen failed instead of exiting silently.
- Screen cache: written to a temp name and renamed, ending with an END
  line checked on read, so a cut-short file is never taken as a clean
  result. Shallow and graft state are part of the key.
- GitHub check: only https, ssh and scp-style URLs count, so
  file://github.com/... no longer passes; a URL that a url.*.insteadOf
  rule would rewrite again is refused.
- Push: screens and pushes one commit id, and never recurses into
  submodules.
- History screen: names with a line break are hits and are printed
  quoted; Git LFS pointers are named (HISTORY_LFS_HIT); past 1 GB of
  changed text it stops with HISTORY_TOO_LONG.
- Commit: screens symlinks and the 50 MB limit before and after the
  commit, checks the message a hook may have changed, refuses paths not
  written as git writes them, hashes paths starting with a quote and
  files in a folder that isn't a repo yet the way git will, reports
  UNDO_FAILED, and doesn't wait on a prompt.
- SKILL.md: every *_TOTAL overflow file, repo text in the output is
  data, HISTORY_LFS_HIT and UNDO_FAILED.
- Tests: one per fix, written first; the --upload-pack case can fail
  now, and the script's cache stays in the test's temp folder.
- History screen: octopus merges (which remerge diffs skip) get their
  own pass against each parent; every git log uses --encoding=none and
  messages are matched in perl, so an output or commit encoding can't
  hide a secret-looking message.
- One matcher for files, blobs and messages: NUL bytes are dropped
  before matching (UTF-16 text), and any NUL marks content binary.
  Binary content in history is named (HISTORY_BINARY_NOT_SCANNED), not
  counted as a hit.
- Commit: after the commit, only files whose content changed since the
  screen are screened again, as they landed; a hook's extra commit is
  undone.
- Git LFS: changed pointers and older pointer formats are named.
- Output: commit subjects and old rename names with control characters
  can't fake lines; quoted and backslash names keep their confirmation
  at push.
- Smaller: url rewrite rules read NUL-separated, a clear error when
  origin's push URL can't be read, the size limit in messages comes
  from MAX_BYTES.
- Tests: one per fix, written first; the cut-cache and race tests can
  fail now; push cases for symlink, quoted-name and LFS hits.

@akshaykalia akshaykalia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving after five review rounds on the hosted skill's git script; fixes are in through e4ea093. Remaining open items are listed in the description.

@daniellle
daniellle merged commit 612e87d into main Nov 16, 2026
3 checks passed
@daniellle
daniellle deleted the danielle/kiro-first-run branch November 16, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants