Skip to content

Commit cb7ba8e

Browse files
committed
fix: auto-override existing team-ai-directives on reinstall
1 parent 5a1c05e commit cb7ba8e

5 files changed

Lines changed: 26 additions & 5 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ bin/
5151
sdd-*/
5252
docs/dev
5353

54+
# Synced copies (local working copies, not committed)
55+
.specify/
56+
.opencode/
57+
5458
# User-specific configuration (now stored globally in ~/.config/specify/)
5559
# Old local config directory is kept for backward compatibility but should not be used
5660
.specify/config/

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to the Specify CLI and templates are documented here.
44

55
# [Unreleased]
66

7+
### Fixed
8+
9+
- **team-ai-directives override**: `sync_team_ai_directives()` now auto-overrides existing installation
10+
- Added `force` parameter to allow reinstalling over existing team-ai-directives
11+
- Matches pre-installed extension behavior (unconditionally overwrites)
12+
- Removes need to manually run `specify extension remove team-ai-directives` first
13+
714
# [0.5.15] - 2026-04-23
815

916
### Changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "agentic-sdlc-specify-cli"
3-
version = "0.5.15"
3+
version = "0.5.16"
44
description = "Specify CLI (tikalk fork). Agentic SDLC toolkit for Spec-Driven Development with pre-installed extensions and AI integrations."
55
requires-python = ">=3.11"
66
dependencies = [

src/specify_cli/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def _derive_target_repo_from_url(zip_url: str) -> str:
222222

223223

224224
def sync_team_ai_directives(
225-
repo_url: str, project_root: Path, *, install: bool = True, skip_tls: bool = False
225+
repo_url: str, project_root: Path, *, install: bool = True, force: bool = False
226226
) -> tuple[str, Path]:
227227
"""Install team-ai-directives as extension from ZIP URL or local path.
228228
@@ -231,7 +231,8 @@ def sync_team_ai_directives(
231231
project_root: Project root directory
232232
install: If True, copy local directories to .specify/extensions/.
233233
If False, use local directories in-place (reference mode).
234-
skip_tls: Skip TLS verification (for HTTPS URLs)
234+
force: If True, remove existing team-ai-directives before reinstalling.
235+
If False (default), raise error if already installed.
235236
236237
Returns:
237238
Tuple of (status, path) where status is "installed", "local", or "reference"
@@ -266,6 +267,11 @@ def sync_team_ai_directives(
266267
# Install mode: copy to .specify/extensions/
267268
ext_manager = ExtensionManager(project_root)
268269
speckit_version = get_speckit_version()
270+
271+
# Force override: remove existing team-ai-directives before reinstalling
272+
if force and ext_manager.registry.is_installed(TEAM_DIRECTIVES_DIRNAME):
273+
ext_manager.remove(TEAM_DIRECTIVES_DIRNAME)
274+
269275
manifest = ext_manager.install_from_directory(
270276
potential_path, speckit_version, priority=1
271277
)
@@ -279,6 +285,10 @@ def sync_team_ai_directives(
279285
ext_manager = ExtensionManager(project_root)
280286
speckit_version = get_speckit_version()
281287

288+
# Force override: remove existing team-ai-directives before reinstalling
289+
if force and ext_manager.registry.is_installed(TEAM_DIRECTIVES_DIRNAME):
290+
ext_manager.remove(TEAM_DIRECTIVES_DIRNAME)
291+
282292
download_dir = project_root / ".specify" / "extensions" / ".cache" / "downloads"
283293
download_dir.mkdir(parents=True, exist_ok=True)
284294
zip_path = download_dir / "team-ai-directives-download.zip"

src/specify_cli/cli_customization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ def pre_init(
337337
)
338338
tracker.complete("team-directives", f"referenced: {directives_path}")
339339
else:
340-
# ZIP URL: install to .specify/extensions/
340+
# ZIP URL: install to .specify/extensions/ (auto-override existing)
341341
status, directives_path = sync_team_ai_directives(
342-
team_ai_directives, project_path, install=True
342+
team_ai_directives, project_path, install=True, force=True
343343
)
344344
if status == "installed":
345345
tracker.complete("team-directives", f"installed to {directives_path}")

0 commit comments

Comments
 (0)