Skip to content

filtalgo/Filtmall-Shopping-Skill

filtmall-shopping

Verified

筛电(Filtmall / Filtalgo)官方商品发现与交易 Skill。用户未指定其他平台,并明确要寻找、选择、购买、推荐或比较真实商品时自动调用;包括先描述困扰再明确询问“有什么商品推荐”。用户明确说是筛电/Filtmall 的购物车、支付、订单、物流、退款、售后或客服任务时也调用。平台不明的账户状态短句先澄清平台,不登录、不查询。已进入商品或成分流程后出现严重过敏时只做安全拦截,不搜索或交易;脱离购物场景的医疗陈述不自动调用。用户明确询问单个化妆品成分时可进入只读查询。明确指定其他平台、纯困扰陈述、一般知识或无购物意图的医疗问题不调用。Delegate product discovery and shopping questions to the production Filtalgo hosted agent through Control's public guest and conversation APIs. Use scripts/service.py in one-shot or persistent line-delimited JSON mode; it manages guest identity, waits for terminal state, and returns answers and product cards. Supports follow-up, resumption, cancellation and clearing. Available tools depend on the target Agent; member transactions require separate authorization and an Agent with commerce tools.

scripts/service.py

View on GitHub
#!/usr/bin/env python3
"""filtalgo 常驻服务:skill 的唯一入口,每行一个 JSON 请求,每行一个 JSON 应答。

stdin:  {"op":"send","conversation":"...","text":"...","format":"widget"}
        {"op":"resume","conversation":"...","format":"widget"}
        {"op":"cancel"|"clear"|"auth-reset"|"status","conversation":"..."}
        {"op":"ping"}
stdout: {"id":<请求序号>,"ok":true,"status":"completed","card_count":3,"html_file":"...cards.html","answer_file":"...answer.md"}
        {"id":<请求序号>,"ok":false,"error":{"code":"...","message":"..."}}

整轮对话只启动一次,复用同一个 Client、文件锁和本地状态;按行串行处理,应答顺序与请求一致。
商品卡片和购物车按 format 输出片段、完整页面或 Markdown;正文另存 answer_file,应答只回路径。
不会新建身份,也不会在失败后重发。不向 stdout 写日志:诊断信息全部进 stderr。
"""
import argparse
import hashlib
import html
import json
import os
import tempfile
import math
import re
import sys
import threading
import time
import traceback
import uuid
from pathlib import Path

SKILL_DIR = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(SKILL_DIR / 'scripts'))

import cards  # noqa: E402
import client  # noqa: E402
import address_cards  # noqa: E402
import logistics_cards  # noqa: E402
import customer_service_cards  # noqa: E402
import commerce_ui  # noqa: E402
import commerce_render  # noqa: E402
from update_check import UpdateChecker  # noqa: E402

ClientError = client.ClientError

PROTOCOL = 1
FORMATS = ('widget', 'html', 'md')
OPS = ('send', 'resume', 'cancel', 'clear', 'auth-reset', 'revoke-authorization', 'logout', 'status', 'ping')
# 请求里可对单个产物指定完整文件路径,覆盖默认目录命名。
OUTPUT_PATH_KEYS = ('fragment_path', 'page_path', 'answer_path', 'cart_path', 'checkout_path', 'after_sale_path', 'address_path', 'logistics_path', 'customer_service_path')


def state_directory(args):
    defaults = json.loads(Path(__file__).resolve().parents[1].joinpath('defaults.json').read_text(encoding='utf8'))
    if bool(args.control_url) != bool(args.agent_id):
        raise client.ClientError('TARGET_REQUIRED', '切换环境时必须同时指定 --control-url 和 --agent-id。')
    origin = args.control_url or defaults['control_url']
    agent = args.agent_id or defaults['agent_id']
    namespace = hashlib.sha256((origin + '\0' + agent + '\0' + args.user_key).encode()).hexdigest()
    directory = Path(args.state_dir) if args.state_dir else Path.home() / '.local/state/filtalgo-agent' / namespace
    return origin, agent, directory


def build_client(args):
    origin, agent, directory = state_directory(args)
    return client.Client(origin, agent, client.Store(directory), user_key=args.user_key)


HEARTBEAT = {'started_at': None, 'requests': 0, 'last_request_at': None, 'restarts': 0}


def write_heartbeat(path):
    if not path:
        return
    payload = dict(HEARTBEAT, pid=__import__('os').getpid(), updated_at=time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()))
    tmp = path.with_suffix('.tmp')
    tmp.write_text(json.dumps(payload, ensure_ascii=False), encoding='utf8')
    tmp.replace(path)


def run_request(client, request, default_format, default_out_dir=None, heartbeat_path=None, update_checker=None):
    """请求放在线程里跑:单次请求崩溃不会带走进程,超时也只影响这一条。"""
    box = {}

    def target():
        try:
            box['ok'] = handle(client, request, default_format, default_out_dir, update_checker)
        except BaseException as exc:  # 线程里必须兜住所有异常;可预期的 ClientError 不刷栈
            if not isinstance(exc, ClientError):
                traceback.print_exc(file=sys.stderr)
            box['error'] = exc

    thread = threading.Thread(target=target, daemon=True)
    thread.start()
    previous = sys.gettrace()
    sys.settrace(None)  # 调试器下 join 心跳会让主线程一直不返回
    try:
        while thread.is_alive():
            thread.join(0.5)
            if thread.is_alive() and heartbeat_path:
                try:
                    write_heartbeat(heartbeat_path)
                except OSError:
                    pass  # 不因心跳写入失败丢弃仍在执行的请求
    finally:
        sys.settrace(previous)
    if 'ok' in box:
        return box['ok']
    exc = box.get('error')
    if isinstance(exc, ClientError):
        raise exc
    raise ClientError('INTERNAL_ERROR', '本次请求内部异常(%s);先 resume 核对,不要重新 send。'
                                    % type(exc).__name__)


def answer_text(result):
    value = (result.get('answer') or {}).get('value') or {}
    content = value.get('content')
    text = cards.unescape_markdown(content) if isinstance(content, str) else ''
    return URL_PATTERN.sub(lambda match: commerce_render.mobile_navigation_url(match.group()), text)


URL_PATTERN = re.compile(r'https://[^\s<>"\'))】\],。;、]+')
PAYMENT_URL_HINT = re.compile(r'cashier|payment|pay|收银台|支付', re.IGNORECASE)



def extract_payment_links(answer):
    """下单答复里若带回收银台链接,单独列出,方便宿主直接展示支付入口。"""
    links = []
    for url in URL_PATTERN.findall(answer or ''):
        url = url.rstrip('.,;')
        if PAYMENT_URL_HINT.search(url) and url not in links:
            links.append(url)
    return links


render_cart = commerce_render.render_cart



def html_page(fragment, title):
    return commerce_ui.html_page(fragment, title)


def render(result, fmt, max_cards, all_cards=False):
    budget = cards.ImageBudget()
    out = {'answer': answer_text(result), '_format': fmt, '_image_budget': budget}
    if 'customer_service_snapshots' in result:
        out['customer_service_status'], out['customer_service_count'], out['customer_service_content'] = customer_service_cards.render(result['customer_service_snapshots'], fmt)
    if 'logistics_snapshots' in result:
        out['logistics_status'], out['logistics_count'], out['logistics_content'] = logistics_cards.render(result['logistics_snapshots'], fmt)
    if 'address_snapshots' in result:
        out['address_status'], out['address_content'] = address_cards.render(result['address_snapshots'], fmt)
    if 'cart' in result:
        try:
            out['cart_status'], out['cart_content'] = render_cart(result['cart'], fmt, budget)
        except Exception:
            out['presentation_status'] = 'failed'
            out['presentation_errors'] = ['cart_render_failed']
    for field, kinds in (('checkout', [('checkouts', 'checkout')]),
                         ('after_sale', [('after_sales', 'after_sale'), ('after_sale_lists', 'after_sale_list')])):
        documents = [(result.get(key) or [], kind) for key, kind in kinds]
        if not any(docs for docs, _ in documents):
            continue
        try:
            content, links = [], []
            ordered = [(document, kind) for docs, kind in documents for document in docs]
            ordered.sort(key=lambda pair: (pair[0].get('display_order', 0), pair[0].get('revision', 0)))
            for document, kind in ordered:
                rendered, navigation = commerce_render.render([document], kind, 'widget' if fmt == 'html' else fmt, budget)
                content.append(rendered); links.extend(navigation)
            combined = '\n'.join(content)
            out[field + '_content'] = html_page(combined, '结算' if field == 'checkout' else '售后') if fmt == 'html' else combined
            out[field + '_count'] = sum(len(docs) for docs, _ in documents)
            if field == 'checkout':
                out['payment_links'] = list(dict.fromkeys(url for _, url, rel in links if rel == 'payment'))
        except Exception:
            out['presentation_status'] = 'failed'
            out.setdefault('presentation_errors', []).append(field + '_render_failed')
    try:
        items = cards.collect(result, cards.DEFAULT_URL_BASE)
        cards.attach_answer_reasons(items, out['answer'])
        cards.attach_answer_analysis(items, out['answer'])
        if not all_cards and out['answer']:
            kept = [c for c in items if cards.referenced(c, out['answer'])]
            items = kept
        if max_cards and max_cards > 0:
            items = items[:max_cards]
        out['card_count'] = len(items)
        if not items:
            return out
        meta = {'title': '', 'footer': ''}
        if fmt in ('widget', 'html'):
            out['widget_cards'] = items
            out['product_links'] = [{'title': item['title'], 'url': item['url']} for item in items if item.get('url')]
        elif fmt == 'md':
            out['cards_markdown'] = cards.render_markdown(items, meta)
    except Exception:
        out['card_count'] = 0
        out['presentation_status'] = 'failed'
        out.setdefault('presentation_errors', []).append('product_render_failed')
    return out


def write_outputs(payload, request, default_out_dir):
    """按所选格式保存商品和购物车产物,正文单独保存。"""
    started = time.monotonic()
    conversation = request['conversation']
    directory = Path(request.get('out_dir') or default_out_dir or Path.home() / '.local/state/filtalgo-agent/output')
    directory = directory / hashlib.sha256(conversation.encode()).hexdigest()[:16]
    custom = dict(request.get('out_dirs') or {})
    for key in OUTPUT_PATH_KEYS:
        if key in request:
            custom[key] = request[key]
    def private_directory(path):
        try:
            path.mkdir(mode=0o700)
        except FileNotFoundError:
            private_directory(path.parent)
            private_directory(path)
        except FileExistsError:
            if not path.is_dir():
                raise
    def private_write(target, content):
        private_directory(target.parent)
        fd, temporary = tempfile.mkstemp(dir=target.parent, prefix='.commerce-')
        try:
            with os.fdopen(fd, 'w', encoding='utf8') as stream:
                stream.write(content)
                stream.flush()
                os.fsync(stream.fileno())
            if target in overwritable:
                os.replace(temporary, target)
            else:
                # Atomic create without silently overwriting another turn.
                os.link(temporary, target)
        finally:
            Path(temporary).unlink(missing_ok=True)
    overwritable = {Path(value).expanduser().resolve() for value in custom.values()}
    stamp = time.strftime('%Y%m%d-%H%M%S') + '-' + uuid.uuid4().hex
    def target_path(key, suffix):
        if key in custom:
            return Path(custom[key]).expanduser().resolve()
        return directory / ('turn-%s.%s' % (stamp, suffix))
    answer = payload.pop('answer', '')
    fmt = payload.pop('_format', 'widget')
    budget = payload.pop('_image_budget', None)
    def save(target, content):
        try:
            private_write(target, content)
            return True
        except OSError:
            payload['presentation_status'] = 'failed'
            payload.setdefault('presentation_errors', []).append('output_write_failed')
            return False
    for field in ('cart', 'checkout', 'after_sale', 'address', 'logistics', 'customer_service'):
        if field + '_content' not in payload:
            continue
        target = target_path(field + '_path', ('addresses' if field == 'address' else field.replace('_', '-')) + ('.html' if fmt in ('widget', 'html') else '.md'))
        if save(target, payload.pop(field + '_content')):
            payload[field + '_file'] = str(target)
            if fmt == 'widget': payload[field + '_fragment_file'] = str(target)
            if fmt == 'html': payload[field + '_page_file'] = str(target)
    if 'widget_cards' in payload:
        items = payload.pop('widget_cards')
        try:
            cards.inline_images(items, 5, budget)
            payload['cards_html'] = cards.render_widget(items, {'title': '', 'footer': ''}, 'auto')
        except Exception:
            payload['presentation_status'] = 'failed'
            payload.setdefault('presentation_errors', []).append('product_render_failed')
    if 'cards_html' in payload:
        fragment = payload.pop('cards_html')
        if fmt == 'html':
            target = target_path('page_path', 'page.html')
            if save(target, html_page(fragment, '商品推荐')):
                payload['page_file'] = str(target)
                payload['html_file'] = str(target)
        else:
            target = target_path('fragment_path', 'fragment.html')
            if save(target, fragment):
                payload['fragment_file'] = str(target)
                payload['html_file'] = str(target)
    elif 'cards_markdown' in payload:
        target = directory / ('turn-%s.cards.md' % stamp)
        if save(target, payload.pop('cards_markdown')):
            payload['html_file'] = str(target)
    if answer.strip():
        target = target_path('answer_path', 'answer.md')
        if save(target, answer):
            payload['answer_file'] = str(target)
    if 'region_selector' in payload:
        payload.pop('region_selector')
        payload['region_selection_required'] = True
    payload['card_count'] = payload.get('card_count', 0)
    print(json.dumps({'event': 'commerce.presentation', 'format': fmt,
                      'status': payload.get('presentation_status', 'completed'),
                      'checkout_count': payload.get('checkout_count', 0),
                      'after_sale_count': payload.get('after_sale_count', 0),
                      'output_ms': round((time.monotonic() - started) * 1000),
                      'image_budget_exhausted': bool(budget and time.monotonic() >= budget.deadline)},
                     ensure_ascii=False), file=sys.stderr)


