specstory-project-stats
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSpecStory Project Stats
SpecStory 项目统计数据
Fetches project statistics from SpecStory's cloud platform, showing contributor counts, session activity, and other project metrics.
从SpecStory的云平台获取项目统计数据,显示贡献者数量、会话活动及其他项目指标。
How It Works
工作原理
- Identifies the project via , git remote, or folder name
.specstory/.project.json - Calls the SpecStory Cloud API
- Returns project statistics in JSON format
- Presents the data in a readable summary
- 识别项目,通过、git远程仓库或文件夹名称
.specstory/.project.json - 调用SpecStory Cloud API
- 返回JSON格式的项目统计数据
- 展示易读的摘要信息
Prerequisites
前提条件
- Project must be synced to SpecStory Cloud
- Node.js must be available to run the script
- 项目必须同步到SpecStory Cloud
- 必须有Node.js环境来运行脚本
Usage
使用方法
Slash Command
斜杠命令
| User says | Action |
|---|---|
| Fetch stats for current project |
| Same as above (no arguments needed) |
| 用户指令 | 操作 |
|---|---|
| 获取当前项目的统计数据 |
| 同上(无需参数) |
Direct Script Usage
直接运行脚本
bash
undefinedbash
undefinedFetch stats for current project
获取当前项目的统计数据
node skills/specstory-project-stats/scripts/get-stats.js
node skills/specstory-project-stats/scripts/get-stats.js
With custom API endpoint (for development)
使用自定义API端点(用于开发)
SPECSTORY_API_URL=http://localhost:5173 node skills/specstory-project-stats/scripts/get-stats.js
undefinedSPECSTORY_API_URL=http://localhost:5173 node skills/specstory-project-stats/scripts/get-stats.js
undefinedOutput
输出
The script outputs JSON with project statistics:
json
{
"project_id": "specstoryai/agent-skills",
"sessions": {
"total": 156,
"last_30_days": 47,
"last_7_days": 12
},
"contributors": {
"total": 5,
"active_last_30_days": 3
},
"activity": {
"first_session": "2025-10-15",
"last_session": "2026-01-28",
"avg_sessions_per_week": 8.2
}
}脚本输出包含项目统计数据的JSON格式内容:
json
{
"project_id": "specstoryai/agent-skills",
"sessions": {
"total": 156,
"last_30_days": 47,
"last_7_days": 12
},
"contributors": {
"total": 5,
"active_last_30_days": 3
},
"activity": {
"first_session": "2025-10-15",
"last_session": "2026-01-28",
"avg_sessions_per_week": 8.2
}
}Project ID Resolution
项目ID解析
The script determines project ID in this order:
- - Uses
.specstory/.project.jsonorgit_idfieldworkspace_id - Git remote - Extracts repo name from remote URL
origin - Folder name - Falls back to current directory name
脚本按以下顺序确定项目ID:
- - 使用
.specstory/.project.json或git_id字段workspace_id - Git远程仓库 - 从远程URL中提取仓库名称
origin - 文件夹名称 - 退而求其次使用当前目录名称
Error Handling
错误处理
| Error | Meaning | Action |
|---|---|---|
| 404 | Project not found | Project needs to sync to SpecStory Cloud first |
| 401 | Unauthorized | API endpoint may require authentication |
| Network error | Can't reach API | Check internet connection |
| 错误 | 含义 | 操作 |
|---|---|---|
| 404 | 项目未找到 | 项目需要先同步到SpecStory Cloud |
| 401 | 未授权 | API端点可能需要身份验证 |
| 网络错误 | 无法连接API | 检查网络连接 |
Present Results to User
向用户展示结果
After fetching stats, present them in a friendly format:
获取统计数据后,以友好格式展示:
Example Response (success)
示例响应(成功)
Here are the stats for **specstoryai/agent-skills**:
**Sessions**
- Total: 156 sessions captured
- Last 30 days: 47 sessions
- Last 7 days: 12 sessions
**Contributors**
- Total: 5 contributors
- Active recently: 3
**Activity**
- First session: October 15, 2025
- Most recent: January 28, 2026
- Average: ~8 sessions per week
Your project has been actively using AI-assisted coding!以下是**specstoryai/agent-skills**的统计数据:
**会话统计**
- 总计:已捕获156次会话
- 近30天:47次会话
- 近7天:12次会话
**贡献者统计**
- 总计:5位贡献者
- 近期活跃:3位
**活动情况**
- 首次会话:2025年10月15日
- 最近会话:2026年1月28日
- 平均值:每周约8次会话
你的项目一直在积极使用AI辅助编码!Example Response (404 error)
示例响应(404错误)
This project doesn't exist on SpecStory Cloud yet.
To get started:
1. Make sure you have SpecStory installed
2. Run `specstory sync` to push your local sessions to the cloud
3. Try this command again
Need help? Check the docs at https://docs.specstory.com该项目尚未在SpecStory Cloud上存在。
开始使用步骤:
1. 确保你已安装SpecStory
2. 运行`specstory sync`将本地会话推送到云端
3. 再次尝试此命令
需要帮助?查看文档:https://docs.specstory.comEnvironment Variables
环境变量
| Variable | Default | Description |
|---|---|---|
| | API endpoint |
| 变量 | 默认值 | 描述 |
|---|---|---|
| | API端点地址 |
Notes
注意事项
- Statistics are fetched from SpecStory Cloud, not local history
- Project must have synced sessions to show meaningful stats
- The API is public and doesn't require authentication for basic stats
- 统计数据从SpecStory Cloud获取,而非本地历史记录
- 项目必须已同步会话才能显示有意义的统计数据
- 该API是公开的,基础统计数据无需身份验证