gstack-agent
把 YC CEO 的思考方法变成你的 AI 助手。
融合 Garry Tan (YC CEO) 开源的 gstack 框架,将 3 大核心方法论转化为可独立运行的 AI 代理:
| 方法论 | 触发场景 | 核心思想 |
|---|---|---|
| Office-Hours 6 问法 | 产品构思 / 方案讨论 | 先搞清楚问题,再想方案。问题不清楚,方案就是瞎猜。 |
| CEO Review 9 条指令 | 方案审核 / 计划评估 | 你不是橡皮图章,让方案变得卓越。 |
| Investigate 4 阶段法 | 故障排查 / bug 修复 | 没有根因调查就不修。修症状 = 打地鼠。 |
快速开始
安装
git clone https://github.com/wacke1/gstack-agent.git
cd gstack-agent
pip install -e .
配置 LLM
在 ~/.gstack-agent/config.json 中配置:
{
"api_key": "sk-xxx",
"base_url": "https://api.openai.com/v1",
"model": "gpt-4o"
}
或通过环境变量:
export LLM_API_KEY=sk-xxx
export LLM_BASE_URL=https://api.openai.com/v1
export LLM_MODEL=gpt-4o
支持任意 OpenAI 兼容 API(OpenRouter、Together AI、本地 Ollama 等)。
用法
1. Office-Hours 6 问法 — 搞清问题再想方案
# 交互模式(推荐)
gstack-agent office-hours "我想做一个 AI 写代码的工具"
# 自动模式(一次性输出完整分析)
gstack-agent office-hours --auto "我想做一个 AI 写代码的工具"
6 个问题依次追问:
- 问题本质是什么?
- 当前怎么做?代价多少?
- 失败代价多大?
- 最小可行解是什么?
- 怎么证伪?
- 如果预算×10,怎么做不同的事?
2. CEO Review 9 条指令 — 让方案变得卓越
gstack-agent ceo-review "我的方案:用微服务架构重做整个系统"
# 严格模式
gstack-agent ceo-review --strict "我的方案..."
9 条指令逐项审核,不合格的直接指出,不说"可以考虑..."。
3. Investigate 4 阶段法 — 没有根因调查就不修
# 交互模式
gstack-agent investigate "生产环境 API 间歇性 502,凌晨 3 点最多"
# 自动模式
gstack-agent investigate "生产环境 API 间歇性 502"
4 阶段:根因调查 → 假设分析 → 最小验证 → 实施修复。
4. analyze — 全面分析
gstack-agent analyze "我想做一个 AI 浏览器插件,自动总结 YouTube 视频"
一次性运行全部三种方法论。
方法论来源
Garry Tan (YC CEO) 的 gstack 框架,开源仓库:https://github.com/garrytan/gstack
架构
gstack-agent/
├── gstack_agent/
│ ├── __init__.py # 包入口
│ ├── __main__.py # python -m gstack_agent 入口
│ ├── cli.py # CLI 入口和参数解析
│ ├── llm.py # LLM 客户端(OpenAI 兼容 API)
│ ├── office_hours.py # Office-Hours 6 问法引擎
│ ├── ceo_review.py # CEO Review 9 条指令引擎
│ └── investigate.py # Investigate 4 阶段法引擎
├── examples/ # 使用示例
├── tests/ # 测试
├── pyproject.toml # 项目配置
└── README.md # 本文件
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gstack_agent-0.1.0.tar.gz.
File metadata
- Download URL: gstack_agent-0.1.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
281f98b8413354addacaed029cdb4eb5bbb0d4fa6e5054319bccddf66e078925
|
|
| MD5 |
d0079fd602523bafae87a7948c1cbe91
|
|
| BLAKE2b-256 |
e5712f583bf82bf121e526f9edd66806b42a16f36d1422d204ff9461157f74dc
|
File details
Details for the file gstack_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gstack_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3c6fc0071575ea2b8a081be6e683618250b1789c997253e003a69099b7665a0
|
|
| MD5 |
30003699d537a924bd9388dff098b62b
|
|
| BLAKE2b-256 |
119cd90bf343f88b19bb104475db3444609f88df511941fa6cd9951379cd87c1
|