Skip to content

A repo's skill goes up with its whole folder - #679

Merged
shhdwi merged 2 commits into
mainfrom
feat/skill-folders
Oct 23, 2026
Merged

shhdwi merged 2 commits into
mainfrom
feat/skill-folders

Conversation

@shhdwi

@shhdwi shhdwi commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Companion to https://github.com/trailhq/trail-cloud/pull/29. A skill is SKILL.md plus the files it points to. Until now the sync sent only SKILL.md's body.

What changed

  • skillItems sends every file git tracks in .claude/skills/<name>/, besides SKILL.md:
    • Text is sent as is and anything else as base64. The executable bit is kept.
    • Files that resolve outside the checkout are skipped, and so are node_modules, __pycache__, .git, .DS_Store, *.map and *.pyc.
    • The server's limits apply: 100 files, 1 MB each, 4 MB per skill.
  • A secret in any of the files keeps the whole skill on this machine, the same as a secret in SKILL.md.
  • The hash covers the whole folder, so a change to any file sends the skill again. Every skill re-uploads once after this lands.
  • Title and description now follow the SKILL.md format: name titles the skill (cut-a-release becomes "Cut a release") and description is sent as the description. Before, the description was used as the title.
  • uploadLearnings splits a big set into parts of at most 12 MB.

Tested

  • test/workspace-sync-skills.test.ts has new cases:
    • only tracked files are sent
    • a link out of the repo isn't followed
    • node_modules is skipped
    • binary files go as base64 and the executable bit is kept
    • the hash changes when a reference changes
    • a secret in a script holds the skill
  • New test/trail-upload-parts.test.ts.
  • npm test: 3992 of 4002 pass. The 2 failures (graft-to-trail, hosts-trail) also fail on main on this machine.
  • End to end: a sandbox repo with a cut-a-release skill (reference, executable script, template, PNG) was synced with the built CLI against the local trail-cloud preview. All 4 files were stored, and the skill page shows and opens each one.

🤖 Generated with Claude Code

A skill is SKILL.md plus the files it points to: references, scripts,
templates, assets. The sync now sends every file git tracks in the skill's
folder (text as text, the rest base64, the executable bit kept), never one
that resolves outside the checkout, skipping node_modules and caches, within
the server's limits (100 files, 1 MB each, 4 MB a skill). A secret in any
file keeps the whole skill on this machine. The hash covers the folder, so
any file changing sends it again.

SKILL.md's name now titles the skill and its description goes up as the
description, as the format means them. A big set of learnings goes up in
parts of at most 12 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trailhq-graft

trailhq-graft Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

1 area changed → 2 areas can be affected. 6 dependent symbols, depth 2.
Tests: 1 area updated its tests.
Tag: @anirudhkumar-nanonets — Workspace Learning Sync, CLI Workspace Command · Rushabh Nagda — Workspace Learning Sync

flowchart TB
  A0(("Workspace Pairing<br/>4 symbols"))
  A1(("CLI Workspace Command<br/>2 symbols"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0,A1 reached;
Loading
Can be affected Symbols Nearest hop Reached from
Workspace Pairing 4 src/cloud/other-repos.ts:L102-L135 setUpPicked — calls, depth 2 Workspace Learning Sync
CLI Workspace Command 2 src/cli.ts:L2220-L2223 leftOutLines — calls, depth 1 Workspace Learning Sync
Who knows this code — 2 people across 3 areas
Area Who knows it
Workspace Learning Sync · changed Rushabh Nagda — 2 commits, last 2d ago · @anirudhkumar-nanonets — 1 commit, last 10d ago
CLI Workspace Command · affected @anirudhkumar-nanonets — 61 commits, last yesterday
Workspace Pairing · affected only you — nobody else has touched these files

Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

All 6 dependent symbols, grouped by area

Workspace Pairing — 4 symbols in 2 files

  • src/cloud/other-repos.ts:L102-L135 — setUpPicked (calls, depth 2)
  • src/cloud/pair.ts:L188-L218 — finish (calls, depth 2)
    196: const item = (l: (typeof payload)[number]) => ({
  • src/cloud/pair.ts:L129-L147 — start (calls, depth 2)
  • src/cloud/pair.ts:L263-L321 — finishPair (calls, depth 2)

CLI Workspace Command — 2 symbols in 1 file

  • src/cli.ts:L2220-L2223 — leftOutLines (calls, depth 1)
    2221: const out = workspaceLearnings(checkout)?.leftOut ?? [];
  • src/cli.ts:L2139-L2213 — workspaceCommand (calls, depth 2)
    2139: function workspaceCommand(name = "workspace"): Command {
Test signal per changed area — 1 ✓

Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.

  • ✓ Workspace Learning Sync — 1 of 5 reached · 1 test file changed here: test/trail-upload-parts.test.ts
    • not reached: skillFolderFiles, skillTitle, skillItems, workspaceLearnings
3 test suites also reference this code

3 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.

  • test/trail-cloud.test.ts
  • test/trail-upload-names.test.ts
  • test/trail-upload-safety.test.ts

graft blast · origin/main...HEAD · depth 2 · 4 changed files

Open the interactive graph → — click an area to see its dependent symbols at file:line.

github-actions Bot added a commit that referenced this pull request Oct 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shhdwi
shhdwi merged commit ddbc44b into main Oct 23, 2026
8 checks passed
github-actions Bot added a commit that referenced this pull request Oct 23, 2026
@shhdwi shhdwi mentioned this pull request Oct 23, 2026
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.

1 participant