← スキル一覧に戻る

run-stata
by sam-barnett
Replication package for "Falling Rates and Rising Superstars"
⭐ 0🍴 0📅 2026年1月8日
SKILL.md
name: run-stata description: Run Stata code by copying it into tempdo.do and executing the file. Use this when the user wants to run Stata code, test a figure, execute a do-file section, or run regressions. This workaround ensures graphs display correctly and multi-line commands with /// work properly.
Running Stata Code
Overview
This skill runs Stata code by:
- Preserving line 1 of tempdo.do (which sources setup_paths.do)
- Replacing the rest of tempdo.do with the code to run
- Executing tempdo.do as a complete file via Stata MCP
This workaround addresses two Stata MCP limitations:
- Graphs only display when running entire files (not selections)
- Line continuation with
///doesn't work with Run Selection
Instructions
When the user asks you to run Stata code:
-
Read the current tempdo.do to get line 1 (the setup_paths.do include)
- Location:
FRRS_code/src/tempdo.do - Line 1 should be:
do "C:\Users\illge\Princeton Dropbox\Sam Barnett\FRRS_rd2_replication\FRRS_code\src\setup_paths.do"
- Location:
-
Write the new tempdo.do with:
- Line 1: Keep the original setup_paths.do include
- Line 2: Empty line
- Lines 3+: The Stata code the user wants to run
-
Inform the user that tempdo.do has been updated and they should:
- Open tempdo.do in VSCode
- Use Stata MCP's "Run File" command (not Run Selection)
- The graph will appear in the Stata Graphs panel
Example
User asks: "Run Figure 2a from analysis_KLMS.do"
Steps:
- Find Figure 2a code in analysis_KLMS.do (search for "2a" or the figure comment)
- Read tempdo.do line 1
- Write tempdo.do with:
do "C:\Users\illge\Princeton Dropbox\Sam Barnett\FRRS_rd2_replication\FRRS_code\src\setup_paths.do"
*(2a) using mp_klms_U: rolling 6Y
use "$proc_analysis/maintable_data", clear
[... rest of figure code ...]
- Tell user: "Updated tempdo.do with Figure 2a code. Open it and use Run File to execute."
Key Paths
- tempdo.do:
FRRS_code/src/tempdo.do - setup_paths.do:
FRRS_code/src/setup_paths.do - analysis_KLMS.do:
FRRS_code/src/analysis_KLMS.do - data_construction_KLMS.do:
FRRS_code/src/data_construction_KLMS.do
Notes
- Always preserve the setup_paths.do include on line 1
- tempdo.do is in .gitignore so changes won't be committed
- If the user provides code directly, use that; if they reference a figure/table, find it in analysis_KLMS.do
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です