Skip to content

Commit a331bbb

Browse files
committed
chore: merge upstream and bump to agentic-sdlc-v0.5.5
Merged upstream github/spec-kit (v0.7.3 → v0.7.4.dev0) with fork customizations: - Full fork import block with try/except and all fallback functions - Banner/tagline theming with orange accent color - Team AI Directives setup step with --team-ai-directives CLI option - Install bundled extensions/presets steps - All UI elements themed with accent_style() - Command prefix changed from /speckit.* to /spec.* - StepTracker title uses accent_color - Finalize step added (was missing) - pyproject.toml: restored specify_cli/core_pack wheel paths, added extensions/tdd - templates/agent-file-template.md restored from backup - Updated FORK.md with lessons learned
2 parents e7a5669 + c118c1c commit a331bbb

88 files changed

Lines changed: 1499 additions & 4687 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,21 @@ This release migrates fork-specific customizations to a preset system to reduce
11151115

11161116
The following entries are from the upstream spec-kit project and are included for reference.
11171117

1118+
## [0.7.3] - 2026-04-17
1119+
1120+
### Changed
1121+
1122+
- fix: replace shell-based context updates with marker-based upsert (#2259)
1123+
- Add Community Friends page to docs site (#2261)
1124+
- Add Spec Scope extension to community catalog (#2172)
1125+
- docs: add Community-maintained plugin for Claude Code and GitHub Copilot CLI that installs Spec Kit skills via the plugin marketplace to README (#2250)
1126+
- fix: suppress CRLF warnings in auto-commit.ps1 (#2258)
1127+
- feat: register Blueprint in community catalog (#2252)
1128+
- preset: Update preset-fiction-book-writing to community catalog -> v1.5.0 (#2256)
1129+
- chore(deps): bump actions/upload-pages-artifact from 3 to 5 (#2251)
1130+
- fix: add reference/*.md to docfx content glob (#2248)
1131+
- chore: release 0.7.2, begin 0.7.3.dev0 development (#2247)
1132+
11181133
## [0.7.2] - 2026-04-16
11191134

11201135
### Changed

FORK.md

Lines changed: 154 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,26 @@ try:
3737
from .cli_customization import (
3838
ACCENT_COLOR,
3939
BANNER_COLORS,
40+
TAGLINE,
4041
accent,
4142
accent_style,
4243
TEAM_DIRECTIVES_DIRNAME,
4344
PKG_NAMES,
45+
pre_init,
46+
post_init,
47+
skill_app,
48+
compute_skill_output_name,
4449
)
4550
except ImportError:
46-
# Fallback to upstream defaults if cli_customization.py doesn't exist
4751
ACCENT_COLOR = "cyan"
4852
BANNER_COLORS = ["#00ffff", "#00cccc", "cyan", "#009999", "white", "bright_white"]
53+
TEAM_DIRECTIVES_DIRNAME = "team-ai-directives"
54+
PKG_NAMES = ["specify-cli"]
55+
skill_app = None
4956

50-
def accent(text: str, bold: bool = False, italic: bool = False, dim: bool = False) -> str:
57+
def accent(
58+
text: str, bold: bool = False, italic: bool = False, dim: bool = False
59+
) -> str:
5160
style = ACCENT_COLOR
5261
if bold:
5362
style = f"bold {style}"
@@ -60,10 +69,18 @@ except ImportError:
6069
def accent_style() -> str:
6170
return ACCENT_COLOR
6271

63-
TEAM_DIRECTIVES_DIRNAME = "team-ai-directives"
64-
PKG_NAMES = ("specify-cli",)
72+
def pre_init(project_path, selected_ai, team_ai_directives, tracker=None):
73+
pass
74+
75+
def post_init(project_path, selected_ai, tracker=None, no_git=False):
76+
pass
77+
78+
def compute_skill_output_name():
79+
return None
6580
```
6681

82+
**Critical**: This block must include ALL fork customizations with fallbacks, not just partial imports. The import block is the SINGLE SOURCE OF TRUTH for fork customizations - all theming, hooks (pre_init, post_init), and helper functions must be defined here.
83+
6784
## Extension Namespace Configuration
6885

6986
In `extensions.py`, the fork configures command name patterns:
@@ -119,41 +136,33 @@ git merge upstream/main
119136

120137
#### Step 3: Resolve Conflicts
121138

122-
**Strategy**: Keep origin (fork) changes as base, adapt upstream changes to work with them.
139+
**CRITICAL: Never use `git checkout --theirs` for __init__.py or pyproject.toml**
123140

124-
If there are conflicts in `__init__.py`, resolve the import block to use our pattern:
141+
**Correct Strategy**: Use upstream as clean base, then ADD fork customizations on top.
125142

126-
```python
127-
# Tikalk fork customizations - import with fallback to upstream defaults
128-
try:
129-
from .cli_customization import (
130-
ACCENT_COLOR,
131-
BANNER_COLORS,
132-
accent,
133-
accent_style,
134-
TEAM_DIRECTIVES_DIRNAME,
135-
PKG_NAMES,
136-
)
137-
except ImportError:
138-
# Fallback to upstream defaults if cli_customization.py doesn't exist
139-
ACCENT_COLOR = "cyan"
140-
BANNER_COLORS = ["#00ffff", "#00cccc", "cyan", "#009999", "white", "bright_white"]
143+
1. **For `__init__.py`**: Merge upstream cleanly (no --theirs). Then manually add fork functions AFTER merge:
144+
- `TEAM_DIRECTIVES_DIRNAME = "team-ai-directives"`
145+
- `_run_git_command()`
146+
- `sync_team_ai_directives()`
147+
- `compute_skill_output_name()` (delegates to cli_customization)
148+
- `TAGLINE` (fork version)
141149

142-
def accent(
143-
text: str, bold: bool = False, italic: bool = False, dim: bool = False
144-
) -> str:
145-
style = ACCENT_COLOR
146-
if bold:
147-
style = f"bold {style}"
148-
if italic:
149-
style = f"italic {style}"
150-
if dim:
151-
style = f"dim {style}"
152-
return f"[{style}]{text}[/]"
150+
2. **For `pyproject.toml`**: NEVER use `--theirs`. The file will be in conflict - manually edit to preserve fork values:
151+
- `name = "agentic-sdlc-specify-cli"`
152+
- `version = "0.5.X"` (fork version)
153+
- `description` (fork description)
154+
- Wheel paths: update to root directories (see below)
155+
- Add `httpx>=0.27.0` dependency
153156

154-
def accent_style() -> str:
155-
return ACCENT_COLOR
156-
```
157+
3. **For test files**: Accept upstream versions to avoid massive diffs:
158+
```bash
159+
git checkout --theirs tests/
160+
```
161+
162+
**Why this works**:
163+
- No merge conflicts in __init__.py because we're using upstream as base
164+
- Fork functions are small additions (~50 lines) - easy to add from backup
165+
- pyproject.toml needs manual edit to preserve fork version (never use --theirs)
157166

158167
#### Step 4: Verify
159168

@@ -371,4 +380,113 @@ uv run pytest
371380
uv run pytest
372381
```
373382
3. **Check for conflicts**: `grep -rn "<<<<<<" src/`
374-
4. **Review recent changes**: `git log --oneline -10`
383+
4. **Review recent changes**: `git log --oneline -10`
384+
385+
## Lessons Learned from Upstream Merge
386+
387+
This section documents hard-won lessons from merging upstream changes.
388+
389+
### Critical Rules
390+
391+
1. **NEVER use `git checkout --theirs` for pyproject.toml or __init__.py**
392+
- Using `--theirs` on pyproject.toml discards the fork version entirely
393+
- The stash with fork changes gets lost
394+
- Always manually edit to preserve fork values after merge
395+
396+
2. **Use upstream as clean base, then ADD fork customizations**
397+
- Merge upstream/main cleanly first
398+
- Then manually add fork-specific functions/values AFTER merge
399+
- This prevents accidental overwriting
400+
401+
3. **The import block is the SINGLE SOURCE OF TRUTH**
402+
- All fork customizations must be in the try/except import block
403+
- Both the imports AND the fallback functions must be complete
404+
- Missing fallbacks = runtime errors when cli_customization.py is not available
405+
406+
### pyproject.toml Wheel Paths
407+
408+
The fork uses `specify_cli/core_pack/...` paths (NOT root-level directories):
409+
410+
```toml
411+
[tool.hatch.build.targets.wheel.force-include]
412+
# Tikalk bundled extensions
413+
"extensions/levelup" = "specify_cli/core_pack/extensions/levelup"
414+
"extensions/evals" = "specify_cli/core_pack/extensions/evals"
415+
"extensions/architect" = "specify_cli/core_pack/extensions/architect"
416+
"extensions/quick" = "specify_cli/core_pack/extensions/quick"
417+
"extensions/product" = "specify_cli/core_pack/extensions/product"
418+
"extensions/tdd" = "specify_cli/core_pack/extensions/tdd" # Don't forget!
419+
# Tikalk bundled presets
420+
"presets/agentic-sdlc" = "specify_cli/bundled_presets/agentic-sdlc"
421+
# Core pack assets
422+
"templates/agent-file-template.md" = "specify_cli/core_pack/templates/agent-file-template.md"
423+
# ... etc
424+
```
425+
426+
**Common mistake**: Using root-level paths like `"extensions/levelup" = "extensions/levelup"` will cause build errors because those paths don't exist inside the wheel.
427+
428+
### __init__.py Required Customizations
429+
430+
After merging upstream, ensure these are present in __init__.py:
431+
432+
1. **Full import block** (see above) - with ALL imports and fallbacks
433+
2. **TEAM_DIRECTIVES_DIRNAME** - for team-ai-directives feature
434+
3. **_run_git_command()** - helper for git operations
435+
4. **sync_team_ai_directives()** - clones/updates team repo
436+
5. **compute_skill_output_name()** - delegates to cli_customization
437+
6. **TAGLINE** - fork's tagline (different from upstream)
438+
439+
### __init__.py Theming
440+
441+
Apply theming to all UI elements using `accent_style()` and `accent()`:
442+
443+
- `show_banner()`: Use `BANNER_COLORS` and `accent_style()` for tagline
444+
- StepTracker title: `f"[{accent_style()}]{self.title}"`
445+
- "Selected AI assistant:" and "Selected script type:": Use `accent()`
446+
- "Project ready.": Use `accent(bold=True)`
447+
- All Panel borders: Use `border_style=accent_style()`
448+
- Next Steps and Enhancement Commands panels
449+
450+
### Tracker Steps
451+
452+
The init flow must include these steps in order:
453+
454+
```python
455+
for key, label in [
456+
("chmod", "Ensure scripts executable"),
457+
("constitution", "Constitution setup"),
458+
("git", "Install git extension"),
459+
("workflow", "Install bundled workflow"),
460+
("team-directives", "Team AI Directives setup"),
461+
("extensions", "Install bundled extensions"),
462+
("presets", "Install bundled presets"),
463+
]:
464+
tracker.add(key, label)
465+
466+
# Final MUST be added LAST
467+
tracker.add("final", "Finalize")
468+
```
469+
470+
### Command Prefix
471+
472+
The fork uses `/spec.*` prefix instead of upstream's `/speckit.*`:
473+
474+
```python
475+
def _display_cmd(name: str) -> str:
476+
# ... agent-specific cases ...
477+
# Fork default: use "spec." prefix instead of "speckit."
478+
return f"/spec.{name}"
479+
```
480+
481+
### Backup Before Merge
482+
483+
Always create a backup branch BEFORE merging:
484+
485+
```bash
486+
git branch backup-before-upstream-merge-$(date +%Y%m%d-%H%M%S)
487+
```
488+
489+
This allows you to:
490+
- Compare against backup to see exactly what changed
491+
- Restore any accidentally lost customizations
492+
- Debug issues by comparing working vs broken state

0 commit comments

Comments
 (0)