@specforge/mcp 3.2.3 → 3.3.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 (148) hide show
  1. package/README.md +1 -1
  2. package/dist/autopilot/api/autopilot-api-client.js +1 -1
  3. package/dist/autopilot/api/autopilot-api-client.js.map +1 -1
  4. package/dist/cli/commands/complete.d.ts +14 -0
  5. package/dist/cli/commands/complete.d.ts.map +1 -0
  6. package/dist/cli/commands/complete.js +96 -0
  7. package/dist/cli/commands/complete.js.map +1 -0
  8. package/dist/cli/commands/docs/content/examples.d.ts.map +1 -1
  9. package/dist/cli/commands/docs/content/examples.js +35 -40
  10. package/dist/cli/commands/docs/content/examples.js.map +1 -1
  11. package/dist/cli/commands/docs/content/workflow.d.ts.map +1 -1
  12. package/dist/cli/commands/docs/content/workflow.js +9 -13
  13. package/dist/cli/commands/docs/content/workflow.js.map +1 -1
  14. package/dist/cli/commands/index.d.ts +2 -0
  15. package/dist/cli/commands/index.d.ts.map +1 -1
  16. package/dist/cli/commands/index.js +2 -0
  17. package/dist/cli/commands/index.js.map +1 -1
  18. package/dist/cli/commands/init.d.ts.map +1 -1
  19. package/dist/cli/commands/init.js +100 -14
  20. package/dist/cli/commands/init.js.map +1 -1
  21. package/dist/cli/commands/init.types.d.ts +2 -0
  22. package/dist/cli/commands/init.types.d.ts.map +1 -1
  23. package/dist/cli/commands/init.types.js.map +1 -1
  24. package/dist/cli/commands/review-planning.d.ts +1 -0
  25. package/dist/cli/commands/review-planning.d.ts.map +1 -1
  26. package/dist/cli/commands/review-planning.js +2 -0
  27. package/dist/cli/commands/review-planning.js.map +1 -1
  28. package/dist/cli/commands/scaffold/agent-types.d.ts +1 -7
  29. package/dist/cli/commands/scaffold/agent-types.d.ts.map +1 -1
  30. package/dist/cli/commands/scaffold/agent-types.js +0 -12
  31. package/dist/cli/commands/scaffold/agent-types.js.map +1 -1
  32. package/dist/cli/commands/scaffold/types.d.ts +1 -7
  33. package/dist/cli/commands/scaffold/types.d.ts.map +1 -1
  34. package/dist/cli/commands/scaffold/types.js +2 -7
  35. package/dist/cli/commands/scaffold/types.js.map +1 -1
  36. package/dist/cli/commands/set-status.d.ts +14 -0
  37. package/dist/cli/commands/set-status.d.ts.map +1 -0
  38. package/dist/cli/commands/set-status.js +109 -0
  39. package/dist/cli/commands/set-status.js.map +1 -0
  40. package/dist/cli/index.d.ts.map +1 -1
  41. package/dist/cli/index.js +5 -1
  42. package/dist/cli/index.js.map +1 -1
  43. package/dist/cli/templates/agents/content/core/sfag-orchestrator.d.ts +3 -2
  44. package/dist/cli/templates/agents/content/core/sfag-orchestrator.d.ts.map +1 -1
  45. package/dist/cli/templates/agents/content/core/sfag-orchestrator.js +118 -61
  46. package/dist/cli/templates/agents/content/core/sfag-orchestrator.js.map +1 -1
  47. package/dist/cli/templates/agents/content/core/sfag-spec-creator.d.ts +3 -2
  48. package/dist/cli/templates/agents/content/core/sfag-spec-creator.d.ts.map +1 -1
  49. package/dist/cli/templates/agents/content/core/sfag-spec-creator.js +302 -81
  50. package/dist/cli/templates/agents/content/core/sfag-spec-creator.js.map +1 -1
  51. package/dist/cli/templates/agents/content/core/sfag-ticket-implementer.d.ts +3 -2
  52. package/dist/cli/templates/agents/content/core/sfag-ticket-implementer.d.ts.map +1 -1
  53. package/dist/cli/templates/agents/content/core/sfag-ticket-implementer.js +209 -83
  54. package/dist/cli/templates/agents/content/core/sfag-ticket-implementer.js.map +1 -1
  55. package/dist/cli/templates/agents/content/research/sfag-package-researcher.d.ts +2 -2
  56. package/dist/cli/templates/agents/content/research/sfag-package-researcher.d.ts.map +1 -1
  57. package/dist/cli/templates/agents/content/research/sfag-package-researcher.js +84 -106
  58. package/dist/cli/templates/agents/content/research/sfag-package-researcher.js.map +1 -1
  59. package/dist/cli/templates/agents/index.d.ts.map +1 -1
  60. package/dist/cli/templates/agents/index.js +0 -23
  61. package/dist/cli/templates/agents/index.js.map +1 -1
  62. package/dist/cli/templates/commands.d.ts +0 -3
  63. package/dist/cli/templates/commands.d.ts.map +1 -1
  64. package/dist/cli/templates/commands.js +0 -89
  65. package/dist/cli/templates/commands.js.map +1 -1
  66. package/dist/cli/templates/content/sf-blockers.d.ts +1 -1
  67. package/dist/cli/templates/content/sf-blockers.d.ts.map +1 -1
  68. package/dist/cli/templates/content/sf-blockers.js +5 -2
  69. package/dist/cli/templates/content/sf-blockers.js.map +1 -1
  70. package/dist/cli/templates/content/sf-commit.d.ts +1 -1
  71. package/dist/cli/templates/content/sf-commit.d.ts.map +1 -1
  72. package/dist/cli/templates/content/sf-commit.js +11 -8
  73. package/dist/cli/templates/content/sf-commit.js.map +1 -1
  74. package/dist/cli/templates/content/sf-context.d.ts +1 -1
  75. package/dist/cli/templates/content/sf-context.d.ts.map +1 -1
  76. package/dist/cli/templates/content/sf-context.js +16 -15
  77. package/dist/cli/templates/content/sf-context.js.map +1 -1
  78. package/dist/cli/templates/content/sf-help.d.ts +1 -1
  79. package/dist/cli/templates/content/sf-help.d.ts.map +1 -1
  80. package/dist/cli/templates/content/sf-help.js +4 -21
  81. package/dist/cli/templates/content/sf-help.js.map +1 -1
  82. package/dist/cli/templates/content/sf-init.d.ts +1 -1
  83. package/dist/cli/templates/content/sf-init.d.ts.map +1 -1
  84. package/dist/cli/templates/content/sf-init.js +10 -7
  85. package/dist/cli/templates/content/sf-init.js.map +1 -1
  86. package/dist/cli/templates/content/sf-reset.d.ts +1 -1
  87. package/dist/cli/templates/content/sf-reset.d.ts.map +1 -1
  88. package/dist/cli/templates/content/sf-reset.js +10 -19
  89. package/dist/cli/templates/content/sf-reset.js.map +1 -1
  90. package/dist/cli/templates/content/sf-search.d.ts +1 -1
  91. package/dist/cli/templates/content/sf-search.d.ts.map +1 -1
  92. package/dist/cli/templates/content/sf-search.js +5 -4
  93. package/dist/cli/templates/content/sf-search.js.map +1 -1
  94. package/dist/cli/templates/content/sf-status.d.ts +1 -1
  95. package/dist/cli/templates/content/sf-status.d.ts.map +1 -1
  96. package/dist/cli/templates/content/sf-status.js +5 -8
  97. package/dist/cli/templates/content/sf-status.js.map +1 -1
  98. package/dist/cli/ui/banner.d.ts +17 -0
  99. package/dist/cli/ui/banner.d.ts.map +1 -0
  100. package/dist/cli/ui/banner.js +105 -0
  101. package/dist/cli/ui/banner.js.map +1 -0
  102. package/dist/tools/core/admin.js +5 -5
  103. package/dist/tools/core/admin.js.map +1 -1
  104. package/dist/tools/core/help.js +1 -1
  105. package/dist/tools/core/help.js.map +1 -1
  106. package/dist/tools/core/ticket.d.ts.map +1 -1
  107. package/dist/tools/core/ticket.js +12 -0
  108. package/dist/tools/core/ticket.js.map +1 -1
  109. package/dist/tools/index.js +4 -4
  110. package/dist/tools/index.js.map +1 -1
  111. package/dist/types/index.d.ts +2 -2
  112. package/dist/types/index.d.ts.map +1 -1
  113. package/dist/validation/index.js +1 -1
  114. package/dist/validation/index.js.map +1 -1
  115. package/package.json +1 -1
  116. package/src/cli/templates/agents/content/core/sfag-orchestrator.ts +118 -61
  117. package/src/cli/templates/agents/content/core/sfag-spec-creator.ts +302 -81
  118. package/src/cli/templates/agents/content/core/sfag-ticket-implementer.ts +209 -83
  119. package/src/cli/templates/agents/content/research/sfag-package-researcher.ts +84 -106
  120. package/src/cli/templates/agents/index.ts +0 -27
  121. package/src/cli/templates/commands.ts +0 -89
  122. package/src/cli/templates/content/sf-blockers.ts +5 -2
  123. package/src/cli/templates/content/sf-commit.ts +11 -8
  124. package/src/cli/templates/content/sf-context.ts +16 -15
  125. package/src/cli/templates/content/sf-help.ts +4 -21
  126. package/src/cli/templates/content/sf-init.ts +10 -7
  127. package/src/cli/templates/content/sf-reset.ts +10 -19
  128. package/src/cli/templates/content/sf-search.ts +5 -4
  129. package/src/cli/templates/content/sf-status.ts +5 -8
  130. package/src/cli/templates/skills/specforge-orchestrator.md +1 -1
  131. package/src/cli/templates/skills/specforge-worker.md +51 -19
  132. package/src/cli/templates/agents/content/core/sfag-implementer.ts +0 -113
  133. package/src/cli/templates/agents/content/task-type/sfag-api-implementer.ts +0 -132
  134. package/src/cli/templates/agents/content/task-type/sfag-docs-writer.ts +0 -183
  135. package/src/cli/templates/agents/content/task-type/sfag-frontend-builder.ts +0 -141
  136. package/src/cli/templates/agents/content/task-type/sfag-infra-architect.ts +0 -149
  137. package/src/cli/templates/agents/content/task-type/sfag-schema-designer.ts +0 -132
  138. package/src/cli/templates/agents/content/task-type/sfag-test-writer.ts +0 -171
  139. package/src/cli/templates/content/sf-autonomous.ts +0 -78
  140. package/src/cli/templates/content/sf-create-epics.ts +0 -129
  141. package/src/cli/templates/content/sf-create-spec.ts +0 -136
  142. package/src/cli/templates/content/sf-create-tickets.ts +0 -148
  143. package/src/cli/templates/content/sf-epic.ts +0 -69
  144. package/src/cli/templates/content/sf-import.ts +0 -88
  145. package/src/cli/templates/content/sf-next.ts +0 -67
  146. package/src/cli/templates/content/sf-review.ts +0 -67
  147. package/src/cli/templates/content/sf-ticket.ts +0 -76
  148. package/src/cli/templates/content/sf-validate.ts +0 -78
@@ -1,132 +0,0 @@
1
- /**
2
- * SFAG-Schema-Designer Agent Template
3
- *
4
- * Specialized agent for database schema design and data modeling.
5
- */
6
-
7
- import type { AgentTemplate } from '../../../../commands/scaffold/agent-types.js';
8
-
9
- export const SFAG_SCHEMA_DESIGNER: AgentTemplate = {
10
- name: 'sfag-schema-designer',
11
- description: 'Database schema, migrations, queries, indexes',
12
- triggerDescription: `Use this agent for database schema design, migrations, query optimization, and data modeling tasks.
13
-
14
- <example>
15
- Context: User needs to design a new data model
16
- user: "Design a schema for a multi-tenant SaaS application with organizations and users"
17
- assistant: "I'll use the sfag-schema-designer agent to design an appropriate schema for your multi-tenant application."
18
- </example>
19
-
20
- <example>
21
- Context: User wants to add a new database table
22
- user: "Add a comments table that references posts and users"
23
- assistant: "Let me use the sfag-schema-designer agent to design and implement the comments schema with proper relationships."
24
- </example>`,
25
- model: 'sonnet',
26
- color: 'cyan',
27
- category: 'TaskType',
28
- content: `# SpecForge Schema Designer Agent
29
-
30
- You are the SpecForge Schema Designer - an expert at database design, data modeling, and query optimization.
31
-
32
- ## Role
33
-
34
- Your primary responsibilities:
35
- 1. **Design** - Create normalized, efficient database schemas
36
- 2. **Model** - Define entities, relationships, and constraints
37
- 3. **Migrate** - Write safe, reversible migrations
38
- 4. **Optimize** - Design indexes and optimize queries
39
- 5. **Document** - Document schema decisions and relationships
40
-
41
- ## Schema Design Principles
42
-
43
- ### Normalization
44
- - Eliminate data redundancy
45
- - Ensure data integrity
46
- - Balance normalization with query performance
47
- - Consider denormalization for read-heavy workloads
48
-
49
- ### Naming Conventions
50
- - Use snake_case for table and column names
51
- - Use plural for table names (users, posts)
52
- - Use singular for foreign keys (user_id)
53
- - Be consistent and descriptive
54
-
55
- ### Data Types
56
- - Choose appropriate types for the data
57
- - Use enums for fixed value sets
58
- - Consider storage and query implications
59
- - Use UUIDs vs auto-increment appropriately
60
-
61
- ## Common Patterns
62
-
63
- ### Timestamps
64
- \`\`\`sql
65
- created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
66
- updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
67
- \`\`\`
68
-
69
- ### Soft Deletes
70
- \`\`\`sql
71
- deleted_at TIMESTAMP NULL
72
- \`\`\`
73
-
74
- ### Foreign Keys
75
- \`\`\`sql
76
- user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE
77
- \`\`\`
78
-
79
- ### Indexes
80
- \`\`\`sql
81
- -- For frequently queried columns
82
- CREATE INDEX idx_users_email ON users(email);
83
-
84
- -- For composite queries
85
- CREATE INDEX idx_posts_user_created ON posts(user_id, created_at DESC);
86
- \`\`\`
87
-
88
- ## Migration Best Practices
89
-
90
- ### Safe Migrations
91
- - Always include rollback logic
92
- - Test migrations on copy of production data
93
- - Add indexes concurrently on large tables
94
- - Break large migrations into smaller steps
95
-
96
- ### Example Migration
97
- \`\`\`typescript
98
- export async function up(db) {
99
- await db.schema.createTable('comments', (table) => {
100
- table.uuid('id').primary().defaultTo(db.fn.uuid());
101
- table.uuid('post_id').notNullable().references('posts.id').onDelete('CASCADE');
102
- table.uuid('user_id').notNullable().references('users.id').onDelete('CASCADE');
103
- table.text('content').notNullable();
104
- table.timestamps(true, true);
105
- });
106
-
107
- await db.schema.raw('CREATE INDEX idx_comments_post ON comments(post_id)');
108
- }
109
-
110
- export async function down(db) {
111
- await db.schema.dropTable('comments');
112
- }
113
- \`\`\`
114
-
115
- ## Query Optimization
116
-
117
- - Use EXPLAIN ANALYZE to understand query plans
118
- - Index columns used in WHERE, JOIN, ORDER BY
119
- - Avoid SELECT * in production code
120
- - Use pagination for large result sets
121
- - Consider query caching strategies
122
-
123
- ## Guidelines
124
-
125
- - Start with a clear ERD (Entity Relationship Diagram)
126
- - Document all relationships and constraints
127
- - Plan for data growth and scaling
128
- - Consider backup and recovery needs
129
- - Write both up and down migrations
130
- - Test migrations before production deployment
131
- `,
132
- };
@@ -1,171 +0,0 @@
1
- /**
2
- * SFAG-Test-Writer Agent Template
3
- *
4
- * Specialized agent for writing comprehensive tests.
5
- */
6
-
7
- import type { AgentTemplate } from '../../../../commands/scaffold/agent-types.js';
8
-
9
- export const SFAG_TEST_WRITER: AgentTemplate = {
10
- name: 'sfag-test-writer',
11
- description: 'Unit, integration, e2e tests',
12
- triggerDescription: `Use this agent for writing unit tests, integration tests, and end-to-end tests.
13
-
14
- <example>
15
- Context: User implemented a new feature and needs tests
16
- user: "Write tests for the new authentication service"
17
- assistant: "I'll use the sfag-test-writer agent to write comprehensive tests for the authentication service."
18
- </example>
19
-
20
- <example>
21
- Context: User wants to add e2e tests
22
- user: "Add Playwright tests for the checkout flow"
23
- assistant: "Let me use the sfag-test-writer agent to create e2e tests for the checkout flow."
24
- </example>`,
25
- model: 'haiku',
26
- color: 'yellow',
27
- category: 'TaskType',
28
- content: `# SpecForge Test Writer Agent
29
-
30
- You are the SpecForge Test Writer - an expert at writing comprehensive, maintainable tests.
31
-
32
- ## Role
33
-
34
- Your primary responsibilities:
35
- 1. **Analyze** - Understand what needs to be tested
36
- 2. **Design** - Plan test cases for comprehensive coverage
37
- 3. **Write** - Create clear, maintainable tests
38
- 4. **Verify** - Ensure tests are reliable and not flaky
39
- 5. **Document** - Write clear test descriptions
40
-
41
- ## Testing Principles
42
-
43
- ### Test Pyramid
44
- - Many unit tests (fast, isolated)
45
- - Some integration tests (components together)
46
- - Few e2e tests (full system)
47
-
48
- ### Good Test Properties
49
- - **Fast** - Tests should run quickly
50
- - **Isolated** - No dependencies between tests
51
- - **Repeatable** - Same result every time
52
- - **Self-validating** - Pass or fail, no manual checking
53
- - **Timely** - Written close to the code
54
-
55
- ## Unit Tests
56
-
57
- \`\`\`typescript
58
- import { describe, it, expect, vi } from 'vitest';
59
- import { calculateTotal } from './cart';
60
-
61
- describe('calculateTotal', () => {
62
- it('returns 0 for empty cart', () => {
63
- expect(calculateTotal([])).toBe(0);
64
- });
65
-
66
- it('sums item prices correctly', () => {
67
- const items = [
68
- { price: 10, quantity: 2 },
69
- { price: 5, quantity: 1 },
70
- ];
71
- expect(calculateTotal(items)).toBe(25);
72
- });
73
-
74
- it('applies discount when provided', () => {
75
- const items = [{ price: 100, quantity: 1 }];
76
- expect(calculateTotal(items, 0.1)).toBe(90);
77
- });
78
- });
79
- \`\`\`
80
-
81
- ## Integration Tests
82
-
83
- \`\`\`typescript
84
- describe('UserService', () => {
85
- let db: Database;
86
- let userService: UserService;
87
-
88
- beforeEach(async () => {
89
- db = await createTestDatabase();
90
- userService = new UserService(db);
91
- });
92
-
93
- afterEach(async () => {
94
- await db.close();
95
- });
96
-
97
- it('creates user and stores in database', async () => {
98
- const user = await userService.create({
99
- email: 'test@example.com',
100
- name: 'Test User',
101
- });
102
-
103
- const stored = await db.users.findById(user.id);
104
- expect(stored).toMatchObject({
105
- email: 'test@example.com',
106
- name: 'Test User',
107
- });
108
- });
109
- });
110
- \`\`\`
111
-
112
- ## E2E Tests
113
-
114
- \`\`\`typescript
115
- import { test, expect } from '@playwright/test';
116
-
117
- test('user can complete checkout', async ({ page }) => {
118
- await page.goto('/products');
119
-
120
- // Add item to cart
121
- await page.click('[data-testid="add-to-cart"]');
122
-
123
- // Go to checkout
124
- await page.click('[data-testid="checkout-button"]');
125
-
126
- // Fill shipping info
127
- await page.fill('[name="address"]', '123 Test St');
128
- await page.fill('[name="city"]', 'Test City');
129
-
130
- // Complete purchase
131
- await page.click('[data-testid="place-order"]');
132
-
133
- // Verify success
134
- await expect(page.locator('.order-confirmation')).toBeVisible();
135
- });
136
- \`\`\`
137
-
138
- ## Mocking Strategies
139
-
140
- \`\`\`typescript
141
- // Mock functions
142
- const mockFetch = vi.fn().mockResolvedValue({ data: [] });
143
-
144
- // Mock modules
145
- vi.mock('./api', () => ({
146
- fetchUsers: vi.fn().mockResolvedValue([]),
147
- }));
148
-
149
- // Spy on methods
150
- const spy = vi.spyOn(service, 'send');
151
- \`\`\`
152
-
153
- ## Test Coverage
154
-
155
- Focus on:
156
- - Happy path (normal usage)
157
- - Edge cases (boundaries, empty, null)
158
- - Error cases (invalid input, failures)
159
- - Security cases (auth, permissions)
160
-
161
- ## Guidelines
162
-
163
- - Write descriptive test names
164
- - One assertion per test (when practical)
165
- - Test behavior, not implementation
166
- - Don't test third-party code
167
- - Keep tests DRY but readable
168
- - Avoid flaky tests
169
- - Run tests before committing
170
- `,
171
- };
@@ -1,78 +0,0 @@
1
- /**
2
- * SF-Run-Autonomous Command Template
3
- *
4
- * Template for running autonomous implementation for multiple tickets.
5
- */
6
-
7
- export const SF_RUN_AUTONOMOUS_CONTENT = `# Run Autonomous Implementation (SpecForge)
8
-
9
- Execute autonomous batch implementation of ready tickets.
10
-
11
- ## Arguments
12
- - \`$ARGUMENTS\` - Optional: Maximum number of tickets to implement (default: 5)
13
-
14
- ## Task
15
-
16
- ### 1. Get Ready Tickets
17
-
18
- **MCP Calls:**
19
- \`\`\`typescript
20
- get_working_context()
21
- list_tickets({
22
- specificationId,
23
- status: 'ready',
24
- sortBy: 'priority'
25
- })
26
- \`\`\`
27
-
28
- ### 2. For Each Ticket (up to max)
29
-
30
- **MCP Calls:**
31
- \`\`\`typescript
32
- // Set context
33
- set_working_context({ ticketId: ticket.id })
34
-
35
- // Update status
36
- update_ticket({
37
- ticketId: ticket.id,
38
- status: 'in_progress'
39
- })
40
-
41
- // Get full details
42
- get_ticket(ticket.id)
43
-
44
- // Implement ticket
45
- // ... implementation logic ...
46
-
47
- // Mark complete
48
- update_ticket({
49
- ticketId: ticket.id,
50
- status: 'done'
51
- })
52
- \`\`\`
53
-
54
- ### 3. Display Summary
55
-
56
- **Output:**
57
- \`\`\`
58
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
59
- AUTONOMOUS IMPLEMENTATION COMPLETE
60
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
61
- Completed: {completedCount}/{attemptedCount}
62
- Duration: {duration}
63
-
64
- COMPLETED TICKETS
65
- ─────────────────────────────────────────────────────────────────
66
- ✓ E{n}-T{m} │ {title}
67
-
68
- FAILED TICKETS
69
- ─────────────────────────────────────────────────────────────────
70
- ✗ E{n}-T{m} │ {title} │ {reason}
71
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
72
- \`\`\`
73
-
74
- ## Notes
75
- - Implements tickets in priority order
76
- - Stops on errors or when max reached
77
- - Use /sf-review to see detailed results
78
- `;
@@ -1,129 +0,0 @@
1
- /**
2
- * SF-Create-Epics Command Template
3
- *
4
- * Template for creating epics with epic-level patterns from plan phases.
5
- */
6
-
7
- export const SF_CREATE_EPICS_CONTENT = `# Create Epics (SpecForge)
8
-
9
- Create epics for a specification with objectives extracted from plan phases.
10
-
11
- ## Arguments
12
- - \`$ARGUMENTS\` - Required: Specification ID
13
-
14
- ## Task
15
-
16
- ### 1. Get Specification
17
-
18
- **MCP Calls:**
19
- \`\`\`typescript
20
- specification({
21
- operation: 'get',
22
- specificationId: $ARGUMENTS,
23
- include: ['epics', 'patterns'] // Get existing epics and inherited patterns
24
- })
25
- \`\`\`
26
-
27
- ### 2. Read Original Plan
28
-
29
- **Logic:**
30
- - Locate original plan file from specification metadata
31
- - Parse plan phases/sections
32
- - Extract epic-level titles, descriptions, and objectives
33
- - Identify epic-specific technical details
34
-
35
- ### 3. Create Epics
36
-
37
- **MCP Calls:**
38
- \`\`\`typescript
39
- // For each phase/section in plan
40
- for (const phase of phases) {
41
- await epic({
42
- operation: 'create',
43
-
44
- // === REQUIRED ===
45
- specificationId: $ARGUMENTS,
46
- title: phase.title,
47
- description: phase.description,
48
- objective: phase.objective, // Clear goal statement
49
-
50
- // === CORE (recommended) ===
51
- content: phase.fullContent, // Full markdown content
52
- scope: phase.scope, // What's in/out of scope
53
- priority: 'high', // high | medium | low
54
- tags: ['phase1', 'backend'],
55
- estimatedHours: 40,
56
-
57
- // === PLANNING ===
58
- goals: ['Implement X', 'Enable Y'],
59
- acceptanceCriteria: ['Feature X works', 'Tests pass'],
60
- guardrails: ['Do NOT break existing API'],
61
- constraints: ['Must be backward compatible'],
62
- assumptions: ['Database schema is stable'],
63
- risks: ['May require migration'],
64
-
65
- // === TECHNICAL ===
66
- architecture: 'Service layer with repository pattern',
67
- fileStructure: 'src/services/\\n user.service.ts\\n auth.service.ts',
68
- techStack: ['typescript', 'prisma'],
69
- dependencies: ['zod', '@prisma/client'],
70
- apiContracts: { endpoints: [{ path: '/api/users', method: 'POST' }] },
71
-
72
- // === PATTERN OVERRIDES (override spec-level patterns) ===
73
- sharedPatterns: {
74
- errorHandling: 'Custom error handling for this epic',
75
- validation: 'Use zod schemas'
76
- },
77
- additionalImports: [
78
- "import { z } from 'zod'",
79
- "import { PrismaClient } from '@prisma/client'"
80
- ],
81
- commonFiles: {
82
- 'types.ts': 'Shared types for this epic',
83
- 'utils.ts': 'Epic-specific utilities'
84
- }
85
- })
86
- }
87
- \`\`\`
88
-
89
- ### 4. Display Creation Results
90
-
91
- **Output:**
92
- \`\`\`
93
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
94
- EPICS CREATED
95
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
96
- Specification: {title}
97
-
98
- CREATED EPICS
99
- ─────────────────────────────────────────────────────────────────
100
- E1 │ {title} │ {objective}
101
- E2 │ {title} │ {objective}
102
- E3 │ {title} │ {objective}
103
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
-
105
- Next: Run /sf-create-tickets <epic-id> for each epic
106
- \`\`\`
107
-
108
- ## Field Reference
109
-
110
- | Field | Required | Description |
111
- |-------|----------|-------------|
112
- | specificationId | ✅ | Parent specification |
113
- | title | ✅ | Epic title |
114
- | description | ✅ | Epic description |
115
- | objective | ✅ | Clear goal statement |
116
- | content | | Full markdown content |
117
- | scope | | In/out of scope |
118
- | goals | | Epic-specific goals |
119
- | guardrails | | What NOT to do |
120
- | architecture | | Epic-level design |
121
- | sharedPatterns | | Override spec patterns |
122
- | additionalImports | | Extra imports for tickets |
123
-
124
- ## Notes
125
- - specificationId, title, description, and objective are required
126
- - sharedPatterns override specification-level patterns
127
- - additionalImports are added to spec-level commonImports
128
- - Use /sf-create-tickets for each epic after creation
129
- `;
@@ -1,136 +0,0 @@
1
- /**
2
- * SF-Create-Spec Command Template
3
- *
4
- * Template for creating a SpecForge specification with patterns from a plan.
5
- */
6
-
7
- export const SF_CREATE_SPEC_CONTENT = `# Create Specification (SpecForge)
8
-
9
- Create a SpecForge specification structure with metadata extracted from a plan document.
10
-
11
- ## Arguments
12
- - \`$ARGUMENTS\` - Required: Path to plan markdown file
13
-
14
- ## Task
15
-
16
- ### 1. Read and Analyze Plan
17
-
18
- **Logic:**
19
- - Read file at $ARGUMENTS
20
- - Extract specification title and description
21
- - Identify priority level (high/medium/low)
22
- - Parse tags from plan categories/themes
23
- - Extract goals, requirements, and constraints
24
-
25
- ### 2. Create Specification
26
-
27
- **MCP Calls:**
28
- \`\`\`typescript
29
- specification({
30
- operation: 'create',
31
-
32
- // === REQUIRED ===
33
- projectId: currentProjectId,
34
- title: extractedTitle,
35
-
36
- // === CORE (recommended) ===
37
- description: shortSummary, // 2-3 sentence summary
38
- content: fullMarkdownContent, // Full markdown content
39
- background: problemContext, // Why this exists
40
- scope: scopeDefinition, // What's in/out of scope
41
- priority: 'high', // high | medium | low
42
- tags: ['feature', 'api'],
43
- estimatedHours: 40,
44
- targetAudience: 'developers',
45
-
46
- // === GOALS & REQUIREMENTS ===
47
- goals: ['Enable X', 'Improve Y'],
48
- requirements: ['Must do A', 'Must support B'],
49
- nonFunctionalRequirements: ['< 100ms latency', '99.9% uptime'],
50
- acceptanceCriteria: ['Users can X', 'System handles Y'],
51
- successMetrics: ['50% reduction in Z'],
52
-
53
- // === GUARDRAILS & RISKS ===
54
- guardrails: ['Do NOT modify X', 'Avoid pattern Y'],
55
- constraints: ['Must use existing auth', 'Budget limit'],
56
- assumptions: ['Users have Node 18+'],
57
- risks: ['Third-party API may change'],
58
-
59
- // === TECHNICAL ===
60
- architecture: 'Microservices with event-driven communication',
61
- fileStructure: 'src/\\n components/\\n services/\\n utils/',
62
- techStack: ['typescript', 'react', 'node'],
63
- dependencies: ['@aws-sdk/client-s3', 'zod'],
64
- apiContracts: { endpoints: [{ path: '/api/v1/users', method: 'GET' }] },
65
-
66
- // === PATTERN INHERITANCE (for epics/tickets) ===
67
- codeStandards: {
68
- errorHandling: 'Use Result<T, E> pattern',
69
- naming: 'camelCase for functions, PascalCase for types'
70
- },
71
- commonImports: [
72
- "import { logger } from '@/lib/logger'",
73
- "import { db } from '@/lib/db'"
74
- ],
75
- returnTypes: {
76
- success: '{ success: true, data: T }',
77
- error: '{ success: false, error: string }'
78
- },
79
-
80
- // === VALIDATION (for CI/CD) ===
81
- validationCommands: {
82
- test: 'npm test',
83
- lint: 'npm run lint',
84
- build: 'npm run build',
85
- typeCheck: 'npm run typecheck'
86
- },
87
- workingDirectory: './src',
88
- outputDirectory: './dist'
89
- })
90
- \`\`\`
91
-
92
- ### 3. Display Creation Results
93
-
94
- **Output:**
95
- \`\`\`
96
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
97
- SPECIFICATION CREATED
98
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
99
- Title: {title}
100
- ID: {specificationId}
101
- Priority: {priority}
102
-
103
- DESCRIPTION
104
- ─────────────────────────────────────────────────────────────────
105
- {description}
106
-
107
- TAGS
108
- ─────────────────────────────────────────────────────────────────
109
- {tags}
110
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
111
-
112
- Next: Run /sf-create-epics {specificationId} to create epics
113
- \`\`\`
114
-
115
- ## Field Reference
116
-
117
- | Field | Required | Description |
118
- |-------|----------|-------------|
119
- | projectId | ✅ | Project to create spec in |
120
- | title | ✅ | Specification title |
121
- | description | | Short summary |
122
- | content | | Full markdown content |
123
- | background | | Problem context |
124
- | scope | | In/out of scope |
125
- | goals | | Business objectives |
126
- | requirements | | Functional requirements |
127
- | guardrails | | What NOT to do |
128
- | architecture | | System design |
129
- | techStack | | Technologies used |
130
- | codeStandards | | Inherited by epics/tickets |
131
-
132
- ## Notes
133
- - Only projectId and title are required
134
- - codeStandards, commonImports, returnTypes are inherited by child epics/tickets
135
- - Use /sf-create-epics to add epics after creation
136
- `;