Skip to content

Commit d8fcfe3

Browse files
committed
feat: add Claude Code PostToolUse hook for spec sync reminders
Implements lightweight version of F006 automated spec updates: - PostToolUse hook triggers after Edit/Write operations - Reminds Claude to update specs when code changes affect behavior - Only activates in spec-driven repos (checks for .specify/ directory) - Non-blocking reminder (doesn't prevent changes) Hook prompts Claude to consider spec updates for: - Feature behavior changes - API contract modifications - Business logic alterations This complements the existing PreToolUse hook that validates specs before git push. Full F006 implementation (auto-updating specs) remains on roadmap.
1 parent f18e1a9 commit d8fcfe3

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

.claude/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
}
2121
]
2222
}
23+
],
24+
"PostToolUse": [
25+
{
26+
"matcher": "Edit|Write",
27+
"hooks": [
28+
{
29+
"type": "prompt",
30+
"prompt": "If this code change affects feature behavior or API contracts, check if related specs in specs/ need updating. In spec-driven repos, specs guide changes to existing code."
31+
}
32+
]
33+
}
2334
]
2435
}
2536
}

production-readiness-specs/F002-automated-spec-generation/spec.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
# F002: Automated Spec Generation
22

3+
## Implementation Status
4+
5+
**Status**: ✅ **INTEGRATED into Gear 3** (as of 2024-11-17)
6+
7+
Gear 3 (`mcp-server/src/tools/create-specs.ts`) now calls F002 automated spec generation tools:
8+
- `generateAllSpecsToolHandler` - Orchestrates full spec generation
9+
- `createConstitutionToolHandler` - Generates constitution from reverse engineering docs
10+
- `createFeatureSpecsToolHandler` - Creates specs for ALL features (complete, partial, missing)
11+
- `createImplPlansToolHandler` - Generates implementation plans for incomplete features
12+
13+
**Result**: Brownfield repos now get 100% spec coverage for entire application!
14+
315
## Overview
416

5-
Currently, StackShift Gear 3 (Create Specs) provides guidance for manually creating GitHub Spec Kit specifications, but doesn't automatically generate the spec files. This feature will enhance Gear 3 to programmatically create all Spec Kit artifacts from reverse-engineering documentation.
17+
Previously, StackShift Gear 3 (Create Specs) provided guidance for manually creating GitHub Spec Kit specifications, but didn't automatically generate the spec files. This feature enhanced Gear 3 to programmatically create all Spec Kit artifacts from reverse-engineering documentation.
618

7-
## Problem Statement
19+
## Problem Statement (RESOLVED)
820

9-
The current implementation of `create-specs` tool (`mcp-server/src/tools/create-specs.ts`) only returns instructional text telling users HOW to create specs manually. This creates a workflow gap:
21+
The previous implementation of `create-specs` tool only returned instructional text telling users HOW to create specs manually. This created a workflow gap:
1022

1123
1. **Current State**: User completes Gears 1-2, has `docs/reverse-engineering/` with 8+ comprehensive documents
1224
2. **Gear 3 Today**: Returns markdown instructions saying "manually create .specify/ directory and spec files"

0 commit comments

Comments
 (0)