synarcx 0.1.0 → 0.2.1

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.
Files changed (51) hide show
  1. package/README.md +240 -34
  2. package/dist/commands/config.js +7 -6
  3. package/dist/core/command-generation/adapters/bob.js +7 -20
  4. package/dist/core/command-generation/adapters/claude.js +9 -29
  5. package/dist/core/command-generation/adapters/cursor.js +9 -22
  6. package/dist/core/command-generation/adapters/pi.js +6 -19
  7. package/dist/core/command-generation/adapters/windsurf.js +9 -29
  8. package/dist/core/command-generation/yaml-utils.d.ts +3 -0
  9. package/dist/core/command-generation/yaml-utils.js +12 -0
  10. package/dist/core/completions/installers/bash-installer.d.ts +1 -0
  11. package/dist/core/completions/installers/bash-installer.js +14 -3
  12. package/dist/core/completions/installers/powershell-installer.d.ts +1 -0
  13. package/dist/core/completions/installers/powershell-installer.js +18 -10
  14. package/dist/core/config.js +0 -3
  15. package/dist/core/index.js +1 -1
  16. package/dist/core/init.d.ts +0 -2
  17. package/dist/core/init.js +27 -75
  18. package/dist/core/migration.js +1 -2
  19. package/dist/core/profile-sync-drift.d.ts +0 -7
  20. package/dist/core/profile-sync-drift.js +2 -15
  21. package/dist/core/profiles.d.ts +0 -11
  22. package/dist/core/profiles.js +1 -18
  23. package/dist/core/shared/artifact-cleanup.d.ts +5 -0
  24. package/dist/core/shared/artifact-cleanup.js +89 -0
  25. package/dist/core/shared/skill-generation.js +5 -1
  26. package/dist/core/shared/tool-detection.d.ts +4 -10
  27. package/dist/core/shared/tool-detection.js +3 -27
  28. package/dist/core/shared/workflow-registry.d.ts +40 -0
  29. package/dist/core/shared/workflow-registry.js +19 -0
  30. package/dist/core/templates/skill-templates.d.ts +2 -0
  31. package/dist/core/templates/skill-templates.js +2 -0
  32. package/dist/core/templates/types.d.ts +7 -0
  33. package/dist/core/templates/types.js +9 -1
  34. package/dist/core/templates/workflows/analyze.js +84 -84
  35. package/dist/core/templates/workflows/apply-change.js +291 -291
  36. package/dist/core/templates/workflows/archive-change.js +254 -254
  37. package/dist/core/templates/workflows/clarify.js +91 -91
  38. package/dist/core/templates/workflows/debug.js +104 -104
  39. package/dist/core/templates/workflows/explore.js +462 -462
  40. package/dist/core/templates/workflows/propose.js +199 -199
  41. package/dist/core/templates/workflows/quick.d.ts +4 -0
  42. package/dist/core/templates/workflows/quick.js +129 -0
  43. package/dist/core/templates/workflows/refactor.d.ts +4 -0
  44. package/dist/core/templates/workflows/refactor.js +126 -0
  45. package/dist/core/templates/workflows/sync.js +152 -95
  46. package/dist/core/update.d.ts +1 -21
  47. package/dist/core/update.js +18 -117
  48. package/dist/core/view.js +8 -8
  49. package/dist/core/workspace/open-surface.d.ts +2 -2
  50. package/dist/core/workspace/open-surface.js +13 -13
  51. package/package.json +84 -76
@@ -0,0 +1,126 @@
1
+ import { commandFromSkill } from '../types.js';
2
+ export function getSynRefactorSkillTemplate() {
3
+ return {
4
+ name: 'syn-refactor',
5
+ description: 'Investigate structural changes that must not alter behavior. Entry point for refactoring — explores, then hands off to /syn:propose.',
6
+ instructions: `Investigate a structural refactoring opportunity. Focuses on improving code structure without changing observable behavior. When thinking is clear, explicitly prompts the user to run \`/syn:propose\` — does NOT auto-create artifacts.
7
+
8
+ **Input**: The user can describe what they want to restructure, or just run the command to start exploring.
9
+
10
+ ---
11
+
12
+ ## Initial Context
13
+
14
+ Check for existing context:
15
+ \`\`\`bash
16
+ synarcx list --json
17
+ \`\`\`
18
+
19
+ If a relevant change exists, read its artifacts. Otherwise, start fresh.
20
+
21
+ ---
22
+
23
+ ## Reframing the Problem
24
+
25
+ This is a structural-change investigation. The goal is to improve code organization, reduce duplication, increase cohesion, or decrease coupling — without changing what the system does.
26
+
27
+ ### Opening Question
28
+
29
+ Start by asking (use AskUserQuestion tool, open-ended):
30
+ > "What part of the codebase feels like it needs restructuring?"
31
+
32
+ Let the user describe the pain point before diving in.
33
+
34
+ ---
35
+
36
+ ## Investigation
37
+
38
+ Explore the codebase to understand the current structure:
39
+
40
+ 1. **Map the current shape** — read relevant source files, identify:
41
+ - Module boundaries and responsibilities
42
+ - Dependency direction
43
+ - Code duplication or overlapping concerns
44
+ - Testing patterns
45
+
46
+ 2. **Identify the target shape** — work with the user to define:
47
+ - What the ideal structure would look like
48
+ - Which modules or files move where
49
+ - How dependencies should flow
50
+
51
+ 3. **Surface risks** — flag areas of concern:
52
+ - Implicit dependencies that aren't visible in imports
53
+ - Areas where refactoring could make things worse
54
+ - Testing hazards (brittle tests, high coupling to internals)
55
+
56
+ 4. **Visualize** — use ASCII diagrams to show:
57
+ - Current vs. target module structure
58
+ - Dependency direction changes
59
+ - File/move relationships
60
+
61
+ ---
62
+
63
+ ## Analyze-Gate Note (for the /syn:analyze phase)
64
+
65
+ When a proposal is created from this investigation, the analyze phase MUST check:
66
+ - Does the proposed change alter any public API signature?
67
+ - Does it change output format, error messages, or user-facing behavior?
68
+ - Does it add new functionality beyond what existed?
69
+
70
+ If any of these is true → flag as a **behavior contract violation** and suggest reclassifying as a feature (not a refactor).
71
+
72
+ ---
73
+
74
+ ## Hand-Off
75
+
76
+ When the investigation reaches a clear conclusion, present findings and explicitly prompt:
77
+
78
+ \`\`\`
79
+ ### Refactoring Plan
80
+
81
+ **Current Shape**: <summary of current structure>
82
+ **Target Shape**: <proposed structure>
83
+ **Key Changes**: <list of structural moves>
84
+ **Risks**: <potential issues>
85
+
86
+ **Ready to formalize?** Run \`/syn:propose\` to create a change with these findings.
87
+ \`\`\`
88
+
89
+ Do NOT create any artifacts or start the pipeline. The user must explicitly run \`/syn:propose\`.`,
90
+ license: 'MIT',
91
+ compatibility: 'Requires synarcx CLI.',
92
+ metadata: { author: 'synarcx', version: '0.1' },
93
+ };
94
+ }
95
+ export function getSynRefactorCommandTemplate() {
96
+ return commandFromSkill(getSynRefactorSkillTemplate(), {
97
+ name: 'syn:refactor',
98
+ description: 'Investigate structural refactoring — map current vs. target shape, then hands off to /syn:propose',
99
+ tags: ['workflow', 'refactor', 'restructure'],
100
+ content: `Investigate a structural refactoring opportunity. Focuses on improving code structure without changing observable behavior. When thinking is clear, explicitly prompts the user to run \`/syn:propose\` — does NOT auto-create artifacts.
101
+
102
+ **Input**: The argument after \`/syn:refactor\` describes what the user wants to restructure.
103
+
104
+ ---
105
+
106
+ ## Investigation
107
+
108
+ 1. **Map the current shape** — read relevant source files, identify module boundaries, dependencies, duplication.
109
+ 2. **Identify the target shape** — define what the ideal structure looks like.
110
+ 3. **Surface risks** — flag implicit dependencies, testing hazards, areas that could get worse.
111
+ 4. **Visualize** — use ASCII diagrams to show current vs. target structure.
112
+
113
+ ---
114
+
115
+ ## Analyze-Gate Note
116
+
117
+ When artifacts are created, the analyze phase MUST check for behavior contract violations — no public API changes, no output format changes, no new functionality. If violated, flag and suggest reclassifying as a feature.
118
+
119
+ ---
120
+
121
+ ## Hand-Off
122
+
123
+ Present a summary with Current Shape, Target Shape, Key Changes, and Risks. Then explicitly prompt: "Ready to formalize? Run \`/syn:propose\` to create a change with these findings."`
124
+ });
125
+ }
126
+ //# sourceMappingURL=refactor.js.map
@@ -1,108 +1,165 @@
1
+ import { commandFromSkill } from '../types.js';
1
2
  export function getSynSyncSkillTemplate() {
2
3
  return {
3
4
  name: 'syn-sync',
4
- description: 'Auto-generate or update synspec/constitution.md from project files (README, AGENTS.md, package.json, src structure) with semver versioning and Sync Impact Report.',
5
- instructions: `Generate or update the project constitution — a living document in \`synspec/constitution.md\` that captures the project's purpose, principles, tech stack, conventions, architecture, and decision log.
6
-
7
- **Input**: The user can specify a description of what to focus on, or just run the command to regenerate from sources.
8
-
9
- ---
10
-
11
- ## First Run
12
-
13
- 1. **Read project sources**
14
- - \`README.md\` — project description, features, purpose
15
- - \`AGENTS.md\` AI agent conventions
16
- - \`package.json\` dependencies, scripts, metadata
17
- - \`src/\` structure code organization (top-level directories)
18
-
19
- 2. **Generate \`synspec/constitution.md\`** with these sections:
20
- - \`# Constitution: <project-name>\` derived from package.json name
21
- - \`Version: 0.1.0\`
22
- - \`## Purpose\` 2-3 sentences from README
23
- - \`## Principles\` key design principles inferred from codebase
24
- - \`## Tech Stack\` languages, frameworks, key dependencies
25
- - \`## Conventions\` code style, naming, patterns observed
26
- - \`## Architecture\` high-level structure overview
27
- - \`## Decision Log\` table with Date, Decision, Rationale
28
-
29
- 3. **Verify** the file was created at \`synspec/constitution.md\`
30
-
31
- ---
32
-
33
- ## Re-run (Update)
34
-
35
- When re-run, offer a semver bump choice:
36
- - **MAJOR**constitution structure changed or reorganized
37
- - **MINOR**new section added
38
- - **PATCH**content update, typo fixes
39
-
40
- Append a Sync Impact Report as an HTML comment at the top:
41
- \`\`\`
42
- <!-- Sync Impact: MAJOR — constitution structure reorganized -->
43
- \`\`\`
44
-
45
- ---
46
-
47
- ## Output
48
-
49
- After completion, summarize what was created or updated, and note the version.`,
5
+ description: 'Generate or update synspec/constitution.md with README validation, supporting file scan, guardrail Q&A, and structured constitution generation.',
6
+ instructions: `Generate or update the project constitution — a living document in \`synspec/constitution.md\` that captures validated project context.
7
+
8
+ **Input**: The user can specify a focus area, or just run the command to proceed through the validation flow.
9
+
10
+ ---
11
+
12
+ ## README Gate (Required)
13
+
14
+ Before any generation, the README MUST pass quality validation.
15
+
16
+ 1. **Check that README.md exists and is not empty.**
17
+ - If missing or blank → stop, output: "SYNC BLOCKED: README.md is missing or empty. Please write a README that describes what this project does and what problem it solves, then re-run \`/syn:sync\`."
18
+ - Do NOT write any files. Do NOT proceed.
19
+
20
+ 2. **Check that README meaningfully describes the project.**
21
+ - A passing README must have both:
22
+ - At least one sentence describing what the project does
23
+ - At least one sentence describing the problem it solves or who it is for
24
+ - AI judges quality at runtime. Examples of THIN content that should fail:
25
+ - Only a title and install instructions
26
+ - Auto-generated placeholder text ("# My Project", "## Getting Started")
27
+ - Single-line descriptions with no substance
28
+ - If README is too thin stop, output: "SYNC BLOCKED: README is too thin. A passing README must describe (1) what the project does and (2) what problem it solves, in at least one sentence each. Please update README.md and re-run \`/syn:sync\`."
29
+
30
+ 3. **If README passes**, proceed to the next phase.
31
+
32
+ ---
33
+
34
+ ## Supporting File Scan
35
+
36
+ After README passes, read supporting project files for context:
37
+ - \`AGENTS.md\`AI agent conventions
38
+ - \`package.json\`dependencies, scripts, metadata
39
+ - \`src/\` structure code organization (top-level directories)
40
+ - Any other notable config files (\`tsconfig.json\`, \`.eslintrc.*\`, etc.)
41
+
42
+ Note what information is already well-covered by the README so guardrail questions avoid repeating it.
43
+
44
+ ---
45
+
46
+ ## Guardrail Q&A
47
+
48
+ Generate up to 5 targeted questions. Each question should probe areas that CANNOT be reliably inferred from code or README alone:
49
+
50
+ | Topic Area | Example Question |
51
+ |------------|-----------------|
52
+ | Off-limits areas | "Are there any parts of the codebase AI should never modify?" |
53
+ | Hard constraints | "Are there compliance, security, or infrastructure constraints?" |
54
+ | Coding rules | "Are there coding conventions not obvious from the code?" |
55
+ | Out-of-scope | "What is explicitly out of scope for this project right now?" |
56
+ | Dependencies | "Are there any planned or pending dependency changes?" |
57
+
58
+ **Rules:**
59
+ - Adapt questions to the project's stack, structure, and domain — don't ask generic questions that don't apply
60
+ - Skip questions already answered by the README, AGENTS.md, or other supporting files
61
+ - Maximum 5 questions per session
62
+ - Ask one at a time using the AskUserQuestion tool, wait for each answer
63
+
64
+ ---
65
+
66
+ ## Constitution Generation
67
+
68
+ With README validated, supporting files scanned, and Q&A answers collected, generate \`synspec/constitution.md\` with these sections:
69
+
70
+ 1. **\`# Constitution: <project-name>\`** — derived from package.json name, with Version field
71
+ 2. **\`## Purpose\`** — 2-3 sentences synthesized from README
72
+ 3. **\`## Principles\`** — key design principles inferred from codebase and Q&A
73
+ 4. **\`## Tech Stack\`** — languages, frameworks, key dependencies from package.json
74
+ 5. **\`## Constraints\`** — from Q&A answers: hard constraints, compliance, infra limits
75
+ 6. **\`## Off-Limits\`** — from Q&A answers: areas AI must not touch, out-of-scope items
76
+ 7. **\`## Conventions\`** — code style, naming, patterns observed from code and AGENTS.md
77
+ 8. **\`## Architecture\`** — high-level structure overview from src/ scan
78
+ 9. **\`## Decision Log\`** — table with Date, Decision, Rationale (append-only)
79
+
80
+ **The Constraints and Off-Limits sections MUST be written from Q&A answers, not inferred from docs.**
81
+
82
+ ---
83
+
84
+ ## Re-run (Update)
85
+
86
+ When re-run and \`synspec/constitution.md\` already exists, still run the README gate — README may have degraded since last sync. Offer a semver bump choice:
87
+ - **MAJOR** — constitution structure changed or reorganized
88
+ - **MINOR** — new section added
89
+ - **PATCH** — content update, typo fixes
90
+
91
+ Append a Sync Impact Report as an HTML comment at the top:
92
+ \`\`\`
93
+ <!-- Sync Impact: MAJOR — constitution structure reorganized -->
94
+ \`\`\`
95
+
96
+ ---
97
+
98
+ ## Output
99
+
100
+ After completion, summarize what was created or updated, note the version, and list how many Q&A questions were answered.`,
50
101
  license: 'MIT',
51
102
  compatibility: 'Requires synarcx CLI.',
52
103
  metadata: { author: 'synarcx', version: '0.1' },
53
104
  };
54
105
  }
55
106
  export function getSynSyncCommandTemplate() {
56
- return {
107
+ return commandFromSkill(getSynSyncSkillTemplate(), {
57
108
  name: 'syn:sync',
58
- description: 'Auto-generate or update synspec/constitution.md from project files',
59
- category: 'Workflow',
109
+ description: 'Generate/update project constitution with README validation, guardrail Q&A, and constraint capture',
60
110
  tags: ['workflow', 'sync', 'project'],
61
- content: `Generate or update the project constitution — a living document in \`synspec/constitution.md\` that captures the project's purpose, principles, tech stack, conventions, architecture, and decision log.
62
-
63
- **Input**: The user can specify a description of what to focus on, or just run the command to regenerate from sources.
64
-
65
- ---
66
-
67
- ## First Run
68
-
69
- 1. **Read project sources**
70
- - \`README.md\` — project description, features, purpose
71
- - \`AGENTS.md\` AI agent conventions
72
- - \`package.json\` dependencies, scripts, metadata
73
- - \`src/\` structure code organization (top-level directories)
74
-
75
- 2. **Generate \`synspec/constitution.md\`** with these sections:
76
- - \`# Constitution: <project-name>\` derived from package.json name
77
- - \`Version: 0.1.0\`
78
- - \`## Purpose\` 2-3 sentences from README
79
- - \`## Principles\` — key design principles inferred from codebase
80
- - \`## Tech Stack\` — languages, frameworks, key dependencies
81
- - \`## Conventions\` — code style, naming, patterns observed
82
- - \`## Architecture\` — high-level structure overview
83
- - \`## Decision Log\` — table with Date, Decision, Rationale
84
-
85
- 3. **Verify** the file was created at \`synspec/constitution.md\`
86
-
87
- ---
88
-
89
- ## Re-run (Update)
90
-
91
- When re-run, offer a semver bump choice:
92
- - **MAJOR** constitution structure changed or reorganized
93
- - **MINOR** — new section added
94
- - **PATCH** — content update, typo fixes
95
-
96
- Append a Sync Impact Report as an HTML comment at the top:
97
- \`\`\`
98
- <!-- Sync Impact: MAJOR constitution structure reorganized -->
99
- \`\`\`
100
-
101
- ---
102
-
103
- ## Output
104
-
105
- After completion, summarize what was created or updated, and note the version.`
106
- };
111
+ content: `Generate or update the project constitution — a living document in \`synspec/constitution.md\` that captures validated project context.
112
+
113
+ **Input**: The user can specify a focus area, or just run the command to proceed through the validation flow.
114
+
115
+ ---
116
+
117
+ ## README Gate (Required)
118
+
119
+ Before any generation, the README MUST pass quality validation.
120
+
121
+ 1. **Check that README.md exists and is not empty.**
122
+ - If missing or blank → stop with message explaining README must exist and describe the project.
123
+ - Do NOT write any files.
124
+
125
+ 2. **Check that README meaningfully describes the project.**
126
+ - A passing README must have both: (1) what the project does, (2) what problem it solves.
127
+ - AI judges quality at runtime.
128
+ - If too thin stop with message explaining what's needed.
129
+
130
+ 3. **If README passes**, proceed.
131
+
132
+ ---
133
+
134
+ ## Supporting File Scan
135
+
136
+ Read AGENTS.md, package.json, src/ structure, and other notable config files. Note what's already covered by README to avoid redundant questions.
137
+
138
+ ---
139
+
140
+ ## Guardrail Q&A
141
+
142
+ Generate up to 5 targeted questions about off-limits areas, hard constraints, coding rules, out-of-scope items, and dependency plans. Adapt to the project's stack and domain. Skip questions already answered by README or supporting files.
143
+
144
+ ---
145
+
146
+ ## Constitution Generation
147
+
148
+ Generate \`synspec/constitution.md\` with sections: Purpose, Principles, Tech Stack, Constraints (from Q&A), Off-Limits (from Q&A), Conventions, Architecture, Decision Log.
149
+
150
+ **Constraints and Off-Limits MUST come from Q&A answers, not inferred.**
151
+
152
+ ---
153
+
154
+ ## Re-run (Update)
155
+
156
+ Still run the README gate even when constitution exists — README may have degraded. Offer semver bump. Append Sync Impact Report HTML comment.
157
+
158
+ ---
159
+
160
+ ## Output
161
+
162
+ Summarize what was created/updated, note the version, and show how many Q&A questions were answered.`
163
+ });
107
164
  }
