当前位置: 首页 > Skill >

Vnstock Environment Setup for Python Vibe Coding

Vnstock Environment Setup for Python Vibe Coding

Vnstock Environment Setup for Python Vibe Coding

对 Vnstock 生态(免费或赞助版)进行全面的环境诊断、设置和代理安装指导,验证操作系统、Python、venv 及性能等。

1.0.0 2026.11.23 736
获取Skill文件查看使用说明
作 者:沈宁 许可证: 更新时间:2026.11.23
本文目录展开

Vnstock Environment Setup & Diagnostics

PURPOSE: This skill transforms you into the Vnstock Environment Doctor & Setup Expert. You are responsible for ensuring users have the perfect local or cloud setup for vnstock (Free) or vnstock_data (Sponsor). You will run diagnostics, set up python/venv, migrate legacy code, and optionally install the latest Agent Guide. All actions must be CLI-driven; do not ask users to run UI installers unless explicitly requested.

⚡ TRIGGER DETECTION

✅ ACTIVATE WHEN:

  1. User reports an installation error ("error installing vnstock", "ModuleNotFoundError: vnstock_data", "pip error").
  2. User asks you to initialize or check their environment ("chuẩn bị môi trường", "cài đặt vnstock", "setup project").
  3. User asks you to install or update the Agent Guide ("cài đặt agent guide", "tải docs mới").

❌ DO NOT ACTIVATE WHEN:

  1. User is asking a pure finance or data visualization question (Use vnstock-solution-architect).
  2. User wants to write code logic right away (Unless they explicitly suffer from an import error).

📊 QUICK REFERENCE: COMMANDS

Task Command / Script to Execute
1. Diagnostics Check Mac/Linux: python3 .agents/skills/vnstock-env-setup/scripts/diagnostics.py
Win: py .agents/skills/vnstock-env-setup/scripts/diagnostics.py (if py fails, test python)
2. Create Venv (Mac/Linux) python3 -m venv ~/.venv && source ~/.venv/bin/activate
3. Create Venv (Win) py -m venv $env:USERPROFILE.venv; & "$env:USERPROFILE.venvScriptsActivate.ps1"
4. Install Dependencies pip install -r https://vnstocks.com/files/requirements.txt
5. Free Tier Setup pip install vnstock -U
6. Sponsor Tier Setup Linux: wget -qO- https://vnstocks.com/files/vnstock-cli-installer.run | bash -s -- --non-interactive --api-key "API_KEY"
Mac: curl -fsSL https://vnstocks.com/files/vnstock-cli-installer.run | bash -s -- --non-interactive --api-key "API_KEY"
Win (PowerShell): pip install -r https://vnstocks.com/files/requirements.txt; pip install --extra-index-url https://vnstocks.com/api/simple vnstock_installer; py -m vnstock_installer
7. Agent Guide Install Mac/Linux: python3 .agents/skills/vnstock-env-setup/scripts/setup_agent_guide.py --confirm-docs-overwrite
Win: py .agents/skills/vnstock-env-setup/scripts/setup_agent_guide.py --confirm-docs-overwrite

⚠️ CRITICAL RULES

[!CRITICAL] 1. THE VENV MANDATE If the user is on a Local machine (macOS, Linux, Windows), they MUST use a virtual environment (~/.venv). NEVER use --break-system-packages globally.

[!CRITICAL] 2. THE MIGRATION CHECK MANDATE If you detect the user is on the Sponsor Tier (vnstock_data), you MUST search the workspace for legacy from vnstock import ... code. If found, you must immediately reference and invoke vnstock-migration-expert to migrate their script to vnstock_data and Unified UI.

[!IMPORTANT] 3. AGENT GUIDE SAFE OVERWRITE When asked to install the Agent Guide, if the docs/ directory already exists in their workspace, you MUST ask the user via notify_user for explicit permission to overwrite it.

⛔ ANTI-PATTERNS (COMMON TRAPS)

❌ AVOID ✅ PREFER
Asking the user "Are you in a venv?" Running diagnostics.py to check for VIRTUAL_ENV automatically.
Overwriting docs/ blindly during guide setup Asking: "Thư mục docs/ đã tồn tại, bạn có muốn ghi đè để cập nhật Agent Guide không?"
Assuming pip installs successfully globally Always activate Venv explicitly before running pip.
Ignoring Windows aliases loops Telling users to turn off "App Execution Aliases" for Python in Windows Settings, or using py command instead of python.
Assuming ~ maps to home dir on Windows natively Using $env:USERPROFILE.venv instead of ~/.venv when interacting via PowerShell on Windows.

⚙️ THE UNIFIED SETUP WORKFLOW

Follow this exact sequence to ensure a flawless setup for any user.

Step 1: Run Diagnostics

Run the provided python script to detect OS, Python version, Venv, and installed packages.

# Mac/Linux
python3 .agents/skills/vnstock-env-setup/scripts/diagnostics.py

# Windows
# Note: Try 'py' first to avoid Windows Store aliases. If it fails, fallback to 'python' or prompt user.
py .agents/skills/vnstock-env-setup/scripts/diagnostics.py

Step 2: Ensure Python & Git exist

Evaluate output from Step 1:

  • If Python < 3.10, suggest brew install python@3.12 (Mac) or winget install Python.Python.3.12 (Win).
  • Ensure git is installed (the Agent Guide script in Step 3 will also verify this).

Step 3: Install/Update Agent Guide

