|
| 1 | +# Maintainer operations |
| 2 | + |
| 3 | +This file records the project-specific release and Codex skill maintenance steps. It is intentionally operational: follow it when publishing, updating bundled skills, or helping another maintainer refresh their local setup. |
| 4 | + |
| 5 | +## What is already configured |
| 6 | + |
| 7 | +- npm package: `codex-flow` |
| 8 | +- npm owner used here: `tutudma` |
| 9 | +- GitHub repo: `Dmatut7/codex-flow` |
| 10 | +- npm Trusted Publisher: GitHub Actions → `Dmatut7/codex-flow` → `publish.yml` |
| 11 | +- Allowed Trusted Publisher action: `npm publish` |
| 12 | +- Release workflow: `.github/workflows/publish.yml` |
| 13 | + |
| 14 | +The release workflow uses OIDC Trusted Publishing. It must not use `NPM_TOKEN`, `NODE_AUTH_TOKEN`, or checked-in `.npmrc` credentials. |
| 15 | + |
| 16 | +## Normal release flow |
| 17 | + |
| 18 | +Start from a clean `main` branch. |
| 19 | + |
| 20 | +```bash |
| 21 | +git checkout main |
| 22 | +git pull origin main |
| 23 | +git status --short |
| 24 | +npm run typecheck |
| 25 | +npm test |
| 26 | +``` |
| 27 | + |
| 28 | +Update `CHANGELOG.md` first. Move the relevant `Unreleased` notes into a dated version section. |
| 29 | + |
| 30 | +Then bump and tag: |
| 31 | + |
| 32 | +```bash |
| 33 | +npm version patch # or: npm version minor / npm version major |
| 34 | +git push origin main --tags |
| 35 | +``` |
| 36 | + |
| 37 | +Pushing the `v*` tag starts GitHub Actions. The workflow verifies the tag matches `package.json`, runs typecheck/tests, then publishes to npm by OIDC. |
| 38 | + |
| 39 | +Check: |
| 40 | + |
| 41 | +```bash |
| 42 | +npm view codex-flow version |
| 43 | +``` |
| 44 | + |
| 45 | +If the GitHub Action fails, fix the repo/workflow and push a new commit/tag as appropriate. Do not fall back to local token publishing unless Trusted Publishing itself is unavailable. |
| 46 | + |
| 47 | +## One-time npm Trusted Publisher setup |
| 48 | + |
| 49 | +This was already done for `codex-flow`, but if the package is recreated or moved: |
| 50 | + |
| 51 | +1. Open `https://www.npmjs.com/package/codex-flow/access`. |
| 52 | +2. In **Trusted Publisher**, choose **GitHub Actions**. |
| 53 | +3. Fill: |
| 54 | + - Organization or user: `Dmatut7` |
| 55 | + - Repository: `codex-flow` |
| 56 | + - Workflow filename: `publish.yml` |
| 57 | + - Environment name: leave blank unless the workflow adds a GitHub environment |
| 58 | +4. Allow only `npm publish`. |
| 59 | +5. Confirm password / 2FA. |
| 60 | +6. Verify the page shows `Dmatut7/codex-flow`, `publish.yml`, and permission `npm publish`. |
| 61 | + |
| 62 | +CLI equivalent, if npm authentication supports trust endpoints: |
| 63 | + |
| 64 | +```bash |
| 65 | +npx npm@^11.10.0 trust github codex-flow \ |
| 66 | + --repo Dmatut7/codex-flow \ |
| 67 | + --file publish.yml \ |
| 68 | + --allow-publish \ |
| 69 | + --yes |
| 70 | +``` |
| 71 | + |
| 72 | +## Updating Codex skills after someone changes this repo |
| 73 | + |
| 74 | +The bundled skills live in: |
| 75 | + |
| 76 | +- `codex-skill/` → installs as `dynamic-workflow` |
| 77 | +- `codex-skill-business-audit/` → installs as `business-defect-audit` |
| 78 | +- `codex-skill-parallel-fix/` → installs as `parallel-fix` |
| 79 | + |
| 80 | +For users installed from npm: |
| 81 | + |
| 82 | +```bash |
| 83 | +npm install -g codex-flow@latest |
| 84 | +codex-flow install-codex |
| 85 | +codex-flow doctor |
| 86 | +# restart Codex App or Codex CLI |
| 87 | +``` |
| 88 | + |
| 89 | +For maintainers working from a local checkout: |
| 90 | + |
| 91 | +```bash |
| 92 | +git pull origin main |
| 93 | +npm install |
| 94 | +node bin/codex-flow.mjs install-codex |
| 95 | +node bin/codex-flow.mjs doctor |
| 96 | +# restart Codex App or Codex CLI |
| 97 | +``` |
| 98 | + |
| 99 | +`install-codex` replaces stale installed skill folders. That is expected. |
| 100 | + |
| 101 | +## What not to commit |
| 102 | + |
| 103 | +These are local run artifacts and should stay untracked: |
| 104 | + |
| 105 | +- `.codex-flow/` journals and generated temporary workflows |
| 106 | +- `.codex-workflow/` |
| 107 | +- `.dongt/` |
| 108 | +- `node_modules/` |
| 109 | +- temporary `.npmrc` files containing publish tokens |
| 110 | +- screenshots or one-off browser artifacts from npm/GitHub setup |
| 111 | + |
| 112 | +If a temporary workflow is useful as a reusable example, copy a cleaned, import-free version into `examples/` and add tests/docs for it. Do not commit raw `.codex-flow/generated/*` files. |
| 113 | + |
| 114 | +## Changing bundled skills |
| 115 | + |
| 116 | +When editing any bundled skill: |
| 117 | + |
| 118 | +1. Edit the source folder in this repo, not `~/.codex/skills`. |
| 119 | +2. Run: |
| 120 | + |
| 121 | +```bash |
| 122 | +npm run typecheck |
| 123 | +npm test |
| 124 | +node bin/codex-flow.mjs install-codex --dir "$(mktemp -d)" |
| 125 | +``` |
| 126 | + |
| 127 | +3. If the change is user-visible, update `CHANGELOG.md`. |
| 128 | +4. Commit the repo change. Users get it by reinstalling `codex-flow@latest` and running `codex-flow install-codex`. |
| 129 | + |
| 130 | +## Emergency local publish fallback |
| 131 | + |
| 132 | +Only use this if GitHub Actions / OIDC is down and the release cannot wait. |
| 133 | + |
| 134 | +```bash |
| 135 | +npm run typecheck |
| 136 | +npm test |
| 137 | +npm publish --access public |
| 138 | +``` |
| 139 | + |
| 140 | +Do not save tokens in the repo. If a temporary npm token or temporary npmrc is used, delete it immediately after publishing. |
0 commit comments