Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions .claude/skills/meta-exec/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ Execute any command in the root repo and every project at this meta level (add `
# Run 'make build' in every repo
meta exec -- make build

# Run any shell command
# Any program with its arguments
meta exec -- ls -la

# Commands with arguments
meta exec -- npm install --save-dev typescript
```

Each argument meta receives reaches the program unchanged: meta runs the program directly, with no shell in between. Quotes, spaces, `$()`, `;`, `|`, `&&`, globs and `%` in an argument stay literal, so text from an issue, a commit message or a file name can't run commands once meta has it. Your own shell still parses the command line before meta runs (`"$(...)"` in double quotes runs there), so pass untrusted text in single quotes or as a separate argv element (as the MCP tools take it). When you want a shell (pipes, `&&`, redirects, globs), ask for one:

```bash
meta exec -- sh -c 'npm ci && npm test'
```

A `.looprc` alias for the program is expanded into words (POSIX quoting rules, nothing expanded or run). On Windows meta does not wrap commands in `cmd /c` either. Batch files such as `npm.cmd` need their extension (`meta exec -- npm.cmd install`); Windows runs those through `cmd.exe`, and Rust escapes their arguments for it and refuses any it cannot pass safely.

The `--` separates meta options from the command to execute. The `--` is optional unless your command starts with `-`.

```bash
Expand Down Expand Up @@ -52,16 +58,17 @@ Parallel mode:

## Filtering Options

Control which repos run the command. These options come from `loop`:
Control which repos run the command:

```bash
# Only directories whose path contains one of these (substring match)
# Only these repos: each value is a repo's .meta name or its path from the workspace root
meta --include api,worker git status
meta --include libs/core,. git status # `.` is the root repo

# Skip directories whose path contains one of these
# Skip these repos
meta --exclude legacy-service git push

# Filter by tag (meta-specific, applied before loop filtering)
# Filter by tag (applied before --include/--exclude)
meta --tag backend exec -- make deploy

# Combine: tag filter + directory filter
Expand All @@ -70,10 +77,10 @@ meta --tag backend --include api git status

**Filter precedence:**
1. `--tag` filters projects by tag (meta level)
2. `--include` limits to specific directories (loop level)
3. `--exclude` removes directories (loop level)
2. `--include` limits to the named repos
3. `--exclude` removes the named repos

Include/exclude match substrings of directory paths, so `api` also matches `api-tests`. The meta root repo stays included even when it doesn't match a tag.
A value names a whole repo, never part of a path: `api` does not match `api-tests`. A value that names no repo is an error, so a typo never runs a command in the repo you meant to skip. Inside a worktree set, a repo is named by its alias (its path in the set). A value starting with `./` is a path only; use it when a name is ambiguous (a value that names several repos is an error too). The meta root repo stays included even when it doesn't match a tag.

## Dry Run

Expand Down Expand Up @@ -129,8 +136,8 @@ meta --silent exec -- npm install
|--------|-------------|
| `--parallel` | Run commands concurrently (the default) |
| `--sequential` | Run one repo at a time |
| `--include <dirs>` | Only directories whose path contains these |
| `--exclude <dirs>` | Skip directories whose path contains these |
| `--include <repos>` | Only these repos (`.meta` name or path from the root) |
| `--exclude <repos>` | Skip these repos (`.meta` name or path from the root) |
| `--tag <tags>` | Filter by project tag(s) |
| `--dry-run` | Preview without executing |
| `--json` | Structured JSON output |
Expand Down Expand Up @@ -161,8 +168,8 @@ meta --exclude large-monorepo exec -- cargo update

### Find Files Across Repos
```bash
# Quote the whole command: meta joins its arguments with spaces for the shell
meta exec -- 'find . -name "*.rs" -type f' | head -20
# Arguments go to find as typed: "*.rs" is find's pattern, not a shell glob
meta exec -- find . -name '*.rs' -type f | head -20
```

### Clean Build Artifacts
Expand All @@ -175,7 +182,7 @@ meta exec -- rm -rf node_modules dist

| Use `meta exec` | Use Plugin (e.g., `meta git`) |
|-----------------|-------------------------------|
| Generic shell commands | Git operations |
| Generic commands | Git operations |
| Build/test commands | Commands needing special handling |
| One-off scripts | Operations with meta-specific logic |
| npm/cargo/make | Clone, update, snapshot |
Expand Down
8 changes: 5 additions & 3 deletions .claude/skills/meta-git/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ meta git status # Shows status for every repo at once
meta git commit -m "feat: update" # Commits in every repo with staged changes
```

Any other git subcommand passes through to git in each repo. Meta passes the arguments it receives to git unchanged, with no shell in between: `meta git log --format='%h %s'` and a commit message containing `$(...)` or `;` are passed as-is. Your own shell still expands `$(...)` inside double quotes before meta runs, so put untrusted text in single quotes.

## Cloning a Meta Repo

```bash
Expand Down Expand Up @@ -87,13 +89,13 @@ meta git log --oneline -5

## Filtering

Target specific repos. With `--tag`, the meta root repo stays included even when it isn't tagged; `--include`/`--exclude` match substrings of directory paths and can drop the root.
Target specific repos. With `--tag`, the meta root repo stays included even when it isn't tagged; `--include`/`--exclude` take whole repos (a `.meta` name or the path from the workspace root, `.` for the root), never part of a path, and can drop the root. A value that names no repo is an error.

```bash
# By tag
meta --tag backend git status

# By directory (substring match: `api` also matches `api-tests`)
# By repo: .meta name or path from the root (`api` does not match `api-tests`)
meta --include api,web git push

# Exclude repos
Expand Down Expand Up @@ -139,7 +141,7 @@ When the meta MCP server is available, these tools provide structured JSON outpu

## Efficiency Tips

- **Targeted commits**: `meta --include repo1,repo2 git commit -m "msg"` commits only in repos whose path matches
- **Targeted commits**: `meta --include repo1,repo2 git commit -m "msg"` commits only in the named repos
- **Tag-based push**: `meta --tag backend git push` pushes tagged repos (and the root)
- **Per-repo messages**: Use `meta_git_multi_commit` when changes in different repos need different commit messages
- **One-call status**: `meta git status` replaces N individual `cd && git status` sequences
4 changes: 2 additions & 2 deletions .claude/skills/meta-safety/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Multi-repo workspaces are powerful but require awareness. Meta gives you precisi

## Precision Operations

Instead of cd-ing into repos one by one, use meta flags to target what you need. Include/exclude match substrings of directory paths; `--tag` keeps the meta root even when it isn't tagged:
Instead of cd-ing into repos one by one, use meta flags to target what you need. Include/exclude take whole repos (a `.meta` name or the path from the workspace root), never part of a path, and a value that names no repo is an error; `--tag` keeps the meta root even when it isn't tagged:

```bash
# Target specific repos
Expand All @@ -42,7 +42,7 @@ When modifying a repo that other repos depend on:
## Efficient Commits

```bash
# Commit only in repos whose path contains repo1 or repo2 (substring match)
# Commit only in repos repo1 and repo2 (.meta name or path from the root)
meta --include repo1,repo2 git commit -m "feat: update shared API"

# Push tagged repos (and the root)
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/meta-workspace/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ When the meta MCP server is available, these tools provide structured JSON for p
## Efficiency Tips

- **One command, all repos**: `meta git status` replaces N individual `cd && git status` calls
- **Targeted operations**: `meta --include repo1,repo2 exec -- cmd` operates on only the repos whose path matches
- **Targeted operations**: `meta --include repo1,repo2 exec -- cmd` operates on only the named repos (`.meta` name or path from the workspace root)
- **Tag-based filtering**: `meta --tag backend exec -- cargo test` scopes to tagged repos
- **Dependency awareness**: `meta_analyze_impact <repo>` shows who depends on a repo before you modify it — prevents cascading fix-up commits
- **Session start**: Always run `meta project list --recursive --json` first to get the workspace map
12 changes: 7 additions & 5 deletions .claude/skills/meta-worktree/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ meta git worktree exec auth-fix --exclude legacy -- npm test
meta git worktree exec auth-fix --parallel -- cargo build
```

`--include`/`--exclude` match text anywhere in each repo's absolute path, and
every path contains `.worktrees/<set>/`: pick filter text that isn't in the set
name (`--include auth` in set `auth-fix` matches every repo).
`--include`/`--exclude` name whole repos by alias, their path in the set
(`.` for the root repo), never part of a path. A value that names no repo in
the set is an error. They go after the set name: `meta --include x git
worktree ...` is refused. The command's arguments reach it as
typed, with no shell; use `-- sh -c '...'` when you want one.

## Context Detection

Expand Down Expand Up @@ -229,7 +231,7 @@ it up with `remove`.

| Option | Description |
|--------|-------------|
| `--include <text>` | Only repos whose path contains it (comma-separated) |
| `--exclude <text>` | Skip repos whose path contains it (comma-separated) |
| `--include <repos>` | Only these repos, by alias (comma-separated) |
| `--exclude <repos>` | Skip these repos, by alias (comma-separated) |
| `--parallel` | Run concurrently |
| `--ephemeral` | Create, run, then remove (takes `--repo`/`--all`, `--branch`, `--from-pr`, `--meta`, a commit-ish) |
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ pub mod context;
pub mod dependency_graph;
pub mod git_utils;
pub mod query;
pub mod repo_filter;
pub mod subprocess_plugins;
pub mod worktree;
Loading
Loading