agentleFS
jasonChen0604jasonChen0604/codebase-to-portfolio/skills/batch-init/SKILL.md

batch-init

Skill2 starsChanged 5 months agoMITView on GitHub

Batch-initialize project docs for valid projects in projects-list.md that are missing a doc file or have an outdated version. Triggers when the user says "batch init", "batch initialize", "update project docs", "批次初始化", or "initialize unfinished projects".

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read profile.config.json from the current working directory.

    line 12
  2. Very specific:

    Run the /get-latest-version skill to get the version string to use as the "latest version" baseline.

    line 19
  3. Very specific:

    If none is returned, all projects with a doc file are treated as "outdated"

    line 21
  4. Very specific:

    After each batch finishes, read each project's <doc_filename> frontmatter to get skill_version, then proceed to the next batch

    line 41
  5. Very specific:

    After each batch completes, immediately update the corresponding rows in projects-list.md:

    line 44
  6. Very specific:

    Update method: Edit projects-list.md directly, match rows by the "Path" column, replace the row.

    line 49
  7. Distinctive:

    After all batches complete, output a summary:

    line 52
  8. Distinctive:

    If a project fails (non-zero exit code), record the failure and continue with remaining projects — do not abort the entire batch

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Batch Init Skill

Goal

Find valid projects in projects-list.md that need their project doc initialized or updated, run the init-project-doc skill in parallel (max 3 per batch), and update projects-list.md after each batch completes.

Step 0: Read config

Read profile.config.json from the current working directory. If missing, tell the user to copy examples/profile.config.example.json to profile.config.json and fill it in, then stop.

  • doc_filename (default CLAUDE.md)
  • agent_command — the shell command template used to run init-project-doc non-interactively in a project directory. Default: claude --dangerously-skip-permissions -p "/init-project-doc". Other CLIs can be substituted, e.g. codex exec "/init-project-doc" (see docs/installation.md for per-tool examples). This flag skips interactive permission/trust prompts — only use it in directories you trust.

Execution Steps

Step 1: Get the latest version number

Run the /get-latest-version skill to get the version string to use as the "latest version" baseline.

  • Return format is a string (e.g. "2.0")
  • If none is returned, all projects with a doc file are treated as "outdated"

Step 2: Filter candidate projects

From the table in projects-list.md, filter rows that satisfy all of the following:

  1. "Active" column is ✅ (skip ❌)
  2. Matches at least one of:
    • Doc-file column is ❌ (not yet initialized)
    • Doc-file column is ✅ but "Version" column is not the latest (including —)

Sort by table order, take the first N (default N=5; user can specify in prompt, e.g. "batch init 3").

Step 3: Run init-project-doc in parallel (max 3 per batch)

Split candidate projects into batches of max 3, run within each batch in parallel, batches run sequentially:

cd <project path> && <agent_command>
  • <project path> is the "Path" column value from the table; expand ~ to $HOME
  • Issue all 3 commands in the same batch simultaneously via Bash tool with run_in_background: true, then wait for all to complete
  • After each batch finishes, read each project's <doc_filename> frontmatter to get skill_version, then proceed to the next batch

Step 4: Update projects-list.md

After each batch completes, immediately update the corresponding rows in projects-list.md:

  • Doc-file column → ✅
  • "Version" column → skill_version value read from the doc file (use — if frontmatter field is missing)
  • "Description" column → one_line_description value from the doc file frontmatter (keep original if missing)

Update method: Edit projects-list.md directly, match rows by the "Path" column, replace the row.

Step 5: Report results

After all batches complete, output a summary:

✅ Batch init complete
- Projects processed: N
- Success: M
- Failed: K (list names)
- projects-list.md updated

Notes

  • Parallelism: max 3 projects per batch run simultaneously; batches are sequential
  • Expand ~ in paths to the full absolute path via $HOME
  • If a project fails (non-zero exit code), record the failure and continue with remaining projects — do not abort the entire batch
  • Version comparison: 2.0 > 1.0 — use numeric comparison, not string comparison
  • Show the candidate list to the user for confirmation before starting execution

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.