Skip to content
Merged
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
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![Latest release](https://img.shields.io/github/v/release/LeonardSEO/pstack-for-codex)](https://github.com/LeonardSEO/pstack-for-codex/releases/latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

An independent Codex adaptation of [Lauren Tan’s pstack](https://github.com/cursor/plugins/tree/main/pstack), with 51 core skills, 23 playbooks, and an additional **Thermo-Nuclear Code Quality Review**. Start with a goal and a checkable completion criterion. The workflows guide your agent through understanding the code, choosing an approach, making the change, and reporting evidence.
An independent Codex adaptation of [Lauren Tan’s pstack](https://github.com/cursor/plugins/tree/main/pstack), with 52 core skills, 23 playbooks, and an additional **Thermo-Nuclear Code Quality Review**. Start with a goal and a checkable completion criterion. The workflows guide your agent through understanding the code, choosing an approach, making the change, and reporting evidence.

[Install](#install) · [Examples](#start-with-a-real-task) · [Skills](#choose-a-workflow) · [Updates](#updates-and-releases) · [Compatibility](#how-it-runs-in-codex)

Expand Down Expand Up @@ -140,7 +140,11 @@ python3 -m unittest discover -s tests -v
python3 scripts/validate.py
```

The sync uses the commit in [`upstream.json`](upstream.json) as its merge base. Resolve blocked changes while preserving the runtime contract, then advance the checkpoint only after validation. Package checks validate metadata, local skill links, and compatibility rules; they do not prove every workflow or external integration works in your environment.
The sync uses the commit in [`upstream.json`](upstream.json) as its source base. It normalizes skill metadata and applies the reviewed Codex translations in [`scripts/codex_adaptations.json`](scripts/codex_adaptations.json) to both upstream revisions before merging with the live fork. This lets wording changes around translated instructions flow through while preserving separately maintained fork edits. The runtime contract and independent review skill remain maintained in this fork.

Translations match exact source fragments, not fuzzy patterns. Unknown edits to a translated instruction, duplicate matches, conflicting fork edits, and unreviewed changes to complete Codex rewrites stop the sync. Complete rewrites and reviewed removal of obsolete instructions require the exact normalized source SHA-256. To extend the translations, compare both source revisions and the current fork, preserve the intended upstream behavior under the Codex runtime contract, and add a regression before accepting a new variant. Never generate a merge base from the current fork or add a blanket resolution for an entire skill.

The synchronizer validates a staged copy of the complete proposed package before writing files, incrementing the saved version, or advancing the checkpoint. A repeated sync of the same source is a validated no-op. The workflow validates again before committing or releasing. Package checks validate metadata, local skill links, and compatibility rules; they do not prove every workflow or external integration works in your environment.

## Credits and license

Expand Down
2 changes: 1 addition & 1 deletion plugins/pstack-for-codex/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "pstack-for-codex",
"version": "1.0.1",
"version": "1.0.2",
"description": "Codex adaptation of pstack engineering principles, playbooks, reviews and verification workflows.",
"author": {
"name": "Leonard van Hemert"
Expand Down
14 changes: 5 additions & 9 deletions plugins/pstack-for-codex/skills/architect/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Read [Codex runtime contract](../../CODEX-RUNTIME.md) before applying this workf

# Architect

Design before implementing. Sketch types, function signatures, class shapes, and module boundaries with `not implemented` bodies and pseudocode. Synthesize across multiple model perspectives, then fill in code against the chosen sketch. If implementation proves the sketch wrong, throw it out and redesign.
Sketch types, function signatures, class shapes, and module boundaries with `not implemented` bodies and pseudocode. Synthesize across multiple model perspectives, then fill in code against the chosen sketch.

## Start

Expand All @@ -25,15 +25,13 @@ Open a todolist with one entry per phase before starting.

## Phase A: Ground the problem

Build a real mental model of every system the new code touches. Run the **how** skill over the relevant subsystems.

Naming a file isn't grounding. Produce the traced model `how` prescribes. If the design redefines ownership or layering, also run the **why** skill on the existing shape so the rationale becomes a constraint, not a guess.
Build a real mental model of every system the new code touches. Run the **how** skill over the relevant subsystems. Naming a file isn't grounding. Produce the architectural explanation `how` prescribes. If the design redefines ownership or layering, also run the **why** skill on the existing shape so the rationale becomes a constraint, not a guess.

Skip Phase A only when the work is genuinely greenfield with no surrounding system to integrate.

## Phase B: Sketch

Run the **arena** skill with the design-sketch task and the Phase A grounding artifacts. Pass `references/runner-prompt.md` as each runner's prompt. Each candidate produces a design package shaped per `references/rationale-template.md`.
Run the **arena** skill with the design-sketch task and the Phase A grounding artifacts. Pass `references/runner-prompt.md` as each runner's prompt.

Use Candidate count from explicitly loaded .agents/pstack-config.md, default two. Every runner inherits the parent model unless an exposed override is explicitly authorized. Apply the arena skill’s native-tool and sequential-fallback rules.

Expand All @@ -43,7 +41,7 @@ Screen every candidate against [`references/design-red-flags.md`](references/des

Compare viable candidates on interface depth. Prefer the design that hides more complexity behind a smaller, simpler public surface. A rich interface can keep call chains short by concentrating capability instead of scattering it across layers.

Arena returns one synthesized design package. The synthesis decision populates the rationale's "Synthesis decision" section.
Arena returns one synthesized design package. Its synthesis decision fills the rationale's "Synthesis decision" section.

## Phase C: Agree (opt-in)

Expand All @@ -57,9 +55,7 @@ If the human pushes back on the shape (in a checkpoint or after the fact), treat

## Phase D: Implement against the sketch

Replace `not implemented` bodies with code, pseudocode with logic. The synthesized sketch is the contract.

Deviations from the sketch are signal worth surfacing, not friction to absorb silently. If a function needs a parameter the sketch didn't anticipate, ask whether the sketch was wrong, the requirement was missed, or the implementation is overreaching.
Replace `not implemented` bodies with code, pseudocode with logic. The synthesized sketch is the contract. Deviations from it are signal to surface, not friction to absorb silently. If a function needs a parameter the sketch didn't anticipate, ask whether the sketch was wrong, the requirement was missed, or the implementation is overreaching.

## Phase E: Scrap when the architecture is wrong

Expand Down
47 changes: 12 additions & 35 deletions plugins/pstack-for-codex/skills/arena/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,43 @@ Read [Codex runtime contract](../../CODEX-RUNTIME.md) before applying this workf

# Arena

Fan out N parallel attempts at the same task. Read every candidate end to end. Pick the strongest as the base. Graft the best ideas from the others into it. Verify the synthesized result.

## Start

Open a todolist with one entry per phase before launching anything.

1. Frame
2. Fan out
3. Cross-judge
4. Pick
5. Graft
6. Verify
Open a todolist with one entry per phase (Frame, Fan out, Cross-judge, Pick, Graft, Verify) before launching anything.

## Phase A: Frame

The N candidates will receive the same prompt, so the prompt is the contract.
Every candidate gets the same prompt, so the prompt is the contract.

1. State the artifact each candidate is producing.
2. Derive the rubric. State what success looks like for *this* task, then turn it into 3-6 concrete gradeable criteria. The rubric is the picker's tool in Phase D. Candidates only see the task.
2. Derive the rubric, 3-6 concrete gradeable criteria for what success looks like on *this* task. It is the picker's tool in Phase D. Candidates only see the task.
3. Read Candidate count from explicitly loaded .agents/pstack-config.md, default two. Every runner inherits the parent model unless an exposed override is explicitly authorized. Native delegation and sequential fallback follow CODEX-RUNTIME.md. If a configured override is unsupported, report it and inherit the parent.
4. Assign output paths. Each candidate writes to its own location (a git worktree where possible, otherwise `/tmp/arena-<slug>/candidate-<n>/`), per the **separate-before-serializing-shared-state** principle skill.
4. Give each candidate its own output location (a git worktree where possible, otherwise `/tmp/arena-<slug>/candidate-<n>/`), per the **separate-before-serializing-shared-state** principle skill.

## Phase B: Fan out

Spawn all N subagents in one message with native nonblocking delegation when supported, each with the task, the path to the shared grounding, its own output path, and instructions to produce both the artifact and a short rationale.
Spawn all N subagents in one message with native nonblocking delegation when supported, each with the task, the path to the shared grounding, its own output path, and instructions to produce the artifact and a short rationale naming the alternatives it considered and what it rejected.

Each rationale names the alternatives the candidate considered and what it rejected.

If a candidate fails to produce output, proceed with N-1 and note the dropout in the synthesis record.
If a candidate produces no output, proceed with N-1 and note the dropout.

## Phase C: Cross-judge

After every candidate completes, give a separate read-only judge the rubric and candidate paths through native delegation where permitted. Default to inherit-parent. Without delegation, perform a separately recorded self-review. Do not claim cross-model independence.

## Phase D: Pick a base

Read every candidate end to end before picking.

Score each candidate against the rubric criterion by criterion, not on holistic feel. Compare against the cross-judge. Agreement on the base confirms the pick. Disagreement means one of you is biased or the rubric was ambiguous. Read both rationales before deciding.
Read every candidate end to end before picking. Score each against the rubric criterion by criterion, not on holistic feel, and compare with the cross-judge. Agreement on the base confirms the pick. Disagreement means one of you is biased or the rubric was ambiguous. Read both rationales before deciding.

Pick the base on which candidate a future maintainer can extend most easily without breaking invariants. Prefer the cleaner boundary or smaller API when two feel tied, per the Laziness Protocol.

Record the pick and the reason in a short synthesis note alongside the base artifact, including the cross-judge's verdict.
Pick the base a future maintainer can extend most easily without breaking invariants. When two feel tied, prefer the cleaner boundary or smaller API, per the Laziness Protocol.

## Phase E: Graft

Walk each losing candidate once more and identify what is worth porting into the base. The signal is usually one or two things per candidate, not most of it.

Fold each graft in by hand, per the **redesign-from-first-principles** principle skill. Don't paste mechanically. The result has to remain coherent under one mental model.
Walk each losing candidate once more for what is worth porting into the base, usually one or two things per candidate, not most of it. Fold each graft in by hand, per the **redesign-from-first-principles** principle skill, so the result stays coherent under one mental model. Don't paste mechanically.

Record what was grafted, from which candidate, and what was rejected and why.

When N candidates converge on the same shape, that is a strong agreement signal. Note the convergence in the record and ship the consensus shape. No graft is needed. When N candidates wildly diverge, Phase A was under-specified. Reframe and re-run rather than averaging the divergence.
If the candidates converge on one shape, that is strong agreement. Note it and ship the consensus shape. No graft is needed. If they wildly diverge, Phase A was under-specified. Reframe and re-run rather than averaging the divergence.

## Phase F: Verify

The synthesized artifact has to hold up under the same scrutiny as any other output, per the **prove-it-works** principle skill.

If verification surfaces a problem the arena did not catch, either Phase A was wrong (re-frame and re-run) or one candidate caught it and you missed the graft (go back to Phase E). Don't paper over.
Verify the synthesized artifact like any other output, per the **prove-it-works** principle skill. If verification finds a problem the arena missed, either Phase A was wrong (re-frame and re-run) or a candidate caught it and you missed the graft (go back to Phase E). Don't paper over it.

## Outputs

One synthesized artifact. One short synthesis note alongside, naming the base, the grafts (with source candidate), the rejections, the dropouts if any, and the verification result.
One synthesized artifact, with a short synthesis note alongside naming the base and why, the cross-judge's verdict, each graft with its source candidate, what was rejected and why, any convergence or dropouts, and the verification result.
Loading
Loading