mit einem Klick
athena-init
// Athena 项目初始化 skill. 在项目中执行 /athena-init 时调用. 职责: 探测平台 / 工具可用性, 创建 .ai_state/ 目录 + 复制 _index.md 模板 + 填入探测结果.
// Athena 项目初始化 skill. 在项目中执行 /athena-init 时调用. 职责: 探测平台 / 工具可用性, 创建 .ai_state/ 目录 + 复制 _index.md 模板 + 填入探测结果.
| name | athena-init |
| description | Athena 项目初始化 skill. 在项目中执行 /athena-init 时调用. 职责: 探测平台 / 工具可用性, 创建 .ai_state/ 目录 + 复制 _index.md 模板 + 填入探测结果. |
| effort | medium |
用户在新项目首次运行 /athena-init. 已 init 的项目 → 跳过, 提示用户用 /athena-status 查状态.
# 项目是否已 init?
if [ -d ".ai_state" ]; then
echo "项目已初始化, 使用 /athena-status 查看状态"
exit 0
fi
# 是否在 git 仓库?
git rev-parse --git-dir >/dev/null 2>&1 || { echo "Athena 需要 git 仓库"; exit 1; }
# CC 始终可用 (因为我们就在 CC 里跑)
CC_VERSION=$(claude --version 2>/dev/null || echo "claude-code (unknown)")
# CX
if command -v codex >/dev/null 2>&1; then
CX_VERSION=$(codex --version 2>/dev/null)
CX_AVAILABLE=true
else
CX_VERSION=""
CX_AVAILABLE=false
fi
# AG (Antigravity)
if command -v agy >/dev/null 2>&1; then
AG_VERSION=$(agy --version 2>/dev/null || echo "agy (unknown)")
AG_CALLABLE=true
else
AG_CALLABLE=false
fi
# context7
if command -v npx >/dev/null 2>&1 && npx --no-install ctx7 --version >/dev/null 2>&1; then
CTX7_AVAILABLE=true
else
CTX7_AVAILABLE=false
fi
# augment MCP (CC 端在 ~/.claude/mcp.json 中)
if [ -f "$HOME/.claude/mcp.json" ] && grep -q "augment-context-engine" "$HOME/.claude/mcp.json" 2>/dev/null; then
AUGMENT_CC=true
else
AUGMENT_CC=false
fi
# rg / jq
RG_AVAILABLE=$(command -v rg >/dev/null && echo true || echo false)
JQ_AVAILABLE=$(command -v jq >/dev/null && echo true || echo false)
mkdir -p .ai_state/sprints/reviews
mkdir -p .ai_state/sprints/lessons
cp ~/.claude/skills/pace/templates/_index.md .ai_state/_index.md
# 用 sed / python 把探测结果替换进 frontmatter
主 agent 编辑 .ai_state/_index.md 把上面探测到的真实值填入对应字段:
cc_version, cx_version, ag_callabletools_available.{context7_cli, augment_mcp_cc, rg_available, jq_available}platform_features.{cc_subagent_task: true, cx_spawn_agent, cx_spawn_agents_on_csv, cx_goal_default_on, ag_parallel_subagents, ag_headless_p}判定规则 (主 agent 在 init 时执行):
cx_spawn_agent = true if CX_VERSION >= 0.128cx_spawn_agents_on_csv = true if CX_VERSION >= 0.128 且 ~/.codex/config.toml [features].multi_agent = truecx_goal_default_on = true if CX_VERSION >= 0.133.0ag_parallel_subagents = ag_callable (Antigravity 默认支持)ag_headless_p = ag_callable (agy -p 默认支持)cat > .ai_state/compound/ << 'EOF'
# Project Lessons (Athena v9.6.4)
> 本项目积累的经验. 每次 polish / review 后由主 agent 追加.
> 格式: `## [date] 简述`
> 内容: pattern (做对的) / pitfall (踩的坑) / constraint (硬约束)
EOF
主 agent 输出 markdown 总结:
✓ Athena v9.6.4 初始化完成
## 平台
- CC: claude-code 2.4.1 ✓
- CX (codex): codex-cli 0.133.0 ✓
- AG (antigravity): 未安装. 安装: `curl -fsSL https://antigravity.google/cli/install.sh | bash`
## 工具
- context7 (npx ctx7): ✓
- augment MCP (CC): 未配置. 配置: 在 ~/.claude/mcp.json 加 augment-context-engine
- rg: ✓
- jq: ✓
## 状态
.ai_state/ 已建立, _index.md 已生成
## 下一步
告诉我你要做什么, 我会路由 PACE 路径:
- "修这个 bug" → Bugfix 路径
- "加个新功能" → Feature 路径
- "重构这个模块" → Refactor 路径 (含 polish 强制)
- "搭一个 X 系统" → System 路径 (含 design + polish 强制)
git initathena-init 不进入任何 PACE stage, 它是 stage="(none)" → 等待用户首条任务输入后才路由.
检查项目依赖 (库 / 包 / jar) 是否有可升级版本, 适配多生态: Maven / npm·pnpm·yarn·bun / PyPI / Cargo / Go / RubyGems / Composer / NuGet. 铁律: 版本号必须从官方 registry 在线查询, 不靠记忆/编造, 且区分 "声明的版本是否存在" 与 "是否最新". 用户要求"看有没有要更新的依赖"时使用.
维护 .ai_state/architecture/ 长效档案 (项目现状档). Refactor/System 路径完成后强制更新 ARCHITECTURE.md 总入口 + {type}-{slug}.md 子系统档. 注: 不同于 cx 端的 architect.toml subagent (后者是 design stage 工作者).
Athena 主入口 skill. 接收用户任务, 做 PACE 路由分诊 (brainstorm/roadmap/plan/...), 启动对应 stage. v9.6.4 升级: 加 brainstorm + roadmap 分诊 (铁律 14), 加路由检测自动 ultrathink 提示.
Athena 版本迁移工具. v9.6.4 重写: 含 v9.6.2 → v9.6.4 破坏式重构 (sprints/ + compound/ + 4 新 ai_state 文件 + lessons.md 三选项交互).
PACE review stage 执行 skill. v9.6.4 升级: 6 维度 (并行 spawn 3 subagent: reviewer + spec-compliance + evaluator).
快速查看当前项目的 Athena 状态: stage / path / sprint / 进度 / 活动 worktree. 无副作用, 只读.