devlyn-cli 1.8.1 → 1.9.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/CLAUDE.md CHANGED
@@ -56,13 +56,17 @@ For hands-free build-evaluate-polish cycles — works for bugs, features, refact
56
56
  /devlyn:auto-resolve [task description]
57
57
  ```
58
58
 
59
- This runs the full pipeline automatically: **Build → Browser Validate → Evaluate → Fix Loop → Simplify → Review → Security Review → Clean → Docs**. Each phase runs as a separate subagent with its own context. Communication between phases happens via files (`.devlyn/done-criteria.md`, `.devlyn/EVAL-FINDINGS.md`, `.devlyn/BROWSER-RESULTS.md`).
59
+ This runs the full pipeline automatically: **Build → Build Gate → Browser Validate → Evaluate → Fix Loop → Simplify → Review → Security Review → Clean → Docs**. Each phase runs as a separate subagent with its own context. Communication between phases happens via files (`.devlyn/done-criteria.md`, `.devlyn/BUILD-GATE.md`, `.devlyn/EVAL-FINDINGS.md`, `.devlyn/BROWSER-RESULTS.md`).
60
+
61
+ The **Build Gate** (Phase 1.4) runs real compilers, typecheckers, and linters — the same commands CI/Docker/production will run. It auto-detects project types (Next.js, Rust, Go, Solidity, Expo, Swift, etc.) and Dockerfiles. This is the primary defense against "tests pass locally, breaks in CI/Docker" class of bugs (type errors in un-tested files, cross-package drift, Dockerfile copy mismatches).
60
62
 
61
63
  For web projects, the Browser Validate phase starts the dev server and tests the implemented feature in a real browser — clicking buttons, filling forms, verifying results. If the feature doesn't work, findings feed back into the fix loop.
62
64
 
63
65
  Optional flags:
64
66
  - `--max-rounds 6` — increase max evaluate-fix iterations (default: 4)
65
67
  - `--skip-browser` — skip browser validation phase (auto-skipped for non-web changes)
68
+ - `--skip-build-gate` — skip the deterministic build gate (not recommended)
69
+ - `--build-gate strict` — treat warnings as errors; `--build-gate no-docker` — skip Docker builds for speed
66
70
  - `--skip-review` — skip team-review phase
67
71
  - `--skip-clean` — skip clean phase
68
72
  - `--skip-docs` — skip update-docs phase
@@ -76,7 +80,7 @@ After completing a roadmap (or a phase), verify that everything was actually imp
76
80
  /devlyn:preflight
77
81
  ```
78
82
 
79
- This reads every commitment from VISION.md, ROADMAP.md, and item specs, then audits the codebase evidence-based. Finds: missing features, incomplete implementations, spec divergence, bugs, stale documentation. Also checks in the browser for web projects.
83
+ This reads every commitment from VISION.md, ROADMAP.md, and item specs, then audits the codebase evidence-based. The code auditor now runs real build/typecheck commands as its first step — any project that doesn't compile is flagged as BROKEN at CRITICAL severity before individual commitments are even checked. Also checks in the browser for web projects.
80
84
 
81
85
  Output: `.devlyn/PREFLIGHT-REPORT.md` with categorized findings (MISSING, INCOMPLETE, DIVERGENT, BROKEN, STALE_DOC). Confirmed gaps can be promoted to new roadmap items for auto-resolve.
82
86
 
package/README.md CHANGED
@@ -65,18 +65,20 @@ Point it at a spec (or just describe what you want) and walk away.
65
65
  /devlyn:auto-resolve "Implement per spec at docs/roadmap/phase-1/1.1-user-auth.md"
66
66
  ```
67
67
 
68
- It runs a **9-phase pipeline** autonomously:
68
+ It runs a **10-phase pipeline** autonomously:
69
69
 
70
70
  ```
