Skip to content

fix: append Pilot marker block below user content, not above (PILOT-224)#5

Merged
TeoSlayer merged 1 commit into
mainfrom
openclaw/pilot-224-20260529-035708
May 29, 2026
Merged

fix: append Pilot marker block below user content, not above (PILOT-224)#5
TeoSlayer merged 1 commit into
mainfrom
openclaw/pilot-224-20260529-035708

Conversation

@matthew-pilot
Copy link
Copy Markdown
Collaborator

What

Change the writeMarker insertion logic to append the Pilot directive marker at the bottom of persona files instead of prepending it at the top.

Why

PILOT-224 — The skillinject plugin was writing Pilot-first doctrine ABOVE user persona sections in SOUL.md, AGENTS.md, CLAUDE.md, and AGENT.md. User persona instructions were buried at line 116+ below ~110 lines of pilot boilerplate.

Before

[YAML frontmatter]
<!-- pilot:begin -->...<!-- pilot:end -->  ← ABOVE user content
[user persona / instructions]

After

[YAML frontmatter]
[user persona / instructions]          ← stays prominent at top
<!-- pilot:begin -->...<!-- pilot:end -->  ← below everything

Scope

  • reconcile.go: swap insertion order (frontmatter→body→marker)
  • zz_skillinject_test.go: update 3 test assertions to expect marker at bottom

2 files, +20/−27 lines (small tier)

Verification

go build ./...   ✓
go test ./...    ✓ (all 4 marker tests pass)

Closes: PILOT-224

…ILOT-224)

Change the writeMarker insertion logic to append the Pilot directive
marker at the bottom of persona files (SOUL.md, AGENTS.md, CLAUDE.md,
AGENT.md) instead of prepending it at the top.

Before: user persona instructions were buried at line 116+ below a wall
of pilot boilerplate. The <!-- pilot:begin -->...<!-- pilot:end -->
marker was always placed at the top of the body after YAML frontmatter.

After: user content stays prominent at the top; the Pilot marker is
appended at the bottom of the file, below all user personas/instructions.

Updated marker-position assertions in TestMarker_PreservesUserContent,
TestMarker_PreservesUserContentBelow, and TestMarker_PreservesYAMLFrontmatter
to expect the marker at the bottom of the file.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@TeoSlayer TeoSlayer merged commit e36bc17 into main May 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants