Skip to content

fix(project): gitignore install metadata in project mode - #760

Merged
runkids merged 1 commit into
mainfrom
runkids/project-metadata-gitignore
Nov 3, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/project-metadata-gitignore

Conversation

@runkids

@runkids runkids commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

Closes #759

Summary

Since v0.19.12 the docs have said a project's skills/.metadata.json is gitignored. No code ever wrote that rule, so git add .skillshare picked the file up. It records this machine's installs (hashes and timestamps) for skill folders that are themselves ignored. Teammates already share config.yaml and skills.lock.json, so committing the metadata only adds noise and merge conflicts.

  • config.ReconcileProjectSkills runs after every project install: CLI, search, dashboard, move and trash. It now adds <prefix>/.metadata.json for the skills source and the agents source, at the path ProjectGitignoreTarget computes.
    • Projects initialized before this fix get the rule on their next install.
    • Custom sources.skills and sources.agents paths get it too.
    • A missing source or a source outside the project is skipped.
  • AdoptMovedProjectSkills does not get the new step, so sync -p still leaves .gitignore unchanged (sync -p rewrites the project config when a record is stale but nothing moved #547).
  • Global mode keeps committing its metadata, which Git Sync merges.
  • Docs that list what the project .gitignore contains now name the metadata files, in English and all four locales. project-skills also explains the one-time git rm --cached .skillshare/skills/.metadata.json for projects that already committed the file.

Tests

  • TestReconcileProjectSkills_IgnoresMetadataFiles: covers the default layout with both skills and agents, starting from a .gitignore that has no rule.
  • TestReconcileProjectSkills_IgnoresCustomSourceMetadata: covers a skills source under the project root, outside .skillshare/.
  • TestInstallProject_GitignoresMetadata: runs the issue's own steps, init -p then install -p, and asserts with real git check-ignore.
  • I reverted the fix and ran all three again. Each failed (git check-ignore: exit status 1).

Checks run

  • make check in the devcontainer: passed, on base 5f51f956.
  • python3 scripts/ai-context.py check: ok.
  • Not run: the website build. The doc changes only edit existing sentences, with no new links or MDX.

Not covered

  • Running install -p with no source when every declared skill is already present calls no reconcile, so it does not add the rule. The rule arrives on the next install, update or move. Covering this would mean changing when config replay reconciles, which is beyond this fix.
  • A metadata file that was already committed stays tracked until the user runs git rm --cached. The docs now say so.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Since v0.19.12 the docs say a project's skills/.metadata.json is
gitignored, but no code ever wrote that rule, so `git add .skillshare`
picked it up (#759). The file records this machine's installs (hashes,
timestamps) for folders that are themselves ignored; teammates already
share config.yaml and skills.lock.json, so committing it only adds noise
and merge conflicts.

ReconcileProjectSkills runs after every project install (CLI, search,
dashboard, move, trash), so it now adds the rule for the skills and
agents sources, at the path ProjectGitignoreTarget computes. Projects
initialized earlier and custom sources get it on their next install.
AdoptMovedProjectSkills is untouched, so `sync -p` still leaves
.gitignore alone (#547). Global mode keeps committing its metadata.

The docs that list the project .gitignore contents now name the
metadata files, and project-skills explains the one-time
`git rm --cached` for projects that already committed it.

Closes #759
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T15:17:06.887605Z 30f2a79 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit d41188b into main Nov 3, 2026
8 checks passed
@runkids
runkids deleted the runkids/project-metadata-gitignore branch November 3, 2026 15:38
runkids added a commit that referenced this pull request Nov 11, 2026
The docs still showed the old `{"skills": [{"name", ...}]}` layout, which
no current release writes; the file is `{"version", "entries", ...}`
keyed by path. Readers comparing the docs with their own file had no way
to tell what `audit_accepted` or `target_overrides` are for.

tracked-repositories also said project mode records `tracked: true` in
`.skillshare/.metadata.json` so teammates get it, but that path does not
exist and project mode gitignores the metadata files (#760); the flag
lives in `.skillshare/config.yaml`.

The example `type` is `github-subdir` because a subdir install records
that, and the field table omits `into`, which nothing writes.
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.

Project: skills/.metadata.json not gitignored

1 participant