Skip to content

bash/POSIX port of the three hooks #2

Description

@h8nc4y

Summary / 概要

v0.1.0 ships PowerShell implementations only. A bash/POSIX port would serve macOS/Linux users who do not want to install PowerShell 7.

Scope

  • Port the three hooks (devlog-session-start / devlog-prompt-nudge / devlog-stop) to POSIX sh or bash: markers via epoch text files, journal staleness via stat mtime, JSON output via printf (fields are fixed strings + paths).
  • Keep every invariant from CONTRIBUTING.md: fail-open (|| exit 0 discipline), raw UTF-8 output, single-variable config (CLAUDE_DEVLOG_DIR), ja/en messages (CLAUDE_DEVLOG_LANG), enforce-once semantics, stop_hook_active guard.
  • Extend scripts/test-hooks.ps1 (or add a sibling harness) so the same 23 behavioral cases run against the bash implementations in CI (ubuntu-latest matrix job).

Notes

  • JSON escaping of arbitrary paths inside the messages is the main risk area (quotes/backslashes in devlog paths); consider jq -Rn if depending on jq is acceptable, or restrict to manual escaping with tests.
  • 日本語補足: v0.1.0 は pwsh 版のみ。POSIX 移植では fail-open・enforce-once・二重ゲート・UTF-8 直書きの不変条件を維持し、既存 pipe-test と同等の23ケースを ubuntu-latest でも回す。

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions