cyrus-edge-worker 0.0.39 → 0.0.40

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.
Files changed (35) hide show
  1. package/dist/AgentSessionManager.d.ts.map +1 -1
  2. package/dist/AgentSessionManager.js +2 -4
  3. package/dist/AgentSessionManager.js.map +1 -1
  4. package/dist/EdgeWorker.d.ts +75 -3
  5. package/dist/EdgeWorker.d.ts.map +1 -1
  6. package/dist/EdgeWorker.js +496 -151
  7. package/dist/EdgeWorker.js.map +1 -1
  8. package/dist/procedures/ProcedureRouter.d.ts.map +1 -1
  9. package/dist/procedures/ProcedureRouter.js +11 -2
  10. package/dist/procedures/ProcedureRouter.js.map +1 -1
  11. package/dist/procedures/registry.d.ts +29 -0
  12. package/dist/procedures/registry.d.ts.map +1 -1
  13. package/dist/procedures/registry.js +45 -8
  14. package/dist/procedures/registry.js.map +1 -1
  15. package/dist/procedures/types.d.ts +1 -1
  16. package/dist/procedures/types.d.ts.map +1 -1
  17. package/dist/prompt-assembly/types.d.ts +81 -0
  18. package/dist/prompt-assembly/types.d.ts.map +1 -0
  19. package/dist/prompt-assembly/types.js +8 -0
  20. package/dist/prompt-assembly/types.js.map +1 -0
  21. package/dist/prompts/subroutines/coding-activity.md +10 -0
  22. package/dist/prompts/subroutines/concise-summary.md +16 -2
  23. package/dist/prompts/subroutines/debugger-fix.md +8 -25
  24. package/dist/prompts/subroutines/debugger-reproduction.md +11 -44
  25. package/dist/prompts/subroutines/git-gh.md +9 -6
  26. package/dist/prompts/subroutines/plan-summary.md +21 -0
  27. package/dist/prompts/subroutines/preparation.md +16 -0
  28. package/dist/prompts/subroutines/question-answer.md +8 -0
  29. package/dist/prompts/subroutines/question-investigation.md +8 -0
  30. package/dist/prompts/subroutines/verifications.md +9 -6
  31. package/package.json +3 -3
  32. package/prompts/orchestrator.md +9 -1
  33. package/prompts/standard-issue-assigned-user-prompt.md +33 -0
  34. package/prompts/todolist-system-prompt-extension.md +15 -0
  35. package/prompt-template-v2.md +0 -89
@@ -7,7 +7,7 @@
7
7
  export const SUBROUTINES = {
8
8
  primary: {
9
9
  name: "primary",
10
- promptPath: "primary", // Special: resolved via label (debugger/builder/scoper/orchestrator)
10
+ promptPath: "primary", // Special: resolved via label (debugger/builder/scoper/orchestrator) or direct user input
11
11
  description: "Main work execution phase",
12
12
  },
13
13
  debuggerReproduction: {
@@ -51,6 +51,35 @@ export const SUBROUTINES = {
51
51
  description: "Detailed summary with implementation details",
52
52
  suppressThoughtPosting: true,
53
53
  },
54
+ questionInvestigation: {
55
+ name: "question-investigation",
56
+ promptPath: "subroutines/question-investigation.md",
57
+ description: "Gather information needed to answer a question",
58
+ },
59
+ questionAnswer: {
60
+ name: "question-answer",
61
+ promptPath: "subroutines/question-answer.md",
62
+ maxTurns: 1,
63
+ description: "Format final answer to user question",
64
+ suppressThoughtPosting: true,
65
+ },
66
+ codingActivity: {
67
+ name: "coding-activity",
68
+ promptPath: "subroutines/coding-activity.md",
69
+ description: "Implementation phase for code changes (no git/gh operations)",
70
+ },
71
+ preparation: {
72
+ name: "preparation",
73
+ promptPath: "subroutines/preparation.md",
74
+ description: "Analyze request to determine if clarification or planning is needed",
75
+ },
76
+ planSummary: {
77
+ name: "plan-summary",
78
+ promptPath: "subroutines/plan-summary.md",
79
+ maxTurns: 1,
80
+ description: "Present clarifying questions or implementation plan",
81
+ suppressThoughtPosting: true,
82
+ },
54
83
  };
55
84
  /**
56
85
  * Predefined procedure definitions
@@ -59,7 +88,10 @@ export const PROCEDURES = {
59
88
  "simple-question": {
60
89
  name: "simple-question",
61
90
  description: "For questions or requests that don't modify the codebase",
62
- subroutines: [SUBROUTINES.primary, SUBROUTINES.conciseSummary],
91
+ subroutines: [
92
+ SUBROUTINES.questionInvestigation,
93
+ SUBROUTINES.questionAnswer,
94
+ ],
63
95
  },
64
96
  "documentation-edit": {
65
97
  name: "documentation-edit",
@@ -74,28 +106,32 @@ export const PROCEDURES = {
74
106
  name: "full-development",
75
107
  description: "For code changes requiring full verification and PR creation",
76
108
  subroutines: [
77
- SUBROUTINES.primary,
109
+ SUBROUTINES.codingActivity,
78
110
  SUBROUTINES.verifications,
79
111
  SUBROUTINES.gitGh,
80
- SUBROUTINES.verboseSummary,
112
+ SUBROUTINES.conciseSummary,
81
113
  ],
82
114
  },
83
115
  "debugger-full": {
84
116
  name: "debugger-full",
85
- description: "Full debugging workflow with reproduction, approval, fix, and verification",
117
+ description: "Full debugging workflow with reproduction, fix, and verification",
86
118
  subroutines: [
87
119
  SUBROUTINES.debuggerReproduction,
88
- SUBROUTINES.getApproval,
89
120
  SUBROUTINES.debuggerFix,
90
121
  SUBROUTINES.verifications,
91
122
  SUBROUTINES.gitGh,
92
- SUBROUTINES.verboseSummary,
123
+ SUBROUTINES.conciseSummary,
93
124
  ],
94
125
  },
95
126
  "orchestrator-full": {
96
127
  name: "orchestrator-full",
97
128
  description: "Full orchestration workflow with decomposition and delegation to sub-agents",
98
- subroutines: [SUBROUTINES.primary, SUBROUTINES.verboseSummary],
129
+ subroutines: [SUBROUTINES.primary, SUBROUTINES.conciseSummary],
130
+ },
131
+ "plan-mode": {
132
+ name: "plan-mode",
133
+ description: "Planning mode for requests needing clarification or implementation planning",
134
+ subroutines: [SUBROUTINES.preparation, SUBROUTINES.planSummary],
99
135
  },
100
136
  };
101
137
  /**
@@ -105,6 +141,7 @@ export const CLASSIFICATION_TO_PROCEDURE = {
105
141
  question: "simple-question",
106
142
  documentation: "documentation-edit",
107
143
  transient: "simple-question",
144
+ planning: "plan-mode",
108
145
  code: "full-development",
109
146
  debugger: "debugger-full",
110
147
  orchestrator: "orchestrator-full",
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/procedures/registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,OAAO,EAAE;QACR,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,SAAS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AW;YACvB,WAAW,CAAC,aAAa;YACzB,WAAW,CAAC,KAAK;YACjB,WAAW,CAAC,cAAc;SAC1B;KACD;IAED,mBAAmB,EAAE;QACpB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACV,6EAA6E;QAC9E,WAAW,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC;KAC9D;IAED,WAAW,EAAE;QACZ,IAAI,EAAE,WAAW;QACjB,WAAW,EACV,6EAA6E;QAC9E,WAAW,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC;KAC/D;CACD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAGpC;IACH,QAAQ,EAAE,iBAAiB;IAC3B,aAAa,EAAE,oBAAoB;IACnC,SAAS,EAAE,iBAAiB;IAC5B,QAAQ,EAAE,WAAW;IACrB,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,eAAe;IACzB,YAAY,EAAE,mBAAmB;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACxC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC5C,cAAqC;IAErC,OAAO,2BAA2B,CAAC,cAAc,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC"}
@@ -49,7 +49,7 @@ export interface ProcedureMetadata {
49
49
  /**
50
50
  * Request classification types for routing decisions
51
51
  */
52
- export type RequestClassification = "question" | "documentation" | "transient" | "code" | "debugger" | "orchestrator";
52
+ export type RequestClassification = "question" | "documentation" | "transient" | "planning" | "code" | "debugger" | "orchestrator";
53
53
  /**
54
54
  * Result of procedure routing decision
55
55
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","s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S,EAAE,mBAAmB,CAAC;IAE/B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Type definitions for the unified prompt assembly system
3
+ *
4
+ * This module provides a clear, testable interface for assembling prompts
5
+ * with well-defined inputs and outputs.
6
+ */
7
+ import type { Issue as LinearIssue } from "@linear/sdk";
8
+ import type { CyrusAgentSession, LinearWebhookAgentSession, LinearWebhookGuidanceRule, RepositoryConfig } from "cyrus-core";
9
+ /**
10
+ * Output structure from buildPrompt - contains everything needed to start a Claude session
11
+ */
12
+ export interface PromptAssembly {
13
+ /** System prompt for Claude runner configuration (e.g., "builder", "debugger") */
14
+ systemPrompt?: string;
15
+ /** The complete user prompt to send to Claude */
16
+ userPrompt: string;
17
+ /** Metadata about what was assembled (for debugging and testing) */
18
+ metadata: {
19
+ /** List of components included in the prompt */
20
+ components: PromptComponent[];
21
+ /** Name of the subroutine prompt loaded (if any) */
22
+ subroutineName?: string;
23
+ /** Type of prompt builder used */
24
+ promptType: PromptType;
25
+ /** Whether this was a new session */
26
+ isNewSession: boolean;
27
+ /** Whether the session is actively streaming */
28
+ isStreaming: boolean;
29
+ };
30
+ }
31
+ /**
32
+ * Components that can be included in a prompt
33
+ */
34
+ export type PromptComponent = "issue-context" | "subroutine-prompt" | "user-comment" | "attachment-manifest" | "guidance-rules";
35
+ /**
36
+ * Type of prompt builder used
37
+ */
38
+ export type PromptType = "label-based" | "label-based-prompt-command" | "mention" | "fallback" | "continuation";
39
+ /**
40
+ * Input structure for buildPrompt - all information needed to assemble a prompt
41
+ */
42
+ export interface PromptAssemblyInput {
43
+ /** The Cyrus agent session */
44
+ session: CyrusAgentSession;
45
+ /** Full Linear issue details */
46
+ fullIssue: LinearIssue;
47
+ /** Repository configuration */
48
+ repository: RepositoryConfig;
49
+ /** User's comment text (or empty string for initial assignment) */
50
+ userComment: string;
51
+ /** Author of the comment (for multi-player context) */
52
+ commentAuthor?: string;
53
+ /** Timestamp of the comment (for multi-player context) */
54
+ commentTimestamp?: string;
55
+ /** Attachment manifest string (if any attachments) */
56
+ attachmentManifest?: string;
57
+ /** Linear agent guidance rules */
58
+ guidance?: LinearWebhookGuidanceRule[];
59
+ /** Whether this is a new session (vs continuation) */
60
+ isNewSession: boolean;
61
+ /** Whether the Claude runner is actively streaming */
62
+ isStreaming: boolean;
63
+ /** Whether triggered by @mention */
64
+ isMentionTriggered?: boolean;
65
+ /** Whether /label-based-prompt command was used */
66
+ isLabelBasedPromptRequested?: boolean;
67
+ /** Agent session data (for mention-triggered prompts) */
68
+ agentSession?: LinearWebhookAgentSession;
69
+ /** Labels on the issue (for system prompt determination) */
70
+ labels?: string[];
71
+ }
72
+ /**
73
+ * Result from building issue context (intermediate step)
74
+ */
75
+ export interface IssueContextResult {
76
+ /** The assembled issue context prompt */
77
+ prompt: string;
78
+ /** Template version (if using versioned templates) */
79
+ version?: string;
80
+ }
81
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/prompt-assembly/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EACX,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,gBAAgB,EAChB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IAEnB,oEAAoE;IACpE,QAAQ,EAAE;QACT,gDAAgD;QAChD,UAAU,EAAE,eAAe,EAAE,CAAC;QAE9B,oDAAoD;QACpD,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB,kCAAkC;QAClC,UAAU,EAAE,UAAU,CAAC;QAEvB,qCAAqC;QACrC,YAAY,EAAE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itions for the unified prompt assembly system
3
+ *
4
+ * This module provides a clear, testable interface for assembling prompts
5
+ * with well-defined inputs and outputs.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/prompt-assembly/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,10 @@
1
+ # Implementation Phase
2
+
3
+ Implement the requested changes:
4
+ - Write production-ready code
5
+ - Run tests to verify it works
6
+ - Follow existing patterns
7
+
8
+ **Do NOT**: commit, push, or create PRs (next phase handles that)
9
+
10
+ Complete with: `Implementation complete - [what was done].`
@@ -40,10 +40,15 @@ Create a clear, brief summary that covers:
40
40
 
41
41
  [Brief description of what was done]
42
42
 
43
- ## Changes
44
-
43
+ +++Changes Made
45
44
  - [Key change 1]
46
45
  - [Key change 2]
46
+ +++
47
+
48
+ +++Files Modified
49
+ - [File 1]
50
+ - [File 2]
51
+ +++
47
52
 
48
53
  ## Status
49
54
 
@@ -51,3 +56,12 @@ Create a clear, brief summary that covers:
51
56
 
52
57
  [PR link if applicable]
53
58
  ```
59
+
60
+ ## Collapsible Sections
61
+
62
+ **IMPORTANT**: When creating your summary, make the following sections collapsible (collapsed by default):
63
+
64
+ - **"Changes Made"** section - Wrap with `+++Changes Made\n...\n+++`
65
+ - **"Files Modified"** section - Wrap with `+++Files Modified\n...\n+++`
66
+
67
+ This keeps the summary concise while preserving detailed information for those who want to expand and read it.
@@ -4,11 +4,10 @@ You are in the **Bug Fix Implementation Phase** of the debugging workflow.
4
4
 
5
5
  ## Context
6
6
 
7
- The reproduction phase is complete and the user has **approved** proceeding with the fix. You have:
7
+ The reproduction phase is complete. You have:
8
8
 
9
9
  - ✅ A failing test case that reproduces the bug
10
10
  - ✅ Root cause analysis from the reproduction phase
11
- - ✅ Approval to implement the fix
12
11
  - ✅ A proposed fix approach
13
12
 
14
13
  ## Objective
@@ -57,31 +56,15 @@ Task: "check that error messages are clear"
57
56
 
58
57
  ## Output Format
59
58
 
60
- After implementing and verifying your fix, summarize your work:
59
+ **IMPORTANT: Do NOT post Linear comments.** Your output is for internal workflow only.
61
60
 
62
- ```markdown
63
- # Bug Fix Implemented
61
+ After implementing and verifying your fix, provide a brief completion message (1 sentence max):
64
62
 
65
- ## Changes Made
66
- - **File**: [path]
67
- - [Description of changes]
68
- - **File**: [path]
69
- - [Description of changes]
70
-
71
- ## Fix Approach
72
- [Explanation of how the fix addresses the root cause]
73
-
74
- ## Test Results
75
- - ✅ Original failing test now passes
76
- - ✅ Full test suite passes (X/X tests)
77
- - ✅ No regressions detected
78
-
79
- ## Verification
80
- [List of verification steps taken and their results]
81
-
82
- ## Notes
83
- [Any important notes about the fix, potential future improvements, or edge cases to monitor]
84
63
  ```
64
+ Fix implemented in [files] - [brief description of what was fixed].
65
+ ```
66
+
67
+ Example: "Fix implemented in src/auth/session.ts - normalized date comparisons to UTC."
85
68
 
86
69
  ## Critical Constraints
87
70
 
@@ -105,4 +88,4 @@ Your fix should be **production-ready** and **thoroughly tested** at this point.
105
88
 
106
89
  ## Remember
107
90
 
108
- You're implementing an **approved fix** based on a clear root cause analysis. Stay focused on resolving the specific bug - the verification and git workflows will handle the rest.
91
+ You're implementing a fix based on a clear root cause analysis. Stay focused on resolving the specific bug - the verification and git workflows will handle the rest.
@@ -41,66 +41,33 @@ Task: "identify missing validation or error handling"
41
41
 
42
42
  ## Output Format
43
43
 
44
- After completing your investigation, you MUST present your findings in this exact format:
44
+ **IMPORTANT: Do NOT post Linear comments.** Your output is for internal workflow only.
45
45
 
46
- ```markdown
47
- # Bug Reproduction Complete
46
+ After completing your investigation, provide a brief completion message (1 sentence max):
48
47
 
49
- ## Summary
50
- [One paragraph summary of the bug]
51
-
52
- ## Root Cause
53
- [Detailed explanation of what's causing the bug]
54
-
55
- ## Reproduction Steps
56
- 1. [Step 1]
57
- 2. [Step 2]
58
- 3. [Expected vs Actual behavior]
59
-
60
- ## Failing Test Case
61
- - File: [path to test file]
62
- - Test name: [name of failing test]
63
- - Status: ✅ Test created and failing as expected
64
-
65
- ## Impact Assessment
66
- - Severity: [Critical/High/Medium/Low]
67
- - Affected components: [list]
68
- - User impact: [description]
69
-
70
- ## Proposed Fix Approach
71
- [High-level description of how you plan to fix it - do NOT implement yet]
72
-
73
- ---
74
-
75
- **🔴 APPROVAL REQUIRED**
76
-
77
- I have completed the reproduction phase and identified the root cause.
78
-
79
- **Please review the above findings and approve to proceed with implementing the fix.**
80
-
81
- I will wait for your approval before making any code changes.
82
48
  ```
49
+ Reproduction complete - root cause identified in [component/file] and failing test created.
50
+ ```
51
+
52
+ Example: "Reproduction complete - root cause identified in session expiry logic and failing test created."
83
53
 
84
54
  ## Critical Constraints
85
55
 
86
56
  - ❌ **DO NOT implement any fixes** - this is reproduction only
87
57
  - ❌ **DO NOT modify production code** - only test files
88
58
  - ❌ **DO NOT commit or push anything** - that happens in later phases
89
- - ❌ **DO NOT create todos for fixing the issue** - fix planning happens after approval in debugger-fix phase
59
+ - ❌ **DO NOT create todos for fixing the issue** - fix planning happens in debugger-fix phase
90
60
  - ✅ **DO use Task extensively** for all analysis
91
61
  - ✅ **DO create a clear, failing test**
92
62
  - ✅ **DO provide detailed root cause analysis**
93
- - ✅ **DO explicitly request approval** at the end
94
63
  - ✅ **DO use TodoWrite for tracking reproduction/analysis tasks** if helpful (e.g., "Investigate error X", "Create test for Y")
95
64
 
96
65
  ## What Happens Next
97
66
 
98
- After you present your findings and request approval:
67
+ After you present your findings:
99
68
 
100
- 1. The system will pause this subroutine
101
- 2. An **approval elicitation** will be posted to Linear
102
- 3. The user will review and either approve or provide feedback
103
- 4. If approved, the next subroutine (fix implementation) will begin
104
- 5. If feedback is given, you'll incorporate it and re-present
69
+ 1. This subroutine will complete
70
+ 2. The next subroutine (fix implementation) will begin automatically
71
+ 3. You will implement the fix based on your reproduction and analysis
105
72
 
106
73
  **Remember**: Your job is to UNDERSTAND and REPRODUCE the bug, not to fix it yet!
@@ -44,9 +44,12 @@ All verification checks have passed. Now commit your changes and create or updat
44
44
 
45
45
  ## Expected Output
46
46
 
47
- Provide a brief summary of:
48
- - Commit messages used
49
- - Files committed
50
- - PR status (created or updated)
51
- - PR URL
52
- - Any issues encountered during git/gh operations
47
+ **IMPORTANT: Do NOT post Linear comments.** Your output is for internal workflow only.
48
+
49
+ Provide a brief completion message (1 sentence max):
50
+
51
+ ```
52
+ Changes committed and PR [created/updated] at [PR URL].
53
+ ```
54
+
55
+ Example: "Changes committed and PR created at https://github.com/org/repo/pull/123."
@@ -0,0 +1,21 @@
1
+ # Plan Summary
2
+
3
+ Present EITHER your clarifying questions OR your implementation plan:
4
+
5
+ **Format in Linear-compatible markdown:**
6
+ - Use `+++Section Name\n...\n+++` for collapsible sections
7
+ - Use `https://linear.app/linear/profiles/username` for @mentions
8
+ - Be clear and well-structured
9
+
10
+ **If presenting clarifying questions:**
11
+ - List specific questions that need answers
12
+ - Explain why each question is important
13
+ - Suggest possible approaches if helpful
14
+
15
+ **If presenting implementation plan:**
16
+ - Outline the implementation approach
17
+ - List key files/components to modify
18
+ - Note any risks or dependencies
19
+ - Provide estimated complexity if relevant
20
+
21
+ Keep it concise (3-5 paragraphs max).
@@ -0,0 +1,16 @@
1
+ # Preparation Phase
2
+
3
+ Analyze the request to determine if it needs clarification or can be planned:
4
+
5
+ **If unclear requirements:**
6
+ - Identify ambiguities and missing information
7
+ - Formulate specific clarifying questions
8
+ - Prepare questions for Linear posting
9
+
10
+ **If requirements are clear:**
11
+ - Break down the work into steps
12
+ - Identify files/components to modify
13
+ - Consider dependencies and edge cases
14
+ - Prepare implementation plan for Linear posting
15
+
16
+ Complete with: `Preparation complete - [ready to plan/needs clarification].`
@@ -0,0 +1,8 @@
1
+ # Answer Question
2
+
3
+ Provide a clear, direct answer using investigation findings:
4
+ - Present in Linear-compatible markdown (supports `+++collapsible+++`, @mentions via `https://linear.app/linear/profiles/username`)
5
+ - Include code references with line numbers
6
+ - Be complete but concise
7
+
8
+ Don't mention the investigation process - just answer the question.
@@ -0,0 +1,8 @@
1
+ # Investigate Question
2
+
3
+ Gather information to answer the question (DON'T answer yet):
4
+ - Search codebase for relevant files/functions
5
+ - Read necessary files
6
+ - Use tools if needed
7
+
8
+ Complete with: `Investigation complete - gathered information from [sources].`
@@ -38,9 +38,12 @@ You have completed the primary work on this issue. Now perform thorough verifica
38
38
 
39
39
  ## Expected Output
40
40
 
41
- Provide a brief summary of:
42
- - What quality checks you performed
43
- - Test results and coverage
44
- - Any issues found and fixed
45
- - Linting and type checking results
46
- - Confirmation that all verifications passed
41
+ **IMPORTANT: Do NOT post Linear comments.** Your output is for internal workflow only.
42
+
43
+ Provide a brief completion message (1 sentence max):
44
+
45
+ ```
46
+ All verifications passed - [X] tests passing, linting clean, types valid.
47
+ ```
48
+
49
+ Example: "All verifications passed - 47 tests passing, linting clean, types valid."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyrus-edge-worker",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "description": "Unified edge worker for processing Linear issues with Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,9 +19,9 @@
19
19
  "file-type": "^18.7.0",
20
20
  "cyrus-claude-runner": "0.0.31",
21
21
  "cyrus-ndjson-client": "0.0.24",
22
- "cyrus-core": "0.0.19",
23
22
  "cyrus-linear-webhook-client": "0.0.3",
24
- "cyrus-simple-agent-runner": "0.0.2"
23
+ "cyrus-core": "0.0.20",
24
+ "cyrus-simple-agent-runner": "0.0.3"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^20.0.0",
@@ -27,6 +27,7 @@ You are an expert software architect and designer responsible for decomposing co
27
27
  Create sub-issues with:
28
28
  - **Clear title**: `[Type] Specific action and target`
29
29
  - **Parent assignee inheritance**: Use the `assigneeId` from the parent issue context (available as `{{assignee_id}}`) to ensure all sub-issues are assigned to the same person
30
+ - **❌ DO NOT assign yourself (Cyrus) as a delegate**: Never use the `delegate` parameter when creating sub-issues.
30
31
  - **Structured description** (include the exact text template below in the sub-issue description):
31
32
  ```
32
33
  Objective: [What needs to be accomplished]
@@ -164,6 +165,10 @@ Include in every sub-issue:
164
165
 
165
166
  10. **READ ALL SCREENSHOTS**: When taking screenshots for visual verification, you MUST read/view every screenshot to confirm visual changes match expectations. Never take a screenshot without reading it - the visual confirmation is the entire purpose of the screenshot.
166
167
 
168
+ 11. **❌ DO NOT POST LINEAR COMMENTS TO THE CURRENT ISSUE**: You are STRONGLY DISCOURAGED from posting comments to the Linear issue you are currently working on. Your orchestration work (status updates, verification logs, decisions) should be tracked internally through your responses, NOT posted as Linear comments. The ONLY acceptable use of Linear commenting is when preparing to trigger a sub-agent session using `mcp__cyrus-tools__linear_agent_session_create_on_comment` - in that case, create a root comment on a child issue to provide context for the sub-agent, then use the tool to create the session on that comment.
169
+
170
+ 12. **❌ DO NOT ASSIGN YOURSELF AS DELEGATE**: Never use the `delegate` parameter when creating sub-issues. Do not assign Cyrus (yourself) as a delegate to any issues. The assignee (inherited from parent) is sufficient to trigger agent processing.
171
+
167
172
 
168
173
  ## Sub-Issue Creation Checklist
169
174
 
@@ -171,6 +176,7 @@ When creating a sub-issue, verify:
171
176
  - [ ] Agent type label added (`Bug`, `Feature`, `Improvement`, or `PRD`)
172
177
  - [ ] Model selection label evaluated (`sonnet` for simple tasks)
173
178
  - [ ] **Parent assignee inherited** (`assigneeId` parameter set to parent's `{{assignee_id}}`)
179
+ - [ ] **NO delegate assigned** (do not use the `delegate` parameter)
174
180
  - [ ] Clear objective defined
175
181
  - [ ] Acceptance criteria specified
176
182
  - [ ] All necessary context included
@@ -201,7 +207,9 @@ When verification fails:
201
207
 
202
208
  ## State Management
203
209
 
204
- Track in parent issue:
210
+ **IMPORTANT: Track orchestration state in your responses, NOT in Linear comments to the current issue.**
211
+
212
+ Track in your internal responses (not Linear comments):
205
213
  ```markdown
206
214
  ## Orchestration Status
207
215
  **Completed**: [List of merged sub-issues with verification results]
@@ -0,0 +1,33 @@
1
+ <context>
2
+ <repository>{{repository_name}}</repository>
3
+ <working_directory>{{working_directory}}</working_directory>
4
+ <base_branch>{{base_branch}}</base_branch>
5
+ </context>
6
+
7
+ <linear_issue>
8
+ <id>{{issue_id}}</id>
9
+ <identifier>{{issue_identifier}}</identifier>
10
+ <title>{{issue_title}}</title>
11
+ <description>
12
+ {{issue_description}}
13
+ </description>
14
+ <state>{{issue_state}}</state>
15
+ <priority>{{issue_priority}}</priority>
16
+ <url>{{issue_url}}</url>
17
+ </linear_issue>
18
+
19
+ <linear_comments>
20
+ {{comment_threads}}
21
+ </linear_comments>
22
+
23
+ {{#if new_comment}}
24
+ <new_comment_to_address>
25
+ <author>{{new_comment_author}}</author>
26
+ <timestamp>{{new_comment_timestamp}}</timestamp>
27
+ <content>
28
+ {{new_comment_content}}
29
+ </content>
30
+ </new_comment_to_address>
31
+
32
+ IMPORTANT: Focus specifically on addressing the new comment above. This is a new request that requires your attention.
33
+ {{/if}}
@@ -0,0 +1,15 @@
1
+ <task_management_instructions>
2
+ CRITICAL: You MUST use the TodoWrite and TodoRead tools extensively:
3
+ - IMMEDIATELY create a comprehensive task list at the beginning of your work
4
+ - Break down complex tasks into smaller, actionable items
5
+ - Mark tasks as 'in_progress' when you start them
6
+ - Mark tasks as 'completed' immediately after finishing them
7
+ - Only have ONE task 'in_progress' at a time
8
+ - Add new tasks as you discover them during your work
9
+ - Your first response should focus on creating a thorough task breakdown
10
+
11
+ Remember: Your first message is internal planning. Use this time to:
12
+ 1. Thoroughly analyze the issue and requirements
13
+ 2. Create detailed todos using TodoWrite
14
+ 3. Plan your approach systematically
15
+ </task_management_instructions>