agentleFS
SulikoAndSoulSulikoAndSoul/claude-code-distill-skill/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    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
  1. Distinctive:

    Ask the user which directory to distill if not already specified.

    line 14
  2. Very specific:

    Use rsync to copy the project to <original>-distilled/ alongside the original, excluding these categories:

    line 18
  3. Distinctive:

    After rsync, delete these categories from the distilled copy:

    line 62
  4. Very specific:

    All directories containing application source code: client/src/, server/, desktop/, python/, test/

    line 97
  5. Very specific:

    All build output (dist/, release/, build/)

    line 107
  6. Distinctive:

    All caches and logs

    line 108
  7. Distinctive:

    All setup/startup scripts

    line 111
  8. Distinctive:

    All IDE/editor config

    line 113
  9. Distinctive:

    If the user wants to push the distilled code to a specific branch on GitHub (not overwriting existing branches), follow this workflow.

    line 119
  10. Distinctive:

    Check that git config --global user.name and git config --global user.email are set.

    line 123
  11. Distinctive:

    Remove the temp repo clone and the distilled directory after a successful push.

    line 154
  12. Very specific:

    Verify with git ls-remote <repo-url> that the new branch exists and existing branches are untouched.

    line 155

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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/null

5. 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
  • .gitignore
  • index.html (Vite entry point)
  • client/ config files at client root (not in client/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 can git init fresh)
  • .env.example and 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.name and git config --global user.email are 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-Location

Cleanup:

  • 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.