@galaxy-stack/orbit-mcp 0.1.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.
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: orbit-framework
3
+ description: >
4
+ Guidance for building backend applications with the Orbit framework
5
+ (@galaxy-stack/orbit-*), a NestJS-style framework optimized for the Bun
6
+ runtime. Use when creating modules, controllers, providers, GraphQL APIs,
7
+ microservices, or when migrating from NestJS to Orbit.
8
+ version: 0.1.0
9
+ ---
10
+
11
+ # Orbit Framework Skill
12
+
13
+ Orbit is a NestJS-style backend framework for Bun. Concept mapping from NestJS:
14
+ `@nestjs/common` → `@galaxy-stack/orbit-core`; `class-validator` DTOs → Zod +
15
+ `orbit-validation`; `@nestjs/graphql` → `orbit-graphql`; `@nestjs/microservices`
16
+ → `orbit-microservices` + transport packages; `@nestjs/swagger` → `orbit-swagger`.
17
+
18
+ ## Project rules
19
+
20
+ 1. Runtime is Bun. Use `bun` instead of `node`/`npm`/`pnpm` for all commands:
21
+ `bun install`, `bun run dev`, `bun test`.
22
+ 2. Entry point: `OrbitFactory.create(AppModule)` then `app.listen(3000)`.
23
+ 3. Every feature is a `@Module({ controllers, providers, exports })` class.
24
+ 4. Providers are `@Injectable()` classes injected via constructor.
25
+ 5. Validate all external input with Zod schemas through ValidationPipe.
26
+ 6. Tests run with `bun test`; e2e tests call `app.handle(new Request(...))`.
27
+
28
+ ## Security baseline (non-negotiable for production code)
29
+
30
+ - `SecurityModule.forRoot({ helmet: true, csrf: true })` — OWASP headers + CSRF.
31
+ - `ThrottlerModule` for rate limiting on auth and write routes.
32
+ - GraphQL: `introspection: false` in production; `security: { maxDepth: 10,
33
+ maxComplexity: 1000, maxAliases: 30 }`; playground disabled in production.
34
+ - Never log secrets; redact before logging.
35
+ - Sanitize any stored HTML with the orbit-security Sanitizer.
36
+
37
+ ## Module template
38
+
39
+ ```ts
40
+ import { Module } from '@galaxy-stack/orbit-core';
41
+
42
+ @Module({
43
+ controllers: [UserController],
44
+ providers: [UserService],
45
+ exports: [UserService],
46
+ })
47
+ export class UserModule {}
48
+ ```
49
+
50
+ ## Controller template
51
+
52
+ ```ts
53
+ import { Controller, Get, Post, Body, Param, HttpCode, UseGuards } from '@galaxy-stack/orbit-core';
54
+
55
+ @Controller('users')
56
+ export class UserController {
57
+ constructor(private readonly users: UserService) {}
58
+
59
+ @Get(':id')
60
+ find(@Param('id') id: string) { return this.users.find(id); }
61
+
62
+ @Post()
63
+ @HttpCode(201)
64
+ @UseGuards(JwtAuthGuard)
65
+ create(@Body() body: CreateUserDto) { return this.users.create(body); }
66
+ }
67
+ ```
68
+
69
+ ## GraphQL template
70
+
71
+ ```ts
72
+ import { Resolver, Query, Mutation, Args } from '@galaxy-stack/orbit-graphql';
73
+
74
+ @Resolver()
75
+ export class UserResolver {
76
+ @Query(() => [User])
77
+ users() { return this.userService.list(); }
78
+
79
+ @Mutation(() => User)
80
+ createUser(@Args('input') input: CreateUserInput) {
81
+ return this.userService.create(input);
82
+ }
83
+ }
84
+ ```
85
+
86
+ Module wiring with security limits:
87
+
88
+ ```ts
89
+ GraphQLModule.forRoot({
90
+ autoSchemaFile: true,
91
+ introspection: process.env.NODE_ENV !== 'production',
92
+ security: { maxDepth: 10, maxComplexity: 1000, maxAliases: 30 },
93
+ resolvers: [UserResolver],
94
+ })
95
+ ```
96
+
97
+ ## Verification checklist (run before declaring done)
98
+
99
+ 1. `bun test` passes.
100
+ 2. App boots: `bun run dev` shows no startup errors.
101
+ 3. Mutating routes have validation + auth.
102
+ 4. GraphQL module has security limits when used.
103
+ 5. No secrets in source; config comes from ConfigModule/env.
104
+
105
+ ## Deeper reference
106
+
107
+ Run the companion MCP server (`@galaxy-stack/orbit-mcp`) for searchable
108
+ knowledge, scaffolding tools, and a security review tool:
109
+
110
+ ```json
111
+ {
112
+ "mcpServers": {
113
+ "orbit": { "command": "bunx", "args": ["@galaxy-stack/orbit-mcp"] }
114
+ }
115
+ }
116
+ ```