forgecraft-mcp 0.2.1 → 0.3.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.
Files changed (95) hide show
  1. package/dist/analyzers/language-detector.d.ts +17 -0
  2. package/dist/analyzers/language-detector.d.ts.map +1 -0
  3. package/dist/analyzers/language-detector.js +89 -0
  4. package/dist/analyzers/language-detector.js.map +1 -0
  5. package/dist/analyzers/package-json.d.ts.map +1 -1
  6. package/dist/analyzers/package-json.js +5 -5
  7. package/dist/analyzers/package-json.js.map +1 -1
  8. package/dist/analyzers/project-context.d.ts +23 -0
  9. package/dist/analyzers/project-context.d.ts.map +1 -0
  10. package/dist/analyzers/project-context.js +181 -0
  11. package/dist/analyzers/project-context.js.map +1 -0
  12. package/dist/index.js +6 -3
  13. package/dist/index.js.map +1 -1
  14. package/dist/registry/composer.d.ts +3 -1
  15. package/dist/registry/composer.d.ts.map +1 -1
  16. package/dist/registry/composer.js +28 -0
  17. package/dist/registry/composer.js.map +1 -1
  18. package/dist/registry/loader.d.ts.map +1 -1
  19. package/dist/registry/loader.js +40 -1
  20. package/dist/registry/loader.js.map +1 -1
  21. package/dist/registry/mcp-discovery.js +1 -0
  22. package/dist/registry/mcp-discovery.js.map +1 -1
  23. package/dist/registry/renderer.d.ts +19 -2
  24. package/dist/registry/renderer.d.ts.map +1 -1
  25. package/dist/registry/renderer.js +64 -2
  26. package/dist/registry/renderer.js.map +1 -1
  27. package/dist/shared/filesystem.d.ts +45 -0
  28. package/dist/shared/filesystem.d.ts.map +1 -0
  29. package/dist/shared/filesystem.js +122 -0
  30. package/dist/shared/filesystem.js.map +1 -0
  31. package/dist/shared/types.d.ts +48 -0
  32. package/dist/shared/types.d.ts.map +1 -1
  33. package/dist/tools/configure-mcp.d.ts +3 -0
  34. package/dist/tools/configure-mcp.d.ts.map +1 -1
  35. package/dist/tools/configure-mcp.js +38 -1
  36. package/dist/tools/configure-mcp.js.map +1 -1
  37. package/dist/tools/generate-claude-md.d.ts +1 -0
  38. package/dist/tools/generate-claude-md.d.ts.map +1 -1
  39. package/dist/tools/generate-claude-md.js +23 -57
  40. package/dist/tools/generate-claude-md.js.map +1 -1
  41. package/dist/tools/get-reference.d.ts +28 -0
  42. package/dist/tools/get-reference.d.ts.map +1 -0
  43. package/dist/tools/get-reference.js +63 -0
  44. package/dist/tools/get-reference.js.map +1 -0
  45. package/dist/tools/list.d.ts +18 -2
  46. package/dist/tools/list.d.ts.map +1 -1
  47. package/dist/tools/list.js +50 -2
  48. package/dist/tools/list.js.map +1 -1
  49. package/dist/tools/refresh-project.d.ts.map +1 -1
  50. package/dist/tools/refresh-project.js +8 -10
  51. package/dist/tools/refresh-project.js.map +1 -1
  52. package/dist/tools/scaffold.d.ts +4 -0
  53. package/dist/tools/scaffold.d.ts.map +1 -1
  54. package/dist/tools/scaffold.js +58 -31
  55. package/dist/tools/scaffold.js.map +1 -1
  56. package/dist/tools/setup-project.d.ts.map +1 -1
  57. package/dist/tools/setup-project.js +5 -1
  58. package/dist/tools/setup-project.js.map +1 -1
  59. package/package.json +1 -1
  60. package/templates/analytics/mcp-servers.yaml +1 -0
  61. package/templates/api/mcp-servers.yaml +1 -0
  62. package/templates/api/skills.yaml +54 -0
  63. package/templates/cli/mcp-servers.yaml +1 -0
  64. package/templates/data-lineage/mcp-servers.yaml +2 -0
  65. package/templates/data-pipeline/mcp-servers.yaml +1 -0
  66. package/templates/data-pipeline/skills.yaml +56 -0
  67. package/templates/fintech/mcp-servers.yaml +1 -0
  68. package/templates/fintech/skills.yaml +35 -0
  69. package/templates/game/mcp-servers.yaml +1 -0
  70. package/templates/healthcare/mcp-servers.yaml +1 -0
  71. package/templates/healthcare/skills.yaml +35 -0
  72. package/templates/hipaa/mcp-servers.yaml +1 -0
  73. package/templates/hipaa/skills.yaml +39 -0
  74. package/templates/infra/mcp-servers.yaml +2 -0
  75. package/templates/library/mcp-servers.yaml +2 -0
  76. package/templates/medallion-architecture/mcp-servers.yaml +2 -0
  77. package/templates/ml/mcp-servers.yaml +1 -0
  78. package/templates/mobile/mcp-servers.yaml +1 -0
  79. package/templates/observability-xray/mcp-servers.yaml +1 -0
  80. package/templates/realtime/mcp-servers.yaml +1 -0
  81. package/templates/soc2/mcp-servers.yaml +2 -0
  82. package/templates/social/mcp-servers.yaml +2 -0
  83. package/templates/state-machine/mcp-servers.yaml +1 -0
  84. package/templates/universal/hooks.yaml +63 -0
  85. package/templates/universal/instructions.yaml +41 -118
  86. package/templates/universal/mcp-servers.yaml +12 -0
  87. package/templates/universal/nfr.yaml +1 -1
  88. package/templates/universal/reference.yaml +111 -0
  89. package/templates/universal/review.yaml +2 -2
  90. package/templates/universal/skills.yaml +106 -0
  91. package/templates/web-react/mcp-servers.yaml +2 -0
  92. package/templates/web-react/skills.yaml +56 -0
  93. package/templates/web-static/mcp-servers.yaml +2 -0
  94. package/templates/web3/mcp-servers.yaml +1 -0
  95. package/templates/zero-trust/mcp-servers.yaml +1 -0
@@ -0,0 +1,111 @@
1
+ tag: UNIVERSAL
2
+ section: reference
3
+ blocks:
4
+ - id: domain-driven-design
5
+ title: "Domain-Driven Design Essentials"
6
+ content: |
7
+ ## Domain-Driven Design (DDD) Essentials
8
+
9
+ ### Entities vs. Value Objects
10
+ - **Entity**: has identity (ID) that persists across state changes. Two users with the
11
+ same name are NOT the same user. Compared by ID.
12
+ - **Value Object**: defined by its attributes, not identity. Two `Money(100, "USD")` are
13
+ the same. Immutable. Compared by value.
14
+ - When in doubt, make it a Value Object — they're simpler and safer.
15
+
16
+ ### Eliminate Primitive Obsession
17
+ - Don't use raw `string` for email, `number` for currency, `string` for phone.
18
+ - Wrap domain concepts in typed Value Objects: `EmailAddress`, `Money`, `PhoneNumber`.
19
+ - Value Objects enforce validation at construction — an invalid email can never exist.
20
+ - This moves validation FROM every call site TO the constructor — DRY + safe.
21
+
22
+ ### Aggregates
23
+ - An aggregate is a cluster of domain objects treated as a single unit for data changes.
24
+ - One entity is the **aggregate root** — all external access goes through it.
25
+ - Aggregates enforce invariants: `Order` ensures its `OrderLines` don't exceed the limit.
26
+ - Reference other aggregates by ID, not by direct object reference.
27
+
28
+ ### Bounded Contexts
29
+ - A bounded context is a boundary within which a domain model has a specific meaning.
30
+ - The word "Account" means different things in Billing vs. Auth vs. Social.
31
+ - Each context owns its models, language, and persistence — no shared database tables.
32
+ - Contexts communicate via well-defined interfaces, events, or an **Anti-Corruption Layer**
33
+ that translates between contexts.
34
+
35
+ ### Domain Events
36
+ - When something important happens in the domain, publish an event: `OrderPlaced`,
37
+ `MemberDeactivated`, `PaymentFailed`.
38
+ - Events decouple modules: the Order module publishes `OrderPlaced`, the Notification
39
+ module subscribes — neither imports the other.
40
+ - Events are past-tense named facts. They carry the data needed by subscribers.
41
+ - In-process event bus for monoliths; message broker (SQS, Kafka, NATS) for distributed.
42
+
43
+ - id: cqrs-event-patterns
44
+ title: "CQRS & Event Patterns"
45
+ content: |
46
+ ## CQRS & Event-Driven Patterns
47
+
48
+ ### CQRS (Command Query Responsibility Segregation)
49
+ When read and write patterns diverge significantly:
50
+ - **Command side**: validates, enforces business rules, writes to the canonical store.
51
+ - **Query side**: reads from optimized read models (denormalized views, search indices).
52
+ - Start simple: same database, separate service methods. Optimize to separate stores
53
+ only when read/write scaling demands it.
54
+ - CQRS is not mandatory everywhere — use it where read/write asymmetry is real.
55
+
56
+ ### Event Sourcing (when appropriate)
57
+ - Store the sequence of events, not just current state.
58
+ - Useful for: audit trails, temporal queries, debugging, undo/redo.
59
+ - NOT appropriate for: simple CRUD, low-value data, early-stage features.
60
+ - If you use event sourcing, you MUST also maintain a read-projection.
61
+
62
+ ### Pub/Sub & Message Patterns
63
+ - **Fire and forget**: publish event, don't wait for subscribers.
64
+ - **Request/Reply**: send command, wait for response.
65
+ - In-process: use an event emitter or mediator.
66
+ - Distributed: use durable message queues with at-least-once delivery.
67
+
68
+ - id: design-patterns-reference
69
+ title: "Design Patterns Quick Reference"
70
+ content: |
71
+ ## Design Patterns — When to Reach for What
72
+
73
+ ### Creational
74
+ - **Factory Method / Abstract Factory**: Use when instantiation logic is complex or varies by context.
75
+ Prefer over `new` in business logic — keep constructors for DI only.
76
+ - **Builder**: Use when constructing objects with many optional parameters. Fluent API preferred.
77
+ - **Singleton**: Almost never in application code. Use DI to manage lifecycle instead.
78
+ Acceptable only for: loggers, config singletons in composition root.
79
+
80
+ ### Structural
81
+ - **Adapter**: Wrap third-party APIs to match your port interfaces. Isolates vendor lock-in.
82
+ - **Facade**: Simplify complex subsystem interactions behind a unified interface.
83
+ Every module's public exports are a facade.
84
+ - **Decorator**: Add behavior (logging, caching, retry, auth) without modifying the original.
85
+ Middleware pipelines are decorator chains.
86
+ - **Proxy**: Lazy loading, access control, or caching in front of expensive resources.
87
+
88
+ ### Behavioral
89
+ - **Strategy**: Extract interchangeable algorithms behind an interface. Inject the right one.
90
+ Examples: pricing calculators, render strategies, sort algorithms.
91
+ - **Observer / Pub-Sub**: Decouple event producers from consumers. Use for: domain events,
92
+ UI state changes, webhook fan-out. See CQRS & Event Patterns section.
93
+ - **Chain of Responsibility**: Middleware pipelines (Express, Koa). Each handler decides
94
+ to process or pass to the next. Order matters.
95
+ - **Command**: Encapsulate actions as objects. Enables: undo/redo, queuing, audit trail.
96
+
97
+ ### Enterprise
98
+ - **Repository**: Encapsulate data access behind a collection-like interface. Defined in the
99
+ domain layer, implemented in the infrastructure layer as adapters.
100
+ - **Unit of Work**: Track changes within a transaction boundary. Commit or roll back atomically.
101
+ Pair with Repository for database operations.
102
+ - **Saga**: Coordinate multi-step distributed operations. Each step has a compensating action
103
+ for rollback. Use for: order processing, payment flows, multi-service workflows.
104
+ - **Outbox**: Write events to a local outbox table in the same transaction as the state change.
105
+ A separate process reliably publishes them. Guarantees at-least-once event delivery.
106
+
107
+ ### Anti-Patterns to Avoid
108
+ - **God Object**: One class that knows/does everything. Split by responsibility.
109
+ - **Service Locator**: Global registry looked up at runtime. Use constructor injection instead.
110
+ - **Anemic Domain Model**: Entities with only getters/setters, logic in services.
111
+ Push behavior into domain objects.
@@ -10,7 +10,7 @@ blocks:
10
10
  Focus on component boundaries, dependency flow, and failure modes.
11
11
  checklist:
12
12
  - id: component-boundaries
13
- description: "Component boundaries are well-defined with clear public APIs (index.ts exports)."
13
+ description: "Component boundaries are well-defined with clear public APIs (module exports)."
14
14
  severity: critical
15
15
  - id: dependency-graph
16
16
  description: "Dependency graph is acyclic. No circular imports between modules."
@@ -85,7 +85,7 @@ blocks:
85
85
  description: "No long method chains through objects (a.b().c().d()). Objects expose only the information their callers need."
86
86
  severity: nice-to-have
87
87
  - id: immutability
88
- description: "const over let, readonly on properties. Mutable state restricted to smallest possible scope."
88
+ description: "Immutable by default prefer constants and frozen structures. Mutable state restricted to smallest possible scope."
89
89
  severity: important
90
90
  - id: pure-functions
91
91
  description: "Domain logic, validation, and transformations are pure (same input → same output, no side effects). Side effects pushed to adapters."
@@ -0,0 +1,106 @@
1
+ tag: UNIVERSAL
2
+ section: skills
3
+ skills:
4
+ - id: code-review
5
+ name: Code Review
6
+ filename: code-review.md
7
+ description: "Structured code review with checklist and severity ratings"
8
+ tier: core
9
+ content: |
10
+ Review the code changes in this project. For each file changed:
11
+
12
+ 1. **Read** the file and understand the context
13
+ 2. **Check** against these criteria:
14
+ - Correctness: Does the logic do what it claims?
15
+ - Security: Any injection, auth bypass, or data leak risks?
16
+ - Performance: Any N+1 queries, unbounded loops, or memory leaks?
17
+ - Readability: Are names intention-revealing? Is complexity justified?
18
+ - Tests: Are edge cases covered? Can tests fail?
19
+
20
+ 3. **Output** findings in this format:
21
+ - **File**: path/to/file
22
+ - **Line**: number
23
+ - **Severity**: CRITICAL | IMPORTANT | SUGGESTION
24
+ - **Issue**: description
25
+ - **Fix**: recommended change
26
+
27
+ If $ARGUMENTS is provided, focus the review on those specific files or concerns.
28
+ Otherwise, review all staged or recently changed files (use `git diff --name-only`).
29
+
30
+ - id: run-tests
31
+ name: Run Tests
32
+ filename: run-tests.md
33
+ description: "Run test suite and analyze failures"
34
+ tier: core
35
+ content: |
36
+ Run the project's test suite and analyze the results.
37
+
38
+ Steps:
39
+ {{#if language_is_typescript}}
40
+ 1. Run `npm test` or `npx vitest run`
41
+ 2. If tests fail, read the failing test files and the source code they test
42
+ 3. Identify root cause — is it a test bug or a source bug?
43
+ 4. Propose a fix with explanation
44
+ {{/if}}
45
+ {{#if language_is_python}}
46
+ 1. Run `pytest -v` or `python -m pytest`
47
+ 2. If tests fail, read the failing test files and the source code they test
48
+ 3. Identify root cause — is it a test bug or a source bug?
49
+ 4. Propose a fix with explanation
50
+ {{/if}}
51
+
52
+ If $ARGUMENTS is provided, run only matching tests (e.g., a specific file or pattern).
53
+
54
+ Always report:
55
+ - Total tests: passed / failed / skipped
56
+ - Coverage summary if available
57
+ - Any flaky test patterns detected
58
+
59
+ - id: debug-error
60
+ name: Debug Error
61
+ filename: debug-error.md
62
+ description: "Investigate and fix an error from logs or stack trace"
63
+ tier: recommended
64
+ content: |
65
+ Debug the following error. $ARGUMENTS should contain the error message or stack trace.
66
+
67
+ Investigation steps:
68
+ 1. Parse the error message and stack trace
69
+ 2. Identify the source file and line number
70
+ 3. Read the relevant source code
71
+ 4. Trace the data flow backward to find the root cause
72
+ 5. Check for similar patterns elsewhere in the codebase
73
+ 6. Propose a fix with:
74
+ - **Root cause**: why this happened
75
+ - **Fix**: the code change
76
+ - **Prevention**: how to prevent recurrence (test, type guard, validation)
77
+
78
+ Do NOT guess. Read the actual code before proposing solutions.
79
+
80
+ - id: refactor-file
81
+ name: Refactor File
82
+ filename: refactor-file.md
83
+ description: "Refactor a file following SOLID principles and project conventions"
84
+ tier: recommended
85
+ content: |
86
+ Refactor the file specified in $ARGUMENTS following project conventions.
87
+
88
+ Analysis steps:
89
+ 1. Read the file completely
90
+ 2. Check against SOLID principles:
91
+ - **S**: Does each function/class have one responsibility?
92
+ - **O**: Can behavior be extended without modifying existing code?
93
+ - **L**: Are subtypes substitutable?
94
+ - **I**: Are interfaces focused?
95
+ - **D**: Are dependencies injected?
96
+ 3. Check project conventions:
97
+ - Max function length: 50 lines
98
+ - Max file length: 300 lines
99
+ - Max parameters: 5 (use parameter object if more)
100
+ - Intention-revealing names, no abbreviations
101
+ 4. Propose changes grouped by priority:
102
+ - MUST: Violations of project standards
103
+ - SHOULD: Improvements to readability/maintainability
104
+ - COULD: Optional enhancements
105
+
106
+ Make changes incrementally. Run tests after each change to verify nothing breaks.
@@ -7,6 +7,7 @@ servers:
7
7
  args: ["-y", "@anthropic/chrome-devtools-mcp@latest"]
8
8
  tags: [WEB-REACT, WEB-STATIC, ANALYTICS]
9
9
  category: devtools
10
+ tier: recommended
10
11
  url: "https://github.com/anthropics/anthropic-quickstarts/tree/main/chrome-devtools-mcp"
11
12
 
12
13
  - name: playwright
@@ -15,4 +16,5 @@ servers:
15
16
  args: ["-y", "@anthropic/mcp-server-playwright"]
16
17
  tags: [WEB-REACT, WEB-STATIC]
17
18
  category: testing
19
+ tier: recommended
18
20
  url: "https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-server-playwright"
@@ -0,0 +1,56 @@
1
+ tag: WEB-REACT
2
+ section: skills
3
+ skills:
4
+ - id: react-add-component
5
+ name: Add React Component
6
+ filename: react-add-component.md
7
+ description: "Scaffold a new React component following project patterns"
8
+ tier: core
9
+ content: |
10
+ Create a new React component. $ARGUMENTS should contain the component name and description.
11
+
12
+ Steps:
13
+ 1. Analyze existing component patterns:
14
+ - File naming convention (PascalCase, kebab-case, index.tsx barrel)
15
+ - Component style (function components, arrow functions)
16
+ - Styling approach (CSS modules, Tailwind, styled-components, etc.)
17
+ - State management pattern (hooks, context, store)
18
+ - Props pattern (inline types, separate interface, shared types)
19
+ 2. Create the component matching discovered patterns:
20
+ - Component file with proper TypeScript props interface
21
+ - Styles file if the project uses co-located styles
22
+ - Index barrel export if the project uses them
23
+ 3. Add tests:
24
+ - Renders without crashing
25
+ - Displays expected content with given props
26
+ - Handles user interaction (click, input) if applicable
27
+ 4. Export from the nearest index file
28
+
29
+ Follow existing patterns. Do NOT introduce new styling or state management approaches.
30
+
31
+ - id: react-optimize-performance
32
+ name: Optimize React Performance
33
+ filename: react-optimize-performance.md
34
+ description: "Find and fix React performance issues"
35
+ tier: recommended
36
+ content: |
37
+ Analyze React components for performance issues. If $ARGUMENTS specifies a component, focus there. Otherwise, scan the project.
38
+
39
+ Check for:
40
+ 1. **Unnecessary re-renders**:
41
+ - Components missing `React.memo` where props rarely change
42
+ - Inline object/array/function creation in JSX props
43
+ - Missing `useCallback` / `useMemo` for expensive operations
44
+ 2. **State management**:
45
+ - State stored too high in the tree causing cascading renders
46
+ - Derived state that should be computed (not stored)
47
+ - Missing state colocation
48
+ 3. **Data fetching**:
49
+ - Missing loading/error states
50
+ - No request deduplication or caching
51
+ - Waterfalls (sequential fetches that could be parallel)
52
+ 4. **Bundle size**:
53
+ - Large imports that could be lazy-loaded
54
+ - Missing code splitting at route boundaries
55
+
56
+ For each issue found, provide the file, line, problem, and fix with code.
@@ -7,6 +7,7 @@ servers:
7
7
  args: ["-y", "@anthropic/chrome-devtools-mcp@latest"]
8
8
  tags: [WEB-REACT, WEB-STATIC, ANALYTICS]
9
9
  category: devtools
10
+ tier: recommended
10
11
  url: "https://github.com/anthropics/anthropic-quickstarts/tree/main/chrome-devtools-mcp"
11
12
 
12
13
  - name: playwright
@@ -15,4 +16,5 @@ servers:
15
16
  args: ["-y", "@anthropic/mcp-server-playwright"]
16
17
  tags: [WEB-REACT, WEB-STATIC]
17
18
  category: testing
19
+ tier: recommended
18
20
  url: "https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-server-playwright"
@@ -7,4 +7,5 @@ servers:
7
7
  args: ["-y", "mcp-server-solidity"]
8
8
  tags: [WEB3]
9
9
  category: devtools
10
+ tier: recommended
10
11
  url: "https://github.com/AIMONGmbH/solidity-mcp-server"
@@ -7,6 +7,7 @@ servers:
7
7
  args: ["-y", "mcp-server-aws"]
8
8
  tags: [ZERO-TRUST, INFRA]
9
9
  category: security
10
+ tier: recommended
10
11
  env:
11
12
  AWS_REGION: ""
12
13
  AWS_ACCESS_KEY_ID: ""