@compilr-dev/sdk 0.5.3 → 0.5.4

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, } from './skills/index.js';
64
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, } 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, } from './skills/index.js';
142
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, } 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: ['session-notes'],
157
+ projectActions: ['outline', '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, } from './platform-skills.js';
4
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, } 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, } from './platform-skills.js';
4
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, } from './platform-skills.js';
@@ -17,8 +17,9 @@ export declare const prdSkill: Skill;
17
17
  export declare const sessionNotesSkill: Skill;
18
18
  export declare const buildSkill: Skill;
19
19
  export declare const scaffoldSkill: Skill;
20
+ export declare const outlineSkill: Skill;
20
21
  /**
21
- * All platform-specific skills (9 total).
22
+ * All platform-specific skills (10 total).
22
23
  * These skills reference platform tools (backlog, workitems, documents, projects)
23
24
  * and belong in the SDK rather than in generic agent/coding libraries.
24
25
  */
@@ -844,10 +844,157 @@ Create both frontend and backend structures:
844
844
  version: '1.0.0',
845
845
  });
846
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
+ // =============================================================================
847
994
  // Aggregate export
848
995
  // =============================================================================
849
996
  /**
850
- * All platform-specific skills (9 total).
997
+ * All platform-specific skills (10 total).
851
998
  * These skills reference platform tools (backlog, workitems, documents, projects)
852
999
  * and belong in the SDK rather than in generic agent/coding libraries.
853
1000
  */
@@ -861,4 +1008,5 @@ export const platformSkills = [
861
1008
  sessionNotesSkill,
862
1009
  buildSkill,
863
1010
  scaffoldSkill,
1011
+ outlineSkill,
864
1012
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",