@compilr-dev/sdk 0.7.7 → 0.7.9
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/platform/sqlite/document-repository.js +2 -0
- package/dist/platform/tools/document-tools.js +2 -0
- package/dist/platform/types.d.ts +2 -2
- package/dist/project-types/action-meta.js +11 -0
- package/dist/project-types/configs.d.ts +1 -0
- package/dist/project-types/configs.js +130 -43
- package/dist/project-types/index.d.ts +1 -1
- package/dist/project-types/index.js +3 -2
- package/dist/project-types/skill-meta.js +11 -0
- package/dist/skills/book-skills.d.ts +10 -0
- package/dist/skills/book-skills.js +195 -0
- package/dist/skills/business-skills.d.ts +11 -0
- package/dist/skills/business-skills.js +341 -0
- package/dist/skills/content-skills.d.ts +10 -0
- package/dist/skills/content-skills.js +184 -0
- package/dist/skills/course-skills.d.ts +9 -0
- package/dist/skills/course-skills.js +164 -0
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/platform-skills.d.ts +11 -35
- package/dist/skills/platform-skills.js +38 -1933
- package/dist/skills/research-skills.d.ts +10 -0
- package/dist/skills/research-skills.js +569 -0
- package/dist/skills/software-skills.d.ts +14 -0
- package/dist/skills/software-skills.js +838 -0
- package/package.json +1 -1
|
@@ -1,1942 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Platform Skills
|
|
2
|
+
* Platform Skills — Aggregate
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* but belong in the SDK since they reference platform tools.
|
|
7
|
-
*
|
|
8
|
-
* Skills: design, sketch, prd, refine, refine-item, architecture, session-notes, build, scaffold
|
|
4
|
+
* Re-exports all domain-specific skills and provides the combined platformSkills array.
|
|
5
|
+
* Individual skill files: software-skills.ts, research-skills.ts, business-skills.ts, content-skills.ts
|
|
9
6
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## PHASES
|
|
30
|
-
|
|
31
|
-
### Phase 1: Vision (3-5 questions)
|
|
32
|
-
Understand the big picture:
|
|
33
|
-
- What problem does this solve?
|
|
34
|
-
- Who is the target user/customer?
|
|
35
|
-
- What's the one-sentence pitch?
|
|
36
|
-
- What makes this different from alternatives?
|
|
37
|
-
|
|
38
|
-
After gathering answers, summarize the vision and confirm with user.
|
|
39
|
-
|
|
40
|
-
### Phase 2: Core Features (3-5 questions)
|
|
41
|
-
Define MVP scope:
|
|
42
|
-
- What are the 3-5 must-have features for v1?
|
|
43
|
-
- What explicitly can wait for v2?
|
|
44
|
-
- Are there any non-negotiable technical requirements?
|
|
45
|
-
|
|
46
|
-
Use the ask_user tool to present feature options when helpful.
|
|
47
|
-
|
|
48
|
-
### Phase 3: Technical Context (2-3 questions)
|
|
49
|
-
Understand constraints:
|
|
50
|
-
- Any existing systems to integrate with?
|
|
51
|
-
- Performance/scale requirements?
|
|
52
|
-
- Compliance/security requirements?
|
|
53
|
-
|
|
54
|
-
### Phase 4: Output
|
|
55
|
-
When you have enough information:
|
|
56
|
-
1. Summarize the design in a concise format
|
|
57
|
-
2. Check if project needs foundation:
|
|
58
|
-
- Use detect_project tool to check current state
|
|
59
|
-
- If no src/, package.json, or code files exist → this is a fresh project
|
|
60
|
-
3. Use backlog_write to create 5-15 items:
|
|
61
|
-
- **For fresh projects, ALWAYS add first:**
|
|
62
|
-
| CHORE-001 | chore | 📋 | critical | Project scaffolding | Create project structure, dependencies, and build config based on tech stack |
|
|
63
|
-
- Core features (type: feature, priority: high)
|
|
64
|
-
- Nice-to-haves (type: feature, priority: medium/low)
|
|
65
|
-
- Technical setup tasks (type: chore, priority: high)
|
|
66
|
-
- Known risks/unknowns (type: tech-debt, priority: medium)
|
|
67
|
-
4. Update the PRD.md file with gathered requirements:
|
|
68
|
-
- Use the edit tool to update PRD.md (located in .compilr/requirements/PRD.md or {project}-docs/00-requirements/PRD.md)
|
|
69
|
-
- Fill in: Problem Statement, Goals, User Stories, Functional Requirements
|
|
70
|
-
- Keep the existing structure, just replace placeholder text
|
|
71
|
-
5. Present the backlog and PRD summary to user for confirmation
|
|
72
|
-
- If CHORE-001 was added, mention: "Run /scaffold to create the project foundation"
|
|
73
|
-
6. If the project involves managing entities (CRUD operations on things like users, orders, products):
|
|
74
|
-
- Mention: "This looks like an entity-based app — /scaffold can auto-generate a full working MVP with CRUD pages, API, routing, and seed data."
|
|
75
|
-
- Do NOT build the Application Model during /design — /scaffold handles that
|
|
76
|
-
|
|
77
|
-
## RULES
|
|
78
|
-
- Ask questions in batches of 2-4 using ask_user tool when possible
|
|
79
|
-
- Always offer a "Type something custom" option
|
|
80
|
-
- Summarize after each phase before moving on
|
|
81
|
-
- If user says "skip" or "later", move to next phase
|
|
82
|
-
- Stop asking when you have enough for a meaningful backlog
|
|
83
|
-
- Total interaction should be 10-20 questions max
|
|
84
|
-
|
|
85
|
-
## COMPLETION CRITERIA
|
|
86
|
-
✓ Vision is clear and confirmed
|
|
87
|
-
✓ MVP features are defined
|
|
88
|
-
✓ Backlog has 5-15 items
|
|
89
|
-
✓ For fresh projects: CHORE-001 scaffolding item is first (critical priority)
|
|
90
|
-
✓ PRD.md is populated with requirements
|
|
91
|
-
✓ If entity-based: user informed about /scaffold auto-generation
|
|
92
|
-
✓ User has approved the backlog`,
|
|
93
|
-
tags: ['planning', 'requirements'],
|
|
94
|
-
});
|
|
95
|
-
export const refineSkill = defineSkill({
|
|
96
|
-
name: 'refine',
|
|
97
|
-
description: 'Iteratively refine and expand project requirements',
|
|
98
|
-
prompt: `You are in REFINE MODE. Your goal is to deepen and expand existing requirements based on user feedback.
|
|
99
|
-
|
|
100
|
-
## When to Use
|
|
101
|
-
- Backlog items are too vague
|
|
102
|
-
- Need to add acceptance criteria
|
|
103
|
-
- Reprioritizing existing items
|
|
104
|
-
- Adding missing items to backlog
|
|
105
|
-
|
|
106
|
-
## When NOT to Use
|
|
107
|
-
- No backlog exists yet → use design skill
|
|
108
|
-
- Quick outline needed → use sketch skill
|
|
109
|
-
- Refining single item → use refine-item skill
|
|
110
|
-
|
|
111
|
-
## STARTUP
|
|
112
|
-
|
|
113
|
-
1. Use todo_write to create a task list:
|
|
114
|
-
- "Get backlog overview"
|
|
115
|
-
- "Ask user what to refine"
|
|
116
|
-
- "Refine selected items"
|
|
117
|
-
- "Update backlog"
|
|
118
|
-
|
|
119
|
-
2. Use backlog_read with limit:10 to get overview (NOT all items!)
|
|
120
|
-
- Note the total count and what types/priorities exist
|
|
121
|
-
- If total > 10, mention there are more items available
|
|
122
|
-
|
|
123
|
-
3. Use ask_user_simple to ask what the user wants to focus on:
|
|
124
|
-
- Question: "What would you like to refine?"
|
|
125
|
-
- Options based on what you found (e.g., "High priority features", "Technical debt items", "A specific item by ID")
|
|
126
|
-
|
|
127
|
-
## REFINEMENT APPROACHES
|
|
128
|
-
|
|
129
|
-
### 1. Expand Existing Items
|
|
130
|
-
For items that are too vague:
|
|
131
|
-
- Break down into sub-tasks
|
|
132
|
-
- Add acceptance criteria
|
|
133
|
-
- Clarify scope boundaries
|
|
134
|
-
|
|
135
|
-
### 2. Add Missing Items
|
|
136
|
-
Identify gaps:
|
|
137
|
-
- Edge cases not covered
|
|
138
|
-
- Error handling scenarios
|
|
139
|
-
- Integration points
|
|
140
|
-
|
|
141
|
-
### 3. Reprioritize
|
|
142
|
-
Based on new understanding:
|
|
143
|
-
- Promote blockers, demote nice-to-haves
|
|
144
|
-
- Identify dependencies
|
|
145
|
-
|
|
146
|
-
### 4. Technical Deep-Dive
|
|
147
|
-
For complex features:
|
|
148
|
-
- Architecture decisions
|
|
149
|
-
- Technology choices
|
|
150
|
-
|
|
151
|
-
## TOOLS TO USE
|
|
152
|
-
|
|
153
|
-
- **ask_user_simple**: For single-choice questions (preferred for most interactions)
|
|
154
|
-
- **ask_user**: For multi-question batches (when gathering related info)
|
|
155
|
-
- **backlog_read**: Use id param to get specific item, use search/filters otherwise
|
|
156
|
-
- **backlog_write**: Update items after refinement decisions
|
|
157
|
-
- **todo_write**: Track your progress through refinement
|
|
158
|
-
|
|
159
|
-
## RULES
|
|
160
|
-
|
|
161
|
-
1. ALWAYS use ask_user_simple or ask_user for decisions - NEVER ask questions in plain text
|
|
162
|
-
2. Keep backlog reads efficient - use filters and limits
|
|
163
|
-
3. One refinement focus at a time
|
|
164
|
-
4. Update backlog with backlog_write after each decision
|
|
165
|
-
5. Summarize changes at the end
|
|
166
|
-
|
|
167
|
-
## COMPLETION CRITERIA
|
|
168
|
-
✓ User's refinement goals are addressed
|
|
169
|
-
✓ Backlog is updated with changes
|
|
170
|
-
✓ No open questions remain`,
|
|
171
|
-
tags: ['planning', 'requirements'],
|
|
172
|
-
});
|
|
173
|
-
export const sketchSkill = defineSkill({
|
|
174
|
-
name: 'sketch',
|
|
175
|
-
description: 'Quick project outline with simple questions',
|
|
176
|
-
prompt: `You are in SKETCH MODE. Ask 6 quick questions, then create backlog items.
|
|
177
|
-
|
|
178
|
-
## When to Use
|
|
179
|
-
- Quick project kickoff
|
|
180
|
-
- User wants fast outline without deep dive
|
|
181
|
-
- Initial brainstorming session
|
|
182
|
-
|
|
183
|
-
## When NOT to Use
|
|
184
|
-
- Detailed requirements needed → use design skill
|
|
185
|
-
- Project already has backlog → use refine skill
|
|
186
|
-
- Single item focus → use refine-item skill
|
|
187
|
-
|
|
188
|
-
STEPS:
|
|
189
|
-
1. Use todo_write with 6 tasks (one per question)
|
|
190
|
-
2. Ask each question using ask_user_simple tool
|
|
191
|
-
3. After each answer, mark that todo complete
|
|
192
|
-
4. After all questions, check if this is a fresh project:
|
|
193
|
-
- Use detect_project to check if src/, package.json, or code files exist
|
|
194
|
-
- If fresh project → add CHORE-001 scaffolding item first (critical priority)
|
|
195
|
-
5. Use backlog_write to create 3-8 items
|
|
196
|
-
6. Summarize and suggest /design for more detail (or /build to start scaffolding)
|
|
197
|
-
|
|
198
|
-
QUESTIONS (ask one at a time):
|
|
199
|
-
1. App type? Options: Web app, Mobile app, CLI tool, API service
|
|
200
|
-
2. Target users? Options: Developers, Business users, Consumers, Internal team
|
|
201
|
-
3. Main problem it solves? (free text, no options)
|
|
202
|
-
4. Must-have features? (free text, no options)
|
|
203
|
-
5. Tech needs? Options: Database, Authentication, External APIs, None
|
|
204
|
-
6. Timeline? Options: Quick prototype, MVP in weeks, Full product
|
|
205
|
-
|
|
206
|
-
RULES:
|
|
207
|
-
- One ask_user_simple call per question
|
|
208
|
-
- Keep it simple and fast
|
|
209
|
-
- For fresh projects, ALWAYS add CHORE-001 scaffolding as first item`,
|
|
210
|
-
tags: ['planning', 'requirements'],
|
|
211
|
-
});
|
|
212
|
-
export const refineItemSkill = defineSkill({
|
|
213
|
-
name: 'refine-item',
|
|
214
|
-
description: 'Focused refinement of a specific backlog item',
|
|
215
|
-
prompt: `You are in FOCUSED REFINE MODE. Your goal is to refine a specific backlog item.
|
|
216
|
-
|
|
217
|
-
## When to Use
|
|
218
|
-
- User wants to work on a specific backlog item
|
|
219
|
-
- Item needs more detail or breakdown
|
|
220
|
-
- Changing priority of specific item
|
|
221
|
-
|
|
222
|
-
## When NOT to Use
|
|
223
|
-
- Multiple items need refinement → use refine skill
|
|
224
|
-
- No items exist yet → use design or sketch skill
|
|
225
|
-
- Ready to implement → use build skill
|
|
226
|
-
|
|
227
|
-
## STARTUP
|
|
228
|
-
|
|
229
|
-
1. Use backlog_read with id parameter to get the specific item
|
|
230
|
-
2. Use todo_write to track progress:
|
|
231
|
-
- "Review current item"
|
|
232
|
-
- "Gather refinement details"
|
|
233
|
-
- "Update backlog"
|
|
234
|
-
|
|
235
|
-
3. Present the item and ask what to refine using ask_user_simple:
|
|
236
|
-
- Question: "How would you like to refine this item?"
|
|
237
|
-
- Options: "Break into subtasks", "Add details/criteria", "Change priority", "Technical deep-dive"
|
|
238
|
-
|
|
239
|
-
## REFINEMENT FLOW
|
|
240
|
-
|
|
241
|
-
Based on user's choice:
|
|
242
|
-
|
|
243
|
-
### Break into subtasks
|
|
244
|
-
- Use ask_user_simple to ask how many subtasks (2-5)
|
|
245
|
-
- For each subtask, use ask_user_simple to get title
|
|
246
|
-
- Use backlog_write to add new items
|
|
247
|
-
- Optionally update original item status
|
|
248
|
-
|
|
249
|
-
### Add details/criteria
|
|
250
|
-
- Use ask_user to gather:
|
|
251
|
-
- Acceptance criteria
|
|
252
|
-
- Edge cases
|
|
253
|
-
- Dependencies
|
|
254
|
-
- Use backlog_write to update description
|
|
255
|
-
|
|
256
|
-
### Change priority
|
|
257
|
-
- Use ask_user_simple with priority options
|
|
258
|
-
- Use backlog_write to update
|
|
259
|
-
|
|
260
|
-
### Technical deep-dive
|
|
261
|
-
- Use ask_user to gather:
|
|
262
|
-
- Architecture approach
|
|
263
|
-
- Technology choices
|
|
264
|
-
- Risks/concerns
|
|
265
|
-
- Add as new tech-debt item or update description
|
|
266
|
-
|
|
267
|
-
## RULES
|
|
268
|
-
|
|
269
|
-
1. ALWAYS use ask_user_simple for single choices
|
|
270
|
-
2. Use ask_user for multi-field input
|
|
271
|
-
3. Update backlog after each decision
|
|
272
|
-
4. Summarize what was changed at the end
|
|
273
|
-
|
|
274
|
-
## COMPLETION
|
|
275
|
-
✓ Item is refined per user's request
|
|
276
|
-
✓ Backlog is updated
|
|
277
|
-
✓ Changes are summarized`,
|
|
278
|
-
tags: ['planning', 'requirements'],
|
|
279
|
-
});
|
|
280
|
-
export const architectureSkill = defineSkill({
|
|
281
|
-
name: 'architecture',
|
|
282
|
-
description: 'Create architecture documentation (ADRs, diagrams, data models, API designs)',
|
|
283
|
-
prompt: `You are in ARCHITECTURE MODE. Your goal is to create architecture documentation.
|
|
284
|
-
|
|
285
|
-
## When to Use
|
|
286
|
-
- Creating ADRs (Architecture Decision Records)
|
|
287
|
-
- Documenting system diagrams
|
|
288
|
-
- Designing data models or API specs
|
|
289
|
-
- Recording technical decisions
|
|
290
|
-
|
|
291
|
-
## When NOT to Use
|
|
292
|
-
- Need product requirements → use design or prd skill
|
|
293
|
-
- Need to implement features → use build skill
|
|
294
|
-
- Just want to understand existing code → use explain skill
|
|
295
|
-
|
|
296
|
-
## DOCUMENT TYPE: {{doc_type}}
|
|
297
|
-
{{#if custom_topic}}Custom Topic: {{custom_topic}}{{/if}}
|
|
298
|
-
|
|
299
|
-
## STARTUP
|
|
300
|
-
|
|
301
|
-
1. Use todo_write to track your progress:
|
|
302
|
-
- "Read project context"
|
|
303
|
-
- "Gather requirements"
|
|
304
|
-
- "Create document"
|
|
305
|
-
- "Confirm with user"
|
|
306
|
-
|
|
307
|
-
2. Read project context:
|
|
308
|
-
- Check for PRD.md (project vision and requirements)
|
|
309
|
-
- Use backlog_read with limit:10 for feature overview
|
|
310
|
-
- Check existing architecture docs to avoid duplicates
|
|
311
|
-
|
|
312
|
-
## DOCUMENT TEMPLATES
|
|
313
|
-
|
|
314
|
-
### For ADR (Architecture Decision Record)
|
|
315
|
-
Location: .compilr/architecture/decisions/ADR-NNN-{{slug}}.md or {project}-docs/02-architecture/decisions/ADR-NNN-{{slug}}.md
|
|
316
|
-
|
|
317
|
-
Use ask_user to gather:
|
|
318
|
-
1. What decision is being documented?
|
|
319
|
-
2. What problem or need prompted this decision?
|
|
320
|
-
3. What alternatives were considered?
|
|
321
|
-
4. What are the trade-offs of the chosen approach?
|
|
322
|
-
|
|
323
|
-
Template:
|
|
324
|
-
\`\`\`markdown
|
|
325
|
-
# ADR-NNN: {{title}}
|
|
326
|
-
|
|
327
|
-
**Status:** Proposed | Accepted | Deprecated | Superseded
|
|
328
|
-
**Date:** {{YYYY-MM-DD}}
|
|
329
|
-
**Deciders:** {{who made this decision}}
|
|
330
|
-
|
|
331
|
-
---
|
|
332
|
-
|
|
333
|
-
## Context
|
|
334
|
-
|
|
335
|
-
{{What is the issue that we're seeing that is motivating this decision?}}
|
|
336
|
-
|
|
337
|
-
## Decision
|
|
338
|
-
|
|
339
|
-
{{What is the change that we're proposing and/or doing?}}
|
|
340
|
-
|
|
341
|
-
## Consequences
|
|
342
|
-
|
|
343
|
-
### Positive
|
|
344
|
-
- {{benefit 1}}
|
|
345
|
-
- {{benefit 2}}
|
|
346
|
-
|
|
347
|
-
### Negative
|
|
348
|
-
- {{trade-off 1}}
|
|
349
|
-
- {{trade-off 2}}
|
|
350
|
-
|
|
351
|
-
### Risks
|
|
352
|
-
- {{risk 1}}
|
|
353
|
-
|
|
354
|
-
---
|
|
355
|
-
|
|
356
|
-
## Alternatives Considered
|
|
357
|
-
|
|
358
|
-
### {{Alternative 1}}
|
|
359
|
-
{{description}}
|
|
360
|
-
**Rejected because:** {{reason}}
|
|
361
|
-
|
|
362
|
-
---
|
|
363
|
-
|
|
364
|
-
*Generated by /arch*
|
|
365
|
-
\`\`\`
|
|
366
|
-
|
|
367
|
-
### For System Diagram
|
|
368
|
-
Location: .compilr/architecture/diagrams/{{slug}}.md or {project}-docs/02-architecture/diagrams/{{slug}}.md
|
|
369
|
-
|
|
370
|
-
Use ask_user to gather:
|
|
371
|
-
1. What are the main components/services?
|
|
372
|
-
2. How do they communicate?
|
|
373
|
-
3. What external integrations exist?
|
|
374
|
-
4. What data flows between components?
|
|
375
|
-
|
|
376
|
-
Generate a Mermaid diagram with explanation.
|
|
377
|
-
|
|
378
|
-
### For Data Model
|
|
379
|
-
Location: .compilr/architecture/data-model.md or {project}-docs/02-architecture/data-model.md
|
|
380
|
-
|
|
381
|
-
Use ask_user to gather:
|
|
382
|
-
1. What are the main entities?
|
|
383
|
-
2. What are the relationships between them?
|
|
384
|
-
3. What are the key fields and constraints?
|
|
385
|
-
|
|
386
|
-
Generate entity descriptions and a Mermaid ER diagram.
|
|
387
|
-
|
|
388
|
-
### For API Design
|
|
389
|
-
Location: .compilr/architecture/api-design.md or {project}-docs/02-architecture/api-design.md
|
|
390
|
-
|
|
391
|
-
Use ask_user to gather:
|
|
392
|
-
1. What resources/endpoints are needed?
|
|
393
|
-
2. What authentication approach?
|
|
394
|
-
3. What are the main request/response formats?
|
|
395
|
-
|
|
396
|
-
Generate OpenAPI-style documentation.
|
|
397
|
-
|
|
398
|
-
### For Custom Topic
|
|
399
|
-
Location: .compilr/architecture/{{slug}}.md or {project}-docs/02-architecture/{{slug}}.md
|
|
400
|
-
|
|
401
|
-
Use ask_user to understand:
|
|
402
|
-
1. What aspect of architecture to document?
|
|
403
|
-
2. What level of detail is needed?
|
|
404
|
-
3. Who is the audience?
|
|
405
|
-
|
|
406
|
-
Generate appropriate documentation.
|
|
407
|
-
|
|
408
|
-
## RULES
|
|
409
|
-
|
|
410
|
-
1. Use ask_user or ask_user_simple for structured input
|
|
411
|
-
2. Read existing docs first to avoid duplicates
|
|
412
|
-
3. For ADRs, auto-number based on existing ADRs in the directory
|
|
413
|
-
4. Create directories if they don't exist
|
|
414
|
-
5. Follow the appropriate template for the document type
|
|
415
|
-
6. Include Mermaid diagrams where helpful
|
|
416
|
-
7. Summarize what was created at the end
|
|
417
|
-
|
|
418
|
-
## COMPLETION CRITERIA
|
|
419
|
-
✓ Document is created in correct location
|
|
420
|
-
✓ All sections are properly filled in
|
|
421
|
-
✓ Diagrams render correctly (valid Mermaid syntax)
|
|
422
|
-
✓ User has reviewed the output`,
|
|
423
|
-
tags: ['architecture', 'documentation'],
|
|
424
|
-
});
|
|
425
|
-
export const prdSkill = defineSkill({
|
|
426
|
-
name: 'prd',
|
|
427
|
-
description: 'Amend or enhance the Product Requirements Document',
|
|
428
|
-
prompt: `You are in PRD MODE. Your goal is to update or enhance the existing Product Requirements Document.
|
|
429
|
-
|
|
430
|
-
## When to Use
|
|
431
|
-
- Updating existing PRD sections
|
|
432
|
-
- Adding new requirements to PRD
|
|
433
|
-
- Refining vision or scope
|
|
434
|
-
|
|
435
|
-
## When NOT to Use
|
|
436
|
-
- No PRD exists yet → use design skill first
|
|
437
|
-
- Need architecture docs → use architecture skill
|
|
438
|
-
- Need session summary → use session-notes skill
|
|
439
|
-
|
|
440
|
-
## STARTUP
|
|
441
|
-
|
|
442
|
-
1. Use todo_write to track your progress:
|
|
443
|
-
- "Read current PRD"
|
|
444
|
-
- "Identify section to update"
|
|
445
|
-
- "Gather updates"
|
|
446
|
-
- "Write updated PRD"
|
|
447
|
-
|
|
448
|
-
2. Read the existing PRD.md:
|
|
449
|
-
- Location: .compilr/requirements/PRD.md or {project}-docs/00-requirements/PRD.md
|
|
450
|
-
- If no PRD exists, inform the user to run /design first
|
|
451
|
-
|
|
452
|
-
3. Present current PRD sections to user using ask_user_simple:
|
|
453
|
-
- Question: "Which section would you like to update?"
|
|
454
|
-
- Options based on PRD structure (Vision, Scope, Technical, Success Criteria)
|
|
455
|
-
|
|
456
|
-
## PRD STRUCTURE
|
|
457
|
-
|
|
458
|
-
The PRD has these sections that can be updated:
|
|
459
|
-
|
|
460
|
-
### 1. Vision
|
|
461
|
-
- Problem Statement
|
|
462
|
-
- Target Users
|
|
463
|
-
- Value Proposition
|
|
464
|
-
- Differentiation
|
|
465
|
-
|
|
466
|
-
### 2. Scope
|
|
467
|
-
- MVP Features (v1)
|
|
468
|
-
- Future Features (v2+)
|
|
469
|
-
- Out of Scope
|
|
470
|
-
|
|
471
|
-
### 3. Technical Context
|
|
472
|
-
- Integrations
|
|
473
|
-
- Constraints (Performance, Scale, Compliance)
|
|
474
|
-
- Tech Stack
|
|
475
|
-
|
|
476
|
-
### 4. Success Criteria
|
|
477
|
-
- How do we know when this is done?
|
|
478
|
-
|
|
479
|
-
## UPDATE FLOW
|
|
480
|
-
|
|
481
|
-
Based on section selected:
|
|
482
|
-
|
|
483
|
-
1. Show current content of that section
|
|
484
|
-
2. Use ask_user to gather:
|
|
485
|
-
- What to add/change
|
|
486
|
-
- What to remove
|
|
487
|
-
- Any clarifications
|
|
488
|
-
3. Use the edit tool to update PRD.md
|
|
489
|
-
4. Show the updated section for confirmation
|
|
490
|
-
|
|
491
|
-
## RULES
|
|
492
|
-
|
|
493
|
-
1. ALWAYS read the existing PRD first
|
|
494
|
-
2. Use ask_user_simple for section selection
|
|
495
|
-
3. Use ask_user for gathering detailed updates
|
|
496
|
-
4. Preserve sections you're not updating
|
|
497
|
-
5. Use edit tool (not write_file) to update specific sections
|
|
498
|
-
6. Keep formatting consistent with existing document
|
|
499
|
-
7. If scope changes affect backlog, suggest running /refine
|
|
500
|
-
|
|
501
|
-
## COMPLETION CRITERIA
|
|
502
|
-
✓ PRD.md is updated with changes
|
|
503
|
-
✓ User has reviewed the updates
|
|
504
|
-
✓ Related backlog updates are suggested if needed`,
|
|
505
|
-
tags: ['planning', 'requirements'],
|
|
506
|
-
});
|
|
507
|
-
export const sessionNotesSkill = defineSkill({
|
|
508
|
-
name: 'session-notes',
|
|
509
|
-
description: 'Create structured session notes capturing work done and decisions made',
|
|
510
|
-
prompt: `You are in SESSION NOTES MODE. Your goal is to create a structured summary of the current session.
|
|
511
|
-
|
|
512
|
-
## When to Use
|
|
513
|
-
- End of a work session
|
|
514
|
-
- User asks to document what was done
|
|
515
|
-
- Need to capture decisions for future reference
|
|
516
|
-
|
|
517
|
-
## When NOT to Use
|
|
518
|
-
- Need product requirements → use prd skill
|
|
519
|
-
- Need architecture docs → use architecture skill
|
|
520
|
-
- In the middle of active work
|
|
521
|
-
|
|
522
|
-
## STARTUP
|
|
523
|
-
|
|
524
|
-
1. Use todo_write to track your progress:
|
|
525
|
-
- "Gather session context"
|
|
526
|
-
- "Write session note"
|
|
527
|
-
- "Confirm with user"
|
|
528
|
-
|
|
529
|
-
2. Review recent conversation to understand:
|
|
530
|
-
- What was accomplished
|
|
531
|
-
- What files were changed
|
|
532
|
-
- What decisions were made
|
|
533
|
-
- What blockers were encountered
|
|
534
|
-
- What should be done next
|
|
535
|
-
|
|
536
|
-
## SESSION NOTE STRUCTURE
|
|
537
|
-
|
|
538
|
-
Create a markdown file with this structure:
|
|
539
|
-
|
|
540
|
-
\`\`\`markdown
|
|
541
|
-
# Session Note - {{title}}
|
|
542
|
-
|
|
543
|
-
**Date:** {{YYYY-MM-DD}}
|
|
544
|
-
**Project:** {{project_name}}
|
|
545
|
-
|
|
546
|
-
---
|
|
547
|
-
|
|
548
|
-
## Summary
|
|
549
|
-
|
|
550
|
-
{{2-3 sentence summary of what was accomplished}}
|
|
551
|
-
|
|
552
|
-
## Changes Made
|
|
553
|
-
|
|
554
|
-
- {{list of files created/modified}}
|
|
555
|
-
- {{features implemented}}
|
|
556
|
-
- {{bugs fixed}}
|
|
557
|
-
|
|
558
|
-
## Decisions Made
|
|
559
|
-
|
|
560
|
-
- {{architectural decisions}}
|
|
561
|
-
- {{technology choices}}
|
|
562
|
-
- {{scope changes}}
|
|
563
|
-
|
|
564
|
-
## Blockers / Issues
|
|
565
|
-
|
|
566
|
-
- {{problems encountered}}
|
|
567
|
-
- {{unresolved questions}}
|
|
568
|
-
|
|
569
|
-
## Next Steps
|
|
570
|
-
|
|
571
|
-
- [ ] {{actionable next task}}
|
|
572
|
-
- [ ] {{follow-up item}}
|
|
573
|
-
|
|
574
|
-
---
|
|
575
|
-
|
|
576
|
-
*Generated by /note*
|
|
577
|
-
\`\`\`
|
|
578
|
-
|
|
579
|
-
## FILE LOCATION
|
|
580
|
-
|
|
581
|
-
Save the note to:
|
|
582
|
-
- Single repo: \`.compilr/sessions/{{YYYY-MM-DD}}-{{slug}}.md\`
|
|
583
|
-
- Two repo: \`{{project}}-docs/04-session-notes/{{YYYY-MM-DD}}-{{slug}}.md\`
|
|
584
|
-
|
|
585
|
-
Create the directory if it doesn't exist.
|
|
586
|
-
|
|
587
|
-
## RULES
|
|
588
|
-
|
|
589
|
-
1. Use ask_user_simple to ask for a title if not provided
|
|
590
|
-
2. Keep summary concise (2-3 sentences max)
|
|
591
|
-
3. List concrete changes, not vague descriptions
|
|
592
|
-
4. Decisions should explain the "why"
|
|
593
|
-
5. Next steps should be actionable
|
|
594
|
-
6. If user provides a title, use it; otherwise generate one from the summary
|
|
595
|
-
|
|
596
|
-
## COMPLETION CRITERIA
|
|
597
|
-
✓ Session note file is created
|
|
598
|
-
✓ All sections are filled in
|
|
599
|
-
✓ User has reviewed the note`,
|
|
600
|
-
tags: ['documentation', 'session'],
|
|
601
|
-
});
|
|
602
|
-
// =============================================================================
|
|
603
|
-
// From @compilr-dev/agents-coding-core (2 skills)
|
|
604
|
-
// =============================================================================
|
|
605
|
-
export const buildSkill = defineSkill({
|
|
606
|
-
name: 'build',
|
|
607
|
-
description: 'Implement a backlog item end-to-end',
|
|
608
|
-
tags: ['implementation', 'coding'],
|
|
609
|
-
prompt: `You are in BUILD MODE. Implement the specified backlog item.
|
|
610
|
-
|
|
611
|
-
## When to Use
|
|
612
|
-
- Implementing a specific backlog item
|
|
613
|
-
- User says "build FEAT-001" or similar
|
|
614
|
-
- Ready to write code for a feature
|
|
615
|
-
|
|
616
|
-
## When NOT to Use
|
|
617
|
-
- Item is too vague → use refine-item skill first
|
|
618
|
-
- No backlog exists → use design or sketch skill
|
|
619
|
-
- Just exploring code → use code-navigation skill
|
|
620
|
-
- Need to fix a bug → use debug skill
|
|
621
|
-
|
|
622
|
-
## CRITICAL: PROJECT DIRECTORY
|
|
623
|
-
|
|
624
|
-
**All files MUST be created/modified in: {{projectPath}}**
|
|
625
|
-
|
|
626
|
-
Use ABSOLUTE paths for ALL file operations. Example:
|
|
627
|
-
- write_file({ path: "{{projectPath}}/src/feature.ts", ... })
|
|
628
|
-
- edit({ path: "{{projectPath}}/src/index.ts", ... })
|
|
629
|
-
|
|
630
|
-
NEVER use relative paths. NEVER use process.cwd().
|
|
631
|
-
|
|
632
|
-
## ITEM TO IMPLEMENT
|
|
633
|
-
- **ID:** {{item_id}}
|
|
634
|
-
- **Title:** {{item_title}}
|
|
635
|
-
- **Type:** {{item_type}}
|
|
636
|
-
- **Priority:** {{item_priority}}
|
|
637
|
-
- **Description:** {{item_description}}
|
|
638
|
-
|
|
639
|
-
## BEFORE STARTING
|
|
640
|
-
|
|
641
|
-
1. Show the item details to the user in a clear format
|
|
642
|
-
2. Use ask_user_simple to confirm: "Proceed with implementation?"
|
|
643
|
-
- Options: "Yes, let's build it", "No, pick a different item", "Cancel"
|
|
644
|
-
3. If there are dependency warnings, mention them and ask if user wants to proceed anyway
|
|
645
|
-
|
|
646
|
-
## CONTEXT TO READ
|
|
647
|
-
|
|
648
|
-
Before implementing, read these files for context:
|
|
649
|
-
- **PRD.md** (if exists): Project vision and requirements
|
|
650
|
-
- **CLAUDE.md**: Coding standards and conventions
|
|
651
|
-
- **Existing code**: Understand patterns already in use
|
|
652
|
-
|
|
653
|
-
## IMPLEMENTATION WORKFLOW
|
|
654
|
-
|
|
655
|
-
### Phase 1: Plan
|
|
656
|
-
1. Use todo_write to create implementation checklist:
|
|
657
|
-
- Break down the item into concrete tasks
|
|
658
|
-
- Identify files to create or modify
|
|
659
|
-
- Note any edge cases to handle
|
|
660
|
-
2. Update backlog status to 🚧 using backlog_write
|
|
661
|
-
|
|
662
|
-
### Phase 2: Implement
|
|
663
|
-
1. Write code following project conventions from CLAUDE.md
|
|
664
|
-
2. Add tests if the project has a test framework
|
|
665
|
-
3. Keep changes focused on the backlog item scope
|
|
666
|
-
4. Use todo_write to track progress through tasks
|
|
667
|
-
|
|
668
|
-
### Phase 3: Verify
|
|
669
|
-
1. Run tests with run_tests tool
|
|
670
|
-
2. Run lint with run_lint tool
|
|
671
|
-
3. If tests or lint fail:
|
|
672
|
-
- Analyze the error message
|
|
673
|
-
- Fix the issue
|
|
674
|
-
- Re-run verification
|
|
675
|
-
- Repeat up to 3 times
|
|
676
|
-
4. If still failing after 3 attempts:
|
|
677
|
-
- Report the issue to user
|
|
678
|
-
- Keep status as 🚧
|
|
679
|
-
- Ask for guidance
|
|
680
|
-
|
|
681
|
-
### Phase 4: Complete
|
|
682
|
-
1. Update backlog status to ✅ using backlog_write
|
|
683
|
-
2. Create git commit with message format:
|
|
684
|
-
- feat({{item_id}}): {{item_title}} - for features
|
|
685
|
-
- fix({{item_id}}): {{item_title}} - for bugs
|
|
686
|
-
- chore({{item_id}}): {{item_title}} - for chores
|
|
687
|
-
3. Update backlog with the commit SHA
|
|
688
|
-
4. Clear todos with todo_write
|
|
689
|
-
5. Summarize what was implemented
|
|
690
|
-
|
|
691
|
-
## RULES
|
|
692
|
-
|
|
693
|
-
- Follow coding standards from CLAUDE.md strictly
|
|
694
|
-
- Keep commits atomic - one backlog item per commit
|
|
695
|
-
- Ask user via ask_user_simple if you hit blockers
|
|
696
|
-
- Don't over-engineer - implement exactly what the item describes
|
|
697
|
-
- Don't add features beyond what was requested
|
|
698
|
-
- Use todo_write throughout to show progress
|
|
699
|
-
- Always run tests before marking complete`,
|
|
700
|
-
version: '1.0.0',
|
|
701
|
-
});
|
|
702
|
-
export const scaffoldSkill = defineSkill({
|
|
703
|
-
name: 'scaffold',
|
|
704
|
-
description: 'Create project foundation based on tech stack',
|
|
705
|
-
tags: ['setup', 'foundation', 'scaffolding'],
|
|
706
|
-
prompt: `You are creating the PROJECT SCAFFOLD (foundation).
|
|
707
|
-
|
|
708
|
-
## When to Use
|
|
709
|
-
- Starting a new project from scratch
|
|
710
|
-
- CHORE-001 scaffolding item in backlog
|
|
711
|
-
- Need basic project structure
|
|
712
|
-
|
|
713
|
-
## When NOT to Use
|
|
714
|
-
- Project already has structure → use build skill
|
|
715
|
-
- Need requirements first → use design skill
|
|
716
|
-
- Modifying existing project → use appropriate skill
|
|
717
|
-
|
|
718
|
-
## FACTORY CHECK (TRY THIS FIRST)
|
|
719
|
-
|
|
720
|
-
Before manual scaffolding, check if the factory can auto-generate the project:
|
|
721
|
-
|
|
722
|
-
1. Call \`app_model_get\` with \`{ "scope": "summary" }\` to check for an existing Application Model.
|
|
723
|
-
- If model exists with entities → use factory path: preview with \`factory_scaffold({ "dry_run": true })\`, confirm with user, then generate with \`factory_scaffold({ "output_dir": "{{projectPath}}" })\`.
|
|
724
|
-
- Skip the manual scaffold below entirely.
|
|
725
|
-
|
|
726
|
-
2. If NO model exists, check project documents for entity patterns:
|
|
727
|
-
- Read PRD with \`project_document_get({ "doc_type": "prd" })\`
|
|
728
|
-
- If PRD mentions managing/tracking things (entities, CRUD, data types) → ask user:
|
|
729
|
-
"Your project involves managing [entities]. I can auto-generate a working app. Want me to use the factory? (Yes = build model + generate / No = manual scaffold)"
|
|
730
|
-
- If Yes → call \`factory_list_toolkits\` to show options, then build the model with \`app_model_update\` operations (set identity, techStack, add entities with fields, add relationships, set features/theme/layout), validate with \`app_model_validate\`, generate with \`factory_scaffold({ "output_dir": "{{projectPath}}" })\`.
|
|
731
|
-
|
|
732
|
-
3. If no entities detected or user declines factory → proceed with MANUAL SCAFFOLD below.
|
|
733
|
-
|
|
734
|
-
---
|
|
735
|
-
|
|
736
|
-
## MANUAL SCAFFOLD (if factory not applicable)
|
|
737
|
-
|
|
738
|
-
## CRITICAL: PROJECT DIRECTORY
|
|
739
|
-
|
|
740
|
-
**All files MUST be created in: {{projectPath}}**
|
|
741
|
-
|
|
742
|
-
Use ABSOLUTE paths for ALL file operations. Example:
|
|
743
|
-
- write_file({ path: "{{projectPath}}/package.json", ... })
|
|
744
|
-
- write_file({ path: "{{projectPath}}/src/index.ts", ... })
|
|
745
|
-
|
|
746
|
-
NEVER use relative paths. NEVER use process.cwd().
|
|
747
|
-
|
|
748
|
-
## PURPOSE
|
|
749
|
-
|
|
750
|
-
Create the base project structure that features will be built on top of.
|
|
751
|
-
This is the skeleton that makes feature implementation possible.
|
|
752
|
-
|
|
753
|
-
## CONTEXT TO READ
|
|
754
|
-
|
|
755
|
-
Use project_document_get to read project documents from the database:
|
|
756
|
-
- PRD document for project vision and requirements
|
|
757
|
-
- Architecture documents if they exist
|
|
758
|
-
|
|
759
|
-
## BEFORE STARTING
|
|
760
|
-
|
|
761
|
-
1. Summarize the detected/specified tech stack
|
|
762
|
-
2. Use ask_user_simple to confirm: "Create project scaffold with this stack?"
|
|
763
|
-
- Options: "Yes, create it", "No, let me specify", "Cancel"
|
|
764
|
-
3. If user wants to specify, ask about tech stack preferences
|
|
765
|
-
|
|
766
|
-
## SCAFFOLD BY PROJECT TYPE
|
|
767
|
-
|
|
768
|
-
### Web Application (React/Vue/Svelte)
|
|
769
|
-
|
|
770
|
-
Create:
|
|
771
|
-
- \`src/\` folder structure:
|
|
772
|
-
- \`src/components/\` - Reusable components
|
|
773
|
-
- \`src/pages/\` or \`src/routes/\` - Page components
|
|
774
|
-
- \`src/lib/\` or \`src/utils/\` - Utility functions
|
|
775
|
-
- \`src/styles/\` - Global styles
|
|
776
|
-
- \`package.json\` with dependencies
|
|
777
|
-
- Build config (\`vite.config.ts\`, \`next.config.js\`, etc.)
|
|
778
|
-
- \`index.html\` entry point (if applicable)
|
|
779
|
-
- Basic App component with routing setup
|
|
780
|
-
- CSS/Tailwind configuration
|
|
781
|
-
- \`.gitignore\`
|
|
782
|
-
- \`README.md\` with setup instructions
|
|
783
|
-
|
|
784
|
-
### API / Backend (Node/Python/Go)
|
|
785
|
-
|
|
786
|
-
Create:
|
|
787
|
-
- \`src/\` folder structure:
|
|
788
|
-
- \`src/routes/\` or \`src/api/\` - API endpoints
|
|
789
|
-
- \`src/services/\` - Business logic
|
|
790
|
-
- \`src/models/\` - Data models
|
|
791
|
-
- \`src/utils/\` - Utilities
|
|
792
|
-
- \`package.json\` / \`requirements.txt\` / \`go.mod\`
|
|
793
|
-
- Entry point (\`src/index.ts\`, \`main.py\`, \`main.go\`)
|
|
794
|
-
- Basic server setup (Express, FastAPI, Gin, etc.)
|
|
795
|
-
- Health check endpoint (\`GET /health\`)
|
|
796
|
-
- Environment config (\`.env.example\`)
|
|
797
|
-
- \`.gitignore\`
|
|
798
|
-
- \`README.md\` with setup instructions
|
|
799
|
-
|
|
800
|
-
### CLI Tool (Node/Python/Rust)
|
|
801
|
-
|
|
802
|
-
Create:
|
|
803
|
-
- \`src/\` folder structure:
|
|
804
|
-
- \`src/commands/\` - Command handlers
|
|
805
|
-
- \`src/utils/\` - Utilities
|
|
806
|
-
- \`package.json\` with \`bin\` entry / \`setup.py\` / \`Cargo.toml\`
|
|
807
|
-
- Entry point with argument parsing
|
|
808
|
-
- Basic command structure (help, version)
|
|
809
|
-
- \`.gitignore\`
|
|
810
|
-
- \`README.md\` with usage instructions
|
|
811
|
-
|
|
812
|
-
### Full-Stack Application
|
|
813
|
-
|
|
814
|
-
Create both frontend and backend structures:
|
|
815
|
-
- \`frontend/\` or \`client/\` - Web app scaffold
|
|
816
|
-
- \`backend/\` or \`server/\` - API scaffold
|
|
817
|
-
- Root \`package.json\` with workspace config (if monorepo)
|
|
818
|
-
- \`docker-compose.yml\` (optional)
|
|
819
|
-
- \`.gitignore\`
|
|
820
|
-
- \`README.md\` with setup instructions
|
|
821
|
-
|
|
822
|
-
## POST-SCAFFOLD STEPS
|
|
823
|
-
|
|
824
|
-
1. Install dependencies:
|
|
825
|
-
- \`npm install\` / \`pip install -r requirements.txt\` / etc.
|
|
826
|
-
2. Run build to verify:
|
|
827
|
-
- \`npm run build\` / equivalent
|
|
828
|
-
3. Run lint to verify:
|
|
829
|
-
- \`npm run lint\` / equivalent
|
|
830
|
-
4. Create initial git commit:
|
|
831
|
-
- \`chore: initial project scaffold\`
|
|
832
|
-
5. Update backlog:
|
|
833
|
-
- Mark scaffold CHORE as ✅ (if exists)
|
|
834
|
-
|
|
835
|
-
## RULES
|
|
836
|
-
|
|
837
|
-
- Follow conventions from CLAUDE.md
|
|
838
|
-
- Use modern, widely-adopted patterns
|
|
839
|
-
- Keep it minimal - only what's needed to start
|
|
840
|
-
- Don't add features - just structure
|
|
841
|
-
- Ensure the project builds and lints clean
|
|
842
|
-
- Add helpful comments in config files
|
|
843
|
-
- Include TypeScript/type hints where applicable`,
|
|
844
|
-
version: '1.0.0',
|
|
845
|
-
});
|
|
846
|
-
// =============================================================================
|
|
847
|
-
// Research Skills
|
|
848
|
-
// =============================================================================
|
|
849
|
-
export const outlineSkill = defineSkill({
|
|
850
|
-
name: 'outline',
|
|
851
|
-
description: 'Build or refine the research paper structure — sections, claims, source mapping',
|
|
852
|
-
prompt: `You are in OUTLINE MODE. Your goal is to help the user build or refine a structured outline for their research paper using the Research Model.
|
|
853
|
-
|
|
854
|
-
## When to Use
|
|
855
|
-
- Starting a new research paper — no outline exists yet
|
|
856
|
-
- Restructuring an existing paper — user wants to reorganize sections
|
|
857
|
-
- Evolving a paper — new sources or insights change the direction
|
|
858
|
-
- Importing structure — user has an existing paper and wants to model it
|
|
859
|
-
|
|
860
|
-
## Step 1: Assess Current State
|
|
861
|
-
|
|
862
|
-
Start by reading the current state:
|
|
863
|
-
1. Use \`research_model_get\` with scope: "overview" to check if a model exists
|
|
864
|
-
2. If it exists, review sections, questions, and sources already defined
|
|
865
|
-
3. Check the Knowledge Base (read pinned content) for available sources
|
|
866
|
-
4. Check existing work items with \`workitem_query\`
|
|
867
|
-
|
|
868
|
-
Tell the user what you found:
|
|
869
|
-
- "You have X sections, Y sources, Z research questions defined" (if model exists)
|
|
870
|
-
- "No research model found yet — let's build one from scratch" (if new)
|
|
871
|
-
|
|
872
|
-
## Step 2: Gather Context (only ask what you don't already know)
|
|
873
|
-
|
|
874
|
-
Ask in batches of 2-3 questions:
|
|
875
|
-
- **Research topic:** What is the main topic or research question?
|
|
876
|
-
- **Scope:** What type of paper? (journal article, thesis chapter, full thesis, literature review, lab report)
|
|
877
|
-
- **Citation style:** APA, MLA, Chicago, IEEE, Harvard?
|
|
878
|
-
- **Audience:** Who is this for? (academic journal, conference, class assignment)
|
|
879
|
-
- **Constraints:** Any required sections or structure mandated by the target venue?
|
|
880
|
-
|
|
881
|
-
If the model already has a title and citation style set, skip those questions.
|
|
882
|
-
|
|
883
|
-
After gathering answers, save the metadata:
|
|
884
|
-
- \`research_model_update\` with op: "set_title"
|
|
885
|
-
- \`research_model_update\` with op: "set_citation_style"
|
|
886
|
-
- \`research_model_update\` with op: "set_authors" (if provided)
|
|
887
|
-
- \`research_model_update\` with op: "set_keywords" (if provided)
|
|
888
|
-
|
|
889
|
-
## Step 3: Propose Research Questions
|
|
890
|
-
|
|
891
|
-
Based on the topic and available sources, propose:
|
|
892
|
-
- One main research question
|
|
893
|
-
- 2-4 sub-questions the paper will address
|
|
894
|
-
|
|
895
|
-
Present them to the user for review. After confirmation, save each:
|
|
896
|
-
- \`research_model_update\` with op: "question_add", question: { question: "..." }
|
|
897
|
-
|
|
898
|
-
## Step 4: Propose Section Structure
|
|
899
|
-
|
|
900
|
-
Based on the questions, scope, and sources, propose an outline. Adapt to the paper type:
|
|
901
|
-
|
|
902
|
-
**Journal article (5-7 sections):**
|
|
903
|
-
1. Introduction — state the problem, thesis, and contribution
|
|
904
|
-
2. Literature Review / Related Work — what's known, what's the gap
|
|
905
|
-
3. Methodology — research approach
|
|
906
|
-
4. Results / Findings — present the evidence
|
|
907
|
-
5. Discussion — interpret results, implications, limitations
|
|
908
|
-
6. Conclusion — summarize contributions, future work
|
|
909
|
-
|
|
910
|
-
**Thesis (chapters with subsections):**
|
|
911
|
-
- Chapters as top-level sections, subsections as children
|
|
912
|
-
- Include: Abstract, Acknowledgments if appropriate
|
|
913
|
-
|
|
914
|
-
**Literature review (thematic):**
|
|
915
|
-
- Organized by themes, not methodology/results
|
|
916
|
-
- Each theme is a section with sub-themes as subsections
|
|
917
|
-
|
|
918
|
-
**Lab report:**
|
|
919
|
-
- Hypothesis, Method, Results, Discussion, Conclusion
|
|
920
|
-
|
|
921
|
-
Present the outline to the user. For each section include:
|
|
922
|
-
- Title
|
|
923
|
-
- Purpose (what this section argues or establishes — not just "discusses X" but "argues that X because Y")
|
|
924
|
-
- Estimated word count (if appropriate for the scope)
|
|
925
|
-
|
|
926
|
-
After user confirms/adjusts, save each section:
|
|
927
|
-
- \`research_model_update\` with op: "section_add", section: { title, purpose, order, parentId, targetWordCount }
|
|
928
|
-
|
|
929
|
-
For subsections, use parentId referencing the parent section's ID.
|
|
930
|
-
|
|
931
|
-
## Step 5: Map Sources to Sections (if sources exist in KB)
|
|
932
|
-
|
|
933
|
-
If the Knowledge Base has sources:
|
|
934
|
-
1. Review available source descriptions/pinned content
|
|
935
|
-
2. For each section, suggest which sources might be relevant
|
|
936
|
-
3. Create initial claim sketches for key arguments
|
|
937
|
-
4. Link sources to claims
|
|
938
|
-
|
|
939
|
-
For each claim:
|
|
940
|
-
- \`research_model_update\` with op: "claim_add", sectionId: "...", claim: { statement: "..." }
|
|
941
|
-
|
|
942
|
-
For each source link (only if source is already in the model):
|
|
943
|
-
- \`research_model_update\` with op: "claim_link_source", sectionId: "...", claimId: "...", sourceRef: { sourceId: "..." }, relation: "supporting"
|
|
944
|
-
|
|
945
|
-
If no sources exist yet, skip this step and note: "Add sources to the Knowledge Base and run /literature-review to link them."
|
|
946
|
-
|
|
947
|
-
## Step 6: Generate Work Items
|
|
948
|
-
|
|
949
|
-
Create one work item per section:
|
|
950
|
-
- Use \`workitem_create\` for each section
|
|
951
|
-
- Type: "feature" (displayed as "Section" in research projects)
|
|
952
|
-
- Title: "Draft: {section title}"
|
|
953
|
-
- Description: Include section purpose, key claims to address, relevant sources
|
|
954
|
-
- Priority based on writing order:
|
|
955
|
-
- Methodology → high (write first, grounds the paper)
|
|
956
|
-
- Literature Review → high (needed early)
|
|
957
|
-
- Results / Findings → medium
|
|
958
|
-
- Discussion → medium
|
|
959
|
-
- Introduction → low (easier to write once you know what you're introducing)
|
|
960
|
-
- Conclusion → low (summary of everything else)
|
|
961
|
-
|
|
962
|
-
## Step 7: Validate and Summarize
|
|
963
|
-
|
|
964
|
-
1. Run \`research_model_validate\` to check for issues
|
|
965
|
-
2. Present a summary:
|
|
966
|
-
- Paper title and scope
|
|
967
|
-
- Research questions
|
|
968
|
-
- Section outline with purposes
|
|
969
|
-
- Source mapping (if any)
|
|
970
|
-
- Work items created
|
|
971
|
-
- Any warnings from validation (unsupported claims, empty sections — expected at this stage)
|
|
972
|
-
|
|
973
|
-
## Rules
|
|
974
|
-
- This is INTERACTIVE. Ask questions, propose, get feedback, iterate. Do NOT generate the entire outline in one shot.
|
|
975
|
-
- Respect existing model state. If sections already exist, propose modifications rather than replacing everything.
|
|
976
|
-
- Each section's purpose should clearly state what it argues or establishes.
|
|
977
|
-
- Claims are hypotheses at this stage — mark them as unsupported until sources are linked.
|
|
978
|
-
- Use the ask_user tool to present options when choices are needed.
|
|
979
|
-
- If the user says "skip" or "later", move to the next step.
|
|
980
|
-
- Total interaction should be 8-15 questions max.
|
|
981
|
-
|
|
982
|
-
## Completion Criteria
|
|
983
|
-
✓ Paper title and citation style are set
|
|
984
|
-
✓ Research questions are defined
|
|
985
|
-
✓ Section structure matches the paper scope
|
|
986
|
-
✓ Each section has a clear purpose
|
|
987
|
-
✓ Sources mapped to sections (if available)
|
|
988
|
-
✓ Work items created for each section
|
|
989
|
-
✓ Model validates without structural errors
|
|
990
|
-
✓ User has reviewed and approved the outline`,
|
|
991
|
-
tags: ['research', 'planning', 'outline'],
|
|
992
|
-
});
|
|
993
|
-
export const literatureReviewSkill = defineSkill({
|
|
994
|
-
name: 'literature-review',
|
|
995
|
-
description: 'Analyze sources from the Knowledge Base — extract findings, link to claims, identify gaps',
|
|
996
|
-
prompt: `You are in LITERATURE REVIEW MODE. Your goal is to systematically analyze the sources in the Knowledge Base and connect them to the Research Model's sections and claims.
|
|
997
|
-
|
|
998
|
-
## When to Use
|
|
999
|
-
- Sources have been added to the Knowledge Base but not yet analyzed
|
|
1000
|
-
- The Research Model has sections/claims that need source support
|
|
1001
|
-
- User wants to understand how sources relate to their argument
|
|
1002
|
-
- User wants to identify gaps in their source coverage
|
|
1003
|
-
|
|
1004
|
-
## Prerequisites
|
|
1005
|
-
- A Research Model should exist (run /outline first if not)
|
|
1006
|
-
- Sources should be in the Knowledge Base (upload PDFs, paste text, or import URLs)
|
|
1007
|
-
|
|
1008
|
-
## Step 1: Assess Current State
|
|
1009
|
-
|
|
1010
|
-
1. Use \`research_model_get\` with scope: "overview" to see the current model
|
|
1011
|
-
2. Use \`research_model_get\` with scope: "sources" to see which sources are already registered and analyzed
|
|
1012
|
-
3. Review the Knowledge Base content (pinned items are in context; read non-pinned files as needed)
|
|
1013
|
-
|
|
1014
|
-
Report to the user:
|
|
1015
|
-
- "You have X sources in the model, Y analyzed, Z unanalyzed"
|
|
1016
|
-
- "The Knowledge Base has N files available"
|
|
1017
|
-
- "X claims currently lack source support"
|
|
1018
|
-
|
|
1019
|
-
## Step 2: Register New Sources
|
|
1020
|
-
|
|
1021
|
-
For each KB document not yet in the Research Model:
|
|
1022
|
-
1. Read the document content (use \`read_file\` if not pinned)
|
|
1023
|
-
2. Extract citation information: authors, title, year, venue, type
|
|
1024
|
-
3. Register it: \`research_model_update\` with op: "source_add", source: { citeKey, citation: { type, title, authors, year, venue } }
|
|
1025
|
-
4. Note: generate a short, memorable citeKey (e.g., "smith2024", "jones-ml-2023")
|
|
1026
|
-
|
|
1027
|
-
Ask the user to confirm the extracted citation info for each source, or batch-confirm if there are many.
|
|
1028
|
-
|
|
1029
|
-
## Step 3: Analyze Each Source
|
|
1030
|
-
|
|
1031
|
-
For each unanalyzed source:
|
|
1032
|
-
1. Read the full content from the KB
|
|
1033
|
-
2. Extract key findings relevant to the paper's research questions
|
|
1034
|
-
3. Identify the source's methodology and limitations
|
|
1035
|
-
4. Determine relevance: primary (directly addresses research questions), secondary (provides context), or background (general knowledge)
|
|
1036
|
-
5. Update the source: \`research_model_update\` with op: "source_update", sourceId: "...", updates: { keyFindings: [...], relevance: "primary|secondary|background", analyzed: true, tags: [...] }
|
|
1037
|
-
|
|
1038
|
-
Present a summary of each source's key findings to the user.
|
|
1039
|
-
|
|
1040
|
-
## Step 4: Link Sources to Claims
|
|
1041
|
-
|
|
1042
|
-
For each section in the model:
|
|
1043
|
-
1. Read the section's existing claims (\`research_model_get\` with sectionId)
|
|
1044
|
-
2. For each claim, identify which analyzed sources support or contradict it
|
|
1045
|
-
3. Link them: \`research_model_update\` with op: "claim_link_source", sectionId, claimId, sourceRef: { sourceId, relevance: "brief note" }, relation: "supporting" or "contradicting"
|
|
1046
|
-
4. Update evidence strength based on the linked sources:
|
|
1047
|
-
- strong: multiple supporting sources, no contradictions
|
|
1048
|
-
- moderate: at least one supporting source
|
|
1049
|
-
- weak: tangential support only
|
|
1050
|
-
- contested: sources disagree
|
|
1051
|
-
- unsupported: no sources linked
|
|
1052
|
-
|
|
1053
|
-
If a source suggests a claim that doesn't exist yet, propose adding it:
|
|
1054
|
-
- \`research_model_update\` with op: "claim_add", sectionId, claim: { statement, type: "derived" }
|
|
1055
|
-
|
|
1056
|
-
## Step 5: Identify Gaps
|
|
1057
|
-
|
|
1058
|
-
After linking sources to claims, analyze gaps:
|
|
1059
|
-
1. Run \`research_model_validate\` to get warnings
|
|
1060
|
-
2. Report:
|
|
1061
|
-
- **Unsupported claims** — claims with no source references (need more sources or should be marked as original analysis)
|
|
1062
|
-
- **Orphan sources** — sources not linked to any claim (may not be relevant, or claims are missing)
|
|
1063
|
-
- **Thin sections** — sections with few claims or few sources
|
|
1064
|
-
- **Missing perspectives** — if all sources agree, note the lack of counter-arguments
|
|
1065
|
-
|
|
1066
|
-
Suggest next steps:
|
|
1067
|
-
- "Section X needs more sources on [topic] — consider searching for..."
|
|
1068
|
-
- "Source Y has findings relevant to Section Z but no claim captures this yet"
|
|
1069
|
-
- "The paper lacks counter-arguments on [claim] — consider adding a limitations discussion"
|
|
1070
|
-
|
|
1071
|
-
## Step 6: Synthesize Themes
|
|
1072
|
-
|
|
1073
|
-
If multiple sources have been analyzed, provide a thematic synthesis:
|
|
1074
|
-
- Group sources by the themes they address
|
|
1075
|
-
- Note where sources agree, where they disagree, and what's novel
|
|
1076
|
-
- Map themes to research questions
|
|
1077
|
-
- Suggest how themes should be organized in the Literature Review section
|
|
1078
|
-
|
|
1079
|
-
## Rules
|
|
1080
|
-
- Analyze sources ONE AT A TIME — don't rush through multiple sources
|
|
1081
|
-
- Ask the user to confirm citation info before saving (batch OK for many sources)
|
|
1082
|
-
- Always distinguish between the source's claims and the user's interpretation
|
|
1083
|
-
- Note methodological differences between sources when relevant
|
|
1084
|
-
- Use citeKeys consistently when referencing sources
|
|
1085
|
-
- If a source is irrelevant to the research, say so — not every KB file needs to be in the model
|
|
1086
|
-
- Keep evidence strength assessments conservative — "moderate" is better than over-claiming "strong"
|
|
1087
|
-
|
|
1088
|
-
## Completion Criteria
|
|
1089
|
-
✓ All relevant KB sources are registered in the model
|
|
1090
|
-
✓ Each source has been analyzed (keyFindings, relevance, tags)
|
|
1091
|
-
✓ Sources are linked to relevant claims
|
|
1092
|
-
✓ Evidence strength updated for linked claims
|
|
1093
|
-
✓ Gaps identified and reported
|
|
1094
|
-
✓ User has reviewed the source-claim mappings`,
|
|
1095
|
-
tags: ['research', 'analysis', 'sources'],
|
|
1096
|
-
});
|
|
1097
|
-
export const draftSectionSkill = defineSkill({
|
|
1098
|
-
name: 'draft-section',
|
|
1099
|
-
description: 'Draft a paper section using the outline, claims, and linked sources',
|
|
1100
|
-
prompt: `You are in DRAFT SECTION MODE. Your goal is to write or revise a section of the research paper, guided by the Research Model's outline, claims, and linked sources.
|
|
1101
|
-
|
|
1102
|
-
## When to Use
|
|
1103
|
-
- A section has status "outlined" and needs its first draft
|
|
1104
|
-
- A section needs revision based on reviewer feedback
|
|
1105
|
-
- The user wants to expand a section with more detail
|
|
1106
|
-
|
|
1107
|
-
## Step 1: Select the Section
|
|
1108
|
-
|
|
1109
|
-
1. Use \`research_model_get\` with scope: "sections" to see all sections and their status
|
|
1110
|
-
2. If the user didn't specify which section, suggest the next logical one:
|
|
1111
|
-
- Methodology first (grounds the paper)
|
|
1112
|
-
- Literature Review (needed early)
|
|
1113
|
-
- Results / Findings (core content)
|
|
1114
|
-
- Discussion (interpretation)
|
|
1115
|
-
- Introduction and Conclusion last (summaries)
|
|
1116
|
-
3. Confirm the section choice with the user
|
|
1117
|
-
|
|
1118
|
-
## Step 2: Gather Section Context
|
|
1119
|
-
|
|
1120
|
-
For the chosen section:
|
|
1121
|
-
1. Use \`research_model_get\` with sectionId to get the section's purpose, claims, and notes
|
|
1122
|
-
2. Read any existing draft file (if the section has been drafted before)
|
|
1123
|
-
3. For each claim with linked sources, read the source content from KB to understand the evidence
|
|
1124
|
-
4. Check the citation style from the model: \`research_model_get\` with scope: "overview"
|
|
1125
|
-
|
|
1126
|
-
Summarize to the user:
|
|
1127
|
-
- "Section: {title}"
|
|
1128
|
-
- "Purpose: {purpose}"
|
|
1129
|
-
- "Claims to address: {list}"
|
|
1130
|
-
- "Sources available: {list with citeKeys}"
|
|
1131
|
-
|
|
1132
|
-
## Step 3: Draft the Section
|
|
1133
|
-
|
|
1134
|
-
Write the section following these guidelines:
|
|
1135
|
-
|
|
1136
|
-
**Structure:**
|
|
1137
|
-
- Start with a topic sentence that states the section's purpose
|
|
1138
|
-
- Address each claim in the section in a logical order
|
|
1139
|
-
- Use transitions between paragraphs
|
|
1140
|
-
- End with a connection to the next section (or summary for final sections)
|
|
1141
|
-
|
|
1142
|
-
**Citations:**
|
|
1143
|
-
- Use the project's citation style for in-text citations
|
|
1144
|
-
- APA: (Author, Year) or Author (Year)
|
|
1145
|
-
- MLA: (Author Page) or Author (Page)
|
|
1146
|
-
- IEEE: [citeKey] or [N]
|
|
1147
|
-
- Chicago: (Author Year) or Author (Year)
|
|
1148
|
-
- Harvard: (Author Year) or Author (Year)
|
|
1149
|
-
- Cite sources for every non-original claim
|
|
1150
|
-
- When multiple sources support a claim, cite them together
|
|
1151
|
-
|
|
1152
|
-
**Academic Tone:**
|
|
1153
|
-
- Formal but clear — avoid jargon without definition
|
|
1154
|
-
- Use hedging language where appropriate ("suggests", "indicates", "appears to")
|
|
1155
|
-
- Distinguish between established facts and interpretations
|
|
1156
|
-
- Use active voice for the author's contributions, passive for general findings
|
|
1157
|
-
|
|
1158
|
-
**Length:**
|
|
1159
|
-
- Respect the section's targetWordCount if set
|
|
1160
|
-
- If not set, aim for appropriate length based on scope:
|
|
1161
|
-
- Journal article section: 500-1500 words
|
|
1162
|
-
- Thesis chapter: 2000-5000 words
|
|
1163
|
-
- Literature review section: 800-2000 words
|
|
1164
|
-
|
|
1165
|
-
## Step 4: Write the File
|
|
1166
|
-
|
|
1167
|
-
1. Determine the file path: \`{project_path}/sections/{section_order}-{section_slug}.md\`
|
|
1168
|
-
- e.g., \`sections/01-introduction.md\`, \`sections/03-methodology.md\`
|
|
1169
|
-
2. Write the draft using \`write_file\` or \`edit_file\` (if revising)
|
|
1170
|
-
3. Include a header comment: \`<!-- Section: {title} | Status: drafted | Rev: {model revision} -->\`
|
|
1171
|
-
|
|
1172
|
-
## Step 5: Update the Model
|
|
1173
|
-
|
|
1174
|
-
After writing:
|
|
1175
|
-
1. Update section status: \`research_model_update\` with op: "section_update", sectionId, updates: { status: "drafted", actualWordCount: N }
|
|
1176
|
-
2. If new claims emerged during writing, add them: \`research_model_update\` with op: "claim_add"
|
|
1177
|
-
3. If evidence strength changed based on closer reading, update claims
|
|
1178
|
-
|
|
1179
|
-
## Step 6: Generate Bibliography (if needed)
|
|
1180
|
-
|
|
1181
|
-
If this is the first section being drafted or the user requests it:
|
|
1182
|
-
1. Use \`bibliography_generate\` with format: "markdown" to produce the references list
|
|
1183
|
-
2. Write it to \`{project_path}/sections/references.md\`
|
|
1184
|
-
|
|
1185
|
-
## Step 7: Summary
|
|
1186
|
-
|
|
1187
|
-
Report to the user:
|
|
1188
|
-
- Section drafted: title, word count, file path
|
|
1189
|
-
- Claims addressed: list with evidence strength
|
|
1190
|
-
- Citations used: list of citeKeys
|
|
1191
|
-
- Suggestions: any gaps noticed, claims that need more support
|
|
1192
|
-
|
|
1193
|
-
## Rules
|
|
1194
|
-
- NEVER fabricate citations — only cite sources that exist in the Research Model
|
|
1195
|
-
- If a claim lacks source support, note it explicitly rather than inventing a reference
|
|
1196
|
-
- Maintain consistency with previously drafted sections (terminology, tense, voice)
|
|
1197
|
-
- If the section has subsections in the model, draft them as ## subheadings
|
|
1198
|
-
- Read existing drafted sections first to maintain consistent style
|
|
1199
|
-
- Ask the user about tone preferences if this is the first section being drafted
|
|
1200
|
-
|
|
1201
|
-
## Completion Criteria
|
|
1202
|
-
✓ Section file written with proper citations
|
|
1203
|
-
✓ Model updated (status: drafted, actualWordCount)
|
|
1204
|
-
✓ All claims in the section are addressed in the text
|
|
1205
|
-
✓ In-text citations match the project's citation style
|
|
1206
|
-
✓ User has reviewed the draft`,
|
|
1207
|
-
tags: ['research', 'writing', 'drafting'],
|
|
1208
|
-
});
|
|
1209
|
-
export const peerReviewSkill = defineSkill({
|
|
1210
|
-
name: 'peer-review',
|
|
1211
|
-
description: 'Validate argument structure, find logical gaps, check consistency across sections',
|
|
1212
|
-
prompt: `You are in PEER REVIEW MODE. Your goal is to critically evaluate the research paper's argument structure, identify gaps, and check consistency — like an academic peer reviewer.
|
|
1213
|
-
|
|
1214
|
-
## When to Use
|
|
1215
|
-
- One or more sections have been drafted
|
|
1216
|
-
- The user wants feedback before submitting/finalizing
|
|
1217
|
-
- After significant revisions to check nothing was broken
|
|
1218
|
-
- To identify areas that need more work
|
|
1219
|
-
|
|
1220
|
-
## Step 1: Assess What's Available
|
|
1221
|
-
|
|
1222
|
-
1. Use \`research_model_get\` with scope: "overview" for the big picture
|
|
1223
|
-
2. Use \`research_model_get\` with scope: "sections" to see status of each section
|
|
1224
|
-
3. Run \`research_model_validate\` for structural issues and warnings
|
|
1225
|
-
|
|
1226
|
-
Report to the user:
|
|
1227
|
-
- "X sections drafted, Y still outlined, Z sources linked"
|
|
1228
|
-
- Any structural errors from validation
|
|
1229
|
-
- Which sections are ready for review
|
|
1230
|
-
|
|
1231
|
-
If no sections are drafted yet, tell the user: "There's nothing to review yet — run /draft-section first."
|
|
1232
|
-
|
|
1233
|
-
## Step 2: Argument Structure Review
|
|
1234
|
-
|
|
1235
|
-
Read each drafted section (use \`read_file\` on the section files) and evaluate:
|
|
1236
|
-
|
|
1237
|
-
**Thesis & Research Questions:**
|
|
1238
|
-
- Is the main thesis clearly stated in the Introduction?
|
|
1239
|
-
- Does each section contribute to answering the research questions?
|
|
1240
|
-
- Are the research questions actually addressed by the paper's content?
|
|
1241
|
-
|
|
1242
|
-
**Logical Flow:**
|
|
1243
|
-
- Does the argument progress logically from Introduction → Literature Review → Methodology → Results → Discussion → Conclusion?
|
|
1244
|
-
- Does each section build on what came before?
|
|
1245
|
-
- Are there logical jumps or non-sequiturs between sections?
|
|
1246
|
-
|
|
1247
|
-
**Claim Validation:**
|
|
1248
|
-
For each claim in the Research Model:
|
|
1249
|
-
- Is it actually stated in the draft text?
|
|
1250
|
-
- Is it supported by the cited sources?
|
|
1251
|
-
- Is the evidence strength rating accurate given the sources?
|
|
1252
|
-
- Are there unsupported assertions presented as established facts?
|
|
1253
|
-
|
|
1254
|
-
Rate each issue found:
|
|
1255
|
-
- **Critical** — breaks the argument (e.g., unsupported central claim, circular reasoning)
|
|
1256
|
-
- **Major** — weakens the argument significantly (e.g., missing counter-arguments, logical gap)
|
|
1257
|
-
- **Minor** — should be fixed but doesn't break the argument (e.g., vague language, minor inconsistency)
|
|
1258
|
-
|
|
1259
|
-
## Step 3: Gap Detection
|
|
1260
|
-
|
|
1261
|
-
Check for missing elements:
|
|
1262
|
-
|
|
1263
|
-
**Source Gaps:**
|
|
1264
|
-
- Claims that should have citations but don't
|
|
1265
|
-
- Sections that rely on very few sources
|
|
1266
|
-
- Important counter-arguments not addressed
|
|
1267
|
-
- Methodology claims without justification
|
|
1268
|
-
|
|
1269
|
-
**Structural Gaps:**
|
|
1270
|
-
- Research questions not addressed by any section
|
|
1271
|
-
- Sections that don't connect to the overall argument
|
|
1272
|
-
- Missing limitations discussion
|
|
1273
|
-
- Missing future work section (if appropriate)
|
|
1274
|
-
|
|
1275
|
-
**Content Gaps:**
|
|
1276
|
-
- Definitions used but never introduced
|
|
1277
|
-
- Acronyms used without expansion
|
|
1278
|
-
- Figures/tables referenced but not present
|
|
1279
|
-
- Promises made in the Introduction but not delivered
|
|
1280
|
-
|
|
1281
|
-
## Step 4: Consistency Check
|
|
1282
|
-
|
|
1283
|
-
Across all drafted sections, check:
|
|
1284
|
-
|
|
1285
|
-
**Terminology:**
|
|
1286
|
-
- Is the same concept referred to consistently? (e.g., not "users" in one place and "participants" in another without reason)
|
|
1287
|
-
- Are technical terms used with consistent meaning?
|
|
1288
|
-
|
|
1289
|
-
**Tense:**
|
|
1290
|
-
- Literature review: past tense for completed studies
|
|
1291
|
-
- Methodology: past tense for what was done, present for general statements
|
|
1292
|
-
- Results: past tense for findings
|
|
1293
|
-
- Discussion: present tense for interpretations
|
|
1294
|
-
|
|
1295
|
-
**Voice & Tone:**
|
|
1296
|
-
- Is the level of formality consistent?
|
|
1297
|
-
- Is the author's voice consistent (not shifting between confident and hedging without reason)?
|
|
1298
|
-
|
|
1299
|
-
**Numbers & Data:**
|
|
1300
|
-
- Do statistics match between text and any tables/figures?
|
|
1301
|
-
- Are numbers formatted consistently?
|
|
1302
|
-
|
|
1303
|
-
## Step 5: Cross-Reference Check
|
|
1304
|
-
|
|
1305
|
-
- "As discussed in Section X" — does Section X actually discuss that?
|
|
1306
|
-
- "See Table N" / "See Figure N" — do they exist?
|
|
1307
|
-
- Citations in text match sources in the Research Model
|
|
1308
|
-
- Consistent use of citation style throughout
|
|
1309
|
-
|
|
1310
|
-
## Step 6: Generate Review Report
|
|
1311
|
-
|
|
1312
|
-
Structure the report as:
|
|
1313
|
-
|
|
1314
|
-
### Strengths
|
|
1315
|
-
- What the paper does well (2-3 points)
|
|
1316
|
-
|
|
1317
|
-
### Critical Issues
|
|
1318
|
-
- Issues that must be addressed (with specific locations)
|
|
1319
|
-
|
|
1320
|
-
### Major Issues
|
|
1321
|
-
- Significant improvements needed
|
|
1322
|
-
|
|
1323
|
-
### Minor Issues
|
|
1324
|
-
- Small fixes and suggestions
|
|
1325
|
-
|
|
1326
|
-
### Recommendations
|
|
1327
|
-
- Prioritized list of what to fix first
|
|
1328
|
-
- Suggested order of revisions
|
|
1329
|
-
|
|
1330
|
-
Write the report to \`{project_path}/reviews/peer-review-{date}.md\`
|
|
1331
|
-
|
|
1332
|
-
## Step 7: Update Model
|
|
1333
|
-
|
|
1334
|
-
For issues that affect the Research Model:
|
|
1335
|
-
1. Update claim evidence strength if ratings were inaccurate
|
|
1336
|
-
2. Add new claims if the review identified missing arguments
|
|
1337
|
-
3. Create work items (type: "bug" / displayed as "Revision") for each critical and major issue:
|
|
1338
|
-
- \`workitem_create\` with type: "bug", title: "Review: {brief issue}", description: detailed issue + suggested fix
|
|
1339
|
-
|
|
1340
|
-
## Rules
|
|
1341
|
-
- Be constructive, not destructive — every critique should include a suggestion for improvement
|
|
1342
|
-
- Reference specific sections, claims, and sources by ID/citeKey
|
|
1343
|
-
- Don't rewrite the paper — point out issues and let the author fix them
|
|
1344
|
-
- Distinguish between opinion ("I would suggest...") and errors ("This claim is unsupported")
|
|
1345
|
-
- If the argument is sound, say so — don't manufacture problems
|
|
1346
|
-
- Focus on the argument, not the writing style (that's the Editor's job)
|
|
1347
|
-
|
|
1348
|
-
## Completion Criteria
|
|
1349
|
-
✓ All drafted sections reviewed
|
|
1350
|
-
✓ Argument structure evaluated (thesis, logical flow, claim support)
|
|
1351
|
-
✓ Gaps identified (source, structural, content)
|
|
1352
|
-
✓ Consistency checked (terminology, tense, cross-references)
|
|
1353
|
-
✓ Review report written to file
|
|
1354
|
-
✓ Revision work items created for critical/major issues
|
|
1355
|
-
✓ User has received the review summary`,
|
|
1356
|
-
tags: ['research', 'review', 'quality'],
|
|
1357
|
-
});
|
|
1358
|
-
export const researchScaffoldSkill = defineSkill({
|
|
1359
|
-
name: 'research-scaffold',
|
|
1360
|
-
description: 'Scaffold a research paper project from a template (APA, IEEE, Thesis, Literature Review, Lab Report)',
|
|
1361
|
-
prompt: `You are in RESEARCH SCAFFOLD MODE. Your goal is to help the user set up a new research paper project using a template.
|
|
1362
|
-
|
|
1363
|
-
## Available Templates
|
|
1364
|
-
|
|
1365
|
-
| Template | ID | Best For |
|
|
1366
|
-
|----------|-----|----------|
|
|
1367
|
-
| APA Research Paper | \`apa-paper\` | Social sciences, psychology, education |
|
|
1368
|
-
| IEEE Conference Paper | \`ieee-paper\` | Engineering, computer science |
|
|
1369
|
-
| Thesis / Dissertation | \`thesis\` | Graduate work, multi-chapter |
|
|
1370
|
-
| Literature Review | \`literature-review\` | Standalone review papers |
|
|
1371
|
-
| Lab Report | \`lab-report\` | Scientific experiments |
|
|
1372
|
-
|
|
1373
|
-
## Step 1: Gather Info
|
|
1374
|
-
|
|
1375
|
-
Ask the user (if not already provided):
|
|
1376
|
-
1. What is the paper topic / title?
|
|
1377
|
-
2. Which template best fits their needs? (describe the options briefly)
|
|
1378
|
-
3. What citation style? (default depends on template — APA for most, IEEE for engineering)
|
|
1379
|
-
|
|
1380
|
-
## Step 2: Scaffold
|
|
1381
|
-
|
|
1382
|
-
Call the \`research_scaffold\` tool with:
|
|
1383
|
-
- \`template\`: the template ID
|
|
1384
|
-
- \`title\`: the paper title
|
|
1385
|
-
- \`citation_style\`: if different from template default
|
|
1386
|
-
- \`output_dir\`: the project path
|
|
1387
|
-
|
|
1388
|
-
This creates:
|
|
1389
|
-
- A Research Model with pre-defined sections
|
|
1390
|
-
- Folder structure (sections/, figures/, references/, knowledge/)
|
|
1391
|
-
- Section stub files (one per section)
|
|
1392
|
-
- COMPILR.md with project context
|
|
1393
|
-
- Bibliography file (.bib)
|
|
1394
|
-
- Work items for each section (type: "Section")
|
|
1395
|
-
|
|
1396
|
-
## Step 3: Confirm and Guide
|
|
1397
|
-
|
|
1398
|
-
After scaffolding, tell the user:
|
|
1399
|
-
- What was created (sections, files, work items)
|
|
1400
|
-
- Suggested next steps:
|
|
1401
|
-
1. "Add your source material to the Knowledge Base"
|
|
1402
|
-
2. "Run /outline to customize the section structure"
|
|
1403
|
-
3. "Run /literature-review to analyze your sources"
|
|
1404
|
-
4. "Run /draft-section to start writing"
|
|
1405
|
-
|
|
1406
|
-
## Rules
|
|
1407
|
-
- If a Research Model already exists, warn the user and don't overwrite
|
|
1408
|
-
- Use dry_run first if the user seems uncertain
|
|
1409
|
-
- The scaffold is a starting point — the user can customize everything after`,
|
|
1410
|
-
tags: ['research', 'scaffold', 'setup'],
|
|
1411
|
-
});
|
|
1412
|
-
// =============================================================================
|
|
1413
|
-
// Business Plan Skills
|
|
1414
|
-
// =============================================================================
|
|
1415
|
-
export const businessVisionSkill = defineSkill({
|
|
1416
|
-
name: 'business-vision',
|
|
1417
|
-
description: 'Define the business identity, problem, solution, and value proposition',
|
|
1418
|
-
prompt: `You are in BUSINESS VISION MODE. Help the user define and articulate their business idea.
|
|
1419
|
-
|
|
1420
|
-
## Step 1: Assess Current State
|
|
1421
|
-
1. Use \`business_model_get\` with scope: "identity" to check if a model exists
|
|
1422
|
-
2. Report what's already defined
|
|
1423
|
-
|
|
1424
|
-
## Step 2: Gather Core Information
|
|
1425
|
-
Ask in batches (only what's not already defined):
|
|
1426
|
-
- **Business name** and tagline
|
|
1427
|
-
- **Problem**: What specific pain point do your target customers experience?
|
|
1428
|
-
- **Solution**: How does your product/service solve this?
|
|
1429
|
-
- **Unique value**: Why you instead of alternatives? What's the unfair advantage?
|
|
1430
|
-
- **Target customer**: Who specifically are you building for?
|
|
1431
|
-
- **Stage**: idea, pre-seed, seed, series-a, growth, or established?
|
|
1432
|
-
- **Industry/sector**
|
|
1433
|
-
|
|
1434
|
-
## Step 3: Craft the Value Proposition
|
|
1435
|
-
Help refine the problem-solution-uniqueValue into a compelling narrative:
|
|
1436
|
-
- Problem should be specific and relatable
|
|
1437
|
-
- Solution should directly address the problem
|
|
1438
|
-
- Unique value should differentiate from ALL alternatives (including doing nothing)
|
|
1439
|
-
|
|
1440
|
-
## Step 4: Save to Model
|
|
1441
|
-
- \`business_model_update\` with op: "set_identity" for name, tagline, mission, stage, industry, sector
|
|
1442
|
-
- \`business_model_update\` with op: "set_value_proposition" for problem, solution, uniqueValue, targetCustomer
|
|
1443
|
-
|
|
1444
|
-
## Step 5: Suggest Next Steps
|
|
1445
|
-
After saving, suggest:
|
|
1446
|
-
- "Run /market-analysis to size your market and define customer segments"
|
|
1447
|
-
- "Run /competitor-analysis to map the competitive landscape"
|
|
1448
|
-
|
|
1449
|
-
## Rules
|
|
1450
|
-
- Interactive — ask questions, don't assume
|
|
1451
|
-
- Push back on vague answers ("everyone" is not a target customer)
|
|
1452
|
-
- A good value proposition is specific, measurable, and defensible`,
|
|
1453
|
-
tags: ['business', 'planning', 'vision'],
|
|
1454
|
-
});
|
|
1455
|
-
export const marketAnalysisSkill = defineSkill({
|
|
1456
|
-
name: 'market-analysis',
|
|
1457
|
-
description: 'Analyze market size, trends, and customer segments',
|
|
1458
|
-
prompt: `You are in MARKET ANALYSIS MODE. Help the user understand their market.
|
|
1459
|
-
|
|
1460
|
-
## Step 1: Assess Current State
|
|
1461
|
-
1. Use \`business_model_get\` with scope: "overview" for context
|
|
1462
|
-
2. Use \`business_model_get\` with scope: "market" for existing market data
|
|
1463
|
-
3. Check Knowledge Base for market research sources
|
|
1464
|
-
|
|
1465
|
-
## Step 2: Define Customer Segments
|
|
1466
|
-
For each segment:
|
|
1467
|
-
- Name and description
|
|
1468
|
-
- Estimated size (number of potential customers or revenue opportunity)
|
|
1469
|
-
- Key pain points (what problems they face)
|
|
1470
|
-
- Willingness to pay
|
|
1471
|
-
|
|
1472
|
-
Save each: \`business_model_update\` with op: "segment_add", segment: { name, description, size, painPoints, willingness }
|
|
1473
|
-
|
|
1474
|
-
## Step 3: Market Sizing
|
|
1475
|
-
Guide through TAM/SAM/SOM:
|
|
1476
|
-
- **TAM** (Total Addressable Market): If everyone who could use your product did, how big is the market?
|
|
1477
|
-
- **SAM** (Serviceable Addressable Market): Realistically, which portion can you reach?
|
|
1478
|
-
- **SOM** (Serviceable Obtainable Market): In the first 1-3 years, what share can you capture?
|
|
1479
|
-
|
|
1480
|
-
Each should have a value (e.g., "$4.2B"), description, and source.
|
|
1481
|
-
Save: \`business_model_update\` with op: "set_market_size", market_size: { tam: {...}, sam: {...}, som: {...} }
|
|
1482
|
-
|
|
1483
|
-
## Step 4: Trends and Growth
|
|
1484
|
-
- Identify 3-5 market trends relevant to the business
|
|
1485
|
-
- Estimate market growth rate
|
|
1486
|
-
Save: \`business_model_update\` with op: "set_market_size", market_size: { trends: [...], growthRate: "..." }
|
|
1487
|
-
|
|
1488
|
-
## Step 5: Generate Work Items
|
|
1489
|
-
Create Milestone work items for:
|
|
1490
|
-
- "Validate segment: [name]" for each segment (priority: high)
|
|
1491
|
-
- "Source market data" if TAM/SAM/SOM need better sources (priority: medium)
|
|
1492
|
-
|
|
1493
|
-
## Rules
|
|
1494
|
-
- Always ask for sources — investors will ask "where did you get that number?"
|
|
1495
|
-
- Challenge unrealistic sizing (a $100B TAM for a niche SaaS is suspicious)
|
|
1496
|
-
- Bottom-up sizing is more credible than top-down
|
|
1497
|
-
- Distinguish between potential customers and paying customers`,
|
|
1498
|
-
tags: ['business', 'analysis', 'market'],
|
|
1499
|
-
});
|
|
1500
|
-
export const competitorAnalysisSkill = defineSkill({
|
|
1501
|
-
name: 'competitor-analysis',
|
|
1502
|
-
description: 'Map the competitive landscape — identify competitors, strengths, weaknesses, positioning',
|
|
1503
|
-
prompt: `You are in COMPETITOR ANALYSIS MODE. Help the user understand their competition.
|
|
1504
|
-
|
|
1505
|
-
## Step 1: Assess Current State
|
|
1506
|
-
1. Use \`business_model_get\` with scope: "competitors" for existing data
|
|
1507
|
-
2. Read Knowledge Base for competitor research, reports, articles
|
|
1508
|
-
3. Use \`business_model_get\` with scope: "identity" for context on the business
|
|
1509
|
-
|
|
1510
|
-
## Step 2: Identify Competitors
|
|
1511
|
-
For each competitor (guide user to list 3-8):
|
|
1512
|
-
- Direct competitors (same product, same market)
|
|
1513
|
-
- Indirect competitors (different product, same problem)
|
|
1514
|
-
- Potential competitors (could enter the market)
|
|
1515
|
-
|
|
1516
|
-
## Step 3: Analyze Each Competitor
|
|
1517
|
-
For each, gather:
|
|
1518
|
-
- **Name** and brief description
|
|
1519
|
-
- **Strengths** (2-4): what they do well
|
|
1520
|
-
- **Weaknesses** (2-4): where they fall short
|
|
1521
|
-
- **Market position**: leader, challenger, niche, or emerging
|
|
1522
|
-
- **Pricing** model/range
|
|
1523
|
-
- **URL** (if applicable)
|
|
1524
|
-
|
|
1525
|
-
Save each: \`business_model_update\` with op: "competitor_add", competitor: { name, description, strengths, weaknesses, marketPosition, pricing, url }
|
|
1526
|
-
|
|
1527
|
-
## Step 4: Define Competitive Advantages
|
|
1528
|
-
Based on the competitor analysis, what are YOUR advantages?
|
|
1529
|
-
- What do you do that no competitor does?
|
|
1530
|
-
- Where are the gaps in the market?
|
|
1531
|
-
- What would be hard for competitors to replicate?
|
|
1532
|
-
|
|
1533
|
-
Save: \`business_model_update\` with op: "set_competitive_advantages", advantages: [...]
|
|
1534
|
-
|
|
1535
|
-
## Step 5: Positioning Matrix
|
|
1536
|
-
Help the user define a 2D positioning matrix:
|
|
1537
|
-
- Ask: "What are the two most important dimensions in your market?" (e.g., price vs. features, simplicity vs. power, general vs. specialized)
|
|
1538
|
-
- Define axes with labels
|
|
1539
|
-
- Score each competitor (0-100) on both axes
|
|
1540
|
-
- Score the user's business position
|
|
1541
|
-
|
|
1542
|
-
Save positioning: \`business_model_update\` op: "set_positioning", positioning: { xAxis: "Domain Specialization", yAxis: "Multi-Agent Capability", xLow: "General", xHigh: "Specialized", yLow: "Single", yHigh: "Multi-Agent", selfX: 85, selfY: 90 }
|
|
1543
|
-
|
|
1544
|
-
Then update each competitor with position: \`business_model_update\` op: "competitor_update", competitor_id: "...", updates: { positionX: 30, positionY: 70 }
|
|
1545
|
-
|
|
1546
|
-
This generates a visual positioning chart in the Business Model Viewer.
|
|
1547
|
-
|
|
1548
|
-
## Step 6: Generate Work Items
|
|
1549
|
-
Create work items for:
|
|
1550
|
-
- "Deep-dive: [competitor name]" for competitors needing more research (type: Research)
|
|
1551
|
-
- "Validate advantage: [advantage]" for unproven competitive claims (type: Research)
|
|
1552
|
-
|
|
1553
|
-
## Rules
|
|
1554
|
-
- "We have no competitors" is always wrong — there's always an alternative (even doing nothing)
|
|
1555
|
-
- Be honest about competitor strengths — investors will know
|
|
1556
|
-
- Focus on defensible advantages, not features that can be copied
|
|
1557
|
-
- Include both current competitors and potential future entrants`,
|
|
1558
|
-
tags: ['business', 'analysis', 'competition'],
|
|
1559
|
-
});
|
|
1560
|
-
export const financialModelSkill = defineSkill({
|
|
1561
|
-
name: 'financial-model',
|
|
1562
|
-
description: 'Build revenue forecasts, cost structure, and break-even analysis',
|
|
1563
|
-
prompt: `You are in FINANCIAL MODEL MODE. Help the user build financial projections.
|
|
1564
|
-
|
|
1565
|
-
## Step 1: Assess Current State
|
|
1566
|
-
1. Use \`business_model_get\` with scope: "financials" for existing projections
|
|
1567
|
-
2. Use \`business_model_get\` with scope: "canvas" for revenue streams and cost structure
|
|
1568
|
-
3. Use \`business_model_get\` with scope: "overview" for business context
|
|
1569
|
-
|
|
1570
|
-
## Step 2: Define Revenue Streams
|
|
1571
|
-
For each revenue stream (if not already defined):
|
|
1572
|
-
- Name, type (subscription, one-time, usage, etc.)
|
|
1573
|
-
- Projected revenue
|
|
1574
|
-
Save: \`business_model_update\` op: "revenue_stream_add"
|
|
1575
|
-
|
|
1576
|
-
## Step 3: Build Revenue Forecasts
|
|
1577
|
-
For each revenue stream, guide through assumptions:
|
|
1578
|
-
- Number of customers per period
|
|
1579
|
-
- Average revenue per customer
|
|
1580
|
-
- Growth rate
|
|
1581
|
-
- Seasonality or ramp-up time
|
|
1582
|
-
|
|
1583
|
-
Save forecasts: \`business_model_update\` op: "forecast_add", financials_field: { type: "revenue", period, category, amount }
|
|
1584
|
-
|
|
1585
|
-
Use realistic time horizons:
|
|
1586
|
-
- Startup: monthly for Year 1, quarterly for Years 2-3
|
|
1587
|
-
- Growth stage: quarterly for 3 years
|
|
1588
|
-
- Established: yearly for 5 years
|
|
1589
|
-
|
|
1590
|
-
## Step 4: Define Cost Structure
|
|
1591
|
-
Guide through expense categories:
|
|
1592
|
-
- **Fixed costs**: salaries, rent, subscriptions, insurance
|
|
1593
|
-
- **Variable costs**: hosting, transaction fees, marketing spend (scales with revenue)
|
|
1594
|
-
|
|
1595
|
-
Save each: \`business_model_update\` op: "cost_item_add"
|
|
1596
|
-
Save forecasts: \`business_model_update\` op: "forecast_add", financials_field: { type: "expense", period, category, amount }
|
|
1597
|
-
|
|
1598
|
-
## Step 5: Break-Even Analysis
|
|
1599
|
-
Calculate:
|
|
1600
|
-
- Monthly burn rate (total fixed + variable costs)
|
|
1601
|
-
- Monthly revenue at steady state
|
|
1602
|
-
- Break-even point (when cumulative revenue > cumulative costs)
|
|
1603
|
-
|
|
1604
|
-
Save: \`business_model_update\` op: "set_financials_fields", financials_field: { breakEvenPoint: "Month 18", fundingNeeds: "$2M", useOfFunds: "70% product, 20% marketing, 10% ops" }
|
|
1605
|
-
|
|
1606
|
-
## Step 6: Document Assumptions
|
|
1607
|
-
List all key assumptions made:
|
|
1608
|
-
- Customer acquisition rate
|
|
1609
|
-
- Churn rate
|
|
1610
|
-
- Pricing changes
|
|
1611
|
-
- Hiring timeline
|
|
1612
|
-
|
|
1613
|
-
Save: \`business_model_update\` op: "set_financials_fields", financials_field: { assumptions: [...] }
|
|
1614
|
-
|
|
1615
|
-
## Rules
|
|
1616
|
-
- Always state assumptions explicitly — hidden assumptions kill credibility
|
|
1617
|
-
- Use conservative estimates (investors multiply your timeline by 2x)
|
|
1618
|
-
- Revenue should be bottoms-up (customers × price), not top-down (% of TAM)
|
|
1619
|
-
- Include a "what if" scenario: what happens if growth is 50% slower?
|
|
1620
|
-
- Round to meaningful numbers — $1.2M not $1,237,849`,
|
|
1621
|
-
tags: ['business', 'analysis', 'financial'],
|
|
1622
|
-
});
|
|
1623
|
-
export const pitchOutlineSkill = defineSkill({
|
|
1624
|
-
name: 'pitch-outline',
|
|
1625
|
-
description: 'Structure an investor pitch or executive summary from the Business Model',
|
|
1626
|
-
prompt: `You are in PITCH OUTLINE MODE. Help the user create a compelling pitch from their Business Model.
|
|
1627
|
-
|
|
1628
|
-
## Step 1: Assess Readiness
|
|
1629
|
-
1. Use \`business_model_get\` with scope: "full" to review the complete model
|
|
1630
|
-
2. Check completeness: identity, value prop, market, competitors, financials
|
|
1631
|
-
3. If major gaps exist, note them and suggest which skills to run first
|
|
1632
|
-
|
|
1633
|
-
## Step 2: Choose Format
|
|
1634
|
-
Ask the user:
|
|
1635
|
-
- **Elevator pitch** (30 seconds — 3 sentences)
|
|
1636
|
-
- **Executive summary** (1 page — for email/document)
|
|
1637
|
-
- **Pitch deck narrative** (10-12 slides — investor presentation)
|
|
1638
|
-
|
|
1639
|
-
## Step 3: Structure the Pitch
|
|
1640
|
-
For a pitch deck (adapt for other formats):
|
|
1641
|
-
|
|
1642
|
-
1. **Problem** — The pain point (from valueProposition.problem)
|
|
1643
|
-
2. **Solution** — Your approach (from valueProposition.solution)
|
|
1644
|
-
3. **Market** — Size and opportunity (from market TAM/SAM/SOM)
|
|
1645
|
-
4. **Product** — What you've built / will build
|
|
1646
|
-
5. **Business Model** — How you make money (from canvas.revenueStreams)
|
|
1647
|
-
6. **Traction** — What you've achieved so far (milestones, users, revenue)
|
|
1648
|
-
7. **Competition** — Why you win (from competitors + competitiveAdvantages)
|
|
1649
|
-
8. **Team** — Why this team (from team)
|
|
1650
|
-
9. **Financials** — Projections and key metrics (from financials)
|
|
1651
|
-
10. **The Ask** — What you need (from financials.fundingNeeds + useOfFunds)
|
|
1652
|
-
|
|
1653
|
-
## Step 4: Draft the Narrative
|
|
1654
|
-
For each section:
|
|
1655
|
-
- Write 2-3 sentences that tell a story
|
|
1656
|
-
- Lead with the strongest point
|
|
1657
|
-
- Use specific numbers, not vague claims
|
|
1658
|
-
- Save as a project document
|
|
1659
|
-
|
|
1660
|
-
## Step 5: Generate Work Items
|
|
1661
|
-
Create Milestone work items:
|
|
1662
|
-
- "Draft: [section name]" for each pitch section
|
|
1663
|
-
- "Prepare: supporting data" for claims that need evidence
|
|
1664
|
-
|
|
1665
|
-
## Rules
|
|
1666
|
-
- The pitch tells a STORY, not a list of facts
|
|
1667
|
-
- Start with emotion (the problem), end with opportunity (the ask)
|
|
1668
|
-
- Every claim should be backed by data from the Business Model
|
|
1669
|
-
- If financials are weak, lead with market size and traction instead
|
|
1670
|
-
- The ask should be specific: "$X for Y months to achieve Z"`,
|
|
1671
|
-
tags: ['business', 'writing', 'pitch'],
|
|
1672
|
-
});
|
|
1673
|
-
export const businessReviewSkill = defineSkill({
|
|
1674
|
-
name: 'business-review',
|
|
1675
|
-
description: 'Validate the business plan — find gaps, weak assumptions, and missing elements',
|
|
1676
|
-
prompt: `You are in BUSINESS REVIEW MODE. Critically evaluate the business plan like an investor would.
|
|
1677
|
-
|
|
1678
|
-
## Step 1: Load and Assess
|
|
1679
|
-
1. Use \`business_model_get\` with scope: "full" to read everything
|
|
1680
|
-
2. Run \`business_model_validate\` for structural issues
|
|
1681
|
-
|
|
1682
|
-
## Step 2: Completeness Check
|
|
1683
|
-
Score each section (Complete / Partial / Missing):
|
|
1684
|
-
- Identity & Value Proposition
|
|
1685
|
-
- Market Analysis (TAM/SAM/SOM, segments)
|
|
1686
|
-
- Competitive Analysis (competitors, advantages)
|
|
1687
|
-
- Business Model Canvas (revenue, costs, channels, partnerships)
|
|
1688
|
-
- Financial Projections (revenue, expenses, break-even)
|
|
1689
|
-
- Go-to-Market (phases, strategy)
|
|
1690
|
-
- Team
|
|
1691
|
-
|
|
1692
|
-
Present a scorecard: "7/7 complete" or "5/7 — missing Financials and GTM"
|
|
1693
|
-
|
|
1694
|
-
## Step 3: Assumption Audit
|
|
1695
|
-
For each key assumption:
|
|
1696
|
-
- Is it stated explicitly?
|
|
1697
|
-
- Is there evidence supporting it?
|
|
1698
|
-
- What happens if it's wrong?
|
|
1699
|
-
|
|
1700
|
-
Flag assumptions that are:
|
|
1701
|
-
- **Optimistic** — "We'll capture 10% of the market in Year 1" (unlikely for most startups)
|
|
1702
|
-
- **Unvalidated** — claims without data or customer evidence
|
|
1703
|
-
- **Risky** — single points of failure
|
|
1704
|
-
|
|
1705
|
-
## Step 4: Competitive Blind Spots
|
|
1706
|
-
- Are there competitors missing from the analysis?
|
|
1707
|
-
- Are competitive advantages truly defensible?
|
|
1708
|
-
- What would a well-funded competitor do to beat you?
|
|
1709
|
-
- Is the pricing competitive given the alternatives?
|
|
1710
|
-
|
|
1711
|
-
## Step 5: Financial Reality Check
|
|
1712
|
-
- Do revenue projections match the market sizing? (can't project $100M revenue in a $50M SAM)
|
|
1713
|
-
- Is the cost structure realistic? (engineering salaries, cloud costs, marketing spend)
|
|
1714
|
-
- Is the break-even timeline achievable with the stated funding?
|
|
1715
|
-
- What's the burn rate, and how long does the funding last?
|
|
1716
|
-
|
|
1717
|
-
## Step 6: Generate Review Report
|
|
1718
|
-
Structure as:
|
|
1719
|
-
|
|
1720
|
-
### Scorecard
|
|
1721
|
-
Section-by-section completeness
|
|
1722
|
-
|
|
1723
|
-
### Strengths (what's compelling)
|
|
1724
|
-
2-3 strongest elements
|
|
1725
|
-
|
|
1726
|
-
### Critical Issues (must fix)
|
|
1727
|
-
Problems that would stop an investor
|
|
1728
|
-
|
|
1729
|
-
### Major Issues (should fix)
|
|
1730
|
-
Significant weaknesses
|
|
1731
|
-
|
|
1732
|
-
### Recommendations
|
|
1733
|
-
Prioritized action items
|
|
1734
|
-
|
|
1735
|
-
Write report to a project document.
|
|
1736
|
-
|
|
1737
|
-
## Step 7: Create Work Items
|
|
1738
|
-
- Type "Issue" (bug) for critical and major issues
|
|
1739
|
-
- Type "Research" (tech-debt) for unvalidated assumptions
|
|
1740
|
-
- Type "Milestone" (feature) for missing sections
|
|
1741
|
-
|
|
1742
|
-
## Rules
|
|
1743
|
-
- Be constructive but honest — sugar-coating helps nobody
|
|
1744
|
-
- Think like an investor: "Would I put money into this?"
|
|
1745
|
-
- Every issue should have a specific recommendation
|
|
1746
|
-
- Acknowledge what's strong — it builds credibility for the critique
|
|
1747
|
-
- Focus on the 3-5 things that matter most, not a list of 20 nitpicks`,
|
|
1748
|
-
tags: ['business', 'review', 'validation'],
|
|
1749
|
-
});
|
|
1750
|
-
// =============================================================================
|
|
1751
|
-
// Content & Marketing Skills
|
|
1752
|
-
// =============================================================================
|
|
1753
|
-
export const brandSetupSkill = defineSkill({
|
|
1754
|
-
name: 'brand-setup',
|
|
1755
|
-
description: 'Define brand identity, visual guidelines, voice, audience, and content strategy',
|
|
1756
|
-
prompt: `You are in BRAND SETUP MODE. Guide the user through building their Brand Model step by step.
|
|
1757
|
-
|
|
1758
|
-
## Step 1: Brand Identity
|
|
1759
|
-
1. Use \`brand_model_get\` with scope: "overview" to check existing state
|
|
1760
|
-
2. Ask for: brand name, tagline, 2-3 sentence description
|
|
1761
|
-
3. Save: \`brand_model_update\` op: "set_brand_identity"
|
|
1762
|
-
|
|
1763
|
-
## Step 2: Values & Mission
|
|
1764
|
-
Ask for 3-5 core values and an optional mission statement.
|
|
1765
|
-
Save: \`brand_model_update\` op: "set_brand_identity" with values and mission
|
|
1766
|
-
|
|
1767
|
-
## Step 3: Color Palette
|
|
1768
|
-
Ask for brand colors with their roles (primary, secondary, accent, background, text).
|
|
1769
|
-
For each: \`brand_model_update\` op: "add_color", color: { role, name, hex }
|
|
1770
|
-
|
|
1771
|
-
## Step 4: Font Hierarchy
|
|
1772
|
-
Ask what fonts the brand uses. Map to roles: title, subtitle, heading, subheading, body, caption.
|
|
1773
|
-
For each: \`brand_model_update\` op: "add_font", font: { role, family, weight }
|
|
1774
|
-
|
|
1775
|
-
## Step 5: Visual Styles
|
|
1776
|
-
Ask about photography style, graphic/illustration style, icon style.
|
|
1777
|
-
Save each: \`brand_model_update\` op: "set_photography_style" / "set_graphic_style" / "set_icon_style", style_value: "..."
|
|
1778
|
-
|
|
1779
|
-
## Step 6: Brand Voice
|
|
1780
|
-
Ask about:
|
|
1781
|
-
- Tone (formal, casual, playful, authoritative, empathetic, technical, inspirational)
|
|
1782
|
-
- Persona ("a knowledgeable friend who explains without jargon")
|
|
1783
|
-
- Words/phrases to USE and AVOID
|
|
1784
|
-
- 1-3 writing samples that represent the brand voice
|
|
1785
|
-
Save: \`brand_model_update\` op: "set_voice", voice: { tone, persona, doUse, dontUse, writingSamples }
|
|
1786
|
-
|
|
1787
|
-
## Step 7: Audience Personas
|
|
1788
|
-
For each target persona: name, role/title, pain points, platforms they use.
|
|
1789
|
-
Save: \`brand_model_update\` op: "add_persona", persona: { name, role, painPoints, platforms }
|
|
1790
|
-
|
|
1791
|
-
## Step 8: Platforms
|
|
1792
|
-
For each platform: id (linkedin, instagram, twitter, blog, newsletter), formats, cadence, tone adjustment.
|
|
1793
|
-
Save: \`brand_model_update\` op: "add_platform", platform: { id, active: true, formats, postsPerWeek, toneDelta }
|
|
1794
|
-
|
|
1795
|
-
## Step 9: Content Pillars
|
|
1796
|
-
Define 3-5 thematic pillars with example topics and weight %.
|
|
1797
|
-
Save: \`brand_model_update\` op: "add_pillar", pillar: { name, description, exampleTopics, weight }
|
|
1798
|
-
|
|
1799
|
-
## Step 10: Validation
|
|
1800
|
-
Run \`brand_model_validate\` to check completeness. Report gaps and ask if user wants to fill them.
|
|
1801
|
-
|
|
1802
|
-
## Rules
|
|
1803
|
-
- This is INTERACTIVE — ask one section at a time, don't overwhelm
|
|
1804
|
-
- If the user already has brand guidelines, they can paste them and you extract the data
|
|
1805
|
-
- Skip sections the user doesn't have answers for — they can complete later
|
|
1806
|
-
- After each section, confirm what was saved before moving on`,
|
|
1807
|
-
tags: ['content', 'brand', 'setup'],
|
|
1808
|
-
});
|
|
1809
|
-
export const contentStrategySkill = defineSkill({
|
|
1810
|
-
name: 'content-strategy',
|
|
1811
|
-
description: 'Define or refine content pillars and per-platform cadence',
|
|
1812
|
-
prompt: `You are in CONTENT STRATEGY MODE. Help the user plan their content approach.
|
|
1813
|
-
|
|
1814
|
-
## Step 1: Assess
|
|
1815
|
-
1. Use \`brand_model_get\` scope: "strategy" for existing pillars
|
|
1816
|
-
2. Use \`brand_model_get\` scope: "audience" for personas and platforms
|
|
1817
|
-
|
|
1818
|
-
## Step 2: Define/Refine Pillars
|
|
1819
|
-
- What are the 3-5 themes you want to publish about?
|
|
1820
|
-
- For each: name, description, example topics, weight (% of content calendar)
|
|
1821
|
-
- Weights should sum to ~100%
|
|
1822
|
-
|
|
1823
|
-
Save: \`brand_model_update\` op: "add_pillar" or "update_pillar"
|
|
1824
|
-
|
|
1825
|
-
## Step 3: Platform Cadence
|
|
1826
|
-
For each active platform, confirm or set posting frequency.
|
|
1827
|
-
Save: \`brand_model_update\` op: "update_platform", updates: { postsPerWeek }
|
|
1828
|
-
|
|
1829
|
-
## Step 4: Generate Work Items
|
|
1830
|
-
Create initial content piece work items based on pillars and cadence.`,
|
|
1831
|
-
tags: ['content', 'strategy', 'planning'],
|
|
1832
|
-
});
|
|
1833
|
-
export const contentCalendarSkill = defineSkill({
|
|
1834
|
-
name: 'content-calendar',
|
|
1835
|
-
description: 'Generate content piece work items for a specific period',
|
|
1836
|
-
prompt: `You are in CONTENT CALENDAR MODE. Plan content for a specific period.
|
|
1837
|
-
|
|
1838
|
-
## Step 1: Assess
|
|
1839
|
-
1. Read Brand Model: pillars, platforms, cadence
|
|
1840
|
-
2. Ask: "What period? (e.g., next 2 weeks, this month)"
|
|
1841
|
-
|
|
1842
|
-
## Step 2: Generate Calendar
|
|
1843
|
-
- Distribute pieces across pillars per their weights
|
|
1844
|
-
- Respect per-platform cadence (postsPerWeek)
|
|
1845
|
-
- Generate topic ideas for each piece
|
|
1846
|
-
- Balance content types (carousel, article, thread, etc.)
|
|
1847
|
-
|
|
1848
|
-
## Step 3: Create Work Items
|
|
1849
|
-
For each content piece:
|
|
1850
|
-
- Type: "feature" (displayed as "Content Piece")
|
|
1851
|
-
- Title: "[Platform] Topic Title"
|
|
1852
|
-
- Description: pillar, format, key points to cover
|
|
1853
|
-
- Priority: based on timing
|
|
1854
|
-
|
|
1855
|
-
Present the calendar as a table before creating work items.`,
|
|
1856
|
-
tags: ['content', 'calendar', 'planning'],
|
|
1857
|
-
});
|
|
1858
|
-
export const createContentSkill = defineSkill({
|
|
1859
|
-
name: 'create-content',
|
|
1860
|
-
description: 'Write copy and generate visual brief for a content piece',
|
|
1861
|
-
prompt: `You are in CONTENT CREATION MODE. Create a complete content piece.
|
|
1862
|
-
|
|
1863
|
-
## Step 1: Read Context
|
|
1864
|
-
1. \`brand_model_get\` scope: "voice" — tone, persona, do/don't
|
|
1865
|
-
2. \`brand_model_get\` scope: "visual" — colors, fonts, styles
|
|
1866
|
-
3. \`brand_model_get\` scope: "audience" — persona and platform conventions
|
|
1867
|
-
4. Read the work item for topic, platform, format details
|
|
1868
|
-
|
|
1869
|
-
## Step 2: Write Copy
|
|
1870
|
-
Based on the platform and format:
|
|
1871
|
-
- **Headline** — attention-grabbing, on-brand
|
|
1872
|
-
- **Body** — main content, matching brand voice
|
|
1873
|
-
- **CTA** — clear call-to-action
|
|
1874
|
-
- **Hashtags** — platform-appropriate
|
|
1875
|
-
- **Slides** (for carousels) — per-slide heading + body
|
|
1876
|
-
|
|
1877
|
-
## Step 3: Visual Brief
|
|
1878
|
-
Generate a detailed visual brief using Brand Model:
|
|
1879
|
-
- Layout description (format, dimensions)
|
|
1880
|
-
- Color usage (which brand colors where)
|
|
1881
|
-
- Font usage (which font roles for which text)
|
|
1882
|
-
- Image direction (photography style, subject, mood)
|
|
1883
|
-
- Key text elements (text that must appear in the visual)
|
|
1884
|
-
|
|
1885
|
-
## Step 4: Assemble
|
|
1886
|
-
Write everything as structured markdown in the work item description.
|
|
1887
|
-
|
|
1888
|
-
## Rules
|
|
1889
|
-
- ALWAYS read the Brand Model voice section before writing
|
|
1890
|
-
- Never use words from the "don't use" list
|
|
1891
|
-
- Adapt tone per platform (use toneDelta if defined)
|
|
1892
|
-
- The visual brief should be specific enough for a designer to execute`,
|
|
1893
|
-
tags: ['content', 'creation', 'writing'],
|
|
1894
|
-
});
|
|
1895
|
-
export const contentReviewSkill = defineSkill({
|
|
1896
|
-
name: 'content-review',
|
|
1897
|
-
description: 'Review content for voice consistency, brand alignment, and platform conventions',
|
|
1898
|
-
prompt: `You are in CONTENT REVIEW MODE. Review a content piece as the brand's quality gate.
|
|
1899
|
-
|
|
1900
|
-
## Step 1: Read References
|
|
1901
|
-
1. \`brand_model_get\` scope: "voice" — tone, do/don't, persona
|
|
1902
|
-
2. \`brand_model_get\` scope: "visual" — brand visual guidelines
|
|
1903
|
-
3. Read the content piece (work item description)
|
|
1904
|
-
|
|
1905
|
-
## Step 2: Voice Check
|
|
1906
|
-
- Does the tone match the brand persona?
|
|
1907
|
-
- Are any "don't use" words present?
|
|
1908
|
-
- Is the language appropriate for the target platform?
|
|
1909
|
-
|
|
1910
|
-
## Step 3: Brand Alignment Check
|
|
1911
|
-
- Does the visual brief use correct brand colors?
|
|
1912
|
-
- Are font roles assigned correctly?
|
|
1913
|
-
- Does image direction match the photography/graphic style?
|
|
1914
|
-
|
|
1915
|
-
## Step 4: Platform Check
|
|
1916
|
-
- Character limits respected?
|
|
1917
|
-
- Hashtag count appropriate?
|
|
1918
|
-
- Format matches platform best practices?
|
|
1919
|
-
|
|
1920
|
-
## Step 5: Report
|
|
1921
|
-
- List issues found (voice, brand, platform)
|
|
1922
|
-
- Create revision work items for significant issues
|
|
1923
|
-
- If clean, mark as reviewed
|
|
1924
|
-
|
|
1925
|
-
## Rules
|
|
1926
|
-
- Be specific about what's wrong and how to fix it
|
|
1927
|
-
- Reference the Brand Model section that the issue violates
|
|
1928
|
-
- Don't rewrite the content — flag issues for the creator to fix`,
|
|
1929
|
-
tags: ['content', 'review', 'quality'],
|
|
1930
|
-
});
|
|
1931
|
-
// =============================================================================
|
|
1932
|
-
// Aggregate export
|
|
1933
|
-
// =============================================================================
|
|
7
|
+
// Software Development
|
|
8
|
+
export { designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, } from './software-skills.js';
|
|
9
|
+
// Research Paper
|
|
10
|
+
export { outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, } from './research-skills.js';
|
|
11
|
+
// Business Plan
|
|
12
|
+
export { businessVisionSkill, marketAnalysisSkill, competitorAnalysisSkill, financialModelSkill, pitchOutlineSkill, businessReviewSkill, } from './business-skills.js';
|
|
13
|
+
// Content & Marketing
|
|
14
|
+
export { brandSetupSkill, contentStrategySkill, contentCalendarSkill, createContentSkill, contentReviewSkill, } from './content-skills.js';
|
|
15
|
+
// Course / Training
|
|
16
|
+
export { curriculumDesignSkill, lessonPlanSkill, assessmentDesignSkill, courseReviewSkill, } from './course-skills.js';
|
|
17
|
+
// Book
|
|
18
|
+
export { bookOutlineSkill, characterDesignSkill, plotThreadsSkill, sceneBreakdownSkill, bookReviewSkill, } from './book-skills.js';
|
|
19
|
+
// Import all for the aggregate array
|
|
20
|
+
import { designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, } from './software-skills.js';
|
|
21
|
+
import { outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, } from './research-skills.js';
|
|
22
|
+
import { businessVisionSkill, marketAnalysisSkill, competitorAnalysisSkill, financialModelSkill, pitchOutlineSkill, businessReviewSkill, } from './business-skills.js';
|
|
23
|
+
import { brandSetupSkill, contentStrategySkill, contentCalendarSkill, createContentSkill, contentReviewSkill, } from './content-skills.js';
|
|
24
|
+
import { curriculumDesignSkill, lessonPlanSkill, assessmentDesignSkill, courseReviewSkill, } from './course-skills.js';
|
|
25
|
+
import { bookOutlineSkill, characterDesignSkill, plotThreadsSkill, sceneBreakdownSkill, bookReviewSkill, } from './book-skills.js';
|
|
1934
26
|
/**
|
|
1935
|
-
* All platform-specific skills (
|
|
1936
|
-
* These skills reference platform tools (backlog, workitems, documents, projects)
|
|
1937
|
-
* and belong in the SDK rather than in generic agent/coding libraries.
|
|
27
|
+
* All platform-specific skills (34 total).
|
|
1938
28
|
*/
|
|
1939
29
|
export const platformSkills = [
|
|
30
|
+
// Software (9)
|
|
1940
31
|
designSkill,
|
|
1941
32
|
sketchSkill,
|
|
1942
33
|
prdSkill,
|
|
@@ -1946,20 +37,34 @@ export const platformSkills = [
|
|
|
1946
37
|
sessionNotesSkill,
|
|
1947
38
|
buildSkill,
|
|
1948
39
|
scaffoldSkill,
|
|
40
|
+
// Research (5)
|
|
1949
41
|
outlineSkill,
|
|
1950
42
|
literatureReviewSkill,
|
|
1951
43
|
draftSectionSkill,
|
|
1952
44
|
peerReviewSkill,
|
|
1953
45
|
researchScaffoldSkill,
|
|
46
|
+
// Business (6)
|
|
1954
47
|
businessVisionSkill,
|
|
1955
48
|
marketAnalysisSkill,
|
|
1956
49
|
competitorAnalysisSkill,
|
|
1957
50
|
financialModelSkill,
|
|
1958
51
|
pitchOutlineSkill,
|
|
1959
52
|
businessReviewSkill,
|
|
53
|
+
// Content (5)
|
|
1960
54
|
brandSetupSkill,
|
|
1961
55
|
contentStrategySkill,
|
|
1962
56
|
contentCalendarSkill,
|
|
1963
57
|
createContentSkill,
|
|
1964
58
|
contentReviewSkill,
|
|
59
|
+
// Course (4)
|
|
60
|
+
curriculumDesignSkill,
|
|
61
|
+
lessonPlanSkill,
|
|
62
|
+
assessmentDesignSkill,
|
|
63
|
+
courseReviewSkill,
|
|
64
|
+
// Book (5)
|
|
65
|
+
bookOutlineSkill,
|
|
66
|
+
characterDesignSkill,
|
|
67
|
+
plotThreadsSkill,
|
|
68
|
+
sceneBreakdownSkill,
|
|
69
|
+
bookReviewSkill,
|
|
1965
70
|
];
|