mirror of
https://github.com/wiseguru/ReWrite-Voice-Notes.git
synced 2026-07-22 07:49:19 +00:00
Default template fixing
This commit is contained in:
parent
c1b160bbe5
commit
c1d1e4e6cd
3 changed files with 66 additions and 7 deletions
|
|
@ -57,7 +57,7 @@ src/
|
|||
├── pipeline.ts # transcribe → cleanup → insert orchestrator
|
||||
├── insert.ts # cursor/newFile/append + {{date}}/{{time}} expansion
|
||||
├── whisper-host.ts # Spawns/stops a user-supplied whisper-server child process (desktop only)
|
||||
├── templates-folder.ts # Load templates from a vault folder + populate it with the 8 defaults
|
||||
├── templates-folder.ts # Load templates from a vault folder + populate it with the 9 defaults
|
||||
├── template-guide.ts # Populate a human-facing "Template guide.md" next to the templates folder (never loaded by the plugin)
|
||||
├── shared-core.ts # Load the shared cleanup preface from a vault Markdown file + populate default (prepended to every template prompt)
|
||||
├── assistant-prompt.ts # Load the ad-hoc-instructions assistant prompt from a vault Markdown file + populate default
|
||||
|
|
@ -67,7 +67,7 @@ src/
|
|||
├── settings/
|
||||
│ ├── index.ts # DEFAULT_SETTINGS, load/save, per-profile secret hydration
|
||||
│ ├── tab.ts # PluginSettingTab: active profile, two profile sections, templates folder, recording
|
||||
│ └── default-templates.ts # The 8 default templates used by the populate button (General cleanup, Todo list, Daily note, Meeting notes, Meeting transcript, Idea capture, Lecture, Podcast); each prompt = per-template rules only (the shared preface is prepended at runtime from shared-core.ts)
|
||||
│ └── default-templates.ts # The 9 default templates used by the populate button (General cleanup, Todo list, Daily note, Meeting notes, Meeting transcript, Idea capture, Lecture, Podcast, Guides); each prompt = per-template rules only (the shared preface is prepended at runtime from shared-core.ts)
|
||||
├── ui/
|
||||
│ ├── modal.ts # Main modal: template select + Record/Paste/From note tabs + setup-card injection
|
||||
│ ├── setup-card.ts # Inline blocker when active profile is unconfigured (voice vs text purpose)
|
||||
|
|
@ -185,7 +185,7 @@ Templates are Markdown files in a vault folder, not entries in `data.json`. The
|
|||
|
||||
Consumers ([src/main.ts](src/main.ts), [src/ui/modal.ts](src/ui/modal.ts), [src/ui/quick-record.ts](src/ui/quick-record.ts)) read `plugin.templates` directly, never `settings.templates` (there is no such field). The populate button is non-destructive: it skips any default template whose `id` already exists on disk, and skips path collisions. Frontmatter `id` is canonical for identity, so renaming a file does not break the `defaultTemplateId` / `lastUsedTemplateId` reference. The first-launch experience is empty templates plus a setup nudge in the modal; the user clicks Populate to get the defaults.
|
||||
|
||||
The 8 defaults ([src/settings/default-templates.ts](src/settings/default-templates.ts)) are General cleanup, Todo list, Daily note, Meeting notes, Meeting transcript, Idea capture, Lecture, Podcast. Each default template carries ONLY its per-template rules; the shared cleanup preface (guardrail + condensed cleanup + output discipline) is NOT baked into the prompt strings. It lives in the vault SharedCore.md file and is prepended at runtime by the pipeline (see Shared core below). General cleanup carries the full detailed prose-polishing ruleset as its body; the structured templates carry only their section layout. The Daily note default is a prompt-only structured fill (extracted `## Calendar` / `## Goals` / `## Tasks`, each omitted when empty, then `## Braindump` = the full cleaned transcript last); no `NoteTemplate` schema change was needed to drive it. Meeting transcript is the Meeting notes prompt adapted for speaker-labeled input, shipped with `diarize: true` so it forces diarization on (see Speaker diarization).
|
||||
The 9 defaults ([src/settings/default-templates.ts](src/settings/default-templates.ts)) are General cleanup, Todo list, Daily note, Meeting notes, Meeting transcript, Idea capture, Lecture, Podcast, Guides. Each default template carries ONLY its per-template rules; the shared cleanup preface (guardrail + condensed cleanup + output discipline) is NOT baked into the prompt strings. It lives in the vault SharedCore.md file and is prepended at runtime by the pipeline (see Shared core below). General cleanup carries the full detailed prose-polishing ruleset as its body; the structured templates carry only their section layout. The Daily note default is a prompt-only structured fill (extracted `## Calendar` / `## Goals` / `## Tasks`, each omitted when empty, then `## Braindump` = the full cleaned transcript last); no `NoteTemplate` schema change was needed to drive it. Meeting transcript is the Meeting notes prompt adapted for speaker-labeled input, shipped with `diarize: true` so it forces diarization on (see Speaker diarization). Guides turns a spoken walkthrough into a step-by-step how-to (`insertMode: newFile`, `enableContextHint: true`); its prompt prescribes a strict two-level list format (ordered top-level steps, `-` bulleted sub-steps indented one tab, no deeper nesting, no `a.`/`i.`/`*` markers) because LLMs reliably mangle nested ordered lists, plus a trailing `## Gaps` section for anything ambiguous or missing.
|
||||
|
||||
`NoteTemplate.disableSharedCore?: boolean` (frontmatter `disableSharedCore: true`) opts a single template out of the shared-core prepend. `renderTemplateFile` ALWAYS emits the key so the knob is discoverable: empty (`disableSharedCore:`, parses to null = not disabled) by default, `disableSharedCore: true` when set. `parseTemplateFile` treats it as disabled only when the value is boolean `true` or the string `"true"` (case-insensitive) — the string form is tolerated because Obsidian's Properties UI may store an edited value as text; any other value (null/empty/false) means not disabled. The two opt-in boolean flags `enableContextHint` (see Context hint) and `diarize` (see Speaker diarization) follow the exact same render/parse convention (always-emitted empty key, boolean-or-`"true"` tolerance); their polarity is positive (set to turn ON), the reverse of `disableSharedCore`.
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const DEFAULT_TEMPLATES: NoteTemplate[] = [
|
|||
id: 'tpl-default-general-cleanup',
|
||||
name: 'General cleanup',
|
||||
prompt:
|
||||
`Produce natural-sounding written prose that preserves the speaker's meaning, structure, and approximate length.
|
||||
`Produce natural-sounding written prose that preserves the speaker's meaning, structure, and full length. This is a cleanup pass, NOT a summary: every distinct point, step, example, caveat, number, and named detail in the input must survive in the output. You are removing disfluencies and redundancy, never information. If the input is long, the output should be comparably long.
|
||||
|
||||
Detailed rules:
|
||||
- Remove "like" used as a filler or hedge ("is like a tool that"). Keep "like" when it means "similar to" or is a verb.
|
||||
|
|
@ -85,7 +85,7 @@ Goals, Tasks, and Calendar are extracted from what the speaker actually said in
|
|||
id: 'tpl-default-idea-capture',
|
||||
name: 'Idea capture',
|
||||
prompt:
|
||||
`Preserve the raw ideas faithfully: do not summarize, abridge, reorder, or invent connections between them. Prepend a single one-sentence summary of the core idea at the very top, followed by a blank line, then the cleaned ideas.`,
|
||||
`Capture every distinct idea and its supporting details faithfully: do not summarize, abridge, merge, reorder, or invent connections between them. Keep all specifics (names, numbers, examples, steps, and caveats) exactly as expressed, in the order the speaker presented them. The result is a complete, lightly cleaned record of everything said, not a digest. Prepend a single one-sentence summary of the core idea at the very top, followed by a blank line, then the cleaned ideas.`,
|
||||
insertMode: 'append',
|
||||
newFileFolder: '',
|
||||
newFileNameTemplate: 'Idea {{date}} {{time}}',
|
||||
|
|
@ -110,6 +110,65 @@ Goals, Tasks, and Calendar are extracted from what the speaker actually said in
|
|||
newFileNameTemplate: 'Podcast {{date}} {{time}}',
|
||||
enableContextHint: true,
|
||||
},
|
||||
{
|
||||
id: 'tpl-default-guides',
|
||||
name: 'Guides',
|
||||
prompt:
|
||||
`You convert transcribed spoken walkthroughs into clean, sequential documentation steps. The input is a raw transcript of someone narrating how to use an application or tool while they demonstrate it. Your output is documentation-ready instructions a writer can paste with minimal editing.
|
||||
|
||||
RULES
|
||||
|
||||
Fidelity over completeness. Use only what the transcript states. Never invent UI labels, menu paths, button names, keyboard shortcuts, or steps that were not described. If a step is clearly implied but its specifics are missing, insert a bracketed placeholder like [unspecified: exact menu name] rather than guessing.
|
||||
|
||||
Preserve literal values exactly. Commands, filenames, URLs, code, and any text the speaker says to type or enter must be reproduced verbatim, not paraphrased. If the speaker spells a command out in words, render the literal token only when unambiguous; otherwise flag it in the Gaps section.
|
||||
|
||||
Reorder into logical sequence. Speakers backtrack and self-correct ("actually, before that..."). Resolve these into the correct final order and drop the false starts. If a correction revises an earlier step, apply it and keep only the corrected version.
|
||||
|
||||
Strip speech artifacts. Remove filler (um, uh, like, you know, basically, so), restarts, and asides with no instructional content. Do NOT remove substantive caveats, warnings, or conditions.
|
||||
|
||||
Convert to imperative voice. "So I'm going to click Save" becomes "Click Save." Address the reader as the one performing the action.
|
||||
|
||||
Separate actions from explanation. Each step is one discrete action. Put rationale, warnings, and "why" context in a Note beneath the relevant step, not inside the step text.
|
||||
|
||||
Handle ambiguous references. Walkthroughs lean on what's on screen ("click here," "this one"). When the referent is recoverable from surrounding context, name it. When it is not, keep the action but mark the target: "Click [target unclear from transcript]."
|
||||
|
||||
Preserve branches and conditions. If the speaker gives alternatives ("if you're on Mac, instead..."), keep them as labeled conditional steps, not merged into one.
|
||||
|
||||
OUTPUT FORMAT
|
||||
|
||||
Output valid Obsidian-flavored Markdown only, structured so it renders cleanly with no literal list markers showing as plain text.
|
||||
|
||||
- Begin with a Markdown H1 title naming the task (e.g. "# SSO and SCIM setup").
|
||||
- End with a "## Gaps" H2 section: a bulleted list of everything ambiguous, missing, spelled-out, or assumed, so the writer knows exactly what to verify.
|
||||
- Put caveats and rationale on their own line as "**Note:** ..." (bold label), indented to match the content they belong to.
|
||||
|
||||
LIST FORMATTING (follow exactly)
|
||||
|
||||
- Use at most TWO levels: top-level steps, and one level of sub-steps beneath a step. Never nest a third level. If content seems to need a third level, flatten it: promote it to its own top-level step, or fold it into the parent line.
|
||||
- Top-level steps: an ordered list, one action per line, marked "1.", "2.", "3.", ... each starting at the left margin with no indentation.
|
||||
- Sub-steps: a bulleted list marked with "-", each line indented by exactly ONE TAB character (never spaces) beneath its parent step.
|
||||
- One marker style per level, never switched: the top level is always "1." numbers, sub-steps are always "-" bullets. Do NOT use lettered ("a.", "b.") or roman-numeral ("i.", "ii.") markers, and do NOT use "*" for bullets.
|
||||
- Do not continue the top-level numbering into sub-steps. Sub-steps are bullets, so they carry no number at all.
|
||||
- A step with no sub-actions is just a single numbered line with no nested list beneath it.
|
||||
- Caveats and rationale go on their own line as "**Note:** ..." (bold label, no list marker), indented one TAB to sit under the step or sub-step they belong to.
|
||||
|
||||
Match this shape exactly (there is exactly one tab before each sub-step bullet):
|
||||
|
||||
1. Create the organization in WorkOS.
|
||||
- Log into WorkOS and open the Organizations tab.
|
||||
- Search by name or domain to confirm it does not already exist.
|
||||
- Click Create Organization, then enter the name and domain from the request.
|
||||
2. Invite the admin to the organization.
|
||||
- Click Invite Contact and copy the setup link.
|
||||
- Paste the link into the Slack thread.
|
||||
- **Note:** For SCIM, also check Directory Sync, not just Single Sign On.
|
||||
|
||||
Do not add an introduction, summary, or closing remarks unless the transcript contains them.`,
|
||||
insertMode: 'newFile',
|
||||
newFileFolder: 'Guides',
|
||||
newFileNameTemplate: 'Guide {{date}} {{time}}',
|
||||
enableContextHint: true,
|
||||
},
|
||||
];
|
||||
|
||||
export function freshDefaultTemplates(): NoteTemplate[] {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ Each template is a single \`.md\` file in your templates folder (default \`ReWri
|
|||
|
||||
Templates are listed in the picker sorted by file name, so prefix names with numbers (\`01 General.md\`, \`02 Daily note.md\`) if you want a specific order. Identity comes from the \`id\` property, not the file name, so you can rename a file without breaking which template is your default or last used.
|
||||
|
||||
The **Populate** button in settings writes the eight built-in templates here. It is non-destructive: it skips any template whose \`id\` already exists, so you can run it again to top up after deleting one, and your own edits are never overwritten.
|
||||
The **Populate** button in settings writes the nine built-in templates here. It is non-destructive: it skips any template whose \`id\` already exists, so you can run it again to top up after deleting one, and your own edits are never overwritten.
|
||||
|
||||
## Frontmatter properties
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ Editing \`SharedCore.md\` changes the baseline for every template at once. It ri
|
|||
|
||||
Set \`enableContextHint: true\` on a template to surface an optional **Context** field whenever you use it. It is collapsed by default in both the main ReWrite window and the "Reprocess audio" picker, so it never gets in your way; expand it only when you want to add a one-off note about the recording, such as "Lecture by Dr. Smith on thermodynamics" or "Meeting with Rachel, Joe, and Sally".
|
||||
|
||||
Whatever you type is added to the prompt as a \`## Context\` block for that single run (it is not saved). It helps the model attribute statements to the right person, spell names correctly, and pick the right tone. It is the one-off counterpart to your Known nouns list: Known nouns is a standing list of names to always preserve, while Context is "here is what *this* recording is". The built-in Meeting notes, Meeting transcript, Lecture, and Podcast templates ship with this turned on.
|
||||
Whatever you type is added to the prompt as a \`## Context\` block for that single run (it is not saved). It helps the model attribute statements to the right person, spell names correctly, and pick the right tone. It is the one-off counterpart to your Known nouns list: Known nouns is a standing list of names to always preserve, while Context is "here is what *this* recording is". The built-in Meeting notes, Meeting transcript, Lecture, Podcast, and Guides templates ship with this turned on.
|
||||
|
||||
## Speaker identification
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue