@shaykec/ai-native-engineer 1.0.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.
- package/README.md +155 -0
- package/dist/github/fetcher.d.ts +21 -0
- package/dist/github/fetcher.d.ts.map +1 -0
- package/dist/github/fetcher.js +110 -0
- package/dist/github/fetcher.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -0
- package/dist/test/server.test.d.ts +2 -0
- package/dist/test/server.test.d.ts.map +1 -0
- package/dist/test/server.test.js +124 -0
- package/dist/test/server.test.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +52 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/templates.d.ts +30 -0
- package/dist/tools/templates.d.ts.map +1 -0
- package/dist/tools/templates.js +533 -0
- package/dist/tools/templates.js.map +1 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# AI-Native Templates MCP Server
|
|
2
|
+
|
|
3
|
+
MCP server that provides AI-Native Engineer templates for syncing to your projects.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This MCP server is a **pure data provider**. It fetches templates from GitHub and returns them with `llmInstructions` that guide the AI agent on how to handle each file. The agent (not the MCP) performs all file operations.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- **Node.js 20+**
|
|
12
|
+
- **gh CLI** installed and authenticated:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Install gh CLI
|
|
16
|
+
brew install gh # macOS
|
|
17
|
+
# or see https://cli.github.com/
|
|
18
|
+
|
|
19
|
+
# Authenticate
|
|
20
|
+
gh auth login
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
### Via npx (recommended)
|
|
26
|
+
|
|
27
|
+
Add to your `.cursor/mcp.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"ai-native-engineer": {
|
|
33
|
+
"command": "npx",
|
|
34
|
+
"args": ["@shaykec/ai-native-engineer"]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Local development
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
cd mcp-server
|
|
44
|
+
npm install
|
|
45
|
+
npm run build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Add to `.cursor/mcp.json`:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"ai-native-engineer": {
|
|
54
|
+
"command": "node",
|
|
55
|
+
"args": ["/path/to/mcp-server/dist/index.js"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
### Single Tool: `templates`
|
|
64
|
+
|
|
65
|
+
This MCP exposes one tool with two modes:
|
|
66
|
+
|
|
67
|
+
#### List Templates
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
templates({ mode: "list" })
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Returns array of available templates with descriptions:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"templates": [
|
|
78
|
+
{ "path": "templates/root/AGENTS.md", "destPath": "AGENTS.md", "description": "Core AI agent instructions." },
|
|
79
|
+
{ "path": "templates/cursor-rules/security.mdc", "destPath": ".cursor/rules/security.mdc", "description": "Security rules." }
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### Sync Templates
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
templates({ mode: "sync" })
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Returns all templates with content and handling instructions:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"templates": [
|
|
95
|
+
{
|
|
96
|
+
"destPath": "AGENTS.md",
|
|
97
|
+
"content": "# AGENTS.md - AI Agent Instructions...",
|
|
98
|
+
"llmInstructions": {
|
|
99
|
+
"purpose": "Core AI agent instructions.",
|
|
100
|
+
"action": "merge",
|
|
101
|
+
"preserve": ["Quick Reference Commands", "Project Overview"],
|
|
102
|
+
"update": ["Critical Rules", "Workflows"],
|
|
103
|
+
"hints": "Keep project-specific content, update process sections."
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"latestCommit": "abc1234",
|
|
108
|
+
"globalInstructions": "For each template..."
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## llmInstructions Actions
|
|
113
|
+
|
|
114
|
+
| Action | Behavior |
|
|
115
|
+
|--------|----------|
|
|
116
|
+
| `create-if-missing` | Only create file if it doesn't exist |
|
|
117
|
+
| `overwrite` | Replace file entirely with template |
|
|
118
|
+
| `merge` | Use `preserve`/`update` arrays to intelligently merge |
|
|
119
|
+
|
|
120
|
+
## Templates Included
|
|
121
|
+
|
|
122
|
+
- **Root docs:** AGENTS.md, CONTRIBUTING.md, SECURITY.md, TESTING.md
|
|
123
|
+
- **Cursor rules:** always.mdc, security.mdc, testing.mdc, code-style.mdc, architecture.mdc
|
|
124
|
+
- **Scripts:** start-issue.sh, finish-issue.sh, check-ci.sh, setup.sh, etc.
|
|
125
|
+
- **GitHub:** PR template, issue templates, CI workflows
|
|
126
|
+
- **Knowledge:** DECISIONS.md, KNOWN_ISSUES.md, LESSONS_LEARNED.md
|
|
127
|
+
|
|
128
|
+
## How It Works
|
|
129
|
+
|
|
130
|
+
1. Templates are stored in `shayke-cohen/ai-native-engineer` GitHub repo
|
|
131
|
+
2. MCP fetches templates via `gh api` (uses your existing GitHub auth)
|
|
132
|
+
3. Templates are cached for 1 hour
|
|
133
|
+
4. Agent receives templates + llmInstructions
|
|
134
|
+
5. Agent reads existing files, applies merge logic, writes files
|
|
135
|
+
6. No file system access needed by MCP - agent handles everything
|
|
136
|
+
|
|
137
|
+
## Agent Workflow
|
|
138
|
+
|
|
139
|
+
When a user asks to sync templates:
|
|
140
|
+
|
|
141
|
+
1. Agent calls `templates({ mode: "sync" })`
|
|
142
|
+
2. For each template in response:
|
|
143
|
+
- Read existing file at `destPath` (if any)
|
|
144
|
+
- Apply `action` from `llmInstructions`
|
|
145
|
+
- Write file using agent's file tools
|
|
146
|
+
3. Report: X created, Y updated, Z skipped
|
|
147
|
+
4. Remind user: `chmod +x scripts/*.sh`
|
|
148
|
+
|
|
149
|
+
## Source Repository
|
|
150
|
+
|
|
151
|
+
Templates: https://github.com/shayke-cohen/ai-native-engineer
|
|
152
|
+
|
|
153
|
+
## Related
|
|
154
|
+
|
|
155
|
+
- [ai-tester](https://github.com/shayke-cohen/ai-tester) - AI-powered testing MCP server
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if gh CLI is authenticated
|
|
3
|
+
*/
|
|
4
|
+
export declare function checkGhAuth(): Promise<boolean>;
|
|
5
|
+
/**
|
|
6
|
+
* Fetch a template file from GitHub
|
|
7
|
+
*/
|
|
8
|
+
export declare function fetchTemplate(path: string): Promise<string>;
|
|
9
|
+
/**
|
|
10
|
+
* List all templates in a directory (recursive)
|
|
11
|
+
*/
|
|
12
|
+
export declare function listTemplates(dir?: string): Promise<string[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Get the latest commit SHA
|
|
15
|
+
*/
|
|
16
|
+
export declare function getLatestCommit(): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Clear the cache
|
|
19
|
+
*/
|
|
20
|
+
export declare function clearCache(): void;
|
|
21
|
+
//# sourceMappingURL=fetcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../src/github/fetcher.ts"],"names":[],"mappings":"AA6BA;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAOpD;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBjE;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,GAAG,GAAE,MAAoB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgChF;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAoBvD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAEjC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { exec } from 'child_process';
|
|
2
|
+
import { promisify } from 'util';
|
|
3
|
+
const execAsync = promisify(exec);
|
|
4
|
+
const REPO = 'shayke-cohen/ai-native-engineer';
|
|
5
|
+
const BRANCH = 'main';
|
|
6
|
+
const CACHE_TTL = 3600000; // 1 hour
|
|
7
|
+
const cache = new Map();
|
|
8
|
+
/**
|
|
9
|
+
* Execute a gh CLI command and return parsed JSON
|
|
10
|
+
*/
|
|
11
|
+
async function gh(command) {
|
|
12
|
+
try {
|
|
13
|
+
const { stdout } = await execAsync(`gh ${command}`);
|
|
14
|
+
return JSON.parse(stdout);
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
const err = error;
|
|
18
|
+
throw new Error(`gh CLI error: ${err.stderr || err.message}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if gh CLI is authenticated
|
|
23
|
+
*/
|
|
24
|
+
export async function checkGhAuth() {
|
|
25
|
+
try {
|
|
26
|
+
await execAsync('gh auth status');
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Fetch a template file from GitHub
|
|
35
|
+
*/
|
|
36
|
+
export async function fetchTemplate(path) {
|
|
37
|
+
const cacheKey = `template:${path}`;
|
|
38
|
+
const cached = cache.get(cacheKey);
|
|
39
|
+
if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
|
|
40
|
+
return cached.content;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
// Use gh api to get file contents
|
|
44
|
+
const result = await gh(`api repos/${REPO}/contents/${path}?ref=${BRANCH}`);
|
|
45
|
+
// GitHub returns base64 encoded content
|
|
46
|
+
const content = Buffer.from(result.content, 'base64').toString('utf-8');
|
|
47
|
+
cache.set(cacheKey, { content, timestamp: Date.now() });
|
|
48
|
+
return content;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
throw new Error(`Failed to fetch template ${path}: ${error.message}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* List all templates in a directory (recursive)
|
|
56
|
+
*/
|
|
57
|
+
export async function listTemplates(dir = 'templates') {
|
|
58
|
+
const cacheKey = `list:${dir}`;
|
|
59
|
+
const cached = cache.get(cacheKey);
|
|
60
|
+
if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
|
|
61
|
+
return JSON.parse(cached.content);
|
|
62
|
+
}
|
|
63
|
+
const templates = [];
|
|
64
|
+
async function fetchDir(path) {
|
|
65
|
+
try {
|
|
66
|
+
const items = await gh(`api repos/${REPO}/contents/${path}?ref=${BRANCH}`);
|
|
67
|
+
for (const item of items) {
|
|
68
|
+
if (item.type === 'file') {
|
|
69
|
+
templates.push(item.path);
|
|
70
|
+
}
|
|
71
|
+
else if (item.type === 'dir') {
|
|
72
|
+
await fetchDir(item.path);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.error(`Failed to list ${path}: ${error.message}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
await fetchDir(dir);
|
|
81
|
+
cache.set(cacheKey, { content: JSON.stringify(templates), timestamp: Date.now() });
|
|
82
|
+
return templates;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get the latest commit SHA
|
|
86
|
+
*/
|
|
87
|
+
export async function getLatestCommit() {
|
|
88
|
+
const cacheKey = 'commit:latest';
|
|
89
|
+
const cached = cache.get(cacheKey);
|
|
90
|
+
// Shorter TTL for commit check (5 minutes)
|
|
91
|
+
if (cached && Date.now() - cached.timestamp < 300000) {
|
|
92
|
+
return cached.content;
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
const result = await gh(`api repos/${REPO}/commits/${BRANCH}`);
|
|
96
|
+
const sha = result.sha.substring(0, 7);
|
|
97
|
+
cache.set(cacheKey, { content: sha, timestamp: Date.now() });
|
|
98
|
+
return sha;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
throw new Error(`Failed to get latest commit: ${error.message}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Clear the cache
|
|
106
|
+
*/
|
|
107
|
+
export function clearCache() {
|
|
108
|
+
cache.clear();
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=fetcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetcher.js","sourceRoot":"","sources":["../../src/github/fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,IAAI,GAAG,iCAAiC,CAAC;AAC/C,MAAM,MAAM,GAAG,MAAM,CAAC;AACtB,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,SAAS;AAOpC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;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ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { ListResourcesRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { registerAllTools } from './tools/index.js';
|
|
6
|
+
import { checkGhAuth } from './github/fetcher.js';
|
|
7
|
+
const SERVER_INSTRUCTIONS = `
|
|
8
|
+
# AI-Native Templates MCP Server
|
|
9
|
+
|
|
10
|
+
This MCP provides AI-Native Engineer templates. It is a pure data provider -
|
|
11
|
+
you (the agent) handle all file operations based on the returned llmInstructions.
|
|
12
|
+
|
|
13
|
+
## Single Tool: templates
|
|
14
|
+
|
|
15
|
+
### List available templates
|
|
16
|
+
\`\`\`
|
|
17
|
+
templates({ mode: "list" })
|
|
18
|
+
\`\`\`
|
|
19
|
+
Returns: Array of template paths with descriptions.
|
|
20
|
+
|
|
21
|
+
### Get all templates for syncing
|
|
22
|
+
\`\`\`
|
|
23
|
+
templates({ mode: "sync" })
|
|
24
|
+
\`\`\`
|
|
25
|
+
Returns: All templates with:
|
|
26
|
+
- destPath: Where to write the file
|
|
27
|
+
- content: Full file content
|
|
28
|
+
- llmInstructions: How to handle the file (action, preserve, update, hints)
|
|
29
|
+
|
|
30
|
+
## Workflow
|
|
31
|
+
|
|
32
|
+
1. Call templates({ mode: "sync" })
|
|
33
|
+
2. For each template, read existing file (if any)
|
|
34
|
+
3. Apply action from llmInstructions:
|
|
35
|
+
- "create-if-missing": Only create if file doesn't exist
|
|
36
|
+
- "overwrite": Replace file entirely
|
|
37
|
+
- "merge": Use preserve/update hints to merge intelligently
|
|
38
|
+
4. Write files using your file tools
|
|
39
|
+
5. Report what was created/updated/skipped
|
|
40
|
+
`.trim();
|
|
41
|
+
async function main() {
|
|
42
|
+
// Verify gh CLI is available and authenticated
|
|
43
|
+
const isAuthenticated = await checkGhAuth();
|
|
44
|
+
if (!isAuthenticated) {
|
|
45
|
+
console.error('[ai-native-engineer] ERROR: gh CLI not authenticated');
|
|
46
|
+
console.error('[ai-native-engineer] Run: gh auth login');
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
const server = new Server({ name: 'ai-native-engineer', version: '1.0.0' }, {
|
|
50
|
+
capabilities: { tools: {}, resources: {} },
|
|
51
|
+
instructions: SERVER_INSTRUCTIONS,
|
|
52
|
+
});
|
|
53
|
+
registerAllTools(server);
|
|
54
|
+
// Empty resources (templates fetched via templates tool)
|
|
55
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => ({ resources: [] }));
|
|
56
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => ({
|
|
57
|
+
contents: [{ uri: request.params.uri, mimeType: 'text/plain', text: 'Use templates tool instead' }],
|
|
58
|
+
}));
|
|
59
|
+
server.onerror = (error) => console.error('[ai-native-engineer] Error:', error);
|
|
60
|
+
const transport = new StdioServerTransport();
|
|
61
|
+
await server.connect(transport);
|
|
62
|
+
console.error('[ai-native-engineer] Server running (using gh CLI for GitHub API)');
|
|
63
|
+
}
|
|
64
|
+
main().catch(console.error);
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MA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AS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;AACrF,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.test.d.ts","sourceRoot":"","sources":["../../src/test/server.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
|
2
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
3
|
+
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
4
|
+
import { spawn } from 'child_process';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const SERVER_PATH = path.join(__dirname, '../../dist/index.js');
|
|
9
|
+
describe('AI-Native Templates MCP Server', () => {
|
|
10
|
+
let client;
|
|
11
|
+
let transport;
|
|
12
|
+
let serverProcess;
|
|
13
|
+
beforeAll(async () => {
|
|
14
|
+
// Spawn the server process
|
|
15
|
+
serverProcess = spawn('node', [SERVER_PATH], {
|
|
16
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
17
|
+
});
|
|
18
|
+
// Create transport connected to server's stdio
|
|
19
|
+
transport = new StdioClientTransport({
|
|
20
|
+
command: 'node',
|
|
21
|
+
args: [SERVER_PATH],
|
|
22
|
+
});
|
|
23
|
+
// Create client
|
|
24
|
+
client = new Client({ name: 'test-client', version: '1.0.0' }, { capabilities: {} });
|
|
25
|
+
// Connect
|
|
26
|
+
await client.connect(transport);
|
|
27
|
+
}, 30000); // 30s timeout for connection
|
|
28
|
+
afterAll(async () => {
|
|
29
|
+
await client?.close();
|
|
30
|
+
serverProcess?.kill();
|
|
31
|
+
});
|
|
32
|
+
describe('Tool: templates', () => {
|
|
33
|
+
it('should list available tools', async () => {
|
|
34
|
+
const tools = await client.listTools();
|
|
35
|
+
expect(tools.tools).toBeDefined();
|
|
36
|
+
expect(tools.tools.length).toBe(1);
|
|
37
|
+
expect(tools.tools[0].name).toBe('templates');
|
|
38
|
+
expect(tools.tools[0].inputSchema).toBeDefined();
|
|
39
|
+
});
|
|
40
|
+
it('should return template list with mode: "list"', async () => {
|
|
41
|
+
const result = await client.callTool({
|
|
42
|
+
name: 'templates',
|
|
43
|
+
arguments: { mode: 'list' },
|
|
44
|
+
});
|
|
45
|
+
expect(result.content).toBeDefined();
|
|
46
|
+
expect(result.content.length).toBeGreaterThan(0);
|
|
47
|
+
const content = result.content[0];
|
|
48
|
+
expect(content.type).toBe('text');
|
|
49
|
+
const parsed = JSON.parse(content.text);
|
|
50
|
+
expect(parsed.templates).toBeDefined();
|
|
51
|
+
expect(Array.isArray(parsed.templates)).toBe(true);
|
|
52
|
+
expect(parsed.templates.length).toBeGreaterThan(0);
|
|
53
|
+
// Check structure of first template
|
|
54
|
+
const firstTemplate = parsed.templates[0];
|
|
55
|
+
expect(firstTemplate).toHaveProperty('path');
|
|
56
|
+
expect(firstTemplate).toHaveProperty('destPath');
|
|
57
|
+
expect(firstTemplate).toHaveProperty('description');
|
|
58
|
+
});
|
|
59
|
+
it('should return full templates with mode: "sync"', async () => {
|
|
60
|
+
const result = await client.callTool({
|
|
61
|
+
name: 'templates',
|
|
62
|
+
arguments: { mode: 'sync' },
|
|
63
|
+
});
|
|
64
|
+
expect(result.content).toBeDefined();
|
|
65
|
+
expect(result.content.length).toBeGreaterThan(0);
|
|
66
|
+
const content = result.content[0];
|
|
67
|
+
expect(content.type).toBe('text');
|
|
68
|
+
const parsed = JSON.parse(content.text);
|
|
69
|
+
// Check top-level structure
|
|
70
|
+
expect(parsed.templates).toBeDefined();
|
|
71
|
+
expect(parsed.latestCommit).toBeDefined();
|
|
72
|
+
expect(parsed.globalInstructions).toBeDefined();
|
|
73
|
+
expect(Array.isArray(parsed.templates)).toBe(true);
|
|
74
|
+
expect(parsed.templates.length).toBeGreaterThan(0);
|
|
75
|
+
// Check structure of a template
|
|
76
|
+
const template = parsed.templates[0];
|
|
77
|
+
expect(template).toHaveProperty('destPath');
|
|
78
|
+
expect(template).toHaveProperty('content');
|
|
79
|
+
expect(template).toHaveProperty('llmInstructions');
|
|
80
|
+
// Check llmInstructions structure
|
|
81
|
+
const instructions = template.llmInstructions;
|
|
82
|
+
expect(instructions).toHaveProperty('purpose');
|
|
83
|
+
expect(instructions).toHaveProperty('action');
|
|
84
|
+
expect(['create-if-missing', 'overwrite', 'merge']).toContain(instructions.action);
|
|
85
|
+
}, 60000); // 60s timeout for fetching all templates
|
|
86
|
+
it('should include AGENTS.md template with merge instructions', async () => {
|
|
87
|
+
const result = await client.callTool({
|
|
88
|
+
name: 'templates',
|
|
89
|
+
arguments: { mode: 'sync' },
|
|
90
|
+
});
|
|
91
|
+
const parsed = JSON.parse(result.content[0].text);
|
|
92
|
+
const agentsMd = parsed.templates.find((t) => t.destPath === 'AGENTS.md');
|
|
93
|
+
expect(agentsMd).toBeDefined();
|
|
94
|
+
expect(agentsMd.llmInstructions.action).toBe('merge');
|
|
95
|
+
expect(agentsMd.llmInstructions.preserve).toBeDefined();
|
|
96
|
+
expect(agentsMd.llmInstructions.update).toBeDefined();
|
|
97
|
+
expect(agentsMd.content).toContain('# AGENTS.md');
|
|
98
|
+
}, 60000);
|
|
99
|
+
it('should include security.mdc template with overwrite action', async () => {
|
|
100
|
+
const result = await client.callTool({
|
|
101
|
+
name: 'templates',
|
|
102
|
+
arguments: { mode: 'sync' },
|
|
103
|
+
});
|
|
104
|
+
const parsed = JSON.parse(result.content[0].text);
|
|
105
|
+
const securityMdc = parsed.templates.find((t) => t.destPath === '.cursor/rules/security.mdc');
|
|
106
|
+
expect(securityMdc).toBeDefined();
|
|
107
|
+
expect(securityMdc.llmInstructions.action).toBe('overwrite');
|
|
108
|
+
}, 60000);
|
|
109
|
+
it('should throw error for invalid mode', async () => {
|
|
110
|
+
await expect(client.callTool({
|
|
111
|
+
name: 'templates',
|
|
112
|
+
arguments: { mode: 'invalid' },
|
|
113
|
+
})).rejects.toThrow();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
describe('Server metadata', () => {
|
|
117
|
+
it('should have correct server info', async () => {
|
|
118
|
+
const serverInfo = client.getServerVersion();
|
|
119
|
+
expect(serverInfo?.name).toBe('ai-native-engineer');
|
|
120
|
+
expect(serverInfo?.version).toBe('1.0.0');
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=server.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.test.js","sourceRoot":"","sources":["../../src/test/server.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;AAWhE,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,IAAI,MAAc,CAAC;IACnB,IAAI,SAA+B,CAAC;IACpC,IAAI,aAA2B,CAAC;IAEhC,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,2BAA2B;QAC3B,aAAa,GAAG,KAAK,CAAC,MAAM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,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAyBnE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAqCrD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { getAllTemplates, getTemplateList } from './templates.js';
|
|
3
|
+
const tools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'templates',
|
|
6
|
+
description: 'AI-Native Engineer templates. Returns template content + llmInstructions for intelligent handling by the agent.',
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
mode: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
enum: ['list', 'sync'],
|
|
13
|
+
description: 'list: get template names and descriptions. sync: get all templates with full content and llmInstructions for each file.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
required: ['mode'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
export function registerAllTools(server) {
|
|
21
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));
|
|
22
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
23
|
+
const { name, arguments: args } = request.params;
|
|
24
|
+
if (name !== 'templates') {
|
|
25
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
26
|
+
}
|
|
27
|
+
const typedArgs = args;
|
|
28
|
+
switch (typedArgs.mode) {
|
|
29
|
+
case 'list': {
|
|
30
|
+
const templates = await getTemplateList();
|
|
31
|
+
return {
|
|
32
|
+
content: [{
|
|
33
|
+
type: 'text',
|
|
34
|
+
text: JSON.stringify({ templates }, null, 2),
|
|
35
|
+
}],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
case 'sync': {
|
|
39
|
+
const result = await getAllTemplates();
|
|
40
|
+
return {
|
|
41
|
+
content: [{
|
|
42
|
+
type: 'text',
|
|
43
|
+
text: JSON.stringify(result, null, 2),
|
|
44
|
+
}],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
default:
|
|
48
|
+
throw new Error(`Unknown mode: ${typedArgs.mode}. Use "list" or "sync".`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,KAAK,GAAG;IACZ;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,iHAAiH;QAC9H,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;oBACtB,WAAW,EAAE,yHAAyH;iBACvI;aACF;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;KACF;CACF,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAE1E,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QAEjD,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,SAAS,GAAG,IAAwB,CAAC;QAE3C,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;YACvB,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,SAAS,GAAG,MAAM,eAAe,EAAE,CAAC;gBAC1C,OAAO;oBACL,OAAO,EAAE,CAAC;4BACR,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;yBAC7C,CAAC;iBACH,CAAC;YACJ,CAAC;YAED,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAC;gBACvC,OAAO;oBACL,OAAO,EAAE,CAAC;4BACR,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC,CAAC;iBACH,CAAC;YACJ,CAAC;YAED;gBACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,SAAS,CAAC,IAAI,yBAAyB,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface LlmInstructions {
|
|
2
|
+
purpose: string;
|
|
3
|
+
action: 'create-if-missing' | 'overwrite' | 'merge';
|
|
4
|
+
preserve?: string[];
|
|
5
|
+
update?: string[];
|
|
6
|
+
hints?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Template {
|
|
9
|
+
destPath: string;
|
|
10
|
+
content: string;
|
|
11
|
+
llmInstructions: LlmInstructions;
|
|
12
|
+
}
|
|
13
|
+
export interface TemplateListItem {
|
|
14
|
+
path: string;
|
|
15
|
+
destPath: string;
|
|
16
|
+
description: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get list of templates with descriptions
|
|
20
|
+
*/
|
|
21
|
+
export declare function getTemplateList(): Promise<TemplateListItem[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Get all templates with content and llmInstructions
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAllTemplates(): Promise<{
|
|
26
|
+
templates: Template[];
|
|
27
|
+
latestCommit: string;
|
|
28
|
+
globalInstructions: string;
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/tools/templates.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,mBAAmB,GAAG,WAAW,GAAG,OAAO,CAAC;IACpD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AA2eD;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAMnE;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC;IAC/C,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC,CA6CD"}
|
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
import { fetchTemplate, getLatestCommit } from '../github/fetcher.js';
|
|
2
|
+
// Template metadata - defines how each template should be handled
|
|
3
|
+
const TEMPLATE_METADATA = {
|
|
4
|
+
// Root documentation files
|
|
5
|
+
'templates/root/AGENTS.md': {
|
|
6
|
+
sourcePath: 'templates/root/AGENTS.md',
|
|
7
|
+
destPath: 'AGENTS.md',
|
|
8
|
+
llmInstructions: {
|
|
9
|
+
purpose: 'Core AI agent instructions. Defines how agents work in this project.',
|
|
10
|
+
action: 'merge',
|
|
11
|
+
preserve: ['Quick Reference Commands', 'Project Overview', 'Tech Stack', 'Project Structure'],
|
|
12
|
+
update: ['Critical Rules', 'GitHub Issues Workflow', 'GitHub CLI Reference', 'Ad-Hoc Task Workflow', 'Parallel Development', 'Testing Requirements', 'Test-Discovered Bug Workflow', 'Code Style', 'Screenshot Guidelines', 'Adding Knowledge', 'Troubleshooting', 'Getting Help', 'Quick Checklist'],
|
|
13
|
+
hints: 'Keep project-specific sections (commands, description, stack, structure). Update all process/workflow/rules sections from template.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
'templates/root/CONTRIBUTING.md': {
|
|
17
|
+
sourcePath: 'templates/root/CONTRIBUTING.md',
|
|
18
|
+
destPath: 'CONTRIBUTING.md',
|
|
19
|
+
llmInstructions: {
|
|
20
|
+
purpose: 'Contribution guidelines for the project.',
|
|
21
|
+
action: 'create-if-missing',
|
|
22
|
+
hints: 'Only create if missing. User may have customized.',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
'templates/root/SECURITY.md': {
|
|
26
|
+
sourcePath: 'templates/root/SECURITY.md',
|
|
27
|
+
destPath: 'SECURITY.md',
|
|
28
|
+
llmInstructions: {
|
|
29
|
+
purpose: 'Security policy and vulnerability reporting.',
|
|
30
|
+
action: 'create-if-missing',
|
|
31
|
+
hints: 'Only create if missing. Security policies vary by project.',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
'templates/root/TESTING.md': {
|
|
35
|
+
sourcePath: 'templates/root/TESTING.md',
|
|
36
|
+
destPath: 'TESTING.md',
|
|
37
|
+
llmInstructions: {
|
|
38
|
+
purpose: 'Testing guidelines and practices.',
|
|
39
|
+
action: 'create-if-missing',
|
|
40
|
+
hints: 'Only create if missing. Testing approaches vary by project.',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
'templates/root/PLANNING.md': {
|
|
44
|
+
sourcePath: 'templates/root/PLANNING.md',
|
|
45
|
+
destPath: 'docs/PLANNING.md',
|
|
46
|
+
llmInstructions: {
|
|
47
|
+
purpose: 'Planning process documentation.',
|
|
48
|
+
action: 'create-if-missing',
|
|
49
|
+
hints: 'Only create if missing.',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
// Cursor rules
|
|
53
|
+
'templates/cursor-rules/always.mdc': {
|
|
54
|
+
sourcePath: 'templates/cursor-rules/always.mdc',
|
|
55
|
+
destPath: '.cursor/rules/always.mdc',
|
|
56
|
+
llmInstructions: {
|
|
57
|
+
purpose: 'Always-applied Cursor rules. Core workflow rules for all files.',
|
|
58
|
+
action: 'overwrite',
|
|
59
|
+
hints: 'These rules should match template exactly. They define core agent behavior.',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
'templates/cursor-rules/security.mdc': {
|
|
63
|
+
sourcePath: 'templates/cursor-rules/security.mdc',
|
|
64
|
+
destPath: '.cursor/rules/security.mdc',
|
|
65
|
+
llmInstructions: {
|
|
66
|
+
purpose: 'Security rules. Prevents common security mistakes.',
|
|
67
|
+
action: 'overwrite',
|
|
68
|
+
hints: 'Security rules should not be customized. Keep template version.',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
'templates/cursor-rules/testing.mdc': {
|
|
72
|
+
sourcePath: 'templates/cursor-rules/testing.mdc',
|
|
73
|
+
destPath: '.cursor/rules/testing.mdc',
|
|
74
|
+
llmInstructions: {
|
|
75
|
+
purpose: 'Testing rules applied to test files.',
|
|
76
|
+
action: 'overwrite',
|
|
77
|
+
hints: 'Standard testing practices. Update from template.',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
'templates/cursor-rules/code-style.mdc': {
|
|
81
|
+
sourcePath: 'templates/cursor-rules/code-style.mdc',
|
|
82
|
+
destPath: '.cursor/rules/code-style.mdc',
|
|
83
|
+
llmInstructions: {
|
|
84
|
+
purpose: 'Code style guidelines.',
|
|
85
|
+
action: 'merge',
|
|
86
|
+
preserve: ['Project-specific naming conventions', 'Custom lint rules'],
|
|
87
|
+
update: ['General best practices'],
|
|
88
|
+
hints: 'Preserve project-specific style rules, update general guidelines.',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
'templates/cursor-rules/architecture.mdc': {
|
|
92
|
+
sourcePath: 'templates/cursor-rules/architecture.mdc',
|
|
93
|
+
destPath: '.cursor/rules/architecture.mdc',
|
|
94
|
+
llmInstructions: {
|
|
95
|
+
purpose: 'Architecture rules for source files.',
|
|
96
|
+
action: 'merge',
|
|
97
|
+
preserve: ['Project-specific architecture decisions'],
|
|
98
|
+
update: ['General architecture patterns'],
|
|
99
|
+
hints: 'Preserve project-specific decisions, update general patterns.',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
// Scripts
|
|
103
|
+
'templates/scripts/start-issue.sh': {
|
|
104
|
+
sourcePath: 'templates/scripts/start-issue.sh',
|
|
105
|
+
destPath: 'scripts/start-issue.sh',
|
|
106
|
+
llmInstructions: {
|
|
107
|
+
purpose: 'Script to start work on a GitHub issue. Creates branch and worktree.',
|
|
108
|
+
action: 'create-if-missing',
|
|
109
|
+
hints: 'Only create if missing. User may have customized. After creating, remind user to run: chmod +x scripts/*.sh',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
'templates/scripts/finish-issue.sh': {
|
|
113
|
+
sourcePath: 'templates/scripts/finish-issue.sh',
|
|
114
|
+
destPath: 'scripts/finish-issue.sh',
|
|
115
|
+
llmInstructions: {
|
|
116
|
+
purpose: 'Script to create PR for an issue.',
|
|
117
|
+
action: 'create-if-missing',
|
|
118
|
+
hints: 'Only create if missing. User may have customized.',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
'templates/scripts/check-ci.sh': {
|
|
122
|
+
sourcePath: 'templates/scripts/check-ci.sh',
|
|
123
|
+
destPath: 'scripts/check-ci.sh',
|
|
124
|
+
llmInstructions: {
|
|
125
|
+
purpose: 'Script to check CI status with retry loop.',
|
|
126
|
+
action: 'create-if-missing',
|
|
127
|
+
hints: 'Only create if missing.',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
'templates/scripts/setup.sh': {
|
|
131
|
+
sourcePath: 'templates/scripts/setup.sh',
|
|
132
|
+
destPath: 'scripts/setup.sh',
|
|
133
|
+
llmInstructions: {
|
|
134
|
+
purpose: 'Project setup script.',
|
|
135
|
+
action: 'create-if-missing',
|
|
136
|
+
hints: 'Only create if missing. User may have customized.',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
'templates/scripts/setup-labels.sh': {
|
|
140
|
+
sourcePath: 'templates/scripts/setup-labels.sh',
|
|
141
|
+
destPath: 'scripts/setup-labels.sh',
|
|
142
|
+
llmInstructions: {
|
|
143
|
+
purpose: 'Script to setup GitHub labels.',
|
|
144
|
+
action: 'create-if-missing',
|
|
145
|
+
hints: 'Only create if missing.',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
'templates/scripts/config.sh': {
|
|
149
|
+
sourcePath: 'templates/scripts/config.sh',
|
|
150
|
+
destPath: 'scripts/config.sh',
|
|
151
|
+
llmInstructions: {
|
|
152
|
+
purpose: 'Shared configuration for scripts.',
|
|
153
|
+
action: 'create-if-missing',
|
|
154
|
+
hints: 'Only create if missing. User may have customized paths.',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
'templates/scripts/list-worktrees.sh': {
|
|
158
|
+
sourcePath: 'templates/scripts/list-worktrees.sh',
|
|
159
|
+
destPath: 'scripts/list-worktrees.sh',
|
|
160
|
+
llmInstructions: {
|
|
161
|
+
purpose: 'Script to list active worktrees.',
|
|
162
|
+
action: 'create-if-missing',
|
|
163
|
+
hints: 'Only create if missing.',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
'templates/scripts/create-task-issue.sh': {
|
|
167
|
+
sourcePath: 'templates/scripts/create-task-issue.sh',
|
|
168
|
+
destPath: 'scripts/create-task-issue.sh',
|
|
169
|
+
llmInstructions: {
|
|
170
|
+
purpose: 'Script to create a task issue.',
|
|
171
|
+
action: 'create-if-missing',
|
|
172
|
+
hints: 'Only create if missing.',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
'templates/scripts/create-bug-issue.sh': {
|
|
176
|
+
sourcePath: 'templates/scripts/create-bug-issue.sh',
|
|
177
|
+
destPath: 'scripts/create-bug-issue.sh',
|
|
178
|
+
llmInstructions: {
|
|
179
|
+
purpose: 'Script to create a bug issue.',
|
|
180
|
+
action: 'create-if-missing',
|
|
181
|
+
hints: 'Only create if missing.',
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
'templates/scripts/verify-setup.sh': {
|
|
185
|
+
sourcePath: 'templates/scripts/verify-setup.sh',
|
|
186
|
+
destPath: 'scripts/verify-setup.sh',
|
|
187
|
+
llmInstructions: {
|
|
188
|
+
purpose: 'Script to verify project setup.',
|
|
189
|
+
action: 'create-if-missing',
|
|
190
|
+
hints: 'Only create if missing.',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
'templates/scripts/setup-mcp.sh': {
|
|
194
|
+
sourcePath: 'templates/scripts/setup-mcp.sh',
|
|
195
|
+
destPath: 'scripts/setup-mcp.sh',
|
|
196
|
+
llmInstructions: {
|
|
197
|
+
purpose: 'Script to setup MCP servers.',
|
|
198
|
+
action: 'create-if-missing',
|
|
199
|
+
hints: 'Only create if missing.',
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
// GitHub templates
|
|
203
|
+
'templates/github/PULL_REQUEST_TEMPLATE.md': {
|
|
204
|
+
sourcePath: 'templates/github/PULL_REQUEST_TEMPLATE.md',
|
|
205
|
+
destPath: '.github/PULL_REQUEST_TEMPLATE.md',
|
|
206
|
+
llmInstructions: {
|
|
207
|
+
purpose: 'PR template for consistent pull requests.',
|
|
208
|
+
action: 'create-if-missing',
|
|
209
|
+
hints: 'Only create if missing. User may have customized.',
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
'templates/github/copilot-instructions.md': {
|
|
213
|
+
sourcePath: 'templates/github/copilot-instructions.md',
|
|
214
|
+
destPath: '.github/copilot-instructions.md',
|
|
215
|
+
llmInstructions: {
|
|
216
|
+
purpose: 'Instructions for GitHub Copilot.',
|
|
217
|
+
action: 'create-if-missing',
|
|
218
|
+
hints: 'Only create if missing.',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
'templates/github/ISSUE_TEMPLATE/bug_report.md': {
|
|
222
|
+
sourcePath: 'templates/github/ISSUE_TEMPLATE/bug_report.md',
|
|
223
|
+
destPath: '.github/ISSUE_TEMPLATE/bug_report.md',
|
|
224
|
+
llmInstructions: {
|
|
225
|
+
purpose: 'Bug report issue template.',
|
|
226
|
+
action: 'create-if-missing',
|
|
227
|
+
hints: 'Only create if missing.',
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
'templates/github/ISSUE_TEMPLATE/feature_request.md': {
|
|
231
|
+
sourcePath: 'templates/github/ISSUE_TEMPLATE/feature_request.md',
|
|
232
|
+
destPath: '.github/ISSUE_TEMPLATE/feature_request.md',
|
|
233
|
+
llmInstructions: {
|
|
234
|
+
purpose: 'Feature request issue template.',
|
|
235
|
+
action: 'create-if-missing',
|
|
236
|
+
hints: 'Only create if missing.',
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
'templates/github/ISSUE_TEMPLATE/task.md': {
|
|
240
|
+
sourcePath: 'templates/github/ISSUE_TEMPLATE/task.md',
|
|
241
|
+
destPath: '.github/ISSUE_TEMPLATE/task.md',
|
|
242
|
+
llmInstructions: {
|
|
243
|
+
purpose: 'Task issue template.',
|
|
244
|
+
action: 'create-if-missing',
|
|
245
|
+
hints: 'Only create if missing.',
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
'templates/github/ISSUE_TEMPLATE/agent-task.md': {
|
|
249
|
+
sourcePath: 'templates/github/ISSUE_TEMPLATE/agent-task.md',
|
|
250
|
+
destPath: '.github/ISSUE_TEMPLATE/agent-task.md',
|
|
251
|
+
llmInstructions: {
|
|
252
|
+
purpose: 'Agent-created task issue template.',
|
|
253
|
+
action: 'create-if-missing',
|
|
254
|
+
hints: 'Only create if missing.',
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
'templates/github/ISSUE_TEMPLATE/planning.md': {
|
|
258
|
+
sourcePath: 'templates/github/ISSUE_TEMPLATE/planning.md',
|
|
259
|
+
destPath: '.github/ISSUE_TEMPLATE/planning.md',
|
|
260
|
+
llmInstructions: {
|
|
261
|
+
purpose: 'Planning issue template.',
|
|
262
|
+
action: 'create-if-missing',
|
|
263
|
+
hints: 'Only create if missing.',
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
'templates/github/ISSUE_TEMPLATE/lesson_learned.md': {
|
|
267
|
+
sourcePath: 'templates/github/ISSUE_TEMPLATE/lesson_learned.md',
|
|
268
|
+
destPath: '.github/ISSUE_TEMPLATE/lesson_learned.md',
|
|
269
|
+
llmInstructions: {
|
|
270
|
+
purpose: 'Lesson learned issue template.',
|
|
271
|
+
action: 'create-if-missing',
|
|
272
|
+
hints: 'Only create if missing.',
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
'templates/github/workflows/ci.yml': {
|
|
276
|
+
sourcePath: 'templates/github/workflows/ci.yml',
|
|
277
|
+
destPath: '.github/workflows/ci.yml',
|
|
278
|
+
llmInstructions: {
|
|
279
|
+
purpose: 'CI workflow for automated testing.',
|
|
280
|
+
action: 'create-if-missing',
|
|
281
|
+
hints: 'Only create if missing. CI workflows are highly project-specific.',
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
'templates/github/workflows/pr-checks.yml': {
|
|
285
|
+
sourcePath: 'templates/github/workflows/pr-checks.yml',
|
|
286
|
+
destPath: '.github/workflows/pr-checks.yml',
|
|
287
|
+
llmInstructions: {
|
|
288
|
+
purpose: 'PR checks workflow.',
|
|
289
|
+
action: 'create-if-missing',
|
|
290
|
+
hints: 'Only create if missing. PR checks vary by project.',
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
// Knowledge base
|
|
294
|
+
'templates/knowledge/DECISIONS.md': {
|
|
295
|
+
sourcePath: 'templates/knowledge/DECISIONS.md',
|
|
296
|
+
destPath: 'knowledge/DECISIONS.md',
|
|
297
|
+
llmInstructions: {
|
|
298
|
+
purpose: 'Architecture decisions log.',
|
|
299
|
+
action: 'merge',
|
|
300
|
+
preserve: ['All existing decision entries'],
|
|
301
|
+
update: ['File header/template structure only'],
|
|
302
|
+
hints: 'Keep all existing decisions. Only update header format if needed.',
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
'templates/knowledge/KNOWN_ISSUES.md': {
|
|
306
|
+
sourcePath: 'templates/knowledge/KNOWN_ISSUES.md',
|
|
307
|
+
destPath: 'knowledge/KNOWN_ISSUES.md',
|
|
308
|
+
llmInstructions: {
|
|
309
|
+
purpose: 'Document known issues and workarounds.',
|
|
310
|
+
action: 'merge',
|
|
311
|
+
preserve: ['All existing issue entries'],
|
|
312
|
+
update: ['File header/template structure only'],
|
|
313
|
+
hints: 'Keep all existing issues. Only update header format if needed.',
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
'templates/knowledge/LESSONS_LEARNED.md': {
|
|
317
|
+
sourcePath: 'templates/knowledge/LESSONS_LEARNED.md',
|
|
318
|
+
destPath: 'knowledge/LESSONS_LEARNED.md',
|
|
319
|
+
llmInstructions: {
|
|
320
|
+
purpose: 'Document lessons learned for future reference.',
|
|
321
|
+
action: 'merge',
|
|
322
|
+
preserve: ['All existing lesson entries'],
|
|
323
|
+
update: ['File header/template structure only'],
|
|
324
|
+
hints: 'Keep all existing lessons. Only update header format if needed.',
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
// Tasks
|
|
328
|
+
'templates/tasks/WORKFLOW.md': {
|
|
329
|
+
sourcePath: 'templates/tasks/WORKFLOW.md',
|
|
330
|
+
destPath: 'tasks/WORKFLOW.md',
|
|
331
|
+
llmInstructions: {
|
|
332
|
+
purpose: 'Task workflow documentation.',
|
|
333
|
+
action: 'create-if-missing',
|
|
334
|
+
hints: 'Only create if missing.',
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
// Docs
|
|
338
|
+
'templates/docs/design/TEMPLATE-feature-spec.md': {
|
|
339
|
+
sourcePath: 'templates/docs/design/TEMPLATE-feature-spec.md',
|
|
340
|
+
destPath: 'docs/templates/TEMPLATE-feature-spec.md',
|
|
341
|
+
llmInstructions: {
|
|
342
|
+
purpose: 'Feature specification template.',
|
|
343
|
+
action: 'create-if-missing',
|
|
344
|
+
hints: 'Only create if missing.',
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
'templates/docs/design/TEMPLATE-technical-design.md': {
|
|
348
|
+
sourcePath: 'templates/docs/design/TEMPLATE-technical-design.md',
|
|
349
|
+
destPath: 'docs/templates/TEMPLATE-technical-design.md',
|
|
350
|
+
llmInstructions: {
|
|
351
|
+
purpose: 'Technical design template.',
|
|
352
|
+
action: 'create-if-missing',
|
|
353
|
+
hints: 'Only create if missing.',
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
// Cursor Commands - AI-Native Engineer workflows
|
|
357
|
+
'templates/cursor-commands/sync-templates.md': {
|
|
358
|
+
sourcePath: 'templates/cursor-commands/sync-templates.md',
|
|
359
|
+
destPath: '.cursor/commands/sync-templates.md',
|
|
360
|
+
llmInstructions: {
|
|
361
|
+
purpose: 'Slash command to sync AI-Native Engineer templates via MCP.',
|
|
362
|
+
action: 'overwrite',
|
|
363
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
'templates/cursor-commands/start-issue.md': {
|
|
367
|
+
sourcePath: 'templates/cursor-commands/start-issue.md',
|
|
368
|
+
destPath: '.cursor/commands/start-issue.md',
|
|
369
|
+
llmInstructions: {
|
|
370
|
+
purpose: 'Slash command to start work on a GitHub issue.',
|
|
371
|
+
action: 'overwrite',
|
|
372
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
'templates/cursor-commands/finish-issue.md': {
|
|
376
|
+
sourcePath: 'templates/cursor-commands/finish-issue.md',
|
|
377
|
+
destPath: '.cursor/commands/finish-issue.md',
|
|
378
|
+
llmInstructions: {
|
|
379
|
+
purpose: 'Slash command to create PR for completed issue.',
|
|
380
|
+
action: 'overwrite',
|
|
381
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
'templates/cursor-commands/progress-update.md': {
|
|
385
|
+
sourcePath: 'templates/cursor-commands/progress-update.md',
|
|
386
|
+
destPath: '.cursor/commands/progress-update.md',
|
|
387
|
+
llmInstructions: {
|
|
388
|
+
purpose: 'Slash command to post progress update to current issue.',
|
|
389
|
+
action: 'overwrite',
|
|
390
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
'templates/cursor-commands/check-ci.md': {
|
|
394
|
+
sourcePath: 'templates/cursor-commands/check-ci.md',
|
|
395
|
+
destPath: '.cursor/commands/check-ci.md',
|
|
396
|
+
llmInstructions: {
|
|
397
|
+
purpose: 'Slash command to check CI status with self-healing loop.',
|
|
398
|
+
action: 'overwrite',
|
|
399
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
'templates/cursor-commands/pre-commit.md': {
|
|
403
|
+
sourcePath: 'templates/cursor-commands/pre-commit.md',
|
|
404
|
+
destPath: '.cursor/commands/pre-commit.md',
|
|
405
|
+
llmInstructions: {
|
|
406
|
+
purpose: 'Slash command to run lint, typecheck, tests before commit.',
|
|
407
|
+
action: 'overwrite',
|
|
408
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
'templates/cursor-commands/code-review.md': {
|
|
412
|
+
sourcePath: 'templates/cursor-commands/code-review.md',
|
|
413
|
+
destPath: '.cursor/commands/code-review.md',
|
|
414
|
+
llmInstructions: {
|
|
415
|
+
purpose: 'Slash command to review code changes vs main before commit.',
|
|
416
|
+
action: 'overwrite',
|
|
417
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
// Cursor Commands - AI-Tester workflows
|
|
421
|
+
'templates/cursor-commands/test-flow.md': {
|
|
422
|
+
sourcePath: 'templates/cursor-commands/test-flow.md',
|
|
423
|
+
destPath: '.cursor/commands/test-flow.md',
|
|
424
|
+
llmInstructions: {
|
|
425
|
+
purpose: 'Slash command to test a user flow using AI-Tester.',
|
|
426
|
+
action: 'overwrite',
|
|
427
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
'templates/cursor-commands/explore-app.md': {
|
|
431
|
+
sourcePath: 'templates/cursor-commands/explore-app.md',
|
|
432
|
+
destPath: '.cursor/commands/explore-app.md',
|
|
433
|
+
llmInstructions: {
|
|
434
|
+
purpose: 'Slash command to explore app for bugs with AI.',
|
|
435
|
+
action: 'overwrite',
|
|
436
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
'templates/cursor-commands/generate-regression.md': {
|
|
440
|
+
sourcePath: 'templates/cursor-commands/generate-regression.md',
|
|
441
|
+
destPath: '.cursor/commands/generate-regression.md',
|
|
442
|
+
llmInstructions: {
|
|
443
|
+
purpose: 'Slash command to generate regression tests from session.',
|
|
444
|
+
action: 'overwrite',
|
|
445
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
446
|
+
},
|
|
447
|
+
},
|
|
448
|
+
'templates/cursor-commands/run-test.md': {
|
|
449
|
+
sourcePath: 'templates/cursor-commands/run-test.md',
|
|
450
|
+
destPath: '.cursor/commands/run-test.md',
|
|
451
|
+
llmInstructions: {
|
|
452
|
+
purpose: 'Slash command to run existing test file (Maestro/Playwright).',
|
|
453
|
+
action: 'overwrite',
|
|
454
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
'templates/cursor-commands/fix-failing-test.md': {
|
|
458
|
+
sourcePath: 'templates/cursor-commands/fix-failing-test.md',
|
|
459
|
+
destPath: '.cursor/commands/fix-failing-test.md',
|
|
460
|
+
llmInstructions: {
|
|
461
|
+
purpose: 'Slash command to run test and auto-fix failures.',
|
|
462
|
+
action: 'overwrite',
|
|
463
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
'templates/cursor-commands/visual-regression.md': {
|
|
467
|
+
sourcePath: 'templates/cursor-commands/visual-regression.md',
|
|
468
|
+
destPath: '.cursor/commands/visual-regression.md',
|
|
469
|
+
llmInstructions: {
|
|
470
|
+
purpose: 'Slash command for screenshot comparison testing.',
|
|
471
|
+
action: 'overwrite',
|
|
472
|
+
hints: 'Commands are overwritten on sync to get latest workflows.',
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* Get list of templates with descriptions
|
|
478
|
+
*/
|
|
479
|
+
export async function getTemplateList() {
|
|
480
|
+
return Object.entries(TEMPLATE_METADATA).map(([key, meta]) => ({
|
|
481
|
+
path: meta.sourcePath,
|
|
482
|
+
destPath: meta.destPath,
|
|
483
|
+
description: meta.llmInstructions.purpose,
|
|
484
|
+
}));
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Get all templates with content and llmInstructions
|
|
488
|
+
*/
|
|
489
|
+
export async function getAllTemplates() {
|
|
490
|
+
const templates = [];
|
|
491
|
+
const errors = [];
|
|
492
|
+
for (const [key, meta] of Object.entries(TEMPLATE_METADATA)) {
|
|
493
|
+
try {
|
|
494
|
+
const content = await fetchTemplate(meta.sourcePath);
|
|
495
|
+
templates.push({
|
|
496
|
+
destPath: meta.destPath,
|
|
497
|
+
content,
|
|
498
|
+
llmInstructions: meta.llmInstructions,
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
catch (error) {
|
|
502
|
+
errors.push(`${meta.sourcePath}: ${error.message}`);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
if (errors.length > 0) {
|
|
506
|
+
console.error('[ai-native-engineer] Failed to fetch some templates:', errors);
|
|
507
|
+
}
|
|
508
|
+
return {
|
|
509
|
+
templates,
|
|
510
|
+
latestCommit: await getLatestCommit(),
|
|
511
|
+
globalInstructions: `
|
|
512
|
+
For each template in the response:
|
|
513
|
+
|
|
514
|
+
1. Check if file exists at destPath
|
|
515
|
+
2. Apply action from llmInstructions:
|
|
516
|
+
- "create-if-missing": Only create if file doesn't exist. Skip if exists.
|
|
517
|
+
- "overwrite": Replace file entirely with template content.
|
|
518
|
+
- "merge":
|
|
519
|
+
* Read existing file
|
|
520
|
+
* Identify sections listed in 'preserve' array - keep those from existing file
|
|
521
|
+
* Identify sections listed in 'update' array - replace those with template version
|
|
522
|
+
* Use 'hints' for guidance on edge cases
|
|
523
|
+
3. Write file using your file editing tools
|
|
524
|
+
4. Track results: created, updated, skipped
|
|
525
|
+
|
|
526
|
+
After processing all templates:
|
|
527
|
+
- Report summary: X created, Y updated, Z skipped
|
|
528
|
+
- For scripts, remind user: chmod +x scripts/*.sh
|
|
529
|
+
- Note any files that failed or had conflicts
|
|
530
|
+
`.trim(),
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,CAAC,sDAAsD,EAAE,MAAM,CAAC,CAAC;IAChF,CAAC;IAED,OAAO;QACL,SAAS;QACT,YAAY,EAAE,MAAM,eAAe,EAAE;QACrC,kBAAkB,EAAE;;;;;;;;;;;;;;;;;;;KAmBnB,CAAC,IAAI,EAAE;KACT,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shaykec/ai-native-engineer",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "MCP server for AI-Native Engineer templates",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"ai-native-engineer": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:watch": "vitest",
|
|
16
|
+
"prepare": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"mcp",
|
|
20
|
+
"ai-native",
|
|
21
|
+
"templates",
|
|
22
|
+
"cursor"
|
|
23
|
+
],
|
|
24
|
+
"author": "shaykec",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^20.10.0",
|
|
31
|
+
"typescript": "^5.3.0",
|
|
32
|
+
"vitest": "^2.0.0"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=20.0.0"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist/**/*"
|
|
39
|
+
],
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
}
|
|
43
|
+
}
|