Skip to content

Commit 68f6a74

Browse files
committed
refactor: Reorganize workflows for better tool grouping
- Create simulator-environment workflow (5 tools) - Move environment config tools from simulator-shared - set_sim_appearance, set/reset_simulator_location, set/reset_network_condition - Create project-scaffolding workflow (2 tools) - Move scaffolding tools from utilities - scaffold_ios_project, scaffold_macos_project - Update workflow tool counts: - simulator-project: 27 → 22 tools - simulator-workspace: 29 → 24 tools - utilities: 4 → 2 tools (now only clean operations) Benefits: - Core workflows focus on essential day-to-day tools - Environment and scaffolding tools can be loaded additively - Cleaner tool discovery and more appropriate AI suggestions - Reduced default tool exposure to clients All tests pass and code is properly linted.
1 parent 0d95de4 commit 68f6a74

35 files changed

Lines changed: 245 additions & 1261 deletions
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/**
2+
* Tests for project-scaffolding workflow metadata
3+
*/
4+
import { describe, it, expect } from 'vitest';
5+
import { workflow } from '../index.js';
6+
7+
describe('project-scaffolding workflow metadata', () => {
8+
describe('Workflow Structure', () => {
9+
it('should export workflow object with required properties', () => {
10+
expect(workflow).toHaveProperty('name');
11+
expect(workflow).toHaveProperty('description');
12+
expect(workflow).toHaveProperty('platforms');
13+
expect(workflow).toHaveProperty('targets');
14+
expect(workflow).toHaveProperty('projectTypes');
15+
expect(workflow).toHaveProperty('capabilities');
16+
});
17+
18+
it('should have correct workflow name', () => {
19+
expect(workflow.name).toBe('Project Scaffolding');
20+
});
21+
22+
it('should have correct description', () => {
23+
expect(workflow.description).toBe(
24+
'Tools for creating new iOS and macOS projects from templates. Bootstrap new applications with best practices, standard configurations, and modern project structures.',
25+
);
26+
});
27+
28+
it('should have correct platforms array', () => {
29+
expect(workflow.platforms).toEqual(['iOS', 'macOS']);
30+
});
31+
32+
it('should have correct targets array', () => {
33+
expect(workflow.targets).toEqual(['simulator', 'device', 'mac']);
34+
});
35+
36+
it('should have correct projectTypes array', () => {
37+
expect(workflow.projectTypes).toEqual(['project']);
38+
});
39+
40+
it('should have correct capabilities array', () => {
41+
expect(workflow.capabilities).toEqual([
42+
'project-creation',
43+
'template-generation',
44+
'project-initialization',
45+
]);
46+
});
47+
});
48+
49+
describe('Workflow Validation', () => {
50+
it('should have valid string properties', () => {
51+
expect(typeof workflow.name).toBe('string');
52+
expect(typeof workflow.description).toBe('string');
53+
expect(workflow.name.length).toBeGreaterThan(0);
54+
expect(workflow.description.length).toBeGreaterThan(0);
55+
});
56+
57+
it('should have valid array properties', () => {
58+
expect(Array.isArray(workflow.platforms)).toBe(true);
59+
expect(Array.isArray(workflow.targets)).toBe(true);
60+
expect(Array.isArray(workflow.projectTypes)).toBe(true);
61+
expect(Array.isArray(workflow.capabilities)).toBe(true);
62+
63+
expect(workflow.platforms.length).toBeGreaterThan(0);
64+
expect(workflow.targets.length).toBeGreaterThan(0);
65+
expect(workflow.projectTypes.length).toBeGreaterThan(0);
66+
expect(workflow.capabilities.length).toBeGreaterThan(0);
67+
});
68+
69+
it('should contain expected platform values', () => {
70+
expect(workflow.platforms).toContain('iOS');
71+
expect(workflow.platforms).toContain('macOS');
72+
});
73+
74+
it('should contain expected target values', () => {
75+
expect(workflow.targets).toContain('simulator');
76+
expect(workflow.targets).toContain('device');
77+
expect(workflow.targets).toContain('mac');
78+
});
79+
80+
it('should contain expected project type values', () => {
81+
expect(workflow.projectTypes).toContain('project');
82+
});
83+
84+
it('should contain expected capability values', () => {
85+
expect(workflow.capabilities).toContain('project-creation');
86+
expect(workflow.capabilities).toContain('template-generation');
87+
expect(workflow.capabilities).toContain('project-initialization');
88+
});
89+
});
90+
});

src/plugins/utilities/__tests__/scaffold_ios_project.test.ts renamed to src/plugins/project-scaffolding/__tests__/scaffold_ios_project.test.ts

File renamed without changes.

src/plugins/utilities/__tests__/scaffold_macos_project.test.ts renamed to src/plugins/project-scaffolding/__tests__/scaffold_macos_project.test.ts

