@trendai-crem/claude-skills 1.3.0 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trendai-crem/claude-skills",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Claude Code skills installer for the trendai-crem team",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -14,7 +14,7 @@ Multi-perspective code review for Trend Micro teams, powered by Claude Code.
14
14
  | Quality | Naming, style guide compliance, documentation |
15
15
  | Testing | Coverage, error handling, regression tests, requirements |
16
16
 
17
- Optional 6th reviewer: **Codex (gpt-5.4, fallback gpt-5.3-codex)** as cross-model baseline (auto-detected, not required). Retries 3 times on gpt-5.4 before falling back.
17
+ Optional 6th reviewer: **Codex (gpt-5.4, fallback gpt-5.3-codex)** as cross-model baseline (auto-detected, not required). Supports the official Codex companion plugin (`codex-companion.mjs`) with fallback to raw CLI (`codex exec`). Retries 3 times on gpt-5.4 before falling back.
18
18
 
19
19
  ### Security Gate (Mandatory, Non-Bypassable)
20
20
 
@@ -139,7 +139,7 @@ The skill auto-triggers when Claude detects a code review request.
139
139
  [Step 3] Write review prompt with language packs
140
140
  |
141
141
  v
142
- [Step 3.5] Check Codex availability (optional)
142
+ [Step 3.5] Detect Codex mode (companion → CLI → unavailable)
143
143
  |
144
144
  v
145
145
  [Step 4] Launch reviewers in parallel (ONE message)
@@ -149,7 +149,7 @@ The skill auto-triggers when Claude detects a code review request.
149
149
  +---> security-reviewer (Claude Agent, MANDATORY GATE)
150
150
  +---> quality-reviewer (Claude Agent)
151
151
  +---> testing-reviewer (Claude Agent)
152
- +---> codex (gpt-5.4 x3 retry, fallback gpt-5.3-codex, if available)
152
+ +---> codex (companion plugin or CLI, gpt-5.4 x3 retry, fallback gpt-5.3-codex)
153
153
  |
154
154
  v
155
155
  [Step 5-7] Collect results, synthesize report
@@ -178,7 +178,7 @@ Installation is handled by the repo's root `install.sh`.
178
178
  ## FAQ
179
179
 
180
180
  **Q: Do I need Codex CLI installed?**
181
- A: No. The skill auto-detects Codex. Without it, 5 Claude reviewers provide full coverage. Codex adds an independent cross-model baseline.
181
+ A: No. The skill auto-detects Codex in three modes: (1) official Codex companion plugin (`codex-companion.mjs` via `--prompt-file`), (2) raw Codex CLI (`codex exec`), (3) not available. Without Codex, 5 Claude reviewers provide full coverage. Codex adds an independent cross-model baseline.
182
182
 
183
183
  **Q: Does it work with repos using `main` instead of `develop`?**
184
184
  A: Yes. The skill shows commit counts for origin/develop, origin/main, and origin/master, then asks you to confirm the correct base branch.
@@ -201,6 +201,7 @@ A: The skill produces a report — it does not directly block git operations. Th
201
201
 
202
202
  | Version | Date | Changes |
203
203
  |---------|------|---------|
204
+ | v1.3.0 | 2026-03-31 | Codex companion plugin support (`codex-companion.mjs` with `--prompt-file`), three-mode detection (companion → CLI → skip), raw CLI preserved as fallback |
204
205
  | v1.2.0 | 2026-03-23 | Session-isolated temp files, user-confirmed base branch, SOLID/design pattern evaluation, Codex gpt-5.4 retry x3 + gpt-5.3-codex fallback, 30min timeout |
205
206
  | v1.1.0 | 2026-03-21 | Base branch detection fix, `.c` extension support, security-reviewer gets language pack |
206
207
  | v1.0.0 | 2026-03-20 | Initial release: 5 lenses + Codex, SCD 10, OWASP Top 10, Red/Blue Team, language packs, JSON output |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: code-review
3
- version: "1.2.0"
3
+ version: "1.3.0"
4
4
  description: "Multi-perspective code review with 5 standards-aligned reviewers + Codex baseline. Enforces Trend Micro RDSec policy, Secure Coding Dojo checkpoints, and company-wide review checklist. Use when the user asks for code review, review changes, review branch, or review PR."
5
5
  ---
6
6
 
@@ -120,14 +120,17 @@ Use the `Write` tool to create `${REVIEW_DIR}/review-prompt.txt` with the REVIEW
120
120
 
121
121
  ## Step 3.5: Detect Codex Availability
122
122
 
123
- Before launching reviews, check if Codex CLI is installed:
123
+ Before launching reviews, detect Codex integration mode. The official Codex companion plugin is preferred over the raw CLI:
124
124
 
125
125
  ```
126
- Bash("command -v codex >/dev/null 2>&1 && echo 'CODEX_AVAILABLE' || echo 'CODEX_UNAVAILABLE'")
126
+ Bash("COMPANION=$(find \"$HOME/.claude/plugins/marketplaces\" -name \"codex-companion.mjs\" -path \"*/openai-codex/*\" 2>/dev/null | head -1); if [ -n \"$COMPANION\" ] && [ -f \"$COMPANION\" ]; then echo \"CODEX_MODE=companion\"; echo \"COMPANION_PATH=$COMPANION\"; elif command -v codex >/dev/null 2>&1; then echo \"CODEX_MODE=cli\"; else echo \"CODEX_MODE=unavailable\"; fi")
127
127
  ```
128
128
 
129
- - If `CODEX_AVAILABLE` include Codex as the 6th reviewer (cross-model baseline)
130
- - If `CODEX_UNAVAILABLE` → proceed with 5 Claude reviewers only. Note in report: "Codex baseline: SKIPPED (CLI not installed)"
129
+ Save `CODEX_MODE` and (if applicable) `COMPANION_PATH` for use in Step 4b.
130
+
131
+ - If `CODEX_MODE=companion` → official Codex plugin detected. Use `node "$COMPANION_PATH" task --prompt-file` for execution. Include Codex as the 6th reviewer.
132
+ - If `CODEX_MODE=cli` → legacy Codex CLI available. Use `codex exec` for execution (backward-compatible). Include Codex as the 6th reviewer.
133
+ - If `CODEX_MODE=unavailable` → no Codex integration. Proceed with 5 Claude reviewers only. Note in report: "Codex baseline: SKIPPED (not installed)"
131
134
 
132
135
  **This is NOT a blocker.** The 5 Claude lens reviewers provide full coverage. Codex adds independent cross-model validation but is optional.
133
136
 
