toga-ai 1.0.32 → 1.0.33
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.
- package/package.json +1 -1
- package/scripts/install.js +40 -5
- package/skills/kickoff/SKILL.md +33 -6
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -661,13 +661,28 @@ function main() {
|
|
|
661
661
|
const ok = mergeSettings(claudeDir, harnessDir);
|
|
662
662
|
console.log(' ' + (ok ? '✓' : '✗') + ' Hooks (' + hooksCount + ' scripts in .claude/hooks/toga/, settings.json merged)');
|
|
663
663
|
|
|
664
|
-
//
|
|
664
|
+
// Contexts — mode context files (dev/research/review), update if changed
|
|
665
|
+
const contextsSrc = path.join(harnessDir, 'contexts');
|
|
666
|
+
const contextsDest = path.join(claudeDir, 'contexts', 'toga');
|
|
667
|
+
if (fs.existsSync(contextsSrc)) {
|
|
668
|
+
let contextsStats = { added: 0, updated: 0, unchanged: 0 };
|
|
669
|
+
try { contextsStats = copyDir(contextsSrc, contextsDest, { updateIfChanged: true }); }
|
|
670
|
+
catch (e) { errors.push('contexts: ' + e.message); }
|
|
671
|
+
console.log(' ✓ Contexts (' + countMd(contextsDest) + '): ' + fmtStats(contextsStats));
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
// MCP example — update if changed so teammates get new server configs
|
|
665
675
|
const mcpSrc = path.join(harnessDir, 'mcp-configs', 'mcp-servers.json');
|
|
666
676
|
const mcpDest = path.join(claudeDir, 'mcp-servers.example.json');
|
|
667
|
-
if (fs.existsSync(mcpSrc)
|
|
668
|
-
try {
|
|
669
|
-
|
|
670
|
-
|
|
677
|
+
if (fs.existsSync(mcpSrc)) {
|
|
678
|
+
try {
|
|
679
|
+
const firstInstall = !fs.existsSync(mcpDest);
|
|
680
|
+
const incoming = fs.readFileSync(mcpSrc);
|
|
681
|
+
if (firstInstall || !incoming.equals(fs.readFileSync(mcpDest))) {
|
|
682
|
+
fs.copyFileSync(mcpSrc, mcpDest);
|
|
683
|
+
console.log(' ✓ MCP (.claude/mcp-servers.example.json ' + (firstInstall ? 'created' : 'updated') + ' — merge into .mcp.json to enable)');
|
|
684
|
+
}
|
|
685
|
+
} catch (e) { errors.push('mcp: ' + e.message); }
|
|
671
686
|
}
|
|
672
687
|
|
|
673
688
|
// Knowledge — git repo if available (has team-captured docs), else npm bundle
|
|
@@ -697,6 +712,26 @@ function main() {
|
|
|
697
712
|
}
|
|
698
713
|
console.log(' ✓ Knowledge (' + countMd(knowledgeDest) + ' docs): ' + fmtStats(knowledgeStats));
|
|
699
714
|
|
|
715
|
+
// registry.json — the repo↔project↔framework map every skill depends on.
|
|
716
|
+
// Force-sync explicitly from the newest source (git if pulled, else bundle) so a
|
|
717
|
+
// partial knowledge copy can never leave a machine without/with a stale registry.
|
|
718
|
+
const registrySrc = path.join(knowledgeDir, 'knowledge', 'registry.json');
|
|
719
|
+
const registryDest = path.join(knowledgeDest, 'registry.json');
|
|
720
|
+
if (fs.existsSync(registrySrc)) {
|
|
721
|
+
try {
|
|
722
|
+
fs.copyFileSync(registrySrc, registryDest);
|
|
723
|
+
let repoCount = 0;
|
|
724
|
+
try {
|
|
725
|
+
const reg = JSON.parse(fs.readFileSync(registryDest, 'utf8'));
|
|
726
|
+
repoCount = Array.isArray(reg) ? reg.length : 0;
|
|
727
|
+
} catch (e) {}
|
|
728
|
+
console.log(' ✓ Registry (' + repoCount + ' repos): synced from ' + (knowledgeDir !== PACKAGE_ROOT ? 'git repo' : 'npm bundle'));
|
|
729
|
+
} catch (e) { errors.push('registry.json: ' + e.message); }
|
|
730
|
+
} else {
|
|
731
|
+
errors.push('registry.json: missing from source ' + registrySrc);
|
|
732
|
+
console.log(' ✗ Registry MISSING from source — kickoff will not work. Re-run: npm cache clean --force && npx toga-ai@latest');
|
|
733
|
+
}
|
|
734
|
+
|
|
700
735
|
// CLAUDE.md
|
|
701
736
|
const action = updateClaudeMd(projectRoot, skillNames, harnessDir, 'npm bundle v' + bundleVersion);
|
|
702
737
|
console.log(' ✓ CLAUDE.md ' + action);
|
package/skills/kickoff/SKILL.md
CHANGED
|
@@ -5,7 +5,18 @@ description: Start-of-session context loader for TOGA Technology projects. Run t
|
|
|
5
5
|
|
|
6
6
|
# Kickoff — prime a coding session from the team knowledge base
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Arguments — text passed after `/kickoff` never skips any step
|
|
9
|
+
|
|
10
|
+
`/kickoff` may be invoked with trailing text (e.g. `/kickoff worker2 backend fix for Compass`).
|
|
11
|
+
That text is the developer's description of today's work — it is **not** permission to
|
|
12
|
+
shortcut the flow.
|
|
13
|
+
|
|
14
|
+
- **Step 0 (auto-update check) ALWAYS runs first**, with or without arguments.
|
|
15
|
+
- Use the argument text to **pre-fill answers** to the Step 2 interview (framework, layer,
|
|
16
|
+
repo, client, task). Only ask about whatever is still missing or ambiguous.
|
|
17
|
+
- Never treat the argument as an instruction to start coding before Steps 0–5 complete.
|
|
18
|
+
|
|
19
|
+
## Step 0 — Auto-update check (runs before anything else, even with arguments)
|
|
9
20
|
|
|
10
21
|
Before loading any context, check whether the installed harness is up to date:
|
|
11
22
|
|
|
@@ -20,17 +31,33 @@ LATEST=$(node -e "const {execSync}=require('child_process');try{process.stdout.w
|
|
|
20
31
|
|
|
21
32
|
**If `INSTALLED` equals `LATEST`** — already up to date. Continue to Step 1.
|
|
22
33
|
|
|
23
|
-
**If `INSTALLED` differs from `LATEST`** — auto-upgrade now, then
|
|
34
|
+
**If `INSTALLED` differs from `LATEST`** — auto-upgrade now, then **verify** before continuing:
|
|
24
35
|
|
|
25
36
|
```bash
|
|
26
37
|
npx toga-ai@latest
|
|
27
38
|
```
|
|
28
39
|
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
After the upgrade, re-read the version file to confirm it actually updated — npx can
|
|
41
|
+
serve a stale cached package (common on Windows), in which case the installer ran but
|
|
42
|
+
installed the old version again:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
NOW=$(cat .claude/toga-ai.version 2>/dev/null || echo "unknown")
|
|
46
|
+
```
|
|
31
47
|
|
|
32
|
-
If
|
|
33
|
-
> "
|
|
48
|
+
- **If `NOW` equals `LATEST`** — success. Tell the developer:
|
|
49
|
+
> "Updated toga-ai from v`INSTALLED` → v`LATEST`. Skills, agents, knowledge, and registry refreshed."
|
|
50
|
+
- **If `NOW` still differs from `LATEST`** — stale npx cache. Retry once with a clean cache:
|
|
51
|
+
```bash
|
|
52
|
+
npm cache clean --force && npx toga-ai@latest
|
|
53
|
+
```
|
|
54
|
+
Re-read the version file again. If it now equals `LATEST`, report success as above.
|
|
55
|
+
- **If still stale after the cache-clean retry, or the upgrade command failed** — warn and
|
|
56
|
+
continue; a stale install beats a blocked session:
|
|
57
|
+
> "⚠ Auto-update to v`LATEST` failed (still on v`NOW`). Run `npm cache clean --force && npx toga-ai@latest` manually when convenient."
|
|
58
|
+
|
|
59
|
+
Never report the update as done based on the command exiting cleanly — only the version
|
|
60
|
+
file equaling `LATEST` counts as success.
|
|
34
61
|
|
|
35
62
|
|
|
36
63
|
|