71
- Build → Browser Test → Evaluate → Fix Loop → Simplify → Review → Security → Clean → Docs
71
+ Build → Build Gate → Browser Test → Evaluate → Fix Loop → Simplify → Review → Security → Clean → Docs
72
72
  ```
73
73
 
74
74
  - Each phase runs as a separate agent with fresh context
75
75
  - Git checkpoints at every phase for safe rollback
76
+ - **Build Gate** runs your project's real compilers, typecheckers, and linters — catches type errors, cross-package drift, and Docker build failures that tests alone miss. Auto-detects project type (Next.js, Rust, Go, Solidity, Expo, Swift, and more) and Dockerfiles.
76
77
  - Browser validation tests your feature end-to-end (clicks, forms, verification)
77
78
  - Evaluation grades against done-criteria — if it fails, auto-fix and re-evaluate
78
79
 
79
- Skip phases you don't need: `--skip-browser`, `--skip-review`, `--skip-clean`, `--skip-docs`, `--max-rounds 6`
80
+ Skip phases you don't need: `--skip-browser`, `--skip-review`, `--skip-clean`, `--skip-docs`, `--skip-build-gate`, `--max-rounds 6`
81
+ Customize the build gate: `--build-gate strict` (warnings = errors), `--build-gate no-docker` (skip Docker builds for speed)
80
82
 
81
83
  ### Step 3 — Verify with `/devlyn:preflight`
82
84
 
@@ -31,6 +31,8 @@ This pipeline runs hands-free. The user launches it to walk away and come back t
31
31
  - `--skip-clean` (false) — skip clean phase
32
32
  - `--skip-browser` (false) — skip browser validation phase (auto-skipped for non-web changes)
33
33
  - `--skip-docs` (false) — skip update-docs phase
34
+ - `--skip-build-gate` (false) — skip the deterministic build gate (Phase 1.4). Not recommended — the build gate is the primary defense against "tests pass locally, breaks in CI/Docker/production" class of bugs.
35
+ - `--build-gate MODE` (auto) — controls build gate behavior. `auto`: detect project type and run appropriate build/typecheck/lint commands; if Dockerfile(s) are present, Docker builds are included automatically. `strict`: auto + treat warnings as errors. `no-docker`: auto but skip Docker builds even if Dockerfiles exist (for faster iteration). `skip`: same as --skip-build-gate.
34
36
  - `--with-codex` (false) — use OpenAI Codex as a cross-model evaluator/reviewer via `mcp__codex-cli__*` MCP tools. Accepts: `evaluate`, `review`, or `both` (default when flag is present without value). When enabled, Codex provides an independent second opinion from a different model family, creating a GAN-like dynamic where Claude builds and Codex critiques.
35
37
 
36
38
  Flags can be passed naturally: `/devlyn:auto-resolve fix the auth bug --max-rounds 3 --skip-docs`
@@ -43,7 +45,7 @@ This pipeline runs hands-free. The user launches it to walk away and come back t
43
45
  ```
44
46
  Auto-resolve pipeline starting
45
47
  Task: [extracted task description]
46
- Phases: Build → [Browser] → Evaluate → [Fix loop if needed] → Simplify → [Review] → [Security] → [Clean] → [Docs]
48
+ Phases: Build → Build Gate → [Browser] → Evaluate → [Fix loop if needed] → Simplify → [Review] → [Security] → [Clean] → [Docs]
47
49
  Max evaluation rounds: [N]
48
50
  Cross-model evaluation (Codex): [evaluate / review / both / disabled]