def handle(client, request, default_format, default_out_dir=None, update_checker=None):
    # 更新信息只属于当前请求;已知业务错误保留原 code/message 和本轮检查结果。
    context = {}
    try:
        payload = _handle(client, request, default_format, default_out_dir, update_checker, context)
    except ClientError as exc:
        if 'skill_update' in context:
            exc.skill_update = context['skill_update']
        elif hasattr(exc, 'skill_update'):
            del exc.skill_update
        raise
    if 'skill_update' in context:
        payload['skill_update'] = context['skill_update']
    return payload


def _handle(client, request, default_format, default_out_dir, update_checker, context):
    op = request.get('op')
    conversation = request.get('conversation')
    if op == 'ping':
        return {'ok': True, 'status': 'idle', 'protocol': PROTOCOL,
                'capabilities': {'ops': list(OPS), 'formats': list(FORMATS)},
                'health': dict(HEARTBEAT)}
    if op not in OPS:
        raise ClientError('INVALID_OP', '未知 op:%s(可用:%s)' % (op, '/'.join(OPS)))
    if not isinstance(conversation, str) or not conversation.strip():
        raise ClientError('INVALID_CONVERSATION', '每个请求都必须带非空 conversation。')
    fmt = request.get('format') or default_format
    if fmt not in FORMATS:
        raise ClientError('INVALID_FORMAT', 'format 只能是 ' + '/'.join(FORMATS))
    if op in ('send', 'resume'):
        timeout = request.get('timeout', 120)
        limit = request.get('max', 0)
        if isinstance(timeout, bool) or not isinstance(timeout, (int, float)) or not math.isfinite(timeout) or timeout < 0 or timeout > 3600:
            raise ClientError('INVALID_REQUEST', 'timeout 必须是 0 到 3600 秒。')
        if isinstance(limit, bool) or not isinstance(limit, int) or limit < 0 or limit > 100:
            raise ClientError('INVALID_REQUEST', 'max 必须是 0 到 100 的整数。')
        for key in ('wait', 'all', 'allow_repeat', 'force'):
            if key in request and not isinstance(request[key], bool):
                raise ClientError('INVALID_REQUEST', key + ' 必须是布尔值。')
        for key in ('out_dir',) + OUTPUT_PATH_KEYS:
            if key in request and (not isinstance(request[key], str) or not request[key].strip()):
                raise ClientError('INVALID_REQUEST', key + ' 必须是非空路径。')
        if 'out_dirs' in request:
            out_dirs = request['out_dirs']
            if not isinstance(out_dirs, dict) or set(out_dirs) - set(OUTPUT_PATH_KEYS):
                raise ClientError('INVALID_REQUEST', 'out_dirs 只能包含 ' + '/'.join(OUTPUT_PATH_KEYS))
            for key, value in out_dirs.items():
                if not isinstance(value, str) or not value.strip():
                    raise ClientError('INVALID_REQUEST', 'out_dirs.' + key + ' 必须是非空路径。')
        paths = {**(request.get('out_dirs') or {}), **{key: request[key] for key in OUTPUT_PATH_KEYS if key in request}}
        resolved = [str(Path(path).expanduser().resolve()) for path in paths.values()]
        if len(resolved) != len(set(resolved)):
            raise ClientError('INVALID_REQUEST', '不同产物必须指定不同路径。')
    if op == 'send':
        text = request.get('text')
        if not isinstance(text, str) or not text.strip():
            raise ClientError('INVALID_TEXT', 'send 需要非空 text。')
        wait = request.get('wait', True) is not False
        if update_checker is not None:
            try:
                context['skill_update'] = update_checker.check(conversation)
            except Exception:
                context['skill_update'] = {'status': 'unknown', 'notify': False, 'reason': 'check_failed'}
        result = client.send(conversation, text, wait, timeout,
                             request.get('allow_repeat') is True, request.get('force') is True)
    elif op == 'resume':
        result = client.resume(conversation, timeout)
    elif op == 'cancel':
        result = client.cancel(conversation)
    elif op == 'clear':
        result = client.clear(conversation)
    elif op == 'auth-reset':
        result = client.reset_authorization(conversation)
    elif op == 'revoke-authorization':
        result = client.revoke_authorization(conversation)
    elif op == 'logout':
        result = client.logout(conversation)
    elif op == 'status':
        value = client.conversation(conversation)
        out = {'ok': True, 'status': 'pending' if value.get('pending') else value.get('last_status', 'idle'),
               'conversation': conversation}
        if value.get('pending') and value.get('last_error'):
            out['last_error'] = value['last_error']['code']
        return out
    payload = {'ok': result.get('ok', True), 'status': result.get('status'), 'conversation': conversation}
    for key in ('authorization_url', 'message', 'error', 'presentation_status'):
        if result.get(key):
            payload[key] = result[key]
    if (result.get('ok', True) and (result.get('answer') is not None or result.get('context_documents') or result.get('region_selector'))) or any(k in result for k in ('cart', 'address_snapshots', 'logistics_snapshots', 'customer_service_snapshots')) or any(result.get(k) for k in ('checkouts', 'after_sales', 'after_sale_lists')):
        rendered = render(result, fmt, request.get('max') or 0, bool(request.get('all')))
        payload.update(rendered)
        if result.get('region_selector'):
            payload['region_selector'] = result['region_selector']
        payment_links = payload.get('payment_links', []) if result.get('checkouts') else extract_payment_links(payload.get('answer'))
        if payment_links:
            payload['payment_links'] = payment_links
        write_outputs(payload, request, default_out_dir)
    return payload


