mcp-ai-agent-guidelines 0.7.2 → 0.7.3

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 (186) hide show
  1. package/README.md +201 -6
  2. package/dist/index.js +290 -5
  3. package/dist/index.js.map +1 -1
  4. package/dist/resources/structured.d.ts.map +1 -1
  5. package/dist/resources/structured.js +410 -0
  6. package/dist/resources/structured.js.map +1 -1
  7. package/dist/schemas/flow-tool-schemas.d.ts +167 -0
  8. package/dist/schemas/flow-tool-schemas.d.ts.map +1 -0
  9. package/dist/schemas/flow-tool-schemas.js +149 -0
  10. package/dist/schemas/flow-tool-schemas.js.map +1 -0
  11. package/dist/tools/bridge/index.d.ts +83 -0
  12. package/dist/tools/bridge/index.d.ts.map +1 -0
  13. package/dist/tools/bridge/index.js +85 -0
  14. package/dist/tools/bridge/index.js.map +1 -0
  15. package/dist/tools/bridge/project-onboarding-bridge.d.ts +54 -0
  16. package/dist/tools/bridge/project-onboarding-bridge.d.ts.map +1 -0
  17. package/dist/tools/bridge/project-onboarding-bridge.js +220 -0
  18. package/dist/tools/bridge/project-onboarding-bridge.js.map +1 -0
  19. package/dist/tools/bridge/semantic-analyzer-bridge.d.ts +47 -0
  20. package/dist/tools/bridge/semantic-analyzer-bridge.d.ts.map +1 -0
  21. package/dist/tools/bridge/semantic-analyzer-bridge.js +174 -0
  22. package/dist/tools/bridge/semantic-analyzer-bridge.js.map +1 -0
  23. package/dist/tools/code-hygiene-analyzer.js +57 -8
  24. package/dist/tools/code-hygiene-analyzer.js.map +1 -1
  25. package/dist/tools/config/guidelines-config.d.ts +2 -14
  26. package/dist/tools/config/guidelines-config.d.ts.map +1 -1
  27. package/dist/tools/config/guidelines-config.js +45 -6
  28. package/dist/tools/config/guidelines-config.js.map +1 -1
  29. package/dist/tools/config/model-config.d.ts +2 -23
  30. package/dist/tools/config/model-config.d.ts.map +1 -1
  31. package/dist/tools/config/model-config.js.map +1 -1
  32. package/dist/tools/config/types/guidelines.types.d.ts +15 -0
  33. package/dist/tools/config/types/guidelines.types.d.ts.map +1 -0
  34. package/dist/tools/config/types/guidelines.types.js +3 -0
  35. package/dist/tools/config/types/guidelines.types.js.map +1 -0
  36. package/dist/tools/config/types/index.d.ts +3 -0
  37. package/dist/tools/config/types/index.d.ts.map +1 -0
  38. package/dist/tools/config/types/index.js +3 -0
  39. package/dist/tools/config/types/index.js.map +1 -0
  40. package/dist/tools/config/types/model.types.d.ts +24 -0
  41. package/dist/tools/config/types/model.types.d.ts.map +1 -0
  42. package/dist/tools/config/types/model.types.js +3 -0
  43. package/dist/tools/config/types/model.types.js.map +1 -0
  44. package/dist/tools/design/adr-generator.d.ts +1 -1
  45. package/dist/tools/design/adr-generator.d.ts.map +1 -1
  46. package/dist/tools/design/adr-generator.js.map +1 -1
  47. package/dist/tools/design/confirmation-module.d.ts +1 -1
  48. package/dist/tools/design/confirmation-module.d.ts.map +1 -1
  49. package/dist/tools/design/confirmation-prompt-builder.d.ts +1 -1
  50. package/dist/tools/design/confirmation-prompt-builder.d.ts.map +1 -1
  51. package/dist/tools/design/confirmation-prompt-builder.js.map +1 -1
  52. package/dist/tools/design/constraint-consistency-enforcer.d.ts +1 -1
  53. package/dist/tools/design/constraint-consistency-enforcer.d.ts.map +1 -1
  54. package/dist/tools/design/constraint-consistency-enforcer.js.map +1 -1
  55. package/dist/tools/design/constraint-manager.d.ts +14 -14
  56. package/dist/tools/design/constraint-manager.d.ts.map +1 -1
  57. package/dist/tools/design/coverage-enforcer.d.ts +1 -1
  58. package/dist/tools/design/coverage-enforcer.d.ts.map +1 -1
  59. package/dist/tools/design/cross-session-consistency-enforcer.d.ts +1 -1
  60. package/dist/tools/design/cross-session-consistency-enforcer.d.ts.map +1 -1
  61. package/dist/tools/design/design-assistant.d.ts +1 -1
  62. package/dist/tools/design/design-assistant.d.ts.map +1 -1
  63. package/dist/tools/design/design-assistant.js +22 -9
  64. package/dist/tools/design/design-assistant.js.map +1 -1
  65. package/dist/tools/design/design-phase-workflow.d.ts +1 -1
  66. package/dist/tools/design/design-phase-workflow.d.ts.map +1 -1
  67. package/dist/tools/design/index.d.ts +1 -1
  68. package/dist/tools/design/index.d.ts.map +1 -1
  69. package/dist/tools/design/methodology-selector.d.ts +1 -1
  70. package/dist/tools/design/methodology-selector.d.ts.map +1 -1
  71. package/dist/tools/design/pivot-module.d.ts +1 -1
  72. package/dist/tools/design/pivot-module.d.ts.map +1 -1
  73. package/dist/tools/design/roadmap-generator.d.ts +1 -1
  74. package/dist/tools/design/roadmap-generator.d.ts.map +1 -1
  75. package/dist/tools/design/roadmap-generator.js.map +1 -1
  76. package/dist/tools/design/spec-generator.d.ts +1 -1
  77. package/dist/tools/design/spec-generator.d.ts.map +1 -1
  78. package/dist/tools/design/spec-generator.js.map +1 -1
  79. package/dist/tools/design/strategic-pivot-prompt-builder.d.ts +1 -1
  80. package/dist/tools/design/strategic-pivot-prompt-builder.d.ts.map +1 -1
  81. package/dist/tools/design/types/artifact.types.d.ts +16 -0
  82. package/dist/tools/design/types/artifact.types.d.ts.map +1 -0
  83. package/dist/tools/design/types/artifact.types.js +3 -0
  84. package/dist/tools/design/types/artifact.types.js.map +1 -0
  85. package/dist/tools/design/types/common.types.d.ts +8 -0
  86. package/dist/tools/design/types/common.types.d.ts.map +1 -0
  87. package/dist/tools/design/types/common.types.js +3 -0
  88. package/dist/tools/design/types/common.types.js.map +1 -0
  89. package/dist/tools/design/types/consistency.types.d.ts +130 -0
  90. package/dist/tools/design/types/consistency.types.d.ts.map +1 -0
  91. package/dist/tools/design/types/consistency.types.js +3 -0
  92. package/dist/tools/design/types/consistency.types.js.map +1 -0
  93. package/dist/tools/design/types/constraint.types.d.ts +53 -0
  94. package/dist/tools/design/types/constraint.types.d.ts.map +1 -0
  95. package/dist/tools/design/types/constraint.types.js +3 -0
  96. package/dist/tools/design/types/constraint.types.js.map +1 -0
  97. package/dist/tools/design/types/coverage.types.d.ts +58 -0
  98. package/dist/tools/design/types/coverage.types.d.ts.map +1 -0
  99. package/dist/tools/design/types/coverage.types.js +3 -0
  100. package/dist/tools/design/types/coverage.types.js.map +1 -0
  101. package/dist/tools/design/types/index.d.ts +9 -0
  102. package/dist/tools/design/types/index.d.ts.map +1 -0
  103. package/dist/tools/design/types/index.js +4 -0
  104. package/dist/tools/design/types/index.js.map +1 -0
  105. package/dist/tools/design/types/methodology.types.d.ts +53 -0
  106. package/dist/tools/design/types/methodology.types.d.ts.map +1 -0
  107. package/dist/tools/design/types/methodology.types.js +3 -0
  108. package/dist/tools/design/types/methodology.types.js.map +1 -0
  109. package/dist/tools/design/types/pivot.types.d.ts +56 -0
  110. package/dist/tools/design/types/pivot.types.d.ts.map +1 -0
  111. package/dist/tools/design/types/pivot.types.js +3 -0
  112. package/dist/tools/design/types/pivot.types.js.map +1 -0
  113. package/dist/tools/design/types/session.types.d.ts +50 -0
  114. package/dist/tools/design/types/session.types.d.ts.map +1 -0
  115. package/dist/tools/design/types/session.types.js +3 -0
  116. package/dist/tools/design/types/session.types.js.map +1 -0
  117. package/dist/tools/design/types.d.ts +18 -401
  118. package/dist/tools/design/types.d.ts.map +1 -1
  119. package/dist/tools/design/types.js +17 -1
  120. package/dist/tools/design/types.js.map +1 -1
  121. package/dist/tools/guidelines-validator.js +3 -3
  122. package/dist/tools/mermaid-diagram-generator.d.ts.map +1 -1
  123. package/dist/tools/mermaid-diagram-generator.js +712 -58
  124. package/dist/tools/mermaid-diagram-generator.js.map +1 -1
  125. package/dist/tools/mode-switcher.d.ts +21 -0
  126. package/dist/tools/mode-switcher.d.ts.map +1 -0
  127. package/dist/tools/mode-switcher.js +383 -0
  128. package/dist/tools/mode-switcher.js.map +1 -0
  129. package/dist/tools/project-onboarding.d.ts +7 -0
  130. package/dist/tools/project-onboarding.d.ts.map +1 -0
  131. package/dist/tools/project-onboarding.js +344 -0
  132. package/dist/tools/project-onboarding.js.map +1 -0
  133. package/dist/tools/prompt/domain-neutral-prompt-builder.d.ts +8 -8
  134. package/dist/tools/prompt/hierarchical-prompt-builder.d.ts +6 -6
  135. package/dist/tools/prompt/hierarchy-level-selector.d.ts +7 -0
  136. package/dist/tools/prompt/hierarchy-level-selector.d.ts.map +1 -0
  137. package/dist/tools/prompt/hierarchy-level-selector.js +256 -0
  138. package/dist/tools/prompt/hierarchy-level-selector.js.map +1 -0
  139. package/dist/tools/prompt/prompt-chaining-builder.d.ts +29 -0
  140. package/dist/tools/prompt/prompt-chaining-builder.d.ts.map +1 -0
  141. package/dist/tools/prompt/prompt-chaining-builder.js +212 -0
  142. package/dist/tools/prompt/prompt-chaining-builder.js.map +1 -0
  143. package/dist/tools/prompt/prompt-flow-builder.d.ts +24 -0
  144. package/dist/tools/prompt/prompt-flow-builder.d.ts.map +1 -0
  145. package/dist/tools/prompt/prompt-flow-builder.js +422 -0
  146. package/dist/tools/prompt/prompt-flow-builder.js.map +1 -0
  147. package/dist/tools/prompt/prompting-hierarchy-evaluator.d.ts +13 -0
  148. package/dist/tools/prompt/prompting-hierarchy-evaluator.d.ts.map +1 -0
  149. package/dist/tools/prompt/prompting-hierarchy-evaluator.js +372 -0
  150. package/dist/tools/prompt/prompting-hierarchy-evaluator.js.map +1 -0
  151. package/dist/tools/prompt/spark-prompt-builder.d.ts +14 -14
  152. package/dist/tools/prompt/types/hierarchy.types.d.ts +42 -0
  153. package/dist/tools/prompt/types/hierarchy.types.d.ts.map +1 -0
  154. package/dist/tools/prompt/types/hierarchy.types.js +23 -0
  155. package/dist/tools/prompt/types/hierarchy.types.js.map +1 -0
  156. package/dist/tools/prompt/types/index.d.ts +2 -0
  157. package/dist/tools/prompt/types/index.d.ts.map +1 -0
  158. package/dist/tools/prompt/types/index.js +3 -0
  159. package/dist/tools/prompt/types/index.js.map +1 -0
  160. package/dist/tools/semantic-code-analyzer.d.ts +7 -0
  161. package/dist/tools/semantic-code-analyzer.d.ts.map +1 -0
  162. package/dist/tools/semantic-code-analyzer.js +380 -0
  163. package/dist/tools/semantic-code-analyzer.js.map +1 -0
  164. package/dist/tools/shared/prompt-sections.d.ts +3 -7
  165. package/dist/tools/shared/prompt-sections.d.ts.map +1 -1
  166. package/dist/tools/shared/prompt-sections.js +2 -26
  167. package/dist/tools/shared/prompt-sections.js.map +1 -1
  168. package/dist/tools/shared/prompt-utils.d.ts +2 -6
  169. package/dist/tools/shared/prompt-utils.d.ts.map +1 -1
  170. package/dist/tools/shared/prompt-utils.js.map +1 -1
  171. package/dist/tools/shared/types/index.d.ts +3 -0
  172. package/dist/tools/shared/types/index.d.ts.map +1 -0
  173. package/dist/tools/shared/types/index.js +3 -0
  174. package/dist/tools/shared/types/index.js.map +1 -0
  175. package/dist/tools/shared/types/prompt-sections.types.d.ts +8 -0
  176. package/dist/tools/shared/types/prompt-sections.types.d.ts.map +1 -0
  177. package/dist/tools/shared/types/prompt-sections.types.js +28 -0
  178. package/dist/tools/shared/types/prompt-sections.types.js.map +1 -0
  179. package/dist/tools/shared/types/prompt-utils.types.d.ts +7 -0
  180. package/dist/tools/shared/types/prompt-utils.types.d.ts.map +1 -0
  181. package/dist/tools/shared/types/prompt-utils.types.js +3 -0
  182. package/dist/tools/shared/types/prompt-utils.types.js.map +1 -0
  183. package/dist/tools/sprint-timeline-calculator.d.ts.map +1 -1
  184. package/dist/tools/sprint-timeline-calculator.js +129 -28
  185. package/dist/tools/sprint-timeline-calculator.js.map +1 -1
  186. package/package.json +3 -1