49
51
  ```
@@ -86,6 +88,63 @@ The task is: [paste the task description here]
86
88
  3. If no changes were made, report failure and stop
87
89
  4. **Checkpoint**: Run `git add -A && git commit -m "chore(pipeline): phase 1 — build complete"` to create a rollback point
88
90
 
91
+ ## PHASE 1.4: BUILD GATE
92
+
93
+ Skip if `--skip-build-gate` or `--build-gate skip` was set.
94
+
95
+ This phase runs the project's real build, typecheck, and lint commands — the same ones CI, Docker, and production environments will run. It catches the entire class of bugs that LLM-based evaluation and test suites cannot: type errors in un-tested files, cross-package type drift in monorepos, lint violations, missing production dependencies, and Dockerfile copy mismatches.
96
+
97
+ This is deterministic — if the compiler says no, the pipeline stops. No LLM judgment involved.
98
+
99
+ Spawn a subagent using the Agent tool with `mode: "bypassPermissions"`.
100
+
101
+ Agent prompt — pass this to the Agent tool:
102
+
103
+ You are the build gate agent. Read `references/build-gate.md` from the auto-resolve skill directory for the full project-type detection matrix and execution rules.
104
+
105
+ Your job: detect every project type in this repo, run their build/typecheck/lint commands, and report results. You do NOT reason about code quality — you run commands and faithfully report what they output.
106
+
107
+ 1. Read the detection matrix in `references/build-gate.md`
108
+ 2. Scan the repo to detect all matching project types (a monorepo may match several)
109
+ 3. Detect the package manager (npm/pnpm/yarn/bun) per the rules in the reference file
110
+ 4. Run all gate commands. Sequential within a project type, parallel across unrelated types.
111
+ 5. If `--build-gate strict` is set, apply strict-mode flags per the reference file
112
+ 6. Run Dockerfile builds if Dockerfiles are detected, UNLESS `--build-gate no-docker` is set (see reference file)
113
+ 7. Write results to `.devlyn/BUILD-GATE.md` following the output format in the reference file
114
+
115
+ For failures: include the FULL error output (not truncated) and extract root file:line references with concrete fix guidance so the fix agent knows exactly where to look.
116
+
117
+ **After the agent completes**:
118
+ 1. Read `.devlyn/BUILD-GATE.md`
119
+ 2. Extract verdict
120
+ 3. Branch:
121
+ - `PASS` → continue to PHASE 1.5
122
+ - `FAIL` → go to PHASE 1.4-fix (build gate fix loop)
123
+
124
+ ## PHASE 1.4-fix: BUILD GATE FIX LOOP
125
+
126
+ Triggered only when PHASE 1.4 returns FAIL.
127
+
128
+ Track a round counter (shared with the main fix loop counter against `max-rounds`). If `round >= max-rounds`, stop with a clear failure report — do NOT continue to evaluate/browser/etc. Code that doesn't build cannot be meaningfully evaluated or tested.
129
+
130
+ Spawn a subagent using the Agent tool with `mode: "bypassPermissions"`.
131
+
132
+ Agent prompt — pass this to the Agent tool:
133
+
134
+ Read `.devlyn/BUILD-GATE.md` — it contains deterministic build/typecheck/lint failures from real compiler output. These are not opinions; the compiler rejected this code. Fix every listed failure at the root cause level.
135
+
136
+ For each failure:
137
+ 1. Read the referenced file:line and enough surrounding context to understand the error
138
+ 2. For type errors: check BOTH sides of the type contract — the consumer AND the type definition. The fix may belong to either side. Do NOT suppress errors with `any`, `@ts-ignore`, `as unknown as`, `// eslint-disable`, or equivalent escape hatches.
139
+ 3. For lint errors: fix the underlying issue, do not disable the rule.
140
+ 4. For missing module/dependency errors: investigate the cause — it may be a missing dep in package.json, a typo in the import path, or a tsconfig paths misconfiguration.
141
+ 5. After fixing, do NOT re-run the build yourself. The orchestrator re-runs PHASE 1.4.
142
+
143
+ **After the agent completes**:
144
+ 1. **Checkpoint**: `git add -A && git commit -m "chore(pipeline): build gate fix round [N]"`
145
+ 2. Increment round counter
146
+ 3. Go back to PHASE 1.4 (re-run the gate)
147
+
89
148
  ## PHASE 1.5: BROWSER VALIDATE (conditional)
90
149
 
91
150
  Skip if `--skip-browser` was set.
@@ -284,7 +343,7 @@ Synchronize documentation with recent code changes. Use `git log --oneline -20`
284
343
  After all phases complete:
285
344
 
