feat: Implement Prompt Builder functionality in Popup and Options
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 39s

- Added a new "Prompt Builder" tab in the Popup for generating AI prompts with customizable parameters.
- Introduced new state variables for managing prompt styles, personas, formats, and models.
- Enhanced the Options page to fetch and display models based on the provided API key.
- Updated the actions and types to include the new 'prompt' action and its associated parameters.
- Implemented migration logic for legacy plaintext API keys to encrypted storage.
- Updated the getSystemPrompt function to incorporate prompt parameters for better instruction generation.
- Added tests for the new functionality, including context menu entries and prompt generation logic.
This commit is contained in:
john kevin asprec
2026-07-15 15:27:41 +08:00
parent 0fef9848cb
commit acea99d7ad
40 changed files with 1971 additions and 177 deletions

View File

@@ -0,0 +1,13 @@
---
name: self-model-audit
description: Compare what the harness believes about the operator and project (docs/SELF_MODEL.md, CLAUDE.md, role memory) against what recent work and corrections actually reveal, and propose edits that close the gap. Use periodically or after repeated "that's not what I meant" signals.
allowed-tools: Read Grep Glob
---
Find where the harness is modeling a stale, aspirational, or simply wrong version of the operator or the project — then propose the smallest edits that make the model match reality. Read-only: propose changes, don't apply them without approval.
1. **Read the belief set.** `docs/SELF_MODEL.md`, `docs/PROJECT_BRIEF.md`, the operator/project instructions in `CLAUDE.md`, active `## Lessons`, and relevant role memory. Note every claim the system holds about who the operator is, what they want, and how they work.
2. **Read the evidence.** Recent handoffs (`docs/HANDOFF.md`), recorded decisions (`docs/DECISIONS.md`), corrections captured in `LESSONS_LEARNED.md`, and the shape of recent tasks. Infer what the operator's actual behavior and choices reveal.
3. **Find the gaps.** Flag each place the stated model conflicts with revealed behavior: preferences that changed, aspirational goals the system optimizes for but recent work contradicts, assumptions never re-confirmed, and voice/style drift. Distinguish "genuinely stale" from "reasonable disagreement" — do not pathologize a deliberate choice.
4. **Propose edits.** For each gap, give the exact `SELF_MODEL.md` (or `CLAUDE.md` instruction) change that closes it, tied to the evidence that justifies it. Prefer removing an over-specific belief over adding more.
5. **Return** the gap list (belief → contradicting evidence → proposed edit), and route any accepted change through the operator or `system-steward`. Never infer a sensitive attribute, and never store credentials, financial/health data, or anything the operator hasn't agreed to persist.