@mr.dj2u/knowledge 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.
- package/dist/content/checklists/ship-test-loop.md +16 -0
- package/dist/content/checklists/unified-agent-bundle-validation.md +8 -0
- package/dist/content/examples/ship-test-loop.md +13 -0
- package/dist/content/examples/unified-agent-bundle-bootstrap.md +8 -0
- package/dist/content/guides/animation-performance.md +30 -0
- package/dist/content/guides/post-create-onboarding.md +113 -0
- package/dist/content/patterns/api/api-routes.md +314 -0
- package/dist/content/patterns/api/error-handling.md +311 -0
- package/dist/content/patterns/database/drizzle-schema.md +280 -0
- package/dist/content/patterns/database/migrations.md +365 -0
- package/dist/content/patterns/database/query-organization.md +537 -0
- package/dist/content/patterns/database/relations.md +450 -0
- package/dist/content/patterns/deployment/build-configuration.md +452 -0
- package/dist/content/patterns/deployment/ci-cd-patterns.md +448 -0
- package/dist/content/patterns/deployment/environment-config.md +380 -0
- package/dist/content/patterns/deployment/hosting-setup.md +425 -0
- package/dist/content/patterns/project/configuration-patterns.md +459 -0
- package/dist/content/patterns/project/documentation-org.md +506 -0
- package/dist/content/patterns/project/folder-structure.md +398 -0
- package/dist/content/patterns/project/library-exports.md +465 -0
- package/dist/content/patterns/project/monorepo-structure.md +500 -0
- package/dist/content/patterns/routing/dynamic-routes.md +221 -0
- package/dist/content/patterns/routing/file-based-routing.md +186 -0
- package/dist/content/patterns/routing/route-groups.md +429 -0
- package/dist/content/patterns/state/persistence-middleware.md +521 -0
- package/dist/content/patterns/state/selector-hooks.md +538 -0
- package/dist/content/patterns/state/store-organization.md +539 -0
- package/dist/content/patterns/state/zustand-patterns.md +348 -0
- package/dist/content/patterns/styling/component-styling.md +468 -0
- package/dist/content/patterns/styling/responsive-patterns.md +398 -0
- package/dist/content/patterns/styling/theme-configuration.md +426 -0
- package/dist/content/patterns/styling/uniwind-setup.md +412 -0
- package/dist/content/prompts/continue-development.md +27 -0
- package/dist/content/prompts/create-expo-super-stack.md +29 -0
- package/dist/content/prompts/fix-seo.md +29 -0
- package/dist/content/prompts/onboard-new-expo-app.md +11 -0
- package/dist/content/prompts/prepare-deploy.md +29 -0
- package/dist/content/prompts/project-research-plan.md +29 -0
- package/dist/content/prompts/review-expo-project.md +29 -0
- package/dist/content/prompts/run-doctor.md +30 -0
- package/dist/content/prompts/ship-test-loop.md +24 -0
- package/dist/content/reference/create-expo-stack-uniwind.md +29 -0
- package/dist/content/reference/doctor-dogfood.md +42 -0
- package/dist/content/reference/mcp-sdk-transport.md +30 -0
- package/dist/content/reference/package-ci-patterns.md +24 -0
- package/dist/content/reference/reference-repo-evacuation.md +31 -0
- package/dist/content/resource-index.json +67 -0
- package/dist/content/rules/app-folder-architecture.md +13 -0
- package/dist/content/rules/env-hygiene.md +9 -0
- package/dist/content/rules/seo-metadata.md +7 -0
- package/dist/content/rules/ssr-safety.md +9 -0
- package/dist/content/skills/api-routes.md +33 -0
- package/dist/content/skills/continue-development.md +31 -0
- package/dist/content/skills/debugging.md +31 -0
- package/dist/content/skills/deployment.md +32 -0
- package/dist/content/skills/dev-server-management.md +31 -0
- package/dist/content/skills/env-vars.md +32 -0
- package/dist/content/skills/expo-router-architecture.md +33 -0
- package/dist/content/skills/expo-ssr-safety.md +32 -0
- package/dist/content/skills/plugin-creation.md +41 -0
- package/dist/content/skills/production-server-patterns.md +31 -0
- package/dist/content/skills/project-onboarding.md +31 -0
- package/dist/content/skills/research-plan-intake.md +31 -0
- package/dist/content/skills/seo-metadata.md +31 -0
- package/dist/content/skills/super-stack-startup.md +31 -0
- package/dist/content/skills/uniwind-theming.md +32 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +369 -0
- package/dist/index.js.map +1 -0
- package/dist/patterns/index.d.ts +78 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +264 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/prompts/index.d.ts +35 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +270 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/skills/index.d.ts +3 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +2 -0
- package/dist/skills/index.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Doctor Dogfood Notes
|
|
2
|
+
|
|
3
|
+
Phase 1 dogfood targets:
|
|
4
|
+
|
|
5
|
+
- `time2pay`
|
|
6
|
+
- `DJsPortfolio`
|
|
7
|
+
- `PokePages`
|
|
8
|
+
- `expo-super-template`
|
|
9
|
+
- `core-monorepo`
|
|
10
|
+
|
|
11
|
+
## Expected Use
|
|
12
|
+
|
|
13
|
+
Before the reference repos are removed from the workspace, run Doctor in
|
|
14
|
+
non-mutating mode against each target and record whether the suite can produce a
|
|
15
|
+
structured report. The goal is not to make every external repo perfect; it is to
|
|
16
|
+
prove Doctor handles real Expo and monorepo shapes without crashing.
|
|
17
|
+
|
|
18
|
+
## Minimum Acceptance
|
|
19
|
+
|
|
20
|
+
- `doctor --json --scripts=false` completes for each target.
|
|
21
|
+
- Reports include project docs, package scripts, env hygiene, Expo config, SSR,
|
|
22
|
+
SEO, and app architecture where applicable.
|
|
23
|
+
- Findings are actionable and avoid leaking env values.
|
|
24
|
+
|
|
25
|
+
## Phase 1 Run Summary
|
|
26
|
+
|
|
27
|
+
Command shape:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node packages/cli/dist/cli.js doctor <target> --json --scripts=false
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| Target | Errors | Warnings | Passed | Skipped | Notes |
|
|
34
|
+
| --- | ---: | ---: | ---: | ---: | --- |
|
|
35
|
+
| `time2pay` | 0 | 1 | 7 | 0 | Structured report completed. |
|
|
36
|
+
| `DJsPortfolio` | 0 | 2 | 6 | 0 | Structured report completed. |
|
|
37
|
+
| `PokePages` | 1 | 3 | 4 | 0 | Package scripts reference missing built server files. |
|
|
38
|
+
| `expo-super-template` | 1 | 3 | 4 | 0 | Package scripts reference a missing server file. |
|
|
39
|
+
| `core-monorepo` | 0 | 2 | 3 | 3 | Structured report completed for monorepo root. |
|
|
40
|
+
|
|
41
|
+
The dogfood pass proves Doctor can scan the required reference shapes without
|
|
42
|
+
needing those repos mounted permanently.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# MCP SDK Transport Pattern
|
|
2
|
+
|
|
3
|
+
Source pattern: `mds-app-mcp/src/index.ts`.
|
|
4
|
+
|
|
5
|
+
## Core Shape
|
|
6
|
+
|
|
7
|
+
- Create a high-level `McpServer` from `@modelcontextprotocol/sdk/server/mcp.js`.
|
|
8
|
+
- Register static markdown resources with stable `mds://` URIs.
|
|
9
|
+
- Register tools with schemas and handlers that return MCP text content.
|
|
10
|
+
- Register prompts for reusable agent workflows.
|
|
11
|
+
- Connect with `StdioServerTransport` for local agent use.
|
|
12
|
+
- Keep HTTP/SSE transport as a later hosting concern unless a client needs it.
|
|
13
|
+
|
|
14
|
+
## MDS Suite Decision
|
|
15
|
+
|
|
16
|
+
Phase 1 uses stdio as the production MCP transport because it works for local
|
|
17
|
+
Codex/Claude workflows and avoids server lifecycle complexity. The server
|
|
18
|
+
still exposes pure functions for tests and direct CLI verification:
|
|
19
|
+
|
|
20
|
+
- `createMrdjMcpServer()`
|
|
21
|
+
- `startStdioServer()`
|
|
22
|
+
- `listResources()`
|
|
23
|
+
- `readResource(uri)`
|
|
24
|
+
- `executeTool(name, input)`
|
|
25
|
+
|
|
26
|
+
## Resource Rule
|
|
27
|
+
|
|
28
|
+
MCP resources must be generated from `packages/knowledge`, not hand-copied into
|
|
29
|
+
`packages/mcp-server`.
|
|
30
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Package And CI Patterns
|
|
2
|
+
|
|
3
|
+
Harvested from `core-monorepo`, `mercury-bank-sdk`, `ads-sdk`, and
|
|
4
|
+
`quantum-api`.
|
|
5
|
+
|
|
6
|
+
## Useful Patterns
|
|
7
|
+
|
|
8
|
+
- Root `ci` scripts should compose lint, typecheck, tests, and build in the
|
|
9
|
+
same order expected by GitHub checks.
|
|
10
|
+
- Package managers differ by repo; Doctor should detect `packageManager` first,
|
|
11
|
+
then lockfiles.
|
|
12
|
+
- SDK packages should expose `types`, ESM entry points, and clear build scripts.
|
|
13
|
+
- Dual ESM/CJS packages need explicit metadata generation for the CJS output
|
|
14
|
+
folder instead of relying on package-manager magic.
|
|
15
|
+
- Monorepos should let root scripts fan out through Turbo or workspace commands,
|
|
16
|
+
while leaf packages keep simple `build`, `typecheck`, and `test` scripts.
|
|
17
|
+
|
|
18
|
+
## Doctor Implications
|
|
19
|
+
|
|
20
|
+
- Missing `lint` or `typecheck` is a warning for local repos.
|
|
21
|
+
- Broken script file targets are errors.
|
|
22
|
+
- `--ci` should run available checks, not assume every repo has the same script
|
|
23
|
+
names.
|
|
24
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Reference Repo Evacuation
|
|
2
|
+
|
|
3
|
+
Phase 1 captured the useful patterns from the temporary multi-root workspace so
|
|
4
|
+
`mds-dev-suite` can run from a clean single-folder workspace.
|
|
5
|
+
|
|
6
|
+
## Captured Sources
|
|
7
|
+
|
|
8
|
+
| Source repo | Captured knowledge | Suite destination |
|
|
9
|
+
| --- | --- | --- |
|
|
10
|
+
| `mds-app-mcp` | MCP SDK server construction, stdio transport, resource registration, prompt registration, and guide loading pattern. | `reference/mcp-sdk-transport.md`, MCP server implementation |
|
|
11
|
+
| `mds-pokemon-mcp` | MCP family naming and guide/resource convention. | Knowledge resource URI rules |
|
|
12
|
+
| `mds-fne-mcp` | MCP family naming and tool/resource split. | Knowledge resource URI rules |
|
|
13
|
+
| `time2pay` | Uniwind setup, CI-equivalent checks, env handling, Expo deployment shape, Doctor dogfood target. | Patterns, Doctor fixtures, `reference/doctor-dogfood.md` |
|
|
14
|
+
| `DJsPortfolio` | API route proxy patterns, Drizzle schema examples, docs organization, route structure, Doctor dogfood target. | API/database/project patterns |
|
|
15
|
+
| `PokePages` | Dynamic route hierarchies, Zustand stores, Drizzle migrations, Doctor dogfood target. | Routing/state/database patterns |
|
|
16
|
+
| `not-hot-dog` | Small app route structure and docs memory convention. | Project/routing patterns |
|
|
17
|
+
| `expo-super-template` | Post-create defaults, Uniwind Metro/global CSS setup, onboarding target shape, Doctor dogfood target. | Styling/onboarding guides |
|
|
18
|
+
| `core-monorepo` | Turborepo package layout, shared package exports, package-manager detection, Doctor dogfood target. | Project/deployment patterns |
|
|
19
|
+
| `mercury-bank-sdk` | Library package export fields, npm workspace scripts, build/test/typecheck workflow. | Project/library and package CI patterns |
|
|
20
|
+
| `ads-sdk` | Small TypeScript SDK package shape and publish build workflow. | Package/CI reference notes |
|
|
21
|
+
| `quantum-api` | Dual ESM/CJS SDK build pattern and generated package metadata workflow. | Package/CI reference notes |
|
|
22
|
+
|
|
23
|
+
## Evacuation Rules
|
|
24
|
+
|
|
25
|
+
- Keep repo names and relative file paths as source notes; do not depend on
|
|
26
|
+
machine-specific absolute paths.
|
|
27
|
+
- Keep reference repos read-only during harvest.
|
|
28
|
+
- Delete `temp/` clones after their patterns are promoted or intentionally
|
|
29
|
+
discarded.
|
|
30
|
+
- A new engineer should be able to open only `mds-dev-suite` and still access
|
|
31
|
+
all Phase 1 knowledge through `packages/knowledge`.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[
|
|
2
|
+
"checklists/ship-test-loop.md",
|
|
3
|
+
"checklists/unified-agent-bundle-validation.md",
|
|
4
|
+
"examples/ship-test-loop.md",
|
|
5
|
+
"examples/unified-agent-bundle-bootstrap.md",
|
|
6
|
+
"guides/animation-performance.md",
|
|
7
|
+
"guides/post-create-onboarding.md",
|
|
8
|
+
"patterns/api/api-routes.md",
|
|
9
|
+
"patterns/api/error-handling.md",
|
|
10
|
+
"patterns/database/drizzle-schema.md",
|
|
11
|
+
"patterns/database/migrations.md",
|
|
12
|
+
"patterns/database/query-organization.md",
|
|
13
|
+
"patterns/database/relations.md",
|
|
14
|
+
"patterns/deployment/build-configuration.md",
|
|
15
|
+
"patterns/deployment/ci-cd-patterns.md",
|
|
16
|
+
"patterns/deployment/environment-config.md",
|
|
17
|
+
"patterns/deployment/hosting-setup.md",
|
|
18
|
+
"patterns/project/configuration-patterns.md",
|
|
19
|
+
"patterns/project/documentation-org.md",
|
|
20
|
+
"patterns/project/folder-structure.md",
|
|
21
|
+
"patterns/project/library-exports.md",
|
|
22
|
+
"patterns/project/monorepo-structure.md",
|
|
23
|
+
"patterns/routing/dynamic-routes.md",
|
|
24
|
+
"patterns/routing/file-based-routing.md",
|
|
25
|
+
"patterns/routing/route-groups.md",
|
|
26
|
+
"patterns/state/persistence-middleware.md",
|
|
27
|
+
"patterns/state/selector-hooks.md",
|
|
28
|
+
"patterns/state/store-organization.md",
|
|
29
|
+
"patterns/state/zustand-patterns.md",
|
|
30
|
+
"patterns/styling/component-styling.md",
|
|
31
|
+
"patterns/styling/responsive-patterns.md",
|
|
32
|
+
"patterns/styling/theme-configuration.md",
|
|
33
|
+
"patterns/styling/uniwind-setup.md",
|
|
34
|
+
"prompts/continue-development.md",
|
|
35
|
+
"prompts/create-expo-super-stack.md",
|
|
36
|
+
"prompts/fix-seo.md",
|
|
37
|
+
"prompts/onboard-new-expo-app.md",
|
|
38
|
+
"prompts/prepare-deploy.md",
|
|
39
|
+
"prompts/project-research-plan.md",
|
|
40
|
+
"prompts/review-expo-project.md",
|
|
41
|
+
"prompts/run-doctor.md",
|
|
42
|
+
"prompts/ship-test-loop.md",
|
|
43
|
+
"reference/create-expo-stack-uniwind.md",
|
|
44
|
+
"reference/doctor-dogfood.md",
|
|
45
|
+
"reference/mcp-sdk-transport.md",
|
|
46
|
+
"reference/package-ci-patterns.md",
|
|
47
|
+
"reference/reference-repo-evacuation.md",
|
|
48
|
+
"rules/app-folder-architecture.md",
|
|
49
|
+
"rules/env-hygiene.md",
|
|
50
|
+
"rules/seo-metadata.md",
|
|
51
|
+
"rules/ssr-safety.md",
|
|
52
|
+
"skills/api-routes.md",
|
|
53
|
+
"skills/continue-development.md",
|
|
54
|
+
"skills/debugging.md",
|
|
55
|
+
"skills/deployment.md",
|
|
56
|
+
"skills/dev-server-management.md",
|
|
57
|
+
"skills/env-vars.md",
|
|
58
|
+
"skills/expo-router-architecture.md",
|
|
59
|
+
"skills/expo-ssr-safety.md",
|
|
60
|
+
"skills/plugin-creation.md",
|
|
61
|
+
"skills/production-server-patterns.md",
|
|
62
|
+
"skills/project-onboarding.md",
|
|
63
|
+
"skills/research-plan-intake.md",
|
|
64
|
+
"skills/seo-metadata.md",
|
|
65
|
+
"skills/super-stack-startup.md",
|
|
66
|
+
"skills/uniwind-theming.md"
|
|
67
|
+
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# App Folder Architecture Rule
|
|
2
|
+
|
|
3
|
+
Keep Expo Router route files focused on routing, layout, screen composition, and
|
|
4
|
+
small view-state glue.
|
|
5
|
+
|
|
6
|
+
Warn when route files:
|
|
7
|
+
|
|
8
|
+
- exceed the configured line budget,
|
|
9
|
+
- import database clients directly,
|
|
10
|
+
- contain heavy form or business logic,
|
|
11
|
+
- duplicate large UI chunks,
|
|
12
|
+
- use browser globals without a client-only guard.
|
|
13
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Environment Hygiene Rule
|
|
2
|
+
|
|
3
|
+
Never expose secrets through `EXPO_PUBLIC_` variables. Public variables are
|
|
4
|
+
bundled for the client.
|
|
5
|
+
|
|
6
|
+
Treat names containing `SECRET`, `SERVICE_ROLE`, `PRIVATE`, `PASSWORD`,
|
|
7
|
+
`TOKEN`, or `STRIPE_SECRET` as unsafe when they are prefixed with
|
|
8
|
+
`EXPO_PUBLIC_`.
|
|
9
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# SSR Safety Rule
|
|
2
|
+
|
|
3
|
+
Expo web routes must not assume browser-only globals are available during
|
|
4
|
+
render.
|
|
5
|
+
|
|
6
|
+
Warn on unguarded `window`, `document`, `localStorage`, `sessionStorage`, and
|
|
7
|
+
`navigator` references in route files. Prefer `useEffect`, explicit
|
|
8
|
+
`typeof window !== 'undefined'` guards, or a storage adapter.
|
|
9
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Skill: API Routes
|
|
2
|
+
|
|
3
|
+
Use when creating, reviewing, or debugging Expo Router API route handlers.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Keep route handlers thin and defensive: validate input, enforce auth/authorization before data access, and return consistent typed responses.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Confirm each endpoint handles allowed methods explicitly and rejects unsupported methods.
|
|
12
|
+
- Validate request params/body with schema guards before business logic executes.
|
|
13
|
+
- Enforce auth first for privileged operations; never rely on client-provided roles.
|
|
14
|
+
- Keep service-role credentials on server-only paths and avoid exposing them to client bundles.
|
|
15
|
+
- Confirm error responses are structured and safe (no stack traces or secret values).
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Use one route module per resource concern.
|
|
20
|
+
- Parse and validate request data first, then call feature/service logic.
|
|
21
|
+
- Keep DB and external API logic in service modules, not inline in route files.
|
|
22
|
+
- Use a shared response envelope pattern for success and failure paths.
|
|
23
|
+
|
|
24
|
+
## Example fix
|
|
25
|
+
|
|
26
|
+
- Problem: A `POST` route writes directly to DB with unchecked body data.
|
|
27
|
+
- Fix: Add schema validation, early auth check, and move write logic into a service function before returning a typed response object.
|
|
28
|
+
|
|
29
|
+
## Agent behavior
|
|
30
|
+
|
|
31
|
+
- Apply the smallest safe refactor that adds validation/auth boundaries first.
|
|
32
|
+
- Delegate framework primitive questions to official Expo API route guidance, then layer MDS project-specific rules (env boundaries, doc updates, Doctor compatibility).
|
|
33
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Skill: Continue Development
|
|
2
|
+
|
|
3
|
+
Use when resuming work on an onboarded app and selecting the next task from `project/todo.md`.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Continue phase-by-phase: finish in-progress phase items first, and only defer/move tasks with an explicit note and user confirmation.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Confirm project memory files are present and current before task selection.
|
|
12
|
+
- Identify the active phase and incomplete tasks in `project/todo.md`.
|
|
13
|
+
- Confirm blockers/context markers are resolved before feature implementation.
|
|
14
|
+
- Confirm any deferral includes a clear reason and destination note.
|
|
15
|
+
- Re-run Doctor/checks after significant phase tasks are completed.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Start each session by summarizing current phase state and next recommended task.
|
|
20
|
+
- Keep task updates minimal and explicit in `project/todo.md`.
|
|
21
|
+
- Keep roadmap changes aligned with product intent in `project/info.md`.
|
|
22
|
+
|
|
23
|
+
## Example fix
|
|
24
|
+
|
|
25
|
+
- Problem: Agent jumps to a later phase feature while current phase has unresolved blockers.
|
|
26
|
+
- Fix: Return to active phase tasks, complete or formally defer blockers, then proceed to later phase work.
|
|
27
|
+
|
|
28
|
+
## Agent behavior
|
|
29
|
+
|
|
30
|
+
- Optimize for forward progress without losing roadmap integrity.
|
|
31
|
+
- Avoid silently reordering roadmap priorities; ask for confirmation before major sequencing changes.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Skill: Debugging
|
|
2
|
+
|
|
3
|
+
Use when diagnosing broken behavior, flaky tooling, or unclear failures in Expo projects.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Debug by narrowing scope quickly: reproduce, isolate, capture evidence, apply the smallest safe fix, then verify.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Reproduce the issue consistently and record exact command/path/error output.
|
|
12
|
+
- Confirm environment assumptions (platform, output mode, env vars, script path) match the failing context.
|
|
13
|
+
- Run targeted checks first (`mds doctor`, focused tests, route/file scans) before broad reruns.
|
|
14
|
+
- Separate root-cause signals from secondary cascade errors.
|
|
15
|
+
- Re-verify with the same reproduction path after the fix.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Keep debugging notes concise in task output or project memory when the issue is recurring.
|
|
20
|
+
- Prefer deterministic scripts over ad-hoc manual sequences.
|
|
21
|
+
- Escalate from narrow test scope to broader validation only after targeted checks pass.
|
|
22
|
+
|
|
23
|
+
## Example fix
|
|
24
|
+
|
|
25
|
+
- Problem: Route crashes only on web server output with ambiguous stack traces.
|
|
26
|
+
- Fix: Reproduce in server mode, isolate browser-global usage in shared module, add guards, rerun targeted test and Doctor scan.
|
|
27
|
+
|
|
28
|
+
## Agent behavior
|
|
29
|
+
|
|
30
|
+
- Start with high-risk failures (security, data loss, crashers), then address lower-risk warnings.
|
|
31
|
+
- Keep users unblocked with concrete next commands and avoid speculative broad refactors before evidence is clear.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Skill: Deployment Readiness
|
|
2
|
+
|
|
3
|
+
Use before merging or releasing an Expo project to shared environments.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Treat deployment as a repeatable checklist: pass local quality gates, verify runtime configuration, and document rollback expectations before ship.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Run lint, type-check, tests, Expo Doctor, and production build/profile checks when scripts exist.
|
|
12
|
+
- Verify env vars are documented and separated by client/server exposure level.
|
|
13
|
+
- Confirm output mode and hosting assumptions match the selected platform strategy.
|
|
14
|
+
- Confirm metadata/indexing basics are defined for web exports.
|
|
15
|
+
- Record release and rollback notes for the current change batch.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Keep release checks in scripts that CI and agents can run consistently.
|
|
20
|
+
- Gate merge/publish flows on the same Doctor and package validation criteria.
|
|
21
|
+
- Keep deployment conventions in `project/guidelines.md` and release tasks in `project/todo.md`.
|
|
22
|
+
|
|
23
|
+
## Example fix
|
|
24
|
+
|
|
25
|
+
- Problem: Release pipeline runs tests but skips Expo Doctor and build profile checks.
|
|
26
|
+
- Fix: Add missing scripts, wire them into pre-merge checks, and document the required sequence in project memory.
|
|
27
|
+
|
|
28
|
+
## Agent behavior
|
|
29
|
+
|
|
30
|
+
- Run project-defined checks first; do not invent alternate release criteria.
|
|
31
|
+
- Delegate framework deployment primitives to official Expo guidance, then apply MDS workflow rules for docs, Doctor parity, and rollback readiness.
|
|
32
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Skill: Dev Server Management
|
|
2
|
+
|
|
3
|
+
Use when Expo or Metro local development servers fail to boot cleanly, hang, or bind to conflicting ports.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Use a deterministic reset path first; do not work around unstable server state with ad-hoc port fallbacks.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Run `mds clear-expo-start` before manual troubleshooting.
|
|
12
|
+
- If a conflict remains, run `mds free-port <port...>` (or legacy `mds free-port`) for blocked ports.
|
|
13
|
+
- Confirm Expo/Metro caches are cleared before retrying startup.
|
|
14
|
+
- Treat fallback to port `8082` as an unresolved state that requires full reset.
|
|
15
|
+
- Confirm the same recovery scripts are available to teammates and automation.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Keep project scripts for clear-expo-start and targeted port cleanup.
|
|
20
|
+
- Standardize a single restart path in project memory (`project/guidelines.md`).
|
|
21
|
+
- Use explicit “fresh” commands when booting local or production-like flows.
|
|
22
|
+
|
|
23
|
+
## Example fix
|
|
24
|
+
|
|
25
|
+
- Problem: `expo start` repeatedly falls back to `8082` after a partial crash.
|
|
26
|
+
- Fix: Run `mds clear-expo-start`, free remaining blocked ports, clear cache, and restart via the project's clear-expo-start script.
|
|
27
|
+
|
|
28
|
+
## Agent behavior
|
|
29
|
+
|
|
30
|
+
- Prefer established MDS cleanup commands over custom shell sequences.
|
|
31
|
+
- Avoid introducing alternate fallback port workflows that hide root-cause server state issues.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Skill: Environment Variables
|
|
2
|
+
|
|
3
|
+
Use when adding, reviewing, or debugging app configuration and secrets handling.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Keep a hard boundary between public client config and private server secrets; anything sensitive must never cross into `EXPO_PUBLIC_*` variables.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Confirm secrets (service-role keys, private tokens, payment secrets, passwords) are server-only.
|
|
12
|
+
- Confirm `EXPO_PUBLIC_*` values are safe to expose in client bundles.
|
|
13
|
+
- Validate required env keys exist for each runtime mode used by the project.
|
|
14
|
+
- Ensure Supabase anon key usage is scoped to client-safe flows and service-role usage is server-only.
|
|
15
|
+
- Verify env naming/docs are consistent across `.env` files, scripts, and project memory.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Keep env access centralized through small typed config helpers.
|
|
20
|
+
- Separate client-safe config and server-only config modules.
|
|
21
|
+
- Document required keys and local setup in project memory and onboarding outputs.
|
|
22
|
+
|
|
23
|
+
## Example fix
|
|
24
|
+
|
|
25
|
+
- Problem: A route imports `EXPO_PUBLIC_SUPABASE_SERVICE_ROLE_KEY` from client config.
|
|
26
|
+
- Fix: Move service-role key to server-only env access, switch client flow to anon key, and update docs/checks.
|
|
27
|
+
|
|
28
|
+
## Agent behavior
|
|
29
|
+
|
|
30
|
+
- Prioritize removing exposure risk before refactoring for style.
|
|
31
|
+
- Delegate framework/env-loading primitives to official Expo guidance, then enforce MDS-specific security boundaries and Doctor alignment.
|
|
32
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Skill: Expo Router Architecture
|
|
2
|
+
|
|
3
|
+
Use when structuring, reviewing, or refactoring Expo Router route code.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Keep route files thin: routing and composition belong in `app/`, while business/data logic lives in feature, service, and shared modules.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Confirm route files avoid direct DB calls, heavy business logic, and large side-effect chains.
|
|
12
|
+
- Confirm shared UI blocks are extracted to component modules.
|
|
13
|
+
- Confirm cross-route state is managed in stores/hooks instead of duplicated route-local logic.
|
|
14
|
+
- Confirm route grouping/layout usage is intentional and not overloaded at root.
|
|
15
|
+
- Confirm file size/complexity trends support long-term maintainability.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Keep `app/` files focused on params, navigation, and screen composition.
|
|
20
|
+
- Place business workflows in `src/features`.
|
|
21
|
+
- Place side effects/integrations in `src/services` or `src/data`.
|
|
22
|
+
- Keep reusable UI in `src/components` and cross-cutting helpers in hooks/utilities.
|
|
23
|
+
|
|
24
|
+
## Example fix
|
|
25
|
+
|
|
26
|
+
- Problem: A route file performs data fetching, mutation, and form business rules inline.
|
|
27
|
+
- Fix: Move fetch/mutation logic to service modules, move workflow rules to a feature module, and keep the route as a thin screen wrapper.
|
|
28
|
+
|
|
29
|
+
## Agent behavior
|
|
30
|
+
|
|
31
|
+
- Prefer small, incremental extractions over broad rewrites.
|
|
32
|
+
- Delegate framework routing primitives to official Expo Router guidance, then apply MDS rules for maintainable app-folder boundaries and Doctor-compatible architecture.
|
|
33
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Skill: Expo SSR Safety
|
|
2
|
+
|
|
3
|
+
Use when preparing or debugging Expo Router web/server output paths.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Assume server runtime first: guard browser-only APIs, isolate native-only code, and keep shared modules safe in both client and server contexts.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Guard `window`, `document`, `navigator`, `localStorage`, and `sessionStorage` access.
|
|
12
|
+
- Confirm client-only packages are not imported by server/API execution paths.
|
|
13
|
+
- Confirm storage/session access happens in client-safe lifecycle points.
|
|
14
|
+
- Verify API routes and server modules do not rely on browser globals.
|
|
15
|
+
- Validate dynamic imports or adapters for platform-specific behavior.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Use small environment-check helpers for browser-global access.
|
|
20
|
+
- Split client-only logic behind platform/runtime-specific modules.
|
|
21
|
+
- Keep server-safe defaults and explicit fallbacks in shared utilities.
|
|
22
|
+
|
|
23
|
+
## Example fix
|
|
24
|
+
|
|
25
|
+
- Problem: Shared auth helper reads `localStorage` at module load and crashes SSR.
|
|
26
|
+
- Fix: Move storage access into guarded runtime functions and provide a server-safe fallback.
|
|
27
|
+
|
|
28
|
+
## Agent behavior
|
|
29
|
+
|
|
30
|
+
- Fix crash-risk paths first, then clean up architecture.
|
|
31
|
+
- Delegate framework SSR primitives to official Expo docs, then apply MDS-specific guard patterns and Doctor rule compatibility.
|
|
32
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Skill: MDS Plugin Creation
|
|
2
|
+
|
|
3
|
+
Use when building or extending an MDS plugin bundle for any agent client (Claude Code, Codex, Cursor, etc.).
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Plugins are thin bundles. `packages/knowledge` is the source of truth for skills, command prompts, checklists, and examples. Do not hand-author plugin skill/command copies in plugin folders.
|
|
8
|
+
|
|
9
|
+
## Structure conventions
|
|
10
|
+
|
|
11
|
+
Every MDS plugin lives in `plugins/<client-name>/`:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
plugins/<client-name>/
|
|
15
|
+
README.md
|
|
16
|
+
CLAUDE.md # Claude-specific merge instructions (if relevant)
|
|
17
|
+
.mcp.json
|
|
18
|
+
commands/ # generated command markdown from canonical prompt specs
|
|
19
|
+
skills/ # generated skill files
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Checks
|
|
23
|
+
|
|
24
|
+
- Skill markdown lives only in `packages/knowledge/src/content/skills/`.
|
|
25
|
+
- Prompt/command markdown lives only in `packages/knowledge/src/content/prompts/`.
|
|
26
|
+
- `plugins/<client>/skills/` remains generated output and is not manually edited.
|
|
27
|
+
- Commands reference real MCP tool names from `packages/mcp-server`.
|
|
28
|
+
- MCP config uses the `mds-dev-suite` server key.
|
|
29
|
+
|
|
30
|
+
## Adding a plugin capability
|
|
31
|
+
|
|
32
|
+
1. Add or update canonical content in `packages/knowledge/src/content/*`.
|
|
33
|
+
2. Update canonical prompt metadata in `packages/knowledge/src/prompts/index.ts`.
|
|
34
|
+
3. Regenerate outputs via `pnpm --filter @mr.dj2u/knowledge build`.
|
|
35
|
+
4. Verify generated plugin assets under `plugins/codex/` and `plugins/claude-code/`.
|
|
36
|
+
|
|
37
|
+
## Agent behavior
|
|
38
|
+
|
|
39
|
+
- Prefer extending canonical knowledge specs over patching generated plugin files.
|
|
40
|
+
- Keep command prompts action-oriented and MCP-first with clear fallback paths.
|
|
41
|
+
- Delegate framework guidance to Expo-owned skills/docs when available; layer MDS project-memory and workflow guidance on top.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Skill: Production Server Patterns
|
|
2
|
+
|
|
3
|
+
Use when setting up or debugging how an Expo project serves production traffic.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Pick one explicit production serving mode per environment and codify it in scripts; avoid mixed runtime assumptions.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Confirm selected mode is documented: managed Expo/EAS, Express adapter, or dual-server.
|
|
12
|
+
- Confirm serving scripts match the selected runtime (`npx expo serve`, `node server.js`, or dual process scripts).
|
|
13
|
+
- Confirm routing boundaries are clear when app and API are separate services.
|
|
14
|
+
- Confirm env var ownership differs correctly across app server and API server in dual-server mode.
|
|
15
|
+
- Confirm “fresh” start scripts exist where server state/caches can cause drift.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Define `serve:prod` and `serve:prod:fresh` scripts for the chosen mode.
|
|
20
|
+
- Keep server bootstrap and adapter code in dedicated files/modules.
|
|
21
|
+
- Keep deployment notes aligned with runtime mode in project memory.
|
|
22
|
+
|
|
23
|
+
## Example fix
|
|
24
|
+
|
|
25
|
+
- Problem: Team mixes Expo serve and custom Express commands, causing inconsistent behavior.
|
|
26
|
+
- Fix: Select one primary mode per environment, standardize scripts, and document routing/env boundaries.
|
|
27
|
+
|
|
28
|
+
## Agent behavior
|
|
29
|
+
|
|
30
|
+
- Use the project’s declared serving mode unless a migration is explicitly requested.
|
|
31
|
+
- Delegate framework runtime primitives to official Expo docs, then enforce MDS conventions for script consistency, environment boundaries, and operational clarity.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Skill: Project Onboarding
|
|
2
|
+
|
|
3
|
+
Use when onboarding an existing Expo app into the MDS workflow after project creation.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Establish project memory and workflow defaults first, then scaffold only the selected technical additions.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Confirm onboarding target is the existing app folder (not a parent directory).
|
|
12
|
+
- Confirm project memory files exist or are generated: `project/info.md`, `project/todo.md`, `project/style.md`, `project/guidelines.md`.
|
|
13
|
+
- Confirm unresolved context markers are cleared before deep implementation work.
|
|
14
|
+
- Confirm selected defaults (styling, state, data, CI, route placement) are documented in project memory.
|
|
15
|
+
- Run Doctor after onboarding changes to validate baseline health.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Use conversational intake to capture audience, flows, data needs, platform targets, and deployment intent.
|
|
20
|
+
- Keep visual guidance in `project/style.md`; keep technical/agent rules in `project/guidelines.md`.
|
|
21
|
+
- Keep onboarding outputs phase-based so follow-up work can continue from `project/todo.md`.
|
|
22
|
+
|
|
23
|
+
## Example fix
|
|
24
|
+
|
|
25
|
+
- Problem: Team starts coding before onboarding, causing missing docs and conflicting architecture assumptions.
|
|
26
|
+
- Fix: Run onboarding flow, generate canonical project memory, reconcile open context markers, then resume implementation using phase order.
|
|
27
|
+
|
|
28
|
+
## Agent behavior
|
|
29
|
+
|
|
30
|
+
- Ask one focused onboarding question at a time when required by the flow.
|
|
31
|
+
- Delegate framework primitive setup guidance to official Expo resources, then layer MDS project-memory and workflow automation rules.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Skill: Research Plan Intake
|
|
2
|
+
|
|
3
|
+
Use when a user has partial product context (notes, research docs, or incomplete project memory) and needs it transformed into canonical MDS project memory.
|
|
4
|
+
|
|
5
|
+
## Main rule
|
|
6
|
+
|
|
7
|
+
Normalize fragmented input into decision-ready `project/info.md` and `project/style.md` structure without inventing missing product facts.
|
|
8
|
+
|
|
9
|
+
## Checks
|
|
10
|
+
|
|
11
|
+
- Parse provided artifacts and classify each required section as clear, ambiguous, or unknown.
|
|
12
|
+
- Reuse clear sections directly; ask focused follow-up only for ambiguous or missing high-impact decisions.
|
|
13
|
+
- Keep visual guidance in style memory and technical/process guidance in guidelines memory.
|
|
14
|
+
- Confirm resulting project memory aligns with current roadmap phase and target platforms.
|
|
15
|
+
- Record unresolved unknowns explicitly instead of guessing.
|
|
16
|
+
|
|
17
|
+
## Preferred structure
|
|
18
|
+
|
|
19
|
+
- Accept inputs from pasted markdown, notes, and prior project memory files.
|
|
20
|
+
- Map extracted content into canonical sections with concise normalization.
|
|
21
|
+
- Produce follow-up questions only where answers materially change implementation direction.
|
|
22
|
+
|
|
23
|
+
## Example fix
|
|
24
|
+
|
|
25
|
+
- Problem: User provides a long brainstorm doc with no clear MVP flow or audience.
|
|
26
|
+
- Fix: Extract known context, mark missing decision points, ask targeted follow-up, then generate canonical project memory sections.
|
|
27
|
+
|
|
28
|
+
## Agent behavior
|
|
29
|
+
|
|
30
|
+
- Preserve user intent and wording where it is already clear.
|
|
31
|
+
- Keep uncertainty visible and collaborative; do not fill strategic gaps with assumptions that can misdirect implementation.
|