286
345
  1. Clean up temporary files:
287
- - Delete the `.devlyn/` directory entirely (contains done-criteria.md, EVAL-FINDINGS.md, BROWSER-RESULTS.md, screenshots/, playwright temp files)
346
+ - Delete the `.devlyn/` directory entirely (contains done-criteria.md, BUILD-GATE.md, EVAL-FINDINGS.md, BROWSER-RESULTS.md, screenshots/, playwright temp files)
288
347
  - Kill any dev server process still running from browser validation
289
348
 
290
349
  2. Run `git log --oneline -10` to show commits made during the pipeline
@@ -300,6 +359,7 @@ After all phases complete:
300
359
  | Phase | Status | Notes |
301
360
  |-------|--------|-------|
302
361
  | Build (team-resolve) | [completed] | [brief summary] |
362
+ | Build gate | [completed / skipped / FAIL after N rounds] | [project types detected, commands run, pass/fail per command] |
303
363
  | Browser validate | [completed / skipped / auto-skipped] | [verdict, tier used, console errors, flow results] |
304
364
  | Evaluate (Claude) | [PASS/NEEDS WORK after N rounds] | [verdict + key findings] |
305
365
  | Evaluate (Codex) | [completed / skipped] | [Codex-only findings count, merged verdict] |
@@ -0,0 +1,116 @@
1
+ # Build Gate — Project Type Detection & Commands
2
+
3
+ Reference for PHASE 1.4 (Build Gate). The build gate agent reads this file to determine which commands to run.
4
+
5
+ ---
6
+
7
+ ## Project Type Detection Matrix
8
+
9
+ Inspect the repository root and subdirectories (up to 2 levels). A repo can match **multiple** signals — run ALL matching gates. Do not pick "the main one"; a monorepo with a Next.js dashboard + Rust service needs both.
10
+
11
+ | Signal file(s) | Project type | Gate commands (run in order) |
12
+ |---|---|---|
13
+ | `package.json` with `next` dep | Next.js | `npx tsc --noEmit` → `npx next build` |
14
+ | `package.json` with `nuxt` dep | Nuxt | `npx nuxi typecheck` → `npx nuxi build` |
15
+ | `package.json` with `vite` + `tsconfig.json` | Vite+TS | `npx tsc --noEmit` → `npm run build` (if script exists) |
16
+ | `package.json` with `expo` dep | Expo (React Native) | `npx tsc --noEmit` → `npx expo-doctor` |
17
+ | `package.json` with `react-native` (no expo) | React Native | `npx tsc --noEmit` |
18
+ | `package.json` with `svelte` + `@sveltejs/kit` | SvelteKit | `npm run check` → `npm run build` |
19
+ | `package.json` only, has `build` script | Generic Node | `npm run build` |
20
+ | `package.json` only, has `tsconfig.json` but no `build` | TS library | `npx tsc --noEmit` |
21
+ | `pnpm-workspace.yaml` / `turbo.json` / `lerna.json` | Monorepo | `pnpm -r build` or `turbo run build typecheck lint` — **workspace-wide**, NOT just the changed package |
22
+ | `Cargo.toml` | Rust | `cargo check --all-targets` → `cargo clippy -- -D warnings` |
23
+ | `go.mod` | Go | `go build ./...` → `go vet ./...` |
24
+ | `foundry.toml` | Foundry (Solidity) | `forge build` |
25
+ | `hardhat.config.{js,ts,cjs}` | Hardhat (Solidity) | `npx hardhat compile` |
26
+ | `Anchor.toml` | Anchor (Solana) | `anchor build` |
27
+ | `Move.toml` | Move (Sui/Aptos) | `sui move build` or `aptos move compile` |
28
+ | `pyproject.toml` / `setup.py` + mypy config | Python+mypy | `mypy .` |
29
+ | `pyproject.toml` with `ruff` | Python+Ruff | `ruff check .` |
30
+ | `Package.swift` | Swift package | `swift build` |
31
+ | `*.xcodeproj` / `*.xcworkspace` | iOS/macOS (Xcode) | Skip by default — log "Xcode project detected, manual build gate recommended". Too project-specific without knowing the scheme. |
32
+ | `build.gradle*` / `settings.gradle*` | Gradle/Android | `./gradlew assembleDebug` (debug, not release — keep it fast) |
33
+ | `CMakeLists.txt` | C/C++ (CMake) | `cmake -B build && cmake --build build` |
34
+ | `Makefile` (with no other signals) | Generic Make | `make` (only if no other type matched — Makefiles are too generic) |
35
+ | `Unity/ProjectSettings/` or `ProjectSettings/ProjectVersion.txt` | Unity | Skip by default — log "Unity project detected, manual build gate recommended" |
36
+ | `project.godot` | Godot | Skip by default — log "Godot project detected, manual build gate recommended" |
37
+ | `Dockerfile*` | Docker | `docker build -f <dockerfile> -t _pipeline_gate_test .` — included by default in `auto` mode. Skip with `--build-gate no-docker`. |
38
+
39
+ ## Package Manager Detection
40
+
41
+ Respect the project's package manager. Check in order:
42
+ 1. `packageManager` field in root `package.json` → use that
43
+ 2. `pnpm-lock.yaml` exists → `pnpm`
44
+ 3. `yarn.lock` exists → `yarn`
45
+ 4. `bun.lockb` / `bun.lock` exists → `bun`
46
+ 5. Default → `npm`
47
+
48
+ Replace `npm run build` / `npx` accordingly: `pnpm build` / `pnpm exec`, `yarn build` / `yarn`, `bun run build` / `bunx`.
49
+
50
+ ## Monorepo Handling
51
+
52
+ Monorepo is the most critical case — cross-package type drift is the #1 source of "tests pass locally, build fails in CI."
53
+
54
+ 1. Detect workspace root markers: `pnpm-workspace.yaml`, `turbo.json`, `lerna.json`, `workspaces` in root `package.json`
55
+ 2. Run gates at the **workspace root** level, not per-changed-package:
56
+ - Turbo: `turbo run build typecheck lint` (respects dependency graph)
57
+ - pnpm: `pnpm -r build` (runs in topological order)
58
+ - yarn workspaces: `yarn workspaces foreach -A run build`
59
+ - npm workspaces: `npm run build --workspaces`
60
+ 3. This ensures Package A's type change that breaks Package B's consumer is caught, even if only Package A was directly modified.
61
+
62
+ ## Strict Mode (`--build-gate strict`)
63
+
64
+ When strict mode is set, treat warnings as failures:
65
+ - TypeScript: add `--strict` if not already in tsconfig (or verify it's set)
66
+ - Clippy: `-D warnings` (already default in the matrix)
67
+ - ESLint: `--max-warnings 0`
68
+ - Go vet: already treats warnings as errors
69
+ - Foundry: `--deny-warnings`
70
+
71
+ In default (auto) mode, only hard errors (non-zero exit code from the tool's perspective) block.
72
+
73
+ ## Docker Build (default in `auto` mode)
74
+
75
+ When `Dockerfile*` files are detected AND `--build-gate no-docker` is NOT set:
76
+ 1. Run all non-Docker gates first (they're faster and catch most errors before the slow Docker step)
77
+ 2. Then run `docker build -f <dockerfile> -t _pipeline_gate_test .` for each Dockerfile found in the repo root and subdirectories (up to 2 levels)
78
+ 3. If Docker daemon is not available, log the skip with a warning but do NOT fail — developers without Docker should not be blocked. The warning should note: "Docker builds were skipped because the Docker daemon is unavailable. Use `--build-gate no-docker` to suppress this warning, or ensure Docker is running to catch Dockerfile-specific issues."
79
+ 4. This catches Dockerfile-specific issues that no other gate can: COPY paths referencing files excluded by .dockerignore, multi-stage build failures, production-only dependency resolution, and environment differences between dev and container builds
80
+
81
+ Use `--build-gate no-docker` to skip Docker builds for faster iteration during development — the language-level gates (tsc, cargo check, etc.) still run and catch the majority of issues. Docker builds are most valuable as a final gate before shipping.
82
+
83
+ ## Output Format
84
+
85
+ Write results to `.devlyn/BUILD-GATE.md`:
86
+
87
+ ```markdown
88
+ # Build Gate Results
89
+ ## Verdict: [PASS / FAIL]
90
+ ## Detected Project Types
91
+ - [type] ([path/])
92
+ ## Gate Commands Run
93
+ | # | Command | Dir | Exit | Status | Time |
94
+ |---|---|---|---|---|---|
95
+ | 1 | `npx tsc --noEmit` | dashboard/ | 0 | PASS | 4.2s |
96
+ | 2 | `npx next build` | dashboard/ | 1 | FAIL | 9.8s |
97
+ | 3 | `cargo check --all-targets` | services/indexer/ | 0 | PASS | 12.1s |
98
+
99
+ ## Failures
100
+
101
+ ### Command #2: `npx next build` (dashboard/, exit 1)
102
+ ```
103
+ [full error output — do NOT truncate. Build errors reference files from earlier in output.]
104
+ ```
105
+
106
+ **Root file:line(s)**:
107
+ - `dashboard/app/(dashboard)/settings/page.tsx:90` — Type error: Property 'config' does not exist on type 'SettingsTabsProps'
108
+
109
+ **Fix guidance**:
110
+ Read `dashboard/app/(dashboard)/settings/page.tsx:88-93` and `dashboard/components/settings/SettingsTabs.tsx` (the SettingsTabsProps type definition). Either add `config` to SettingsTabsProps or remove the prop from the parent. Then re-run `npx next build` from `dashboard/` to verify.
111
+ ```
112
+
113
+ Verdict rules:
114
+ - Any exit code != 0 → **FAIL**
115
+ - All exit codes == 0 → **PASS**
116
+ - No gates detected → **PASS** with note "No build gate detected — project type unknown. Consider adding `--build-gate deploy` if Dockerfiles are present."
@@ -8,6 +8,19 @@ You are auditing a codebase against its planning commitments. Your job is to ver
8
8
 
9
9
  Read `.devlyn/commitment-registry.md` for the full list of commitments to verify. Skip any items in the "Not Started (Planned)" section — those are acknowledged future work, not gaps.
10
10
 
11
+ **Step 0 — Build health check**: Before auditing individual commitments, verify the project actually builds. Detect the project type(s) and run their build/typecheck commands:
12
+ - `package.json` with `next` → `npx tsc --noEmit && npx next build`
13
+ - `package.json` with `vite` + `tsconfig.json` → `npx tsc --noEmit`
14
+ - `Cargo.toml` → `cargo check --all-targets`
15
+ - `go.mod` → `go build ./... && go vet ./...`
16
+ - `foundry.toml` → `forge build`
17
+ - `hardhat.config.*` → `npx hardhat compile`
18
+ - Monorepo (`pnpm-workspace.yaml`/`turbo.json`) → workspace-wide build
19
+ - `Dockerfile*` → `docker build` (if Docker available)
20
+ - For other project types, look for a `build` script in `package.json` or equivalent
21
+
22
+ Any build/typecheck failure is a BROKEN finding at CRITICAL severity — code that doesn't compile cannot fulfill any commitment. Include the full compiler error output with file:line references. This catches type errors, missing imports, cross-package drift, and Dockerfile build failures that text-based code reading alone cannot detect.
23
+
11
24
  **For each active commitment (not planned):**
12
25
  1. Search the codebase for its implementation (use Grep, Glob, Read in parallel where possible)
13
26
  2. Read the implementing code thoroughly — line by line for critical paths
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devlyn-cli",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "description": "AI development toolkit for Claude Code — ideate, auto-resolve, and ship with context engineering and agent orchestration",
5
5
  "homepage": "https://github.com/fysoul17/devlyn-cli#readme",
6
6
  "bin": {