Skip to content

feat: make devai guideline files marker-based and fully user-overridable#124

Merged
markshust merged 1 commit into
developfrom
feature/devai-overridable-guidelines
Jun 23, 2026
Merged

feat: make devai guideline files marker-based and fully user-overridable#124
markshust merged 1 commit into
developfrom
feature/devai-overridable-guidelines

Conversation

@markshust

Copy link
Copy Markdown
Collaborator

Summary

Makes marko/devai-generated AI guideline files portable across tools, single-sourced, and fully user-overridable — fixing the original bugs where AGENTS.md/CLAUDE.md were clobbered on every run and shipped dead .claude/ links into every generated project.

What changed

  • Marker-aware writes. Every agent guideline file (AGENTS.md, CLAUDE.md, GEMINI.md, .github/copilot-instructions.md, junie/guidelines.md, .cursor/rules/marko.mdc) now routes through a new static GuidelinesWriter:
    • creates the file wrapped in <!-- BEGIN marko:devai --> / <!-- END marko:devai --> markers when absent;
    • on update, rewrites only the marked region — user content outside is preserved byte-for-byte;
    • if the markers are removed, devai backs off entirely (with a loud notice drained into the install log), so a user can take full ownership of any file.
  • AGENTS.md is now tool-agnostic. core.md drops the dead .claude/ links and is curated to behavior-shaping rules (no-traits, interface-over-driver, constructor-injection, config-as-truth), pointing depth at the search_docs MCP tool. No static reference docs are shipped (they would drift against the MCP/LSP).
  • Cursor .mdc frontmatter stays valid — markers wrap only the body, never the leading ---.
  • AgentsMdRenderer no longer emits a standalone generated-by header (the marker carries that semantics); InstallationOrchestrator drains GuidelinesWriter notices into its log.
  • Test hygiene: fixed a stale tests/PackagingTest.php that blanket-required every package to export-ignore its .gitignore, contradicting the deliberate skeleton behavior (commit 0ad6e90) of shipping its .gitignore to generated projects — the project template is now exempted.

Testing

Full suite green: 6935 passed, 0 failed. devai package: 217 passing.

Follow-up (not in this PR)

Live search_docs ranking could not be validated in-session (no MCP connected). A separate audit will run the greenfield query matrix against the live MCP and decide whether to adopt the docs-vec hybrid driver over docs-fts.

🤖 Generated with Claude Code

devai now writes every agent guideline file (AGENTS.md, CLAUDE.md, GEMINI.md,
.github/copilot-instructions.md, junie/guidelines.md, .cursor/rules/marko.mdc)
through a marker-aware GuidelinesWriter that:
- creates the file with <!-- BEGIN/END marko:devai --> markers when absent
- rewrites only content between the markers on update; user content outside is
  preserved byte-for-byte
- backs off untouched, with a loud notice, when the markers are removed, so a
  user can take full ownership of any file

Other changes:
- core.md: drop dead .claude/ links, curate to behavior-shaping rules
  (no-traits, interface-over-driver, constructor-injection, config-as-truth),
  point depth at the search_docs MCP tool; AGENTS.md is now tool-agnostic
- AgentsMdRenderer no longer emits a standalone generated-by header (the marker
  carries that semantics now)
- InstallationOrchestrator drains GuidelinesWriter notices into the install log
- fix stale tests/PackagingTest.php: exempt the skeleton project template from
  the .gitignore export-ignore rule (it intentionally ships its .gitignore)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@markshust markshust merged commit a9b5161 into develop Jun 23, 2026
1 check passed
@markshust markshust deleted the feature/devai-overridable-guidelines branch June 23, 2026 19:26
@github-actions github-actions Bot added the enhancement New feature or request label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant