@farazirfan/costar-server-executor 1.7.16 → 1.7.19
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/agent/pi-embedded-runner/system-prompt.d.ts.map +1 -1
- package/dist/agent/pi-embedded-runner/system-prompt.js +13 -9
- package/dist/agent/pi-embedded-runner/system-prompt.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +11 -0
- package/dist/server.js.map +1 -1
- package/dist/skills/index.d.ts +1 -0
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +2 -0
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/sync.d.ts +29 -0
- package/dist/skills/sync.d.ts.map +1 -0
- package/dist/skills/sync.js +107 -0
- package/dist/skills/sync.js.map +1 -0
- package/dist/workspace/templates.d.ts +1 -1
- package/dist/workspace/templates.d.ts.map +1 -1
- package/dist/workspace/templates.js +23 -0
- package/dist/workspace/templates.js.map +1 -1
- package/package.json +1 -1
- package/skills/trading/LEARNING.md +171 -0
- package/skills/trading/SKILL.md +244 -0
- package/skills/trading/references/crypto.md +74 -0
- package/skills/trading/references/forex.md +75 -0
- package/skills/trading/references/metals.md +54 -0
- package/skills/trading/references/risk-management.md +74 -0
- package/skills/trading/references/stocks.md +74 -0
- package/skills/trading/references/strategies.md +98 -0
- package/skills/trading/scripts/position-sizer.py +125 -0
- package/skills/commit/SKILL.md +0 -69
- package/skills/review-pr/SKILL.md +0 -105
- package/skills/skill-creator/SKILL.md +0 -236
- package/skills/test/SKILL.md +0 -57
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Stocks Trading Reference
|
|
2
|
+
|
|
3
|
+
> **This file is agent-editable.** Update it as you learn from real trades.
|
|
4
|
+
|
|
5
|
+
## Market Characteristics
|
|
6
|
+
|
|
7
|
+
- Regular hours: NYSE/NASDAQ 9:30-16:00 ET, Mon-Fri
|
|
8
|
+
- Pre-market 4:00-9:30 ET, After-hours 16:00-20:00 ET
|
|
9
|
+
- Fundamentals + sentiment drive price
|
|
10
|
+
- Index moves (SPY/QQQ) drag individual stocks
|
|
11
|
+
- Sector rotation is a major theme
|
|
12
|
+
|
|
13
|
+
## Key Indices
|
|
14
|
+
|
|
15
|
+
| Index | Tracks | Signal |
|
|
16
|
+
|-------|--------|--------|
|
|
17
|
+
| SPY | S&P 500 large-cap | Broad market health |
|
|
18
|
+
| QQQ | NASDAQ 100 tech | Growth/tech sentiment |
|
|
19
|
+
| IWM | Russell 2000 small-cap | Risk appetite |
|
|
20
|
+
| VIX | Implied volatility | Fear gauge (> 25 = fear) |
|
|
21
|
+
|
|
22
|
+
## Data to Fetch via APIs
|
|
23
|
+
|
|
24
|
+
Your FMP APIs give you massive edge here:
|
|
25
|
+
- **Stock quotes**: real-time, after-hours, batch
|
|
26
|
+
- **Historical prices**: EOD and intraday (1min-4hr)
|
|
27
|
+
- **Technical indicators**: SMA, EMA, RSI, MACD, Williams, ADX from API directly
|
|
28
|
+
- **Fundamentals**: Income statements, balance sheets, key metrics, financial scores
|
|
29
|
+
- **Earnings**: Calendar, estimates, transcripts, surprises
|
|
30
|
+
- **Analyst data**: Ratings, price targets, grades, consensus
|
|
31
|
+
- **Institutional**: 13F filings, insider trades, fund holdings
|
|
32
|
+
- **Market breadth**: Sector performance, gainers/losers, most active
|
|
33
|
+
- **Screener**: Filter by 100+ criteria
|
|
34
|
+
- **News**: Stock-specific news, press releases
|
|
35
|
+
|
|
36
|
+
## Key Signals
|
|
37
|
+
|
|
38
|
+
### Market Internals
|
|
39
|
+
- Advance/Decline: more advancing = healthy rally
|
|
40
|
+
- % above 200 SMA: > 60% bullish, < 40% bearish
|
|
41
|
+
- VIX term structure: contango = complacent, backwardation = panic
|
|
42
|
+
|
|
43
|
+
### Sector Rotation Cycle
|
|
44
|
+
- Early expansion: tech, consumer discretionary
|
|
45
|
+
- Mid: industrials, materials
|
|
46
|
+
- Late: energy, staples
|
|
47
|
+
- Recession: utilities, healthcare
|
|
48
|
+
|
|
49
|
+
### Earnings
|
|
50
|
+
- Guidance matters more than results
|
|
51
|
+
- Pre-earnings: IV rises, range-bound
|
|
52
|
+
- Post-earnings: gap based on beat/miss vs expectations
|
|
53
|
+
|
|
54
|
+
## Stock-Specific Strategies
|
|
55
|
+
|
|
56
|
+
### Relative Strength
|
|
57
|
+
- Buy stocks outperforming sector AND SPY on pullbacks to 20 EMA
|
|
58
|
+
|
|
59
|
+
### Gap and Go
|
|
60
|
+
- Pre-market gaps > 3% on volume → trade first candle break
|
|
61
|
+
|
|
62
|
+
### ETF Sector Rotation
|
|
63
|
+
- Buy top 2-3 sectors by relative performance, avoid bottom 2-3
|
|
64
|
+
|
|
65
|
+
## Risk Rules (Stock-Specific)
|
|
66
|
+
|
|
67
|
+
- No single stock > 5% of portfolio
|
|
68
|
+
- Cut size 50% before earnings
|
|
69
|
+
- PDT rule: < $25K = max 3 day trades per 5 days
|
|
70
|
+
- Avoid penny stocks under $5
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
*Last updated: Initial version. Agent should update after real stock trades.*
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Trading Strategies Reference
|
|
2
|
+
|
|
3
|
+
> **This file is agent-editable.** Add new strategies you discover, refine existing ones based on performance, mark declining strategies.
|
|
4
|
+
|
|
5
|
+
## Strategy Selection
|
|
6
|
+
|
|
7
|
+
| Timeframe | Trending | Ranging | High Volatility |
|
|
8
|
+
|-----------|----------|---------|-----------------|
|
|
9
|
+
| Scalp (min) | Momentum scalp | Range scalp | Avoid |
|
|
10
|
+
| Day (hours) | Breakout, trend-follow | Mean reversion, VWAP | News fade |
|
|
11
|
+
| Swing (days) | Momentum, breakout | S/R bounce | Vol contraction |
|
|
12
|
+
| Position (weeks) | Trend-follow, macro | Accumulation | Hedged |
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Day Trading
|
|
17
|
+
|
|
18
|
+
### Breakout
|
|
19
|
+
- Consolidation → volume spike > 2x on break → enter on candle CLOSE
|
|
20
|
+
- Stop below range, target = measured move (range height)
|
|
21
|
+
|
|
22
|
+
### VWAP Mean Reversion
|
|
23
|
+
- Extended deviation from VWAP → reversion entry with RSI divergence
|
|
24
|
+
- Avoid strong trending days
|
|
25
|
+
|
|
26
|
+
### Opening Range Breakout (ORB)
|
|
27
|
+
- First 15-30 min high/low → trade the break, stop at opposite side
|
|
28
|
+
- Filter: trade in direction of pre-market bias
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Swing Trading
|
|
33
|
+
|
|
34
|
+
### EMA Trend Following
|
|
35
|
+
- Price > 20 > 50 > 200 EMA → buy pullback to 20 EMA
|
|
36
|
+
- Stop below 50 EMA, target previous high or 2-3x risk, hold 3-15 days
|
|
37
|
+
|
|
38
|
+
### Support/Resistance Bounce
|
|
39
|
+
- Bounce at S/R with candlestick confirmation, stop 0.5-1% beyond level
|
|
40
|
+
|
|
41
|
+
### Fibonacci Retracement
|
|
42
|
+
- Key levels: 38.2%, 50%, 61.8% — enter at confluence with S/R + EMA
|
|
43
|
+
- Stop below 78.6%
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Momentum
|
|
48
|
+
|
|
49
|
+
### Relative Strength
|
|
50
|
+
- Buy top 20% RS ranking on pullbacks, exit when RS drops below 50th pctile
|
|
51
|
+
|
|
52
|
+
### MACD Momentum
|
|
53
|
+
- MACD crosses signal + histogram growing + price above EMA → enter
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Mean Reversion
|
|
58
|
+
|
|
59
|
+
### RSI Extreme
|
|
60
|
+
- Long: RSI < 25 crosses back above 30. Short: RSI > 75 crosses below 70
|
|
61
|
+
- Avoid in strong trends
|
|
62
|
+
|
|
63
|
+
### Bollinger Squeeze
|
|
64
|
+
- Bands contract → breakout imminent → trade the direction when bands expand
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Arbitrage
|
|
69
|
+
|
|
70
|
+
### Cross-Exchange (Crypto)
|
|
71
|
+
- Same asset different prices → buy cheap, sell expensive simultaneously
|
|
72
|
+
|
|
73
|
+
### Pairs/Statistical
|
|
74
|
+
- Correlated assets diverge → long underperformer, short outperformer → close on mean reversion
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## News/Events
|
|
79
|
+
|
|
80
|
+
### Scheduled Events
|
|
81
|
+
- Wait 5-15 min post-release, trade new direction after noise settles
|
|
82
|
+
|
|
83
|
+
### Earnings Gap (Stocks)
|
|
84
|
+
- Gap with trend = trade it. Gap against = wait (60%+ fill rate). 0.5% max risk.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Rules
|
|
89
|
+
|
|
90
|
+
1. Max 2 strategies simultaneously on same asset
|
|
91
|
+
2. Strategies must confirm, not contradict
|
|
92
|
+
3. If indicators conflict → stay flat
|
|
93
|
+
4. Track each strategy separately in LEARNING.md
|
|
94
|
+
5. Retire strategies declining over 20+ trades
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
*Last updated: Initial version. Agent should add and refine based on real performance.*
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Position Sizer - Calculate exact position size based on risk parameters.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
python3 scripts/position-sizer.py --account 1000 --risk-pct 1 --entry 50000 --stop 48500
|
|
7
|
+
python3 scripts/position-sizer.py --account 1000 --risk-pct 1 --entry 50000 --stop 48500 --target 53000
|
|
8
|
+
python3 scripts/position-sizer.py --account 1000 --risk-pct 1 --entry 50000 --stop 48500 --leverage 5
|
|
9
|
+
|
|
10
|
+
Output: Position size, dollar risk, units, and trade validation.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import json
|
|
14
|
+
import sys
|
|
15
|
+
import argparse
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def calculate_position(account, risk_pct, entry, stop, target=None, leverage=1):
|
|
19
|
+
"""Calculate position size and trade parameters."""
|
|
20
|
+
# Validate inputs
|
|
21
|
+
if account <= 0:
|
|
22
|
+
return {"error": "Account balance must be positive"}
|
|
23
|
+
if risk_pct <= 0 or risk_pct > 5:
|
|
24
|
+
return {"error": "Risk percentage must be between 0 and 5%"}
|
|
25
|
+
if entry <= 0 or stop <= 0:
|
|
26
|
+
return {"error": "Entry and stop prices must be positive"}
|
|
27
|
+
if entry == stop:
|
|
28
|
+
return {"error": "Entry and stop cannot be the same price"}
|
|
29
|
+
|
|
30
|
+
# Determine direction
|
|
31
|
+
is_long = stop < entry
|
|
32
|
+
direction = "LONG" if is_long else "SHORT"
|
|
33
|
+
|
|
34
|
+
# Calculate risk per unit
|
|
35
|
+
risk_per_unit = abs(entry - stop)
|
|
36
|
+
risk_pct_of_entry = risk_per_unit / entry * 100
|
|
37
|
+
|
|
38
|
+
# Dollar risk
|
|
39
|
+
dollar_risk = account * (risk_pct / 100)
|
|
40
|
+
|
|
41
|
+
# Position size (in units of the asset)
|
|
42
|
+
units = dollar_risk / risk_per_unit
|
|
43
|
+
|
|
44
|
+
# Position value (in dollars)
|
|
45
|
+
position_value = units * entry
|
|
46
|
+
|
|
47
|
+
# Account percentage used
|
|
48
|
+
account_pct_used = position_value / account * 100
|
|
49
|
+
|
|
50
|
+
# With leverage
|
|
51
|
+
margin_required = position_value / leverage
|
|
52
|
+
margin_pct = margin_required / account * 100
|
|
53
|
+
|
|
54
|
+
result = {
|
|
55
|
+
"direction": direction,
|
|
56
|
+
"entry_price": entry,
|
|
57
|
+
"stop_loss": stop,
|
|
58
|
+
"risk_per_unit": round(risk_per_unit, 6),
|
|
59
|
+
"risk_pct_of_entry": round(risk_pct_of_entry, 2),
|
|
60
|
+
"dollar_risk": round(dollar_risk, 2),
|
|
61
|
+
"units": round(units, 8),
|
|
62
|
+
"position_value": round(position_value, 2),
|
|
63
|
+
"account_pct_used": round(account_pct_used, 2),
|
|
64
|
+
"leverage": leverage,
|
|
65
|
+
"margin_required": round(margin_required, 2),
|
|
66
|
+
"margin_pct_of_account": round(margin_pct, 2),
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
# Take-profit analysis
|
|
70
|
+
if target:
|
|
71
|
+
reward_per_unit = abs(target - entry)
|
|
72
|
+
reward_dollars = units * reward_per_unit
|
|
73
|
+
rr_ratio = reward_per_unit / risk_per_unit
|
|
74
|
+
|
|
75
|
+
result["take_profit"] = target
|
|
76
|
+
result["reward_per_unit"] = round(reward_per_unit, 6)
|
|
77
|
+
result["reward_dollars"] = round(reward_dollars, 2)
|
|
78
|
+
result["risk_reward_ratio"] = round(rr_ratio, 2)
|
|
79
|
+
result["rr_assessment"] = (
|
|
80
|
+
"EXCELLENT" if rr_ratio >= 3 else
|
|
81
|
+
"GOOD" if rr_ratio >= 2 else
|
|
82
|
+
"ACCEPTABLE" if rr_ratio >= 1.5 else
|
|
83
|
+
"POOR - DO NOT TAKE"
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# Breakeven win rate needed
|
|
87
|
+
breakeven_wr = 1 / (1 + rr_ratio) * 100
|
|
88
|
+
result["breakeven_win_rate"] = round(breakeven_wr, 1)
|
|
89
|
+
|
|
90
|
+
# Validation warnings
|
|
91
|
+
warnings = []
|
|
92
|
+
|
|
93
|
+
if risk_pct > 2:
|
|
94
|
+
warnings.append("RISK TOO HIGH: Risking more than 2% per trade. Reduce to 1% or less.")
|
|
95
|
+
if account_pct_used > 30 and leverage == 1:
|
|
96
|
+
warnings.append(f"LARGE POSITION: Using {account_pct_used:.1f}% of account on one trade.")
|
|
97
|
+
if margin_pct > 50:
|
|
98
|
+
warnings.append(f"HIGH MARGIN: Using {margin_pct:.1f}% of account as margin.")
|
|
99
|
+
if leverage > 10:
|
|
100
|
+
warnings.append(f"EXTREME LEVERAGE: {leverage}x leverage is very risky.")
|
|
101
|
+
if target and result.get("risk_reward_ratio", 0) < 2:
|
|
102
|
+
warnings.append(f"LOW R:R: {result['risk_reward_ratio']}:1 is below minimum 2:1 threshold.")
|
|
103
|
+
|
|
104
|
+
result["warnings"] = warnings
|
|
105
|
+
result["trade_approved"] = len([w for w in warnings if "TOO HIGH" in w or "DO NOT TAKE" in w or "EXTREME" in w]) == 0
|
|
106
|
+
|
|
107
|
+
return result
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def main():
|
|
111
|
+
parser = argparse.ArgumentParser(description="Calculate trading position size")
|
|
112
|
+
parser.add_argument("--account", type=float, required=True, help="Account balance in USD")
|
|
113
|
+
parser.add_argument("--risk-pct", type=float, required=True, help="Risk percentage per trade (e.g., 1 for 1%%)")
|
|
114
|
+
parser.add_argument("--entry", type=float, required=True, help="Entry price")
|
|
115
|
+
parser.add_argument("--stop", type=float, required=True, help="Stop-loss price")
|
|
116
|
+
parser.add_argument("--target", type=float, help="Take-profit price (optional)")
|
|
117
|
+
parser.add_argument("--leverage", type=float, default=1, help="Leverage multiplier (default: 1)")
|
|
118
|
+
|
|
119
|
+
args = parser.parse_args()
|
|
120
|
+
result = calculate_position(args.account, args.risk_pct, args.entry, args.stop, args.target, args.leverage)
|
|
121
|
+
print(json.dumps(result, indent=2))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
if __name__ == "__main__":
|
|
125
|
+
main()
|
package/skills/commit/SKILL.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: commit
|
|
3
|
-
description: Create git commits with proper formatting and commit messages. Follows Conventional Commits standard.
|
|
4
|
-
homepage: https://www.conventionalcommits.org/
|
|
5
|
-
metadata:
|
|
6
|
-
emoji: "📝"
|
|
7
|
-
requires:
|
|
8
|
-
bins: ["git"]
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Commit Skill
|
|
12
|
-
|
|
13
|
-
Create well-formatted git commits following best practices.
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
Before committing:
|
|
18
|
-
1. Check git status to see what's changed
|
|
19
|
-
2. Review the diff to understand changes
|
|
20
|
-
3. Stage only related files together
|
|
21
|
-
4. Write clear, concise commit messages
|
|
22
|
-
|
|
23
|
-
## Commit Message Format
|
|
24
|
-
|
|
25
|
-
Follow Conventional Commits:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
<type>(<scope>): <description>
|
|
29
|
-
|
|
30
|
-
[optional body]
|
|
31
|
-
|
|
32
|
-
[optional footer]
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Types:
|
|
36
|
-
- `feat`: New feature
|
|
37
|
-
- `fix`: Bug fix
|
|
38
|
-
- `docs`: Documentation
|
|
39
|
-
- `style`: Formatting (no code change)
|
|
40
|
-
- `refactor`: Code refactoring
|
|
41
|
-
- `test`: Adding tests
|
|
42
|
-
- `chore`: Maintenance
|
|
43
|
-
|
|
44
|
-
## Examples
|
|
45
|
-
|
|
46
|
-
Simple commit:
|
|
47
|
-
```bash
|
|
48
|
-
git add src/tools/new-tool.ts
|
|
49
|
-
git commit -m "feat(tools): add new-tool for API calls"
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Commit with body:
|
|
53
|
-
```bash
|
|
54
|
-
git commit -m "fix(auth): handle expired tokens
|
|
55
|
-
|
|
56
|
-
Tokens are now refreshed automatically when they expire.
|
|
57
|
-
Previously this would cause auth failures.
|
|
58
|
-
|
|
59
|
-
Fixes #123"
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Best Practices
|
|
63
|
-
|
|
64
|
-
1. **Atomic commits**: Each commit should be a single logical change
|
|
65
|
-
2. **Clear messages**: Describe what and why, not how
|
|
66
|
-
3. **Present tense**: "Add feature" not "Added feature"
|
|
67
|
-
4. **Imperative mood**: "Fix bug" not "Fixes bug"
|
|
68
|
-
5. **Reference issues**: Include issue numbers when relevant
|
|
69
|
-
6. **Review before commit**: Always check `git diff --staged`
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: review-pr
|
|
3
|
-
description: Review pull requests using GitHub CLI. Check code changes, CI status, and provide feedback.
|
|
4
|
-
homepage: https://cli.github.com/manual/gh_pr
|
|
5
|
-
metadata:
|
|
6
|
-
emoji: "👀"
|
|
7
|
-
requires:
|
|
8
|
-
bins: ["gh"]
|
|
9
|
-
install:
|
|
10
|
-
- id: brew
|
|
11
|
-
kind: brew
|
|
12
|
-
formula: gh
|
|
13
|
-
bins: ["gh"]
|
|
14
|
-
label: "Install GitHub CLI (brew)"
|
|
15
|
-
- id: apt
|
|
16
|
-
kind: apt
|
|
17
|
-
package: gh
|
|
18
|
-
bins: ["gh"]
|
|
19
|
-
label: "Install GitHub CLI (apt)"
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
# Review PR Skill
|
|
23
|
-
|
|
24
|
-
Review pull requests efficiently using GitHub CLI.
|
|
25
|
-
|
|
26
|
-
## Viewing PRs
|
|
27
|
-
|
|
28
|
-
**List open PRs:**
|
|
29
|
-
```bash
|
|
30
|
-
gh pr list
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**View specific PR:**
|
|
34
|
-
```bash
|
|
35
|
-
gh pr view 123
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
**View PR diff:**
|
|
39
|
-
```bash
|
|
40
|
-
gh pr diff 123
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Checkout PR locally:**
|
|
44
|
-
```bash
|
|
45
|
-
gh pr checkout 123
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Checking CI Status
|
|
49
|
-
|
|
50
|
-
**View checks:**
|
|
51
|
-
```bash
|
|
52
|
-
gh pr checks 123
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**Watch checks (live updates):**
|
|
56
|
-
```bash
|
|
57
|
-
gh pr checks 123 --watch
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Reviewing
|
|
61
|
-
|
|
62
|
-
**View review comments:**
|
|
63
|
-
```bash
|
|
64
|
-
gh pr view 123 --comments
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**Leave review comment:**
|
|
68
|
-
```bash
|
|
69
|
-
gh pr review 123 --comment --body "LGTM!"
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**Request changes:**
|
|
73
|
-
```bash
|
|
74
|
-
gh pr review 123 --request-changes --body "Please fix..."
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
**Approve:**
|
|
78
|
-
```bash
|
|
79
|
-
gh pr review 123 --approve
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Best Practices
|
|
83
|
-
|
|
84
|
-
1. **Check CI first**: Ensure tests pass before detailed review
|
|
85
|
-
2. **Review diff**: Look at `gh pr diff` for context
|
|
86
|
-
3. **Test locally**: Check out the PR if needed
|
|
87
|
-
4. **Constructive feedback**: Be specific and helpful
|
|
88
|
-
5. **Approve or request changes**: Don't leave hanging PRs
|
|
89
|
-
|
|
90
|
-
## Advanced
|
|
91
|
-
|
|
92
|
-
**View specific files:**
|
|
93
|
-
```bash
|
|
94
|
-
gh pr diff 123 --name-only
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
**Check review status:**
|
|
98
|
-
```bash
|
|
99
|
-
gh pr view 123 --json reviewDecision
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**Merge after approval:**
|
|
103
|
-
```bash
|
|
104
|
-
gh pr merge 123 --squash
|
|
105
|
-
```
|
|
@@ -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
|
-
```
|