Skip to content

anbeime/skill / projects/companion-simple

xiaoyue-companion

Verified

专为软件开发工程师与综合办公文员打造。当你在等待任务执行、工作疲惫或需要鼓励时,使用此技能通过智谱AI自动生成温暖对话回应与场景配图,一键获取专属情绪价值与虚拟陪伴,让AI助手更懂你。

FileKindSize
.gitignoreother603 B
API_INTEGRATION.mdmarkdown4.3 KB
DEMO-SUCCESS.mdmarkdown4.3 KB
DEPLOYMENT_CHECKLIST.mdmarkdown5.8 KB
DEPLOYMENT_GUIDE.mdmarkdown6.0 KB
FINAL-SUMMARY.mdmarkdown1.3 KB
PROJECT_SUMMARY.mdmarkdown5.3 KB
QUICKSTART.mdmarkdown4.8 KB
README-FINAL.mdmarkdown3.1 KB
README.mdmarkdown10.5 KB
SKILL.mdskill md6.6 KB
SUMMARY.mdmarkdown3.1 KB
USAGE-GUIDE.mdmarkdown5.9 KB
XIAOYI-README.mdmarkdown5.1 KB
api_client.pyscript5.5 KB
api_server_example.pyscript6.3 KB
config.pyscript859 B
crawler.pyscript4.6 KB
data/last_update.txtmarkdown26 B
data/local_skills.jsonconfig5.4 KB
data/skills.jsonconfig66.5 KB
data_manager.pyscript4.6 KB
docs/D盘tool目录整理完成报告.mdmarkdown15.8 KB
docs/技能数量差异分析报告.mdmarkdown7.0 KB
docs/技能清理与迁移指南.mdmarkdown14.6 KB
docs/技能管理数据库.mdmarkdown32.1 KB
docs/整理完成总结.mdmarkdown5.7 KB
main.pyscript5.0 KB
package-lock.jsonmanifest103 B
public/index-en.htmlother9.9 KB
public/index.htmlother11.1 KB
public/local-skills.htmlother8.4 KB
public/skills-en.htmlother16.7 KB
public/skills.htmlother28.0 KB
public/styles.cssother6.6 KB
requirements.txtmanifest140 B
run_once.batscript560 B
scheduler.pyscript4.2 KB
scripts/xiaoyi-chat.ps1script1.7 KB
scripts/xiaoyue-chat.jsscript2.8 KB
scripts/xiaoyue-chat.ps1script1.5 KB
scripts/xiaoyue-companion.shscript2.2 KB
setup_scheduled_task.ps1script1.0 KB
start_daemon.batscript771 B
templates/soul-injection.mdmarkdown1.8 KB
vercel.jsonconfig371 B
技能清单.mdmarkdown2.7 KB
# -*- coding: utf-8 -*-
"""
技能商店自动更新主程序
"""

import os
import sys
import logging
import argparse
from datetime import datetime

# 添加当前目录到 Python 路径
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

from config import LOG_DIR, LOG_FILE
from scheduler import UpdateScheduler
from data_manager import DataManager


def setup_logging(verbose: bool = False):
    """配置日志系统"""
    os.makedirs(LOG_DIR, exist_ok=True)
    
    log_level = logging.DEBUG if verbose else logging.INFO
    
    # 配置日志格式
    formatter = logging.Formatter(
        '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
        datefmt='%Y-%m-%d %H:%M:%S'
    )
    
    # 文件处理器
    file_handler = logging.FileHandler(LOG_FILE, encoding='utf-8')
    file_handler.setLevel(log_level)
    file_handler.setFormatter(formatter)
    
    # 控制台处理器
    console_handler = logging.StreamHandler(sys.stdout)
    console_handler.setLevel(log_level)
    console_handler.setFormatter(formatter)
    
    # 根日志器
    root_logger = logging.getLogger()
    root_logger.setLevel(log_level)
    root_logger.addHandler(file_handler)
    root_logger.addHandler(console_handler)
    
    return root_logger


def main():
    """主函数"""
    parser = argparse.ArgumentParser(
        description='技能商店自动更新工具',
        formatter_class=argparse.RawDescriptionHelpFormatter,
        epilog="""
使用示例:
  # 立即执行一次更新
  python main.py --once
  
  # 启动定时自动更新(后台运行)
  python main.py --daemon
  
  # 查看当前数据统计
  python main.py --stats
  
  # 导出技能数据为 CSV
  python main.py --export skills.csv
        """
    )
    
    parser.add_argument(
        '--once',
        action='store_true',
        help='立即执行一次更新任务'
    )
    
    parser.add_argument(
        '--daemon',
        action='store_true',
        help='启动定时自动更新(持续运行)'
    )
    
    parser.add_argument(
        '--stats',
        action='store_true',
        help='显示当前技能数据统计'
    )
    
    parser.add_argument(
        '--export',
        metavar='FILE',
        help='导出技能数据为 CSV 文件'
    )
    
    parser.add_argument(
        '-v', '--verbose',
        action='store_true',
        help='显示详细日志'
    )
    
    parser.add_argument(
        '--api-sync',
        action='store_true',
        help='启用 API 同步(需配置 API URL 和 Key)'
    )
    
    args = parser.parse_args()
    
    # 配置日志
    logger = setup_logging(args.verbose)
    logger.info("技能商店自动更新工具启动")
    
    # 创建调度器和数据管理器(根据参数决定是否启用 API 同步)
    scheduler = UpdateScheduler(enable_api_sync=args.api_sync)
    data_manager = DataManager()
    
    try:
        if args.once:
            # 立即执行一次更新
            logger.info("执行模式: 单次更新")
            scheduler.run_once()
        
        elif args.daemon:
            # 启动定时调度
            logger.info("执行模式: 定时自动更新")
            scheduler.start_scheduled()
        
        elif args.stats:
            # 显示统计信息
            logger.info("执行模式: 数据统计")
            skills = data_manager.load_skills()
            if skills:
                categories = {}
                for skill in skills:
                    cat = skill.get('category', '未分类')
                    categories[cat] = categories.get(cat, 0) + 1
                
                print(f"\n技能数据统计:")
                print(f"总计: {len(skills)} 个技能")
                print(f"分类数: {len(categories)}")
                print(f"\n各分类技能数:")
                for cat, count in sorted(categories.items(), key=lambda x: x[1], reverse=True):
                    print(f"  {cat}: {count}")
                
                last_update = data_manager.get_last_update_time()
                if last_update:
                    print(f"\n最后更新: {last_update.strftime('%Y-%m-%d %H:%M:%S')}")
            else:
                print("暂无技能数据")
        
        elif args.export:
            # 导出数据
            logger.info(f"执行模式: 导出数据到 {args.export}")
            skills = data_manager.load_skills()
            if skills:
                if data_manager.export_to_csv(skills, args.export):
                    print(f"成功导出 {len(skills)} 个技能到: {args.export}")
                else:
                    print("导出失败")
            else:
                print("暂无技能数据可导出")
        
        else:
            # 默认显示帮助
            parser.print_help()
    
    except KeyboardInterrupt:
        logger.info("收到中断信号,程序退出")
    except Exception as e:
        logger.error(f"程序异常: {e}", exc_info=True)
        sys.exit(1)


if __name__ == '__main__':
    main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall