@farazirfan/costar-server-executor 1.7.17 โ†’ 1.7.20

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 (38) hide show
  1. package/dist/agent/pi-embedded-runner/system-prompt.d.ts.map +1 -1
  2. package/dist/agent/pi-embedded-runner/system-prompt.js +11 -24
  3. package/dist/agent/pi-embedded-runner/system-prompt.js.map +1 -1
  4. package/dist/cli/skill-cmd.d.ts.map +1 -1
  5. package/dist/cli/skill-cmd.js +6 -2
  6. package/dist/cli/skill-cmd.js.map +1 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +9 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/server.d.ts.map +1 -1
  11. package/dist/server.js +19 -1
  12. package/dist/server.js.map +1 -1
  13. package/dist/skills/index.d.ts +1 -0
  14. package/dist/skills/index.d.ts.map +1 -1
  15. package/dist/skills/index.js +2 -0
  16. package/dist/skills/index.js.map +1 -1
  17. package/dist/skills/sync.d.ts +29 -0
  18. package/dist/skills/sync.d.ts.map +1 -0
  19. package/dist/skills/sync.js +107 -0
  20. package/dist/skills/sync.js.map +1 -0
  21. package/dist/workspace/templates.d.ts +1 -1
  22. package/dist/workspace/templates.d.ts.map +1 -1
  23. package/dist/workspace/templates.js +23 -0
  24. package/dist/workspace/templates.js.map +1 -1
  25. package/package.json +1 -1
  26. package/skills/trading/LEARNING.md +171 -0
  27. package/skills/trading/SKILL.md +244 -0
  28. package/skills/trading/references/crypto.md +74 -0
  29. package/skills/trading/references/forex.md +75 -0
  30. package/skills/trading/references/metals.md +54 -0
  31. package/skills/trading/references/risk-management.md +74 -0
  32. package/skills/trading/references/stocks.md +74 -0
  33. package/skills/trading/references/strategies.md +98 -0
  34. package/skills/trading/scripts/position-sizer.py +125 -0
  35. package/skills/commit/SKILL.md +0 -69
  36. package/skills/review-pr/SKILL.md +0 -105
  37. package/skills/skill-creator/SKILL.md +0 -236
  38. package/skills/test/SKILL.md +0 -57
