Skip to content

feat: composable system prompt with embedded identity - #5

Merged
buchenberg merged 1 commit into
mainfrom
feature/identity
Jul 14, 2026
Merged

feat: composable system prompt with embedded identity#5
buchenberg merged 1 commit into
mainfrom
feature/identity

Conversation

@buchenberg

Copy link
Copy Markdown
Owner

Replace the hardcoded one-line system prompt with a composable three-layer architecture.

Changes

  • internal/prompts/identity.md - 137-line embedded identity document shipped in the binary via //go:embed. Covers yaah''s principles, capabilities, tools, code editing conventions, and behavioral rules. Replaces: "You are yaah, a helpful AI assistant. Respond concisely."
  • internal/prompts/prompts.go - Layers struct and Build() function that assembles the full system prompt from identity + user context + project context + memory
  • internal/instructions/instructions.go - Added ReadFile(dir) for loading user-level AGENTS.md
  • cmd/yaah/root_cmd.go - Wired in the prompts.Layers / prompts.Build() composition

System prompt layers

Layer Source Required
Identity //go:embed identity.md Yes (shipped in binary)
User context ~/.yaah/AGENTS.md Optional
Project context AGENTS.md walked up from cwd Optional
Memory SQLite state.db Optional

Why

Previously yaah had no identity - the system prompt was one generic sentence. When the user asked "tell me about yourself", the model had no knowledge of yaah's features, tools, or principles. Now the binary ships with a comprehensive identity document that tells the model exactly what it is and what it can do.

Replace the hardcoded one-line system prompt with a three-layer
architecture: embedded identity (//go:embed), user-level AGENTS.md
(~/.yaah/AGENTS.md), and project-level AGENTS.md (walked up from cwd).

Add internal/prompts/ with identity.md containing a comprehensive
137-line identity document covering yaah's principles, capabilities,
behavioral rules, code editing conventions, and memory guidelines.
@buchenberg
buchenberg merged commit 6c955c2 into main Jul 14, 2026
8 checks passed
@buchenberg
buchenberg deleted the feature/identity branch July 14, 2026 03:34
buchenberg added a commit that referenced this pull request Aug 7, 2026
…anup

- Thread pane width through renderMarkdown via GetInnerRect().Dx()
  instead of hard-coded 80 columns (CodeRabbit #6)
- Update architecture review: tui2 markdown entry now says tviewmd instead
  of glamour (#4), model-picker wiring is partial not missing (#5)
- Add language identifiers to unlabeled code fences in plan (#markdownlint)
- Phase 1 text already replaced by checkmarked completion in amended commit
buchenberg added a commit that referenced this pull request Aug 7, 2026
* feat: extract tviewmd markdown renderer and wire into tui2

Replace glamour+TranslateANSI in tui2 with native tview color-tag
rendering via the published github.com/buchenberg/tviewmd module (v0.1.0).

The tviewmd module (14 files, MIT) provides:
- CommonMark + GFM parsing via goldmark
- chroma syntax highlighting for fenced code blocks
- tview color-tag backend (no ANSI round-trip)
- 23 tests + fuzz (315k+ executions, zero panics)

Adds architecture review (docs/architecture-review.md) and implementation
plan (.agents/plans/tui2-hardening/PLAN.md).

* feat: extract tviewmd markdown renderer and wire into tui2

Replace glamour+TranslateANSI in tui2 with native tview color-tag
rendering via the published github.com/buchenberg/tviewmd module (v0.1.0).

The tviewmd module (14 files, MIT) provides:
- CommonMark + GFM parsing via goldmark
- chroma syntax highlighting for fenced code blocks
- tview color-tag backend (no ANSI round-trip)
- 23 tests + fuzz (315k+ executions, zero panics)

Adds architecture review (docs/architecture-review.md) and implementation
plan (.agents/plans/tui2-hardening/PLAN.md).

* fix: address PR review — dynamic markdown width, stale docs, plan cleanup

- Thread pane width through renderMarkdown via GetInnerRect().Dx()
  instead of hard-coded 80 columns (CodeRabbit #6)
- Update architecture review: tui2 markdown entry now says tviewmd instead
  of glamour (#4), model-picker wiring is partial not missing (#5)
- Add language identifiers to unlabeled code fences in plan (#markdownlint)
- Phase 1 text already replaced by checkmarked completion in amended commit

* docs(architecture): add deep-dive review of tui2 internals

Expand the architecture review with a comprehensive §4 section covering
`internal/tui2`'s package topology (~19 subpackages), the flat-factory
component pattern, and an analysis of the imperative widget tree model
with its strengths (simplicity, zero abstraction overhead) and weaknesses
(no lifecycle standardization, lack of isolation via shared *App).

Update the §3 recommendation to reference the new deep-dive section.
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.

1 participant