Skip to content

chore(devex): add Taskfile, test-auto, slim CLAUDE.md - #1270

Merged
kalbasit merged 3 commits into
mainfrom
user/wnasreddine/cleanup-skills
May 25, 2026
Merged

kalbasit merged 3 commits into
mainfrom
user/wnasreddine/cleanup-skills

Conversation

@kalbasit

@kalbasit kalbasit commented May 25, 2026 •

Copy link
Copy Markdown
Owner

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.

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]>
@kalbasit

kalbasit commented May 25, 2026 •

Copy link
Copy Markdown
Owner Author

This change is part of the following stack:

Change managed by git-spice.

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. documentation Improvements or additions to documentation go Pull requests that update go code labels May 25, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: da9869db-8247-43f9-829e-faf03020e61b

📥 Commits

Reviewing files that changed from the base of the PR and between 6c547c4 and 7247006.

📒 Files selected for processing (4)
  • .claude/rules/ent-migrations.md
  • .claude/rules/no-panic-outside-main.md
  • dev-scripts/test-auto.sh
  • openspec/changes/archive/2026-05-25-improve-devex/design.md
✅ Files skipped from review due to trivial changes (2)
  • openspec/changes/archive/2026-05-25-improve-devex/design.md
  • .claude/rules/ent-migrations.md

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a root task runner for formatting, linting, testing, building, and a conditional integration-test workflow that can start/stop required services.
  • Documentation

    • Added comprehensive TDD, interface design, mocking, testing, refactoring guides and several repository rule docs; condensed and reorganized the main developer guide.
  • Chores

    • Dev tooling updated to include the task runner in dev shells and added an integration-test orchestration script.

Walkthrough

Adds 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.

Changes

Developer Experience Framework

Layer / File(s) Summary
TDD skills and governance rules
.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, .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.md
Adds comprehensive TDD guidance (philosophy, tests, mocking, interface design, module depth, refactoring) and repository rules covering Ent migrations, environment bootstrap, commit flow, panic handling, git hooks, nolint comments, and pre-completion verification.
Task automation & devshell
Taskfile.yml, nix/devshells/flake-module.nix
Introduces a root Taskfile with tasks for fmt, lint (and fix), test (unit/integration/auto), build, dev server, backing services, Ent generate/lint/check, and migrations generation; adds pkgs.go-task to devShell buildInputs.
Integration test orchestration
dev-scripts/test-auto.sh
Adds a script that checks ports (9000,5432,3306,6379), conditionally starts nix run .#deps, waits up to 60s for readiness, enables integration env vars, runs go test -race ./..., and tears down only services it started.
Documentation consolidation
CLAUDE.md
Condenses the main development guide to a short pointer-based reference (prereqs, common commands, architecture pointers) and delegates operational detail to new rules/skills docs.
Formal specifications & records
openspec/specs/task-workflow/spec.md, openspec/changes/archive/2026-05-25-improve-devex/*
Adds specs and archived proposal/design/tasks describing Taskfile contract, test modes (including test:auto), Ent/migration task behavior, and CLAUDE.md content constraints.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • kalbasit/ncps#1224: Both PRs modify CLAUDE.md and related migration/workflow docs; likely overlapping in documentation/migration guidance areas.
  • kalbasit/ncps#1240: Overlaps changes to .agent/skills/ncps/SKILL.md environment/setup sections and may conflict with deleted ncps skill content.

Suggested labels

enhancement, size:M, merge-stack

Poem

🐰 I hopped through tasks and docs today,

Tracer bullets led the way,
Ports checked, services spun with care,
CLAUDE trimmed down, rules laid bare,
TDD guides so tests can play.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding Taskfile, test-auto script, and slimming CLAUDE.md, directly corresponding to the changeset.
Description check ✅ Passed The description clearly relates to the changeset, detailing the addition of Taskfile.yml, dev-scripts/test-auto.sh, devshell changes, CLAUDE.md trimming, and new rules/skills files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread dev-scripts/test-auto.sh Fixed
Comment thread dev-scripts/test-auto.sh Fixed
Comment thread dev-scripts/test-auto.sh Fixed
Comment thread dev-scripts/test-auto.sh Fixed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread dev-scripts/test-auto.sh Resolved
Comment thread dev-scripts/test-auto.sh Resolved
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]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (4)
openspec/changes/archive/2026-05-25-improve-devex/tasks.md (1)

24-30: 💤 Low value

Consider 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 .#deps fails 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 value

Consider clarifying the gs-create command.

For readers unfamiliar with git-spice, briefly noting that gs-create is 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 win

Clarify "forward-only" migration policy.

The statement "migrations are forward-only" appears to conflict with the mention of /migrate-down in the same sentence. Consider clarifying that /migrate-down is 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 value

Consider listing all rules or clarifying "key rules" scope.

The rules section lists 6 rules but omits no-commits-to-main.md and no-skip-git-hooks.md from 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

📥 Commits

Reviewing files that changed from the base of the PR and between 08b6888 and 6b953a0.

📒 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.md
  • CLAUDE.md
  • Taskfile.yml
  • dev-scripts/test-auto.sh
  • nix/devshells/flake-module.nix
  • openspec/changes/archive/2026-05-25-improve-devex/.openspec.yaml
  • openspec/changes/archive/2026-05-25-improve-devex/design.md
  • openspec/changes/archive/2026-05-25-improve-devex/proposal.md
  • openspec/changes/archive/2026-05-25-improve-devex/specs/task-workflow/spec.md
  • openspec/changes/archive/2026-05-25-improve-devex/tasks.md
  • openspec/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

Comment thread .claude/rules/ent-migrations.md Resolved
Comment thread .claude/rules/no-panic-outside-main.md Resolved
Comment thread .claude/rules/no-panic-outside-main.md Resolved
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]>
Comment thread dev-scripts/test-auto.sh Dismissed
Comment thread dev-scripts/test-auto.sh Dismissed
Comment thread dev-scripts/test-auto.sh Dismissed
Comment thread dev-scripts/test-auto.sh Dismissed
@kalbasit
kalbasit enabled auto-merge (squash) May 25, 2026 19:31
@kalbasit
kalbasit merged commit 754fc3a into main May 25, 2026
24 checks passed
@kalbasit
kalbasit deleted the user/wnasreddine/cleanup-skills branch May 25, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation go Pull requests that update go code size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants