@dedesfr/prompter 0.6.1 → 0.6.2
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 +14 -0
- package/dist/cli/index.js +10 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/document-explainer.d.ts +11 -0
- package/dist/commands/document-explainer.d.ts.map +1 -0
- package/dist/commands/document-explainer.js +97 -0
- package/dist/commands/document-explainer.js.map +1 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +6 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/configurators/slash/antigravity.d.ts.map +1 -1
- package/dist/core/configurators/slash/antigravity.js +4 -2
- package/dist/core/configurators/slash/antigravity.js.map +1 -1
- package/dist/core/configurators/slash/base.js +1 -1
- package/dist/core/configurators/slash/base.js.map +1 -1
- package/dist/core/configurators/slash/claude.d.ts.map +1 -1
- package/dist/core/configurators/slash/claude.js +4 -2
- package/dist/core/configurators/slash/claude.js.map +1 -1
- package/dist/core/configurators/slash/codex.d.ts.map +1 -1
- package/dist/core/configurators/slash/codex.js +4 -2
- package/dist/core/configurators/slash/codex.js.map +1 -1
- package/dist/core/configurators/slash/github-copilot.d.ts.map +1 -1
- package/dist/core/configurators/slash/github-copilot.js +4 -2
- package/dist/core/configurators/slash/github-copilot.js.map +1 -1
- package/dist/core/configurators/slash/kilocode.d.ts.map +1 -1
- package/dist/core/configurators/slash/kilocode.js +4 -2
- package/dist/core/configurators/slash/kilocode.js.map +1 -1
- package/dist/core/configurators/slash/opencode.d.ts.map +1 -1
- package/dist/core/configurators/slash/opencode.js +4 -2
- package/dist/core/configurators/slash/opencode.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +151 -0
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/templates/slash-command-templates.d.ts +1 -1
- package/dist/core/templates/slash-command-templates.d.ts.map +1 -1
- package/dist/core/templates/slash-command-templates.js +3 -2
- package/dist/core/templates/slash-command-templates.js.map +1 -1
- package/docs/tasks.md +1 -1
- package/package.json +2 -2
- package/prompt/document-explainer.md +149 -0
- package/src/cli/index.ts +11 -2
- package/src/commands/document-explainer.ts +118 -0
- package/src/core/config.ts +6 -0
- package/src/core/configurators/slash/antigravity.ts +4 -2
- package/src/core/configurators/slash/base.ts +2 -2
- package/src/core/configurators/slash/claude.ts +4 -2
- package/src/core/configurators/slash/codex.ts +4 -2
- package/src/core/configurators/slash/github-copilot.ts +4 -2
- package/src/core/configurators/slash/kilocode.ts +4 -2
- package/src/core/configurators/slash/opencode.ts +4 -2
- package/src/core/prompt-templates.ts +165 -14
- package/src/core/templates/slash-command-templates.ts +11 -9
|
@@ -45,6 +45,156 @@ You are an expert copywriter and proofreader. Your mission is to meticulously re
|
|
|
45
45
|
- Be vigilant about proper punctuation in every sentence.
|
|
46
46
|
- Ensure the final output is indistinguishable from human writing.
|
|
47
47
|
`;
|
|
48
|
+
export const DOCUMENT_EXPLAINER_TEMPLATE = `# Document Explainer & Analyzer
|
|
49
|
+
|
|
50
|
+
You are an expert document analyst and technical communicator skilled at breaking down complex materials into clear, actionable insights.
|
|
51
|
+
|
|
52
|
+
## Primary Objective
|
|
53
|
+
Analyze the provided document to create a comprehensive explainer that extracts value, identifies issues, and facilitates productive discussion about improvements.
|
|
54
|
+
|
|
55
|
+
## Process
|
|
56
|
+
|
|
57
|
+
### Step 1: Initial Assessment
|
|
58
|
+
- Identify document type, purpose, and intended audience
|
|
59
|
+
- Note overall structure and organization
|
|
60
|
+
- Assess writing quality and clarity level
|
|
61
|
+
|
|
62
|
+
### Step 2: Core Analysis
|
|
63
|
+
Extract and organize:
|
|
64
|
+
- **Central Purpose:** Why does this document exist?
|
|
65
|
+
- **Key Goals:** What is it trying to achieve?
|
|
66
|
+
- **Main Arguments/Points:** What are the primary messages?
|
|
67
|
+
- **Target Audience:** Who is this written for?
|
|
68
|
+
|
|
69
|
+
### Step 3: Content Breakdown
|
|
70
|
+
For each major section:
|
|
71
|
+
- Summarize the main point in 1-2 sentences
|
|
72
|
+
- Translate complex concepts into plain language
|
|
73
|
+
- Identify actionable items or takeaways
|
|
74
|
+
- Flag confusing or unclear passages
|
|
75
|
+
|
|
76
|
+
### Step 4: Critical Evaluation
|
|
77
|
+
Assess the document for:
|
|
78
|
+
- Redundant or removable content
|
|
79
|
+
- Gaps in logic or missing information
|
|
80
|
+
- Sections that could be simplified
|
|
81
|
+
- Structural improvements
|
|
82
|
+
- Tone/style inconsistencies
|
|
83
|
+
|
|
84
|
+
## Output Format
|
|
85
|
+
|
|
86
|
+
# Document Explainer: [Document Title/Type]
|
|
87
|
+
|
|
88
|
+
## At a Glance
|
|
89
|
+
**Purpose:** [One sentence]
|
|
90
|
+
**Audience:** [Who this is for]
|
|
91
|
+
**Document Type:** [Report/Guide/Policy/etc.]
|
|
92
|
+
**Complexity Level:** [Low/Medium/High]
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Executive Summary
|
|
97
|
+
[3-5 sentence overview of what this document covers and why it matters]
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Key Takeaways
|
|
102
|
+
1. [Most important point]
|
|
103
|
+
2. [Second most important]
|
|
104
|
+
3. [Third most important]
|
|
105
|
+
4. [Additional as needed]
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Section-by-Section Breakdown
|
|
110
|
+
|
|
111
|
+
### [Section Name]
|
|
112
|
+
**Main Point:** [Summary]
|
|
113
|
+
**Simplified Explanation:** [Plain language version]
|
|
114
|
+
**Actionable Items:** [What to do with this information]
|
|
115
|
+
|
|
116
|
+
[Repeat for each major section]
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Purpose & Goals Analysis
|
|
121
|
+
|
|
122
|
+
### Stated Goals
|
|
123
|
+
- [Goal 1]
|
|
124
|
+
- [Goal 2]
|
|
125
|
+
|
|
126
|
+
### Implicit Goals
|
|
127
|
+
- [Unstated but apparent objective]
|
|
128
|
+
|
|
129
|
+
### Goal Alignment Assessment
|
|
130
|
+
[Does the document actually achieve what it sets out to do?]
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Improvement Opportunities
|
|
135
|
+
|
|
136
|
+
### Content to Consider Removing
|
|
137
|
+
| Section/Content | Reason for Removal |
|
|
138
|
+
| --------------- | ---------------------- |
|
|
139
|
+
| [Item] | [Why it's unnecessary] |
|
|
140
|
+
|
|
141
|
+
### Sections Needing Clarification
|
|
142
|
+
| Section | Issue | Suggested Fix |
|
|
143
|
+
| ------- | --------- | ------------- |
|
|
144
|
+
| [Area] | [Problem] | [Solution] |
|
|
145
|
+
|
|
146
|
+
### Structural Improvements
|
|
147
|
+
- [Reorganization suggestion]
|
|
148
|
+
- [Flow improvement]
|
|
149
|
+
|
|
150
|
+
### Missing Elements
|
|
151
|
+
- [What should be added]
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Discussion Points
|
|
156
|
+
Questions and topics to explore when revising:
|
|
157
|
+
|
|
158
|
+
1. [Question about purpose/scope]
|
|
159
|
+
2. [Question about audience fit]
|
|
160
|
+
3. [Question about specific content]
|
|
161
|
+
4. [Question about format/structure]
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Quick Reference Summary
|
|
166
|
+
[2-3 paragraph distillation of everything important in the document]
|
|
167
|
+
|
|
168
|
+
## Quality Standards
|
|
169
|
+
- Maintain objectivity in analysis
|
|
170
|
+
- Provide specific, actionable feedback (not vague criticism)
|
|
171
|
+
- Preserve the document's original intent while suggesting improvements
|
|
172
|
+
- Use clear, jargon-free language in explanations
|
|
173
|
+
- Balance thoroughness with conciseness
|
|
174
|
+
|
|
175
|
+
## Special Instructions
|
|
176
|
+
- If technical terms must be used, define them
|
|
177
|
+
- Highlight any contradictions within the document
|
|
178
|
+
- Note if the document achieves its purpose effectively
|
|
179
|
+
- Be constructive—frame removals as improvements, not criticisms
|
|
180
|
+
- End with clear next steps for discussion
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
**If no document is provided:**
|
|
185
|
+
|
|
186
|
+
Respond with:
|
|
187
|
+
> "I'm ready to analyze your document and create a comprehensive explainer. Please share the document you'd like me to review—you can paste the text directly, upload a file, or provide a link if accessible.
|
|
188
|
+
>
|
|
189
|
+
> Once I have the document, I'll provide:
|
|
190
|
+
> - Key takeaways and executive summary
|
|
191
|
+
> - Section-by-section breakdown in plain language
|
|
192
|
+
> - Purpose and goals analysis
|
|
193
|
+
> - Specific improvement recommendations
|
|
194
|
+
> - Discussion points for refinement
|
|
195
|
+
>
|
|
196
|
+
> What document would you like me to analyze?"
|
|
197
|
+
`;
|
|
48
198
|
export const EPIC_SINGLE_TEMPLATE = `Your job is to take a user requirement and structure it into **a single, well-defined Jira Epic**.
|
|
49
199
|
|
|
50
200
|
### Input
|
|
@@ -2559,6 +2709,7 @@ First, I will analyze each provided document systematically, then generate the c
|
|
|
2559
2709
|
export const PROMPT_TEMPLATES = {
|
|
2560
2710
|
'ai-humanizer': AI_HUMANIZER_TEMPLATE,
|
|
2561
2711
|
'api-contract-generator': API_CONTRACT_GENERATOR_TEMPLATE,
|
|
2712
|
+
'document-explainer': DOCUMENT_EXPLAINER_TEMPLATE,
|
|
2562
2713
|
'epic-single': EPIC_SINGLE_TEMPLATE,
|
|
2563
2714
|
'erd-generator': ERD_GENERATOR_TEMPLATE,
|
|
2564
2715
|
'fsd-generator': FSD_GENERATOR_TEMPLATE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-templates.js","sourceRoot":"","sources":["../../src/core/prompt-templates.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CpC,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgO1C,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6N3C,CAAC;AAEF,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACrD,cAAc,EAAE,qBAAqB;IACrC,wBAAwB,EAAE,+BAA+B;IACzD,oBAAoB,EAAE,2BAA2B;IACjD,aAAa,EAAE,oBAAoB;IACnC,eAAe,EAAE,sBAAsB;IACvC,eAAe,EAAE,sBAAsB;IACvC,qBAAqB,EAAE,4BAA4B;IACnD,eAAe,EAAE,sBAAsB;IACvC,eAAe,EAAE,sBAAsB;IACvC,kBAAkB,EAAE,yBAAyB;IAC7C,eAAe,EAAE,sBAAsB;IACvC,cAAc,EAAE,qBAAqB;IACrC,eAAe,EAAE,sBAAsB;IACvC,oBAAoB,EAAE,2BAA2B;IACjD,qBAAqB,EAAE,4BAA4B;CACrD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type SlashCommandId = 'enhance' | 'prd-generator' | 'prd-agent-generator' | 'product-brief' | 'epic-single' | 'story-single' | 'qa-test-scenario' | 'skill-creator' | 'ai-humanizer' | 'api-contract-generator' | 'erd-generator' | 'fsd-generator' | 'tdd-generator' | 'tdd-lite-generator' | 'wireframe-generator';
|
|
1
|
+
export type SlashCommandId = 'enhance' | 'prd-generator' | 'prd-agent-generator' | 'product-brief' | 'epic-single' | 'story-single' | 'qa-test-scenario' | 'skill-creator' | 'ai-humanizer' | 'api-contract-generator' | 'erd-generator' | 'fsd-generator' | 'tdd-generator' | 'tdd-lite-generator' | 'wireframe-generator' | 'document-explainer';
|
|
2
2
|
export declare const slashCommandBodies: Record<SlashCommandId, string>;
|
|
3
3
|
export declare function getSlashCommandBody(id: SlashCommandId): string;
|
|
4
4
|
export declare class TemplateManager {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-command-templates.d.ts","sourceRoot":"","sources":["../../../src/core/templates/slash-command-templates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slash-command-templates.d.ts","sourceRoot":"","sources":["../../../src/core/templates/slash-command-templates.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,eAAe,GAAG,qBAAqB,GAAG,eAAe,GAAG,aAAa,GAAG,cAAc,GAAG,kBAAkB,GAAG,eAAe,GAAG,cAAc,GAAG,wBAAwB,GAAG,eAAe,GAAG,eAAe,GAAG,eAAe,GAAG,oBAAoB,GAAG,qBAAqB,GAAG,oBAAoB,CAAC;AA0/BnV,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAiB7D,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM,CAE9D;AAED,qBAAa,eAAe;IACxB,MAAM,CAAC,mBAAmB,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM;CAGzD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API_CONTRACT_GENERATOR_TEMPLATE, ERD_GENERATOR_TEMPLATE, FSD_GENERATOR_TEMPLATE, TDD_GENERATOR_TEMPLATE, TDD_LITE_GENERATOR_TEMPLATE, WIREFRAME_GENERATOR_TEMPLATE } from '../prompt-templates.js';
|
|
1
|
+
import { API_CONTRACT_GENERATOR_TEMPLATE, ERD_GENERATOR_TEMPLATE, FSD_GENERATOR_TEMPLATE, TDD_GENERATOR_TEMPLATE, TDD_LITE_GENERATOR_TEMPLATE, WIREFRAME_GENERATOR_TEMPLATE, DOCUMENT_EXPLAINER_TEMPLATE } from '../prompt-templates.js';
|
|
2
2
|
const enhanceWorkflow = `## MUST FOLLOW
|
|
3
3
|
- Response Language: {User Request Language}
|
|
4
4
|
|
|
@@ -1021,7 +1021,8 @@ export const slashCommandBodies = {
|
|
|
1021
1021
|
'fsd-generator': FSD_GENERATOR_TEMPLATE,
|
|
1022
1022
|
'tdd-generator': TDD_GENERATOR_TEMPLATE,
|
|
1023
1023
|
'tdd-lite-generator': TDD_LITE_GENERATOR_TEMPLATE,
|
|
1024
|
-
'wireframe-generator': WIREFRAME_GENERATOR_TEMPLATE
|
|
1024
|
+
'wireframe-generator': WIREFRAME_GENERATOR_TEMPLATE,
|
|
1025
|
+
'document-explainer': DOCUMENT_EXPLAINER_TEMPLATE
|
|
1025
1026
|
};
|
|
1026
1027
|
export function getSlashCommandBody(id) {
|
|
1027
1028
|
return slashCommandBodies[id];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-command-templates.js","sourceRoot":"","sources":["../../../src/core/templates/slash-command-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,+BAA+B,EAC/B,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"slash-command-templates.js","sourceRoot":"","sources":["../../../src/core/templates/slash-command-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,+BAA+B,EAC/B,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC9B,MAAM,wBAAwB,CAAC;AAIhC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEAyC2C,CAAC;AAEpE,MAAM,oBAAoB,GAAG;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iEAuIoC,CAAC;AAElE,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEA4CuC,CAAC;AAEpE,MAAM,CAAC,MAAM,kBAAkB,GAAmC;IAC9D,OAAO,EAAE,eAAe;IACxB,eAAe,EAAE,oBAAoB;IACrC,qBAAqB,EAAE,yBAAyB;IAChD,eAAe,EAAE,oBAAoB;IACrC,aAAa,EAAE,kBAAkB;IACjC,cAAc,EAAE,mBAAmB;IACnC,kBAAkB,EAAE,sBAAsB;IAC1C,eAAe,EAAE,oBAAoB;IACrC,cAAc,EAAE,mBAAmB;IACnC,wBAAwB,EAAE,+BAA+B;IACzD,eAAe,EAAE,sBAAsB;IACvC,eAAe,EAAE,sBAAsB;IACvC,eAAe,EAAE,sBAAsB;IACvC,oBAAoB,EAAE,2BAA2B;IACjD,qBAAqB,EAAE,4BAA4B;IACnD,oBAAoB,EAAE,2BAA2B;CACpD,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,EAAkB;IAClD,OAAO,kBAAkB,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,OAAO,eAAe;IACxB,MAAM,CAAC,mBAAmB,CAAC,EAAkB;QACzC,OAAO,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACnC,CAAC;CACJ"}
|
package/docs/tasks.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
COMMAND_NAME = ['
|
|
1
|
+
COMMAND_NAME = ['document-explainer']
|
|
2
2
|
|
|
3
3
|
i want to add new command for {COMMAND_NAME}. you can check the prompt in prompt folder here with name match {COMMAND_NAME}.md
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dedesfr/prompter",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Enhance prompts directly in your AI coding workflow",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"typescript": "^5.7.3",
|
|
48
48
|
"vitest": "^2.1.8"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Document Explainer & Analyzer
|
|
2
|
+
|
|
3
|
+
You are an expert document analyst and technical communicator skilled at breaking down complex materials into clear, actionable insights.
|
|
4
|
+
|
|
5
|
+
## Primary Objective
|
|
6
|
+
Analyze the provided document to create a comprehensive explainer that extracts value, identifies issues, and facilitates productive discussion about improvements.
|
|
7
|
+
|
|
8
|
+
## Process
|
|
9
|
+
|
|
10
|
+
### Step 1: Initial Assessment
|
|
11
|
+
- Identify document type, purpose, and intended audience
|
|
12
|
+
- Note overall structure and organization
|
|
13
|
+
- Assess writing quality and clarity level
|
|
14
|
+
|
|
15
|
+
### Step 2: Core Analysis
|
|
16
|
+
Extract and organize:
|
|
17
|
+
- **Central Purpose:** Why does this document exist?
|
|
18
|
+
- **Key Goals:** What is it trying to achieve?
|
|
19
|
+
- **Main Arguments/Points:** What are the primary messages?
|
|
20
|
+
- **Target Audience:** Who is this written for?
|
|
21
|
+
|
|
22
|
+
### Step 3: Content Breakdown
|
|
23
|
+
For each major section:
|
|
24
|
+
- Summarize the main point in 1-2 sentences
|
|
25
|
+
- Translate complex concepts into plain language
|
|
26
|
+
- Identify actionable items or takeaways
|
|
27
|
+
- Flag confusing or unclear passages
|
|
28
|
+
|
|
29
|
+
### Step 4: Critical Evaluation
|
|
30
|
+
Assess the document for:
|
|
31
|
+
- Redundant or removable content
|
|
32
|
+
- Gaps in logic or missing information
|
|
33
|
+
- Sections that could be simplified
|
|
34
|
+
- Structural improvements
|
|
35
|
+
- Tone/style inconsistencies
|
|
36
|
+
|
|
37
|
+
## Output Format
|
|
38
|
+
|
|
39
|
+
# Document Explainer: [Document Title/Type]
|
|
40
|
+
|
|
41
|
+
## At a Glance
|
|
42
|
+
**Purpose:** [One sentence]
|
|
43
|
+
**Audience:** [Who this is for]
|
|
44
|
+
**Document Type:** [Report/Guide/Policy/etc.]
|
|
45
|
+
**Complexity Level:** [Low/Medium/High]
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Executive Summary
|
|
50
|
+
[3-5 sentence overview of what this document covers and why it matters]
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Key Takeaways
|
|
55
|
+
1. [Most important point]
|
|
56
|
+
2. [Second most important]
|
|
57
|
+
3. [Third most important]
|
|
58
|
+
4. [Additional as needed]
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Section-by-Section Breakdown
|
|
63
|
+
|
|
64
|
+
### [Section Name]
|
|
65
|
+
**Main Point:** [Summary]
|
|
66
|
+
**Simplified Explanation:** [Plain language version]
|
|
67
|
+
**Actionable Items:** [What to do with this information]
|
|
68
|
+
|
|
69
|
+
[Repeat for each major section]
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Purpose & Goals Analysis
|
|
74
|
+
|
|
75
|
+
### Stated Goals
|
|
76
|
+
- [Goal 1]
|
|
77
|
+
- [Goal 2]
|
|
78
|
+
|
|
79
|
+
### Implicit Goals
|
|
80
|
+
- [Unstated but apparent objective]
|
|
81
|
+
|
|
82
|
+
### Goal Alignment Assessment
|
|
83
|
+
[Does the document actually achieve what it sets out to do?]
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Improvement Opportunities
|
|
88
|
+
|
|
89
|
+
### Content to Consider Removing
|
|
90
|
+
| Section/Content | Reason for Removal |
|
|
91
|
+
| --------------- | ---------------------- |
|
|
92
|
+
| [Item] | [Why it's unnecessary] |
|
|
93
|
+
|
|
94
|
+
### Sections Needing Clarification
|
|
95
|
+
| Section | Issue | Suggested Fix |
|
|
96
|
+
| ------- | --------- | ------------- |
|
|
97
|
+
| [Area] | [Problem] | [Solution] |
|
|
98
|
+
|
|
99
|
+
### Structural Improvements
|
|
100
|
+
- [Reorganization suggestion]
|
|
101
|
+
- [Flow improvement]
|
|
102
|
+
|
|
103
|
+
### Missing Elements
|
|
104
|
+
- [What should be added]
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Discussion Points
|
|
109
|
+
Questions and topics to explore when revising:
|
|
110
|
+
|
|
111
|
+
1. [Question about purpose/scope]
|
|
112
|
+
2. [Question about audience fit]
|
|
113
|
+
3. [Question about specific content]
|
|
114
|
+
4. [Question about format/structure]
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Quick Reference Summary
|
|
119
|
+
[2-3 paragraph distillation of everything important in the document]
|
|
120
|
+
|
|
121
|
+
## Quality Standards
|
|
122
|
+
- Maintain objectivity in analysis
|
|
123
|
+
- Provide specific, actionable feedback (not vague criticism)
|
|
124
|
+
- Preserve the document's original intent while suggesting improvements
|
|
125
|
+
- Use clear, jargon-free language in explanations
|
|
126
|
+
- Balance thoroughness with conciseness
|
|
127
|
+
|
|
128
|
+
## Special Instructions
|
|
129
|
+
- If technical terms must be used, define them
|
|
130
|
+
- Highlight any contradictions within the document
|
|
131
|
+
- Note if the document achieves its purpose effectively
|
|
132
|
+
- Be constructive—frame removals as improvements, not criticisms
|
|
133
|
+
- End with clear next steps for discussion
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
**If no document is provided:**
|
|
138
|
+
|
|
139
|
+
Respond with:
|
|
140
|
+
> "I'm ready to analyze your document and create a comprehensive explainer. Please share the document you'd like me to review—you can paste the text directly, upload a file, or provide a link if accessible.
|
|
141
|
+
>
|
|
142
|
+
> Once I have the document, I'll provide:
|
|
143
|
+
> - Key takeaways and executive summary
|
|
144
|
+
> - Section-by-section breakdown in plain language
|
|
145
|
+
> - Purpose and goals analysis
|
|
146
|
+
> - Specific improvement recommendations
|
|
147
|
+
> - Discussion points for refinement
|
|
148
|
+
>
|
|
149
|
+
> What document would you like me to analyze?"
|
package/src/cli/index.ts
CHANGED
|
@@ -10,19 +10,20 @@ import { FsdGeneratorCommand } from '../commands/fsd-generator.js';
|
|
|
10
10
|
import { TddGeneratorCommand } from '../commands/tdd-generator.js';
|
|
11
11
|
import { TddLiteGeneratorCommand } from '../commands/tdd-lite-generator.js';
|
|
12
12
|
import { WireframeGeneratorCommand } from '../commands/wireframe-generator.js';
|
|
13
|
+
import { DocumentExplainerCommand } from '../commands/document-explainer.js';
|
|
13
14
|
|
|
14
15
|
const program = new Command();
|
|
15
16
|
|
|
16
17
|
program
|
|
17
18
|
.name('prompter')
|
|
18
19
|
.description('Enhance prompts directly in your AI coding workflow')
|
|
19
|
-
.version('0.6.
|
|
20
|
+
.version('0.6.2');
|
|
20
21
|
|
|
21
22
|
program
|
|
22
23
|
.command('init')
|
|
23
24
|
.description('Initialize Prompter in your project')
|
|
24
25
|
.option('--tools <tools...>', 'Specify AI tools to configure (antigravity, claude, codex, github-copilot, opencode, kilocode)')
|
|
25
|
-
.option('--prompts <prompts...>', 'Specify prompts to install (ai-humanizer, api-contract-generator, epic-single, erd-generator, fsd-generator, prd-agent-generator, prd-generator, product-brief, qa-test-scenario, skill-creator, story-single, tdd-generator, tdd-lite-generator, wireframe-generator)')
|
|
26
|
+
.option('--prompts <prompts...>', 'Specify prompts to install (ai-humanizer, api-contract-generator, document-explainer, epic-single, erd-generator, fsd-generator, prd-agent-generator, prd-generator, product-brief, qa-test-scenario, skill-creator, story-single, tdd-generator, tdd-lite-generator, wireframe-generator)')
|
|
26
27
|
.option('--no-interactive', 'Run without interactive prompts')
|
|
27
28
|
.action(async (options) => {
|
|
28
29
|
const initCommand = new InitCommand();
|
|
@@ -110,4 +111,12 @@ program
|
|
|
110
111
|
await command.execute();
|
|
111
112
|
});
|
|
112
113
|
|
|
114
|
+
program
|
|
115
|
+
.command('document-explainer')
|
|
116
|
+
.description('Generate Document Explainer workflow files')
|
|
117
|
+
.action(async () => {
|
|
118
|
+
const command = new DocumentExplainerCommand();
|
|
119
|
+
await command.execute();
|
|
120
|
+
});
|
|
121
|
+
|
|
113
122
|
program.parse();
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { PrompterConfig, PROMPTER_MARKERS } from '../core/config.js';
|
|
5
|
+
import { registry } from '../core/configurators/slash/index.js';
|
|
6
|
+
|
|
7
|
+
interface DocumentExplainerOptions {
|
|
8
|
+
tools?: string[];
|
|
9
|
+
noInteractive?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class DocumentExplainerCommand {
|
|
13
|
+
async execute(options: DocumentExplainerOptions = {}): Promise<void> {
|
|
14
|
+
const projectPath = process.cwd();
|
|
15
|
+
|
|
16
|
+
// Check if initialized
|
|
17
|
+
if (!await PrompterConfig.prompterDirExists(projectPath)) {
|
|
18
|
+
console.log(chalk.red('\n❌ Prompter is not initialized in this project.\n'));
|
|
19
|
+
console.log(chalk.gray(' Run `prompter init` first.\n'));
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
console.log(chalk.blue('\n📖 Generating document explainer workflow files...\n'));
|
|
25
|
+
|
|
26
|
+
// Detect currently configured tools
|
|
27
|
+
const configuredTools = await this.detectConfiguredTools(projectPath);
|
|
28
|
+
|
|
29
|
+
if (configuredTools.length === 0) {
|
|
30
|
+
console.log(chalk.yellow('⚠️ No tools configured yet.\n'));
|
|
31
|
+
console.log(chalk.gray(' Run `prompter init` to configure AI tools first.\n'));
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Generate document-explainer workflow files for all configured tools
|
|
37
|
+
let successCount = 0;
|
|
38
|
+
let failCount = 0;
|
|
39
|
+
|
|
40
|
+
for (const toolId of configuredTools) {
|
|
41
|
+
const configurator = registry.get(toolId);
|
|
42
|
+
if (configurator) {
|
|
43
|
+
try {
|
|
44
|
+
// Generate only the document-explainer workflow file
|
|
45
|
+
const body = configurator['getBody']('document-explainer');
|
|
46
|
+
const relativePath = configurator['getRelativePath']('document-explainer');
|
|
47
|
+
const filePath = path.join(projectPath, relativePath);
|
|
48
|
+
|
|
49
|
+
// Ensure directory exists
|
|
50
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
51
|
+
|
|
52
|
+
// Check if file exists
|
|
53
|
+
const fileExists = await this.fileExists(filePath);
|
|
54
|
+
|
|
55
|
+
if (fileExists) {
|
|
56
|
+
console.log(chalk.yellow('⚠️') + ` ${chalk.cyan(relativePath)} already exists, skipping`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Get frontmatter if needed
|
|
61
|
+
const frontmatter = configurator['getFrontmatter']('document-explainer');
|
|
62
|
+
const sections: string[] = [];
|
|
63
|
+
if (frontmatter) {
|
|
64
|
+
sections.push(frontmatter.trim());
|
|
65
|
+
}
|
|
66
|
+
sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
|
|
67
|
+
const content = sections.join('\n') + '\n';
|
|
68
|
+
|
|
69
|
+
await fs.writeFile(filePath, content, 'utf-8');
|
|
70
|
+
console.log(chalk.green('✓') + ` Created ${chalk.cyan(relativePath)}`);
|
|
71
|
+
successCount++;
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.log(chalk.red('✗') + ` Failed to create files for ${toolId}: ${error}`);
|
|
74
|
+
failCount++;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Success message
|
|
80
|
+
console.log(chalk.green(`\n✅ Document explainer workflow files created successfully!\n`));
|
|
81
|
+
console.log(chalk.blue('Next steps:'));
|
|
82
|
+
console.log(chalk.gray(' 1. Use /document-explainer in your AI tool to analyze complex documents'));
|
|
83
|
+
console.log(chalk.gray(' 2. Provide your document content to get a comprehensive breakdown and insights\n'));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private async fileExists(filePath: string): Promise<boolean> {
|
|
87
|
+
try {
|
|
88
|
+
await fs.access(filePath);
|
|
89
|
+
return true;
|
|
90
|
+
} catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private async detectConfiguredTools(projectPath: string): Promise<string[]> {
|
|
96
|
+
const configuredTools: string[] = [];
|
|
97
|
+
const allConfigurators = registry.getAll();
|
|
98
|
+
|
|
99
|
+
for (const configurator of allConfigurators) {
|
|
100
|
+
const targets = configurator.getTargets();
|
|
101
|
+
let hasFiles = false;
|
|
102
|
+
|
|
103
|
+
for (const target of targets) {
|
|
104
|
+
const filePath = path.join(projectPath, target.path);
|
|
105
|
+
if (await this.fileExists(filePath)) {
|
|
106
|
+
hasFiles = true;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (hasFiles) {
|
|
112
|
+
configuredTools.push(configurator.toolId);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return configuredTools;
|
|
117
|
+
}
|
|
118
|
+
}
|
package/src/core/config.ts
CHANGED
|
@@ -44,6 +44,12 @@ export const AVAILABLE_PROMPTS: PromptChoice[] = [
|
|
|
44
44
|
description: 'Generate OpenAPI specification from FSD and ERD',
|
|
45
45
|
sourceFile: 'api-contract-generator.md'
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Document Explainer',
|
|
49
|
+
value: 'document-explainer',
|
|
50
|
+
description: 'Analyze and explain complex documents into clear, actionable insights',
|
|
51
|
+
sourceFile: 'document-explainer.md'
|
|
52
|
+
},
|
|
47
53
|
{
|
|
48
54
|
name: 'Epic (Single)',
|
|
49
55
|
value: 'epic-single',
|
|
@@ -16,7 +16,8 @@ const FILE_PATHS: Record<SlashCommandId, string> = {
|
|
|
16
16
|
'fsd-generator': '.agent/workflows/fsd-generator.md',
|
|
17
17
|
'tdd-generator': '.agent/workflows/tdd-generator.md',
|
|
18
18
|
'tdd-lite-generator': '.agent/workflows/tdd-lite-generator.md',
|
|
19
|
-
'wireframe-generator': '.agent/workflows/wireframe-generator.md'
|
|
19
|
+
'wireframe-generator': '.agent/workflows/wireframe-generator.md',
|
|
20
|
+
'document-explainer': '.agent/workflows/document-explainer.md'
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
const DESCRIPTIONS: Record<SlashCommandId, string> = {
|
|
@@ -34,7 +35,8 @@ const DESCRIPTIONS: Record<SlashCommandId, string> = {
|
|
|
34
35
|
'fsd-generator': 'Generate Functional Specification Document from PRD',
|
|
35
36
|
'tdd-generator': 'Generate comprehensive Technical Design Document',
|
|
36
37
|
'tdd-lite-generator': 'Generate lean Technical Design Document (TDD-Lite)',
|
|
37
|
-
'wireframe-generator': 'Generate UI/UX wireframes from technical specs'
|
|
38
|
+
'wireframe-generator': 'Generate UI/UX wireframes from technical specs',
|
|
39
|
+
'document-explainer': 'Analyze and explain complex documents into clear, actionable insights'
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
export class AntigravityConfigurator extends SlashCommandConfigurator {
|
|
@@ -9,7 +9,7 @@ export interface SlashCommandTarget {
|
|
|
9
9
|
kind: 'slash';
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const ALL_COMMANDS: SlashCommandId[] = ['enhance', 'prd-generator', 'prd-agent-generator', 'product-brief', 'epic-single', 'story-single', 'qa-test-scenario', 'skill-creator', 'ai-humanizer', 'api-contract-generator', 'erd-generator', 'fsd-generator', 'tdd-generator', 'tdd-lite-generator', 'wireframe-generator'];
|
|
12
|
+
const ALL_COMMANDS: SlashCommandId[] = ['enhance', 'prd-generator', 'prd-agent-generator', 'product-brief', 'epic-single', 'story-single', 'qa-test-scenario', 'skill-creator', 'ai-humanizer', 'api-contract-generator', 'erd-generator', 'fsd-generator', 'tdd-generator', 'tdd-lite-generator', 'wireframe-generator', 'document-explainer'];
|
|
13
13
|
|
|
14
14
|
export abstract class SlashCommandConfigurator {
|
|
15
15
|
abstract readonly toolId: string;
|
|
@@ -22,7 +22,7 @@ export abstract class SlashCommandConfigurator {
|
|
|
22
22
|
const commandsToGenerate = filterIds === undefined
|
|
23
23
|
? ALL_COMMANDS
|
|
24
24
|
: ALL_COMMANDS.filter(id => filterIds.includes(id));
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
return commandsToGenerate.map((id) => ({
|
|
27
27
|
id,
|
|
28
28
|
path: this.getRelativePath(id),
|
|
@@ -16,7 +16,8 @@ const FILE_PATHS: Record<SlashCommandId, string> = {
|
|
|
16
16
|
'fsd-generator': '.claude/commands/prompter/fsd-generator.md',
|
|
17
17
|
'tdd-generator': '.claude/commands/prompter/tdd-generator.md',
|
|
18
18
|
'tdd-lite-generator': '.claude/commands/prompter/tdd-lite-generator.md',
|
|
19
|
-
'wireframe-generator': '.claude/commands/prompter/wireframe-generator.md'
|
|
19
|
+
'wireframe-generator': '.claude/commands/prompter/wireframe-generator.md',
|
|
20
|
+
'document-explainer': '.claude/commands/prompter/document-explainer.md'
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
const DESCRIPTIONS: Record<SlashCommandId, string> = {
|
|
@@ -34,7 +35,8 @@ const DESCRIPTIONS: Record<SlashCommandId, string> = {
|
|
|
34
35
|
'fsd-generator': 'Generate Functional Specification Document from PRD',
|
|
35
36
|
'tdd-generator': 'Generate comprehensive Technical Design Document',
|
|
36
37
|
'tdd-lite-generator': 'Generate lean Technical Design Document (TDD-Lite)',
|
|
37
|
-
'wireframe-generator': 'Generate UI/UX wireframes from technical specs'
|
|
38
|
+
'wireframe-generator': 'Generate UI/UX wireframes from technical specs',
|
|
39
|
+
'document-explainer': 'Analyze and explain complex documents into clear, actionable insights'
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
export class ClaudeConfigurator extends SlashCommandConfigurator {
|
|
@@ -16,7 +16,8 @@ const FILE_PATHS: Record<SlashCommandId, string> = {
|
|
|
16
16
|
'fsd-generator': '.codex/prompts/fsd-generator.md',
|
|
17
17
|
'tdd-generator': '.codex/prompts/tdd-generator.md',
|
|
18
18
|
'tdd-lite-generator': '.codex/prompts/tdd-lite-generator.md',
|
|
19
|
-
'wireframe-generator': '.codex/prompts/wireframe-generator.md'
|
|
19
|
+
'wireframe-generator': '.codex/prompts/wireframe-generator.md',
|
|
20
|
+
'document-explainer': '.codex/prompts/document-explainer.md'
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
const DESCRIPTIONS: Record<SlashCommandId, string> = {
|
|
@@ -34,7 +35,8 @@ const DESCRIPTIONS: Record<SlashCommandId, string> = {
|
|
|
34
35
|
'fsd-generator': 'Generate Functional Specification Document from PRD',
|
|
35
36
|
'tdd-generator': 'Generate comprehensive Technical Design Document',
|
|
36
37
|
'tdd-lite-generator': 'Generate lean Technical Design Document (TDD-Lite)',
|
|
37
|
-
'wireframe-generator': 'Generate UI/UX wireframes from technical specs'
|
|
38
|
+
'wireframe-generator': 'Generate UI/UX wireframes from technical specs',
|
|
39
|
+
'document-explainer': 'Analyze and explain complex documents into clear, actionable insights'
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
export class CodexConfigurator extends SlashCommandConfigurator {
|