feat: composable system prompt with embedded identity - #5
Merged
Conversation
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
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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-Layersstruct andBuild()function that assembles the full system prompt from identity + user context + project context + memoryinternal/instructions/instructions.go- AddedReadFile(dir)for loading user-levelAGENTS.mdcmd/yaah/root_cmd.go- Wired in theprompts.Layers/prompts.Build()compositionSystem prompt layers
//go:embed identity.md~/.yaah/AGENTS.mdAGENTS.mdwalked up from cwdstate.dbWhy
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.