@infosuweb/prompt-rewriter 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  - No changes yet.
11
11
 
12
+ ## [1.0.1] - 2026-11-30
13
+
14
+ - README: document usage-metrics command/settings, missing provider settings (`model`, `anthropicBaseUrl`, `catalogFreeOnly`, F8 analysis/research toggles), fix F10 "ten parts" → eight, align F8 Features with project analysis, and correct the environment-variables section.
15
+ - Acceptance tests for the architecture diagram match CI tag publish to npm (`publish-npm`) and regenerate Release labels without a stale SVG/PNG.
16
+
12
17
  ## [1.0.0] - 2026-11-30
13
18
 
14
19
  - First 1.x stable release: F6/F7 research mode, CI tag publish to npm via `NPM_TOKEN`, and the 0.16 line prompt/spec contracts.
package/README.md CHANGED
@@ -11,7 +11,7 @@ Independent commands:
11
11
 
12
12
  | Command | Shortcut | Description |
13
13
  | --- | --- | --- |
14
- | **Rewrite Current Input** | **F8** | Clarifies the same task into six parts in order (system context, what it does, actor, use cases, domain rules, limits). Adds no persona line. APIs and a main entity appear only when the draft already supports them. Uses skills plus a bounded 6,000-character view of workspace rules and configured root docs; skips chat history, the docs folder, and global rules. Method research goes to the Output log, not the chat field. Repeating F8 must produce a material refinement rather than the same result. |
14
+ | **Rewrite Current Input** | **F8** | Clarifies the same task into six parts in order (system context, what it does, actor, use cases, domain rules, limits). Adds no persona line. APIs and a main entity appear only when the draft already supports them. With project analysis on (default), indexes workspace rules, root docs, manifest, `specs/`, docs folder, and CHANGELOG, then rewrites with the selected sections in full (falls back to a bounded 6,000-character lean context if analysis fails). Skips chat history as the task, the docs folder as a bulk dump, and global rules. Method research goes to the Output log, not the chat field. Repeating F8 must produce a material refinement rather than the same result. |
15
15
  | **Specify Current Input** | **F9** | Writes an eight-part feature specification (introduction, business objectives, user scenarios and testing, functional requirements `RF#`, non-functional requirements `RNF#`, assumptions, key entities, limits). Does not run F8 and does not start with `Act as …`. Uses rules/docs as bounds; **always skips chat history** and built-in architecture defaults. Does not write plan, tasks, or implementation. |
16
16
  | **Specify Current Input (JSON)** | **F10** | Same eight parts as F9 Specify, as structured JSON (no `expert_role`). Also skips chat history. |
17
17
  | **Research Current Input (Spec)** | **F7** | Researches the questions in the input (related project docs, web search, model knowledge) and writes the eight-part F9 specification plus a research record: starting questions, analysis of the request, sources consulted, and process learning. Does not plan, send, or run anything. |
@@ -24,6 +24,7 @@ Independent commands:
24
24
  | **Select Active Model** | — | Lists models for the current backend (Ollama `/api/tags`, Cursor `agent models`, Hermes/OpenAI `GET /models`, curated ids when live listing is unavailable). |
25
25
  | **Select Ollama Model** | — | Lists local Ollama models only (same `GET /api/tags` catalog Hermes uses) and saves `promptRewriter.ollamaModel`. |
26
26
  | **Import Hermes Model Settings** | — | Copies Hermes Agent’s primary local model (`hermes config get model.*`) into Prompt Rewriter Ollama settings. |
27
+ | **Copy Usage Metrics Summary** | — | Copies a local anonymous usage-metrics summary to the clipboard (command ids, success/failure, version, platform, backend). Never includes prompts, keys, or file contents. |
27
28
 
28
29
  F12 enforces a specific expert role. F6/F7, F8 and F9/F10 do not add a persona. Every F6–F12 transformation validates its output format and scope, rejects invented operational work or file paths, and makes one focused repair attempt when a model response fails those checks. API keys, prompts, file contents, file names, and generated text are never sent to usage metrics.
29
30
 
@@ -163,6 +164,8 @@ Open **Settings** and set:
163
164
  | Setting | Purpose |
164
165
  | --- | --- |
165
166
  | `promptRewriter.backend` | `ollama` (local), `openai` (official API), `anthropic` (Claude API), `google` (Gemini), `cursorAgents` (Cursor Agent CLI), or `openaiCompatible` (Hermes/custom). Default: `ollama` |
167
+ | `promptRewriter.model` | Model id for OpenAI / openaiCompatible (and Select Active Model). Example: `gpt-4o-mini` or a Hermes `:free` id. |
168
+ | `promptRewriter.catalogFreeOnly` | When true, the Setup model list prefers Hermes/OpenAI ids ending with `:free`. You can still type any id. Default: `false` |
166
169
  | `promptRewriter.worker.enabled` | Opt-in context worker for **F6/F7/F9/F10**. Oversized context is summarized before the main model call. **F8/F12 never delegate.** Default: `false` |
167
170
  | `promptRewriter.worker.backend` | Worker backend, independent from the main backend: `ollama`, `openai`, `anthropic`, `google`, or `openaiCompatible`. It reuses that backend's existing credentials, URL, and timeout. Default: `ollama` |
168
171
  | `promptRewriter.worker.model` | Worker model id, independent from the main model. Required when the worker is enabled. |
@@ -171,7 +174,8 @@ Open **Settings** and set:
171
174
  | `promptRewriter.apiKey` | API key for OpenAI / Hermes / openaiCompatible. Do not commit. |
172
175
  | `promptRewriter.cursorApiKey` | Optional Cursor API key when `backend` is `cursorAgents`. Prefer `agent login` / `CURSOR_API_KEY` when unset. |
173
176
  | `promptRewriter.anthropicApiKey` | Anthropic/Claude API key when `backend` is `anthropic`. |
174
- | `promptRewriter.anthropicWorkspaceId` | Workspace ID (`wrkspc_…`) for identity-linked / multi-workspace Anthropic keys. Sent as `anthropic-workspace-id` on each request. |
177
+ | `promptRewriter.anthropicBaseUrl` | Anthropic API host. Default: `https://api.anthropic.com` |
178
+ | `promptRewriter.anthropicWorkspaceId` | Workspace ID (`wrkspc_…`) for identity-linked / multi-workspace Anthropic keys. Sent as `anthropic-workspace-id` on each request. When empty, falls back to `ANTHROPIC_WORKSPACE_ID` if set. |
175
179
  | `promptRewriter.googleApiKey` | Google AI Studio API key when `backend` is `google`. Used to list models available to that key and to call `:generateContent`. |
176
180
  | `promptRewriter.googleBaseUrl` | Gemini API host (OpenAI-compat form). Used to derive the native `:generateContent` / `/models` endpoints. Default: `https://generativelanguage.googleapis.com/v1beta/openai/` |
177
181
  | `promptRewriter.googleModel` | Preferred Gemini model id. Default: `gemini-3.6-flash`. Retired ids such as `gemini-2.5-flash` are remapped automatically. |
@@ -187,13 +191,17 @@ Open **Settings** and set:
187
191
  | `promptRewriter.includeRootDocs` | When true, current-input modes load `AGENTS.md`, `README.md`, and `.cursorrules`; **F6/F7 Research** and **F8/F12** include them only within their bounded 6,000-character lean context. Default: `true` |
188
192
  | `promptRewriter.docsFolder` | Docs folder for **F9/F10** (`.md`/`.mdc`/`.txt`). Default: `docs`. Empty disables it. **F6/F7 Research** and **F8/F12** always skip the docs folder (F6/F7 still load related sections through research evidence). |
189
193
  | `promptRewriter.includeArchitectureDefaults` | When true, F8 and F12 inject built-in SOLID + hexagonal constraints for software work. **F6/F7 Research** and **F9/F10 Specify** skip them. Default: `true` |
190
- | `promptRewriter.includeLastChatResponse` | Chat history from Cursor agent transcripts. **F6/F7 Research** and **F9/F10 Specify** always skip chat history. **F8** always skips chat history (lean rewrite). **F12** always loads it. Default: `true` |
194
+ | `promptRewriter.includeLastChatResponse` | Chat history from Cursor agent transcripts. **F6/F7 Research** and **F9/F10 Specify** always skip chat history. **F8** always skips chat history as the task (lean rewrite; the last reply may still help resolve references for expert research). **F12** always loads it. Default: `true` |
195
+ | `promptRewriter.rewriteProjectAnalysis` | When true, **F8** indexes project docs and rewrites with the selected sections in full instead of only the first lean root-doc slice. Default: `true` |
196
+ | `promptRewriter.rewriteExpertResearch` | When true, **F8** runs native web search for how a practitioner would approach the subject and writes the method note to the Output log (not the chat field). Skipped when the backend has no web search. Default: `true` |
191
197
  | `promptRewriter.rewriteSystemPromptRules` | Custom system prompt for **F8 Rewrite**. Empty uses the built-in six-part clarified request (no persona). Custom rules still must pass the six-part and mechanism checks. Editable in the Rules tab. |
192
198
  | `promptRewriter.expandSystemPromptRules` | Custom system prompt for **F9 Specify**. Empty uses the built-in eight-part specification without a persona and without running F8 first. Custom rules still must pass the eight-part checks. Editable in the Rules tab. |
193
- | `promptRewriter.expandJsonSystemPromptRules` | Custom system prompt for **F10 Specify JSON**. Empty uses built-in JSON for the same ten parts as F9 (no `expert_role`). Editable in the Rules tab. |
199
+ | `promptRewriter.expandJsonSystemPromptRules` | Custom system prompt for **F10 Specify JSON**. Empty uses built-in JSON for the same eight parts as F9 (no `expert_role`). Editable in the Rules tab. |
194
200
  | `promptRewriter.researchSpecSystemPromptRules` | Custom system prompt for **F7 Research Spec**. Empty uses the built-in rules (eight F9 parts plus the research record, no persona line). Editable in the Rules tab. |
195
201
  | `promptRewriter.researchPromptSystemPromptRules` | Custom system prompt for **F6 Research Prompt**. Empty uses the built-in rules (six F8 parts plus the research record, no persona line). Editable in the Rules tab. |
196
202
  | `promptRewriter.loopSystemPromptRules`, `promptRewriter.loopJsonSystemPromptRules` | **Deprecated and ignored** since 0.16.0 (they configured the old F7/F6 Spec Kit plan). Each F6/F7 run notes in the Output channel when they still hold a value. |
203
+ | `promptRewriter.shareUsageMetrics` | When true, record anonymous usage metrics (command id, success/failure, extension version, platform, LLM backend). Never records prompt text, API keys, or personal data. Default: `false` |
204
+ | `promptRewriter.usageMetricsEndpoint` | Optional HTTPS URL to POST anonymous usage event batches when `shareUsageMetrics` is enabled. Empty keeps metrics local only. |
197
205
 
198
206
  - Prefer **User** settings over **Workspace** settings so the API key is not stored in the repository.
199
207
  - **Save & apply** writes User settings and clears any Workspace overrides for the same keys, so F6–F12 match the panel.
@@ -509,7 +517,14 @@ To change a shortcut:
509
517
 
510
518
  ## Environment variables and secrets
511
519
 
512
- This extension does not read `.env` files or environment variables. Configure the API key through `promptRewriter.apiKey` in editor settings. Never commit real secrets.
520
+ This extension does not read `.env` files. Prefer editor settings for secrets (`promptRewriter.apiKey`, `promptRewriter.anthropicApiKey`, `promptRewriter.googleApiKey`, optional `promptRewriter.cursorApiKey`). Never commit real secrets.
521
+
522
+ Host process environment used when set:
523
+
524
+ | Variable | Purpose |
525
+ | --- | --- |
526
+ | `CURSOR_API_KEY` | Cursor Agent CLI auth when `backend` is `cursorAgents` and `promptRewriter.cursorApiKey` is empty (prefer `agent login`). |
527
+ | `ANTHROPIC_WORKSPACE_ID` | Fallback workspace id when `promptRewriter.anthropicWorkspaceId` is empty. |
513
528
 
514
529
  ## License
515
530
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@infosuweb/prompt-rewriter",
3
3
  "displayName": "Prompt Rewriter",
4
4
  "description": "Rewrite a selected prompt so it is clearer and more precise, without adding new ideas.",
5
- "version": "1.0.0",
5
+ "version": "1.0.1",
6
6
  "publisher": "suweb",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -289,7 +289,7 @@
289
289
  "promptRewriter.anthropicWorkspaceId": {
290
290
  "type": "string",
291
291
  "default": "",
292
- "description": "Anthropic workspace ID (wrkspc_\u2026) required for identity-linked / multi-workspace API keys. Sent as the anthropic-workspace-id header."
292
+ "description": "Anthropic workspace ID (wrkspc_…) required for identity-linked / multi-workspace API keys. Sent as the anthropic-workspace-id header."
293
293
  },
294
294
  "promptRewriter.googleApiKey": {
295
295
  "type": "string",
@@ -333,7 +333,7 @@
333
333
  "default": 8192,
334
334
  "minimum": 2048,
335
335
  "maximum": 131072,
336
- "description": "Context window size sent to Ollama as options.num_ctx for every Ollama command (F6\u2013F12, clipboard, selection). Default: 8192. Raise it if local models truncate long prompts."
336
+ "description": "Context window size sent to Ollama as options.num_ctx for every Ollama command (F6–F12, clipboard, selection). Default: 8192. Raise it if local models truncate long prompts."
337
337
  },
338
338
  "promptRewriter.contextFolder": {
339
339
  "type": "string",