Skip to content

mxyhi/ok-skills / product-decision-agent

product-decision-agent

Verified

中文产品决策 Agent。用于中国大陆互联网产品、运营、增长、商业化、数据、项目推进和组织协作场景:产品规划、需求分析、PRD、需求优先级、排期、版本规划、Roadmap、MVP、灰度、上线、迭代、增长停滞、拉新、投放、渠道、裂变、CAC、LTV、ROI、留存、转化、DAU/MAU、GMV、漏斗、社区运营、内容供给、创作者、用户运营、活动运营、私域、会员、定价、指标异常、数据口径、埋点、A/B Test、用户反馈、客服/销售反馈、竞品冲击、资源不足、项目延期、需求反复、老板临时插需求、跨部门协作、团队冲突、OKR/KPI、目标拆解、复盘等。触发时像资深互联网产品负责人一样,先判断真实问题、当前阶段、核心阻塞、关键约束、相关方和证据充分性,再给出最值得执行的下一步。默认中文回答,不讲理论、不引用原文、不解释历史、不暴露后台方法来源。

FileKindSize
LICENSEother1.0 KB
SKILL.mdskill md5.5 KB
agents/openai.yamlconfig353 B
references/methodology-basis.mdmarkdown10.2 KB
references/product-playbooks.mdmarkdown23.4 KB
references/reasoning-engine.mdmarkdown12.1 KB
references/response-examples.mdmarkdown10.7 KB
scripts/quality_gate.pyexecutablescript5.4 KB
scripts/test_quality_gate.pyexecutablescript3.3 KB

scripts/test_quality_gate.py

View on GitHub
#!/usr/bin/env python3
"""Regression tests for the sample-output quality gate."""

from __future__ import annotations

import importlib.util
import tempfile
import unittest
from pathlib import Path


MODULE_PATH = Path(__file__).with_name("quality_gate.py")
SPEC = importlib.util.spec_from_file_location("quality_gate", MODULE_PATH)
if SPEC is None or SPEC.loader is None:
    raise RuntimeError(f"Cannot load {MODULE_PATH}")
quality_gate = importlib.util.module_from_spec(SPEC)
SPEC.loader.exec_module(quality_gate)


VALID_OUTPUT = """# 测试回答

**问题判断**
当前最关键的是先拆清楚留存下降来自哪个用户群体。

**原因分析**
- 总量变化可能掩盖渠道和版本差异。

**行动建议**
1. 今天按渠道和版本拆 D7 留存,并用结果决定是否回滚。

**风险提醒**
不要在口径不清时直接全量回滚。
"""


class QuestionCountingTests(unittest.TestCase):
    def test_counts_only_confirmation_section(self) -> None:
        text = VALID_OUTPUT + "\n前文的问题是什么?\n"
        self.assertEqual(quality_gate.count_questions(text), 0)

    def test_counts_multiple_questions_on_one_line(self) -> None:
        text = VALID_OUTPUT + """

**需要确认**
1. 掉的是新用户吗?集中在哪个版本?
2. 埋点改过吗?是否有发布事故?
"""
        self.assertEqual(quality_gate.count_questions(text), 4)

    def test_ignores_url_query_string(self) -> None:
        text = VALID_OUTPUT + """

**需要确认**
1. 请确认看板 https://example.com/report?cohort=new 是否采用同一口径。
"""
        self.assertEqual(quality_gate.count_questions(text), 0)


class FileCheckingTests(unittest.TestCase):
    def check(self, text: str) -> tuple[list[str], list[str]]:
        with tempfile.TemporaryDirectory() as temp_dir:
            path = Path(temp_dir) / "sample.md"
            path.write_text(text, encoding="utf-8")
            return quality_gate.check_file(path)

    def test_valid_output_passes(self) -> None:
        errors, warnings = self.check(VALID_OUTPUT)
        self.assertEqual(errors, [])
        self.assertEqual(warnings, [])

    def test_hard_source_leak_fails(self) -> None:
        errors, _ = self.check(VALID_OUTPUT + "\n毛泽东认为应该这样做。\n")
        self.assertTrue(any("hard-banned" in error for error in errors))

    def test_soft_term_warns_without_failing(self) -> None:
        errors, warnings = self.check(VALID_OUTPUT + "\n这是一个经典案例。\n")
        self.assertEqual(errors, [])
        self.assertTrue(any("review-needed" in warning for warning in warnings))

    def test_more_than_three_confirmation_questions_fails(self) -> None:
        text = VALID_OUTPUT + """

**需要确认**
1. 指标是什么?
2. 持续多久?
3. 哪类用户?
4. 试过什么?
"""
        errors, _ = self.check(text)
        self.assertIn("asks too many questions", errors)

    def test_aggregate_examples_get_targeted_error(self) -> None:
        text = f"""# 中文输出样例

## 样例 1:留存下降

{VALID_OUTPUT}

## 样例 2:转化下降

{VALID_OUTPUT}
"""
        errors, warnings = self.check(text)
        self.assertEqual(
            errors,
            ["input contains multiple answers; pass one candidate answer per file"],
        )
        self.assertEqual(warnings, [])


if __name__ == "__main__":
    unittest.main()
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall