Skip to content

feat(ai-autopilot): built-in prompts library (#111)#119

Merged
suleimansh merged 1 commit into
mainfrom
feat/prompts-library
Jul 2, 2026
Merged

feat(ai-autopilot): built-in prompts library (#111)#119
suleimansh merged 1 commit into
mainfrom
feat/prompts-library

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Closes #111. Child of the AI-framework epic #110; supplies the bodies the loop (#113) dispatches and consults the decisions ledger (#112). This closes the turnkey wire across all three.

What

The stack-aware prompt bodies, shipped as data. Eight markdown bundles under prompts/ (published in the tarball):

  • review (TLDR + thorough), code-quality, security, refactor, UX, QA, knowledge-base
  • Each already knows Vike + universal-orm (authz/IDOR scoping, server/client boundary, ORM N+1, SSR/hydration, ...).
  • Frontmatter is parsed by @gemstack/ai-skills (metadata.loopId / passes / event), so a contributor improves a prompt by editing prose, not code (the main OSS contribution surface).

Loaded with builtinLibrary() / loadPromptsFrom(dir) into a PromptLibrary. loopPromptsFor(library, makeAgent) materializes them into loop prompts so defaultLoopRules() ids (review/code-quality/security/qa/ux) resolve to real bodies, a fresh agent per pass. promptInstructions composes a body with the decisions briefing; renderTask turns a LoopEvent into the worker's task.

The turnkey wire (what this unlocks)

const library = await builtinLibrary()
const loop = new Loop({
  rules: defaultLoopRules(),
  prompts: loopPromptsFor(library, ctx => agent({ instructions: ctx.instructions, tools: runnerTools(session) })),
  ledger,
})
await loop.handle({ kind: 'major-change', summary: 'reworked auth', paths: ['src/auth/*'] })

Design notes

  • Bodies are .md files loaded at runtime relative to the module (../../prompts/), added to files and verified present in npm pack. Works in dev, test, and a published install.
  • The prompt id vs name split lets review-thorough dispatch as review while review-tldr stays a standalone body.
  • Landscape note on Built-in prompts library (review, quality, security, refactor, UX, QA, knowledge base) #111 stands (prompts are the on-ramp, not the moat); kept as data so the community grows them.

Verification

  • 128 tests pass (12 new: parse/library/bridge), typecheck + build clean, npm pack includes all 8 prompts/*.md.
  • Drove the full wire against the built dist: builtinLibrary loads all 8 bodies from disk, a major-change event fires review (2 fresh passes) + code-quality + security, ui-flow fires qa + ux, each composed with the decisions briefing.

Ships eight stack-aware prompt bodies as markdown under prompts/ (review TLDR +
thorough, code-quality, security, refactor, UX, QA, knowledge-base) that already
know Vike + universal-orm. builtinLibrary() / loadPromptsFrom(dir) load them into
a PromptLibrary, parsed via @gemstack/ai-skills frontmatter so a contributor edits
prose, not code. loopPromptsFor(library, makeAgent) materializes them into loop
prompts so defaultLoopRules() ids resolve to real bodies (a fresh agent per pass);
promptInstructions composes a body with the decisions briefing (#112) and
renderTask turns a LoopEvent into the worker task.

Closes the turnkey wire across #111 / #112 / #113. Child #111 of the AI-framework
epic (#110).
@suleimansh suleimansh added enhancement New feature or request priority: high Should be addressed soon labels Jul 2, 2026
@suleimansh suleimansh self-assigned this Jul 2, 2026
@suleimansh suleimansh merged commit 8f780f3 into main Jul 2, 2026
2 checks passed
@suleimansh suleimansh deleted the feat/prompts-library branch July 2, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: high Should be addressed soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Built-in prompts library (review, quality, security, refactor, UX, QA, knowledge base)

1 participant