A Claude Code skill that fetches project statistics for the current project from SpecStory's cloud platform.
This skill automatically determines your project ID and fetches statistics from the SpecStory API. The project ID is calculated using a deterministic algorithm that ensures consistency across different environments.
The skill determines the project ID using the following priority:
-
.specstory/.project.json: If this file exists, it uses:git_idfield (preferred)workspace_idfield (fallback)
-
Git Repository: If no project JSON exists, it extracts the repository name from
.git/config(remote "origin") -
Folder Name: If no git repository is found, it uses the current folder name
The identifier is then hashed using SHA256, truncated to 16 characters, and formatted as xxxx-xxxx-xxxx-xxxx.
Simply invoke the skill:
/specstory-project-stats
You can also run the script directly:
node skills/specstory-project-stats/scripts/get-stats.jsTo use a different SpecStory API endpoint (e.g., production):
SPECSTORY_API_URL=https://cloud.specstory.com node skills/specstory-project-stats/scripts/get-stats.jsBy default, the script uses https://cloud.specstory.com, for local development you can override it with SPECSTORY_API_URL=http://localhost:5173.
The skill calls:
{baseUrl}/api/v1/projects/{projectId}/stats
Where:
baseUrldefaults tohttps://cloud.specstory.com(configurable viaSPECSTORY_API_URL, usehttp://localhost:5173for local development)projectIdis calculated as described above
- Node.js (uses built-in modules:
fs,path,crypto,https) - No external dependencies required
scripts/get-stats.js: Main script that calculates project ID and fetches statsSKILL.md: Claude Code skill instructionsREADME.md: This documentation file
Project ID: a1b2-c3d4-e5f6-7890
Fetching stats from: https://cloud.specstory.com/api/v1/projects/a1b2-c3d4-e5f6-7890/stats
Stats:
{
"project": "example/repo",
"total_commits": 1234,
"contributors": 56,
...
}
The script will exit with an error if:
- The API endpoint is unreachable
- The API returns a non-200 status code
- The response cannot be parsed as JSON
Error messages will include helpful context for debugging.