|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Repository Structure |
| 4 | + |
| 5 | +- `config.toml` is the shared Codex CLI configuration and points to the local `copilot-gateway` provider at `localhost:4141`. |
| 6 | +- Root-level `*.config.toml` files are optional Codex Profiles (`chatgpt`, `azure`, `github-copilot`, and `openrouter`). Keep the `<name>.config.toml` naming required by `codex --profile <name>`. |
| 7 | +- `skills/<name>/SKILL.md` contains reusable workflows. Put deterministic helpers in `scripts/`, detailed references in `references/`, UI metadata in `agents/openai.yaml`, and offline regression tests in `tests/`. |
| 8 | +- `prompts/` contains historical Custom Prompts retained for migration reference. Do not add new workflows there; use a Skill instead. |
| 9 | +- `litellm_config.yaml` is only for the optional GitHub Copilot through LiteLLM profile. It is not the backend used by the default `config.toml`. |
| 10 | + |
| 11 | +## Validation Commands |
| 12 | + |
| 13 | +Run checks that match the files you changed. The standard offline suite is: |
| 14 | + |
| 15 | +```bash |
| 16 | +# TOML syntax |
| 17 | +python3 -c 'import pathlib, tomllib; [tomllib.loads(p.read_text()) for p in pathlib.Path(".").glob("**/*.toml")]' |
| 18 | + |
| 19 | +# Skill structure |
| 20 | +for skill in skills/*; do |
| 21 | + test ! -f "$skill/SKILL.md" || \ |
| 22 | + python3 ~/.codex/skills/.system/skill-creator/scripts/quick_validate.py "$skill" |
| 23 | +done |
| 24 | + |
| 25 | +# Python scripts and offline tests |
| 26 | +python3 -m compileall -q skills |
| 27 | +ruff check skills |
| 28 | +for test_dir in skills/*/tests; do |
| 29 | + test ! -d "$test_dir" || python3 -m unittest discover -s "$test_dir" -v |
| 30 | +done |
| 31 | + |
| 32 | +# Bundled shell and JavaScript helpers |
| 33 | +bash -n skills/brainstorming/scripts/start-server.sh \ |
| 34 | + skills/brainstorming/scripts/stop-server.sh |
| 35 | +node --check skills/brainstorming/scripts/server.cjs |
| 36 | +node --check skills/brainstorming/scripts/helper.js |
| 37 | +``` |
| 38 | + |
| 39 | +Run provider integration checks only when the related provider files change: |
| 40 | + |
| 41 | +- Strict Codex config: with the relevant provider available, run `CODEX_HOME="$PWD" codex --strict-config exec --ephemeral --sandbox read-only --skip-git-repo-check -c mcp_servers.chrome.enabled=false -c web_search="disabled" "Reply exactly OK"`. |
| 42 | +- Default gateway: start `copilot-gateway`, then run `codex` or `codex doctor --summary`. |
| 43 | +- LiteLLM profile: start `litellm --config ~/.codex/litellm_config.yaml`, then run `codex --profile github-copilot`. |
| 44 | +- ChatGPT profile: authenticate with `codex login`, then run `codex --profile chatgpt`. |
| 45 | +- External API Skills: prefer mocked/offline tests. Use real credentials only for an explicitly requested integration test. |
| 46 | + |
| 47 | +## Style and Skill Conventions |
| 48 | + |
| 49 | +- TOML uses two-space indentation where indentation applies, aligned `=` signs within related blocks, double-quoted strings, and grouped tables. |
| 50 | +- Name Profiles, Skills, prompts, and scripts with lowercase kebab-case unless the platform requires another filename. |
| 51 | +- Skill frontmatter contains only `name` and `description`. Put requirements and compatibility notes in the body. |
| 52 | +- Write Skill instructions in imperative form. Keep the core workflow concise and move repeatable or fragile behavior into bundled scripts. |
| 53 | +- Add or refresh `agents/openai.yaml` when a Skill is created or materially renamed. Its `default_prompt` must mention `$skill-name`. |
| 54 | +- Scripts must expose `--help`, validate local inputs before network/API calls, return non-zero on failure, and create output parent directories when appropriate. |
| 55 | +- Tests must not require paid API calls, browser cookies, interactive approval, or live third-party services unless the user explicitly requests an integration run. |
| 56 | + |
| 57 | +## Commit and Pull Request Guidelines |
| 58 | + |
| 59 | +- Use concise title-case imperative commit subjects, consistent with repository history. |
| 60 | +- Keep commits scoped; do not include local Codex runtime state, credentials, generated logs, or unrelated working-tree changes. |
| 61 | +- In pull requests, list affected configs or Skills, validation commands run, intentionally skipped integration checks, and any compatibility assumptions. |
| 62 | +- Use redacted placeholders such as `sk-dummy` in examples. |
| 63 | + |
| 64 | +## Security |
| 65 | + |
| 66 | +- Never commit API keys, access tokens, cookies, real authorization headers, or private logs. |
| 67 | +- Review `shell_environment_policy`, sandbox, network, MCP, and browser-cookie behavior when changing integrations. |
| 68 | +- Do not silently broaden permissions or enable browser-cookie access. Explain the need and obtain user approval first. |
| 69 | +- Follow `SECURITY.md` for vulnerability reporting. |
0 commit comments