forked from Lucent-Financial-Group/Zeta
-
Notifications
You must be signed in to change notification settings - Fork 0
backlog(B-0069): encode HEREDOC patterns into commit-message-shape skill #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AceHack
merged 2 commits into
main
from
backlog/B-0069-heredoc-encode-substrate-aaron-2026-04-28
Apr 28, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
...069-heredoc-patterns-encode-into-commit-message-shape-skill-aaron-2026-04-28.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| --- | ||
| id: B-0069 | ||
| priority: P2 | ||
| status: open | ||
| title: Encode HEREDOC patterns into commit-message-shape skill (Aaron 2026-04-28) | ||
| effort: S | ||
| ask: maintainer Aaron 2026-04-28 /btw aside | ||
| created: 2026-04-28 | ||
| last_updated: 2026-04-28 | ||
| tags: [skill-substrate, commit-discipline, heredoc, agency-signature] | ||
| --- | ||
|
|
||
| # B-0069 — Encode HEREDOC scripts into substrate | ||
|
|
||
| ## Why | ||
|
|
||
| The human maintainer 2026-04-28 (verbatim, /btw aside during PR drain): | ||
|
|
||
| > "does HEREDOC have scripts we should encode into substraight?" | ||
|
|
||
| The factory uses a recurring `git commit -m "$(cat <<'EOF' ... EOF | ||
| )"` HEREDOC pattern for commit messages and `gh pr create --body | ||
| "$(cat <<'EOF' ... EOF | ||
| )"` for PR bodies. These patterns have nuance that is currently | ||
| tribal knowledge — should be encoded into | ||
| `.claude/skills/commit-message-shape/SKILL.md` so future | ||
| agents/contributors get the discipline at session-bootstrap, not | ||
| discover it through trial-and-error. | ||
|
|
||
| ## Patterns worth encoding | ||
|
|
||
| 1. **Single-quoted EOF (`<<'EOF'`)** — prevents shell expansion of | ||
| backticks (`` ` ``), `$variables`, `$(command)` substitution, and | ||
| `\` escapes inside the body. Critical for commit messages / | ||
| PR bodies that contain literal backticks (markdown code spans), | ||
| dollar-prefixed identifiers (file paths, env vars), or shell | ||
| metacharacters. Unquoted `<<EOF` would break those. | ||
|
|
||
| 2. **Closing `EOF\n)"` form** — the trailing newline before the | ||
| closing `)` is what makes the HEREDOC parse correctly inside the | ||
| `$(...)` command substitution. Missing the newline produces a | ||
| shell parse error. | ||
|
|
||
| 3. **Trailer-block placement at end** — when the HEREDOC body ends | ||
| with an AgencySignature trailer block, the trailer block must be | ||
| the last lines of the body (per `git interpret-trailers` parser | ||
| rules: trailers are the last paragraph, separated from prose by | ||
| one blank line). Embedding trailer-shape lines mid-body breaks | ||
| the parser. | ||
|
|
||
| 4. **Co-authored-by line as final trailer** — the `Co-authored-by:` | ||
| line attributes the agent contribution; lives at end of trailer | ||
| block. Composes with the AgencySignature 7-trailer schema (per | ||
| task #298 (pre-merge validator landed) + task #299 (post-merge | ||
| auditor landed); the canonical schema is documented in | ||
| `tools/hygiene/validate-agencysignature-pr-body.sh` which is | ||
| already in-tree and authoritative). | ||
|
|
||
| 5. **PR body HEREDOC vs commit message HEREDOC** — same shape, | ||
| different consumers. PR body has GitHub-flavor markdown (tables, | ||
| task lists `[ ]`, `🤖 Generated with [Claude Code]` footer); | ||
| commit message is plain text + trailer block. Both use | ||
| `<<'EOF'` / `EOF\n)"`. | ||
|
|
||
| 6. **Variable interpolation cases** — when HEREDOC body MUST include | ||
| a shell variable (commit SHA, run ID), use unquoted `<<EOF` | ||
| instead of `<<'EOF'`. This is rare; most cases stay | ||
| single-quoted. Per Aaron's framing, this is the "scripts | ||
| encoded into substrate" piece — knowing when to flip the | ||
| quoting discipline. | ||
|
|
||
| 7. **Backtick-in-trailer pitfalls** — backticks in trailer-block | ||
| text (e.g., `` Authority-Source: `docs/AGENT-BEST-PRACTICES.md` ``) | ||
| need single-quoted `<<'EOF'` to preserve literally; otherwise | ||
| the shell parses the backticks as command substitution. | ||
|
|
||
| 8. **Truncated heredoc end-marker rule** — closing `EOF` MUST be at | ||
| the start of its line (no leading whitespace). YAML files / nested | ||
| shell often add accidental indentation; that breaks the heredoc | ||
| close detection and makes the next 1000+ lines of script body part | ||
| of the heredoc. | ||
|
|
||
| ## Composition with existing substrate | ||
|
|
||
| - `.claude/skills/commit-message-shape/SKILL.md` — the natural home | ||
| - task #296 — "Integrate ferry-3 canonical commit-attribution | ||
| schema into commit-message-shape SKILL.md via skill-improver | ||
| workflow" — same skill update target; bundle B-0069 with task | ||
| #296 if the skill-improver workflow is already triggering | ||
| - `memory/feedback_otto_354_*` — AgencySignature trailer-discipline | ||
| memory (operational status; refinement to v2 7-schema pending) | ||
| - task #298 + task #299 — pre-merge validator + post-merge | ||
| auditor (already landed) | ||
|
|
||
| ## Cadence | ||
|
|
||
| When skill-improver workflow next fires for the | ||
| commit-message-shape SKILL — bundle this with task #296 to keep | ||
| the changes coherent. | ||
|
|
||
| ## Provenance | ||
|
|
||
| - Aaron 2026-04-28 verbatim (above) | ||
| - Composition partner: task #296 (skill-improver workflow trigger) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This backlog row says the HEREDOC guidance composes with a "7-trailer schema" while citing
tools/hygiene/validate-agencysignature-pr-body.shas the canonical source, but that validator currently enforces 10 required AgencySignature trailers (required_keysinvalidate-agencysignature-pr-body.shlines 67-69). Because this item is intended to feedcommit-message-shapeskill updates, the mismatch can propagate incorrect trailer requirements and put the skill guidance out of sync with the enforcement tooling.Useful? React with 👍 / 👎.