Skip to content

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/errors.py

View on GitHub
# -*- coding: utf-8 -*-
"""错误码与异常类型(仿 DSH plugin-manager 的 failedAt / code 归因)。

错误码以字符串常量暴露给宿主 —— CLI 与 ``__GHPM__`` 事件协议里出现的是
这些字面量,改动它们等于破坏宿主契约,只能新增不能改名。
"""
from __future__ import annotations

# 错误码
E_INVALID_SPEC = "E_INVALID_SPEC"
E_NOT_FOUND = "E_NOT_FOUND"
E_NOT_SKILL = "E_NOT_SKILL"
E_ALREADY = "E_ALREADY"
E_NETWORK = "E_NETWORK"
E_TIMEOUT = "E_TIMEOUT"
E_CANCELLED = "E_CANCELLED"
E_LOCKED = "E_LOCKED"
E_CONFLICT = "E_CONFLICT"
E_WRITE = "E_WRITE"              # 本地写入失败(磁盘满 / 文件被占用 / 权限不足)
E_UNSAFE_PATH = "E_UNSAFE_PATH"  # 路径越界:拒绝操作 WB 目录之外的目标
E_BAD_ARCHIVE = "E_BAD_ARCHIVE"  # ZIP 结构异常:条目过多 / 单文件过大 / 设备名 / 压缩炸弹


class UnsafePathError(RuntimeError):
    """路径越界。单独一类,便于 CLI 归因成 E_UNSAFE_PATH。"""


class HttpError(RuntimeError):
    """带状态码的 HTTP 失败。

    GitHub 的 404 会返回合法 JSON,只看 curl 退出码会把「仓库不存在」
    当成「响应格式错误」,所以必须把状态码带上来。
    """

    def __init__(self, status: int, body: str, url: str):
        super().__init__("HTTP %d %s" % (status, body[:160]))
        self.status = status
        self.body = body
        self.url = url


class NotSkillError(RuntimeError):
    """仓库里没有 skills/*/SKILL.md。"""


class BadArchiveError(RuntimeError):
    """ZIP 结构不合法 / 超出安全上限。解压前抛出,此时磁盘上还没有任何改动。"""


class ConflictError(RuntimeError):
    """skill 已被别的项目占用。默认拒绝安装,除非 --force。"""

    def __init__(self, conflicts: list):
        self.conflicts = conflicts
        super().__init__("以下 skill 已被其他项目占用:%s"
                         % "、".join("%s(属 %s)" % (c["skill"], c["owner"])
                                     for c in conflicts[:6]))
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: 470kUpdated Claude CodeCodexVerifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall