lite-kits 0.1.0__py3-none-any.whl → 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lite_kits/__init__.py +61 -9
- lite_kits/cli.py +788 -262
- lite_kits/core/__init__.py +19 -0
- lite_kits/core/banner.py +160 -0
- lite_kits/core/conflict_checker.py +115 -0
- lite_kits/core/detector.py +140 -0
- lite_kits/core/installer.py +322 -0
- lite_kits/core/manifest.py +146 -0
- lite_kits/core/validator.py +146 -0
- lite_kits/kits/README.md +14 -15
- lite_kits/kits/dev/README.md +241 -0
- lite_kits/kits/dev/commands/.claude/audit.md +143 -0
- lite_kits/kits/{git/claude/commands → dev/commands/.claude}/cleanup.md +2 -2
- lite_kits/kits/{git/claude/commands → dev/commands/.claude}/commit.md +2 -2
- lite_kits/kits/{project/claude/commands → dev/commands/.claude}/orient.md +30 -48
- lite_kits/kits/{git/claude/commands → dev/commands/.claude}/pr.md +1 -1
- lite_kits/kits/dev/commands/.claude/review.md +202 -0
- lite_kits/kits/dev/commands/.claude/stats.md +162 -0
- lite_kits/kits/dev/commands/.github/audit.prompt.md +143 -0
- lite_kits/kits/{git/github/prompts → dev/commands/.github}/cleanup.prompt.md +2 -2
- lite_kits/kits/{git/github/prompts → dev/commands/.github}/commit.prompt.md +2 -2
- lite_kits/kits/{project/github/prompts → dev/commands/.github}/orient.prompt.md +34 -48
- lite_kits/kits/{git/github/prompts → dev/commands/.github}/pr.prompt.md +1 -1
- lite_kits/kits/dev/commands/.github/review.prompt.md +202 -0
- lite_kits/kits/dev/commands/.github/stats.prompt.md +163 -0
- lite_kits/kits/kits.yaml +497 -0
- lite_kits/kits/multiagent/README.md +28 -17
- lite_kits/kits/multiagent/{claude/commands → commands/.claude}/sync.md +331 -331
- lite_kits/kits/multiagent/{github/prompts → commands/.github}/sync.prompt.md +73 -69
- lite_kits/kits/multiagent/memory/git-worktrees-protocol.md +370 -370
- lite_kits/kits/multiagent/memory/parallel-work-protocol.md +536 -536
- lite_kits/kits/multiagent/memory/pr-workflow-guide.md +275 -281
- lite_kits/kits/multiagent/templates/collaboration-structure/README.md +166 -166
- lite_kits/kits/multiagent/templates/decision.md +79 -79
- lite_kits/kits/multiagent/templates/handoff.md +95 -95
- lite_kits/kits/multiagent/templates/session-log.md +68 -68
- lite_kits-0.3.1.dist-info/METADATA +259 -0
- lite_kits-0.3.1.dist-info/RECORD +41 -0
- {lite_kits-0.1.0.dist-info → lite_kits-0.3.1.dist-info}/licenses/LICENSE +21 -21
- lite_kits/installer.py +0 -417
- lite_kits/kits/git/README.md +0 -374
- lite_kits/kits/git/scripts/bash/get-git-context.sh +0 -208
- lite_kits/kits/git/scripts/powershell/Get-GitContext.ps1 +0 -242
- lite_kits/kits/project/README.md +0 -244
- lite_kits-0.1.0.dist-info/METADATA +0 -415
- lite_kits-0.1.0.dist-info/RECORD +0 -31
- {lite_kits-0.1.0.dist-info → lite_kits-0.3.1.dist-info}/WHEEL +0 -0
- {lite_kits-0.1.0.dist-info → lite_kits-0.3.1.dist-info}/entry_points.txt +0 -0
lite_kits/installer.py
DELETED
@@ -1,417 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Installer logic for spec-kit-multiagent
|
3
|
-
|
4
|
-
Handles installation, removal, and validation of multiagent features.
|
5
|
-
"""
|
6
|
-
|
7
|
-
import shutil
|
8
|
-
from pathlib import Path
|
9
|
-
from typing import Dict, List, Optional
|
10
|
-
|
11
|
-
|
12
|
-
class Installer:
|
13
|
-
"""Manages installation of multiagent features to spec-kit projects."""
|
14
|
-
|
15
|
-
def __init__(self, target_dir: Path, kits: Optional[List[str]] = None):
|
16
|
-
"""
|
17
|
-
Initialize installer.
|
18
|
-
|
19
|
-
Args:
|
20
|
-
target_dir: Target spec-kit project directory
|
21
|
-
kits: List of kits to install (project, git, multiagent). Defaults to ['project']
|
22
|
-
"""
|
23
|
-
self.target_dir = Path(target_dir).resolve()
|
24
|
-
self.kits_dir = Path(__file__).parent / "kits"
|
25
|
-
self.kits = kits or ['project'] # Default to project kit only
|
26
|
-
|
27
|
-
# Validate kit names
|
28
|
-
valid_kits = {'project', 'git', 'multiagent'}
|
29
|
-
invalid = set(self.kits) - valid_kits
|
30
|
-
if invalid:
|
31
|
-
raise ValueError(f"Invalid kit(s): {invalid}. Valid: {valid_kits}")
|
32
|
-
|
33
|
-
# Auto-include dependencies
|
34
|
-
# multiagent requires both project and git
|
35
|
-
if 'multiagent' in self.kits:
|
36
|
-
if 'project' not in self.kits:
|
37
|
-
self.kits.append('project')
|
38
|
-
if 'git' not in self.kits:
|
39
|
-
self.kits.append('git')
|
40
|
-
|
41
|
-
def is_spec_kit_project(self) -> bool:
|
42
|
-
"""
|
43
|
-
Check if target directory is a spec-kit project.
|
44
|
-
|
45
|
-
Returns:
|
46
|
-
True if directory contains spec-kit markers
|
47
|
-
"""
|
48
|
-
markers = [
|
49
|
-
self.target_dir / ".specify",
|
50
|
-
self.target_dir / ".claude",
|
51
|
-
self.target_dir / ".github" / "prompts",
|
52
|
-
]
|
53
|
-
return any(marker.exists() for marker in markers)
|
54
|
-
|
55
|
-
def is_multiagent_installed(self) -> bool:
|
56
|
-
"""
|
57
|
-
Check if multiagent features are already installed.
|
58
|
-
|
59
|
-
Returns:
|
60
|
-
True if multiagent features detected
|
61
|
-
"""
|
62
|
-
# Check for kit markers
|
63
|
-
markers = {
|
64
|
-
'project': [
|
65
|
-
self.target_dir / ".claude" / "commands" / "orient.md",
|
66
|
-
self.target_dir / ".github" / "prompts" / "orient.prompt.md",
|
67
|
-
],
|
68
|
-
'git': [
|
69
|
-
self.target_dir / ".claude" / "commands" / "commit.md",
|
70
|
-
self.target_dir / ".github" / "prompts" / "commit.prompt.md",
|
71
|
-
],
|
72
|
-
'multiagent': [
|
73
|
-
self.target_dir / ".specify" / "memory" / "pr-workflow-guide.md",
|
74
|
-
],
|
75
|
-
}
|
76
|
-
|
77
|
-
# Check if any requested kit is already installed
|
78
|
-
for kit in self.kits:
|
79
|
-
if any(marker.exists() for marker in markers.get(kit, [])):
|
80
|
-
return True
|
81
|
-
|
82
|
-
return False
|
83
|
-
|
84
|
-
def preview_installation(self) -> Dict[str, List[str]]:
|
85
|
-
"""
|
86
|
-
Preview what files will be created/modified.
|
87
|
-
|
88
|
-
Returns:
|
89
|
-
Dictionary with lists of new_files, modified_files, new_directories
|
90
|
-
"""
|
91
|
-
changes = {
|
92
|
-
"new_files": [],
|
93
|
-
"modified_files": [],
|
94
|
-
"new_directories": [],
|
95
|
-
}
|
96
|
-
|
97
|
-
# Check which interface(s) exist
|
98
|
-
has_claude = (self.target_dir / ".claude").exists()
|
99
|
-
has_copilot = (self.target_dir / ".github" / "prompts").exists()
|
100
|
-
|
101
|
-
# Project kit files
|
102
|
-
if 'project' in self.kits:
|
103
|
-
if has_claude:
|
104
|
-
changes["new_files"].append(".claude/commands/orient.md")
|
105
|
-
if has_copilot:
|
106
|
-
changes["new_files"].append(".github/prompts/orient.prompt.md")
|
107
|
-
|
108
|
-
# Git kit files
|
109
|
-
if 'git' in self.kits:
|
110
|
-
if has_claude:
|
111
|
-
changes["new_files"].append(".claude/commands/commit.md")
|
112
|
-
changes["new_files"].append(".claude/commands/pr.md")
|
113
|
-
if has_copilot:
|
114
|
-
changes["new_files"].append(".github/prompts/commit.prompt.md")
|
115
|
-
changes["new_files"].append(".github/prompts/pr.prompt.md")
|
116
|
-
|
117
|
-
# Multiagent kit files
|
118
|
-
if 'multiagent' in self.kits and (self.target_dir / ".specify").exists():
|
119
|
-
changes["new_files"].extend([
|
120
|
-
".specify/memory/pr-workflow-guide.md",
|
121
|
-
".specify/memory/git-worktrees-protocol.md",
|
122
|
-
])
|
123
|
-
changes["new_directories"].append("specs/*/collaboration/ (created with new features)")
|
124
|
-
|
125
|
-
return changes
|
126
|
-
|
127
|
-
def install(self) -> Dict:
|
128
|
-
"""
|
129
|
-
Install multiagent features to target project.
|
130
|
-
|
131
|
-
Returns:
|
132
|
-
Dictionary with success status and installed items
|
133
|
-
"""
|
134
|
-
result = {
|
135
|
-
"success": False,
|
136
|
-
"installed": [],
|
137
|
-
"error": None,
|
138
|
-
}
|
139
|
-
|
140
|
-
try:
|
141
|
-
# Detect which interfaces are present
|
142
|
-
has_claude = (self.target_dir / ".claude").exists()
|
143
|
-
has_copilot = (self.target_dir / ".github" / "prompts").exists()
|
144
|
-
|
145
|
-
if not has_claude and not has_copilot:
|
146
|
-
result["error"] = "No supported AI interface found (.claude or .github/prompts)"
|
147
|
-
return result
|
148
|
-
|
149
|
-
# Install project kit
|
150
|
-
if 'project' in self.kits:
|
151
|
-
if has_claude:
|
152
|
-
self._install_file('project/claude/commands/orient.md', '.claude/commands/orient.md')
|
153
|
-
result["installed"].append("project-kit (Claude): /orient command")
|
154
|
-
|
155
|
-
if has_copilot:
|
156
|
-
self._install_file('project/github/prompts/orient.prompt.md', '.github/prompts/orient.prompt.md')
|
157
|
-
result["installed"].append("project-kit (Copilot): /orient command")
|
158
|
-
|
159
|
-
# Install git kit
|
160
|
-
if 'git' in self.kits:
|
161
|
-
if has_claude:
|
162
|
-
self._install_file('git/claude/commands/commit.md', '.claude/commands/commit.md')
|
163
|
-
self._install_file('git/claude/commands/pr.md', '.claude/commands/pr.md')
|
164
|
-
self._install_file('git/claude/commands/cleanup.md', '.claude/commands/cleanup.md')
|
165
|
-
result["installed"].append("git-kit (Claude): /commit, /pr, /cleanup commands")
|
166
|
-
|
167
|
-
if has_copilot:
|
168
|
-
self._install_file('git/github/prompts/commit.prompt.md', '.github/prompts/commit.prompt.md')
|
169
|
-
self._install_file('git/github/prompts/pr.prompt.md', '.github/prompts/pr.prompt.md')
|
170
|
-
self._install_file('git/github/prompts/cleanup.prompt.md', '.github/prompts/cleanup.prompt.md')
|
171
|
-
result["installed"].append("git-kit (Copilot): /commit, /pr, /cleanup commands")
|
172
|
-
|
173
|
-
# Install multiagent kit
|
174
|
-
if 'multiagent' in self.kits and (self.target_dir / ".specify").exists():
|
175
|
-
# Commands
|
176
|
-
if has_claude:
|
177
|
-
self._install_file('multiagent/claude/commands/sync.md', '.claude/commands/sync.md')
|
178
|
-
if has_copilot:
|
179
|
-
self._install_file('multiagent/github/prompts/sync.prompt.md', '.github/prompts/sync.prompt.md')
|
180
|
-
|
181
|
-
# Memory guides
|
182
|
-
self._install_file('multiagent/memory/pr-workflow-guide.md', '.specify/memory/pr-workflow-guide.md')
|
183
|
-
self._install_file('multiagent/memory/git-worktrees-protocol.md', '.specify/memory/git-worktrees-protocol.md')
|
184
|
-
self._install_file('multiagent/memory/parallel-work-protocol.md', '.specify/memory/parallel-work-protocol.md')
|
185
|
-
|
186
|
-
# Templates
|
187
|
-
templates_dir = self.target_dir / ".specify" / "templates"
|
188
|
-
templates_dir.mkdir(parents=True, exist_ok=True)
|
189
|
-
self._install_file('multiagent/templates/session-log.md', '.specify/templates/session-log.md')
|
190
|
-
self._install_file('multiagent/templates/handoff.md', '.specify/templates/handoff.md')
|
191
|
-
self._install_file('multiagent/templates/decision.md', '.specify/templates/decision.md')
|
192
|
-
self._install_file('multiagent/templates/collaboration-structure/README.md', '.specify/templates/collaboration-README.md')
|
193
|
-
|
194
|
-
result["installed"].append("multiagent-kit: /sync command")
|
195
|
-
result["installed"].append("multiagent-kit: Memory guides (PR workflow, git worktrees, parallel work)")
|
196
|
-
result["installed"].append("multiagent-kit: Templates (session-log, handoff, decision, collaboration)")
|
197
|
-
|
198
|
-
result["success"] = True
|
199
|
-
|
200
|
-
except Exception as e:
|
201
|
-
result["error"] = str(e)
|
202
|
-
|
203
|
-
return result
|
204
|
-
|
205
|
-
def validate(self) -> Dict:
|
206
|
-
"""
|
207
|
-
Validate kit installation.
|
208
|
-
|
209
|
-
Returns:
|
210
|
-
Dictionary with validation results
|
211
|
-
"""
|
212
|
-
checks = {}
|
213
|
-
|
214
|
-
# Check project-kit files
|
215
|
-
claude_orient = self.target_dir / ".claude" / "commands" / "orient.md"
|
216
|
-
copilot_orient = self.target_dir / ".github" / "prompts" / "orient.prompt.md"
|
217
|
-
|
218
|
-
project_kit_installed = claude_orient.exists() or copilot_orient.exists()
|
219
|
-
checks["project_kit"] = {
|
220
|
-
"passed": project_kit_installed,
|
221
|
-
"message": "project-kit: /orient command found" if project_kit_installed
|
222
|
-
else "project-kit not installed - run: lite-kits add --here --kit project",
|
223
|
-
}
|
224
|
-
|
225
|
-
# Check git-kit files
|
226
|
-
claude_commit = self.target_dir / ".claude" / "commands" / "commit.md"
|
227
|
-
claude_pr = self.target_dir / ".claude" / "commands" / "pr.md"
|
228
|
-
claude_cleanup = self.target_dir / ".claude" / "commands" / "cleanup.md"
|
229
|
-
|
230
|
-
git_kit_installed = claude_commit.exists() or claude_pr.exists() or claude_cleanup.exists()
|
231
|
-
checks["git_kit"] = {
|
232
|
-
"passed": git_kit_installed,
|
233
|
-
"message": "git-kit: /commit, /pr, /cleanup commands found" if git_kit_installed
|
234
|
-
else "git-kit not installed - run: lite-kits add --here --kit git",
|
235
|
-
}
|
236
|
-
|
237
|
-
# Check multiagent-kit files (only if user is checking for them)
|
238
|
-
claude_sync = self.target_dir / ".claude" / "commands" / "sync.md"
|
239
|
-
pr_guide = self.target_dir / ".specify" / "memory" / "pr-workflow-guide.md"
|
240
|
-
worktree_guide = self.target_dir / ".specify" / "memory" / "git-worktrees-protocol.md"
|
241
|
-
|
242
|
-
multiagent_kit_installed = claude_sync.exists() or pr_guide.exists() or worktree_guide.exists()
|
243
|
-
checks["multiagent_kit"] = {
|
244
|
-
"passed": multiagent_kit_installed,
|
245
|
-
"message": "multiagent-kit: /sync command and memory guides found" if multiagent_kit_installed
|
246
|
-
else "multiagent-kit not installed - run: lite-kits add --here --kit multiagent",
|
247
|
-
}
|
248
|
-
|
249
|
-
# Only fail validation if NO kits are installed
|
250
|
-
# If they only installed project+git, don't fail on missing multiagent
|
251
|
-
all_passed = checks["project_kit"]["passed"] or checks["git_kit"]["passed"] or checks["multiagent_kit"]["passed"]
|
252
|
-
|
253
|
-
return {
|
254
|
-
"valid": all_passed,
|
255
|
-
"checks": checks,
|
256
|
-
}
|
257
|
-
|
258
|
-
# Private installation methods
|
259
|
-
|
260
|
-
def _install_file(self, kit_relative_path: str, target_relative_path: str):
|
261
|
-
"""
|
262
|
-
Install a file from kits directory to target project.
|
263
|
-
|
264
|
-
Args:
|
265
|
-
kit_relative_path: Path relative to kits/ directory (e.g., 'project/claude/commands/orient.md')
|
266
|
-
target_relative_path: Path relative to target directory (e.g., '.claude/commands/orient.md')
|
267
|
-
"""
|
268
|
-
source = self.kits_dir / kit_relative_path
|
269
|
-
target = self.target_dir / target_relative_path
|
270
|
-
|
271
|
-
if not source.exists():
|
272
|
-
raise FileNotFoundError(f"Kit file not found: {source}")
|
273
|
-
|
274
|
-
target.parent.mkdir(parents=True, exist_ok=True)
|
275
|
-
shutil.copy2(source, target)
|
276
|
-
|
277
|
-
# TODO: Implement these methods
|
278
|
-
|
279
|
-
def _merge_constitution(self):
|
280
|
-
"""
|
281
|
-
Merge multiagent sections into existing constitution.
|
282
|
-
|
283
|
-
Strategy:
|
284
|
-
1. Read existing constitution
|
285
|
-
2. Check for multiagent marker (<!-- MULTIAGENT-START -->)
|
286
|
-
3. If marker exists, replace section
|
287
|
-
4. If marker missing, append section
|
288
|
-
5. Preserve user edits outside markers
|
289
|
-
"""
|
290
|
-
# TODO: Implement smart merge logic
|
291
|
-
# - Read templates/enhancements/constitution-multiagent.md
|
292
|
-
# - Merge into .specify/memory/constitution.md
|
293
|
-
# - Use marker comments for idempotent updates
|
294
|
-
pass
|
295
|
-
|
296
|
-
def _install_collaboration_template(self):
|
297
|
-
"""
|
298
|
-
Create collaboration directory template.
|
299
|
-
|
300
|
-
Creates:
|
301
|
-
- .specify/templates/collaboration-template/
|
302
|
-
- Scripts reference this when creating new features
|
303
|
-
"""
|
304
|
-
# TODO: Create collaboration directory template
|
305
|
-
# - active/
|
306
|
-
# - archive/
|
307
|
-
# - results/
|
308
|
-
pass
|
309
|
-
|
310
|
-
def remove(self) -> Dict:
|
311
|
-
"""
|
312
|
-
Remove multiagent features from project.
|
313
|
-
|
314
|
-
Returns to vanilla spec-kit state.
|
315
|
-
|
316
|
-
Returns:
|
317
|
-
Dictionary with success status and removed items
|
318
|
-
"""
|
319
|
-
result = {
|
320
|
-
"success": False,
|
321
|
-
"removed": [],
|
322
|
-
"error": None,
|
323
|
-
}
|
324
|
-
|
325
|
-
try:
|
326
|
-
# Remove project kit files
|
327
|
-
if 'project' in self.kits:
|
328
|
-
removed = []
|
329
|
-
# Claude
|
330
|
-
orient_claude = self.target_dir / ".claude" / "commands" / "orient.md"
|
331
|
-
if orient_claude.exists():
|
332
|
-
orient_claude.unlink()
|
333
|
-
removed.append(".claude/commands/orient.md")
|
334
|
-
|
335
|
-
# Copilot
|
336
|
-
orient_copilot = self.target_dir / ".github" / "prompts" / "orient.prompt.md"
|
337
|
-
if orient_copilot.exists():
|
338
|
-
orient_copilot.unlink()
|
339
|
-
removed.append(".github/prompts/orient.prompt.md")
|
340
|
-
|
341
|
-
if removed:
|
342
|
-
result["removed"].append(f"project-kit: {', '.join(removed)}")
|
343
|
-
|
344
|
-
# Remove git kit files
|
345
|
-
if 'git' in self.kits:
|
346
|
-
removed = []
|
347
|
-
git_commands = ['commit', 'pr', 'cleanup']
|
348
|
-
|
349
|
-
# Claude
|
350
|
-
for cmd in git_commands:
|
351
|
-
cmd_file = self.target_dir / ".claude" / "commands" / f"{cmd}.md"
|
352
|
-
if cmd_file.exists():
|
353
|
-
cmd_file.unlink()
|
354
|
-
removed.append(f".claude/commands/{cmd}.md")
|
355
|
-
|
356
|
-
# Copilot
|
357
|
-
for cmd in git_commands:
|
358
|
-
cmd_file = self.target_dir / ".github" / "prompts" / f"{cmd}.prompt.md"
|
359
|
-
if cmd_file.exists():
|
360
|
-
cmd_file.unlink()
|
361
|
-
removed.append(f".github/prompts/{cmd}.prompt.md")
|
362
|
-
|
363
|
-
if removed:
|
364
|
-
result["removed"].append(f"git-kit: {', '.join(removed)}")
|
365
|
-
|
366
|
-
# Remove multiagent kit files
|
367
|
-
if 'multiagent' in self.kits:
|
368
|
-
removed = []
|
369
|
-
|
370
|
-
# Sync command
|
371
|
-
sync_claude = self.target_dir / ".claude" / "commands" / "sync.md"
|
372
|
-
if sync_claude.exists():
|
373
|
-
sync_claude.unlink()
|
374
|
-
removed.append(".claude/commands/sync.md")
|
375
|
-
|
376
|
-
sync_copilot = self.target_dir / ".github" / "prompts" / "sync.prompt.md"
|
377
|
-
if sync_copilot.exists():
|
378
|
-
sync_copilot.unlink()
|
379
|
-
removed.append(".github/prompts/sync.prompt.md")
|
380
|
-
|
381
|
-
# Memory guides
|
382
|
-
memory_files = [
|
383
|
-
'pr-workflow-guide.md',
|
384
|
-
'git-worktrees-protocol.md',
|
385
|
-
'parallel-work-protocol.md',
|
386
|
-
]
|
387
|
-
for file in memory_files:
|
388
|
-
file_path = self.target_dir / ".specify" / "memory" / file
|
389
|
-
if file_path.exists():
|
390
|
-
file_path.unlink()
|
391
|
-
removed.append(f".specify/memory/{file}")
|
392
|
-
|
393
|
-
# Templates
|
394
|
-
template_files = [
|
395
|
-
'session-log.md',
|
396
|
-
'handoff.md',
|
397
|
-
'decision.md',
|
398
|
-
'collaboration-README.md',
|
399
|
-
]
|
400
|
-
for file in template_files:
|
401
|
-
file_path = self.target_dir / ".specify" / "templates" / file
|
402
|
-
if file_path.exists():
|
403
|
-
file_path.unlink()
|
404
|
-
removed.append(f".specify/templates/{file}")
|
405
|
-
|
406
|
-
if removed:
|
407
|
-
result["removed"].append(f"multiagent-kit: {', '.join(removed)}")
|
408
|
-
|
409
|
-
# Note: Preserve collaboration directories (user data)
|
410
|
-
# Note: Preserve vanilla spec-kit files
|
411
|
-
|
412
|
-
result["success"] = True
|
413
|
-
|
414
|
-
except Exception as e:
|
415
|
-
result["error"] = str(e)
|
416
|
-
|
417
|
-
return result
|