diff --git a/cli/src/update.py b/cli/src/update.py index 9f918d7..e9ccae3 100644 --- a/cli/src/update.py +++ b/cli/src/update.py @@ -55,6 +55,8 @@ def update( _reinstall_editable_packages(repo_root) reinstalled = True + _sync_skill_files(repo_root) + print_output( { "repo": str(repo_root), @@ -137,6 +139,17 @@ def _reinstall_editable_packages(repo_root: Path) -> None: ) +def _sync_skill_files(repo_root: Path) -> None: + config_home = Path(os.environ.get("BROKER_CONFIG_HOME", "").strip() or + Path(os.environ.get("XDG_CONFIG_HOME", "").strip() or + Path.home() / ".config") / "broker") + skill_source = repo_root / "skills" / "broker" / "SKILL.md" + skill_target = config_home / "skills" / "broker" / "SKILL.md" + if skill_source.is_file(): + skill_target.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(skill_source, skill_target) + + def _git(repo_root: Path, *args: str) -> str: return _run(["git", *args], cwd=repo_root) diff --git a/install/main.sh b/install/main.sh index ffe245b..10bca2a 100755 --- a/install/main.sh +++ b/install/main.sh @@ -57,7 +57,7 @@ fi # Install-only shared steps (provider-specific dependencies are installed in setup.sh) # 1. Prepare dirs 2. Bootstrap tooling 3. Create config # 4. Python runtime 5. Python packages 6. Link CLI 7. Completions -STEP_TOTAL=7 +STEP_TOTAL=8 # ─── Install ───────────────────────────────────────────────────────────────── @@ -68,6 +68,7 @@ run_step "Creating broker config (${BROKER_CONFIG_JSON})" ensure_broker_config run_step "Creating Python runtime" create_python_runtime run_step "Installing broker Python packages" install_python_packages run_step "Linking broker CLI command" bind_broker_command +run_step "Installing skill files" install_skill_files run_step "Installing shell completions" install_shell_completions # ─── Done ───────────────────────────────────────────────────────────────────── diff --git a/install/steps/summary.sh b/install/steps/summary.sh index 496c5f8..1560f6a 100644 --- a/install/steps/summary.sh +++ b/install/steps/summary.sh @@ -84,6 +84,7 @@ print_summary() { ${BOLD}${GREEN}Broker Install Complete (E*Trade)${RESET} Config: ${BROKER_CONFIG_JSON} +Skill file: ${BROKER_CONFIG_HOME}/skills/broker/SKILL.md Tokens: ${BROKER_CONFIG_HOME}/etrade-tokens.json Fund repo: ${fund_dir:-"(not configured)"} @@ -100,6 +101,7 @@ SUMMARY ${BOLD}${GREEN}Broker Install Complete${RESET} Config: ${BROKER_CONFIG_JSON} +Skill file: ${BROKER_CONFIG_HOME}/skills/broker/SKILL.md Runtime state: ${BROKER_STATE_HOME} Runtime data: ${BROKER_DATA_HOME} Fund repo: ${fund_dir:-"(not configured)"} diff --git a/install/steps/workspace.sh b/install/steps/workspace.sh index a693c1d..ea89a2d 100644 --- a/install/steps/workspace.sh +++ b/install/steps/workspace.sh @@ -6,6 +6,15 @@ prepare_broker_home() { mkdir -p "${BROKER_DATA_HOME}" } +install_skill_files() { + local skill_source="${ROOT_DIR}/skills/broker/SKILL.md" + local skill_target="${BROKER_CONFIG_HOME}/skills/broker/SKILL.md" + if [[ -f "${skill_source}" ]]; then + mkdir -p "$(dirname "${skill_target}")" + cp "${skill_source}" "${skill_target}" + fi +} + ensure_broker_config() { mkdir -p "${BROKER_CONFIG_HOME}" if ! command -v python3 >/dev/null 2>&1; then diff --git a/setup.sh b/setup.sh index 90ac48b..e524ce2 100755 --- a/setup.sh +++ b/setup.sh @@ -113,4 +113,7 @@ configure_fund_repository echo "" echo "${GREEN}✔${RESET} Setup complete." echo "" +echo " Config: ${BROKER_CONFIG_JSON}" +echo " Skill file: ${BROKER_CONFIG_HOME}/skills/broker/SKILL.md" +echo "" echo "${BLUE}→${RESET} Try: ${BOLD}${BLUE}broker daemon start${RESET}" diff --git a/website/app/reference/page.tsx b/website/app/reference/page.tsx index 7515179..e954a9e 100644 --- a/website/app/reference/page.tsx +++ b/website/app/reference/page.tsx @@ -608,6 +608,7 @@ export default function ReferencePage() { {[ ["Config", "~/.config/broker/config.json"], + ["Skill file", "~/.config/broker/skills/broker/SKILL.md"], ["E*Trade tokens", "~/.config/broker/etrade_tokens.json"], ["Daemon socket", "~/.local/state/broker/broker.sock"], ["Daemon log", "~/.local/state/broker/broker.log"],