aiblueprint-cli 1.4.88 → 1.4.90
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/agents-config/skills/agents-manager/SKILL.md +14 -3
- package/agents-config/skills/agents-manager/references/writing-agent-prompts.md +1 -1
- package/agents-config/skills/apex/SKILL.md +116 -55
- package/agents-config/skills/apex/scripts/setup-templates.sh +154 -0
- package/agents-config/skills/apex/scripts/update-progress.sh +80 -0
- package/agents-config/skills/apex/steps/step-00-init.md +278 -0
- package/agents-config/skills/apex/steps/step-00b-branch.md +126 -0
- package/agents-config/skills/apex/steps/step-00b-economy.md +247 -0
- package/agents-config/skills/apex/steps/step-00b-interactive.md +170 -0
- package/agents-config/skills/apex/steps/step-00b-save.md +125 -0
- package/agents-config/skills/apex/steps/step-01-analyze.md +388 -0
- package/agents-config/skills/apex/steps/step-02-plan.md +593 -0
- package/agents-config/skills/apex/steps/step-02b-tasks.md +301 -0
- package/agents-config/skills/apex/steps/step-03-execute-teams.md +296 -0
- package/agents-config/skills/apex/steps/step-03-execute.md +240 -0
- package/agents-config/skills/apex/steps/step-04-validate.md +272 -0
- package/agents-config/skills/apex/steps/step-05-examine.md +400 -0
- package/agents-config/skills/apex/steps/step-06-resolve.md +239 -0
- package/agents-config/skills/apex/steps/step-07-tests.md +250 -0
- package/agents-config/skills/apex/steps/step-08-run-tests.md +314 -0
- package/agents-config/skills/apex/steps/step-09-finish.md +223 -0
- package/agents-config/skills/apex/steps/step-10-verify.md +296 -0
- package/agents-config/skills/apex/templates/00-context.md +55 -0
- package/agents-config/skills/apex/templates/01-analyze.md +10 -0
- package/agents-config/skills/apex/templates/02-plan.md +10 -0
- package/agents-config/skills/apex/templates/03-execute.md +10 -0
- package/agents-config/skills/apex/templates/04-validate.md +10 -0
- package/agents-config/skills/apex/templates/05-examine.md +10 -0
- package/agents-config/skills/apex/templates/06-resolve.md +10 -0
- package/agents-config/skills/apex/templates/07-tests.md +10 -0
- package/agents-config/skills/apex/templates/08-run-tests.md +10 -0
- package/agents-config/skills/apex/templates/09-finish.md +10 -0
- package/agents-config/skills/apex/templates/10-verify.md +9 -0
- package/agents-config/skills/apex/templates/README.md +195 -0
- package/agents-config/skills/apex/templates/step-complete.md +7 -0
- package/agents-config/skills/appstore-connect/SKILL.md +3 -9
- package/agents-config/skills/environments-manager/SKILL.md +86 -94
- package/agents-config/skills/environments-manager/examples/{skills/dev/SKILL.md → claude/commands/dev.md} +1 -2
- package/agents-config/skills/environments-manager/examples/{skills/lint/SKILL.md → claude/commands/lint.md} +1 -2
- package/agents-config/skills/environments-manager/examples/{skills/test/SKILL.md → claude/commands/test.md} +1 -2
- package/agents-config/skills/environments-manager/examples/{skills/typecheck/SKILL.md → claude/commands/typecheck.md} +1 -2
- package/agents-config/skills/environments-manager/examples/scripts/worktree-down.sh +5 -12
- package/agents-config/skills/environments-manager/examples/scripts/worktree-up.sh +11 -21
- package/agents-config/skills/environments-manager/references/claude.md +9 -13
- package/agents-config/skills/environments-manager/references/convex.md +120 -0
- package/agents-config/skills/environments-manager/references/cursor.md +2 -2
- package/agents-config/skills/environments-manager/references/postgresql.md +89 -0
- package/agents-config/skills/oneshot/SKILL.md +21 -37
- package/agents-config/skills/rules-manager/SKILL.md +15 -2
- package/agents-config/skills/skill-manager/SKILL.md +30 -2
- package/agents-config/skills/ultrathink/SKILL.md +1 -1
- package/agents-config/skills/use-fable/SKILL.md +64 -0
- package/package.json +1 -1
- package/agents-config/skills/appstore-connect/references/setup.md +0 -156
- package/agents-config/skills/appstore-connect/references/testflight.md +0 -212
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Example:
|
|
3
|
-
# Generated by environments-manager.
|
|
2
|
+
# Example: backend-neutral worktree setup.
|
|
3
|
+
# Generated by environments-manager. Add backend-specific blocks from references.
|
|
4
4
|
|
|
5
5
|
set -euo pipefail
|
|
6
6
|
|
|
@@ -24,26 +24,16 @@ elif [[ -f yarn.lock ]]; then yarn install
|
|
|
24
24
|
elif [[ -f package-lock.json ]]; then npm install
|
|
25
25
|
fi
|
|
26
26
|
|
|
27
|
-
# 3.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if grep -qE '^DATABASE_URL=' .env; then
|
|
33
|
-
if [[ "${MYAPP_RESET_DB:-0}" == "1" ]] && command -v dropdb >/dev/null 2>&1; then
|
|
34
|
-
dropdb --if-exists -d postgres "$db_name" || true
|
|
35
|
-
fi
|
|
36
|
-
if command -v createdb >/dev/null 2>&1; then
|
|
37
|
-
createdb -d postgres "$db_name" 2>/dev/null || true
|
|
38
|
-
fi
|
|
39
|
-
# Rewrite only the DB name in DATABASE_URL
|
|
40
|
-
sed -i.bak -E "s|(DATABASE_URL=postgres://[^/]+)/[^?\"']+|\1/${db_name}|" .env && rm -f .env.bak
|
|
41
|
-
echo "DB set to $db_name"
|
|
42
|
-
fi
|
|
43
|
-
fi
|
|
27
|
+
# 3. Backend isolation/seeding
|
|
28
|
+
# Load a backend reference before adding database-specific behavior:
|
|
29
|
+
# - references/postgresql.md
|
|
30
|
+
# - references/convex.md
|
|
31
|
+
# - researcher-agent findings for any other backend
|
|
44
32
|
|
|
45
|
-
# 4. Codegen
|
|
46
|
-
if [[ -f
|
|
33
|
+
# 4. Codegen (adapt to the project)
|
|
34
|
+
if [[ -f convex/convex.config.ts || -f convex/schema.ts ]]; then
|
|
35
|
+
pnpm exec convex codegen
|
|
36
|
+
elif [[ -f prisma/schema.prisma ]]; then
|
|
47
37
|
pnpm prisma generate
|
|
48
38
|
fi
|
|
49
39
|
|
|
@@ -25,13 +25,12 @@ There is no separate `PostWorktreeCreate` hook (feature request #27744 is open).
|
|
|
25
25
|
```text
|
|
26
26
|
.worktreeinclude # gitignore-syntax list of files to auto-copy
|
|
27
27
|
.claude/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
├──
|
|
32
|
-
├──
|
|
33
|
-
|
|
34
|
-
└── lint/SKILL.md
|
|
28
|
+
├── settings.json # WorktreeCreate + WorktreeRemove hooks
|
|
29
|
+
└── commands/ # optional: per-action slash commands
|
|
30
|
+
├── dev.md
|
|
31
|
+
├── typecheck.md
|
|
32
|
+
├── test.md
|
|
33
|
+
└── lint.md
|
|
35
34
|
scripts/
|
|
36
35
|
├── claude-worktree-create.sh # WorktreeCreate hook wrapper
|
|
37
36
|
├── claude-worktree-remove.sh # WorktreeRemove hook wrapper
|
|
@@ -124,14 +123,11 @@ The `WorktreeCreate` hook **only fires for `claude --worktree` from the CLI**. T
|
|
|
124
123
|
|
|
125
124
|
Also: **`.claude/settings.json` changes only take effect after restarting Claude.** A running session keeps the old hook config. Tell the user to restart before testing.
|
|
126
125
|
|
|
127
|
-
##
|
|
126
|
+
## Custom Slash Commands as Actions (optional)
|
|
128
127
|
|
|
129
|
-
To expose standard
|
|
130
|
-
under `.agents/skills/<name>/SKILL.md`. Each skill tells the agent to run the
|
|
131
|
-
matching shared script or package-manager command.
|
|
128
|
+
Claude Code does not have a top-bar action menu. To expose the standard actions, write one file per action under `.claude/commands/`. Each is a tiny prompt that tells Claude to run the matching shared script or package-manager command.
|
|
132
129
|
|
|
133
|
-
See `examples/
|
|
134
|
-
`lint`).
|
|
130
|
+
See `examples/claude/commands/` for the four standard ones (`dev.md`, `typecheck.md`, `test.md`, `lint.md`).
|
|
135
131
|
|
|
136
132
|
## Guardrails
|
|
137
133
|
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Convex Worktree Backend
|
|
2
|
+
|
|
3
|
+
Load this reference only when the target project uses Convex and the user selected backend isolation, seeding, env cloning, or Convex codegen.
|
|
4
|
+
|
|
5
|
+
Convex worktree setup is project-specific. Prefer the target repo's existing scripts over generic snippets. If the repo is `thumbfa.st` or follows the same style, inspect `scripts/worktree-context.sh`, `scripts/worktree-setup.sh`, `scripts/worktree-cleanup.sh`, and `.codex/environments/environment.toml` before editing; they show a useful pattern for isolated Convex deployments, env sync, auth cookie isolation, codegen, and cleanup.
|
|
6
|
+
|
|
7
|
+
## First Decision
|
|
8
|
+
|
|
9
|
+
Ask or infer which Convex mode the project should use:
|
|
10
|
+
|
|
11
|
+
| Mode | Use when | Setup shape |
|
|
12
|
+
| :--- | :--- | :--- |
|
|
13
|
+
| Local deployment | The worktree can run fully local Convex state. | Create/select local deployment, keep data local, run `convex dev --local --once` or the repo's equivalent. |
|
|
14
|
+
| Cloud dev deployment | Each worktree needs an isolated Convex dev deployment. | Create/select `dev/<worktree-slug>`, clone safe env vars, push schema/functions, seed selected data. |
|
|
15
|
+
| Existing deployment | The team wants to reuse the source checkout's selected deployment. | Copy env files and avoid destructive reset/import steps. |
|
|
16
|
+
|
|
17
|
+
Do not assume one mode globally. Convex projects vary a lot.
|
|
18
|
+
|
|
19
|
+
## Table Seeding Policy
|
|
20
|
+
|
|
21
|
+
Fresh worktrees usually need enough data to log in, select an organization, exercise billing/credits, and test the product workflow. They do not need a full copy of analytics, logs, generated outputs, webhook history, background jobs, embeddings, message transcripts, file storage, or other heavy/derived tables.
|
|
22
|
+
|
|
23
|
+
Before writing Convex seed code:
|
|
24
|
+
|
|
25
|
+
1. Inspect `convex/schema.ts` and nearby feature code.
|
|
26
|
+
2. Ask which tables are important enough to seed.
|
|
27
|
+
3. If the user does not know, propose a small allowlist. Default to core identity, org, billing, settings, and product fixture tables.
|
|
28
|
+
4. Read `examples/scripts/convex-selective-seed.sh` and adapt it to the repo.
|
|
29
|
+
|
|
30
|
+
Use this policy when adding Convex data copy:
|
|
31
|
+
|
|
32
|
+
- Require a small `CONVEX_IMPORT_TABLES` allowlist in the generated script or a project-specific helper.
|
|
33
|
+
- Prefer committed seed fixtures or a project helper that exports only those tables to JSONL/JSON.
|
|
34
|
+
- Import one table at a time with `npx convex import --table "$table" "$path"`.
|
|
35
|
+
- Do not use a broad `npx convex export` / `npx convex import --replace-all` as the default setup path. It is a project-specific choice, not the generic safe default.
|
|
36
|
+
- Do not include `_storage` unless the user explicitly says file storage is required for the workflow.
|
|
37
|
+
- If relationships require stable document IDs across tables, document that targeted imports may regenerate IDs and prefer a purpose-built seed mutation/helper over partial backup editing.
|
|
38
|
+
|
|
39
|
+
## Selective Seed Shape
|
|
40
|
+
|
|
41
|
+
Adapt table names, deployment flags, and seed paths to the repo:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Convex selected-table seed. Keep this list short and project-specific.
|
|
45
|
+
CONVEX_IMPORT_DEPLOYMENT="${CONVEX_IMPORT_DEPLOYMENT:-dev}"
|
|
46
|
+
CONVEX_IMPORT_DIR="${CONVEX_IMPORT_DIR:-$SOURCE_PATH/.worktree-seed/convex}"
|
|
47
|
+
CONVEX_IMPORT_TABLES=(
|
|
48
|
+
users
|
|
49
|
+
organizations
|
|
50
|
+
organizationMembers
|
|
51
|
+
subscriptions
|
|
52
|
+
credits
|
|
53
|
+
settings
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
assert_non_prod_ref "$CONVEX_IMPORT_DEPLOYMENT"
|
|
57
|
+
|
|
58
|
+
convex_import_flags=()
|
|
59
|
+
case "$CONVEX_IMPORT_DEPLOYMENT" in
|
|
60
|
+
dev)
|
|
61
|
+
;;
|
|
62
|
+
preview:*)
|
|
63
|
+
convex_import_flags=(--preview-name "${CONVEX_IMPORT_DEPLOYMENT#preview:}")
|
|
64
|
+
;;
|
|
65
|
+
*)
|
|
66
|
+
echo "unknown Convex import target '$CONVEX_IMPORT_DEPLOYMENT'; use dev or preview:<name>" >&2
|
|
67
|
+
exit 1
|
|
68
|
+
;;
|
|
69
|
+
esac
|
|
70
|
+
|
|
71
|
+
if [[ -d "$CONVEX_IMPORT_DIR" ]]; then
|
|
72
|
+
for table in "${CONVEX_IMPORT_TABLES[@]}"; do
|
|
73
|
+
seed_file="$CONVEX_IMPORT_DIR/$table.jsonl"
|
|
74
|
+
if [[ -f "$seed_file" ]]; then
|
|
75
|
+
npx convex import "${convex_import_flags[@]}" --replace --table "$table" "$seed_file"
|
|
76
|
+
echo "seeded Convex table: $table"
|
|
77
|
+
else
|
|
78
|
+
echo "skipped Convex table without seed file: $table"
|
|
79
|
+
fi
|
|
80
|
+
done
|
|
81
|
+
else
|
|
82
|
+
echo "no Convex seed directory at $CONVEX_IMPORT_DIR, skipping selected-table seed"
|
|
83
|
+
fi
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Cloud Dev Deployment Pattern
|
|
87
|
+
|
|
88
|
+
When using isolated cloud dev deployments, generate or adapt helper functions instead of cramming everything into one giant script:
|
|
89
|
+
|
|
90
|
+
- Resolve worktree path, source tree, workspace slug, and deployment ref in a small helper such as `scripts/worktree-context.sh`.
|
|
91
|
+
- Use a deterministic dev deployment ref such as `dev/<worktree-slug>`, unless the user provides one.
|
|
92
|
+
- Reject production-looking refs before exports, imports, env cloning, or cleanup.
|
|
93
|
+
- Clone only safe env vars from the source dev deployment. If the project has a helper like `scripts/convex-sync-env.sh`, use it.
|
|
94
|
+
- Set worktree-specific auth/cookie/session prefixes when the app uses Better Auth or similar auth middleware.
|
|
95
|
+
- Push schema/functions with the repo's normal command, often `pnpm exec convex dev --once`.
|
|
96
|
+
- Run `pnpm exec convex codegen` or the repo's codegen command after deployment selection.
|
|
97
|
+
|
|
98
|
+
Thumbfa.st is a good local example of this shape: it resolves context in `scripts/worktree-context.sh`, creates/selects a Convex dev deployment in setup, syncs env, sets an auth cookie prefix, pushes Convex, generates code, and cleans local Convex state/env vars in cleanup. Borrow the structure, not every destructive command.
|
|
99
|
+
|
|
100
|
+
## Cleanup
|
|
101
|
+
|
|
102
|
+
Cleanup should only remove resources that the setup script created or selected explicitly.
|
|
103
|
+
|
|
104
|
+
Typical cleanup:
|
|
105
|
+
|
|
106
|
+
- Remove worktree-specific Convex env vars only for deterministic worktree deployment refs such as `dev/<slug>`.
|
|
107
|
+
- Remove local `.convex` state only if the user did not request keeping it.
|
|
108
|
+
- Remove copied env files after cleanup work is done.
|
|
109
|
+
- Never remove or mutate production deployments.
|
|
110
|
+
|
|
111
|
+
If the project creates cloud dev deployments and the Convex CLI supports deleting them in the current version, use researcher agents to verify the exact command and prompts before adding deletion. Otherwise leave deployment deletion manual and make cleanup idempotent.
|
|
112
|
+
|
|
113
|
+
## Guardrails
|
|
114
|
+
|
|
115
|
+
- Never import into or export from production by default.
|
|
116
|
+
- Never copy every table just because the CLI supports full deployment backups.
|
|
117
|
+
- Never log Convex deployment admin keys, auth secrets, webhooks, or API keys.
|
|
118
|
+
- Keep setup non-interactive: set `CI=1` from wrappers where possible and use explicit CLI flags.
|
|
119
|
+
- Keep reset explicit, for example `CONVEX_WORKTREE_RESET_DATA=1`.
|
|
120
|
+
- Prefer project helpers over generic snippets when they already exist.
|
|
@@ -14,7 +14,7 @@ Three setup keys are supported (Cursor picks the first one that matches the host
|
|
|
14
14
|
|
|
15
15
|
Cursor does **not** support a cleanup script. Cleanup is timer-based via global settings (`cursor.worktreeCleanupIntervalHours`, `cursor.worktreeMaxCount`). To get a real cleanup hook, expose `scripts/worktree-down.sh` as a project command the user runs manually before `/delete-worktree`.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Built-in worktree slash commands the user already has: `/worktree`, `/best-of-n`, `/apply-worktree`, `/delete-worktree`.
|
|
18
18
|
|
|
19
19
|
## Environment Variables
|
|
20
20
|
|
|
@@ -72,7 +72,7 @@ Inline is fine for two-line setups. For anything more, use a script - the worktr
|
|
|
72
72
|
|
|
73
73
|
- Do not put fragile multi-line setup inline. If it does not fit in two clean array entries, call the script.
|
|
74
74
|
- Do not put `.cursor/worktrees.json` only in a worktree - it must be on the source checkout / main branch so future worktrees pick it up.
|
|
75
|
-
- Do not rely on a cleanup hook - Cursor does not have one. Tell the user to run `scripts/worktree-down.sh` before
|
|
75
|
+
- Do not rely on a cleanup hook - Cursor does not have one. Tell the user to run `scripts/worktree-down.sh` before `/delete-worktree`, or document it in the project README.
|
|
76
76
|
- Do not use `$CURSOR_WORKTREE_PATH` - that variable is not documented and not guaranteed. Use `pwd` inside the worktree.
|
|
77
77
|
|
|
78
78
|
## Verification
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# PostgreSQL Worktree Backend
|
|
2
|
+
|
|
3
|
+
Load this reference only when the target project uses PostgreSQL and the user selected backend isolation or cleanup.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
Create a worktree-specific PostgreSQL database, rewrite only local env values to point at it, run the project's schema/codegen steps, and drop only that database during cleanup.
|
|
8
|
+
|
|
9
|
+
Do not use this reference for other SQL engines by analogy. For MySQL, SQLite, Turso/libSQL, Neon branching, Supabase branching, PlanetScale, MongoDB, Redis, or any other backend, use researcher agents to inspect official docs and the repo's existing scripts before writing backend setup.
|
|
10
|
+
|
|
11
|
+
## `scripts/worktree-up.sh` Additions
|
|
12
|
+
|
|
13
|
+
Add this block after env copying and dependency install. Adapt the prefix, env vars, schema commands, and reset env var to the project.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# PostgreSQL worktree-isolated database.
|
|
17
|
+
worktree_slug="$(basename "$WORKTREE_PATH" | tr '/' '-' | tr '[:upper:]' '[:lower:]')"
|
|
18
|
+
db_name="<project>_${worktree_slug}"
|
|
19
|
+
|
|
20
|
+
if [[ -f .env ]]; then
|
|
21
|
+
if grep -qE '^DATABASE_URL=' .env; then
|
|
22
|
+
# Replace PROJECT_RESET_DB with a project-specific env var, e.g. MYAPP_RESET_DB.
|
|
23
|
+
if [[ "${PROJECT_RESET_DB:-0}" == "1" ]] && command -v dropdb >/dev/null 2>&1; then
|
|
24
|
+
dropdb --if-exists -d postgres "$db_name" || true
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
if command -v createdb >/dev/null 2>&1; then
|
|
28
|
+
createdb -d postgres "$db_name" 2>/dev/null || true
|
|
29
|
+
else
|
|
30
|
+
echo "createdb not found; skipped PostgreSQL database creation"
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Rewrite only the DB name in DATABASE_URL.
|
|
34
|
+
sed -i.bak -E "s|(DATABASE_URL=postgres://[^/]+)/[^?\"']+|\1/${db_name}|" .env && rm -f .env.bak
|
|
35
|
+
echo "PostgreSQL DB set to $db_name"
|
|
36
|
+
fi
|
|
37
|
+
fi
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
If the project uses `postgresql://`, multiple database env vars, SSL params, pooled URLs, direct URLs, or a hosted provider URL format, inspect existing env conventions and adjust carefully. Do not log secrets.
|
|
41
|
+
|
|
42
|
+
## Schema and Seed
|
|
43
|
+
|
|
44
|
+
Run only project-local schema steps after the URL rewrite. Examples:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
if [[ -f prisma/schema.prisma ]]; then
|
|
48
|
+
pnpm prisma generate
|
|
49
|
+
pnpm prisma db push
|
|
50
|
+
fi
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
if [[ -f drizzle.config.ts ]]; then
|
|
55
|
+
pnpm drizzle-kit push
|
|
56
|
+
fi
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Use project seed commands only when the user selected seeding or the repo already treats them as required for local startup.
|
|
60
|
+
|
|
61
|
+
## `scripts/worktree-down.sh` Additions
|
|
62
|
+
|
|
63
|
+
Read the database name from the worktree env file. Never derive it from the branch or worktree path during cleanup.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
if [[ ! -f .env ]]; then
|
|
67
|
+
echo "no .env in worktree, nothing to clean"
|
|
68
|
+
exit 0
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
db_name="$(grep -E '^DATABASE_URL=' .env | sed -E 's|.*/([^/?]+).*|\1|' | head -n1 || true)"
|
|
72
|
+
|
|
73
|
+
if [[ -n "${db_name:-}" ]] && command -v dropdb >/dev/null 2>&1; then
|
|
74
|
+
dropdb --if-exists -d postgres "$db_name" || true
|
|
75
|
+
echo "dropped PostgreSQL DB $db_name"
|
|
76
|
+
else
|
|
77
|
+
echo "no PostgreSQL DB cleanup performed"
|
|
78
|
+
fi
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Remove copied env files only after cleanup has read the values it needs.
|
|
82
|
+
|
|
83
|
+
## Guardrails
|
|
84
|
+
|
|
85
|
+
- Never drop a database whose name was guessed from a branch.
|
|
86
|
+
- Never print full `DATABASE_URL` values.
|
|
87
|
+
- Keep reset explicit: `<PROJECT>_RESET_DB=1`.
|
|
88
|
+
- Prefer idempotent schema commands for setup.
|
|
89
|
+
- If database creation requires a hosted provider CLI or branching API, stop using this local PostgreSQL reference and research that provider directly.
|
|
@@ -1,56 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oneshot
|
|
3
|
-
description:
|
|
3
|
+
description: Implement one focused code change quickly with minimal exploration and targeted validation. Use for small bug fixes, single feature edits, config updates, or explicit "$oneshot" requests.
|
|
4
4
|
argument-hint: <feature-description>
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# OneShot
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use this for one narrow implementation task. Optimize for the shortest reliable path to a working, verified change.
|
|
10
10
|
|
|
11
11
|
## Workflow
|
|
12
12
|
|
|
13
|
-
### 1.
|
|
13
|
+
### 1. Scope
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
- Quick `WebSearch` only if library-specific API knowledge needed
|
|
19
|
-
- NO exploration tours - find examples/edit targets and move on
|
|
15
|
+
- Identify the exact target and likely files with `rg` / `rg --files`.
|
|
16
|
+
- Read only the files needed to edit safely, usually 2-5 plus nearby examples.
|
|
17
|
+
- Look up docs only when API, version, or current behavior may be stale.
|
|
20
18
|
|
|
21
|
-
### 2.
|
|
19
|
+
### 2. Implement
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- NO comments unless genuinely complex
|
|
28
|
-
- NO refactoring beyond requirements
|
|
29
|
-
- Run formatters if available (`npm run format`)
|
|
21
|
+
- Edit as soon as the existing pattern is clear.
|
|
22
|
+
- Keep the diff minimal and local to the request.
|
|
23
|
+
- Do not refactor, rename, redesign, rewrite docs, or clean adjacent code unless required.
|
|
24
|
+
- Prefer existing helpers, conventions, and package scripts.
|
|
30
25
|
|
|
31
|
-
### 3.
|
|
26
|
+
### 3. Validate
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
- NO full test suite unless explicitly requested
|
|
28
|
+
- Run the smallest meaningful checks: targeted tests, touched-package lint/typecheck, and formatter when expected.
|
|
29
|
+
- If a check fails, fix only failures caused by this change and rerun.
|
|
30
|
+
- Run broader checks only for shared/high-risk code or when the user asks.
|
|
37
31
|
|
|
38
|
-
##
|
|
32
|
+
## Stop Rules
|
|
39
33
|
|
|
40
|
-
|
|
34
|
+
- Do not expand into adjacent improvements.
|
|
35
|
+
- Ask only when a missing decision blocks safe implementation.
|
|
36
|
+
- If blocked after two concrete attempts, report the blocker, evidence, and the next exact option.
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
## Done
|
|
38
|
+
## Final Response
|
|
44
39
|
|
|
45
|
-
|
|
46
|
-
**Files changed:** {list}
|
|
47
|
-
**Validation:** ✓ lint ✓ typecheck
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Constraints
|
|
51
|
-
|
|
52
|
-
- ONE task only - no tangential improvements
|
|
53
|
-
- NO documentation files unless requested
|
|
54
|
-
- NO refactoring outside immediate scope
|
|
55
|
-
- NO "while I'm here" additions
|
|
56
|
-
- If stuck >2 attempts: report blocker and stop
|
|
40
|
+
Report changed files, validation commands/results, and any skipped checks with reason.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rules-manager
|
|
3
|
-
description: Create and maintain
|
|
4
|
-
argument-hint: "[init | add <rule-name> | optimize | task description]"
|
|
3
|
+
description: Create, edit, and maintain AGENTS.md and .agents/rules/ — tech stack, commands, universal rules, rule index, and rule files. Use to add, modify, restructure, or optimize project rules, conventions, and constraints.
|
|
4
|
+
argument-hint: "[init | add <rule-name> | edit | optimize | task description]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<core_principle>
|
|
@@ -146,6 +146,17 @@ When the argument starts with `add`:
|
|
|
146
146
|
|
|
147
147
|
**CRITICAL:** Step 5 is non-negotiable. A rule file without an index entry is invisible.
|
|
148
148
|
|
|
149
|
+
## `/rules-manager edit` - Modify AGENTS.md directly
|
|
150
|
+
|
|
151
|
+
When the user wants to change AGENTS.md itself rather than add a rule file — update the tech stack, commands, universal rules, project description, or restructure sections:
|
|
152
|
+
|
|
153
|
+
1. **Read AGENTS.md** - Load current content.
|
|
154
|
+
2. **Make the targeted edit in place** - Change only the relevant section; leave unrelated sections untouched.
|
|
155
|
+
3. **Preserve the index** - If touching `## Rules`, keep every `.agents/rules/*.md` link intact.
|
|
156
|
+
4. **Stay minimal** - Apply `<writing_rules>`: specific, prohibitions over guidance, no bloat.
|
|
157
|
+
|
|
158
|
+
This is the default when the user references AGENTS.md content (not a rule file) — e.g. "add a command to AGENTS.md", "update the tech stack", "tighten the universal rules".
|
|
159
|
+
|
|
149
160
|
## `/rules-manager optimize` - Audit and clean up
|
|
150
161
|
|
|
151
162
|
When the argument contains `optimize`:
|
|
@@ -177,11 +188,13 @@ When the argument is a free-form task (e.g., "add a rule about how we tag releas
|
|
|
177
188
|
|
|
178
189
|
<rules_for_this_skill>
|
|
179
190
|
|
|
191
|
+
- This skill manages ALL of AGENTS.md (tech stack, commands, universal rules, index, description) and `.agents/rules/` — not just creating new rule files. Editing existing AGENTS.md content is fully in scope.
|
|
180
192
|
- ALWAYS update AGENTS.md `## Rules` index when creating a file in `.agents/rules/`
|
|
181
193
|
- NEVER create a rule file without confirming with the user what it should contain
|
|
182
194
|
- NEVER overwrite existing AGENTS.md or rule files without asking
|
|
183
195
|
- Default to short rule files (20-60 lines). Split if larger.
|
|
184
196
|
- When user asks "create a rule", default to creating a file in `.agents/rules/` (not inline in AGENTS.md), unless the rule is 1-2 lines and fits the universal section.
|
|
197
|
+
- When the user references AGENTS.md content directly (a command, the stack, a universal rule), edit AGENTS.md in place via the `edit` workflow — don't spin up a new rule file.
|
|
185
198
|
</rules_for_this_skill>
|
|
186
199
|
|
|
187
200
|
<reference_guides>
|
|
@@ -44,6 +44,17 @@ Three loading levels:
|
|
|
44
44
|
|
|
45
45
|
Keep references one level deep. Reference them by name in SKILL.md so the agent knows when to open them.
|
|
46
46
|
|
|
47
|
+
### Online research routing
|
|
48
|
+
|
|
49
|
+
When a skill or agent needs online research, name the exact research skill to use instead of relying on vague web-search language:
|
|
50
|
+
|
|
51
|
+
- Use `/Users/melvynx/.agents/skills/find-docs/SKILL.md` for current technical documentation, API references, config options, SDKs, CLIs, cloud services, and code examples.
|
|
52
|
+
- Use `/Users/melvynx/.agents/skills/exa-search/SKILL.md` for broader online research, recent information, source discovery, similar pages, URL extraction, or cited web answers.
|
|
53
|
+
- Mention default harness tools for local code, file, git, shell, and browser inspection.
|
|
54
|
+
- Keep built-in `WebSearch` and `WebFetch` as fallback tools unless the user explicitly asks for them.
|
|
55
|
+
- For restricted agents, include `Skill` and `Bash` in the tool list when these skills need to run local CLIs.
|
|
56
|
+
- Never put secrets, tokens, credentials, personal data, or proprietary code in external queries.
|
|
57
|
+
|
|
47
58
|
### Skill anatomy
|
|
48
59
|
|
|
49
60
|
```
|
|
@@ -94,8 +105,25 @@ For researched guidance and examples, see [references/description-recommandation
|
|
|
94
105
|
|
|
95
106
|
## Where each platform stores skills
|
|
96
107
|
|
|
108
|
+
**Canonical personal skills:** `~/.agents/skills/` is the single source of truth (git repo `Melvynx/agents-config`). It is an official user-level root for both Cursor and Codex, so they read it directly. Write new personal skills only under `~/.agents/skills/<name>/`.
|
|
109
|
+
|
|
110
|
+
Per the official Cursor docs ([cursor.com/docs/skills](https://cursor.com/docs/skills)), user-level roots are `~/.agents/skills/` and `~/.cursor/skills/`, plus compat dirs `~/.claude/skills/` and `~/.codex/skills/`. `~/.cursor/skills-cursor/` is NOT a documented path; do not use it.
|
|
111
|
+
|
|
112
|
+
Because `~/.agents/skills/` is read directly, the only symlinks needed are the compat dirs for agents that do not read `~/.agents/skills/` themselves:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
~/.claude/skills -> ~/.agents/skills # Claude Code reads ~/.claude/skills
|
|
116
|
+
~/.codex/skills -> ~/.agents/skills # Codex compat (optional; Codex also reads ~/.agents/skills)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Do NOT symlink `~/.cursor/skills` or `~/.cursor/skills-cursor` to `~/.agents/skills/`; that makes Cursor scan the same skills two or three times. To repair the compat symlinks if missing:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
ln -s ~/.agents/skills ~/.claude/skills
|
|
123
|
+
```
|
|
124
|
+
|
|
97
125
|
See the per-platform reference files. Quick reminders:
|
|
98
126
|
|
|
99
|
-
- **
|
|
127
|
+
- **Cursor**: reads `~/.agents/skills/` and `~/.cursor/skills/` (user-level), `.agents/skills/` and `.cursor/skills/` (project). Use `~/.agents/skills/` as the single root; skip the `~/.cursor/skills*` symlinks.
|
|
128
|
+
- **Claude Code**: `~/.claude/skills/` (symlink → `~/.agents/skills/`) or `.claude/skills/` (project). Higher scope wins on name collision.
|
|
100
129
|
- **Codex**: `.agents/skills/` walks up from CWD to repo root, then `~/.agents/skills/`, then `/etc/codex/skills`, then system bundled.
|
|
101
|
-
- **Cursor**: `.cursor/rules/` (project, version-controlled) or `AGENTS.md` files in project subdirectories.
|
|
@@ -25,7 +25,7 @@ Take a deep breath. We're not here to write code. We're here to make a dent in t
|
|
|
25
25
|
|
|
26
26
|
## Your Tools Are Instruments
|
|
27
27
|
|
|
28
|
-
- Use bash tools, MCP servers, and
|
|
28
|
+
- Use bash tools, MCP servers, and custom commands like a virtuoso
|
|
29
29
|
- Git history tells the story—read it, learn from it, honor it
|
|
30
30
|
- Multiple Claude instances aren't redundancy—they're collaboration between perspectives
|
|
31
31
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: use-fable
|
|
3
|
+
description: "Orchestrator mode for Fable: Fable thinks, plans, and reviews while Codex CLI and subagents execute all heavy work. Use when the user invokes /use-fable, says 'use fable', 'fable mode', 'orchestrator mode', or wants to save Fable tokens/rate limits."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Use Fable
|
|
7
|
+
|
|
8
|
+
Fable is the thinker, never the typist. Its tokens are scarce and expensive; Codex (GPT-5.5) is effectively free and highly steerable. In this mode, Fable's job is deciding **what** to do and judging **whether it was done well** — everything token-hungry runs elsewhere and reports back.
|
|
9
|
+
|
|
10
|
+
Model rankings, Codex mechanics, and effort settings live in `~/.claude/rules/models.md` (already in context). This skill is the enforcement layer.
|
|
11
|
+
|
|
12
|
+
## Core rule
|
|
13
|
+
|
|
14
|
+
Fable does not execute. Fable may: read a few targeted files, search, inspect git state, think, plan, decompose, write specs and delegation prompts, review diffs and reports, judge outputs, and talk to the user.
|
|
15
|
+
|
|
16
|
+
Fable must NOT directly do:
|
|
17
|
+
|
|
18
|
+
- Implementation, refactors, migrations, test writing (any multi-file or >~15-line change)
|
|
19
|
+
- Codebase-wide exploration or analysis (reading many files to "understand")
|
|
20
|
+
- Computer use, browser automation, UI/UX verification
|
|
21
|
+
- Log triage, data analysis, bulk mechanical edits
|
|
22
|
+
- Running long build/test loops and reading their full output
|
|
23
|
+
|
|
24
|
+
The only direct edits allowed: trivial single-file tweaks (a config value, a typo, a one-liner) where writing a delegation prompt would cost more than the edit itself.
|
|
25
|
+
|
|
26
|
+
## Who executes what
|
|
27
|
+
|
|
28
|
+
| Task | Executor |
|
|
29
|
+
|------|----------|
|
|
30
|
+
| Well-spec'd implementation, refactors, migrations, bulk edits | Codex: `codex exec "<prompt>"` |
|
|
31
|
+
| Investigation, codebase analysis, log/data triage (no writes) | Codex: `codex exec -s read-only "<prompt>"` |
|
|
32
|
+
| Computer use, UI/UX verification, browser checks | Codex (way better at it) or `verifier`/`dev-browser` subagent |
|
|
33
|
+
| Codebase exploration to inform a plan | `Explore` or `explore-fast` subagent — Fable reads the summary, not the files |
|
|
34
|
+
| User-facing taste work (UI, copy, API design) | Claude subagent with `model: "opus"` |
|
|
35
|
+
| Plan/implementation review | Fable itself (its core job), optionally + Codex as second perspective |
|
|
36
|
+
| Inside a Workflow | thin `sonnet`/`effort: low` wrapper agent that runs `codex exec` via Bash and returns output verbatim |
|
|
37
|
+
|
|
38
|
+
Claude subagents always get `model: "opus"` unless the wrapper-for-Codex pattern applies. Never Haiku.
|
|
39
|
+
|
|
40
|
+
## The loop
|
|
41
|
+
|
|
42
|
+
1. **Think.** Understand the request. If context is missing, delegate the exploration (don't read the codebase yourself) and think on the summaries.
|
|
43
|
+
2. **Spec.** Write a self-contained delegation prompt: exact files, goal, constraints, and what "done" looks like (tests pass, lint clean, behavior X). Codex can't see this conversation — spell everything out. See `/codex:gpt-5-4-prompting` for hard cases.
|
|
44
|
+
3. **Delegate.** Fire independent tasks in parallel (multiple `codex exec` in background, or multiple subagents in one message). Stay available to steer.
|
|
45
|
+
4. **Verify.** Delegate verification too — Codex read-only pass, test run, or `verifier` agent. Fable reads the report and the diff, not the whole tree.
|
|
46
|
+
5. **Judge.** If the output misses the bar: refine the spec and re-delegate (Codex is steerable — better prompts beat manual fixes), or escalate to an opus subagent for taste-sensitive work. Do not "just fix it quickly" yourself — that's how the mode dies.
|
|
47
|
+
|
|
48
|
+
## Delegation prompt checklist (for Codex)
|
|
49
|
+
|
|
50
|
+
- Names exact files/paths and the repo root
|
|
51
|
+
- States the goal in one sentence, then constraints (style, deletion safety: `trash` not `rm -rf`, no scope creep)
|
|
52
|
+
- Defines done: commands to run, expected results
|
|
53
|
+
- Asks for a report: changed files, what was done, tests run, risks
|
|
54
|
+
- Non-git/untrusted dir → add `--skip-git-repo-check`
|
|
55
|
+
|
|
56
|
+
## Anti-patterns
|
|
57
|
+
|
|
58
|
+
- "It's faster if I just do it" — for anything beyond a trivial tweak, it isn't: it burns the budget the whole session depends on.
|
|
59
|
+
- Reading 10 files to plan — delegate exploration, plan from the summary.
|
|
60
|
+
- Fixing Codex's output by hand — refine the prompt and rerun instead.
|
|
61
|
+
- Serializing independent delegations — parallelize.
|
|
62
|
+
- Verifying UI by taking screenshots yourself — Codex does computer use and UI verification better and cheaper.
|
|
63
|
+
|
|
64
|
+
If no delegation path works (Codex unavailable, Bash denied), say so explicitly and ask the user before falling back to direct execution — never silently drop out of the mode.
|