Files
soul-yongping/.cursor/config/paths.py

98 lines
3.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Soul 创业派对 - 路径别名
以项目根为工作区,脚本统一引用。迁移到其他电脑时只需修改 workspace.txt。
"""
from pathlib import Path
# ========== 工作区根目录 ==========
_THIS_FILE = Path(__file__).resolve()
_CURSOR_DIR = _THIS_FILE.parent.parent
ROOT = _CURSOR_DIR.parent
_WORKSPACE_OVERRIDE = _THIS_FILE.parent / "workspace.txt"
if _WORKSPACE_OVERRIDE.exists():
for line in _WORKSPACE_OVERRIDE.read_text(encoding="utf-8").strip().splitlines():
line = line.strip()
if line and not line.startswith("#"):
ROOT = Path(line).resolve()
break
# ========== 核心目录别名 ==========
CURSOR = ROOT / ".cursor"
RULES = CURSOR / "rules"
SKILLS = CURSOR / "skills"
SCRIPTS = CURSOR / "scripts"
PROCESS = CURSOR / "process"
MEETING = CURSOR / "meeting"
ARCHIVE = CURSOR / "archive"
CONFIG = CURSOR / "config"
MODEL_SWITCH = CONFIG / "model_switch.json"
DOCS = CURSOR / "docs"
# ========== Agent 目录Soul 开发团队结构) ==========
AGENT = CURSOR / "agent"
# 管理层
AGENT_LEAD = AGENT / "老板分身"
EVOLUTION_LEAD = AGENT_LEAD / "evolution"
# 支撑层
AGENT_ASSISTANT = AGENT / "开发助理"
EVOLUTION_ORANGE = AGENT_ASSISTANT / "evolution"
ARCHIVED_ORANGE = AGENT_ASSISTANT / "archived"
PROJECT_INDEX = AGENT_ASSISTANT / "项目索引"
SCRIPT_ORANGE = AGENT_ASSISTANT / "script"
# Soul 开发角色
AGENT_MINIPROGRAM = AGENT / "小程序开发工程师"
AGENT_ADMIN = AGENT / "管理端开发工程师"
AGENT_BACKEND = AGENT / "后端工程师"
AGENT_PRODUCT = AGENT / "产品经理"
AGENT_TEST = AGENT / "软件测试"
AGENT_TEAM = AGENT / "团队"
# ========== 常用文件 ==========
RULE_MAIN = RULES / "老板分身-索引.mdc"
LOG_EVOLUTION = SCRIPTS / "进化日志.md"
TEMPLATE_EXPERIENCE = SCRIPTS / "经验模板.md"
# ========== 角色 → agent 目录名映射 ==========
ROLE_TO_AGENT = {
# 管理层
"老板分身": "老板分身",
"开发助理": "开发助理",
"助理橙子": "开发助理",
"助手橙子": "开发助理",
# Soul 开发角色
"小程序开发工程师": "小程序开发工程师",
"小程序": "小程序开发工程师",
"管理端开发工程师": "管理端开发工程师",
"管理端": "管理端开发工程师",
"后端工程师": "后端工程师",
"后端": "后端工程师",
"后端开发": "后端工程师",
# 产品与质量
"产品经理": "产品经理",
"产品": "产品经理",
"软件测试": "软件测试",
"测试": "软件测试",
"测试人员": "软件测试",
# 通用
"团队": "团队",
}
def agent_evolution(role: str) -> Path:
"""获取角色对应的 evolution 目录。"""
agent_name = ROLE_TO_AGENT.get(role, role)
return AGENT / agent_name / "evolution"
def agent_script(role: str) -> Path:
"""获取角色对应的 script 目录。"""
agent_name = ROLE_TO_AGENT.get(role, role)
return AGENT / agent_name / "script"