You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(docs): add branch-name validation guidance across skills, agents, and hook script
Update four files plus the git hooks migration spec to prevent committing
under a wrong, closed, or non-existent issue number:
- create-feature-branch/SKILL.md: validation step before branch creation
- run-pre-commit-checks/SKILL.md: manual check for branch name validity
- committer.agent.md: step 2 validates branch name against open specs
- pre-commit.sh: TODO referencing #1843 for future Rust automation
- 1843-migrate-git-hooks-scripts-from-bash-to-rust.md: add T22 + AC22,
cross-reference related artifacts
| T17 | TODO | Implement heartbeat emitter | Background ticker fires every 20–30s while a step is running; emits `heartbeat` NDJSON event (step name, elapsed seconds); extends T3 schema |
216
-
| T18 | TODO | Implement staged file type analysis and smart step selection |`git diff --cached --name-only`; classify changeset (Markdown-only / docs-only / mixed); skip inapplicable steps; emit `step_skip` NDJSON events for skipped steps; extends T3 schema |
217
-
| T19 | TODO | Implement pre-commit idempotency cache | Compute staged tree SHA (`git write-tree`) + step-config hash; check/write `.git/torrust-hooks/pre-commit-cache`; exit 0 immediately on cache hit |
218
-
| T20 | TODO | Implement pre-push idempotency cache | Check/write per-commit-SHA records in `.git/torrust-hooks/pre-push-cache`; exit 0 immediately when all pushed commits have passing records |
219
-
| T21 | TODO | Add Phase 2 unit and integration tests | Cover: heartbeat timing and event shape, staged file classification, smart step selection, cache read/write/invalidation, cache-and-smart-skip interaction |
220
-
| T22 | TODO | Verify Phase 2 quality gates |`linter all`, full test suite; all Phase 2 ACs met |
| T17 | TODO | Implement heartbeat emitter | Background ticker fires every 20–30s while a step is running; emits `heartbeat` NDJSON event (step name, elapsed seconds); extends T3 schema |
219
+
| T18 | TODO | Implement staged file type analysis and smart step selection |`git diff --cached --name-only`; classify changeset (Markdown-only / docs-only / mixed); skip inapplicable steps; emit `step_skip` NDJSON events for skipped steps; extends T3 schema |
220
+
| T19 | TODO | Implement pre-commit idempotency cache | Compute staged tree SHA (`git write-tree`) + step-config hash; check/write `.git/torrust-hooks/pre-commit-cache`; exit 0 immediately on cache hit |
221
+
| T20 | TODO | Implement pre-push idempotency cache | Check/write per-commit-SHA records in `.git/torrust-hooks/pre-push-cache`; exit 0 immediately when all pushed commits have passing records |
222
+
| T21 | TODO | Add Phase 2 unit and integration tests | Cover: heartbeat timing and event shape, staged file classification, smart step selection, cache read/write/invalidation, cache-and-smart-skip interaction |
223
+
| T22 | TODO | Implement branch-name validation | When the branch uses an issue-number prefix (e.g. `42-some-description`), verify that `docs/issues/open/` contains a matching spec file or directory. If none found, emit a warning event and optionally block the commit. Prevents committing under a wrong, closed, or non-existent issue number. See `docs/issues/open/1774-automate-cleanup-completed-issues-skill-script.md` for context |
224
+
| T23 | TODO | Verify Phase 2 quality gates |`linter all`, full test suite; all Phase 2 ACs met |
221
225
222
226
## Progress Tracking
223
227
@@ -267,6 +271,7 @@ Bash scripts are removed. **Phase 2** adds new capabilities on top of the alread
267
271
-[ ] AC19: When only `*.md` files (and documentation-adjacent files) are staged, `pre-commit` skips Rust-specific steps and runs only markdown-relevant linters; a `step_skip` NDJSON event is emitted for each skipped step
268
272
-[ ] AC20: A second `torrust-git-hooks pre-commit` invocation with an unchanged staged tree (same `git write-tree` SHA and step config) exits 0 immediately without re-running any step
269
273
-[ ] AC21: A `torrust-git-hooks pre-push` invocation where all commits in the push already have passing cache records exits 0 immediately without re-running any step
274
+
-[ ] AC22: When the current branch has an issue-number prefix (e.g. `42-some-description`), the `pre-commit` subcommand verifies that a matching spec exists in `docs/issues/open/`. If none is found, it emits a warning event and blocks the commit with exit code 1.
0 commit comments