aiblueprint-cli 1.4.45 → 1.4.48
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/{claude-code-config → ai-config}/.claude-plugin/plugin.json +2 -2
- package/ai-config/scripts/CLAUDE.md +31 -0
- package/{claude-code-config → ai-config}/scripts/package.json +1 -8
- package/ai-config/skills/codex-environment/SKILL.md +182 -0
- package/dist/cli.js +933 -767
- package/package.json +2 -2
- package/claude-code-config/hooks/hooks.json +0 -15
- package/claude-code-config/scripts/CLAUDE.md +0 -50
- package/claude-code-config/scripts/command-validator/CLAUDE.md +0 -112
- package/claude-code-config/scripts/command-validator/README.md +0 -147
- package/claude-code-config/scripts/command-validator/src/__tests__/validator.test.ts +0 -99
- package/claude-code-config/scripts/command-validator/src/cli.ts +0 -120
- package/claude-code-config/scripts/command-validator/src/lib/security-rules.ts +0 -174
- package/claude-code-config/scripts/command-validator/src/lib/types.ts +0 -34
- package/claude-code-config/scripts/command-validator/src/lib/validator.ts +0 -90
- package/claude-code-config/song/finish.mp3 +0 -0
- package/claude-code-config/song/need-human.mp3 +0 -0
- /package/{claude-code-config → ai-config}/agents/action.md +0 -0
- /package/{claude-code-config → ai-config}/agents/explore-codebase.md +0 -0
- /package/{claude-code-config → ai-config}/agents/explore-docs.md +0 -0
- /package/{claude-code-config → ai-config}/agents/websearch.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/.claude/commands/fix-on-my-computer.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/biome.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/bun.lockb +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/CLAUDE.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/README.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/__tests__/context.test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/__tests__/formatters.test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/__tests__/statusline.test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/data/.gitignore +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/data/.gitkeep +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/defaults.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/docs/ARCHITECTURE.md +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/fixtures/mock-transcript.jsonl +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/fixtures/test-input.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/index.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/config-types.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/config.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/context.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/formatters.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/git.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/menu-factories.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/presets.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/render-pure.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/types.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/lib/utils.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/src/tests/spend-v2.test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/statusline.config.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/test-with-fixtures.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/test.ts +0 -0
- /package/{claude-code-config → ai-config}/scripts/statusline/tsconfig.json +0 -0
- /package/{claude-code-config → ai-config}/scripts/tsconfig.json +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/scripts/setup-templates.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/scripts/update-progress.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-00-init.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-00b-branch.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-00b-economy.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-00b-interactive.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-01-analyze.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-02-plan.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-03-execute.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/steps/step-04-validate.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/00-context.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/01-analyze.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/02-plan.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/03-execute.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/04-validate.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/README.md +0 -0
- /package/{claude-code-config → ai-config}/skills/apex/templates/step-complete.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/comprehensive-example.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/optimize-guide.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/project-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/prompting-techniques.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/rules-directory-guide.md +0 -0
- /package/{claude-code-config → ai-config}/skills/claude-memory/references/section-templates.md +0 -0
- /package/{claude-code-config → ai-config}/skills/commit/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/create-pr/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/fix-errors/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/fix-grammar/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/fix-pr-comments/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/merge/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/oneshot/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/anthropic-best-practices.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/anti-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/clarity-principles.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/context-management.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/few-shot-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/openai-best-practices.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/prompt-templates.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/reasoning-techniques.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/system-prompt-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/prompt-creator/references/xml-structure.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/scripts/setup.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/steps/step-00-init.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/steps/step-01-interactive-prd.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/steps/step-02-create-stories.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ralph-loop/steps/step-03-finish.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/LICENSE.txt +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/package.json +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/output-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/progressive-disclosure-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/prompting-integration.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/real-world-examples.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/script-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/workflows.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/references/xml-tag-guide.md +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/scripts/init-skill.ts +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/scripts/package-skill.ts +0 -0
- /package/{claude-code-config → ai-config}/skills/skill-creator/scripts/validate.ts +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/context-management.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/debugging-agents.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/error-handling-and-recovery.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/evaluation-and-testing.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/orchestration-patterns.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/subagents.md +0 -0
- /package/{claude-code-config → ai-config}/skills/subagent-creator/references/writing-subagent-prompts.md +0 -0
- /package/{claude-code-config → ai-config}/skills/ultrathink/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/SKILL.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/scripts/setup-templates.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/scripts/update-progress.sh +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00-init.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00b-branch.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00b-economy.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-00b-interactive.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-01-analyze.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-02-plan.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-03-execute.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/steps/step-04-validate.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/00-context.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/01-analyze.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/02-plan.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/03-execute.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/04-validate.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/README.md +0 -0
- /package/{claude-code-config → ai-config}/skills/workflow-apex-free/templates/step-complete.md +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aibp-base",
|
|
3
3
|
"version": "1.0.1",
|
|
4
|
-
"description": "AIBlueprint base configuration with custom agents, slash commands,
|
|
4
|
+
"description": "AIBlueprint base configuration with custom agents, slash commands, skills, and productivity workflows for Claude Code",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Melvyn",
|
|
7
7
|
"url": "https://github.com/melvynx"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"productivity",
|
|
16
16
|
"agents",
|
|
17
17
|
"commands",
|
|
18
|
-
"
|
|
18
|
+
"skills",
|
|
19
19
|
"workflows",
|
|
20
20
|
"statusline"
|
|
21
21
|
],
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Scripts - Project Memory
|
|
2
|
+
|
|
3
|
+
Houses the statusline script for Claude Code.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
scripts/
|
|
9
|
+
├── statusline/ # Custom statusline for Claude Code
|
|
10
|
+
└── package.json # Root package
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun run test # Run statusline tests
|
|
17
|
+
bun run lint # Lint
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Per-Package Commands
|
|
21
|
+
|
|
22
|
+
| Package | Test | Start |
|
|
23
|
+
|---------|------|-------|
|
|
24
|
+
| statusline | `bun run statusline:test` | `bun run statusline:start` |
|
|
25
|
+
|
|
26
|
+
## Cross-Platform Support
|
|
27
|
+
|
|
28
|
+
The statusline supports macOS, Linux, and Windows (via WSL):
|
|
29
|
+
- Use `path.join()` instead of string concatenation
|
|
30
|
+
- Use `os.homedir()` instead of `process.env.HOME`
|
|
31
|
+
- Use `path.sep` or regex `[/\\]` for path splitting
|
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
"name": "scripts",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"test": "bun test
|
|
6
|
-
"auto-rename:start": "bun auto-rename-session/src/index.ts",
|
|
7
|
-
"auto-rename:rename-all": "bun auto-rename-session/src/rename-all.ts",
|
|
8
|
-
"auto-rename:test": "bun test auto-rename-session",
|
|
9
|
-
"validator:cli": "bun command-validator/src/cli.ts",
|
|
10
|
-
"validator:test": "bun test command-validator",
|
|
11
|
-
"validator:lint": "biome check --write command-validator",
|
|
12
|
-
"ai:test": "bun test claude-code-ai",
|
|
5
|
+
"test": "bun test statusline",
|
|
13
6
|
"statusline:start": "bun statusline/src/index.ts",
|
|
14
7
|
"statusline:test-fixtures": "bun statusline/test-with-fixtures.ts",
|
|
15
8
|
"statusline:test": "bun test statusline",
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-environment
|
|
3
|
+
description: Create, inspect, or repair Codex app Local Environment configuration for worktrees, including .codex/environments/environment.toml, setup and cleanup scripts, worktree up/down scripts, copied env files, isolated databases, and reusable app actions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codex Environment
|
|
7
|
+
|
|
8
|
+
Use this skill when the user asks about Codex Local Environments, worktree setup scripts, cleanup scripts, Codex actions, `.codex/environments/environment.toml`, `CODEX_WORKTREE_PATH`, `CODEX_SOURCE_TREE_PATH`, or making a worktree ready to run.
|
|
9
|
+
|
|
10
|
+
## What We Learned
|
|
11
|
+
|
|
12
|
+
- Codex app Local Environments are project config, not one-off terminal commands.
|
|
13
|
+
- The shareable config lives at `.codex/environments/environment.toml` at the project root.
|
|
14
|
+
- Setup scripts run when Codex creates a new worktree for a new thread.
|
|
15
|
+
- Cleanup scripts run before Codex cleans up the worktree.
|
|
16
|
+
- Actions appear in the Codex app top bar and run in the integrated terminal.
|
|
17
|
+
- Worktrees only contain checked-in files, so ignored files like `.env` must be copied or recreated by setup.
|
|
18
|
+
- Prefer short setup/cleanup entries that call versioned project scripts instead of long inline shell.
|
|
19
|
+
- Keep executable entrypoints in `scripts/`, for example `scripts/worktree-up` and `scripts/worktree-down`.
|
|
20
|
+
- Keep `.codex` focused on Codex config; keep operational logic in `scripts/`.
|
|
21
|
+
- Do not commit secrets. It is fine for setup to copy ignored env files locally.
|
|
22
|
+
- For projects with local databases, setup should create a worktree-specific DB name and rewrite the copied `.env` to point to it.
|
|
23
|
+
- Cleanup should drop only the worktree-specific databases and remove copied local env files.
|
|
24
|
+
- Use `CODEX_SOURCE_TREE_PATH` for the original project checkout and `CODEX_WORKTREE_PATH` for the new worktree when available.
|
|
25
|
+
|
|
26
|
+
## Preferred Shape
|
|
27
|
+
|
|
28
|
+
Create or update:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
.codex/
|
|
32
|
+
└── environments/
|
|
33
|
+
└── environment.toml
|
|
34
|
+
scripts/
|
|
35
|
+
├── worktree-up
|
|
36
|
+
├── worktree-down
|
|
37
|
+
├── codex-dev.sh
|
|
38
|
+
└── project-specific helpers...
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use this `environment.toml` pattern:
|
|
42
|
+
|
|
43
|
+
```toml
|
|
44
|
+
# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY
|
|
45
|
+
version = 1
|
|
46
|
+
name = "Project Worktree"
|
|
47
|
+
|
|
48
|
+
[setup]
|
|
49
|
+
script = "cd \"$CODEX_WORKTREE_PATH\"\nscripts/worktree-up"
|
|
50
|
+
|
|
51
|
+
[cleanup]
|
|
52
|
+
script = "cd \"$CODEX_WORKTREE_PATH\"\nscripts/worktree-down"
|
|
53
|
+
|
|
54
|
+
[[actions]]
|
|
55
|
+
name = "Dev"
|
|
56
|
+
icon = "tool"
|
|
57
|
+
command = "scripts/codex-dev.sh"
|
|
58
|
+
|
|
59
|
+
[[actions]]
|
|
60
|
+
name = "Typecheck"
|
|
61
|
+
icon = "tool"
|
|
62
|
+
command = "pnpm ts"
|
|
63
|
+
|
|
64
|
+
[[actions]]
|
|
65
|
+
name = "Unit tests"
|
|
66
|
+
icon = "tool"
|
|
67
|
+
command = "pnpm test:ci"
|
|
68
|
+
|
|
69
|
+
[[actions]]
|
|
70
|
+
name = "Lint"
|
|
71
|
+
icon = "tool"
|
|
72
|
+
command = "pnpm lint:ci"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Keep setup script content small:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
#!/usr/bin/env bash
|
|
79
|
+
set -euo pipefail
|
|
80
|
+
|
|
81
|
+
cd "${CODEX_WORKTREE_PATH:-$(pwd)}"
|
|
82
|
+
scripts/make-worktree-ready.sh
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Keep cleanup script content small:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
#!/usr/bin/env bash
|
|
89
|
+
set -euo pipefail
|
|
90
|
+
|
|
91
|
+
cd "${CODEX_WORKTREE_PATH:-$(pwd)}"
|
|
92
|
+
scripts/worktree-db-down.sh
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Setup Script Rules
|
|
96
|
+
|
|
97
|
+
When writing `scripts/worktree-up` or its helper:
|
|
98
|
+
|
|
99
|
+
- Start with `set -euo pipefail`.
|
|
100
|
+
- `cd "${CODEX_WORKTREE_PATH:-$(pwd)}"` before touching files.
|
|
101
|
+
- Locate the source checkout with `CODEX_SOURCE_TREE_PATH`, then a project-specific fallback like `$HOME/Developer/saas/<repo>`.
|
|
102
|
+
- Copy ignored env files from source to worktree, usually `.env`, `.env.local`, and `.env.development.local`.
|
|
103
|
+
- Prefer project package manager conventions, for example `pnpm install`, never `npm install` in a pnpm repo.
|
|
104
|
+
- Create a deterministic worktree DB name from the branch or target worktree, replacing `/` with `-`.
|
|
105
|
+
- Rewrite only DB-related env values in the copied `.env`.
|
|
106
|
+
- Run project generation steps needed after env setup, for example `pnpm prisma:generate`.
|
|
107
|
+
- Make reruns idempotent. If the DB already exists, skip import unless a reset env var is set.
|
|
108
|
+
- Add an explicit reset escape hatch such as `LUMAIL_RESET_DB=1`.
|
|
109
|
+
|
|
110
|
+
## Cleanup Script Rules
|
|
111
|
+
|
|
112
|
+
When writing `scripts/worktree-down` or its helper:
|
|
113
|
+
|
|
114
|
+
- Read DB names from the worktree `.env`, not from guessed branch names.
|
|
115
|
+
- Drop only the DBs referenced by the worktree env.
|
|
116
|
+
- Use `dropdb --if-exists` and a maintenance database.
|
|
117
|
+
- Remove copied local env files from the worktree after DB cleanup.
|
|
118
|
+
- If env files or PostgreSQL tools are missing, exit cleanly with a short message.
|
|
119
|
+
|
|
120
|
+
## Actions
|
|
121
|
+
|
|
122
|
+
Use actions for commands the user will run often:
|
|
123
|
+
|
|
124
|
+
- `Dev`: start the app, ideally via a script that finds a free port.
|
|
125
|
+
- `Typecheck`: `pnpm ts`, `npm run typecheck`, or equivalent.
|
|
126
|
+
- `Unit tests`: the project unit test command.
|
|
127
|
+
- `Lint`: the CI lint command.
|
|
128
|
+
- `E2E`: optional, only if it is not too expensive/noisy for a quick action.
|
|
129
|
+
|
|
130
|
+
For dev servers, prefer a script like:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
#!/usr/bin/env bash
|
|
134
|
+
set -euo pipefail
|
|
135
|
+
|
|
136
|
+
cd "${CODEX_WORKTREE_PATH:-$(pwd)}"
|
|
137
|
+
|
|
138
|
+
port="${CODEX_DEV_PORT_START:-3910}"
|
|
139
|
+
while lsof -nP -iTCP:"$port" -sTCP:LISTEN >/dev/null 2>&1; do
|
|
140
|
+
port=$((port + 1))
|
|
141
|
+
done
|
|
142
|
+
|
|
143
|
+
echo "Starting app on http://localhost:$port"
|
|
144
|
+
exec pnpm dev -p "$port"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Verification
|
|
148
|
+
|
|
149
|
+
After editing a Codex environment:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
bash -n scripts/worktree-up scripts/worktree-down
|
|
153
|
+
sed -n '1,220p' .codex/environments/environment.toml
|
|
154
|
+
git status --short
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
If Python 3.11+ is available, validate TOML:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
python3 - <<'PY'
|
|
161
|
+
import tomllib
|
|
162
|
+
with open(".codex/environments/environment.toml", "rb") as f:
|
|
163
|
+
tomllib.load(f)
|
|
164
|
+
PY
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Guardrails
|
|
168
|
+
|
|
169
|
+
- Do not read or write `.conductor` directories.
|
|
170
|
+
- Do not print full env values or secrets in logs; print only DB names or redacted hosts.
|
|
171
|
+
- Do not create duplicate environments when the user already has one; update the existing `.codex/environments/environment.toml`.
|
|
172
|
+
- Do not put large fragile shell programs directly in TOML strings.
|
|
173
|
+
- Do not hardcode a dev port unless the user asks; pick a free port or allow `PORT`.
|
|
174
|
+
- Do not drop databases unless their names come from the worktree env or from an explicit user-provided target.
|
|
175
|
+
- If the environment is meant for future worktrees, ensure the `.codex` config and scripts are present in the source checkout/main branch, not only the current Codex worktree.
|
|
176
|
+
|
|
177
|
+
## Online References
|
|
178
|
+
|
|
179
|
+
- OpenAI Codex Local Environments: https://developers.openai.com/codex/app/local-environments
|
|
180
|
+
- OpenAI Codex Worktrees: https://developers.openai.com/codex/app/worktrees
|
|
181
|
+
- `CODEX_SOURCE_TREE_PATH` / `CODEX_WORKTREE_PATH` community note: https://zenn.dev/route06/articles/c1f686b4479957
|
|
182
|
+
- Codex app environment TOML practice note: https://zenn.dev/devneko/articles/8a5f6f44adf606
|