Skip to content

docs(skill): /trade setup tracks the knowledge dir by default, drops the global gitignore entry; release v2.17.0 - #54

Merged
himself65 merged 2 commits into
mainfrom
claude/wonderful-murdock-e1a1be
Sep 25, 2026
Merged

himself65 merged 2 commits into
mainfrom
claude/wonderful-murdock-e1a1be

Conversation

@himself65

Copy link
Copy Markdown
Owner

What

Replaces the git handling in /trade setup step 4 with one model that matches the rest of the skill: the personal knowledge dir is private and version-tracked by default. Setup ignores it only where it would otherwise be committed to the wrong repo, and never writes the global gitignore. The scaffolded template's "Git tracking" section now describes the same model. Bumps the plugin to v2.17.0 (plugin.json + both marketplace.json fields), so merging auto-tags and releases.

Why

Step 4 unconditionally appended an unanchored knowledge/ to the user's global gitignore, and the same pattern to the .gitignore of whatever repo setup ran in, on the premise that the knowledge dir "stays local". The rest of the skill says the opposite:

  • SKILL.md → Knowledge Architecture: L2 is "private, usually a separate repo found via knowledge_path".
  • commands/import.md: "Do not commit — the personal knowledge repo is version-tracked on purpose".
  • data-collection.md: a repo's visibility is set by the most restrictive corpus it holds, a rule that only matters for a tracked repo.

The failure is silent (reproduced in a scratch repo). With the global line present, a notes repo keeps showing edits to files it already tracks, but a new writedown never appears in git status and git add -A skips it. Only an explicit git add <path> complains. So a notes repo that keeps its bundle in a knowledge/ subdirectory (e.g. ~/Code/<site>/knowledge/, resolved via knowledge_path) looks healthy while new notes never reach a commit. Two more problems:

  • The unanchored pattern also hid every knowledge/ directory in every other repo on the machine.
  • The project-level entry resolved the repo from the cwd rather than from the target, so a target in another repo got a path relative to the wrong repo.

How setup behaves now (step 4)

Setup finds the repo that contains the target (git -C <target> rev-parse --show-toplevel) and asks which case applies instead of inferring it:

Host repo Setup
None Writes nothing. Suggests git init plus a private remote.
Meant to hold the notes Writes nothing, then runs git check-ignore -v --no-index on the scaffolded files to confirm no rule hides them (without --no-index, tracked files are skipped). Warns if the remote is public.
Not meant to hold them (a code repo, a public repo, a clone of this plugin) Adds an anchored /<path>/ entry to that clone's .git/info/exclude, which is never committed and is shared by linked worktrees. Skips the write if a rule already covers the dir, and warns if notes are already tracked there.
  • Setup never writes the global gitignore and never modifies git config.
  • It offers, and asks before acting, to delete the entries older versions wrote under their # Personal trade knowledge scaffolded by /trade setup — never commit. comment.
  • Step 1 now warns when the cwd is a code repo, because the default ./knowledge would then land inside it.

Files

Reviewer notes

…riting the global gitignore

Setup step 4 unconditionally appended an unanchored `knowledge/` to the
user's global gitignore, and the same pattern to the .gitignore of whatever
repo setup ran in, on the premise that the knowledge dir "stays local". The
rest of the skill says the opposite: L2 is private and usually a separate
repo found via knowledge_path (SKILL.md, Knowledge Architecture), import.md
never commits because the personal knowledge repo is version-tracked on
purpose, and data-collection.md sets a repo's visibility by its corpora.

The failure is silent. With the global line present, a notes repo keeps
showing edits to files it already tracks, but a new writedown never appears
in `git status` and `git add -A` skips it. The unanchored pattern also hid
every `knowledge/` directory in every other repo, and the project entry
resolved the repo from the cwd instead of from the target.

Step 4 now classifies the repo that contains the target and asks which case
applies: no repo (write nothing), a repo meant to hold the notes (write
nothing, then probe with `git check-ignore -v --no-index`), or a repo not
meant to hold them (an anchored entry in that clone's .git/info/exclude,
never the committed .gitignore). It never writes the global gitignore and
offers to delete the entries older versions wrote. The scaffolded template's
Git tracking section follows the same model, and its stale
`knowledge/*/raw/` tip is replaced by the corpus rule.
#53 shipped v2.16.0 and fixed the same raw/ leftovers in setup step 5 and
the knowledge-index template. The conflicting hunks take its wording, which
matches its import.md change (copy the source into a corpus, leave the
original). This branch's release moves to v2.17.0, and its log entry now
sits above #53's.
@himself65
himself65 merged commit 0dd47dc into main Sep 25, 2026
1 check passed
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