5-phase-workflow 3.0.0 → 3.1.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/README.md +31 -101
- package/bin/install.js +168 -176
- package/bin/sync-agents.js +59 -54
- package/docs/workflow-guide.md +35 -79
- package/package.json +2 -2
- package/src/agents/step-executor-agent.md +5 -4
- package/src/agents/step-orchestrator-agent.md +12 -12
- package/src/agents/verification-agent.md +7 -8
- package/src/codex-commands/plan.md +65 -0
- package/src/commands/5/address-review-findings.md +43 -52
- package/src/commands/5/analyze-feature.md +1 -1
- package/src/commands/5/configure.md +75 -179
- package/src/commands/5/eject.md +0 -1
- package/src/commands/5/implement.md +78 -68
- package/src/commands/5/lean-check.md +75 -0
- package/src/commands/5/reconfigure.md +48 -129
- package/src/commands/5/review.md +42 -14
- package/src/commands/5/synchronize-agents.md +1 -1
- package/src/commands/5/update.md +2 -2
- package/src/hooks/dependency-guard.js +150 -0
- package/src/hooks/statusline.js +5 -3
- package/src/references/configure-tables.md +0 -33
- package/src/settings.json +3 -4
- package/src/skills/baseline-conventions/SKILL.md +37 -0
- package/src/skills/cognitive-load/SKILL.md +52 -0
- package/src/skills/configure-agents-md/SKILL.md +72 -0
- package/src/skills/configure-rules/SKILL.md +146 -0
- package/src/skills/documentation-style/SKILL.md +32 -0
- package/src/skills/fowler-code-smells/SKILL.md +25 -0
- package/src/skills/review-style/SKILL.md +142 -0
- package/src/templates/AGENTS.md +31 -31
- package/src/templates/workflow/REVIEW-FINDINGS.md +2 -9
- package/src/workflows/5-implement.js +67 -92
- package/docs/findings.md +0 -361
- package/docs/progress.md +0 -102
- package/src/commands/5/apply-review-findings.md +0 -66
- package/src/commands/5/commit.md +0 -43
- package/src/commands/5/plan.md +0 -189
- package/src/commands/5/reply-pr-comments.md +0 -48
- package/src/commands/5/split.md +0 -86
- package/src/commands/5/triage-pr-comments.md +0 -70
- package/src/hooks/config-guard.js +0 -30
- package/src/skills/configure-docs-index/SKILL.md +0 -243
- package/src/skills/configure-skills/SKILL.md +0 -311
- package/src/skills/generate-readme/EXAMPLES.md +0 -168
- package/src/skills/generate-readme/SKILL.md +0 -122
- package/src/skills/generate-readme/TEMPLATE.md +0 -141
- package/src/skills/use-index/SKILL.md +0 -49
- package/src/templates/ARCHITECTURE.md +0 -33
- package/src/templates/CONCERNS.md +0 -33
- package/src/templates/CONVENTIONS.md +0 -74
- package/src/templates/TESTING.md +0 -24
- package/src/templates/workflow/FIX-PLAN.md +0 -55
- package/src/templates/workflow/PLAN-COMPACT.md +0 -42
- package/src/templates/workflow/PLAN.md +0 -76
- package/src/templates/workflow/REVIEW-SUMMARY.md +0 -53
package/README.md
CHANGED
|
@@ -1,131 +1,57 @@
|
|
|
1
1
|
# foifi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Vision
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Install foifi in a project and it sets up Claude Code (or Codex) for you, so you don't have to micromanage the AI setup. The result is an assistant that:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **plans well**, and backs its plans with diagrams where a picture explains more than text
|
|
8
|
+
- **writes good, stable, well-structured, and secure code**, and prefers clean code
|
|
9
|
+
- **reviews its own work automatically** before you see it
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
Two rules keep foifi honest:
|
|
10
12
|
|
|
11
|
-
**
|
|
12
|
-
|
|
13
|
-
2. **Implement** (`/5:implement`) — an orchestrator agent turns the plan into a typed execution graph, then delegates each component to a focused executor agent, firing independent components in parallel waves. A verification agent checks completeness, correctness, and test coverage at the end of every run.
|
|
14
|
-
3. **Review** (`/5:review`) — wraps Claude Code's built-in `code-review` skill, produces structured findings, and feeds them into `/5:address-review-findings` for interactive fix decisions and PR replies.
|
|
15
|
-
|
|
16
|
-
This separation keeps planning readable, implementation mechanical, and review structured. Where Claude Code ships a native capability, foifi wraps it rather than reimplementing it — what foifi adds is the durable repo-local artifact and the ticket/config conventions around it.
|
|
17
|
-
|
|
18
|
-
**Code review and findings** — `/5:review` triages changed files and produces structured `review-findings-*.md`. `/5:address-review-findings` presents each finding interactively, records `fix`/`wont_fix`/`wait` decisions, applies approved local fixes, handles PR comment replies, and keeps a decision log — all without losing context between sessions.
|
|
19
|
-
|
|
20
|
-
**Plan management helpers** — `/5:split` breaks a large plan into smaller linked child plans. `/5:reconfigure` refreshes docs and skills when the project evolves.
|
|
21
|
-
|
|
22
|
-
**Codex support** — Every command has a `$5-*` Codex equivalent. Codex runs are token-budgeted: simple steps use a lighter model and low reasoning, complex or security-sensitive steps escalate automatically.
|
|
23
|
-
|
|
24
|
-
### The name
|
|
25
|
-
|
|
26
|
-
"foifi" is Swiss German for *five*. The name comes from the project's original 5-phase workflow. That workflow has since been streamlined into the current 3-phase plan → implement → review loop, but the name stuck — and all commands still carry the `/5:` prefix.
|
|
13
|
+
- **Stay lean.** What Claude Code already does well — plan mode, code review, exploring the code — foifi uses as it is. foifi adds only the glue: conventions, durable artifacts, and checks. It never runs a parallel process that competes with the native one.
|
|
14
|
+
- **Your standards win.** foifi reads the standards a project already has, such as `CONTRIBUTING.md`, a code style guide, or an existing `CLAUDE.md` / `AGENTS.md`, and follows them. It never overwrites them. Its own style rules only fill the gaps a project leaves open.
|
|
27
15
|
|
|
28
16
|
## Install
|
|
29
17
|
|
|
30
18
|
```bash
|
|
31
|
-
npx foifi
|
|
32
|
-
npx foifi --codex
|
|
19
|
+
npx foifi # Claude Code, this project
|
|
20
|
+
npx foifi --codex # Codex
|
|
21
|
+
npx foifi --global # all projects (~/.claude/)
|
|
33
22
|
```
|
|
34
23
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npx foifi --global
|
|
39
|
-
npx foifi --codex --global
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Claude Code installs commands under `.claude/`. Codex installs converted skills under `.codex/skills/`.
|
|
43
|
-
|
|
44
|
-
## Configure
|
|
45
|
-
|
|
46
|
-
Run configuration once per project:
|
|
24
|
+
Then configure the project once:
|
|
47
25
|
|
|
48
26
|
```bash
|
|
49
27
|
/5:configure
|
|
50
|
-
# or in Codex
|
|
51
|
-
$5-configure
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Configuration writes `.5/config.json` and `.5/features/CONFIGURE/plan.md`. Then run:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
28
|
/5:implement CONFIGURE
|
|
58
|
-
# or
|
|
59
|
-
$5-implement CONFIGURE
|
|
60
29
|
```
|
|
61
30
|
|
|
62
|
-
|
|
31
|
+
This adds the foifi rules to `AGENTS.md` as one marked block, links your existing standards from it, and makes `CLAUDE.md` include it. Nothing else in your files or settings changes.
|
|
63
32
|
|
|
64
33
|
## Workflow
|
|
65
34
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/5:implement {feature-name}
|
|
70
|
-
/5:review
|
|
71
|
-
/5:address-review-findings {feature-name}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Codex equivalents:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
$5-plan
|
|
78
|
-
$5-split {feature-name}
|
|
79
|
-
$5-implement {feature-name}
|
|
80
|
-
$5-review
|
|
81
|
-
$5-address-review-findings {feature-name}
|
|
82
|
-
```
|
|
35
|
+
1. **Plan** — use Claude Code's plan mode (shift+tab). Plans include a mermaid diagram where it helps.
|
|
36
|
+
2. **Approve** — Claude runs `/5:implement` on its own: small plans directly, larger ones with parallel agents. It checks that the build and tests pass.
|
|
37
|
+
3. **Review** — runs automatically after the implementation: correctness, security, and your standards. Claude fixes the clear findings itself and asks you only about real decisions, one question at a time.
|
|
83
38
|
|
|
84
|
-
|
|
39
|
+
On Codex, start with `$5-plan`; the rest is the same.
|
|
85
40
|
|
|
86
41
|
## Commands
|
|
87
42
|
|
|
88
43
|
| Command | Purpose |
|
|
89
44
|
|---------|---------|
|
|
90
|
-
| `/5:
|
|
91
|
-
| `/5:
|
|
92
|
-
| `/5:
|
|
93
|
-
| `/5:
|
|
94
|
-
| `/5:
|
|
95
|
-
| `/5:
|
|
96
|
-
| `/5:
|
|
97
|
-
| `/5:
|
|
98
|
-
| `/5:update` / `$5-update` | Upgrade installed workflow files |
|
|
99
|
-
| `/5:eject` / `$5-eject` | Stop workflow-managed updates |
|
|
100
|
-
| `/5:synchronize-agents` / `$5-synchronize-agents` | Sync user content between Claude Code and Codex |
|
|
101
|
-
|
|
102
|
-
## Artifacts
|
|
103
|
-
|
|
104
|
-
Each feature lives under `.5/features/{feature-name}/`:
|
|
105
|
-
|
|
106
|
-
- `plan.md` - single human-reviewed planning artifact
|
|
107
|
-
- `codebase-scan.md` - cached discovery used to reduce repeated scanning
|
|
108
|
-
- `state.json` - small resume record: status, completed components, verification result
|
|
109
|
-
- `split-manifest-*.json` - parent feature record for child plans created by `/5:split`
|
|
110
|
-
- `review-findings-*.md` - review output for `/5:address-review-findings`
|
|
111
|
-
- `review-decisions-*.json` - interactive fix/wont-fix/wait decisions for local findings
|
|
112
|
-
- `pr-comment-decisions.json` - PR review comment decisions when PR handling is used
|
|
113
|
-
|
|
114
|
-
## Design
|
|
45
|
+
| `/5:implement [plan]` | Implement a plan (runs automatically after approval) |
|
|
46
|
+
| `/5:review [low\|medium\|high\|max]` | Review any change on its own |
|
|
47
|
+
| `/5:address-review-findings [--interactive]` | Address saved review findings again; `--interactive` asks about each one |
|
|
48
|
+
| `/5:lean-check` | Check a diff for scope drift and over-engineering |
|
|
49
|
+
| `/5:analyze-feature` | Document an existing feature with diagrams |
|
|
50
|
+
| `/5:configure` / `/5:reconfigure` | Set up the project / refresh the AGENTS.md block and rules |
|
|
51
|
+
| `/5:update` / `/5:eject` | Update foifi / stop automatic updates |
|
|
52
|
+
| `/5:synchronize-agents` | Sync your own skills and rules between Claude Code and Codex |
|
|
115
53
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
Delegation is matched to the size of the job. Approving a plan means you want it built, so `/5:plan` finishes compact plans itself — for one or two files, the already-warm session beats anything an orchestrator can set up. Full plans go to `/5:implement`, where the cost is repaid: `step-orchestrator-agent` reads `plan.md` and `codebase-scan.md` and returns an execution graph, then each component goes to a `step-executor-agent` with an inline executor contract, independent components firing in parallel. Pattern context is passed as targeted references instead of broad file lists so executors read only the relevant ranges, and mechanical components run on a cheaper model than the ones that need reasoning.
|
|
119
|
-
|
|
120
|
-
State is kept to what is actually read. The execution graph is derived fresh on every run and never written to disk; `state.json` persists only the status, the completed component names, and the verification result, which is all a resume needs. Component names are copied verbatim from the plan's checklist, so a re-derived graph still matches what already ran. Live progress comes from the task list, not from a file.
|
|
121
|
-
|
|
122
|
-
Verification uses a dedicated agent. `/5:implement` runs `verification-agent` at the end, passing it the pre-change baseline so pre-existing failures are not blamed on the change, and records a concise final status without generating an extra report.
|
|
123
|
-
|
|
124
|
-
Review delegates to Claude Code's built-in `code-review` skill (default effort `high`, override with `/5:review {low|medium|high|max}`) and maps its findings into the workflow's findings file. Where that skill is unavailable — Codex, for example — a built-in review agent takes over and triages changed files by risk instead. `/5:address-review-findings` presents each finding one by one with a recommendation, records `fix`/`wont_fix`/`wait` decisions, then coordinates narrower helpers for approved local fixes, PR comment triage, and PR replies so the common path stays compact.
|
|
125
|
-
|
|
126
|
-
Reconfiguration uses a compact `.5/reconfigure-manifest.json` to pass refresh decisions to documentation and skill generation helpers without duplicating long detection summaries in prompts.
|
|
127
|
-
|
|
128
|
-
For Codex installs, the workflow is token-budgeted: exploration, orchestration, and simple executors default to `gpt-5.4-mini` with low reasoning. Complex logic, security-sensitive work, data migrations, public API changes, final verification that needs deeper review, and failed retries escalate to `gpt-5.4` with medium reasoning.
|
|
54
|
+
Codex uses `$5-…` instead of `/5:…`.
|
|
129
55
|
|
|
130
56
|
## Updating
|
|
131
57
|
|
|
@@ -134,4 +60,8 @@ npx foifi --upgrade
|
|
|
134
60
|
npx foifi --codex --upgrade
|
|
135
61
|
```
|
|
136
62
|
|
|
137
|
-
|
|
63
|
+
The status line shows when an update is available. Run `/5:reconfigure` after a major version.
|
|
64
|
+
|
|
65
|
+
## The name
|
|
66
|
+
|
|
67
|
+
"foifi" is Swiss German for *five*. The name comes from the original 5-phase workflow; the commands still carry the `/5:` prefix.
|