Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,17 @@ import {
promptChainingBuilderSchema,
promptFlowBuilderSchema,
} from "./schemas/flow-tool-schemas.js";
import { gapFrameworksAnalyzers } from "./tools/analysis/gap-frameworks-analyzers.js";
import { cleanCodeScorer } from "./tools/analysis/clean-code-scorer.js";
import { codeHygieneAnalyzer } from "./tools/analysis/code-hygiene-analyzer.js";
import { dependencyAuditor } from "./tools/analysis/dependency-auditor.js";
import { gapFrameworksAnalyzer } from "./tools/analysis/gap-frameworks-analyzer.js";
import { iterativeCoverageEnhancer } from "./tools/analysis/iterative-coverage-enhancer.js";
import { semanticCodeAnalyzer } from "./tools/analysis/semantic-code-analyzer.js";
import { strategyFrameworksBuilder } from "./tools/analysis/strategy-frameworks-builder.js";
import { cleanCodeScorer } from "./tools/clean-code-scorer.js";
import { codeHygieneAnalyzer } from "./tools/code-hygiene-analyzer.js";
import { dependencyAuditor } from "./tools/dependency-auditor.js";
import {
type DesignAssistantRequest,
designAssistant,
} from "./tools/design/index.js";
import { guidelinesValidator } from "./tools/guidelines-validator.js";
import { iterativeCoverageEnhancer } from "./tools/iterative-coverage-enhancer.js";
import { memoryContextOptimizer } from "./tools/memory-context-optimizer.js";
import { mermaidDiagramGenerator } from "./tools/mermaid-diagram-generator.js";
import { modeSwitcher } from "./tools/mode-switcher.js";
import { modelCompatibilityChecker } from "./tools/model-compatibility-checker.js";
import { projectOnboarding } from "./tools/project-onboarding.js";
import { architectureDesignPromptBuilder } from "./tools/prompt/architecture-design-prompt-builder.js";
import { codeAnalysisPromptBuilder } from "./tools/prompt/code-analysis-prompt-builder.js";
import { debuggingAssistantPromptBuilder } from "./tools/prompt/debugging-assistant-prompt-builder.js";
Expand All @@ -65,8 +60,13 @@ import { promptFlowBuilder } from "./tools/prompt/prompt-flow-builder.js";
import { promptingHierarchyEvaluator } from "./tools/prompt/prompting-hierarchy-evaluator.js";
import { securityHardeningPromptBuilder } from "./tools/prompt/security-hardening-prompt-builder.js";
import { sparkPromptBuilder } from "./tools/prompt/spark-prompt-builder.js";
import { semanticCodeAnalyzer } from "./tools/semantic-code-analyzer.js";
import { sprintTimelineCalculator } from "./tools/sprint-timeline-calculator.js";
import { guidelinesValidator } from "./tools/utility/guidelines-validator.js";
import { memoryContextOptimizer } from "./tools/utility/memory-context-optimizer.js";
import { mermaidDiagramGenerator } from "./tools/utility/mermaid-diagram-generator.js";
import { modeSwitcher } from "./tools/utility/mode-switcher.js";
import { modelCompatibilityChecker } from "./tools/utility/model-compatibility-checker.js";
import { projectOnboarding } from "./tools/utility/project-onboarding.js";
import { sprintTimelineCalculator } from "./tools/utility/sprint-timeline-calculator.js";

const server = new Server(
{
Expand Down Expand Up @@ -1846,7 +1846,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
case "strategy-frameworks-builder":
return strategyFrameworksBuilder(args);
case "gap-frameworks-analyzers":
return gapFrameworksAnalyzers(args);
return gapFrameworksAnalyzer(args);
case "spark-prompt-builder":
return sparkPromptBuilder(args);
case "domain-neutral-prompt-builder":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { buildFurtherReadingSection } from "./shared/prompt-utils.js";
import { buildFurtherReadingSection } from "../shared/prompt-utils.js";

const CleanCodeScorerSchema = z.object({
projectPath: z.string().optional(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { buildFurtherReadingSection } from "./shared/prompt-utils.js";
import { buildFurtherReadingSection } from "../shared/prompt-utils.js";

const CodeHygieneSchema = z.object({
codeContent: z.string(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { buildFurtherReadingSection } from "./shared/prompt-utils.js";
import { buildFurtherReadingSection } from "../shared/prompt-utils.js";

const DependencyAuditorSchema = z.object({
packageJsonContent: z.string().describe("Content of package.json file"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const GapFrameworkSchema = z.object({
inputFile: z.string().optional(),
});

export async function gapFrameworksAnalyzers(args: unknown) {
export async function gapFrameworksAnalyzer(args: unknown) {
const input = GapFrameworkSchema.parse(args);

const sections: string[] = [];
Expand Down
12 changes: 12 additions & 0 deletions src/tools/analysis/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Analysis tools barrel export
* Exports all code analysis, scoring, and framework tools
*/

export { cleanCodeScorer } from "./clean-code-scorer.js";
export { codeHygieneAnalyzer } from "./code-hygiene-analyzer.js";
export { dependencyAuditor } from "./dependency-auditor.js";
export { gapFrameworksAnalyzer } from "./gap-frameworks-analyzer.js";
export { iterativeCoverageEnhancer } from "./iterative-coverage-enhancer.js";
export { semanticCodeAnalyzer } from "./semantic-code-analyzer.js";
export { strategyFrameworksBuilder } from "./strategy-frameworks-builder.js";
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// while identifying and suggesting removal of dead code

import { z } from "zod";
import { buildFurtherReadingSection } from "./shared/prompt-utils.js";
import { buildFurtherReadingSection } from "../shared/prompt-utils.js";

const IterativeCoverageEnhancerSchema = z.object({
// Analysis Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
PatternInfo,
StructureInfo,
SymbolInfo,
} from "./semantic-analyzer/index.js";
} from "../semantic-analyzer/index.js";
import {
analyzeCode,
buildDependenciesSection,
Expand All @@ -15,11 +15,11 @@ import {
detectLanguage,
generateInsights,
generateRecommendations,
} from "./semantic-analyzer/index.js";
} from "../semantic-analyzer/index.js";
import {
buildFurtherReadingSection,
buildMetadataSection,
} from "./shared/prompt-utils.js";
} from "../shared/prompt-utils.js";

const SemanticCodeAnalyzerSchema = z.object({
codeContent: z.string().describe("Code content to analyze"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { z } from "zod";
import {
CATEGORY_CONFIG,
type CategoryConfig,
} from "./config/guidelines-config.js";
import { buildFurtherReadingSection } from "./shared/prompt-utils.js";
} from "../config/guidelines-config.js";
import { buildFurtherReadingSection } from "../shared/prompt-utils.js";

const GuidelinesValidationSchema = z.object({
practiceDescription: z.string(),
Expand Down
12 changes: 12 additions & 0 deletions src/tools/utility/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Utility tools barrel export
* Exports general-purpose utility tools
*/

export { guidelinesValidator } from "./guidelines-validator.js";
export { memoryContextOptimizer } from "./memory-context-optimizer.js";
export { mermaidDiagramGenerator } from "./mermaid-diagram-generator.js";
export { modeSwitcher } from "./mode-switcher.js";
export { modelCompatibilityChecker } from "./model-compatibility-checker.js";
export { projectOnboarding } from "./project-onboarding.js";
export { sprintTimelineCalculator } from "./sprint-timeline-calculator.js";
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { buildFurtherReadingSection } from "./shared/prompt-utils.js";
import { buildFurtherReadingSection } from "../shared/prompt-utils.js";

const MemoryOptimizationSchema = z.object({
contextContent: z.string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from "zod";
import {
buildFurtherReadingSection,
buildMetadataSection,
} from "./shared/prompt-utils.js";
} from "../shared/prompt-utils.js";

const AgentModeSchema = z.enum([
"planning",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MODELS,
REQUIREMENT_KEYWORDS,
type ScoredModel,
} from "./config/model-config.js";
} from "../config/model-config.js";

const ModelCompatibilitySchema = z.object({
taskDescription: z.string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from "zod";
import {
buildFurtherReadingSection,
buildMetadataSection,
} from "./shared/prompt-utils.js";
} from "../shared/prompt-utils.js";

const ProjectOnboardingSchema = z.object({
projectPath: z.string().describe("Path to the project directory"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from "zod";
import { logger } from "./shared/logger.js";
import { buildFurtherReadingSection } from "./shared/prompt-utils.js";
import { logger } from "../shared/logger.js";
import { buildFurtherReadingSection } from "../shared/prompt-utils.js";

const SprintTimelineSchema = z.object({
tasks: z.array(
Expand Down
12 changes: 6 additions & 6 deletions tests/vitest/additional-coverage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe("Additional coverage for uncovered lines", () => {

it("should test mermaid generator edge cases", async () => {
const { mermaidDiagramGenerator } = await import(
"../../src/tools/mermaid-diagram-generator.js"
"../../src/tools/utility/mermaid-diagram-generator.js"
);

// Test different diagram types
Expand Down Expand Up @@ -229,7 +229,7 @@ describe("Additional coverage for uncovered lines", () => {

it("should test memory optimizer edge cases", async () => {
const { memoryContextOptimizer } = await import(
"../../src/tools/memory-context-optimizer.js"
"../../src/tools/utility/memory-context-optimizer.js"
);

// Test different cache strategies
Expand All @@ -250,7 +250,7 @@ describe("Additional coverage for uncovered lines", () => {

it("should test code hygiene analyzer edge cases", async () => {
const { codeHygieneAnalyzer } = await import(
"../../src/tools/code-hygiene-analyzer.js"
"../../src/tools/analysis/code-hygiene-analyzer.js"
);

// Test with different languages
Expand All @@ -276,7 +276,7 @@ describe("Additional coverage for uncovered lines", () => {

it("should test sprint timeline calculator edge cases", async () => {
const { sprintTimelineCalculator } = await import(
"../../src/tools/sprint-timeline-calculator.js"
"../../src/tools/utility/sprint-timeline-calculator.js"
);

// Test with complex task structure
Expand All @@ -297,7 +297,7 @@ describe("Additional coverage for uncovered lines", () => {

it("should test model compatibility checker edge cases", async () => {
const { modelCompatibilityChecker } = await import(
"../../src/tools/model-compatibility-checker.js"
"../../src/tools/utility/model-compatibility-checker.js"
);

// Test with different budget levels and requirements
Expand All @@ -321,7 +321,7 @@ describe("Additional coverage for uncovered lines", () => {

it("should test guidelines validator edge cases", async () => {
const { guidelinesValidator } = await import(
"../../src/tools/guidelines-validator.js"
"../../src/tools/utility/guidelines-validator.js"
);

// Test different categories
Expand Down
28 changes: 14 additions & 14 deletions tests/vitest/analysis-tools-coverage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import { describe, expect, it } from "vitest";

// Import analysis tools
import { gapFrameworksAnalyzers } from "../../src/tools/analysis/gap-frameworks-analyzers.ts";
import { gapFrameworksAnalyzer } from "../../src/tools/analysis/gap-frameworks-analyzer.js";
import { strategyFrameworksBuilder } from "../../src/tools/analysis/strategy-frameworks-builder.ts";

describe("Analysis Tools Coverage Tests", () => {
describe("Gap Frameworks Analyzers", () => {
it("should test capability gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Software development team",
currentState: "Basic testing practices",
desiredState: "Comprehensive TDD and automated testing",
Expand All @@ -22,7 +22,7 @@ describe("Analysis Tools Coverage Tests", () => {
});

it("should test process gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Development workflow",
currentState: "Manual deployment process",
desiredState: "Fully automated CI/CD pipeline",
Expand All @@ -33,7 +33,7 @@ describe("Analysis Tools Coverage Tests", () => {
});

it("should test compliance gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Security compliance",
currentState: "Basic security measures",
desiredState: "SOC 2 Type II compliance",
Expand All @@ -44,7 +44,7 @@ describe("Analysis Tools Coverage Tests", () => {
});

it("should test multiple framework analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Technology transformation",
currentState: "Legacy monolithic architecture",
desiredState: "Modern microservices architecture",
Expand All @@ -56,7 +56,7 @@ describe("Analysis Tools Coverage Tests", () => {
});

it("should test performance gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Application performance",
currentState: "Response times > 2 seconds",
desiredState: "Response times < 200ms",
Expand All @@ -67,7 +67,7 @@ describe("Analysis Tools Coverage Tests", () => {
});

it("should test skills gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Development team capabilities",
currentState: "Junior developers with basic skills",
desiredState: "Senior team with specialized expertise",
Expand All @@ -78,7 +78,7 @@ describe("Analysis Tools Coverage Tests", () => {
});

it("should test market gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Product market fit",
currentState: "Niche market presence",
desiredState: "Market leader position",
Expand All @@ -89,7 +89,7 @@ describe("Analysis Tools Coverage Tests", () => {
});

it("should test strategic gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Business strategy",
currentState: "Regional player",
desiredState: "Global enterprise solution",
Expand All @@ -100,7 +100,7 @@ describe("Analysis Tools Coverage Tests", () => {
});

it("should test operational gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Operations efficiency",
currentState: "Manual operations with high error rate",
desiredState: "Automated operations with 99.9% accuracy",
Expand All @@ -111,7 +111,7 @@ describe("Analysis Tools Coverage Tests", () => {
});

it("should test cultural gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Organizational culture",
currentState: "Siloed departments with poor communication",
desiredState: "Collaborative cross-functional teams",
Expand Down Expand Up @@ -225,7 +225,7 @@ describe("Analysis Tools Coverage Tests", () => {
describe("Edge Cases and Error Handling", () => {
it("should handle missing required fields gracefully", async () => {
try {
await gapFrameworksAnalyzers({
await gapFrameworksAnalyzer({
// Missing required context, currentState, desiredState
frameworks: ["capability"],
});
Expand All @@ -236,7 +236,7 @@ describe("Analysis Tools Coverage Tests", () => {

it("should handle invalid frameworks", async () => {
try {
await gapFrameworksAnalyzers({
await gapFrameworksAnalyzer({
context: "Test context",
currentState: "Current",
desiredState: "Desired",
Expand All @@ -261,7 +261,7 @@ describe("Analysis Tools Coverage Tests", () => {

describe("Framework Combinations", () => {
it("should test comprehensive gap analysis", async () => {
const result = await gapFrameworksAnalyzers({
const result = await gapFrameworksAnalyzer({
context: "Digital transformation initiative",
currentState: "Traditional on-premise infrastructure",
desiredState: "Cloud-native, AI-powered platform",
Expand Down
2 changes: 1 addition & 1 deletion tests/vitest/clean-code-scorer-comprehensive.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { cleanCodeScorer } from "../../src/tools/clean-code-scorer.js";
import { cleanCodeScorer } from "../../src/tools/analysis/clean-code-scorer.js";

describe("Clean Code Scorer - Comprehensive Coverage", () => {
describe("Edge Cases and Score Boundaries", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/vitest/clean-code-scorer.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { cleanCodeScorer } from "../../src/tools/clean-code-scorer";
import { cleanCodeScorer } from "../../src/tools/analysis/clean-code-scorer.js";

describe("Clean Code Scorer", () => {
describe("Overall Score Calculation", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/vitest/code-hygiene-analyzer.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { codeHygieneAnalyzer } from "../../src/tools/code-hygiene-analyzer";
import { codeHygieneAnalyzer } from "../../src/tools/analysis/code-hygiene-analyzer.js";

describe("code-hygiene-analyzer", () => {
it("flags JS issues: TODO, var, console.log, async without try/catch", async () => {
Expand Down
Loading
Loading