108
165
  //# sourceMappingURL=sync.js.map
@@ -44,27 +44,7 @@ export declare class UpdateCommand {
44
44
  */
45
45
  private displayOldCoreCustomProfileNote;
46
46
  /**
47
- * Removes skill directories for workflows when delivery changed to commands-only.
48
- * Returns the number of directories removed.
49
- */
50
- private removeSkillDirs;
51
- /**
52
- * Removes skill directories for workflows that are no longer selected in the active profile.
53
- * Returns the number of directories removed.
54
- */
55
- private removeUnselectedSkillDirs;
56
- /**
57
- * Removes command files for workflows when delivery changed to skills-only.
58
- * Returns the number of files removed.
59
- */
60
- private removeCommandFiles;
61
- /**
62
- * Removes command files for workflows that are no longer selected in the active profile.
63
- * Returns the number of files removed.
64
- */
65
- private removeUnselectedCommandFiles;
66
- /**
67
- * Detect and handle legacy OpenSpec artifacts.
47
+ * Detect and handle legacy artifacts.
68
48
  * Unlike init, update warns but continues if legacy files found in non-interactive mode.
69
49
  * Returns array of tool IDs that were newly configured during legacy upgrade.
70
50
  */
@@ -7,7 +7,6 @@
7
7
  import path from 'path';
8
8
  import chalk from 'chalk';
9
9
  import ora from 'ora';
10
- import * as fs from 'fs';
11
10
  import { createRequire } from 'module';
12
11
  import { FileSystemUtils } from '../utils/file-system.js';
13
12
  import { transformToHyphenCommands } from '../utils/command-references.js';
@@ -17,12 +16,14 @@ import { getToolVersionStatus, getSkillTemplates, getCommandContents, generateSk
17
16
  import { detectLegacyArtifacts, cleanupLegacyArtifacts, formatCleanupSummary, formatDetectionSummary, getToolsFromLegacyArtifacts, } from './legacy-cleanup.js';
18
17
  import { isInteractive } from '../utils/interactive.js';
19
18
  import { getGlobalConfig } from './global-config.js';
20
- import { getProfileWorkflows, ALL_WORKFLOWS } from './profiles.js';
19
+ import { getProfileWorkflows } from './profiles.js';
20
+ import { ALL_WORKFLOWS } from './shared/workflow-registry.js';
21
+ import { removeSkillDirs, removeUnselectedSkillDirs, removeCommandFiles, removeUnselectedCommandFiles, } from './shared/artifact-cleanup.js';
21
22
  import { getAvailableTools } from './available-tools.js';
22
- import { WORKFLOW_TO_SKILL_DIR, getCommandConfiguredTools, getConfiguredToolsForProfileSync, getToolsNeedingProfileSync, } from './profile-sync-drift.js';
23
+ import { getCommandConfiguredTools, getConfiguredToolsForProfileSync, getToolsNeedingProfileSync, } from './profile-sync-drift.js';
23
24
  import { scanInstalledWorkflows as scanInstalledWorkflowsShared, migrateIfNeeded as migrateIfNeededShared, } from './migration.js';
24
25
  const require = createRequire(import.meta.url);
25
- const { version: OPENSPEC_VERSION } = require('../../package.json');
26
+ const { version: SYNARCX_VERSION } = require('../../package.json');
26
27
  const OLD_CORE_WORKFLOWS = ['propose', 'explore', 'apply', 'archive'];
27
28
  /**
28
29
  * Scans installed workflow artifacts (skills and managed commands) across all configured tools.
@@ -43,9 +44,9 @@ export class UpdateCommand {
43
44
  }
44
45
  async execute(projectPath) {
45
46
  const resolvedProjectPath = path.resolve(projectPath);
46
- const openspecPath = path.join(resolvedProjectPath, SYNSPEC_DIR_NAME);
47
+ const synspecPath = path.join(resolvedProjectPath, SYNSPEC_DIR_NAME);
47
48
  // 1. Check synspec directory exists
48
- if (!await FileSystemUtils.directoryExists(openspecPath)) {
49
+ if (!await FileSystemUtils.directoryExists(synspecPath)) {
49
50
  throw new Error(`No synarcx directory found. Run 'synarcx init' first.`);
50
51
  }
51
52
  // 2. Perform one-time migration if needed before any legacy upgrade generation.
@@ -73,7 +74,7 @@ export class UpdateCommand {
73
74
  const commandConfiguredTools = getCommandConfiguredTools(resolvedProjectPath);
74
75
  const commandConfiguredSet = new Set(commandConfiguredTools);
75
76
  const toolStatuses = configuredTools.map((toolId) => {
76
- const status = getToolVersionStatus(resolvedProjectPath, toolId, OPENSPEC_VERSION);
77
+ const status = getToolVersionStatus(resolvedProjectPath, toolId, SYNARCX_VERSION);
77
78
  if (!status.configured && commandConfiguredSet.has(toolId)) {
78
79
  return { ...status, configured: true };
79
80
  }
@@ -132,14 +133,14 @@ export class UpdateCommand {
132
133
  const skillFile = path.join(skillDir, 'SKILL.md');
133
134
  // Use hyphen-based command references for tools where filename = command name
134
135
  const transformer = tool.value === 'pi' ? transformToHyphenCommands : undefined;
135
- const skillContent = generateSkillContent(template, OPENSPEC_VERSION, transformer);
136
+ const skillContent = generateSkillContent(template, SYNARCX_VERSION, transformer);
136
137
  await FileSystemUtils.writeFile(skillFile, skillContent);
137
138
  }
138
- removedDeselectedSkillCount += await this.removeUnselectedSkillDirs(skillsDir, desiredWorkflows);
139
+ removedDeselectedSkillCount += await removeUnselectedSkillDirs(skillsDir, desiredWorkflows);
139
140
  }
140
141
  // Delete skill directories if delivery is commands-only
141
142
  if (!shouldGenerateSkills) {
142
- removedSkillCount += await this.removeSkillDirs(skillsDir);
143
+ removedSkillCount += await removeSkillDirs(skillsDir);
143
144
  }
144
145
  // Generate commands if delivery includes commands
145
146
  if (shouldGenerateCommands) {
@@ -150,12 +151,12 @@ export class UpdateCommand {
150
151
  const commandFile = path.isAbsolute(cmd.path) ? cmd.path : path.join(resolvedProjectPath, cmd.path);
151
152
  await FileSystemUtils.writeFile(commandFile, cmd.fileContent);
152
153
  }
153
- removedDeselectedCommandCount += await this.removeUnselectedCommandFiles(resolvedProjectPath, toolId, desiredWorkflows);
154
+ removedDeselectedCommandCount += await removeUnselectedCommandFiles(resolvedProjectPath, toolId, desiredWorkflows);
154
155
  }
155
156
  }
156
157
  // Delete command files if delivery is skills-only
157
158
  if (!shouldGenerateCommands) {
158
- removedCommandCount += await this.removeCommandFiles(resolvedProjectPath, toolId);
159
+ removedCommandCount += await removeCommandFiles(resolvedProjectPath, toolId);
159
160
  }
160
161
  spinner.succeed(`Updated ${tool.name}`);
161
162
  updatedTools.push(tool.name);
@@ -171,7 +172,7 @@ export class UpdateCommand {
171
172
  // 11. Summary
172
173
  console.log();
173
174
  if (updatedTools.length > 0) {
174
- console.log(chalk.green(`✓ Updated: ${updatedTools.join(', ')} (v${OPENSPEC_VERSION})`));
175
+ console.log(chalk.green(`✓ Updated: ${updatedTools.join(', ')} (v${SYNARCX_VERSION})`));
175
176
  }
176
177
  if (failedTools.length > 0) {
177
178
  console.log(chalk.red(`✗ Failed: ${failedTools.map(f => `${f.name} (${f.error})`).join(', ')}`));
@@ -215,7 +216,7 @@ export class UpdateCommand {
215
216
  */
216
217
  displayUpToDateMessage(toolStatuses) {
217
218
  const toolNames = toolStatuses.map((s) => s.toolId);
218
- console.log(chalk.green(`✓ All ${toolStatuses.length} tool(s) up to date (v${OPENSPEC_VERSION})`));
219
+ console.log(chalk.green(`✓ All ${toolStatuses.length} tool(s) up to date (v${SYNARCX_VERSION})`));
219
220
  console.log(chalk.dim(` Tools: ${toolNames.join(', ')}`));
220
221
  console.log();
221
222
  console.log(chalk.dim('Use --force to refresh files anyway.'));
@@ -228,7 +229,7 @@ export class UpdateCommand {
228
229
  const status = statusByTool.get(toolId);
229
230
  if (status?.needsUpdate) {
230
231
  const fromVersion = status.generatedByVersion ?? 'unknown';
231
- return `${status.toolId} (${fromVersion} → ${OPENSPEC_VERSION})`;
232
+ return `${status.toolId} (${fromVersion} → ${SYNARCX_VERSION})`;
232
233
  }
233
234
  return `${toolId} (config sync)`;
234
235
  });
@@ -283,107 +284,7 @@ export class UpdateCommand {
283
284
  console.log(chalk.dim('Run `synarcx config profile core` and then `synarcx update` to add sync.'));
284
285
  }
285
286
  /**
286
- * Removes skill directories for workflows when delivery changed to commands-only.
287
- * Returns the number of directories removed.
288
- */
289
- async removeSkillDirs(skillsDir) {
290
- let removed = 0;
291
- for (const workflow of ALL_WORKFLOWS) {
292
- const dirName = WORKFLOW_TO_SKILL_DIR[workflow];
293
- if (!dirName)
294
- continue;
295
- const skillDir = path.join(skillsDir, dirName);
296
- try {
297
- if (fs.existsSync(skillDir)) {
298
- await fs.promises.rm(skillDir, { recursive: true, force: true });
299
- removed++;
300
- }
301
- }
302
- catch {
303
- // Ignore errors
304
- }
305
- }
306
- return removed;
307
- }
308
- /**
309
- * Removes skill directories for workflows that are no longer selected in the active profile.
310
- * Returns the number of directories removed.
311
- */
312
- async removeUnselectedSkillDirs(skillsDir, desiredWorkflows) {
313
- const desiredSet = new Set(desiredWorkflows);
314
- let removed = 0;
315
- for (const workflow of ALL_WORKFLOWS) {
316
- if (desiredSet.has(workflow))
317
- continue;
318
- const dirName = WORKFLOW_TO_SKILL_DIR[workflow];
319
- if (!dirName)
320
- continue;
321
- const skillDir = path.join(skillsDir, dirName);
322
- try {
323
- if (fs.existsSync(skillDir)) {
324
- await fs.promises.rm(skillDir, { recursive: true, force: true });
325
- removed++;
326
- }
327
- }
328
- catch {
329
- // Ignore errors
330
- }
331
- }
332
- return removed;
333
- }
334
- /**
335
- * Removes command files for workflows when delivery changed to skills-only.
336
- * Returns the number of files removed.
337
- */
338
- async removeCommandFiles(projectPath, toolId) {
339
- let removed = 0;
340
- const adapter = CommandAdapterRegistry.get(toolId);
341
- if (!adapter)
342
- return 0;
343
- for (const workflow of ALL_WORKFLOWS) {
344
- const cmdPath = adapter.getFilePath(workflow);
345
- const fullPath = path.isAbsolute(cmdPath) ? cmdPath : path.join(projectPath, cmdPath);
346
- try {
347
- if (fs.existsSync(fullPath)) {
348
- await fs.promises.unlink(fullPath);
349
- removed++;
350
- }
351
- }
352
- catch {
353
- // Ignore errors
354
- }
355
- }
356
- return removed;
357
- }
358
- /**
359
- * Removes command files for workflows that are no longer selected in the active profile.
360
- * Returns the number of files removed.
361
- */
362
- async removeUnselectedCommandFiles(projectPath, toolId, desiredWorkflows) {
363
- let removed = 0;
364
- const adapter = CommandAdapterRegistry.get(toolId);
365
- if (!adapter)
366
- return 0;
367
- const desiredSet = new Set(desiredWorkflows);
368
- for (const workflow of ALL_WORKFLOWS) {
369
- if (desiredSet.has(workflow))
370
- continue;
371
- const cmdPath = adapter.getFilePath(workflow);
372
- const fullPath = path.isAbsolute(cmdPath) ? cmdPath : path.join(projectPath, cmdPath);
373
- try {
374
- if (fs.existsSync(fullPath)) {
375
- await fs.promises.unlink(fullPath);
376
- removed++;
377
- }
378
- }
379
- catch {
380
- // Ignore errors
381
- }
382
- }
383
- return removed;
384
- }
385
- /**
386
- * Detect and handle legacy OpenSpec artifacts.
287
+ * Detect and handle legacy artifacts.
387
288
  * Unlike init, update warns but continues if legacy files found in non-interactive mode.
388
289
  * Returns array of tool IDs that were newly configured during legacy upgrade.
389
290
  */
@@ -523,7 +424,7 @@ export class UpdateCommand {
523
424
  const skillFile = path.join(skillDir, 'SKILL.md');
524
425
  // Use hyphen-based command references for tools where filename = command name
525
426
  const transformer = tool.value === 'pi' ? transformToHyphenCommands : undefined;
526
- const skillContent = generateSkillContent(template, OPENSPEC_VERSION, transformer);
427
+ const skillContent = generateSkillContent(template, SYNARCX_VERSION, transformer);
527
428
  await FileSystemUtils.writeFile(skillFile, skillContent);
528
429
  }
529
430
  }