@vfarcic/dot-ai 0.36.0 → 0.38.0
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 +49 -14
- package/dist/interfaces/mcp.d.ts +4 -0
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +26 -2
- package/dist/tools/prompts.d.ts +31 -0
- package/dist/tools/prompts.d.ts.map +1 -0
- package/dist/tools/prompts.js +200 -0
- package/package.json +2 -1
- package/prompts/doc-testing-test-section.md +41 -7
- package/shared-prompts/context-load.md +19 -0
- package/shared-prompts/context-save.md +24 -0
- package/shared-prompts/prd-create.md +172 -0
- package/shared-prompts/prd-done.md +53 -0
- package/shared-prompts/prd-next.md +247 -0
- package/shared-prompts/prd-start.md +186 -0
- package/shared-prompts/prd-update-decisions.md +89 -0
- package/shared-prompts/prd-update-progress.md +233 -0
- package/shared-prompts/prds-get.md +35 -0
- package/shared-prompts/tests-reminder.md +40 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
DevOps AI Toolkit provides
|
|
9
|
+
DevOps AI Toolkit provides three powerful AI-driven capabilities: **Kubernetes deployment recommendations** that discover your cluster's capabilities and suggest optimal deployment approaches, **automated documentation testing** that validates documentation accuracy by executing commands and testing examples, and **shared prompts library** that enables centralized prompt sharing via native slash commands across development teams.
|
|
10
10
|
|
|
11
11
|
## Who is this for?
|
|
12
12
|
|
|
@@ -19,8 +19,13 @@ DevOps AI Toolkit provides two powerful AI-driven capabilities: **Kubernetes dep
|
|
|
19
19
|
- **Technical Writers**: Identify which sections need updates and prioritize work effectively
|
|
20
20
|
- **Open Source Maintainers**: Ensure documentation works correctly for new contributors
|
|
21
21
|
|
|
22
|
+
### Shared Prompts Library
|
|
23
|
+
- **Development Teams**: Share proven prompts across projects without file management
|
|
24
|
+
- **Project Managers**: Standardize workflows with consistent prompt usage across teams
|
|
25
|
+
- **Individual Developers**: Access curated prompt library via native slash commands
|
|
26
|
+
|
|
22
27
|
### AI Integration
|
|
23
|
-
- **AI Agents**: Integrate
|
|
28
|
+
- **AI Agents**: Integrate all capabilities with Claude Code, Cursor, or VS Code for conversational workflows
|
|
24
29
|
|
|
25
30
|
## Key Features
|
|
26
31
|
|
|
@@ -36,19 +41,31 @@ DevOps AI Toolkit provides two powerful AI-driven capabilities: **Kubernetes dep
|
|
|
36
41
|
🛠️ **Fix Application**: User-driven selection and application of recommended documentation improvements
|
|
37
42
|
💾 **Session Management**: Resumable testing workflows for large documentation sets
|
|
38
43
|
|
|
44
|
+
### Shared Prompts Library
|
|
45
|
+
🎯 **Native Slash Commands**: Prompts appear as `/dot-ai:prompt-name` in your coding agent
|
|
46
|
+
📚 **Curated Library**: Access proven prompts for code review, documentation, architecture, and project management
|
|
47
|
+
🔄 **Zero Setup**: Connect to MCP server and prompts are immediately available across all projects
|
|
48
|
+
🤝 **Team Consistency**: Standardized prompt usage with centralized management
|
|
49
|
+
|
|
39
50
|
### AI Integration
|
|
40
51
|
⚡ **MCP Integration**: Works seamlessly with Claude Code, Cursor, or VS Code through Model Context Protocol
|
|
41
|
-
🤖 **Conversational Interface**: Natural language interaction for
|
|
52
|
+
🤖 **Conversational Interface**: Natural language interaction for deployment, documentation testing, and shared prompt workflows
|
|
53
|
+
|
|
54
|
+
**Setup Required**: See the [MCP Setup Guide](./docs/mcp-setup.md) for complete configuration instructions.
|
|
42
55
|
|
|
43
56
|
## Quick Start
|
|
44
57
|
|
|
45
58
|
### Prerequisites
|
|
46
59
|
|
|
47
|
-
**For
|
|
60
|
+
**For Kubernetes deployment and documentation testing:**
|
|
48
61
|
- **Claude API key** (required for AI analysis)
|
|
49
|
-
- Get your API key from [Anthropic Console](https://console.anthropic.com/)
|
|
62
|
+
- Get your API key from [Anthropic Console](https://console.anthropic.com/) (requires account login)
|
|
63
|
+
<!-- dotai-ignore: Console URL may return 403 - expected behavior for auth-protected endpoint -->
|
|
50
64
|
- Set it as environment variable: `export ANTHROPIC_API_KEY=your_api_key_here`
|
|
51
65
|
|
|
66
|
+
**For shared prompts library:**
|
|
67
|
+
- **No API key required** - Works with any MCP-enabled coding agent
|
|
68
|
+
|
|
52
69
|
**For Kubernetes deployment recommendations:**
|
|
53
70
|
- **kubectl** configured with cluster access
|
|
54
71
|
- Verify cluster access with: `kubectl get nodes`
|
|
@@ -63,12 +80,13 @@ DevOps AI Toolkit provides two powerful AI-driven capabilities: **Kubernetes dep
|
|
|
63
80
|
|
|
64
81
|
DevOps AI Toolkit is designed to be used through AI development tools via MCP (Model Context Protocol). No direct installation needed - simply configure your AI tool to connect to the MCP server.
|
|
65
82
|
|
|
66
|
-
###
|
|
83
|
+
### Usage
|
|
67
84
|
|
|
68
|
-
|
|
69
|
-
Perfect for conversational
|
|
85
|
+
**AI Agent Integration (Claude Code Example)**
|
|
86
|
+
Perfect for conversational AI-driven workflows:
|
|
70
87
|
|
|
71
88
|
1. **Create `.mcp.json` in your project:**
|
|
89
|
+
<!-- dotai-ignore: MCP server binary (dot-ai-mcp) not testable as CLI - only works through MCP client connections -->
|
|
72
90
|
```json
|
|
73
91
|
{
|
|
74
92
|
"mcpServers": {
|
|
@@ -96,6 +114,9 @@ Perfect for conversational deployments with AI agents:
|
|
|
96
114
|
mkdir -p tmp/sessions
|
|
97
115
|
|
|
98
116
|
claude
|
|
117
|
+
|
|
118
|
+
# Verify MCP server connection
|
|
119
|
+
# You should see "dot-ai" listed as an available MCP server
|
|
99
120
|
```
|
|
100
121
|
|
|
101
122
|
3. **Use conversational workflows:**
|
|
@@ -138,6 +159,24 @@ User: Fix the port number directly in the doc, and I'll create a GitHub issue fo
|
|
|
138
159
|
Agent: ✅ Documentation testing complete! Fixed 1 issue directly, 1 issue tracked externally.
|
|
139
160
|
```
|
|
140
161
|
|
|
162
|
+
*Note: Conversational examples are illustrative - actual AI responses will vary based on specific context and implementation.*
|
|
163
|
+
|
|
164
|
+
**Example: Shared Prompts Library**
|
|
165
|
+
```
|
|
166
|
+
# Conversational approach
|
|
167
|
+
User: I want to create a new PRD for a feature
|
|
168
|
+
|
|
169
|
+
Agent: I'll help you create a documentation-first PRD. Let me start the process.
|
|
170
|
+
[Uses prd-create prompt via /dot-ai:prd-create]
|
|
171
|
+
|
|
172
|
+
Agent: Great! I've created GitHub issue #34 and the PRD file. What feature would you like to document?
|
|
173
|
+
|
|
174
|
+
# Direct slash command approach
|
|
175
|
+
User: /dot-ai:prd-create
|
|
176
|
+
|
|
177
|
+
Agent: I'm executing the PRD creation workflow. Please describe the feature you want to create a PRD for...
|
|
178
|
+
```
|
|
179
|
+
|
|
141
180
|
📖 **[Complete MCP Setup Guide →](docs/mcp-setup.md)** - Detailed configuration, troubleshooting, and examples
|
|
142
181
|
|
|
143
182
|
|
|
@@ -147,7 +186,7 @@ Agent: ✅ Documentation testing complete! Fixed 1 issue directly, 1 issue track
|
|
|
147
186
|
### MCP Issues
|
|
148
187
|
|
|
149
188
|
**MCP server won't start:**
|
|
150
|
-
- Verify environment variables are
|
|
189
|
+
- Verify environment variables are correctly configured in `.mcp.json` env section
|
|
151
190
|
- Check session directory exists and is writable
|
|
152
191
|
- Ensure `ANTHROPIC_API_KEY` is valid
|
|
153
192
|
|
|
@@ -162,6 +201,7 @@ Agent: ✅ Documentation testing complete! Fixed 1 issue directly, 1 issue track
|
|
|
162
201
|
- **[MCP Setup Guide](docs/mcp-setup.md)** - AI tools integration (Claude Code, Cursor)
|
|
163
202
|
- **[MCP Recommendation Guide](docs/mcp-recommendation-guide.md)** - Kubernetes deployment recommendations
|
|
164
203
|
- **[MCP Documentation Testing Guide](docs/mcp-documentation-testing-guide.md)** - Automated documentation validation
|
|
204
|
+
- **[MCP Prompts Guide](docs/mcp-prompts-guide.md)** - Shared prompt library and slash commands
|
|
165
205
|
|
|
166
206
|
### 👩💻 Development
|
|
167
207
|
- **[API Reference](docs/API.md)** - TypeScript interfaces and programmatic usage
|
|
@@ -169,17 +209,12 @@ Agent: ✅ Documentation testing complete! Fixed 1 issue directly, 1 issue track
|
|
|
169
209
|
|
|
170
210
|
### 🏗️ Architecture
|
|
171
211
|
- **[Design Overview](docs/design.md)** - Technical design and principles
|
|
172
|
-
- **[Stage-Based API](docs/STAGE_BASED_API.md)** - Workflow stages and API design
|
|
173
212
|
- **[Discovery Engine](docs/discovery-engine.md)** - Cluster resource discovery
|
|
174
213
|
|
|
175
214
|
### 🤖 AI & Integration
|
|
176
215
|
- **[Error Handling](docs/error-handling.md)** - Error management and debugging
|
|
177
216
|
- **[Function Registration](docs/function-registration.md)** - Tool and function management
|
|
178
217
|
|
|
179
|
-
### 📋 Reference
|
|
180
|
-
- **[Context & Background](docs/CONTEXT.md)** - Project context and inspiration
|
|
181
|
-
- **[Next Steps & Roadmap](docs/NEXT_STEPS.md)** - Planned features and future vision
|
|
182
|
-
|
|
183
218
|
**Quick Navigation:**
|
|
184
219
|
- **New to DevOps AI Toolkit?** → Start with [MCP Setup Guide](docs/mcp-setup.md)
|
|
185
220
|
- **Building integrations?** → See [API Reference](docs/API.md)
|
package/dist/interfaces/mcp.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export declare class MCPServer {
|
|
|
22
22
|
* Register all tools with McpServer
|
|
23
23
|
*/
|
|
24
24
|
private registerTools;
|
|
25
|
+
/**
|
|
26
|
+
* Register prompts capability with McpServer
|
|
27
|
+
*/
|
|
28
|
+
private registerPrompts;
|
|
25
29
|
private generateRequestId;
|
|
26
30
|
start(): Promise<void>;
|
|
27
31
|
stop(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAoDtC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAAa;gBAEzB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe;IA6BjD;;OAEG;IACH,OAAO,CAAC,aAAa;IAmGrB;;OAEG;IACH,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,iBAAiB;IAKnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B,OAAO,IAAI,OAAO;CAGnB"}
|
package/dist/interfaces/mcp.js
CHANGED
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.MCPServer = void 0;
|
|
10
10
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
11
11
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
12
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
12
13
|
const error_handling_1 = require("../core/error-handling");
|
|
13
14
|
const recommend_1 = require("../tools/recommend");
|
|
14
15
|
const choose_solution_1 = require("../tools/choose-solution");
|
|
@@ -17,6 +18,7 @@ const generate_manifests_1 = require("../tools/generate-manifests");
|
|
|
17
18
|
const deploy_manifests_1 = require("../tools/deploy-manifests");
|
|
18
19
|
const version_1 = require("../tools/version");
|
|
19
20
|
const test_docs_1 = require("../tools/test-docs");
|
|
21
|
+
const prompts_1 = require("../tools/prompts");
|
|
20
22
|
class MCPServer {
|
|
21
23
|
server;
|
|
22
24
|
dotAI;
|
|
@@ -32,7 +34,8 @@ class MCPServer {
|
|
|
32
34
|
version: config.version
|
|
33
35
|
}, {
|
|
34
36
|
capabilities: {
|
|
35
|
-
tools: {}
|
|
37
|
+
tools: {},
|
|
38
|
+
prompts: {}
|
|
36
39
|
}
|
|
37
40
|
});
|
|
38
41
|
this.logger.info('Initializing MCP Server', {
|
|
@@ -40,8 +43,9 @@ class MCPServer {
|
|
|
40
43
|
version: config.version,
|
|
41
44
|
author: config.author
|
|
42
45
|
});
|
|
43
|
-
// Register all tools directly with McpServer
|
|
46
|
+
// Register all tools and prompts directly with McpServer
|
|
44
47
|
this.registerTools();
|
|
48
|
+
this.registerPrompts();
|
|
45
49
|
}
|
|
46
50
|
/**
|
|
47
51
|
* Register all tools with McpServer
|
|
@@ -102,6 +106,26 @@ class MCPServer {
|
|
|
102
106
|
totalTools: 7
|
|
103
107
|
});
|
|
104
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Register prompts capability with McpServer
|
|
111
|
+
*/
|
|
112
|
+
registerPrompts() {
|
|
113
|
+
// Register prompts/list handler
|
|
114
|
+
this.server.server.setRequestHandler(types_js_1.ListPromptsRequestSchema, async (request) => {
|
|
115
|
+
const requestId = this.generateRequestId();
|
|
116
|
+
this.logger.info('Processing prompts/list request', { requestId });
|
|
117
|
+
return await (0, prompts_1.handlePromptsListRequest)(request.params || {}, this.logger, requestId);
|
|
118
|
+
});
|
|
119
|
+
// Register prompts/get handler
|
|
120
|
+
this.server.server.setRequestHandler(types_js_1.GetPromptRequestSchema, async (request) => {
|
|
121
|
+
const requestId = this.generateRequestId();
|
|
122
|
+
this.logger.info('Processing prompts/get request', { requestId, promptName: request.params?.name });
|
|
123
|
+
return await (0, prompts_1.handlePromptsGetRequest)(request.params || {}, this.logger, requestId);
|
|
124
|
+
});
|
|
125
|
+
this.logger.info('Registered prompts capability with McpServer', {
|
|
126
|
+
endpoints: ['prompts/list', 'prompts/get']
|
|
127
|
+
});
|
|
128
|
+
}
|
|
105
129
|
generateRequestId() {
|
|
106
130
|
return `mcp_${Date.now()}_${++this.requestIdCounter}`;
|
|
107
131
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Prompts Handler - Manages shared prompt library
|
|
3
|
+
*/
|
|
4
|
+
import { Logger } from '../core/error-handling';
|
|
5
|
+
export interface PromptMetadata {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
category: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Prompt {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
content: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Loads and parses a prompt file with YAML frontmatter
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadPromptFile(filePath: string): Prompt;
|
|
19
|
+
/**
|
|
20
|
+
* Loads all prompts from the shared-prompts directory
|
|
21
|
+
*/
|
|
22
|
+
export declare function loadAllPrompts(logger: Logger): Prompt[];
|
|
23
|
+
/**
|
|
24
|
+
* Handle prompts/list MCP request
|
|
25
|
+
*/
|
|
26
|
+
export declare function handlePromptsListRequest(args: any, logger: Logger, requestId: string): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Handle prompts/get MCP request
|
|
29
|
+
*/
|
|
30
|
+
export declare function handlePromptsGetRequest(args: any, logger: Logger, requestId: string): Promise<any>;
|
|
31
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/tools/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAsCvD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAmCvD;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAmCd;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAiEd"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCP Prompts Handler - Manages shared prompt library
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.loadPromptFile = loadPromptFile;
|
|
40
|
+
exports.loadAllPrompts = loadAllPrompts;
|
|
41
|
+
exports.handlePromptsListRequest = handlePromptsListRequest;
|
|
42
|
+
exports.handlePromptsGetRequest = handlePromptsGetRequest;
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const error_handling_1 = require("../core/error-handling");
|
|
46
|
+
/**
|
|
47
|
+
* Loads and parses a prompt file with YAML frontmatter
|
|
48
|
+
*/
|
|
49
|
+
function loadPromptFile(filePath) {
|
|
50
|
+
try {
|
|
51
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
52
|
+
// Parse YAML frontmatter
|
|
53
|
+
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
54
|
+
if (!frontmatterMatch) {
|
|
55
|
+
throw new Error(`Invalid prompt file format: missing YAML frontmatter in ${filePath}`);
|
|
56
|
+
}
|
|
57
|
+
const [, frontmatterYaml, promptContent] = frontmatterMatch;
|
|
58
|
+
// Simple YAML parsing for our specific format
|
|
59
|
+
const metadata = {};
|
|
60
|
+
const lines = frontmatterYaml.split('\n');
|
|
61
|
+
for (const line of lines) {
|
|
62
|
+
const match = line.match(/^([^:]+):\s*(.+)$/);
|
|
63
|
+
if (match) {
|
|
64
|
+
const [, key, value] = match;
|
|
65
|
+
// Remove quotes if present
|
|
66
|
+
const cleanValue = value.trim().replace(/^["']|["']$/g, '');
|
|
67
|
+
metadata[key.trim()] = cleanValue;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (!metadata.name || !metadata.description || !metadata.category) {
|
|
71
|
+
throw new Error(`Missing required metadata in ${filePath}: name, description, category`);
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
name: metadata.name,
|
|
75
|
+
description: metadata.description,
|
|
76
|
+
content: promptContent.trim()
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new Error(`Failed to load prompt file ${filePath}: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Loads all prompts from the shared-prompts directory
|
|
85
|
+
*/
|
|
86
|
+
function loadAllPrompts(logger) {
|
|
87
|
+
try {
|
|
88
|
+
const promptsDir = path.join(process.cwd(), 'shared-prompts');
|
|
89
|
+
if (!fs.existsSync(promptsDir)) {
|
|
90
|
+
logger.warn('Shared prompts directory not found', { path: promptsDir });
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
const files = fs.readdirSync(promptsDir);
|
|
94
|
+
const promptFiles = files.filter(file => file.endsWith('.md'));
|
|
95
|
+
const prompts = [];
|
|
96
|
+
for (const file of promptFiles) {
|
|
97
|
+
try {
|
|
98
|
+
const filePath = path.join(promptsDir, file);
|
|
99
|
+
const prompt = loadPromptFile(filePath);
|
|
100
|
+
prompts.push(prompt);
|
|
101
|
+
logger.debug('Loaded prompt', { name: prompt.name, file });
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
logger.error(`Failed to load prompt file ${file}`, error);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
logger.info('Loaded prompts from shared library', {
|
|
108
|
+
total: prompts.length,
|
|
109
|
+
promptsDir
|
|
110
|
+
});
|
|
111
|
+
return prompts;
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
logger.error('Failed to load prompts directory', error);
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Handle prompts/list MCP request
|
|
120
|
+
*/
|
|
121
|
+
async function handlePromptsListRequest(args, logger, requestId) {
|
|
122
|
+
try {
|
|
123
|
+
logger.info('Processing prompts/list request', { requestId });
|
|
124
|
+
const prompts = loadAllPrompts(logger);
|
|
125
|
+
// Convert to MCP prompts/list response format
|
|
126
|
+
const promptList = prompts.map(prompt => ({
|
|
127
|
+
name: prompt.name,
|
|
128
|
+
description: prompt.description
|
|
129
|
+
}));
|
|
130
|
+
logger.info('Prompts list generated', {
|
|
131
|
+
requestId,
|
|
132
|
+
promptCount: promptList.length
|
|
133
|
+
});
|
|
134
|
+
return {
|
|
135
|
+
prompts: promptList
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
logger.error('Prompts list request failed', error);
|
|
140
|
+
throw error_handling_1.ErrorHandler.createError(error_handling_1.ErrorCategory.OPERATION, error_handling_1.ErrorSeverity.HIGH, error instanceof Error ? error.message : 'Unknown error in prompts list', {
|
|
141
|
+
operation: 'prompts_list',
|
|
142
|
+
component: 'PromptsHandler',
|
|
143
|
+
requestId,
|
|
144
|
+
input: args
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Handle prompts/get MCP request
|
|
150
|
+
*/
|
|
151
|
+
async function handlePromptsGetRequest(args, logger, requestId) {
|
|
152
|
+
try {
|
|
153
|
+
logger.info('Processing prompts/get request', {
|
|
154
|
+
requestId,
|
|
155
|
+
promptName: args.name
|
|
156
|
+
});
|
|
157
|
+
if (!args.name) {
|
|
158
|
+
throw new Error('Missing required parameter: name');
|
|
159
|
+
}
|
|
160
|
+
const prompts = loadAllPrompts(logger);
|
|
161
|
+
const prompt = prompts.find(p => p.name === args.name);
|
|
162
|
+
if (!prompt) {
|
|
163
|
+
throw error_handling_1.ErrorHandler.createError(error_handling_1.ErrorCategory.VALIDATION, error_handling_1.ErrorSeverity.MEDIUM, `Prompt not found: ${args.name}`, {
|
|
164
|
+
operation: 'prompts_get',
|
|
165
|
+
component: 'PromptsHandler',
|
|
166
|
+
requestId
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
logger.info('Prompt found and returned', {
|
|
170
|
+
requestId,
|
|
171
|
+
promptName: prompt.name
|
|
172
|
+
});
|
|
173
|
+
// Convert to MCP prompts/get response format
|
|
174
|
+
return {
|
|
175
|
+
description: prompt.description,
|
|
176
|
+
messages: [
|
|
177
|
+
{
|
|
178
|
+
role: "user",
|
|
179
|
+
content: {
|
|
180
|
+
type: "text",
|
|
181
|
+
text: prompt.content
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
logger.error('Prompts get request failed', error);
|
|
189
|
+
// Re-throw if already an AppError
|
|
190
|
+
if (error instanceof Error && 'category' in error) {
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
throw error_handling_1.ErrorHandler.createError(error_handling_1.ErrorCategory.OPERATION, error_handling_1.ErrorSeverity.HIGH, error instanceof Error ? error.message : 'Unknown error in prompts get', {
|
|
194
|
+
operation: 'prompts_get',
|
|
195
|
+
component: 'PromptsHandler',
|
|
196
|
+
requestId,
|
|
197
|
+
input: args
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Universal Kubernetes application deployment agent with CLI and MCP interfaces",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"files": [
|
|
70
70
|
"dist",
|
|
71
71
|
"prompts",
|
|
72
|
+
"shared-prompts",
|
|
72
73
|
"README.md",
|
|
73
74
|
"LICENSE"
|
|
74
75
|
],
|
|
@@ -37,6 +37,30 @@ Execute everything testable in this section:
|
|
|
37
37
|
□ **User Experience Claims**: Would a typical user get the promised experience?
|
|
38
38
|
□ **Code/Architecture Claims**: When documentation makes claims about code, files, or system architecture, validate them against the actual codebase
|
|
39
39
|
|
|
40
|
+
### Cross-File Terminology Validation (When Applicable)
|
|
41
|
+
|
|
42
|
+
**When testing documentation that references related files**, validate terminology consistency:
|
|
43
|
+
|
|
44
|
+
#### Terminology Consistency Check
|
|
45
|
+
**For files that are part of a documentation set** (e.g., setup guides, user guides, API references):
|
|
46
|
+
|
|
47
|
+
1. **Identify Key Terms**: Extract important technical terms, feature names, and concepts from current section
|
|
48
|
+
2. **Find Related Files**: Identify documentation files that should use consistent terminology
|
|
49
|
+
3. **Cross-Reference Validation**: Check if the same concepts use identical terms across files
|
|
50
|
+
4. **Flag Inconsistencies**: Report terminology mismatches that could confuse users
|
|
51
|
+
|
|
52
|
+
**Common Terminology Issues:**
|
|
53
|
+
- Same feature called different names in different files
|
|
54
|
+
- Inconsistent capitalization (e.g., "MCP Server" vs "mcp server")
|
|
55
|
+
- Different terms for same concept (e.g., "slash commands" vs "command shortcuts")
|
|
56
|
+
- Inconsistent format examples (e.g., `/dot-ai:name` vs `/mcp.dot-ai.name`)
|
|
57
|
+
|
|
58
|
+
**How to Perform Cross-File Validation:**
|
|
59
|
+
1. **Extract key terms** from current section being tested
|
|
60
|
+
2. **Read related documentation files** mentioned in cross-references or logically related
|
|
61
|
+
3. **Compare terminology usage** across files for consistency
|
|
62
|
+
4. **Report discrepancies** that would confuse users navigating between files
|
|
63
|
+
|
|
40
64
|
### Code Analysis Validation (When Applicable)
|
|
41
65
|
|
|
42
66
|
**When testing technical documentation in a code repository**, perform BOTH directions of validation:
|
|
@@ -199,7 +223,9 @@ Return your results as JSON in this exact format:
|
|
|
199
223
|
- Mention how many items you tested in both phases
|
|
200
224
|
- Example: "Tested 4 installation commands - npm install, API key setup, and 2 verification commands. All executed successfully with minor adaptations. Analyzed 6 documentation claims including 'easy installation' and 'automatic verification' - found installation complexity matches claimed simplicity but verification requires manual interpretation."
|
|
201
225
|
|
|
202
|
-
**Both
|
|
226
|
+
**Common Requirements for Both Issues and Recommendations:**
|
|
227
|
+
- **MUST include precise location**: Section headings, specific text snippets, or element descriptions (NOT line numbers)
|
|
228
|
+
- **MUST be immediately actionable**: Clear enough for someone else to locate and address
|
|
203
229
|
- Be specific and actionable items only
|
|
204
230
|
- Do NOT include positive assessments like "section works well" or "documentation is accurate"
|
|
205
231
|
- Use empty arrays if nothing to report
|
|
@@ -207,14 +233,22 @@ Return your results as JSON in this exact format:
|
|
|
207
233
|
- Focus on user impact and success
|
|
208
234
|
|
|
209
235
|
**issues** (array of strings):
|
|
210
|
-
- Specific problems that prevent or hinder user success
|
|
211
|
-
- Include
|
|
212
|
-
-
|
|
236
|
+
- **Purpose**: Specific problems that prevent or hinder user success
|
|
237
|
+
- **Include**: Both functional problems (doesn't work) and semantic problems (inaccurate descriptions)
|
|
238
|
+
- **Must explain user impact**: What fails or misleads users
|
|
239
|
+
- Examples:
|
|
240
|
+
- "In 'Quick Start' section: npm install command requires global flag but documentation doesn't mention it"
|
|
241
|
+
- "Under 'Verification' heading: Expected output 'Success: Ready' but actual output shows 'Status: OK'"
|
|
242
|
+
- "The phrase 'automatically detects' in Prerequisites: Claims automatic detection but requires manual configuration file editing"
|
|
213
243
|
|
|
214
244
|
**recommendations** (array of strings):
|
|
215
|
-
- Specific actionable improvements that would help users succeed
|
|
216
|
-
- Only
|
|
217
|
-
-
|
|
245
|
+
- **Purpose**: Specific actionable improvements that would help users succeed
|
|
246
|
+
- **Include**: Only concrete changes or additions to the documentation
|
|
247
|
+
- **Must specify exact action**: What text to add, remove, or modify
|
|
248
|
+
- Examples:
|
|
249
|
+
- "In 'Quick Start' section: Change 'npm install' command to 'npm install --global'"
|
|
250
|
+
- "Under 'Verification' heading: Update expected output example from 'Success: Ready' to 'Status: OK'"
|
|
251
|
+
- "In Prerequisites section: Add note after 'automatically detects' phrase: 'Requires manual editing of config.json file before detection works'"
|
|
218
252
|
|
|
219
253
|
**Important**:
|
|
220
254
|
- Use only this JSON format - do not include additional text before or after
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-load
|
|
3
|
+
description: Load context from tmp/context.md to continue previous work session
|
|
4
|
+
category: session-management
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Load Context
|
|
8
|
+
|
|
9
|
+
Load context from tmp/context.md to continue previous work session.
|
|
10
|
+
|
|
11
|
+
Steps:
|
|
12
|
+
1. Read the context file from `tmp/context.md`
|
|
13
|
+
2. Analyze the saved context to understand:
|
|
14
|
+
- What work was completed previously
|
|
15
|
+
- Current status and next steps
|
|
16
|
+
- Available test data and file locations
|
|
17
|
+
- Technical implementation details
|
|
18
|
+
3. Provide a brief summary of the loaded context
|
|
19
|
+
4. Ask the user how they'd like to proceed based on the context
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-save
|
|
3
|
+
description: Save current context to tmp/context.md for session continuity
|
|
4
|
+
category: session-management
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Save Context
|
|
8
|
+
|
|
9
|
+
Save current context to tmp/context.md for session continuity.
|
|
10
|
+
|
|
11
|
+
Steps:
|
|
12
|
+
1. Clear existing context: Delete or empty tmp/context.md if it exists to ensure fresh state
|
|
13
|
+
2. Analyze the current state of work, tasks completed, and next steps
|
|
14
|
+
3. Create a comprehensive context summary including:
|
|
15
|
+
- Current status and what was accomplished
|
|
16
|
+
- Technical implementation details
|
|
17
|
+
- Test data and file locations
|
|
18
|
+
- Manual testing instructions
|
|
19
|
+
- Expected results and next steps
|
|
20
|
+
- Design decisions and architecture notes
|
|
21
|
+
4. Save the fresh context to `tmp/context.md`
|
|
22
|
+
5. Confirm the context has been saved successfully
|
|
23
|
+
|
|
24
|
+
This ensures each context save represents only the current session state, preventing confusion from stale information and keeping context files manageable.
|