zjs105910/workbuddy-market / bundled/github-project-manager/skills/github-project-manager
github-project-manager
Verified管理从 GitHub 下载到本机的开源项目与技能包:列出、扫描发现、安装前预检、检查更新、一键更新、移除、回滚、数据完整性校验与环境诊断。带 O_EXCL 原子锁 + 心跳租约、事务级失败回滚、InstallPlan 状态收敛、单次遍历的磁盘预检、批量更新复用远程信息(消灭 N+1 请求)、ZIP 预扫描与压缩炸弹/设备名双重防护、skill 冲突阻断、内容指纹校验、硬链接与 rename 两种备份介质。触发方式:/ghpm、『GitHub 项目管理』『检查插件更新』『更新开源项目』『我装了哪些 GitHub 项目』『这个插件有新版吗』『卸载插件』『这个仓库能装吗』『ghpm doctor』『ghpm verify』『文件丢了/装坏了』。
scripts/ghpm.py
View on GitHub#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""ghpm 入口 —— 保持 ``python ghpm.py <cmd>`` 这个调用方式不变。
v4 把 2721 行的实现拆进了同目录的 ``ghpm/`` 包(见 ghpm/__init__.py 的模块图)。
这个文件只剩下三件事:
1. 把脚本所在目录放进 ``sys.path``(直接跑脚本时 Python 不会自动加,
而包导入需要它);
2. 统一 stdout/stderr 编码(Windows 默认 GBK,会把中文进度打成乱码);
3. 调用 ``ghpm.cli.main()``。
三种调用方式都可用:
python ghpm.py list
python -m ghpm list (在 scripts/ 目录下)
import ghpm; ghpm.install(...)
为了兼容「把本文件当模块加载」的老用法(例如旧版测试里的
``spec_from_file_location("ghpm", "ghpm.py")``),这里用 ``__getattr__``
把属性访问转发给真正的包 —— 所以 ``m.load()`` / ``m.install_targets(...)``
这类写法不会因为拆分而失效。
"""
from __future__ import annotations
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
try:
sys.stdout.reconfigure(encoding="utf-8")
sys.stderr.reconfigure(encoding="utf-8")
except Exception:
pass
if sys.version_info < (3, 10):
print("ghpm 需要 Python 3.10+,当前 %d.%d" % sys.version_info[:2], file=sys.stderr)
sys.exit(2)
from ghpm.cli import main # noqa: E402
def __getattr__(name):
"""把 ghpm.py 当模块用时,属性访问转发给 ghpm 包。"""
import ghpm as _pkg
try:
return getattr(_pkg, name)
except AttributeError:
raise AttributeError("module 'ghpm' has no attribute %r" % name)
if __name__ == "__main__":
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 470k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |