@xynogen/pix-skills 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +75 -0
- package/package.json +48 -0
- package/skills/audit.md +48 -0
- package/skills/bootstrap.md +50 -0
- package/skills/brainstorm.md +49 -0
- package/skills/clone.md +22 -0
- package/skills/commit.md +80 -0
- package/skills/debug.md +55 -0
- package/skills/explain.md +47 -0
- package/skills/finish.md +78 -0
- package/skills/handoff.md +121 -0
- package/skills/plan.md +62 -0
- package/skills/readme.md +79 -0
- package/skills/review.md +50 -0
- package/skills/runner.md +402 -0
- package/skills/search.md +47 -0
- package/skills/standup.md +253 -0
- package/skills/suggest.md +45 -0
- package/skills/task.md +46 -0
- package/skills/test.md +47 -0
- package/skills/tldr.md +32 -0
- package/skills/ui.md +36 -0
- package/skills/verify.md +45 -0
- package/src/index.ts +182 -0
package/skills/runner.md
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: runner
|
|
3
|
+
description: Generate, convert, or update a task runner file (justfile, Makefile, mise tasks, Taskfile.yml, package.json scripts, or run.sh) for any project
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
# Task Runner Generation Directive
|
|
7
|
+
|
|
8
|
+
## Below are what agent MUST do:
|
|
9
|
+
- **AUTO-RUN**: Run terminal commands and tool calls needed proactively without confirmation unless explicit input required.
|
|
10
|
+
- **ASK FORMAT**: Before generating anything, ask user which runner format they want using the Question tool with these options:
|
|
11
|
+
- **justfile** — requires `just`. Native deps, groups, params, comments.
|
|
12
|
+
- **Makefile** — universal, pre-installed on all Unix. `.PHONY` targets, deps via prerequisites.
|
|
13
|
+
- **mise (mise.toml)** — task runner built into mise. Inline or file-based tasks with deps.
|
|
14
|
+
- **Taskfile.yml (go-task)** — YAML-based, cross-platform. Requires `task` binary.
|
|
15
|
+
- **package.json (npm scripts)** — requires Node. Simple key:value, no native dep graph.
|
|
16
|
+
- **run.sh (shell script)** — zero dependencies. Single bash script with subcommands.
|
|
17
|
+
- **DETECT**: Scan project root for language/framework indicators (`package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `Makefile`, `justfile`, `setup.sh`, etc.). Identify primary language, package manager, test runner, linter, formatter.
|
|
18
|
+
- **SCAN EXISTING**: Runner file already exists (any format) → read it first as source of truth. Parse recipes/tasks, dependencies, groups, descriptions, parameters.
|
|
19
|
+
- **RESEARCH**: Unfamiliar with detected stack → consult official docs for canonical dev/test/lint/format commands before writing recipes.
|
|
20
|
+
- **GENERATE**: Create runner file in project root adapted to detected stack and chosen format.
|
|
21
|
+
- **VALIDATE**: Run format's list command after creation to confirm all recipes parse correctly.
|
|
22
|
+
|
|
23
|
+
## Required Task Structure
|
|
24
|
+
|
|
25
|
+
Every generated runner MUST include these standalone tasks at minimum:
|
|
26
|
+
|
|
27
|
+
| Task | Purpose |
|
|
28
|
+
|-----------|----------------------------------------|
|
|
29
|
+
| `install` | Create local environment, install deps |
|
|
30
|
+
| `dev` | Run the development server |
|
|
31
|
+
|
|
32
|
+
Additional consolidated tasks added based on what project contains (see Detection-to-Task Mapping below).
|
|
33
|
+
|
|
34
|
+
For dotfiles repos, task structure follows group/module pattern instead (sync, CLI, GUI, AI, System).
|
|
35
|
+
|
|
36
|
+
## Task Consolidation
|
|
37
|
+
|
|
38
|
+
### Principle
|
|
39
|
+
|
|
40
|
+
Group related operations into single parameterized task with `<action>` argument instead of separate flat tasks. Reduces surface area, makes runner discoverable.
|
|
41
|
+
|
|
42
|
+
### Consolidation Decision Rule
|
|
43
|
+
|
|
44
|
+
| Condition | Action |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Single command, no variants | Standalone task (e.g., `dev`, `install`) |
|
|
47
|
+
| 2+ related commands, action maps directly to a CLI arg | Simple parameterized — pass action through to the underlying tool |
|
|
48
|
+
| 2+ related commands, each runs different logic | Complex parameterized — case/conditional dispatch per action |
|
|
49
|
+
| Multi-step setup with no variants | Standalone with multi-command/array syntax |
|
|
50
|
+
|
|
51
|
+
### Detection-to-Task Mapping
|
|
52
|
+
|
|
53
|
+
Scan project for these files/patterns. When detected, generate corresponding consolidated task:
|
|
54
|
+
|
|
55
|
+
| Detected files | Task | Actions | Type |
|
|
56
|
+
|---|---|---|---|
|
|
57
|
+
| `docker-compose.yml`, `Dockerfile` | `docker` | `build\|up\|down` | Simple (pass-through to `docker compose`) |
|
|
58
|
+
| DB config, migration dirs, ORM config | `db` | `migrate\|seed\|setup` | Complex (each action runs different commands) |
|
|
59
|
+
| Test runner present | `test` | `unit\|tidy` | Complex (each action runs a different tool) |
|
|
60
|
+
| Formatter present | `format` | `fix\|check` | Complex (`fix` rewrites, `check` dry-run for CI) |
|
|
61
|
+
| Linter present | `lint` | `check\|fix` | Complex (`check` reports issues, `fix` auto-corrects) |
|
|
62
|
+
| Deploy config (`fly.toml`, `render.yaml`, `vercel.json`, CI/CD) | `deploy` | `staging\|production` or format-appropriate | Complex |
|
|
63
|
+
| `proto/`, gRPC/OpenAPI specs | `gen` | `proto\|types\|client` | Complex |
|
|
64
|
+
|
|
65
|
+
Agent MUST check these indicators during DETECT step. Only generate consolidated tasks for capabilities that actually exist in project. Don't generate `docker` if no `Dockerfile`.
|
|
66
|
+
|
|
67
|
+
### Naming Rules
|
|
68
|
+
|
|
69
|
+
- Task names: lowercase, single word when possible (`dev`, `test`, `db`)
|
|
70
|
+
- Descriptions: include action options in parens — `"Test operations (unit|tidy)"`
|
|
71
|
+
- Arg name: always `<action>` for the primary positional argument
|
|
72
|
+
- Bash blocks in parameterized tasks: always start with `#!/usr/bin/env bash` and `set -euo pipefail`
|
|
73
|
+
- **`lint` and `format` are NOT part of `test`** — they are separate concerns:
|
|
74
|
+
- `test` → correctness (pytest, cargo test, go test, etc.)
|
|
75
|
+
- `format` → code style; `fix` rewrites in-place, `check` is dry-run for CI
|
|
76
|
+
- `lint` → static analysis; `check` reports issues, `fix` auto-corrects
|
|
77
|
+
|
|
78
|
+
## Language Adaptation Table
|
|
79
|
+
|
|
80
|
+
Use as reference when generating recipes:
|
|
81
|
+
|
|
82
|
+
| Language | install | dev | format | lint | test | tidy |
|
|
83
|
+
|------------|------------------------------------------------|----------------------------------|---------------------------|-----------------------------|--------------------------|----------------------------------------------|
|
|
84
|
+
| Python | `python -m venv .venv && .venv/bin/pip install -r requirements.txt` | `.venv/bin/python -m <app>` | `ruff format .` | `ruff check .` | `pytest` | `find . -type d -name __pycache__ -exec rm -rf {} + && rm -rf .pytest_cache dist build *.egg-info` |
|
|
85
|
+
| Node/TS | `npm install` | `npm run dev` | `npx prettier --write .` | `npx eslint .` | `npm test` | `rm -rf node_modules dist .next .nuxt` |
|
|
86
|
+
| Rust | `cargo build` | `cargo run` | `cargo fmt` | `cargo clippy` | `cargo test` | `cargo clean` |
|
|
87
|
+
| Go | `go mod download` | `go run .` | `gofmt -w .` | `golangci-lint run` | `go test ./...` | `go clean -cache -testcache` |
|
|
88
|
+
| Ruby | `bundle install` | `bundle exec rails server` | `bundle exec rubocop -A` | `bundle exec rubocop` | `bundle exec rspec` | `rm -rf tmp/cache vendor/bundle` |
|
|
89
|
+
| PHP | `composer install` | `php artisan serve` | `./vendor/bin/pint` | `./vendor/bin/phpstan` | `./vendor/bin/phpunit` | `rm -rf vendor/ .phpunit.cache` |
|
|
90
|
+
| Java | `./gradlew build` or `mvn install` | `./gradlew bootRun` or `mvn spring-boot:run` | `./gradlew spotlessApply` | `./gradlew check` | `./gradlew test` or `mvn test` | `./gradlew clean` or `mvn clean` |
|
|
91
|
+
| Elixir | `mix deps.get` | `mix phx.server` | `mix format` | `mix credo` | `mix test` | `mix clean` |
|
|
92
|
+
| Zig | `zig build` | `zig build run` | `zig fmt .` | `zig fmt --check .` | `zig build test` | `rm -rf zig-out zig-cache` |
|
|
93
|
+
|
|
94
|
+
## Format-Specific Generation Rules
|
|
95
|
+
|
|
96
|
+
### justfile
|
|
97
|
+
- Use `set shell := ["bash", "-cu"]`
|
|
98
|
+
- Use `[group('Name')]` for categories
|
|
99
|
+
- Dependencies via `recipe: dep1 dep2`
|
|
100
|
+
- Comments above recipes become descriptions
|
|
101
|
+
- Validate: `just --list`
|
|
102
|
+
- **Standalone**: `recipe:` with direct command
|
|
103
|
+
- **Simple parameterized**: `recipe action:` where action passes through to the tool
|
|
104
|
+
- **Complex parameterized**: `recipe action:` with `if/else` dispatch in a bash block
|
|
105
|
+
```just
|
|
106
|
+
# Docker operations (build|up|down)
|
|
107
|
+
[group('Infra')]
|
|
108
|
+
docker action:
|
|
109
|
+
docker compose -f docker-compose.dev.yml {{action}}
|
|
110
|
+
|
|
111
|
+
# Run unit tests or clean artifacts (unit|tidy)
|
|
112
|
+
[group('test')]
|
|
113
|
+
test action:
|
|
114
|
+
#!/usr/bin/env bash
|
|
115
|
+
set -euo pipefail
|
|
116
|
+
case "{{action}}" in
|
|
117
|
+
unit) pytest -v ;;
|
|
118
|
+
tidy) find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true ;;
|
|
119
|
+
esac
|
|
120
|
+
|
|
121
|
+
# Format operations — fix rewrites, check is dry-run for CI (fix|check)
|
|
122
|
+
[group('format')]
|
|
123
|
+
format action="fix":
|
|
124
|
+
#!/usr/bin/env bash
|
|
125
|
+
set -euo pipefail
|
|
126
|
+
case "{{action}}" in
|
|
127
|
+
fix) ruff format . && ruff check --fix . ;;
|
|
128
|
+
check) ruff format --check . && ruff check . ;;
|
|
129
|
+
esac
|
|
130
|
+
|
|
131
|
+
# Lint operations — check reports issues, fix auto-corrects (check|fix)
|
|
132
|
+
[group('format')]
|
|
133
|
+
lint action="check":
|
|
134
|
+
#!/usr/bin/env bash
|
|
135
|
+
set -euo pipefail
|
|
136
|
+
case "{{action}}" in
|
|
137
|
+
check) ruff check . ;;
|
|
138
|
+
fix) ruff check --fix . ;;
|
|
139
|
+
esac
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Makefile
|
|
143
|
+
- Set `SHELL := /bin/bash` and `.DEFAULT_GOAL := help`
|
|
144
|
+
- Declare all targets in `.PHONY`
|
|
145
|
+
- Use `## comment` after target for help text, generate a `help` target with `grep -E`
|
|
146
|
+
- Dependencies via `target: dep1 dep2`
|
|
147
|
+
- Group with comment headers (`# --- Group ---`)
|
|
148
|
+
- Validate: `make help`
|
|
149
|
+
- **Standalone**: standard target with direct commands
|
|
150
|
+
- **Simple parameterized**: pattern rule `docker-%:` dispatching to `docker compose $*`
|
|
151
|
+
- **Complex parameterized**: pattern rule `test-%:` with per-target recipes
|
|
152
|
+
```makefile
|
|
153
|
+
.PHONY: docker-% test-% format-% lint
|
|
154
|
+
|
|
155
|
+
docker-%: ## Docker operations (build|up|down)
|
|
156
|
+
docker compose -f docker-compose.dev.yml $*
|
|
157
|
+
|
|
158
|
+
test-unit: ## Run unit tests
|
|
159
|
+
pytest -v
|
|
160
|
+
test-tidy: ## Clean build artifacts
|
|
161
|
+
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
|
|
162
|
+
|
|
163
|
+
format-fix: ## Reformat code
|
|
164
|
+
ruff format . && ruff check --fix .
|
|
165
|
+
format-check: ## Dry-run format check (CI)
|
|
166
|
+
ruff format --check . && ruff check .
|
|
167
|
+
|
|
168
|
+
lint-check: ## Lint — report issues
|
|
169
|
+
ruff check .
|
|
170
|
+
lint-fix: ## Lint — auto-correct
|
|
171
|
+
ruff check --fix .
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### mise (mise.toml)
|
|
175
|
+
- Environment block (`[env]`) at the top of the file
|
|
176
|
+
- Define tasks under `[tasks.<name>]`
|
|
177
|
+
- Use `description`, `depends`, `run` fields
|
|
178
|
+
- Group with comment headers (`# --- Group ---`)
|
|
179
|
+
- Validate: `mise tasks`
|
|
180
|
+
- **Standalone**: `[tasks.dev]` with `run = "command"`
|
|
181
|
+
- **Multi-step standalone**: `run = [...]` array for sequential commands
|
|
182
|
+
- **Simple parameterized**: bash `case` dispatch on `$1`, action interpolated directly
|
|
183
|
+
- **Complex parameterized**: bash `case` dispatch on `$1` with per-action logic
|
|
184
|
+
- **No `usage` field**: `usage` with `arg` enforces required args and errors before bash runs. Skip it — handle arg validation in bash instead.
|
|
185
|
+
- **Help on no arg**: When called without an action, print usage with action descriptions and `exit 0` (not `exit 1`). This makes bare `mise run <task>` a discoverable help command.
|
|
186
|
+
```toml
|
|
187
|
+
[tasks.docker]
|
|
188
|
+
description = "Docker operations (build|up|down)"
|
|
189
|
+
run = '''
|
|
190
|
+
#!/usr/bin/env bash
|
|
191
|
+
set -euo pipefail
|
|
192
|
+
action="${1:-}"
|
|
193
|
+
if [ -z "$action" ]; then
|
|
194
|
+
echo "Usage: mise run docker <action>"
|
|
195
|
+
echo ""
|
|
196
|
+
echo "Actions:"
|
|
197
|
+
echo " build Build docker images"
|
|
198
|
+
echo " up Start docker services"
|
|
199
|
+
echo " down Stop docker services"
|
|
200
|
+
exit 0
|
|
201
|
+
fi
|
|
202
|
+
docker compose -f docker-compose.dev.yml "$action"
|
|
203
|
+
'''
|
|
204
|
+
|
|
205
|
+
[tasks.test]
|
|
206
|
+
description = "Test operations (unit|tidy)"
|
|
207
|
+
run = '''
|
|
208
|
+
#!/usr/bin/env bash
|
|
209
|
+
set -euo pipefail
|
|
210
|
+
action="${1:-}"
|
|
211
|
+
if [ -z "$action" ]; then
|
|
212
|
+
echo "Usage: mise run test <action>"
|
|
213
|
+
echo ""
|
|
214
|
+
echo "Actions:"
|
|
215
|
+
echo " unit Run pytest"
|
|
216
|
+
echo " tidy Remove caches and compiled files"
|
|
217
|
+
exit 0
|
|
218
|
+
fi
|
|
219
|
+
case "$action" in
|
|
220
|
+
unit) python -m pytest -v ;;
|
|
221
|
+
tidy) find . -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true ;;
|
|
222
|
+
*) echo "Unknown action: $action"; exit 1 ;;
|
|
223
|
+
esac
|
|
224
|
+
'''
|
|
225
|
+
|
|
226
|
+
[tasks.format]
|
|
227
|
+
description = "Format operations — fix rewrites, check is dry-run for CI (fix|check)"
|
|
228
|
+
run = '''
|
|
229
|
+
#!/usr/bin/env bash
|
|
230
|
+
set -euo pipefail
|
|
231
|
+
action="${1:-fix}"
|
|
232
|
+
if [ -z "$action" ]; then
|
|
233
|
+
echo "Usage: mise run format <action>"
|
|
234
|
+
echo ""
|
|
235
|
+
echo "Actions:"
|
|
236
|
+
echo " fix Reformat code in-place"
|
|
237
|
+
echo " check Dry-run, exit 1 if changes needed (CI)"
|
|
238
|
+
exit 0
|
|
239
|
+
fi
|
|
240
|
+
case "$action" in
|
|
241
|
+
fix) ruff format . && ruff check --fix . ;;
|
|
242
|
+
check) ruff format --check . && ruff check . ;;
|
|
243
|
+
*) echo "Unknown action: $action"; exit 1 ;;
|
|
244
|
+
esac
|
|
245
|
+
'''
|
|
246
|
+
|
|
247
|
+
[tasks.lint]
|
|
248
|
+
description = "Lint operations (check|fix)"
|
|
249
|
+
run = '''
|
|
250
|
+
#!/usr/bin/env bash
|
|
251
|
+
set -euo pipefail
|
|
252
|
+
action="${1:-check}"
|
|
253
|
+
case "$action" in
|
|
254
|
+
check) ruff check . ;;
|
|
255
|
+
fix) ruff check --fix . ;;
|
|
256
|
+
*) echo "Unknown action: $action"; exit 1 ;;
|
|
257
|
+
esac
|
|
258
|
+
'''
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Taskfile.yml (go-task)
|
|
262
|
+
- Use `version: '3'`
|
|
263
|
+
- Define under `tasks:` with `desc`, `deps`, `cmds`
|
|
264
|
+
- Group with comment headers
|
|
265
|
+
- Validate: `task --list`
|
|
266
|
+
- **Standalone**: single task with `cmds` list
|
|
267
|
+
- **Simple parameterized**: `{{.CLI_ARGS}}` passed through to the underlying tool
|
|
268
|
+
- **Complex parameterized**: internal tasks per action, parent dispatches via `task test-{{.CLI_ARGS}}`
|
|
269
|
+
```yaml
|
|
270
|
+
tasks:
|
|
271
|
+
docker:
|
|
272
|
+
desc: "Docker operations (build|up|down)"
|
|
273
|
+
cmds:
|
|
274
|
+
- docker compose -f docker-compose.dev.yml {{.CLI_ARGS}}
|
|
275
|
+
|
|
276
|
+
test:
|
|
277
|
+
desc: "Test operations (unit|tidy)"
|
|
278
|
+
cmds:
|
|
279
|
+
- task: "test-{{.CLI_ARGS}}"
|
|
280
|
+
test-unit:
|
|
281
|
+
internal: true
|
|
282
|
+
cmds: [pytest -v]
|
|
283
|
+
test-tidy:
|
|
284
|
+
internal: true
|
|
285
|
+
cmds: ["find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true"]
|
|
286
|
+
|
|
287
|
+
format:
|
|
288
|
+
desc: "Format operations (fix|check)"
|
|
289
|
+
cmds:
|
|
290
|
+
- task: "format-{{.CLI_ARGS}}"
|
|
291
|
+
format-fix:
|
|
292
|
+
internal: true
|
|
293
|
+
cmds: [ruff format ., ruff check --fix .]
|
|
294
|
+
format-check:
|
|
295
|
+
internal: true
|
|
296
|
+
cmds: [ruff format --check ., ruff check .]
|
|
297
|
+
|
|
298
|
+
lint:
|
|
299
|
+
desc: "Lint operations (check|fix)"
|
|
300
|
+
cmds:
|
|
301
|
+
- task: "lint-{{.CLI_ARGS}}"
|
|
302
|
+
lint-check:
|
|
303
|
+
internal: true
|
|
304
|
+
cmds: [ruff check .]
|
|
305
|
+
lint-fix:
|
|
306
|
+
internal: true
|
|
307
|
+
cmds: [ruff check --fix .]
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### package.json (npm scripts)
|
|
311
|
+
- No native arg dispatch or dep graph
|
|
312
|
+
- Validate: `npm run`
|
|
313
|
+
- **Standalone**: direct command string
|
|
314
|
+
- **Consolidated via colon namespacing**: `"docker:build"`, `"docker:up"`, `"docker:down"` as separate scripts, parent `"docker"` echoes usage
|
|
315
|
+
- **Complex parameterized**: individual `"test:unit"`, `"format:fix"`, `"format:check"` scripts, plus standalone `"lint"`
|
|
316
|
+
```json
|
|
317
|
+
{
|
|
318
|
+
"scripts": {
|
|
319
|
+
"dev": "next dev",
|
|
320
|
+
"install:deps": "npm ci",
|
|
321
|
+
"docker:build": "docker compose -f docker-compose.dev.yml build",
|
|
322
|
+
"docker:up": "docker compose -f docker-compose.dev.yml up",
|
|
323
|
+
"docker:down": "docker compose -f docker-compose.dev.yml down",
|
|
324
|
+
"test:unit": "jest",
|
|
325
|
+
"test:tidy": "rm -rf node_modules dist .next",
|
|
326
|
+
"format:fix": "prettier --write . && eslint --fix .",
|
|
327
|
+
"format:check": "prettier --check . && eslint .",
|
|
328
|
+
"lint:check": "eslint .",
|
|
329
|
+
"lint:fix": "eslint --fix ."
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
Note: `npm run` has no arg validation or choices — colon namespacing is the closest equivalent.
|
|
334
|
+
|
|
335
|
+
### run.sh (shell script)
|
|
336
|
+
- `#!/usr/bin/env bash` with `set -euo pipefail`
|
|
337
|
+
- Each task as `cmd_<name>()` function
|
|
338
|
+
- Dispatch via `main()` with case/declare lookup
|
|
339
|
+
- Help via `cmd_help()` listing all commands
|
|
340
|
+
- Validate: `./run.sh help`
|
|
341
|
+
- **Standalone**: `cmd_dev()` with direct command
|
|
342
|
+
- **Parameterized**: `cmd_<name>()` takes `$1` as action, inner `case` dispatch
|
|
343
|
+
```bash
|
|
344
|
+
cmd_docker() {
|
|
345
|
+
local action="${1:?Usage: $0 docker <build|up|down>}"
|
|
346
|
+
case "$action" in
|
|
347
|
+
build|up|down) docker compose -f docker-compose.dev.yml "$action" ;;
|
|
348
|
+
*) echo "Unknown action: $action"; exit 1 ;;
|
|
349
|
+
esac
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
cmd_test() {
|
|
353
|
+
local action="${1:?Usage: $0 test <unit|tidy>}"
|
|
354
|
+
case "$action" in
|
|
355
|
+
unit) pytest -v ;;
|
|
356
|
+
tidy) find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true ;;
|
|
357
|
+
*) echo "Unknown action: $action"; exit 1 ;;
|
|
358
|
+
esac
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
cmd_format() {
|
|
362
|
+
local action="${1:-fix}"
|
|
363
|
+
case "$action" in
|
|
364
|
+
fix) ruff format . && ruff check --fix . ;;
|
|
365
|
+
check) ruff format --check . && ruff check . ;;
|
|
366
|
+
*) echo "Unknown action: $action"; exit 1 ;;
|
|
367
|
+
esac
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
cmd_lint() {
|
|
371
|
+
local action="${1:-check}"
|
|
372
|
+
case "$action" in
|
|
373
|
+
check) ruff check . ;;
|
|
374
|
+
fix) ruff check --fix . ;;
|
|
375
|
+
*) echo "Unknown action: $action"; exit 1 ;;
|
|
376
|
+
esac
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
## Conversion Rules
|
|
381
|
+
|
|
382
|
+
When converting between formats:
|
|
383
|
+
1. **Source of truth**: Read existing runner file first. Parse all tasks, actions, deps, groups, descriptions, parameters.
|
|
384
|
+
2. **Preserve ALL tasks** — standalone and consolidated. Don't drop tasks or flatten consolidated tasks into separate entries.
|
|
385
|
+
3. **Preserve consolidation** — source has `test unit|tidy` as single parameterized task → target must also express it as one entry point (using target format's parameterization mechanism). `format` and `lint` are always separate tasks — do not merge them into `test`.
|
|
386
|
+
4. **Preserve dependency order** — task A depends on B → express this in target format.
|
|
387
|
+
5. **Preserve groups/categories** — use target format's native grouping or comment headers.
|
|
388
|
+
6. **Preserve descriptions** — map comments to target format's description mechanism. Include action options in parens.
|
|
389
|
+
7. **Handle parameters** — translate `<action>` args using target format's native mechanism. Format lacks arg validation (e.g., package.json) → use colon namespacing, document the workaround.
|
|
390
|
+
8. **Handle sudo** — preserve `sudo` prefixes where present.
|
|
391
|
+
9. **Default task** — every format must have help/list command as default entry point.
|
|
392
|
+
|
|
393
|
+
## Customization Rules
|
|
394
|
+
- **Monorepo**: Multiple languages detected → ask user which is primary. Generate one runner for root or per-workspace.
|
|
395
|
+
- **Existing runner**: Runner file already exists in target format → present diff of proposed changes, ask confirmation before overwriting.
|
|
396
|
+
- **Framework override**: Framework has own conventions (e.g., Next.js `next dev`, Django `manage.py runserver`) → prefer framework-specific commands.
|
|
397
|
+
- **Missing tools**: Recipe requires tool not present → add install step or note as prerequisite comment.
|
|
398
|
+
- **pyproject.toml**: `[tool.uv]` or `uv.lock` detected → prefer `uv`. `[tool.poetry]` → prefer `poetry`.
|
|
399
|
+
- **Extra tasks**: Agent MAY add additional consolidated tasks if project clearly benefits — but only when backed by detected project files (see Detection-to-Task Mapping). Don't speculatively generate tasks for capabilities project doesn't have.
|
|
400
|
+
|
|
401
|
+
## Report
|
|
402
|
+
After generation, output result of format's list command and confirm all recipes functional.
|
package/skills/search.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: search
|
|
3
|
+
description: Deep logic discovery and project context mapping. Use when user asks "where is X", "find all usages of Y", "how is Z wired up", "what handles this", or location of a behavior is unknown across many files.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
# Deep Context Search Directive
|
|
7
|
+
|
|
8
|
+
## Goal
|
|
9
|
+
Build precise map of where a behavior lives and how it connects — so next action operates on full context, not single match.
|
|
10
|
+
|
|
11
|
+
## Tool Tiers (match tool to scope)
|
|
12
|
+
- **Unknown location, pattern across many files, comments/strings/config** → native `Grep` / `Read`.
|
|
13
|
+
- **Known symbol — definition, usages, type** → LSP `goToDefinition` / `findReferences` / `hover`.
|
|
14
|
+
- Start with `Grep` to locate, then switch to LSP for exact navigation. Never grep what LSP can resolve exactly.
|
|
15
|
+
|
|
16
|
+
## Below are what agent MUST do:
|
|
17
|
+
|
|
18
|
+
### Phase 1: Scan
|
|
19
|
+
- **AUTO-RUN**: Run searches without confirmation unless input required.
|
|
20
|
+
- **SEARCH**: Grep for content, glob for structure. Search synonyms and likely alternate spellings, not just literal term.
|
|
21
|
+
- **GROUP**: Cluster matches by intent — Logic, Config, Tests, Docs.
|
|
22
|
+
|
|
23
|
+
### Phase 2: Trace
|
|
24
|
+
- **FLOW**: For each cluster, identify how data flows in and out. Note every call site.
|
|
25
|
+
- **DEPENDENCIES**: Map cross-module references the matches rely on.
|
|
26
|
+
- **IDENTIFY**: Flag inconsistencies, anti-patterns, deviations from project convention.
|
|
27
|
+
|
|
28
|
+
### Phase 3: Report
|
|
29
|
+
```
|
|
30
|
+
## Target: [what was searched]
|
|
31
|
+
|
|
32
|
+
## Found in
|
|
33
|
+
- **Logic**: `path:line` — [role]
|
|
34
|
+
- **Config**: `path:line` — [role]
|
|
35
|
+
- **Tests**: `path:line` — [role]
|
|
36
|
+
|
|
37
|
+
## How it connects
|
|
38
|
+
[entry point] → [path:line] → [path:line] → [exit]
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
[Inconsistencies, dead code, missing coverage, surprises.]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Red Flags — STOP
|
|
45
|
+
- Reporting first match without checking for others.
|
|
46
|
+
- Searching only literal string when synonyms/aliases likely exist.
|
|
47
|
+
- Using LSP for broad sweep, or grep for exact symbol resolution.
|