link_commit
Link a git commit SHA to a feature spec and optionally a task. Creates full traceability from code to commit to task to spec.
Instructions
Link a git commit SHA to a feature spec and optionally a task. Creates full traceability: code -> commit -> task -> spec.
Deterministic workflow for AI agents:
Retrieve spec via get_feature_spec (spec_id is now in context)
Implement changes and commit code
Run
git rev-parse HEADto capture the exact SHARun
git remote get-url originand normalize SSH URLs to HTTPSCall this tool with the SHA, repo_url, and spec_id (and task_id if applicable)
The commit is recorded in the spec's related_commits array and commit_count is incremented. If task_id is provided, the commit is also linked to the task with a last_commit_at timestamp.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | No | Site domain (e.g., "example.com"). Uses SEO_CLIENT_DOMAIN env var if not provided. | |
| project_id | No | Project UUID — use instead of domain when no domain is configured. | |
| spec_id | Yes | UUID of the feature spec to link the commit to (required) | |
| task_id | No | UUID of the specific task to link the commit to. If provided, the commit is linked to both the task and its parent spec. | |
| commit_sha | Yes | Git commit SHA to link (from `git rev-parse HEAD` after committing) | |
| repo_url | No | Repository HTTPS URL (e.g., "https://github.com/owner/repo"). Derive from `git remote get-url origin` and normalize SSH to HTTPS. |