@@ -140,7 +143,20 @@ Execute ALL of the following in a SINGLE message (5 reviewers if no Codex, 6 if
140
143
  TeamCreate(team_name="code-review")
141
144
  ```
142
145
 
143
- ### 4b. Launch Codex (ONLY if CODEX_AVAILABLE)
146
+ ### 4b. Launch Codex (ONLY if CODEX_MODE is "companion" or "cli")
147
+
148
+ Select the appropriate invocation based on `CODEX_MODE` from Step 3.5. Skip this step entirely if `CODEX_MODE=unavailable`.
149
+
150
+ **If CODEX_MODE is "companion" (official plugin):**
151
+ ```
152
+ Bash(
153
+ command='COMPANION="${COMPANION_PATH}"; REVIEW_DIR_VAL="${REVIEW_DIR}"; MODEL="gpt-5.4"; FALLBACK="gpt-5.3-codex"; MAX_RETRY=3; for i in $(seq 1 $MAX_RETRY); do echo "Attempt $i/$MAX_RETRY with $MODEL via companion"; node "$COMPANION" task --prompt-file "${REVIEW_DIR_VAL}/review-prompt.txt" --model $MODEL 2>"${REVIEW_DIR_VAL}/codex-stderr.txt" && exit 0; echo "Failed (attempt $i)"; sleep 2; done; echo "gpt-5.4 failed after $MAX_RETRY attempts. Falling back to $FALLBACK..."; node "$COMPANION" task --prompt-file "${REVIEW_DIR_VAL}/review-prompt.txt" --model $FALLBACK 2>"${REVIEW_DIR_VAL}/codex-stderr.txt"',
154
+ run_in_background=true,
155
+ timeout=1800000
156
+ )
157
+ ```
158
+
159
+ **If CODEX_MODE is "cli" (legacy fallback):**
144
160
  ```
145
161
  Bash(
146
162
  command='REVIEW_DIR_VAL="${REVIEW_DIR}"; MODEL="gpt-5.4"; FALLBACK="gpt-5.3-codex"; MAX_RETRY=3; for i in $(seq 1 $MAX_RETRY); do echo "Attempt $i/$MAX_RETRY with $MODEL"; cat ${REVIEW_DIR_VAL}/review-prompt.txt | codex exec -m $MODEL -s read-only --skip-git-repo-check - 2>${REVIEW_DIR_VAL}/codex-stderr.txt && exit 0; echo "Failed (attempt $i)"; sleep 2; done; echo "gpt-5.4 failed after $MAX_RETRY attempts. Falling back to $FALLBACK..."; cat ${REVIEW_DIR_VAL}/review-prompt.txt | codex exec -m $FALLBACK -s read-only --skip-git-repo-check - 2>${REVIEW_DIR_VAL}/codex-stderr.txt',
@@ -149,10 +165,15 @@ Bash(
149
165
  )
150
166
  ```
151
167
 
152
- **Codex retry strategy:**
168
+ **Codex retry strategy (same for both modes):**
153
169
  - Default model: `gpt-5.4` (retry up to 3 times on failure)
154
170
  - Fallback: `gpt-5.3-codex` (if all 3 retries fail)
155
- - Skip this step entirely if Codex CLI is unavailable. Do NOT error or warn the user to install it.
171
+ - Skip this step entirely if `CODEX_MODE=unavailable`. Do NOT error or warn the user to install it.
172
+
173
+ **Companion mode advantages:**
174
+ - `--prompt-file` reads the review prompt directly from disk (no stdin piping)
175
+ - The companion validates authentication via `ensureCodexReady()` before executing
176
+ - No `--skip-git-repo-check` or `-s read-only` flags needed (companion defaults to read-only sandbox without `--write`)
156
177
 
157
178
  ### 4c. Spawn Architecture Reviewer
158
179
  ```
@@ -754,7 +775,7 @@ TypeScript-specific checks:
754
775
  | security-reviewer | Security (GATE) | Claude | [OK/FAILED/TIMEOUT] | N crit, N major, N minor |
755
776
  | quality-reviewer | Style + Documentation | Claude | [OK/FAILED/TIMEOUT] | N crit, N major, N minor |
756
777
  | testing-reviewer | Testing + Requirements | Claude | [OK/FAILED/TIMEOUT] | N crit, N major, N minor |
757
- | codex | External Baseline | gpt-5.4 (fallback: gpt-5.3-codex) | [OK/FAILED/TIMEOUT] | N crit, N major, N minor |
778
+ | codex | External Baseline | gpt-5.4 via companion/CLI (fallback: gpt-5.3-codex) | [OK/FAILED/TIMEOUT] | N crit, N major, N minor |
758
779
 
759
780
  ### Dimension Scores
760
781
 
@@ -800,7 +821,7 @@ TypeScript-specific checks:
800
821
  #### Testing Reviewer
801
822
  (same format)
802
823
 
803
- #### Codex (gpt-5.4 / gpt-5.3-codex fallback)
824
+ #### Codex (gpt-5.4 via companion/CLI, fallback: gpt-5.3-codex)
804
825
  (same format)
805
826
 
806
827
  ---
@@ -859,7 +880,7 @@ Note: These three verdicts are evaluated in order: FAIL first, then PASS, then P
859
880
 
860
881
  ## Rules
861
882
 
862
- 1. **Codex default model is `gpt-5.4`, retry 3 times on failure, then fallback to `gpt-5.3-codex`. If Codex CLI is not installed, skip gracefully — do NOT ask the user to install it.**
883
+ 1. **Codex uses the official companion plugin when available (`codex-companion.mjs` with `--prompt-file`), falling back to raw CLI (`codex exec`) if the plugin is not installed. Default model is `gpt-5.4`, retry 3 times on failure, then fallback to `gpt-5.3-codex`. If neither companion nor CLI is available, skip gracefully — do NOT ask the user to install it.**
863
884
  2. **Claude teammates use Agent Teams. No `claude -p`. No `unset CLAUDECODE`.**
864
885
  3. **Every issue must have exact file:line, code snippet, and policy reference. No vague descriptions.**
865
886
  4. **Do NOT recommend replacing dependencies unless a concrete bug is demonstrated.**
@@ -269,6 +269,28 @@ for issue in data["issues"]:
269
269
  - **Expected**: Remaining reviewers complete, report marks failed reviewer, averages adjust
270
270
  - **Validates**: Graceful partial failure
271
271
 
272
+ ### 2.8 Codex Integration Modes
273
+
274
+ #### TC-CDX-01: Companion plugin detected and used
275
+ - **Setup**: Ensure `~/.claude/plugins/marketplaces/openai-codex/` contains `codex-companion.mjs`
276
+ - **Expected**: `CODEX_MODE=companion`, `COMPANION_PATH` resolved, Codex invoked via `node "$COMPANION" task --prompt-file`
277
+ - **Validates**: Official companion plugin detection and execution path
278
+
279
+ #### TC-CDX-02: Companion not found, CLI fallback
280
+ - **Setup**: Remove or rename companion plugin directory, ensure `codex` CLI is in PATH
281
+ - **Expected**: `CODEX_MODE=cli`, Codex invoked via `cat ... | codex exec -m ... -s read-only --skip-git-repo-check -`
282
+ - **Validates**: Backward-compatible CLI fallback when plugin is not installed
283
+
284
+ #### TC-CDX-03: Neither companion nor CLI available
285
+ - **Setup**: Remove companion plugin AND ensure `codex` not in PATH
286
+ - **Expected**: `CODEX_MODE=unavailable`, report notes "Codex baseline: SKIPPED (not installed)", 5 Claude reviewers only
287
+ - **Validates**: Graceful skip without error or user prompt
288
+
289
+ #### TC-CDX-04: Companion auth failure
290
+ - **Setup**: Companion plugin exists but Codex is not authenticated (`codex login` not run)
291
+ - **Expected**: Companion's `ensureCodexReady()` throws, retry loop catches failure, Codex marked as FAILED in report
292
+ - **Validates**: Auth failure handling in companion mode
293
+
272
294
  ---
273
295
 
274
296
  ## 3. Test Fixtures