def update_timeout(value):
    try:
        timeout = float(value)
    except ValueError:
        raise argparse.ArgumentTypeError('更新检查超时必须是大于 0 且不超过 30 秒的有限数值。')
    if not math.isfinite(timeout) or not 0 < timeout <= 30:
        raise argparse.ArgumentTypeError('更新检查超时必须是大于 0 且不超过 30 秒的有限数值。')
    return timeout


def main():
    parser = argparse.ArgumentParser(description='filtalgo 常驻服务:stdin/stdout 逐行 JSON,skill 的唯一入口。')
    parser.add_argument('--user-key', default='local')
    parser.add_argument('--control-url', default=None)
    parser.add_argument('--agent-id', default=None)
    parser.add_argument('--state-dir', default=None)
    parser.add_argument('--format', choices=FORMATS, default='widget', help='请求未指定 format 时使用的默认值')
    parser.add_argument('--heartbeat', default=None, help='心跳文件路径;默认写到状态目录的 service-heartbeat.json')
    parser.add_argument('--out-dir', default=None, help='每轮卡片与正文的输出目录;请求里可用 out_dir 覆盖')
    parser.add_argument('--once', action='store_true', help='读取一条 JSON 请求并输出一条应答后退出;省略 op 时默认为 send')
    parser.add_argument('--update-timeout', type=update_timeout, default=2.0, help='更新检查超时秒数,默认 2;必须大于 0 且不超过 30')
    parser.add_argument('--update-action', choices=('check', 'shown', 'later', 'ignore', 'reset'), help='独立检查更新或记录已提醒/稍后/忽略/重置后退出,不读取业务请求')
    parser.add_argument('--update-version', help='提醒选择对应的正式版本,例如 v2.10.0')
    parser.add_argument('--update-conversation', help='更新检查或提醒选择对应的 conversation')
    args = parser.parse_args()
    if not args.update_action and (args.update_version is not None or args.update_conversation is not None):
        parser.error('--update-version 和 --update-conversation 需要同时指定 --update-action。')
    for stream in (sys.stdout, sys.stderr):
        stream.reconfigure(encoding='utf8', errors='backslashreplace', newline='\n')
    if args.update_action:
        # 使用与 send 相同的状态目录;不构造业务身份、不写心跳、不读取 stdin。
        try:
            _, _, directory = state_directory(args)
            checker = UpdateChecker(SKILL_DIR, directory, args.user_key, args.update_timeout)
            response = ({'ok': True, 'skill_update': checker.check(args.update_conversation)}
                        if args.update_action == 'check' else
                        checker.record(args.update_action, args.update_version, args.update_conversation))
        except ClientError as exc:
            response = {'ok': False, 'error': {'code': exc.code, 'message': str(exc)}}
        except Exception:
            response = {'ok': False, 'error': 'update_management_failed'}
        sys.stdout.write(json.dumps(response, ensure_ascii=False) + '\n')
        sys.stdout.flush()
        if not response.get('ok'):
            raise SystemExit(1)
        return
    api = build_client(args)
    _, _, directory = state_directory(args)
    update_checker = UpdateChecker(SKILL_DIR, directory, args.user_key, args.update_timeout)
    heartbeat_path = Path(args.heartbeat) if args.heartbeat else directory / 'service-heartbeat.json'
    HEARTBEAT['started_at'] = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
    write_heartbeat(heartbeat_path)
    seq = 0
    for line in sys.stdin.buffer:
        if not line.strip():
            continue
        seq += 1
        HEARTBEAT['requests'] = seq
        HEARTBEAT['last_request_at'] = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
        try:
            request = json.loads(line.decode('utf8'))
            if not isinstance(request, dict):
                raise ClientError('INVALID_REQUEST', '请求必须是 JSON 对象。')
            if args.once and 'op' not in request:
                request['op'] = 'send'
            response = run_request(api, request, args.format, args.out_dir, heartbeat_path, update_checker)
        except ClientError as exc:
            response = {'ok': False, 'error': {'code': exc.code, 'message': str(exc)}}
            if hasattr(exc, 'skill_update'):
                response['skill_update'] = exc.skill_update
        except BaseException as exc:  # 循环本身不能退出,否则后续请求全部丢失
            traceback.print_exc(file=sys.stderr)
            HEARTBEAT['restarts'] = HEARTBEAT.get('restarts', 0) + 1
            try:
                api = build_client(args)
            except Exception:
                traceback.print_exc(file=sys.stderr)
            response = {'ok': False, 'error': {'code': 'INVALID_STATE_OR_RESPONSE',
                                               'message': '本次请求内部异常(%s);先 resume 核对,不要重新 send。' % type(exc).__name__}}
        response['id'] = seq
        sys.stdout.write(json.dumps(response, ensure_ascii=False) + '\n')
        sys.stdout.flush()
        write_heartbeat(heartbeat_path)
        if args.once:
            break


if __name__ == '__main__':
    try:
        main()
    except ClientError as exc:
        sys.stderr.write(json.dumps({'ok': False, 'error': {'code': exc.code, 'message': str(exc)}}, ensure_ascii=False) + '\n')
        sys.exit(1)
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: 472kUpdated 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: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated 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: 323kUpdated Claude CodeCodexVerifiedInstall