@@ -1,236 +0,0 @@
1
- ---
2
- name: skill-creator
3
- description: "Create new skills for the CoStar agent. Use when the user wants to add a new reusable capability, automate a workflow, or improve the agent's abilities. Also use when the agent identifies a repeating pattern that should be turned into a skill."
4
- metadata:
5
- emoji: "๐Ÿ› ๏ธ"
6
- always: true
7
- skillKey: skill-creator
8
- ---
9
-
10
- # Skill Creator
11
-
12
- You can create new skills to extend your own capabilities. Skills are modular, reusable instructions that teach you how to handle specific tasks.
13
-
14
- ## What is a Skill?
15
-
16
- A skill is a directory containing a `SKILL.md` file with:
17
- 1. **YAML frontmatter** - metadata (name, description, requirements)
18
- 2. **Markdown body** - detailed instructions for the agent to follow
19
-
20
- Skills can also include:
21
- - `scripts/` - executable scripts (Python, Bash, etc.)
22
- - `references/` - documentation files to load into context
23
- - `assets/` - templates, configs, or other files
24
-
25
- ## Skill Locations
26
-
27
- Skills can be installed in three places:
28
-
29
- | Location | Path | Scope |
30
- |----------|------|-------|
31
- | **Workspace** | `<workspace>/skills/<name>/` | This agent only |
32
- | **Managed** | `~/.costar/skills/<name>/` | All agents on this machine |
33
- | **Bundled** | Shipped with the package | All installations |
34
-
35
- **Recommendation**: Create skills in the **workspace** (`skills/` subdirectory) for user-specific skills, or in **managed** (`~/.costar/skills/`) for skills that should persist across workspace resets.
36
-
37
- ## Creating a New Skill
38
-
39
- ### Step 1: Plan the Skill
40
-
41
- Before creating, consider:
42
- - **What task does it automate?** Be specific.
43
- - **What tools/commands does it need?** List required binaries, APIs, or env vars.
44
- - **Is it reusable?** Skills should handle a class of tasks, not one-off actions.
45
- - **What scripts or references would help?** Think about helper scripts.
46
-
47
- ### Step 2: Create the Directory Structure
48
-
49
- ```bash
50
- # For workspace skills:
51
- mkdir -p <workspace>/skills/<skill-name>
52
-
53
- # For managed skills (shared):
54
- mkdir -p ~/.costar/skills/<skill-name>
55
- ```
56
-
57
- ### Step 3: Write SKILL.md
58
-
59
- Create `SKILL.md` with this template:
60
-
61
- ```markdown
62
- ---
63
- name: my-skill-name
64
- description: "Clear, one-line description of what this skill does and when to use it."
65
- metadata:
66
- emoji: "๐Ÿ”ง"
67
- requires:
68
- bins: ["required-binary"]
69
- env: ["REQUIRED_ENV_VAR"]
70
- install:
71
- - kind: brew
72
- formula: required-binary
73
- - kind: npm
74
- package: required-package
75
- ---
76
-
77
- # Skill Name
78
-
79
- ## Overview
80
- Brief explanation of what this skill does.
81
-
82
- ## Instructions
83
- Step-by-step instructions for the agent to follow when this skill is activated.
84
-
85
- ### Step 1: ...
86
- ### Step 2: ...
87
-
88
- ## Examples
89
- Show example inputs and expected outputs.
90
-
91
- ## Notes
92
- Any caveats, edge cases, or important considerations.
93
- ```
94
-
95
- ### Step 4: Add Resources (Optional)
96
-
97
- ```
98
- my-skill/
99
- โ”œโ”€โ”€ SKILL.md
100
- โ”œโ”€โ”€ scripts/
101
- โ”‚ โ”œโ”€โ”€ helper.py # Helper scripts
102
- โ”‚ โ””โ”€โ”€ setup.sh # Setup script
103
- โ”œโ”€โ”€ references/
104
- โ”‚ โ””โ”€โ”€ api-docs.md # Reference documentation
105
- โ””โ”€โ”€ assets/
106
- โ””โ”€โ”€ template.json # Template files
107
- ```
108
-
109
- ### Step 5: Validate
110
-
111
- After creating the skill:
112
- 1. Check it appears in the skills list (the agent will see it on next turn)
113
- 2. Test it by asking the agent to use it
114
- 3. Iterate on the instructions based on results
115
-
116
- ## YAML Frontmatter Reference
117
-
118
- ### Required Fields
119
-
120
- | Field | Type | Description |
121
- |-------|------|-------------|
122
- | `name` | string | Unique skill identifier (lowercase, hyphens) |
123
- | `description` | string | When to use this skill (shown to agent) |
124
-
125
- ### Optional Metadata Fields
126
-
127
- | Field | Type | Description |
128
- |-------|------|-------------|
129
- | `emoji` | string | Display emoji |
130
- | `always` | boolean | Always load (skip requirement checks) |
131
- | `skillKey` | string | Config key override |
132
- | `primaryEnv` | string | Primary API key env var |
133
- | `os` | string[] | Supported OS: `["darwin", "linux"]` |
134
- | `requires.bins` | string[] | Required binaries (all must exist) |
135
- | `requires.anyBins` | string[] | Required binaries (at least one) |
136
- | `requires.env` | string[] | Required environment variables |
137
- | `install` | array | Installation specs |
138
-
139
- ### Install Specs
140
-
141
- ```yaml
142
- install:
143
- - kind: brew # macOS Homebrew
144
- formula: package-name
145
- - kind: npm # Node.js package
146
- package: package-name
147
- - kind: apt # Debian/Ubuntu package
148
- package: package-name
149
- - kind: download # Direct download
150
- url: https://...
151
- bins: ["binary-name"]
152
- ```
153
-
154
- ## Self-Improvement Guidelines
155
-
156
- When you notice a repeating pattern or workflow that could benefit from a skill:
157
-
158
- 1. **Identify the pattern** - What steps are repeated? What's the common input/output?
159
- 2. **Abstract it** - Generalize specific details into parameters
160
- 3. **Create the skill** - Write clear, reusable instructions
161
- 4. **Save it** - Put it in the workspace or managed skills directory
162
- 5. **Announce it** - Tell the user you've created a new skill
163
-
164
- ### Good Candidates for Skills
165
- - Multi-step workflows you've done more than twice
166
- - Complex tool chains (e.g., "search web โ†’ summarize โ†’ email results")
167
- - Domain-specific knowledge (e.g., "deploy to production checklist")
168
- - User-specific preferences (e.g., "format reports the way I like them")
169
-
170
- ### Bad Candidates for Skills
171
- - One-off tasks
172
- - Simple single-tool operations
173
- - Tasks that change significantly each time
174
-
175
- ## Examples of Well-Written Skills
176
-
177
- ### Example: Daily Briefing Skill
178
-
179
- ```markdown
180
- ---
181
- name: daily-briefing
182
- description: "Compile and send a daily briefing with calendar events, important emails, and task updates."
183
- metadata:
184
- emoji: "๐Ÿ“‹"
185
- requires:
186
- env: ["GOOGLE_SERVICE_ACCOUNT_JSON"]
187
- ---
188
-
189
- # Daily Briefing
190
-
191
- ## Instructions
192
- 1. Get today's calendar events using get_calendar_events
193
- 2. Search for unread important emails using search_emails
194
- 3. Check pending cron jobs using cron tool status
195
- 4. Compile into a concise briefing
196
- 5. Send via message tool to the user
197
-
198
- ## Format
199
- Subject: Daily Briefing - {date}
200
-
201
- ๐Ÿ“… Calendar:
202
- - {event1}
203
- - {event2}
204
-
205
- ๐Ÿ“ง Important Emails:
206
- - {email1}
207
- - {email2}
208
-
209
- โœ… Tasks:
210
- - {task1}
211
- ```
212
-
213
- ### Example: Code Review Skill
214
-
215
- ```markdown
216
- ---
217
- name: code-review
218
- description: "Review code changes for bugs, style issues, and improvements."
219
- metadata:
220
- emoji: "๐Ÿ”"
221
- requires:
222
- bins: ["git"]
223
- ---
224
-
225
- # Code Review
226
-
227
- ## Instructions
228
- 1. Run `git diff` to see changes
229
- 2. Analyze each file for:
230
- - Bugs or logic errors
231
- - Style inconsistencies
232
- - Missing error handling
233
- - Security issues
234
- 3. Provide structured feedback with severity levels
235
- 4. Suggest specific improvements with code examples
236
- ```
@@ -1,57 +0,0 @@
1
- ---
2
- name: test
3
- description: Run tests using common testing frameworks (vitest, jest, npm test). Verify code quality before committing.
4
- metadata:
5
- emoji: "๐Ÿงช"
6
- requires:
7
- anyBins: ["npm", "pnpm", "yarn", "bun"]
8
- ---
9
-
10
- # Test Skill
11
-
12
- Run tests and verify code quality.
13
-
14
- ## Running Tests
15
-
16
- **All tests:**
17
- ```bash
18
- npm test
19
- ```
20
-
21
- **Watch mode:**
22
- ```bash
23
- npm test -- --watch
24
- ```
25
-
26
- **Single file:**
27
- ```bash
28
- npm test -- path/to/test.ts
29
- ```
30
-
31
- **Coverage:**
32
- ```bash
33
- npm test -- --coverage
34
- ```
35
-
36
- ## Best Practices
37
-
38
- 1. **Run tests before committing**: Always verify tests pass
39
- 2. **Write tests for new features**: Cover new code paths
40
- 3. **Fix failing tests first**: Don't commit broken tests
41
- 4. **Check coverage**: Aim for good test coverage on critical paths
42
- 5. **Watch mode during development**: Use `--watch` for faster feedback
43
-
44
- ## Common Testing Patterns
45
-
46
- **Unit tests**: Test individual functions/modules in isolation
47
-
48
- **Integration tests**: Test components working together
49
-
50
- **E2E tests**: Test full user workflows
51
-
52
- ## Tips
53
-
54
- - Run specific test suites: `npm test -- --grep "pattern"`
55
- - Update snapshots: `npm test -- --update` (use carefully)
56
- - Verbose output: `npm test -- --verbose`
57
- - Parallel execution: Most frameworks run tests in parallel by default