@compilr-dev/sdk 0.5.6 → 0.5.7

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 CHANGED
@@ -61,7 +61,7 @@ export type { AskUserQuestion, AskUserInput, AskUserResult, AskUserHandler, AskU
61
61
  export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, ProjectAnchorStore, } from './platform/index.js';
62
62
  export type { ProjectAnchorStoreConfig } from './platform/index.js';
63
63
  export { STEP_ORDER, GUIDED_STEP_CRITERIA, getNextStep, isValidTransition, getStepCriteria, formatStepDisplay, getStepNumber, } from './platform/index.js';
64
- export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, } from './skills/index.js';
64
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, } from './skills/index.js';
65
65
  export { ACTION_REGISTRY, getActionsForContext, getActionById, resolveActionPrompt, buildContextSummary, getSuggestedRole, } from './actions/index.js';
66
66
  export type { ActionContext, ActionDefinition } from './actions/index.js';
67
67
  export { PROJECT_TYPES, getProjectTypeConfig, getProjectTypesByCategory, generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig, } from './project-types/index.js';
package/dist/index.js CHANGED
@@ -139,7 +139,7 @@ export { STEP_ORDER, GUIDED_STEP_CRITERIA, getNextStep, isValidTransition, getSt
139
139
  // =============================================================================
140
140
  // Platform Skills (platform-specific prompt expansions)
141
141
  // =============================================================================
142
- export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, } from './skills/index.js';
142
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, } from './skills/index.js';
143
143
  // =============================================================================
144
144
  // Contextual Actions (skill invocations with context)
145
145
  // =============================================================================
@@ -154,8 +154,8 @@ export const researchConfig = {
154
154
  { type: 'bibliography', label: 'Bibliography', description: 'References and citations' },
155
155
  { type: 'session-notes', label: 'Session Notes', description: 'Summary of work done' },
156
156
  ],
157
- projectActions: ['outline', 'literature-review', 'session-notes'],
158
- workItemActions: ['explain'],
157
+ projectActions: ['outline', 'literature-review', 'draft-section', 'session-notes'],
158
+ workItemActions: ['draft-section', 'explain'],
159
159
  workItemLabels: {
160
160
  feature: { short: 'SC', full: 'Section' },
161
161
  bug: { short: 'RV', full: 'Revision' },
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Platform Skills — barrel export
3
3
  */
4
- export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, } from './platform-skills.js';
4
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, } from './platform-skills.js';
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Platform Skills — barrel export
3
3
  */
4
- export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, } from './platform-skills.js';
4
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, } from './platform-skills.js';
@@ -19,6 +19,7 @@ export declare const buildSkill: Skill;
19
19
  export declare const scaffoldSkill: Skill;
20
20
  export declare const outlineSkill: Skill;
21
21
  export declare const literatureReviewSkill: Skill;
22
+ export declare const draftSectionSkill: Skill;
22
23
  /**
23
24
  * All platform-specific skills (11 total).
24
25
  * These skills reference platform tools (backlog, workitems, documents, projects)
@@ -1094,6 +1094,118 @@ If multiple sources have been analyzed, provide a thematic synthesis:
1094
1094
  ✓ User has reviewed the source-claim mappings`,
1095
1095
  tags: ['research', 'analysis', 'sources'],
1096
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
+ });
1097
1209
  // =============================================================================
1098
1210
  // Aggregate export
1099
1211
  // =============================================================================
@@ -1114,4 +1226,5 @@ export const platformSkills = [
1114
1226
  scaffoldSkill,
1115
1227
  outlineSkill,
1116
1228
  literatureReviewSkill,
1229
+ draftSectionSkill,
1117
1230
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",