Sources: extracted from two upstream archives (skill-repo, skills-main),
merged with the following policy:
- 15 broken symlinks (pointing to /Users/jameslee/.cc-switch/skills or
../../.agents/skills on a foreign machine) discarded
- 3 real name collisions with identical content (ai-pair, ifind-http-api,
zhipu-websearch) kept as one copy
- Functional overlaps deduped keeping the strongest variant:
- docx family: kept docx (official, full toolchain) + docx-cn
(GB/T 9704 Chinese official-document constants),
dropped docx_writer (no scripts, name collided with docx)
- humanizer family: kept humanizer-zh (6 zh reference docs),
dropped humanizer (en, redundant for CN workflow)
- Skills that only ran in a foreign environment removed:
ablemind-ops, app-publish, hlb-design-system, openclaw-adj-skill,
claude-driver
- alphapai excluded from this public repo because its SKILL.md hard-coded
live credentials
Result: 25 skills, 572 files, ~7.5 MB.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
50 lines
1.1 KiB
Python
50 lines
1.1 KiB
Python
"""
|
|
配置管理模块
|
|
"""
|
|
|
|
from pathlib import Path
|
|
from typing import Optional
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""应用配置"""
|
|
|
|
# 项目路径
|
|
base_dir: Path = Path(__file__).parent.parent
|
|
templates_dir: Path = base_dir / "templates"
|
|
output_dir: Path = base_dir / "output"
|
|
data_dir: Path = base_dir / "data"
|
|
|
|
# API 配置
|
|
api_title: str = "PPT-Station API"
|
|
api_version: str = "0.1.0"
|
|
api_prefix: str = "/api/v1"
|
|
|
|
# Tushare 配置
|
|
tushare_token: Optional[str] = None
|
|
|
|
# 数据库配置(可选)
|
|
database_url: Optional[str] = None
|
|
|
|
# 调试模式
|
|
debug: bool = True
|
|
|
|
model_config = SettingsConfigDict(
|
|
env_file=".env",
|
|
env_file_encoding="utf-8",
|
|
case_sensitive=False,
|
|
)
|
|
|
|
def __init__(self, **kwargs):
|
|
super().__init__(**kwargs)
|
|
# 确保目录存在
|
|
self.templates_dir.mkdir(parents=True, exist_ok=True)
|
|
self.output_dir.mkdir(parents=True, exist_ok=True)
|
|
self.data_dir.mkdir(parents=True, exist_ok=True)
|
|
|
|
|
|
# 全局配置实例
|
|
settings = Settings()
|
|
|