Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Changelog

## 2.1.1 — 2026-07-15

Robustness release: script hardening, dynamic branching, and a regression test suite.

### Fixed

- **State-directory footgun**: `codex-implement`, `codex-code-review`, and `codex-ask` now ship their own `start`/`resume`/`reset`/`show` wrapper scripts that pin `STATE_DIR` themselves. The old `export STATE_DIR` choreography silently broke when the export and the script call ran in separate shells — worst case, a resume continued the *plan-review* thread with the reviewer model instead of the implementation thread.
- **State-key lookup for free-form labels**: `TRIP-3-release` now derives the code-review state key via the new shared `key.sh` instead of an inline `realpath` pipeline, which mis-keyed unplanned work (free-form labels) and silently downgraded a converged Codex review to the "skipped" fallback.
- **Prompt substitution**: `load_prompt` no longer corrupts prompts containing `&` or backslashes, and no longer loops forever when a substituted value quotes its own placeholder (e.g. implementer notes discussing the templates).
- **Committed session artifacts**: added the missing `state/.gitignore` for `codex-implement` and `codex-ask`, so `git add -A` during release no longer commits thread IDs, reports, and event logs.
- **Stale v1 references**: week-anchor formula location, synthesize template's version-step pointer, tutorial step numbering and its renumber list.

### Changed

- **Dynamic base branch**: `TRIP-2-implement`, `TRIP-3-release`, and `TRIP-hotfix` now work from whatever branch is active. The base branch is recorded at branch creation (`branch.<name>.trip-base` git config) and the release/hotfix merge returns to it — the `[MAIN_BRANCH]` placeholder is gone.
- **Push is now explicit**: `TRIP-3-release` and `TRIP-hotfix` list the available branches and ask which one to push (base branch recommended), unless the user already specified one. Hotfix previously pushed automatically as part of the merge chain.
- **Hotfix merge policy**: `TRIP-hotfix` now enforces `--ff-only` like the release skill — never a merge commit.
- **Docs**: unified ARCHI.md token thresholds (10–15k target, ~20k ceiling) across README, `TRIP-compact`, and `TRIP-3-release`; added the Bash/Codex CLI/`jq`/GNU-coreutils requirements note; typo fixes.

### Added

- `tests/workflow-regression.sh` — regression suite covering prompt substitution (literal `&`/backslash handling, self-referencing placeholder termination), shared key derivation for free-form labels, wrapper state-directory isolation, and state `.gitignore` presence.

## 2.1.0 — 2026-07-13

### Added

- **`codex-ask` skill**: grounded second opinion from Codex on any matter — architecture calls, debugging hypotheses, research conclusions. Read-only sandbox, threaded per topic, advisory only (no verdict tags, nothing gated).
- **TRIP-research cross-check step**: decision-grade findings are red-teamed via `codex-ask` before being presented; real disagreements are recorded in the memo's Open Questions section.

## 2.0.0 — 2026-07-13

Flow simplified to **Plan → Implement → Release**: review and test moved inside Implement as a testing gate and an automatic Codex review loop.

### Added

- **`codex-implement` skill**: implementation delegated to Codex CLI in a workspace-write sandbox, with persistent per-plan threads for phased delegation.
- **`TRIP-3-release` skill**: owns the release ceremony (version, CR promotion, changelogs, docs, commit, tag, ff-merge, push).
- **Testing gate** in `TRIP-2-implement`, with the hard-to-cover policy and coverage-debt ledger.
- **Per-flow Codex model defaults** in `codex-plan-review/scripts/_common.sh` (implementation vs review models), overridable via `CODEX_MODEL` / `CODEX_EFFORT`.

### Changed

- `TRIP-review` and `TRIP-test` reborn as on-demand support skills (manual fallback/audit review, deep test-authoring reference).
- `TRIP-upgrade` handles the v1 → v2 rename/migration (`TRIP-3-review` → `TRIP-review`, `TRIP-4-test` → `TRIP-test`).

## Earlier (1.x)