File renamed without changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Project Scaffolding workflow
3+
*
4+
* Provides tools for creating new iOS and macOS projects from templates.
5+
* These tools are used at project inception to bootstrap new applications
6+
* with best practices and standard configurations.
7+
*/
8+
9+
export const workflow = {
10+
name: 'Project Scaffolding',
11+
description:
12+
'Tools for creating new iOS and macOS projects from templates. Bootstrap new applications with best practices, standard configurations, and modern project structures.',
13+
platforms: ['iOS', 'macOS'],
14+
targets: ['simulator', 'device', 'mac'],
15+
projectTypes: ['project'],
16+
capabilities: ['project-creation', 'template-generation', 'project-initialization'],
17+
};
File renamed without changes.
File renamed without changes.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/**
2+
* Tests for simulator-environment workflow metadata
3+
*/
4+
import { describe, it, expect } from 'vitest';
5+
import { workflow } from '../index.js';
6+
7+
describe('simulator-environment workflow metadata', () => {
8+
describe('Workflow Structure', () => {
9+
it('should export workflow object with required properties', () => {
10+
expect(workflow).toHaveProperty('name');
11+
expect(workflow).toHaveProperty('description');
12+
expect(workflow).toHaveProperty('platforms');
13+
expect(workflow).toHaveProperty('targets');
14+
expect(workflow).toHaveProperty('projectTypes');
15+
expect(workflow).toHaveProperty('capabilities');
16+
});
17+
18+
it('should have correct workflow name', () => {
19+
expect(workflow.name).toBe('Simulator Environment Configuration');
20+
});
21+
22+
it('should have correct description', () => {
23+
expect(workflow.description).toBe(
24+
'Tools for configuring iOS Simulator environment settings including appearance, location services, and network conditions. Perfect for testing apps under various environmental conditions.',
25+
);
26+
});
27+
28+
it('should have correct platforms array', () => {
29+
expect(workflow.platforms).toEqual(['iOS']);
30+
});
31+
32+
it('should have correct targets array', () => {
33+
expect(workflow.targets).toEqual(['simulator']);
34+
});
35+
36+
it('should have correct projectTypes array', () => {
37+
expect(workflow.projectTypes).toEqual(['project', 'workspace']);
38+
});
39+
40+
it('should have correct capabilities array', () => {
41+
expect(workflow.capabilities).toEqual([
42+
'environment-config',
43+
'appearance',
44+
'location',
45+
'network-simulation',
46+
]);
47+
});
48+
});
49+
50+
describe('Workflow Validation', () => {
51+
it('should have valid string properties', () => {
52+
expect(typeof workflow.name).toBe('string');
53+
expect(typeof workflow.description).toBe('string');
54+
expect(workflow.name.length).toBeGreaterThan(0);
55+
expect(workflow.description.length).toBeGreaterThan(0);
56+
});
57+
58+
it('should have valid array properties', () => {
59+
expect(Array.isArray(workflow.platforms)).toBe(true);
60+
expect(Array.isArray(workflow.targets)).toBe(true);
61+
expect(Array.isArray(workflow.projectTypes)).toBe(true);
62+
expect(Array.isArray(workflow.capabilities)).toBe(true);
63+
64+
expect(workflow.platforms.length).toBeGreaterThan(0);
65+
expect(workflow.targets.length).toBeGreaterThan(0);
66+
expect(workflow.projectTypes.length).toBeGreaterThan(0);
67+
expect(workflow.capabilities.length).toBeGreaterThan(0);
68+
});
69+
70+
it('should contain expected platform values', () => {
71+
expect(workflow.platforms).toContain('iOS');
72+
});
73+
74+
it('should contain expected target values', () => {
75+
expect(workflow.targets).toContain('simulator');
76+
});
77+
78+
it('should contain expected project type values', () => {
79+
expect(workflow.projectTypes).toContain('project');
80+
expect(workflow.projectTypes).toContain('workspace');
81+
});
82+
83+
it('should contain expected capability values', () => {
84+
expect(workflow.capabilities).toContain('environment-config');
85+
expect(workflow.capabilities).toContain('appearance');
86+
expect(workflow.capabilities).toContain('location');
87+
expect(workflow.capabilities).toContain('network-simulation');
88+
});
89+
});
90+
});

src/plugins/simulator-shared/__tests__/reset_network_condition.test.ts renamed to src/plugins/simulator-environment/__tests__/reset_network_condition.test.ts

File renamed without changes.

src/plugins/simulator-shared/__tests__/reset_simulator_location.test.ts renamed to src/plugins/simulator-environment/__tests__/reset_simulator_location.test.ts

File renamed without changes.

src/plugins/simulator-shared/__tests__/set_network_condition.test.ts renamed to src/plugins/simulator-environment/__tests__/set_network_condition.test.ts

File renamed without changes.

0 commit comments

Comments
 (0)