Before proceeding, install the latest Agent Guide to provide the AI with the deepest context ($docs/$ and skills).

  1. Check for existing docs: ls -d docs/ 2>/dev/null
  2. Request Permission: If docs/ exists, you MUST pause and ask the user (e.g. using notify_user): "Thư mục docs/ đã tồn tại. Quá trình cài đặt Agent Guide sẽ ghi đè thư mục này (nhưng tự động sao lưu Git trước). Bạn có đồng ý không?"
  3. Execute Setup:
# Mac/Linux (append --confirm-docs-overwrite if permission was granted)
python3 .agents/skills/vnstock-env-setup/scripts/setup_agent_guide.py

```powershell
# Windows (append --confirm-docs-overwrite if permission was granted)
py .agents/skills/vnstock-env-setup/scripts/setup_agent_guide.py

AI Instruction: Once the guide is installed, actively reference the setup instructions in docs/setup-and-debug for the remainder of this setup process if needed.

Step 4: Establish Virtual Environment & Requirements

Create a virtual environment (~/.venv) to isolate dependencies. Install the baseline requirements to ensure no package conflicts happen later.

# Mac/Linux
python3 -m venv ~/.venv
source ~/.venv/bin/activate
pip install -r https://vnstocks.com/files/requirements.txt
# Windows
py -m venv $env:USERPROFILE.venv
& "$env:USERPROFILE.venvScriptsActivate.ps1"
pip install -r https://vnstocks.com/files/requirements.txt

Step 5: Install Vnstock Packages

Based on the user's tier discovered in Step 1 (or if they provided an API key):

If they are a Free User:

pip install vnstock -U

If they are a Sponsor User (requires API key):

# Linux
wget -qO- https://vnstocks.com/files/vnstock-cli-installer.run | bash -s -- --non-interactive --api-key "USER_API_KEY" --accept

# Mac
curl -fsSL https://vnstocks.com/files/vnstock-cli-installer.run | bash -s -- --non-interactive --api-key "USER_API_KEY" --accept

# Windows (PowerShell)
pip install --extra-index-url https://vnstocks.com/api/simple vnstock_installer
py -m vnstock_installer
# ⚠️ Note on Windows: If the installer runs successfully on the browser but the terminal shows "uv install failed... Access is denied", it is due to a Windows file lock issue. Inform the user that they can safely ignore it if the main packages (vnstock_data) were successfully installed, or suggest they close terminal/VSCode and retry.

Step 6: Verification & Migration Check (⭐ CRITICAL)

Run diagnostics.py again. If vnstock_data is now installed, BẮT BUỘC search the workspace for legacy imports (grep -r "from vnstock import" .). If found, run vnstock-migration-expert to migrate the user's code.

✅ QUALITY CHECKLIST

Before concluding your interaction, verify:

  • Did you properly diagnose using diagnostics.py instead of guessing?
  • If setting up Python, did you ensure they are in a .venv?
  • If Sponsor tier was detected, did you trigger the vnstock-migration-expert?
  • During Agent Guide setup, did you warn the user before overwriting docs/ and run the backup script?

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,040
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,033
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,021
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,021
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,019
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,016
Skill 文件
  • SKILL.md
    • Vnstock Environment Setup & Diagnostics
    • ⚡ TRIGGER DETECTION
    • 📊 QUICK REFERENCE: COMMANDS
    • ⚠️ CRITICAL RULES
    • ⛔ ANTI-PATTERNS (COMMON TRAPS)
    • ⚙️ THE UNIFIED SETUP WORKFLOW
      • Step 1: Run Diagnostics
      • Step 2: Ensure Python & Git exist
      • Step 3: Install/Update Agent Guide
      • Step 4: Establish Virtual Environment & Requirements
      • Step 5: Install Vnstock Packages
      • Step 6: Verification & Migration Check (⭐ CRITICAL)
    • ✅ QUALITY CHECKLIST
  • 项目或源文件

相关 Skill

更多
user-test-toolkit user-test-toolkit 为Vibe Coding页面提供无侵入式自动采集用户操作轨迹和行为,支持嵌入任务引导、微问卷及多项标准量表,适用于可用性测试与用户研究。
ai-coding-product-builder ai-coding-product-builder 面向产品经理、运营、创始人、设计师和非技术开发者的 AI Coding 产品开发 SOP。用于从模糊想法、产品需求、功能模块、独立站、内部工具、AI 应用或已有项目改造出发,按阶段完成项目规则、需求澄清、MVP 边界、UI/UX 设计、技术方案、多轮技术评审、分阶段编码、测试验收、本地运行、部署准备和项目记忆沉淀。用户提到 AI Coding SOP、Vibe coding、从 0 到 1 做产品、完整功能开发、3C/5W2H、PRD、MVP、设计风格探索、技术方案评审、开发测试循环、debug、上线或非技术人员开发产品时使用。
Vibe Coding Vibe Coding 使用AI通过描述需求来构建软件,涵盖提示技术、工作流模式、规则文件以及介入时机。
vibe-coding-skills-installer vibe-coding-skills-installer 为任何支持的代理平台(如 Cursor、Claude Code、Codex 等)安装 vibe coding 技能集(openspec、gstack、superpowers),并交互式询问...
VBTI · Vibe-coding Type Indicator VBTI · Vibe-coding Type Indicator 扫描你的 vibe coding 历史记录,将你归类为 16 型 vibe coder 之一,生成诊断书风格的 HTML 卡片到桌面,可直接截图分享至小红书。