- 2026-06-09 — Codex review integration, `TRIP-upgrade` skill, review file separation.
- 2026-02-10 — minor tool call update.
- 2026-02-05 — Mistral Vibe compatibility, contributing section, `AskUserQuestion` emulation skill.
- 2026-02-03 — migration to Skills.
- 2026-01-29 — initial commit.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![TRIP Workflow Banner](assets/trip-workflow-banner2.png)

![Version](https://img.shields.io/badge/version-2.1.0-blue) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/PiLastDigit/TRIP-workflow/blob/master/LICENSE) ![Works with](https://img.shields.io/badge/Works_with-grey) [![Claude Code](https://img.shields.io/badge/Claude_Code-E5582B)](https://docs.anthropic.com/en/docs/claude-code) [![Codex CLI](https://img.shields.io/badge/Codex_CLI-10A37F)](https://developers.openai.com/codex/cli/) [![OpenCode](https://img.shields.io/badge/OpenCode-1a3a5c)](https://github.com/sst/opencode) [![Mistral Vibe](https://img.shields.io/badge/Mistral_Vibe-F7D046)](https://github.com/mistralai/mistral-vibe)
![Version](https://img.shields.io/badge/version-2.1.1-blue) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/PiLastDigit/TRIP-workflow/blob/master/LICENSE) ![Works with](https://img.shields.io/badge/Works_with-grey) [![Claude Code](https://img.shields.io/badge/Claude_Code-E5582B)](https://docs.anthropic.com/en/docs/claude-code) [![Codex CLI](https://img.shields.io/badge/Codex_CLI-10A37F)](https://developers.openai.com/codex/cli/) [![OpenCode](https://img.shields.io/badge/OpenCode-1a3a5c)](https://github.com/sst/opencode) [![Mistral Vibe](https://img.shields.io/badge/Mistral_Vibe-F7D046)](https://github.com/mistralai/mistral-vibe)

## What is TRIP?

Expand All @@ -18,7 +18,7 @@ Even the "simple" ones come with:

- 47 different commands & skills to memorize
- Sub-agents swarm for God-knows-what
- Mutlti-chapters courses (sometimes paid lol)
- Multi-chapter courses (sometimes paid lol)

**TRIP is different.** It's deliberately minimal:

Expand All @@ -38,6 +38,8 @@ It was kept stupid simple because **the goal is to ship features, not to master

## Getting Started

Requirements for the bundled Codex scripts: Bash, Codex CLI, `jq`, and GNU coreutils (`realpath` and GNU `date`). On Windows, run them from WSL or a shell with those tools installed.

1. Copy the `skills/` folder contents to your repo's `.claude/skills/` or whatever
2. Run `/TRIP-init [YourProjectName]`
3. Follow the interactive prompts
Expand Down Expand Up @@ -132,7 +134,7 @@ Exploratory investigation with defined compute level. For feasibility studies an
### `/TRIP-compact`

Run this skill to compact ARCHI.md size while preserving relevance, accuracy, and coverage through summarization and restructuring. Token calculator script included.
As a rule of thumb, ARCHI.md should not exceed ~10% of context window.
Aim for 10,000–15,000 tokens; treat ~20,000 as the hard ceiling.

## Multi-Agent: Using Different LLMs at Different Steps

Expand All @@ -147,7 +149,7 @@ As of mid july 2026, this Fable + GPT5.6 harness combo is absolute peak.

## MCP Servers: Less Is More

Last piece of advise before your new coding quest: Every MCP server you add is extra context, extra latency, and extra confusion. Keep it minimal. The one use case where MCP genuinely shines is **up-to-date documentation**, so your agent stops hallucinating deprecated APIs/whatever. Two servers cover it: [Context7](https://github.com/upstash/context7) for current library & framework docs, and [Exa](https://github.com/exa-labs/exa-mcp-server) for web search when the answer isn't in any doc. No bloat beyond that.
Last piece of advice before your new coding quest: Every MCP server you add is extra context, extra latency, and extra confusion. Keep it minimal. The one use case where MCP genuinely shines is **up-to-date documentation**, so your agent stops hallucinating deprecated APIs/whatever. Two servers cover it: [Context7](https://github.com/upstash/context7) for current library & framework docs, and [Exa](https://github.com/exa-labs/exa-mcp-server) for web search when the answer isn't in any doc. No bloat beyond that.

## Contributing

Expand Down
21 changes: 8 additions & 13 deletions skills/TRIP-2-implement/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ Implement: $ARGUMENTS

## Step 0: Create a Branch (Pre-Implementation)

**Always** create a dedicated branch before implementing — no need to ask. `TRIP-3-release` merges it back into the main branch with fast-forward, keeping a single clean linear history.
**Always** create a dedicated branch before implementing — no need to ask. The workflow is base-branch agnostic: whatever branch is active right now becomes the **base branch**, and `TRIP-3-release` merges the feature branch back into it with fast-forward, keeping a single clean linear history.

```bash
BASE_BRANCH="$(git branch --show-current)"
git checkout -b feat/[short-description] # or fix/[short-description]
git config branch."feat/[short-description]".trip-base "$BASE_BRANCH"
```

Derive the short description from the plan/feature name. If already on a dedicated branch for this work (e.g., resuming a session), continue on it.
The `trip-base` config entry records where the branch came from so the release step knows where to merge back — no hardcoded main. Derive the short description from the plan/feature name. If already on a dedicated branch for this work (e.g., resuming a session), continue on it.

---

Expand All @@ -49,8 +51,7 @@ You do NOT write the implementation yourself — delegate it to Codex via the `c
Follow-up phases resume the same thread (context retained):

```bash
export STATE_DIR=".claude/skills/codex-implement/state"
bash .claude/skills/codex-plan-review/scripts/resume.sh \
bash .claude/skills/codex-implement/scripts/resume.sh \
--prompt-file .claude/skills/codex-implement/prompts/continue.tpl \
<plan-path> "Now implement Phase 2"
```
Expand Down Expand Up @@ -126,15 +127,9 @@ Always run the Codex code review after the testing gate passes — no confirmati

### Loop

Always export before invoking shared scripts:

```bash
export STATE_DIR=".claude/skills/codex-code-review/state"
```

1. **Start**:
```bash
bash .claude/skills/codex-plan-review/scripts/start.sh \
bash .claude/skills/codex-code-review/scripts/start.sh \
--prompt-file .claude/skills/codex-code-review/prompts/start.tpl \
<plan-path> "$GATE_SUMMARY"
```
Expand All @@ -148,7 +143,7 @@ export STATE_DIR=".claude/skills/codex-code-review/state"

5. **Resume** (re-run the testing gate first — lint, typecheck, affected tests — and build a fresh summary):
```bash
bash .claude/skills/codex-plan-review/scripts/resume.sh \
bash .claude/skills/codex-code-review/scripts/resume.sh \
--prompt-file .claude/skills/codex-code-review/prompts/resume.tpl \
--notes "Fixed X. Pushed back on Y because Z." \
<plan-path> "$GATE_SUMMARY"
Expand All @@ -164,7 +159,7 @@ Skip if loop converged on Turn 1 (state file already holds full review).
Turn-N state files hold only that turn's delta. After multi-round convergence, produce a consolidated review:

```bash
bash .claude/skills/codex-plan-review/scripts/resume.sh \
bash .claude/skills/codex-code-review/scripts/resume.sh \
--prompt-file .claude/skills/codex-code-review/prompts/synthesize.tpl \
<plan-path> "Today's date is YYYY-MM-DD"
```
Expand Down
33 changes: 22 additions & 11 deletions skills/TRIP-3-release/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Now that week (`a`) and version (`x.y.z`) are known:

1. Compute state file path:
```bash
STATE_KEY="$(realpath <plan-path> | sed 's|^/||; s|/|__|g')"
STATE_KEY="$(bash .claude/skills/codex-plan-review/scripts/key.sh <plan-path-or-label>)"
STATE_FILE=".claude/skills/codex-code-review/state/${STATE_KEY}.review.txt"
```

Expand Down Expand Up @@ -158,25 +158,36 @@ git tag vx.y.z

## Step 11: Merge (fast-forward)

Merge the feature branch back into the main branch, keeping a single clean linear history:
Merge the feature branch back into its **base branch** — the branch it was created from, recorded by `TRIP-2-implement` Step 0 — keeping a single clean linear history. Run as ONE command so the lookup and the merge share a shell:

```bash
git checkout [MAIN_BRANCH]
git merge --ff-only <feature-branch>
git branch -d <feature-branch>
BASE_BRANCH="$(git config branch.<feature-branch>.trip-base)" \
&& git checkout "$BASE_BRANCH" \
&& git merge --ff-only <feature-branch> \
&& git branch -d <feature-branch>
```

If `--ff-only` fails, the main branch moved during implementation — rebase the feature branch onto it, then retry. **Never create a merge commit.**
If the `trip-base` lookup fails (branch created outside TRIP-2), ask the user which branch to merge into and substitute it for `"$BASE_BRANCH"`.

If `--ff-only` fails, the base branch moved during implementation — rebase the feature branch onto it, then retry. **Never create a merge commit.**

## Step 12: Push

**Use the `AskUserQuestion` tool** to ask:
**If the user already specified which branch to push** (in the request or earlier in the session), push that branch directly and skip the question.

Otherwise, list the available branches:

```bash
git branch --format='%(refname:short)'
```

Then **use the `AskUserQuestion` tool** to ask:

- **Question**: "Release vx.y.z is committed, tagged, and merged. Push to remote?"
- **Options**: "Yes, push now" (push branch and tags), "Not yet" (push manually later)
- **Question**: "Release vx.y.z is committed, tagged, and merged. Which branch should I push?"
- **Options**: One option per branch from the list above — the base branch first, marked "(recommended)" — plus "Not yet" (push manually later). If there are too many branches to list, include the most relevant ones; the user can name another via "Other".

**If "Yes"**:
**If a branch is selected**:

```bash
git push && git push --tags
git push origin <selected-branch> && git push --tags
```
2 changes: 1 addition & 1 deletion skills/TRIP-compact/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You are now in **compaction mode** - intelligently reducing ARCHI.md size while

## Why Compact?

ARCHI.md should not exceed _~20k tokens_. A bloated ARCHI:
Aim for 10,000–15,000 tokens and treat ~20,000 as the hard ceiling. A bloated ARCHI:

- Consumes tokens that could be used for actual work
- Slows down every command that reads it
Expand Down
Empty file modified skills/TRIP-compact/count-tokens.sh
100755 → 100644
Empty file.
45 changes: 38 additions & 7 deletions skills/TRIP-hotfix/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ Before proceeding, confirm this is a genuine hotfix:

## Step 2: Create Hotfix Branch

Branch from the **currently active branch** — the workflow is base-branch agnostic, and Step 8 merges back into whatever branch you started from. Run as ONE command so the steps share a shell:

```bash
git checkout main && git pull
git checkout -b hotfix/[short-description]
BASE_BRANCH="$(git branch --show-current)" \
&& git pull --ff-only \
&& git checkout -b hotfix/[short-description] \
&& git config branch."hotfix/[short-description]".trip-base "$BASE_BRANCH"
```

If the active branch has no upstream, drop the `git pull --ff-only` step instead of ignoring its failure.

---

## Step 3: Minimal Investigation
Expand Down Expand Up @@ -106,12 +112,37 @@ git add -A && git commit -m "hotfix: [brief description]"

## Step 8: Merge & Tag

Merge back into the base branch recorded in Step 2. Run as ONE command so the lookup and the merge share a shell:

```bash
BASE_BRANCH="$(git config branch.hotfix/[short-description].trip-base)" \
&& git checkout "$BASE_BRANCH" \
&& git merge --ff-only hotfix/[short-description] \
&& git tag vx.y.z \
&& git branch -d hotfix/[short-description]
```

If the `trip-base` lookup fails (branch created outside this skill), ask the user which branch to merge into. If `--ff-only` fails, the base branch moved during the fix — rebase the hotfix branch onto it, then retry. **Never create a merge commit.**

## Step 8b: Push

**If the user already specified which branch to push**, push that branch directly and skip the question.

Otherwise, list the available branches:

```bash
git branch --format='%(refname:short)'
```

Then **use the `AskUserQuestion` tool** to ask:

- **Question**: "Hotfix vx.y.z is merged and tagged. Which branch should I push?"
- **Options**: One option per branch from the list above — the base branch first, marked "(recommended)" — plus "Not yet" (push manually later). If there are too many branches to list, include the most relevant ones; the user can name another via "Other".

**If a branch is selected**:

```bash
git checkout main
git merge hotfix/[short-description]
git tag vx.y.z
git push && git push --tags
git branch -d hotfix/[short-description]
git push origin <selected-branch> && git push --tags
```

---
Expand Down
9 changes: 5 additions & 4 deletions skills/TRIP-init/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ Update Step 2 to reference the actual version file:

**B. Week Anchor**

The week Init is run becomes **Week 1** of the project. Capture the anchor date (Monday of the current week) and update the week formula in `TRIP-2-implement`.
The week Init is run becomes **Week 1** of the project. Capture the anchor date (Monday of the current week) and update the week formula in `TRIP-3-release`.

Run this to get the anchor date:

Expand Down Expand Up @@ -687,7 +687,7 @@ Then replace the `[WEEK_ANCHOR_DATE]` placeholder in `TRIP-3-release` Step 1 wit
Then update the `[TUTORIAL_STEP]` block in `TRIP-3-release` with the user's context:

```markdown
### Step 7: Tutorial
### Step 8: Tutorial

Create `docs/5-tuto/tuto_x.y.z.md` explaining the core principle.

Expand All @@ -705,6 +705,8 @@ Create `docs/5-tuto/tuto_x.y.z.md` explaining the core principle.
- Step 8: README Update → **Step 9**: README Update
- Step 9: Commit → **Step 10**: Commit
- Step 10: Tag → **Step 11**: Tag
- Step 11: Merge → **Step 12**: Merge
- Step 12: Push → **Step 13**: Push

**D. Codex Review Test Commands**

Expand Down Expand Up @@ -1012,10 +1014,9 @@ Update: Technology Stack, and any affected architectural sections
- [ ] `TRIP-1-plan`: `[ADAPT_TO_PROJECT]` markers replaced with actual technical considerations
- [ ] `TRIP-1-plan`: Guidance sections replaced with project-specific patterns
- [ ] `TRIP-1-plan`: Custom plan sections added (if user requested)
- [ ] `TRIP-2-implement`: Testing gate commands (`[LINT_COMMAND]`, `[TYPECHECK_COMMAND]`, `[TEST_COMMAND]`) replaced with actual commands
- [ ] `TRIP-2-implement` and `TRIP-3-release`: Testing commands (`[LINT_COMMAND]`, `[TYPECHECK_COMMAND]`, `[TEST_COMMAND]`) replaced with actual commands
- [ ] `TRIP-3-release`: `[VERSION_FILE]` placeholder replaced
- [ ] `TRIP-3-release`: `[WEEK_ANCHOR_DATE]` placeholder replaced
- [ ] `TRIP-3-release`: Standalone-verification commands replaced with actual commands
- [ ] `TRIP-3-release`: Tutorial preference configured (if enabled: 5-tuto/ folder created + user context; if disabled: `[TUTORIAL_STEP]` block removed)
- [ ] `TRIP-review/checklist.md`: `[ADAPT_TO_PROJECT]` markers replaced with project-specific checklist sections
- [ ] `TRIP-review/cr-template.md`: Checklist section names updated to match adapted `checklist.md`
Expand Down
3 changes: 1 addition & 2 deletions skills/TRIP-research/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ Conduct the research:
For **decision-grade findings** — architecture recommendations, technology choices, anything the user will build on (typically compute level `think hard` and above) — red-team the draft conclusion with the `codex-ask` skill before presenting. Skip for quick lookups.

```bash
export STATE_DIR=".claude/skills/codex-ask/state"
bash .claude/skills/codex-plan-review/scripts/start.sh \
bash .claude/skills/codex-ask/scripts/start.sh \
--prompt-file .claude/skills/codex-ask/prompts/ask.tpl \
<topic-label> "Here is my draft recommendation: <summary + key rationale>. Red-team it: what am I missing, what would you choose instead, and why?"
```
Expand Down
Loading