@compilr-dev/sdk 0.5.5 → 0.5.6

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, } from './skills/index.js';
64
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, } 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, } from './skills/index.js';
142
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, } from './skills/index.js';
143
143
  // =============================================================================
144
144
  // Contextual Actions (skill invocations with context)
145
145
  // =============================================================================
@@ -154,7 +154,7 @@ 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', 'session-notes'],
157
+ projectActions: ['outline', 'literature-review', 'session-notes'],
158
158
  workItemActions: ['explain'],
159
159
  workItemLabels: {
160
160
  feature: { short: 'SC', full: 'Section' },
@@ -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, } from './platform-skills.js';
4
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, } 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, } from './platform-skills.js';
4
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, } from './platform-skills.js';
@@ -18,8 +18,9 @@ export declare const sessionNotesSkill: Skill;
18
18
  export declare const buildSkill: Skill;
19
19
  export declare const scaffoldSkill: Skill;
20
20
  export declare const outlineSkill: Skill;
21
+ export declare const literatureReviewSkill: Skill;
21
22
  /**
22
- * All platform-specific skills (10 total).
23
+ * All platform-specific skills (11 total).
23
24
  * These skills reference platform tools (backlog, workitems, documents, projects)
24
25
  * and belong in the SDK rather than in generic agent/coding libraries.
25
26
  */
@@ -990,11 +990,115 @@ Create one work item per section:
990
990
  ✓ User has reviewed and approved the outline`,
991
991
  tags: ['research', 'planning', 'outline'],
992
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
+ });
993
1097
  // =============================================================================
994
1098
  // Aggregate export
995
1099
  // =============================================================================
996
1100
  /**
997
- * All platform-specific skills (10 total).
1101
+ * All platform-specific skills (11 total).
998
1102
  * These skills reference platform tools (backlog, workitems, documents, projects)
999
1103
  * and belong in the SDK rather than in generic agent/coding libraries.
1000
1104
  */
@@ -1009,4 +1113,5 @@ export const platformSkills = [
1009
1113
  buildSkill,
1010
1114
  scaffoldSkill,
1011
1115
  outlineSkill,
1116
+ literatureReviewSkill,
1012
1117
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",