Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves developer-facing documentation and example/script robustness, while also expanding the bundled “skills” library (notably adding Mem0 materials and a new web-artifacts-builder skill with helper scripts).
Changes:
- Added Traditional Chinese documentation (root
README_TW.md, skills/docs undermini_agent/skills/, andexamples/README_TW.md). - Hardened/standardized example and runtime error-handling + logging (retry logging, broad-exception linting, explicit UTF-8 reads in examples).
- Added new skills and supporting assets/scripts (Mem0 skill + references, web artifacts builder scripts and bundled component archive, additional skill docs).
Reviewed changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| README_TW.md | New Traditional Chinese project README (setup/usage/troubleshooting). |
| pyproject.toml | Expanded global Pylint disable list. |
| mini_agent/skills/web-artifacts-builder/SKILL.md | New skill definition/docs for building complex web artifacts. |
| mini_agent/skills/web-artifacts-builder/scripts/shadcn-components.tar.gz | Bundled UI components archive used by init script. |
| mini_agent/skills/web-artifacts-builder/scripts/init-artifact.sh | Script to scaffold a React/Vite + Tailwind + shadcn/ui project. |
| mini_agent/skills/web-artifacts-builder/scripts/bundle-artifact.sh | Script to bundle a project into a single inlined HTML artifact. |
| mini_agent/skills/web-artifacts-builder/LICENSE.txt | License file for the new web-artifacts-builder skill content. |
| mini_agent/skills/setup-cowork/SKILL.md | New skill instructions for guided Cowork setup. |
| mini_agent/skills/schedule/SKILL.md | New skill instructions for creating scheduled tasks. |
| mini_agent/skills/README_TW.md | Traditional Chinese skills README (overview + catalog). |
| mini_agent/skills/mem0/SKILL.md | New Mem0 integration skill instructions and references index. |
| mini_agent/skills/mem0/scripts/mem0_doc_search.py | New on-demand Mem0 docs search helper script. |
| mini_agent/skills/mem0/references/use-cases.md | Mem0 use-cases reference content. |
| mini_agent/skills/mem0/references/sdk-guide.md | Mem0 SDK guide reference content. |
| mini_agent/skills/mem0/references/quickstart.md | Mem0 quickstart reference content. |
| mini_agent/skills/mem0/references/integration-patterns.md | Mem0 framework integration patterns reference content. |
| mini_agent/skills/mem0/references/features.md | Mem0 platform features reference content. |
| mini_agent/skills/mem0/references/architecture.md | Mem0 architecture reference content. |
| mini_agent/skills/mem0/references/api-reference.md | Mem0 API reference content. |
| mini_agent/skills/mem0/README.md | Mem0 skill README (what it is, install, layout). |
| mini_agent/skills/mem0/LICENSE | Mem0 skill license text. |
| mini_agent/skills/mem0-codex/SKILL.md | New Mem0-Codex protocol skill instructions. |
| mini_agent/skills/doc-coauthoring/SKILL.md | New doc co-authoring workflow skill. |
| mini_agent/skills/create-pull-request/SKILL.md | New skill for creating GitHub PRs using gh CLI. |
| mini_agent/retry.py | Improved retry logging formatting, exception chaining, and specific exception type for unknown error. |
| mini_agent/config/mcp-example.json | Expanded MCP example configuration with many optional server entries (TW descriptions). |
| mini_agent/cli.py | Standardized broad-exception handling annotations; minor lint-focused adjustments; moved retry config import to module scope. |
| mini_agent/agent.py | Standardized broad-exception handling; moved imports to module scope for traceback/retry errors. |
| examples/README_TW.md | New Traditional Chinese examples README. |
| examples/06_tool_schema_demo.py | Added lint disables; improved exception handling and traceback printing. |
| examples/05_provider_selection.py | Added lint disables; standardized broad-exception handling and traceback printing. |
| examples/04_full_agent.py | Added lint disables; standardized exception handling; explicit UTF-8 read for session notes. |
| examples/03_session_notes.py | Added lint disables; explicit UTF-8 read for notes file; standardized exception handling. |
| examples/02_simple_agent.py | Added lint disables; standardized exception handling; kept traceback printing. |
| examples/01_basic_tools.py | Added lint disables; explicit UTF-8 reads; removed unnecessary f-strings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Detect OS and set sed syntax | ||
| if [[ "$OSTYPE" == "darwin"* ]]; then | ||
| SED_INPLACE="sed -i ''" | ||
| else | ||
| SED_INPLACE="sed -i" | ||
| fi |
There was a problem hiding this comment.
SED_INPLACE is stored as a string containing quotes (sed -i '') and then executed via $SED_INPLACE .... Quotes inside variables are not re-parsed by the shell, so on macOS this will pass a literal "''" suffix to sed -i (and may create unexpected backup files or fail). Use a function or an array for the in-place sed invocation, or branch per-OS at the call sites.
| # Detect Node version | ||
| NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1) | ||
|
|
||
| echo "🔍 Detected Node.js version: $NODE_VERSION" | ||
|
|
||
| if [ "$NODE_VERSION" -lt 18 ]; then | ||
| echo "❌ Error: Node.js 18 or higher is required" | ||
| echo " Current version: $(node -v)" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
The script calls node -v while set -e is enabled, but it doesn't check that node exists first. If Node.js isn't installed, the script exits with a generic "command not found" instead of a clear error. Add an explicit command -v node check with a helpful message before reading the version.
| # Check if project name is provided | ||
| if [ -z "$1" ]; then | ||
| echo "❌ Usage: ./create-react-shadcn-complete.sh <project-name>" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
The usage message references ./create-react-shadcn-complete.sh, but this file is init-artifact.sh. This makes the error output misleading for users; update the usage string to match the actual script name (or use $0).
| echo "🧹 Cleaning up Vite template..." | ||
| $SED_INPLACE '/<link rel="icon".*vite\.svg/d' index.html | ||
| $SED_INPLACE 's/<title>.*<\/title>/<title>'"$PROJECT_NAME"'<\/title>/' index.html | ||
|
|
There was a problem hiding this comment.
The <title> replacement injects PROJECT_NAME into a sed replacement without escaping. Project names containing /, &, or backslashes can break the sed command or produce unexpected output. Escape the project name for the sed replacement (or update the title using a safer Node/JS snippet).
| # Install bundling dependencies | ||
| echo "📦 Installing bundling dependencies..." | ||
| pnpm add -D parcel @parcel/config-default parcel-resolver-tspaths html-inline | ||
|
|
There was a problem hiding this comment.
This script assumes pnpm is available (pnpm add, pnpm exec) but doesn't check/install it like init-artifact.sh does. Add a command -v pnpm check (with guidance to install/enable Corepack) before first use. Also consider avoiding pnpm add -D ... during bundling (it mutates package.json/lockfile); pnpm dlx or temporary installs can keep projects clean.
|
|
||
| 此專案配備了為穩健且智慧的代理開發體驗而設計的功能: | ||
|
|
||
| * ✅ **完整代理執行循環**:一個完整且可靠的基础,配備用於檔案系統和 shell 操作的基本工具集。 |
There was a problem hiding this comment.
This Traditional Chinese README uses simplified characters (e.g., 「基础」). Please standardize wording/characters to Traditional Chinese (e.g., 「基礎」) for consistency with the target locale.
| * ✅ **完整代理執行循環**:一個完整且可靠的基础,配備用於檔案系統和 shell 操作的基本工具集。 | |
| * ✅ **完整代理執行循環**:一個完整且可靠的基礎,配備用於檔案系統和 shell 操作的基本工具集。 |
| ### SSL 憑證錯誤 | ||
|
|
||
| 如果您遇到 `[SSL: CERTIFICATE_VERIFY_FAILED]` 錯誤: | ||
|
|
||
| **測試快速修復**(修改 `mini_agent/llm.py`): | ||
| ```python | ||
| # 第 50 行:在 AsyncClient 中加入 verify=False | ||
| async with httpx.AsyncClient(timeout=120.0, verify=False) as client: | ||
| ``` |
There was a problem hiding this comment.
The troubleshooting section suggests setting verify=False on the HTTP client. Disabling TLS verification is insecure and can enable MITM attacks; it shouldn’t be presented as a general “quick fix” without strong warnings and safer alternatives. Consider replacing this with guidance on installing/updating CA certs (certifi/OS trust store) and only mentioning verify=False as a last-resort local debugging step with explicit security warnings.
| 此儲存庫中的範例 skills 是開源的(Apache 2.0)。我們 also included the document creation & editing skills that power [Claude's document capabilities](https://www.anthropic.com/news/create-files) under the hood in the [`document-skills/`](./document-skills/) folder. These are source-available, not open source, but we wanted to share these with developers as a reference for more complex skills that are actively used in a production AI application. | ||
|
|
||
| **注意:**這些是作為靈感和學習的參考範例。它們展示的是通用功能,而非組織特定的工作流程或敏感內容。 | ||
|
|
||
| ## 免责声明 |
There was a problem hiding this comment.
This file mixes Traditional Chinese with English and Simplified Chinese terminology (e.g., "我們 also included...", and headings like 「免责声明/重要免责声明」). For a TW README, consider fully translating that paragraph and using Traditional Chinese terms like 「免責聲明」 to keep the document consistent and professional.
| 此儲存庫中的範例 skills 是開源的(Apache 2.0)。我們 also included the document creation & editing skills that power [Claude's document capabilities](https://www.anthropic.com/news/create-files) under the hood in the [`document-skills/`](./document-skills/) folder. These are source-available, not open source, but we wanted to share these with developers as a reference for more complex skills that are actively used in a production AI application. | |
| **注意:**這些是作為靈感和學習的參考範例。它們展示的是通用功能,而非組織特定的工作流程或敏感內容。 | |
| ## 免责声明 | |
| 此儲存庫中的範例 skills 是開源的(Apache 2.0)。我們也納入了支援 [Claude 文件功能](https://www.anthropic.com/news/create-files) 幕後運作的文件建立與編輯 skills,放在 [`document-skills/`](./document-skills/) 資料夾中。這些內容是可取得原始碼的(source-available),而非開源(open source),但我們仍希望將它們分享給開發者,作為更複雜 skills 的參考範例;這些 skills 目前已實際用於正式環境中的 AI 應用程式。 | |
| **注意:**這些是作為靈感和學習的參考範例。它們展示的是通用功能,而非組織特定的工作流程或敏感內容。 | |
| ## 免責聲明 |
This pull request focuses on improving code quality and robustness in the example scripts, as well as adding a new Traditional Chinese README. The main changes include standardizing exception handling, improving file encoding handling, and enhancing code linting compliance.
Documentation:
README_TW.md) to provide setup, usage, and troubleshooting instructions for traditional Chinese users.Code Quality and Linting Improvements:
# pylint: disable=invalid-nameto all example scripts to suppress naming convention warnings and ensure consistent linting. [1] [2] [3] [4] [5] [6]Exception Handling Enhancements:
File Encoding Consistency:
encoding='utf-8'to prevent encoding issues and improve cross-platform compatibility. [1] [2] [3]Minor Output and Formatting Adjustments:
f-strings where not needed and improved output formatting for clarity in several print statements. [1] [2] [3]These changes collectively improve the reliability, maintainability, and accessibility of the example scripts and documentation.