Repository navigation
chore(devex): add Taskfile, test-auto, slim CLAUDE.md - #1270
Conversation
Add Taskfile.yml with 15 standard tasks (fmt, lint, test, test:integration, test:auto, build, dev, deps, ent:*, migrations:*) so that `task fmt/lint/test` work as required by the verify-before-completion rule. Add dev-scripts/test-auto.sh: auto-detects whether backing services are running (port checks on 9000/5432/3306/6379), starts `nix run .#deps` in the background if not, enables all integration env vars, runs `go test -race ./...`, and tears down on exit. Add pkgs.go-task to the devshell (devshell-only, not docker-dev). Trim CLAUDE.md from 638 to 109 lines by removing sections now covered by .claude/rules/ and .agent/skills/: NarInfo migration runbook, integration test detail, code quality section, Helm/Kind detail. Keep project overview, task commands, architecture, and pointers to rules and skills. Replace build/ncps/test skills with a comprehensive tdd/ skill set. Add eight .claude/rules/ files covering TDD, verification, env setup, Ent migrations, panic policy, and nolint conventions. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
This change is part of the following stack: Change managed by git-spice. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds TDD skill docs and repository rules, a root Taskfile with standard tasks, a devscript to auto-orchestrate integration test dependencies, condenses CLAUDE.md, and records formal specs and design notes for the dev-experience changes. ChangesDeveloper Experience Framework
Estimated code review effort 🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive task runner configuration via Taskfile.yml and a helper script dev-scripts/test-auto.sh to streamline formatting, linting, and local integration testing. It also adds structured developer rules and a TDD skill set, while significantly slimming down CLAUDE.md to keep it concise. The reviewer feedback suggests two valuable improvements to dev-scripts/test-auto.sh: replacing the nc -z dependency with Bash's native /dev/tcp port checking for better portability, and adding a fail-fast check inside the service readiness loop to immediately detect if the background process dies.
This is a Go-only project. Replace the TypeScript-first examples in interface-design.md, mocking.md, and tests.md with Go-only examples, inlined directly under each concept rather than isolated in a separate "Go Examples" section. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (4)
openspec/changes/archive/2026-05-25-improve-devex/tasks.md (1)
24-30: 💤 Low valueConsider documenting error handling expectations.
The test-auto.sh script logic is well-described, but the task description could benefit from noting error handling expectations (e.g., what happens if port wait times out, if
nix run .#depsfails to start, or if services don't become healthy within the timeout).Since this is archived documentation of completed work, this enhancement would improve future reference but isn't critical.
📝 Suggested enhancement
- [x] 3.2 Create `dev-scripts/test-auto.sh`: - Check each backend port (9000/S3, 5432/PG, 3306/MySQL, 6379/Redis) via `nc -z` - If any are unreachable, start `nix run .#deps` in the background; capture PID - - Wait for all four ports with 60s timeout (poll every 2s) + - Wait for all four ports with 60s timeout (poll every 2s); exit with error if timeout exceeded - Run `eval "$(enable-integration-tests)"` and then `go test -race ./...` - - On exit (via `trap`), kill the background process if the script started it + - On exit (via `trap`), kill the background process if the script started it (handles success, failure, and interrupt) - Propagate the test exit code🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@openspec/changes/archive/2026-05-25-improve-devex/tasks.md` around lines 24 - 30, The task description for dev-scripts/test-auto.sh lacks explicit error-handling expectations; update the archived task text to state what should occur on failures: specify that if any nc -z port check ultimately times out (after the 60s, polling every 2s) the script should exit non‑zero and log a clear timeout error, that failure to start nix run .#deps must be detected (capture its PID and verify the process is running) and cause an error log and non‑zero exit, and that on any early exit the trap must still kill the background deps process started by the script and propagate the go test exit code after logging the failure; reference the script name dev-scripts/test-auto.sh and the commands nc -z, nix run .#deps, enable-integration-tests, trap in the description so future readers know the intended error behavior..claude/rules/no-commits-to-main.md (1)
5-5: 💤 Low valueConsider clarifying the
gs-createcommand.For readers unfamiliar with git-spice, briefly noting that
gs-createis the git-spice command for creating stacked branches would improve clarity.📝 Optional clarification
-All work must happen on a feature branch. Use `gs-create` to create a new stacked branch before committing. +All work must happen on a feature branch. Use `gs-create` (git-spice) to create a new stacked branch before committing.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/rules/no-commits-to-main.md at line 5, Update the rule text to clarify that `gs-create` is the git-spice command for creating stacked feature branches: change the sentence "Use `gs-create` to create a new stacked branch before committing." to something like "Use `gs-create` (the git-spice command for creating stacked branches) to create a new stacked feature branch before committing." to make the purpose and origin of `gs-create` explicit.CLAUDE.md (2)
94-94: ⚡ Quick winClarify "forward-only" migration policy.
The statement "migrations are forward-only" appears to conflict with the mention of
/migrate-downin the same sentence. Consider clarifying that/migrate-downis for development/testing rollback scenarios, or explaining how the expand-contract policy relates to forward-only production migrations.📝 Suggested clarification
-Use `/migrate-new` for schema changes, `/migrate-up` to apply, `/migrate-down` for the expand-contract policy (migrations are forward-only). +Use `/migrate-new` for schema changes, `/migrate-up` to apply. Migrations are forward-only in production; use `/migrate-down` only for local development rollback.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@CLAUDE.md` at line 94, Clarify the apparent contradiction by updating the sentence that mentions "/migrate-new", "/migrate-up", and "/migrate-down" to state that production migrations are forward-only (use /migrate-new and /migrate-up) while /migrate-down is allowed only for development/testing or rollback scenarios; also briefly explain that the "expand-contract" policy is a strategy for performing forward-compatible schema changes (expand in one release, contract in a later release) to avoid needing down migrations in production. Reference the commands /migrate-new, /migrate-up, /migrate-down and the term "expand-contract" so readers can understand which commands are for production vs dev/testing.
54-62: 💤 Low valueConsider listing all rules or clarifying "key rules" scope.
The rules section lists 6 rules but omits
no-commits-to-main.mdandno-skip-git-hooks.mdfrom the.claude/rules/directory introduced in this PR. If these are intentionally omitted as less critical, consider adding a note like "Key rules:" to clarify the selection criteria, or list all rules for completeness.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@CLAUDE.md` around lines 54 - 62, The "Key rules" list in CLAUDE.md omits two new rule files; update CLAUDE.md to either list all rule filenames from .claude/rules/ (including no-commits-to-main.md and no-skip-git-hooks.md) or explicitly clarify the scope by changing the heading/text to "Key rules (selected):" and add a brief sentence explaining the selection criteria; locate the existing block that lists tdd-required.md, verify-before-completion.md, env-execution.md, ent-migrations.md, no-panic-outside-main.md, and nolint-with-comments.md and add the missing filenames or the clarifying note there.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/rules/ent-migrations.md:
- Around line 90-96: Fix the markdown by replacing the malformed "snake\*case"
with "snake_case" and correcting the enum type pattern in the explanatory
example: change the shown pattern from the inconsistent `<table>*<column>\_enum`
to `<table>_<column>_enum` (as used in the `field.Enum(...)` example and
`entsql.Annotation{Type: "<table>_<column>_enum"}`), removing the stray
backslash and asterisk so the text renders and matches the project's snake_case
convention.
In @.claude/rules/no-panic-outside-main.md:
- Line 16: Fix the incorrect generated-code path string: replace the reference
to "apps/uar/ent/<db>/" with the correct project paths by stating that generated
Ent code lives under "ent/" (and should not be hand-edited) and that
hand-authored schemas live under "ent/schema/"; update the sentence that
currently exempts generated code so it explicitly exempts files under "ent/" and
clarifies that "ent/schema/" contains hand-authored schemas.
- Line 17: Update the schema path string in the rule text by replacing the
incorrect reference "ent/<db>/schema/" with the correct "ent/schema/" so it
matches the project documentation (see CLAUDE.md). Locate the sentence in the
rule (the line containing "Hand-written schema files under `ent/<db>/schema/`
are NOT generated code and MUST follow this rule.") and change the path token to
"ent/schema/" while preserving the surrounding sentence and formatting.
In `@openspec/changes/archive/2026-05-25-improve-devex/design.md`:
- Line 52: Update the design table's dev task entry to match the actual
Taskfile.yml by replacing the incorrect script path './dev-scripts/run.sh' with
the correct './dev-scripts/run.py' so the `dev` task reference in design.md
matches the Taskfile.yml `dev` task.
---
Nitpick comments:
In @.claude/rules/no-commits-to-main.md:
- Line 5: Update the rule text to clarify that `gs-create` is the git-spice
command for creating stacked feature branches: change the sentence "Use
`gs-create` to create a new stacked branch before committing." to something like
"Use `gs-create` (the git-spice command for creating stacked branches) to create
a new stacked feature branch before committing." to make the purpose and origin
of `gs-create` explicit.
In `@CLAUDE.md`:
- Line 94: Clarify the apparent contradiction by updating the sentence that
mentions "/migrate-new", "/migrate-up", and "/migrate-down" to state that
production migrations are forward-only (use /migrate-new and /migrate-up) while
/migrate-down is allowed only for development/testing or rollback scenarios;
also briefly explain that the "expand-contract" policy is a strategy for
performing forward-compatible schema changes (expand in one release, contract in
a later release) to avoid needing down migrations in production. Reference the
commands /migrate-new, /migrate-up, /migrate-down and the term "expand-contract"
so readers can understand which commands are for production vs dev/testing.
- Around line 54-62: The "Key rules" list in CLAUDE.md omits two new rule files;
update CLAUDE.md to either list all rule filenames from .claude/rules/
(including no-commits-to-main.md and no-skip-git-hooks.md) or explicitly clarify
the scope by changing the heading/text to "Key rules (selected):" and add a
brief sentence explaining the selection criteria; locate the existing block that
lists tdd-required.md, verify-before-completion.md, env-execution.md,
ent-migrations.md, no-panic-outside-main.md, and nolint-with-comments.md and add
the missing filenames or the clarifying note there.
In `@openspec/changes/archive/2026-05-25-improve-devex/tasks.md`:
- Around line 24-30: The task description for dev-scripts/test-auto.sh lacks
explicit error-handling expectations; update the archived task text to state
what should occur on failures: specify that if any nc -z port check ultimately
times out (after the 60s, polling every 2s) the script should exit non‑zero and
log a clear timeout error, that failure to start nix run .#deps must be detected
(capture its PID and verify the process is running) and cause an error log and
non‑zero exit, and that on any early exit the trap must still kill the
background deps process started by the script and propagate the go test exit
code after logging the failure; reference the script name
dev-scripts/test-auto.sh and the commands nc -z, nix run .#deps,
enable-integration-tests, trap in the description so future readers know the
intended error behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 75a924d5-5b1e-4d68-9484-905540069841
📒 Files selected for processing (27)
.agent/skills/build/SKILL.md.agent/skills/ncps/SKILL.md.agent/skills/tdd/SKILL.md.agent/skills/tdd/deep-modules.md.agent/skills/tdd/interface-design.md.agent/skills/tdd/mocking.md.agent/skills/tdd/refactoring.md.agent/skills/tdd/tests.md.agent/skills/test/SKILL.md.claude/rules/ent-migrations.md.claude/rules/env-execution.md.claude/rules/no-commits-to-main.md.claude/rules/no-panic-outside-main.md.claude/rules/no-skip-git-hooks.md.claude/rules/nolint-with-comments.md.claude/rules/tdd-required.md.claude/rules/verify-before-completion.mdCLAUDE.mdTaskfile.ymldev-scripts/test-auto.shnix/devshells/flake-module.nixopenspec/changes/archive/2026-05-25-improve-devex/.openspec.yamlopenspec/changes/archive/2026-05-25-improve-devex/design.mdopenspec/changes/archive/2026-05-25-improve-devex/proposal.mdopenspec/changes/archive/2026-05-25-improve-devex/specs/task-workflow/spec.mdopenspec/changes/archive/2026-05-25-improve-devex/tasks.mdopenspec/specs/task-workflow/spec.md
💤 Files with no reviewable changes (3)
- .agent/skills/ncps/SKILL.md
- .agent/skills/build/SKILL.md
- .agent/skills/test/SKILL.md
test-auto.sh: replace nc -z with bash /dev/tcp built-in to remove the external netcat dependency and eliminate devskim false positives on localhost port checks. test-auto.sh: fail fast in the service-readiness loop if the background deps process dies (kill -0 check), rather than waiting the full 60s timeout. ent-migrations.md: fix malformed markdown — snake\*case and <table>*<column>\_enum were rendering with stray backslash and asterisk; corrected to snake_case and <table>_<column>_enum. no-panic-outside-main.md: fix copy-paste path errors — replace apps/uar/ent/<db>/ with ent/ and ent/<db>/schema/ with ent/schema/ to match this project's actual directory structure. design.md (archive): fix dev task script reference from run.sh to run.py to match the actual Taskfile.yml entry. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Add Taskfile.yml with 15 standard tasks (fmt, lint, test,
test:integration, test:auto, build, dev, deps, ent:, migrations:)
so that
task fmt/lint/testwork as required by theverify-before-completion rule.
Add dev-scripts/test-auto.sh: auto-detects whether backing services
are running (port checks on 9000/5432/3306/6379), starts
nix run .#depsin the background if not, enables all integrationenv vars, runs
go test -race ./..., and tears down on exit.Add pkgs.go-task to the devshell (devshell-only, not docker-dev).
Trim CLAUDE.md from 638 to 109 lines by removing sections now
covered by .claude/rules/ and .agent/skills/: NarInfo migration
runbook, integration test detail, code quality section, Helm/Kind
detail. Keep project overview, task commands, architecture, and
pointers to rules and skills.
Replace build/ncps/test skills with a comprehensive tdd/ skill set.
Add eight .claude/rules/ files covering TDD, verification, env
setup, Ent migrations, panic policy, and nolint conventions.