package/README.md CHANGED
@@ -137,7 +137,9 @@ After adding the server, open your chat client (e.g., Cline in VS Code). The too
137
137
  Example prompts:
138
138
  - "Use hierarchical-prompt-builder to create a refactor plan for src/index.ts with outputFormat markdown."
139
139
  - "Analyze this Python file with code-hygiene-analyzer; highlight security issues."
140
- - "Generate a Mermaid diagram for our pipeline using mermaid-diagram-generator (flowchart)."
140
+ - "Generate a Mermaid sequence diagram showing: User sends request to API, API queries Database, Database returns data, API responds to User."
141
+ - "Create an ER diagram for: Customer has Orders, Order contains LineItems, Product referenced in LineItems."
142
+ - "Build a user journey map for our checkout flow using mermaid-diagram-generator."
141
143
 
142
144
  Tip: Most clients can pass file content automatically when you select a file and invoke a tool.
143
145
 
@@ -145,6 +147,135 @@ GitHub Chat (VS Code): In the chat, type your request and pick a tool suggestion
145
147
 
146
148
  ## Features
147
149
 
150
+ > **🆕 NEW: Serena-Inspired Strategies** — We've integrated effective agent strategies from [@oraios/serena](https://github.com/oraios/serena) including semantic code analysis, project onboarding, and flexible mode switching. See [docs/SERENA_STRATEGIES.md](./docs/SERENA_STRATEGIES.md) for details.
151
+
152
+ > **🌊 NEW: Flow-Based Prompting** — Advanced prompting strategies inspired by [@ruvnet/claude-flow](https://github.com/ruvnet/claude-flow) including prompt chaining, declarative flows, and dynamic orchestration.
153
+ > - **Examples**: [docs/FLOW_PROMPTING_EXAMPLES.md](./docs/FLOW_PROMPTING_EXAMPLES.md)
154
+ > - **Integration Guide**: [docs/FLOW_SERENA_INTEGRATION.md](./docs/FLOW_SERENA_INTEGRATION.md) - Combining flow-based prompting with Serena memory patterns
155
+
156
+ <details>
157
+ <summary><strong>🔗 Prompt Chaining Builder</strong> — Multi-step prompts with output passing (NEW)</summary>
158
+
159
+ Usage: `prompt-chaining-builder`
160
+
161
+ | Parameter | Required | Description |
162
+ | -------------- | -------- | ------------------------------------- |
163
+ | `chainName` | ✅ | Name of the prompt chain |
164
+ | `steps` | ✅ | Array of chain steps with prompts |
165
+ | `description` | ❌ | Description of chain purpose |
166
+ | `context` | ❌ | Global context for the chain |
167
+ | `globalVariables` | ❌ | Variables accessible to all steps |
168
+ | `executionStrategy` | ❌ | sequential/parallel-where-possible |
169
+
170
+ Build sophisticated multi-step prompt workflows where each step can depend on outputs from previous steps. Supports error handling strategies (skip/retry/abort) and automatic Mermaid visualization.
171
+
172
+ **Example:**
173
+ ```typescript
174
+ {
175
+ chainName: "Security Analysis Pipeline",
176
+ steps: [
177
+ {
178
+ name: "Scan",
179
+ prompt: "Scan for vulnerabilities",
180
+ outputKey: "vulns"
181
+ },
182
+ {
183
+ name: "Assess",
184
+ prompt: "Assess severity of {{vulns}}",
185
+ dependencies: ["vulns"],
186
+ errorHandling: "retry"
187
+ }
188
+ ]
189
+ }
190
+ ```
191
+
192
+ </details>
193
+
194
+ <details>
195
+ <summary><strong>🌊 Prompt Flow Builder</strong> — Declarative flows with branching/loops (NEW)</summary>
196
+
197
+ Usage: `prompt-flow-builder`
198
+
199
+ | Parameter | Required | Description |
200
+ | -------------- | -------- | ------------------------------------- |
201
+ | `flowName` | ✅ | Name of the prompt flow |
202
+ | `nodes` | ✅ | Flow nodes (prompt/condition/loop/parallel/merge/transform) |
203
+ | `edges` | ❌ | Connections between nodes with conditions |
204
+ | `entryPoint` | ❌ | Starting node ID |
205
+ | `variables` | ❌ | Flow-level variables |
206
+ | `outputFormat` | ❌ | markdown/mermaid/both |
207
+
208
+ Create complex adaptive prompt flows with conditional branching, loops, parallel execution, and merge points. Automatically generates Mermaid flowcharts and execution guides.
209
+
210
+ **Example:**
211
+ ```typescript
212
+ {
213
+ flowName: "Adaptive Code Review",
214
+ nodes: [
215
+ { id: "analyze", type: "prompt", name: "Analyze" },
216
+ { id: "check", type: "condition", name: "Complex?",
217
+ config: { expression: "complexity > 10" } },
218
+ { id: "deep", type: "prompt", name: "Deep Review" },
219
+ { id: "quick", type: "prompt", name: "Quick Check" }
220
+ ],
221
+ edges: [
222
+ { from: "analyze", to: "check" },
223
+ { from: "check", to: "deep", condition: "true" },
224
+ { from: "check", to: "quick", condition: "false" }
225
+ ]
226
+ }
227
+ ```
228
+
229
+ </details>
230
+
231
+ <details>
232
+ <summary><strong>🔍 Semantic Code Analyzer</strong> — Symbol-based code understanding (NEW)</summary>
233
+
234
+ Usage: `semantic-code-analyzer`
235
+
236
+ | Parameter | Required | Description |
237
+ | -------------- | -------- | ------------------------------------- |
238
+ | `codeContent` | ✅ | Code content to analyze |
239
+ | `language` | ❌ | Programming language (auto-detected) |
240
+ | `analysisType` | ❌ | symbols/structure/dependencies/patterns/all |
241
+
242
+ Performs semantic analysis to identify symbols, dependencies, patterns, and structure. Inspired by Serena's language server approach.
243
+
244
+ </details>
245
+
246
+ <details>
247
+ <summary><strong>🚀 Project Onboarding</strong> — Comprehensive project familiarization (NEW)</summary>
248
+
249
+ Usage: `project-onboarding`
250
+
251
+ | Parameter | Required | Description |
252
+ | -------------- | -------- | ------------------------------------- |
253
+ | `projectPath` | ✅ | Path to project directory |
254
+ | `projectName` | ❌ | Name of the project |
255
+ | `projectType` | ❌ | library/application/service/tool/other |
256
+ | `analysisDepth`| ❌ | quick/standard/deep |
257
+ | `includeMemories` | ❌ | Generate project memories (default: true) |
258
+
259
+ Analyzes project structure, detects technologies, and generates memories for context retention. Based on Serena's onboarding system.
260
+
261
+ </details>
262
+
263
+ <details>
264
+ <summary><strong>🔄 Mode Switcher</strong> — Flexible agent operation modes (NEW)</summary>
265
+
266
+ Usage: `mode-switcher`
267
+
268
+ | Parameter | Required | Description |
269
+ | -------------- | -------- | ------------------------------------- |
270
+ | `targetMode` | ✅ | Mode to switch to (planning/editing/analysis/etc.) |
271
+ | `currentMode` | ❌ | Current active mode |
272
+ | `context` | ❌ | Operating context (desktop-app/ide-assistant/etc.) |
273
+ | `reason` | ❌ | Reason for mode switch |
274
+
275
+ Switches between operation modes with optimized tool sets and prompting strategies. Modes include: planning, editing, analysis, interactive, one-shot, debugging, refactoring, documentation.
276
+
277
+ </details>
278
+
148
279
  <details>
149
280
  <summary><strong>Hierarchical Prompt Builder</strong> — Build structured prompts with clear hierarchies</summary>
150
281
 
@@ -205,11 +336,75 @@ Usage: `security-hardening-prompt-builder`
205
336
 
206
337
  Usage: `mermaid-diagram-generator`
207
338
 
208
- | Parameter | Required | Description |
209
- | ------------- | -------- | ---------------------------------------------------------------- |
210
- | `description` | | Description of the system or process to diagram |
211
- | `diagramType` | | Type: `flowchart`, `sequence`, `class`, `state`, `gantt`, `pie` |
212
- | `theme` | | Visual theme for the diagram |
339
+ Generates Mermaid diagrams with intelligent parsing of descriptions for rich, customizable visualizations.
340
+
341
+ | Parameter | Required | Description |
342
+ | ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
343
+ | `description` | | Description of the system or process to diagram. Be detailed and specific for better diagram generation. |
344
+ | `diagramType` | ✅ | Type: `flowchart`, `sequence`, `class`, `state`, `gantt`, `pie`, `er`, `journey`, `quadrant`, `git-graph`, `mindmap`, `timeline` |
345
+ | `theme` | ❌ | Visual theme: `default`, `dark`, `forest`, `neutral` |
346
+ | `direction` | ❌ | Flowchart direction: `TD`/`TB` (top-down), `BT` (bottom-top), `LR` (left-right), `RL` (right-left) |
347
+ | `strict` | ❌ | If true, never emit invalid diagram; use fallback if needed (default: true) |
348
+ | `repair` | ❌ | Attempt auto-repair on validation failure (default: true) |
349
+ | `accTitle` | ❌ | Accessibility title (added as Mermaid comment) |
350
+ | `accDescr` | ❌ | Accessibility description (added as Mermaid comment) |
351
+ | `customStyles` | ❌ | Custom CSS/styling directives for advanced customization |
352
+ | `advancedFeatures` | ❌ | Type-specific advanced features (e.g., `{autonumber: true}` for sequence diagrams) |
353
+
354
+ **Enhanced Features:**
355
+
356
+ - **Intelligent Description Parsing**: All diagram types now parse descriptions to extract relevant entities, relationships, and structures
357
+ - **New Diagram Types**:
358
+ - `er` - Entity Relationship diagrams for database schemas
359
+ - `journey` - User journey maps for UX workflows
360
+ - `quadrant` - Quadrant/priority charts for decision matrices
361
+ - `git-graph` - Git commit history visualization
362
+ - `mindmap` - Hierarchical concept maps
363
+ - `timeline` - Event timelines and roadmaps
364
+ - **Advanced Customization**: Direction control, themes, custom styles, and type-specific features
365
+ - **Smart Fallbacks**: Generates sensible default diagrams when description parsing is ambiguous
366
+
367
+ **Examples:**
368
+
369
+ ```bash
370
+ # Sequence diagram with participants auto-detected from description
371
+ {
372
+ "description": "User sends login request to API. API queries Database for credentials. Database returns user data. API responds to User with token.",
373
+ "diagramType": "sequence",
374
+ "advancedFeatures": {"autonumber": true}
375
+ }
376
+
377
+ # Class diagram with relationships extracted
378
+ {
379
+ "description": "User has id and email. Order contains Product items. User places Order. Product has price and name.",
380
+ "diagramType": "class"
381
+ }
382
+
383
+ # ER diagram for database schema
384
+ {
385
+ "description": "Customer places Order. Order contains LineItem. Product is referenced in LineItem.",
386
+ "diagramType": "er"
387
+ }
388
+
389
+ # User journey map
390
+ {
391
+ "description": "Shopping Journey. Section Discovery: User finds product. User reads reviews. Section Purchase: User adds to cart. User completes checkout.",
392
+ "diagramType": "journey"
393
+ }
394
+
395
+ # Gantt chart with tasks from description
396
+ {
397
+ "description": "Project: Feature Development. Phase Planning: Research requirements. Design architecture. Phase Development: Implement backend. Create frontend. Phase Testing: QA validation.",
398
+ "diagramType": "gantt"
399
+ }
400
+
401
+ # Flowchart with custom direction
402
+ {
403
+ "description": "Receive request. Validate input. Process data. Return response.",
404
+ "diagramType": "flowchart",
405
+ "direction": "LR"
406
+ }
407
+ ```
213
408
 
214
409
  </details>
215
410
 
package/dist/index.js CHANGED
@@ -18,6 +18,8 @@ import { CallToolRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema
18
18
  import { getPrompt, listPrompts } from "./prompts/index.js";
19
19
  // Import resources
20
20
  import { getResource, listResources } from "./resources/index.js";
21
+ // Import tool schemas
22
+ import { promptChainingBuilderSchema, promptFlowBuilderSchema, } from "./schemas/flow-tool-schemas.js";
21
23
  import { gapFrameworksAnalyzers } from "./tools/analysis/gap-frameworks-analyzers.js";
22
24
  import { strategyFrameworksBuilder } from "./tools/analysis/strategy-frameworks-builder.js";
23
25
  import { codeHygieneAnalyzer } from "./tools/code-hygiene-analyzer.js";
@@ -26,12 +28,19 @@ import { guidelinesValidator } from "./tools/guidelines-validator.js";
26
28
  import { iterativeCoverageEnhancer } from "./tools/iterative-coverage-enhancer.js";
27
29
  import { memoryContextOptimizer } from "./tools/memory-context-optimizer.js";
28
30
  import { mermaidDiagramGenerator } from "./tools/mermaid-diagram-generator.js";
31
+ import { modeSwitcher } from "./tools/mode-switcher.js";
29
32
  import { modelCompatibilityChecker } from "./tools/model-compatibility-checker.js";
33
+ import { projectOnboarding } from "./tools/project-onboarding.js";
30
34
  import { domainNeutralPromptBuilder } from "./tools/prompt/domain-neutral-prompt-builder.js";
31
35
  // Import tool implementations
32
36
  import { hierarchicalPromptBuilder } from "./tools/prompt/hierarchical-prompt-builder.js";
37
+ import { hierarchyLevelSelector } from "./tools/prompt/hierarchy-level-selector.js";
38
+ import { promptChainingBuilder } from "./tools/prompt/prompt-chaining-builder.js";
39
+ import { promptFlowBuilder } from "./tools/prompt/prompt-flow-builder.js";
40
+ import { promptingHierarchyEvaluator } from "./tools/prompt/prompting-hierarchy-evaluator.js";
33
41
  import { securityHardeningPromptBuilder } from "./tools/prompt/security-hardening-prompt-builder.js";
34
42
  import { sparkPromptBuilder } from "./tools/prompt/spark-prompt-builder.js";
43
+ import { semanticCodeAnalyzer } from "./tools/semantic-code-analyzer.js";
35
44
  import { sprintTimelineCalculator } from "./tools/sprint-timeline-calculator.js";
36
45
  const server = new Server({
37
46
  name: "ai-agent-guidelines",
@@ -512,22 +521,50 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
512
521
  },
513
522
  {
514
523
  name: "mermaid-diagram-generator",
515
- description: "Generate Mermaid diagrams from text descriptions following best practices",
524
+ description: "Generate Mermaid diagrams from text descriptions following best practices. Supports advanced diagram types and customization options for richer documentation.",
516
525
  inputSchema: {
517
526
  type: "object",
518
527
  properties: {
519
528
  description: {
520
529
  type: "string",
521
- description: "Description of the system or process to diagram",
530
+ description: "Description of the system or process to diagram. Be specific and detailed for better diagram generation.",
522
531
  },
523
532
  diagramType: {
524
533
  type: "string",
525
- enum: ["flowchart", "sequence", "class", "state", "gantt", "pie"],
534
+ enum: [
535
+ "flowchart",
536
+ "sequence",
537
+ "class",
538
+ "state",
539
+ "gantt",
540
+ "pie",
541
+ "er",
542
+ "journey",
543
+ "quadrant",
544
+ "git-graph",
545
+ "mindmap",
546
+ "timeline",
547
+ ],
526
548
  description: "Type of diagram to generate",
527
549
  },
528
550
  theme: {
529
551
  type: "string",
530
- description: "Visual theme for the diagram",
552
+ description: "Visual theme for the diagram (e.g., 'default', 'dark', 'forest', 'neutral')",
553
+ },
554
+ direction: {
555
+ type: "string",
556
+ enum: ["TD", "TB", "BT", "LR", "RL"],
557
+ description: "Direction for flowcharts: TD/TB (top-down), BT (bottom-top), LR (left-right), RL (right-left)",
558
+ },
559
+ strict: {
560
+ type: "boolean",
561
+ description: "If true, never emit invalid diagram; fallback to minimal diagram if needed (default: true)",
562
+ default: true,
563
+ },
564
+ repair: {
565
+ type: "boolean",
566
+ description: "Attempt auto-repair on diagram validation failure (default: true)",
567
+ default: true,
531
568
  },
532
569
  accTitle: {
533
570
  type: "string",
@@ -537,6 +574,14 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
537
574
  type: "string",
538
575
  description: "Accessibility description (added as a Mermaid comment)",
539
576
  },
577
+ customStyles: {
578
+ type: "string",
579
+ description: "Custom CSS/styling directives for advanced customization",
580
+ },
581
+ advancedFeatures: {
582
+ type: "object",
583
+ description: "Type-specific advanced features (e.g., {autonumber: true} for sequence diagrams)",
584
+ },
540
585
  },
541
586
  required: ["description", "diagramType"],
542
587
  },
@@ -846,7 +891,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
846
891
  },
847
892
  {
848
893
  name: "sprint-timeline-calculator",
849
- description: "Calculate optimal development cycles and sprint timelines",
894
+ description: "Calculate optimal development cycles and sprint timelines with dependency-aware scheduling",
850
895
  inputSchema: {
851
896
  type: "object",
852
897
  properties: {
@@ -864,6 +909,19 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
864
909
  type: "number",
865
910
  description: "Team velocity (story points per sprint)",
866
911
  },
912
+ optimizationStrategy: {
913
+ type: "string",
914
+ enum: ["greedy", "linear-programming"],
915
+ description: "Optimization strategy: 'greedy' (default, deterministic bin-packing) or 'linear-programming' (future MILP optimization)",
916
+ },
917
+ includeMetadata: {
918
+ type: "boolean",
919
+ description: "Include metadata in output",
920
+ },
921
+ inputFile: {
922
+ type: "string",
923
+ description: "Input file reference",
924
+ },
867
925
  },
868
926
  required: ["tasks", "teamSize"],
869
927
  },
@@ -934,6 +992,219 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
934
992
  required: ["practiceDescription", "category"],
935
993
  },
936
994
  },
995
+ {
996
+ name: "semantic-code-analyzer",
997
+ description: "Perform semantic code analysis to identify symbols, structure, dependencies, and patterns. Inspired by Serena's language server-based approach for precise code understanding.",
998
+ inputSchema: {
999
+ type: "object",
1000
+ properties: {
1001
+ codeContent: {
1002
+ type: "string",
1003
+ description: "Code content to analyze",
1004
+ },
1005
+ language: {
1006
+ type: "string",
1007
+ description: "Programming language (auto-detected if not provided)",
1008
+ },
1009
+ analysisType: {
1010
+ type: "string",
1011
+ enum: ["symbols", "structure", "dependencies", "patterns", "all"],
1012
+ description: "Type of semantic analysis to perform",
1013
+ },
1014
+ includeReferences: {
1015
+ type: "boolean",
1016
+ description: "Include external reference links",
1017
+ },
1018
+ includeMetadata: {
1019
+ type: "boolean",
1020
+ description: "Include metadata section",
1021
+ },
1022
+ inputFile: {
1023
+ type: "string",
1024
+ description: "Optional input file path",
1025
+ },
1026
+ },
1027
+ required: ["codeContent"],
1028
+ },
1029
+ },
1030
+ {
1031
+ name: "project-onboarding",
1032
+ description: "Perform comprehensive project onboarding including structure analysis, dependency detection, and memory generation. Based on Serena's onboarding system for efficient project familiarization.",
1033
+ inputSchema: {
1034
+ type: "object",
1035
+ properties: {
1036
+ projectPath: {
1037
+ type: "string",
1038
+ description: "Path to the project directory",
1039
+ },
1040
+ projectName: {
1041
+ type: "string",
1042
+ description: "Name of the project",
1043
+ },
1044
+ projectType: {
1045
+ type: "string",
1046
+ enum: ["library", "application", "service", "tool", "other"],
1047
+ description: "Type of project",
1048
+ },
1049
+ analysisDepth: {
1050
+ type: "string",
1051
+ enum: ["quick", "standard", "deep"],
1052
+ description: "Depth of analysis",
1053
+ },
1054
+ includeMemories: {
1055
+ type: "boolean",
1056
+ description: "Generate project memories",
1057
+ },
1058
+ includeReferences: {
1059
+ type: "boolean",
1060
+ description: "Include external reference links",
1061
+ },
1062
+ includeMetadata: {
1063
+ type: "boolean",
1064
+ description: "Include metadata section",
1065
+ },
1066
+ },
1067
+ required: ["projectPath"],
1068
+ },
1069
+ },
1070
+ {
1071
+ name: "mode-switcher",
1072
+ description: "Switch between different agent operation modes (planning, editing, analysis, debugging, etc.) with tailored tool sets and prompting strategies. Based on Serena's flexible mode/context system.",
1073
+ inputSchema: {
1074
+ type: "object",
1075
+ properties: {
1076
+ currentMode: {
1077
+ type: "string",
1078
+ enum: [
1079
+ "planning",
1080
+ "editing",
1081
+ "analysis",
1082
+ "interactive",
1083
+ "one-shot",
1084
+ "debugging",
1085
+ "refactoring",
1086
+ "documentation",
1087
+ ],
1088
+ description: "Current active mode",
1089
+ },
1090
+ targetMode: {
1091
+ type: "string",
1092
+ enum: [
1093
+ "planning",
1094
+ "editing",
1095
+ "analysis",
1096
+ "interactive",
1097
+ "one-shot",
1098
+ "debugging",
1099
+ "refactoring",
1100
+ "documentation",
1101
+ ],
1102
+ description: "Mode to switch to",
1103
+ },
1104
+ context: {
1105
+ type: "string",
1106
+ enum: [
1107
+ "desktop-app",
1108
+ "ide-assistant",
1109
+ "agent",
1110
+ "terminal",
1111
+ "collaborative",
1112
+ ],
1113
+ description: "Operating context",
1114
+ },
1115
+ reason: {
1116
+ type: "string",
1117
+ description: "Reason for mode switch",
1118
+ },
1119
+ includeReferences: {
1120
+ type: "boolean",
1121
+ description: "Include external reference links",
1122
+ },
1123
+ includeMetadata: {
1124
+ type: "boolean",
1125
+ description: "Include metadata section",
1126
+ },
1127
+ },
1128
+ required: ["targetMode"],
1129
+ },
1130
+ },
1131
+ {
1132
+ name: "prompting-hierarchy-evaluator",
1133
+ description: "Evaluate prompts using hierarchical taxonomy and provide numeric scoring based on clarity, specificity, completeness, and cognitive complexity. Implements reinforcement learning-inspired evaluation metrics.",
1134
+ inputSchema: {
1135
+ type: "object",
1136
+ properties: {
1137
+ promptText: {
1138
+ type: "string",
1139
+ description: "The prompt text to evaluate",
1140
+ },
1141
+ targetLevel: {
1142
+ type: "string",
1143
+ enum: [
1144
+ "independent",
1145
+ "indirect",
1146
+ "direct",
1147
+ "modeling",
1148
+ "scaffolding",
1149
+ "full-physical",
1150
+ ],
1151
+ description: "Expected hierarchy level (if known)",
1152
+ },
1153
+ context: {
1154
+ type: "string",
1155
+ description: "Additional context about the task",
1156
+ },
1157
+ includeRecommendations: {
1158
+ type: "boolean",
1159
+ description: "Include improvement recommendations",
1160
+ },
1161
+ includeReferences: {
1162
+ type: "boolean",
1163
+ description: "Include reference links",
1164
+ },
1165
+ },
1166
+ required: ["promptText"],
1167
+ },
1168
+ },
1169
+ {
1170
+ name: "hierarchy-level-selector",
1171
+ description: "Select the most appropriate prompting hierarchy level (independent, indirect, direct, modeling, scaffolding, full-physical) based on task characteristics, agent capability, and autonomy preferences.",
1172
+ inputSchema: {
1173
+ type: "object",
1174
+ properties: {
1175
+ taskDescription: {
1176
+ type: "string",
1177
+ description: "Description of the task the prompt will address",
1178
+ },
1179
+ agentCapability: {
1180
+ type: "string",
1181
+ enum: ["novice", "intermediate", "advanced", "expert"],
1182
+ description: "Agent's capability level",
1183
+ },
1184
+ taskComplexity: {
1185
+ type: "string",
1186
+ enum: ["simple", "moderate", "complex", "very-complex"],
1187
+ description: "Complexity of the task",
1188
+ },
1189
+ autonomyPreference: {
1190
+ type: "string",
1191
+ enum: ["low", "medium", "high"],
1192
+ description: "Desired level of agent autonomy",
1193
+ },
1194
+ includeExamples: {
1195
+ type: "boolean",
1196
+ description: "Include example prompts for the recommended level",
1197
+ },
1198
+ includeReferences: {
1199
+ type: "boolean",
1200
+ description: "Include reference links",
1201
+ },
1202
+ },
1203
+ required: ["taskDescription"],
1204
+ },
1205
+ },
1206
+ promptChainingBuilderSchema,
1207
+ promptFlowBuilderSchema,
937
1208
  {
938
1209
  name: "design-assistant",
939
1210
  description: "Deterministic, context-driven design assistant with constraint framework for structured design sessions",
@@ -1035,6 +1306,20 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1035
1306
  return modelCompatibilityChecker(args);
1036
1307
  case "guidelines-validator":
1037
1308
  return guidelinesValidator(args);
1309
+ case "semantic-code-analyzer":
1310
+ return semanticCodeAnalyzer(args);
1311
+ case "project-onboarding":
1312
+ return projectOnboarding(args);
1313
+ case "mode-switcher":
1314
+ return modeSwitcher(args);
1315
+ case "prompting-hierarchy-evaluator":
1316
+ return promptingHierarchyEvaluator(args);
1317
+ case "hierarchy-level-selector":
1318
+ return hierarchyLevelSelector(args);
1319
+ case "prompt-chaining-builder":
1320
+ return promptChainingBuilder(args);
1321
+ case "prompt-flow-builder":
1322
+ return promptFlowBuilder(args);
1038
1323
  case "design-assistant": {
1039
1324
  const result = await designAssistant.processRequest(args);
1040
1325
  return {