distill-project
Skill0 starsChanged 6 months agoMITView on GitHub
Use when the user asks to 蒸馏 (distill/strip) a project down to source code only for GitHub upload, or says things like "只剩源码", "提纯", "去掉依赖", "准备上传github", "distill to source", "strip to source". Removes all build artifacts, dependencies, documentation, setup scripts, demo data, and runtime files, keeping only application source code and essential project config.
- Reads credentials
- Deletes or force-pushes
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- amit-t/skillstheir own version, first seen Oct 25, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- amit-t/skills★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Ask the user which directory to distill if not already specified.
- Very specific: line 18
Use rsync to copy the project to <original>-distilled/ alongside the original, excluding these categories:
- Distinctive: line 62
After rsync, delete these categories from the distilled copy:
- Very specific: line 97
All directories containing application source code: client/src/, server/, desktop/, python/, test/
- Very specific: line 107
All build output (dist/, release/, build/)
- Distinctive: line 108
All caches and logs
- Distinctive: line 111
All setup/startup scripts
- Distinctive: line 113
All IDE/editor config
- Distinctive: line 119
If the user wants to push the distilled code to a specific branch on GitHub (not overwriting existing branches), follow this workflow.
- Distinctive: line 123
Check that git config --global user.name and git config --global user.email are set.
- Distinctive: line 154
Remove the temp repo clone and the distilled directory after a successful push.
- Very specific: line 155
Verify with git ls-remote <repo-url> that the new branch exists and existing branches are untouched.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Distill Project to Source Code
Strip a project down to pure source code — no build artifacts, no dependencies, no docs, no demo data, no setup scripts. Ready for git init && git push.
Process
1. Confirm the source directory
Ask the user which directory to distill if not already specified. The source must exist and be readable.
2. Create the distilled copy
Use rsync to copy the project to <original>-distilled/ alongside the original, excluding these categories:
Build artifacts & caches:
node_modules/,node_modules_old/client/node_modules/,client/node_modules_old/dist/,dist-electron/,release/,build/.ruff_cache/,__pycache__/*.log
Runtime data:
data/server/data/server/config.json(sensitive)
Version control:
.git/(fresh start for GitHub)
Temp/files:
vite.config.ts.timestamp-*
rsync -av \
--exclude='node_modules/' \
--exclude='node_modules_old/' \
--exclude='client/node_modules/' \
--exclude='client/node_modules_old/' \
--exclude='dist/' \
--exclude='dist-electron/' \
--exclude='release/' \
--exclude='build/' \
--exclude='.ruff_cache/' \
--exclude='__pycache__/' \
--exclude='*.log' \
--exclude='data/' \
--exclude='server/data/' \
--exclude='server/config.json' \
--exclude='vite.config.ts.timestamp-*' \
--exclude='.git/' \
--exclude='.claude/' \
"<source>/" "<source>-distilled/"3. Remove non-source files
After rsync, delete these categories from the distilled copy:
- Setup/startup scripts:
setup.bat,setup.sh,stop.sh,start.sh,run.sh,install.sh - Documentation:
README.md,ARCHITECTURE.md,CHANGELOG.md,CONTRIBUTING.md,*.md(except keep nothing in root — no docs) - Demo/example data:
demo-*,*.csv,*.xlsx,sample-*,example-* - Environment templates:
.env.example,.env.template - Build/packaging scripts dir:
scripts/(if it contains only build/packaging, not application source) - IDE/editor config:
.claude/,.vscode/,.idea/ - CI/CD:
.github/,.gitlab-ci.yml,Jenkinsfile
rm -rf \
"<dst>/setup.bat" "<dst>/setup.sh" "<dst>/stop.sh" \
"<dst>/README.md" "<dst>/ARCHITECTURE.md" \
"<dst>/demo-"* "<dst>/*.csv" "<dst>/*.xlsx" \
"<dst>/.env.example" \
"<dst>/scripts" \
"<dst>/.claude" "<dst>/.vscode" "<dst>/.idea" \
"<dst>/.github"4. Clean up stray Python caches
find "<dst>" -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null5. Verify and report
- Show the final file tree
- Report size comparison (original vs distilled)
- Confirm only source code remains:
client/src/,server/,desktop/,python/,test/, plus essential config files (package.json,tsconfig.json,.gitignore, lint config)
What stays (keep)
- All directories containing application source code:
client/src/,server/,desktop/,python/,test/ - Project config:
package.json,package-lock.json,tsconfig.json,vite.config.ts,tailwind.config.js,postcss.config.js - Lint config:
eslint.config.mjs,.eslintrc.cjs,ruff.toml,.prettierrc .gitignoreindex.html(Vite entry point)client/config files at client root (not inclient/src/)
What goes (remove)
- All
node_modules/ - All build output (
dist/,release/,build/) - All caches and logs
- All runtime data
- All documentation
- All setup/startup scripts
- All demo data
- All IDE/editor config
.git/(user cangit initfresh).env.exampleand similar templates
6. Upload to GitHub as a branch (optional)
If the user wants to push the distilled code to a specific branch on GitHub (not overwriting existing branches), follow this workflow.
Prerequisites:
- Confirm the target repo URL and branch name with the user
- Check that
git config --global user.nameandgit config --global user.emailare set. If not, warn the user before proceeding.
Platform note:
- On Windows, use PowerShell for all git commands (
git clone,git push,git ls-remote). Do NOT use Bash — Cygwin/MSYS2 can suffer from fork errors.
Steps:
# 1. Clone the target repo to a temp directory
$tempRepo = "<temp-path>"
if (Test-Path $tempRepo) { Remove-Item $tempRepo -Recurse -Force }
git clone <repo-url> $tempRepo
# 2. Create an orphan branch (independent history, won't touch main)
Push-Location $tempRepo
git checkout --orphan <branch-name>
git rm -rf .
# 3. Copy all distilled files into the temp repo
Get-ChildItem -Path "<distilled-path>" -Force | ForEach-Object {
Copy-Item $_.FullName -Destination (Join-Path $tempRepo $_.Name) -Recurse -Force
}
# 4. Stage, commit, and push
git add -A
git commit -m "Distilled source code"
git push -u origin <branch-name>
Pop-LocationCleanup:
- Remove the temp repo clone and the distilled directory after a successful push.
- Verify with
git ls-remote <repo-url>that the new branch exists and existing branches are untouched.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

