git-hide-rebel-frontmatter
Set up a git clean filter to automatically strip Rebel YAML frontmatter from README.md in commits, keeping the local file unchanged for Rebel.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Set up a git clean filter to automatically strip Rebel YAML frontmatter from README.md in commits, keeping the local file unchanged for Rebel.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Helps users connect and use a service in Rebel when it isn't already in the built-in connector catalog. Acts as an expert advisor — runs the full build-vs-buy check (catalog, MCP Registry, community) before scaffolding a custom MCP server and guiding research, implementation, security review, and contribution.
Guides users through adding new tools or capabilities to an existing connector (MCP server). Handles eligibility, workspace setup, connector research, implementation via Software Engineer workflow, local testing, and PR submission with an extension-specific template.
Capture citable sources (meetings, documents, files, media, web content) as structured files in memory/sources/ with provenance metadata for traceability.
Help users celebrate impactful wins and surface important learnings by analyzing their recent communications and activities.
Guidelines for maintaining single sources of truth and using signposting to connect documentation without duplication
Evaluate a finalised meeting transcript and distribute relevant content to other spaces, deciding per space whether to copy the full transcript, write a sanitised summary, or skip.
| name | git-hide-rebel-frontmatter |
| description | Set up a git clean filter to automatically strip Rebel YAML frontmatter from README.md in commits, keeping the local file unchanged for Rebel. |
| last_updated | "2026-03-16T00:00:00.000Z" |
| agent_type | main_agent |
When a git repo is added as a Rebel Space, Rebel writes YAML frontmatter (between --- markers) into README.md. This is harmless locally but can pollute the README on GitHub/GitLab for public repos.
This skill sets up a git clean filter that automatically strips the frontmatter block from README.md during commits. The local file stays untouched — Rebel continues to read/write frontmatter normally.
Git clean/smudge filters transform file content between the working tree and the object database:
This means:
cat README.md shows the file with frontmatter (the working copy Rebel uses)git show HEAD:README.md shows the committed version without frontmatterImportant caveat: Because there is no smudge filter (restore on checkout), a fresh git clone or git checkout will materialise the stripped version (without frontmatter). Rebel will re-add frontmatter on its next write. This is by design — the filter ensures the remote repo is clean, while Rebel manages the local copy.
README.md is never modified by the filterREADME.md in this specific repo (uses local git config, not global)awk command in git configawk which ships with all platforms (macOS, Linux, Windows Git for Windows)Before proceeding, verify ALL of the following:
Confirm the space is a git repo:
git -C "<space-path>" rev-parse --is-inside-work-tree
If this fails, stop — this skill does not apply.
Confirm README.md has well-formed Rebel frontmatter (opening AND closing ---):
head -20 "<space-path>/README.md"
Verify: line 1 is exactly ---, and there is a second --- line within the first ~20 lines. If line 1 is not ---, there is no frontmatter to strip. If there is an opening --- but no closing ---, warn the user that the frontmatter is malformed and fix it before proceeding.
STOP if the README uses frontmatter for other tools: If this is a Jekyll, Hugo, or other static-site repo where README.md frontmatter is used by the build system, do not use this skill. The filter strips ALL leading frontmatter, not just Rebel fields. Ask the user:
"Does this README.md use YAML frontmatter for any other purpose (e.g., Jekyll, Hugo, or another static site generator)? If so, this filter will also strip that frontmatter from commits, which could break your build."
Ask the user for confirmation:
"This will set up a git filter so that Rebel's YAML frontmatter in README.md is automatically stripped from your git commits. The local file stays unchanged — Rebel will continue to work normally. This only affects this repo. Shall I proceed?"
Run all commands from the repo root (the space path).
This command is identical on all platforms (macOS, Linux, Windows Git for Windows):
git config --local filter.strip-rebel-frontmatter.clean "awk 'NR==1 && /^---[[:space:]]*$/ {skip=1; next} skip && /^---[[:space:]]*$/ {skip=0; next} skip {next} {print}'"
Note: git config --local writes to .git/config inside the repo. It does NOT modify the user's global ~/.gitconfig or any system files.
How the awk command works:
--- (with optional trailing whitespace/CR), enter skip mode---, exit skip mode and discard that line tooThe [[:space:]]*$ pattern handles both LF (---\n) and CRLF (---\r\n) line endings. If line 1 is NOT ---, skip mode is never entered and the entire file passes through unchanged.
Safety property: If the opening --- has no matching closing ---, ALL lines after line 1 are skipped. This is safe because: (a) Rebel always writes well-formed frontmatter, and (b) the pre-check verifies frontmatter is well-formed before setup.
.gitattributes entryCheck if .gitattributes already exists and has the filter:
grep -q 'filter=strip-rebel-frontmatter' .gitattributes 2>/dev/null
If not present, append it (ensuring a newline before the append):
[ -f .gitattributes ] && [ -n "$(tail -c1 .gitattributes)" ] && echo '' >> .gitattributes; echo 'README.md filter=strip-rebel-frontmatter' >> .gitattributes
This ensures no corruption if the existing .gitattributes lacks a trailing newline.
If .gitattributes does not exist yet, just:
echo 'README.md filter=strip-rebel-frontmatter' > .gitattributes
Force git to re-process the file through the filter:
git add --renormalize README.md
Then check what git will commit:
git diff --cached README.md | head -20
The diff should show the frontmatter lines as "removed". The body content should be unchanged.
.gitattributes commitTell the user:
"The
.gitattributesfile should be committed so the filter rule persists. Anyone who clones the repo will also need to run thegit configcommand (Step 1) for the filter to be active on their machine. Without the config, git silently ignores the filter — no errors, just no stripping."
git add .gitattributes
git commit -m "chore: add git filter to strip Rebel frontmatter from README.md"
After setup, confirm:
Local file has frontmatter (Rebel still works):
head -1 README.md
Should output ---.
Committed content has no frontmatter (clean for GitHub):
git show HEAD:README.md | head -3
Should NOT start with ---.
Future commits auto-strip — edit the README.md body, commit, and verify git show HEAD:README.md still has no frontmatter.
To remove the filter and go back to committing frontmatter normally:
git config --local --unset filter.strip-rebel-frontmatter.clean
Optionally remove the line from .gitattributes:
grep -v 'filter=strip-rebel-frontmatter' .gitattributes > .gitattributes.tmp && mv .gitattributes.tmp .gitattributes
This portable approach works on macOS, Linux, and Windows Git Bash (avoids sed -i portability issues).
---.---): the filter will skip all lines after line 1. The pre-check verifies well-formed frontmatter before setup. If the user later breaks the frontmatter, the next commit will have only line 1's content — but the local file is unaffected and Rebel will repair it on next write.--- blocks in the file: only the first block (line 1 to next ---) is removed. Content after the closing ---, including any later --- lines, is untouched..gitattributes is committed but git config is local. Collaborators without the config see the filter rule but git silently ignores it (no error, no stripping). This is fine — only the repo owner needs the filter.[[:space:]]*$ pattern in the awk command matches both ---\n and ---\r\n, so the filter works regardless of core.autocrlf settings.EF BB BF), the BOM precedes --- on line 1, and the pattern won't match. The filter becomes a no-op (safe, but frontmatter is not stripped). This is extremely rare for README.md files.Filter not working (frontmatter still in commits):
git config --local filter.strip-rebel-frontmatter.clean.gitattributes is in the repo root (not a subdirectory)git add --renormalize README.mdawk not found:
awk is always availableawk via MSYS2. Ensure Git for Windows is installed.User wants to commit frontmatter once (override):
git -c filter.strip-rebel-frontmatter.clean=cat add README.md