@jaypie/mcp 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/package.json +4 -3
  2. package/prompts/Branch_Management.md +34 -0
  3. package/prompts/Development_Process.md +67 -0
  4. package/prompts/Jaypie_Agent_Rules.md +110 -0
  5. package/prompts/Jaypie_Auth0_Express_Mongoose.md +736 -0
  6. package/prompts/Jaypie_Browser_and_Frontend_Web_Packages.md +18 -0
  7. package/prompts/Jaypie_CDK_Constructs_and_Patterns.md +156 -0
  8. package/prompts/Jaypie_CICD_with_GitHub_Actions.md +151 -0
  9. package/prompts/Jaypie_Commander_CLI_Package.md +166 -0
  10. package/prompts/Jaypie_Core_Errors_and_Logging.md +39 -0
  11. package/prompts/Jaypie_Eslint_NPM_Package.md +78 -0
  12. package/prompts/Jaypie_Ideal_Project_Structure.md +78 -0
  13. package/prompts/Jaypie_Init_Express_on_Lambda.md +87 -0
  14. package/prompts/Jaypie_Init_Jaypie_CDK_Package.md +35 -0
  15. package/prompts/Jaypie_Init_Lambda_Package.md +245 -0
  16. package/prompts/Jaypie_Init_Monorepo_Project.md +44 -0
  17. package/prompts/Jaypie_Init_Project_Subpackage.md +70 -0
  18. package/prompts/Jaypie_Legacy_Patterns.md +11 -0
  19. package/prompts/Jaypie_Llm_Calls.md +113 -0
  20. package/prompts/Jaypie_Llm_Tools.md +124 -0
  21. package/prompts/Jaypie_Mocks_and_Testkit.md +137 -0
  22. package/prompts/Jaypie_Mongoose_Models_Package.md +231 -0
  23. package/prompts/Jaypie_Mongoose_with_Express_CRUD.md +1000 -0
  24. package/prompts/Jaypie_Scrub.md +177 -0
  25. package/prompts/Write_Efficient_Prompt_Guides.md +48 -0
  26. package/prompts/Write_and_Maintain_Engaging_Readme.md +67 -0
  27. package/prompts/templates/cdk-subpackage/bin/cdk.ts +11 -0
  28. package/prompts/templates/cdk-subpackage/cdk.json +19 -0
  29. package/prompts/templates/cdk-subpackage/lib/cdk-app.ts +41 -0
  30. package/prompts/templates/cdk-subpackage/lib/cdk-infrastructure.ts +15 -0
  31. package/prompts/templates/express-subpackage/index.ts +8 -0
  32. package/prompts/templates/express-subpackage/src/app.ts +18 -0
  33. package/prompts/templates/express-subpackage/src/handler.config.ts +44 -0
  34. package/prompts/templates/express-subpackage/src/routes/resource/__tests__/resourceGet.route.spec.ts +29 -0
  35. package/prompts/templates/express-subpackage/src/routes/resource/resourceGet.route.ts +22 -0
  36. package/prompts/templates/express-subpackage/src/routes/resource.router.ts +11 -0
  37. package/prompts/templates/express-subpackage/src/types/express.ts +9 -0
  38. package/prompts/templates/project-monorepo/.vscode/settings.json +72 -0
  39. package/prompts/templates/project-monorepo/eslint.config.mjs +1 -0
  40. package/prompts/templates/project-monorepo/package.json +20 -0
  41. package/prompts/templates/project-monorepo/tsconfig.base.json +18 -0
  42. package/prompts/templates/project-monorepo/tsconfig.json +6 -0
  43. package/prompts/templates/project-monorepo/vitest.workspace.js +3 -0
  44. package/prompts/templates/project-subpackage/package.json +16 -0
  45. package/prompts/templates/project-subpackage/tsconfig.json +11 -0
  46. package/prompts/templates/project-subpackage/vite.config.ts +21 -0
  47. package/prompts/templates/project-subpackage/vitest.config.ts +7 -0
  48. package/prompts/templates/project-subpackage/vitest.setup.ts +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaypie/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Jaypie MCP server",
5
5
  "license": "MIT",
6
6
  "author": "Finlayson Studio",
@@ -17,7 +17,8 @@
17
17
  "jaypie-mcp": "dist/index.js"
18
18
  },
19
19
  "files": [
20
- "dist"
20
+ "dist",
21
+ "prompts"
21
22
  ],
22
23
  "scripts": {
23
24
  "build": "rollup --config",
@@ -36,5 +37,5 @@
36
37
  "publishConfig": {
37
38
  "access": "public"
38
39
  },
39
- "gitHead": "f9017346106103230809370764572ac5e65eae09"
40
+ "gitHead": "3551541ce381627a92bea7f8baece6965d822f37"
40
41
  }
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Process for creating, merging branches (always read)
3
+ ---
4
+
5
+ # Branch Management
6
+
7
+ ## Naming Conventions
8
+
9
+ Name branches after the ticket or use a generic naming scheme.
10
+
11
+ ### Ticket Naming
12
+
13
+ If the issue is from a ticketing system such as GitHub, Jira, or Linear, use `feat/{{ ticket }}`.
14
+ Jira and Linear usually include a keyword like `DEV-12`.
15
+ For GitHub tickets use `GITHUB-#`.
16
+
17
+ ### Generic Naming
18
+
19
+ Check the first eight characters of the latest commit hash with `git -C workspace rev-parse --short=8 HEAD`
20
+ Create a new branch prefixed with `feat/`.
21
+ Make the branch name a concise two- or three-word summary of the ticket.
22
+ Lead with the most important word.
23
+ Use dashes, for example `feat/readme-update-abcd5678`.
24
+
25
+ ## Development
26
+
27
+ Refer to [Development_Process.md](./Development_Process.md) for details on process, scripts, and tests expected in the development step.
28
+
29
+ ## Completion
30
+
31
+ Push the completed branch.
32
+ Start a new pull request.
33
+ Describe the changes and any failing validation steps.
34
+ Mark it closing the issue.
@@ -0,0 +1,67 @@
1
+ ---
2
+ description: Development workflow, required reading for coding tasks (always read)
3
+ ---
4
+
5
+ # Development Process
6
+
7
+ ## Baseline Conditions
8
+
9
+ Check package.json scripts for build, format, lint, test, and typecheck commands.
10
+ Build, lint, test, and typecheck the repository before continuing.
11
+ Note but do not attempt to fix errors and warnings.
12
+
13
+ ## Development
14
+
15
+ Start a subagent for actual feature implementation.
16
+ Include any build, lint, test, and type warnings to disregard.
17
+ Have the subagent write a test to validate work whenever possible.
18
+ Have the subagent run tests but not worry about lint and types.
19
+ Commit the changes when complete.
20
+ Follow conventional commits.
21
+
22
+ ## Validation
23
+
24
+ Use a subagent for each step, if applicable.
25
+ Skip any step that does not have a corresponding npm script.
26
+ If the npm script produces no errors or warnings,
27
+ Include any build, lint, test, and type warnings to disregard.
28
+ Skip any step that cannot be passed.
29
+ Commit after each step to ensure changes can be discarded.
30
+
31
+ ### Scrub
32
+
33
+ Follow prompts/Jaypie_Scrub.md.
34
+ If provided, allow repo instructions to override Jaypie scrub.
35
+ Scrub can prevent errors in further steps, especially testing.
36
+
37
+ ### Test
38
+
39
+ Test the repository.
40
+ Have a subagent correct any new errors in the test
41
+ Be clear whether the error is in the test or in the implementation.
42
+ If the failure is an unchanged test, likely the new implementation is to blame.
43
+ If the new implementation intentionally changed code covered by the test triggering the failure, the test may be incorrect.
44
+ Commit the changes when complete.
45
+
46
+ ### Type Check
47
+
48
+ Run `npm run typecheck`.
49
+ Have a subagent correct any new type errors.
50
+ Commit the changes when complete.
51
+
52
+ ### Format and lint
53
+
54
+ Run the format, when available, or lint commands.
55
+ Check status to see if format updated any files.
56
+ Call a subagent for any remaining lint errors introduced by this branch.
57
+ Commit the changes when complete.
58
+
59
+ ### Build
60
+
61
+ Run `npm run build`.
62
+ Have a subagent correct any new build errors.
63
+ Commit the changes when complete.
64
+
65
+ ## Documentation
66
+
67
+ Have a subagent update README.md, if any already-documented features were changed or new features introduced.
@@ -0,0 +1,110 @@
1
+ ---
2
+ trigger: always_on
3
+ description: Baseline rules in Jaypie repositories. Required reading.
4
+ ---
5
+
6
+ # Jaypie's Agent Rules
7
+
8
+ This repository uses Jaypie, an opinionated event-driven fullstack library.
9
+
10
+ ## Errors
11
+
12
+ Jaypie providers errors that will be handled properly when thrown (e.g., presenting the correct status code).
13
+
14
+ `import { BadGatewayError, BadRequestError, ConfigurationError, ForbiddenError, GatewayTimeoutError, GoneError, IllogicalError, InternalError, MethodNotAllowedError, NotFoundError, NotImplementedError, RejectedError, TeapotError, UnauthorizedError, UnavailableError, UnhandledError, UnreachableCodeError } from "jaypie";`
15
+
16
+ ConfigurationError is a special InternalError 500 that is also thrown when types are incorrect.
17
+
18
+ Though supported, rely on default error messages when throwing.
19
+ Custom error messages should be logged not thrown
20
+
21
+ <Bad>
22
+ throw new NotFoundError("Item not found");
23
+ </Bad>
24
+ <Good>
25
+ log.error("Item not found");
26
+ throw new NotFoundError();
27
+ </Good>
28
+
29
+ Error messages may be returned to the user especially in express.
30
+
31
+ ## Logging
32
+
33
+ `import { log } from "jaypie";`
34
+ `log` has methods `trace`, `debug`, `info`, `warn`, `error`, `fatal`, and `var`.
35
+ Only `trace` and `var` should be used in "happy paths".
36
+ `debug` should be used when execution deviates from the happy path.
37
+ `info` should rarely be used.
38
+ `var` expects a _single_ key-value pair like `log.var({ key: "value" });`.
39
+ Do _not_ pass multiple keys to `var`.
40
+
41
+ ## Testing
42
+
43
+ `@jaypie/testkit` is a testing library used with vitest providing custom matchers and mocks for the main Jaypie library.
44
+ Always use the testkit to mock Jaypie.
45
+ Always create a manual mock for a models package.
46
+ Always mock network calls and external commands.
47
+ Jaypie relies heavily on mocking to confirm expected behavior and prevent behavior drift.
48
+
49
+ See [Jaypie_Mocks_and_Testkit.md](./Jaypie_Mocks_and_Testkit.md) for more context.
50
+
51
+ ### Configuration
52
+
53
+ Mocks and matchers are usually configured at the subpackage-level in `testSetup.js` (legacy path) or `vitest.setup.[js|ts]` (modern path).
54
+ The subpackage `[vite|vitest].config[js|ts]` will reference the setup file.
55
+ All jaypie functions are mocked with `vi.mock("jaypie", async () => vi.importActual("@jaypie/testkit/mock"));`
56
+
57
+ vitest.setup.ts
58
+ ```typescript
59
+ import { matchers as jaypieMatchers } from "@jaypie/testkit";
60
+ import * as extendedMatchers from "jest-extended";
61
+ import { expect , vi} from "vitest";
62
+
63
+ expect.extend(extendedMatchers);
64
+ expect.extend(jaypieMatchers);
65
+
66
+ vi.mock("jaypie", async () => vi.importActual("@jaypie/testkit/mock"));
67
+ ```
68
+
69
+ ### Errors
70
+
71
+ Use matchers to test errors.
72
+ `expect(fn).toThrowBadGatewayError();`
73
+ `await expect(async() => fn()).toThrowBadGatewayError();`
74
+ Do not use `.rejects`
75
+
76
+ ### Matchers
77
+
78
+ toBeCalledAboveTrace, toBeCalledWithInitialParams, toBeClass, toBeJaypieError, toMatchBase64, toMatchJwt, toMatchMongoId, toMatchSchema, toMatchSignedCookie, toMatchUuid4, toMatchUuid5, toMatchUuid, toThrowBadGatewayError, toThrowBadRequestError, toThrowConfigurationError, toThrowForbiddenError, toThrowGatewayTimeoutError, toThrowInternalError, toThrowJaypieError, toThrowNotFoundError, toThrowUnauthorizedError, toThrowUnavailableError,
79
+
80
+ ### Order of Tests
81
+
82
+ Tests are named `./__tests__/<subject>.spec.<js|ts>`.
83
+ Each file should have one top-level `describe` block.
84
+ Organize tests in one of seven second-level describe block sections in this order:
85
+
86
+ 1. Base Cases - it is the type we expect ("It is a Function"). For functions, the simplest possible call works and returns not undefined ("It Works"). For objects, the expected shape.
87
+ 2. Error Conditions - any error handling the code performs
88
+ 3. Security - any security checks the code performs
89
+ 4. Observability - any logging the code performs
90
+ 5. Happy Paths - The most common use case
91
+ 6. Features - Features in addition to the happy path
92
+ 7. Specific Scenarios - Special cases
93
+ Omit describe blocks for sections that are not applicable or empty.
94
+ Whenever possible, especially when refactoring, write the test first so the user can confirm the expected behavior passes/fails.
95
+
96
+ ### Test Coverage
97
+
98
+ Aim for complete coverage of all happy paths, features, and error conditions.
99
+ Whenever possible, confirm mocked functions are called.
100
+ Confirm calls to log above debug in Observability. Do not confirm calls to debug, var, or trace.
101
+
102
+ ## Linting
103
+
104
+ Use double quotes, trailing commas, and semicolons.
105
+ Do not delete `// eslint-disable-next-line no-shadow` comments; add when shadowing variables, especially `error` in catch blocks.
106
+
107
+ ### Beyond Lint
108
+
109
+ Whenever a hard-coded value like `site: "datadoghq.com"` is used, define a constant at the top of the file, `const DATADOG_SITE = "datadoghq.com"`, and reference that throughout.
110
+ Alphabetize as much as possible.