@happyvertical/smrt-dev-mcp 0.30.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/AGENTS.md +75 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +323 -0
- package/agent-skills/smrt-code-review/SKILL.md +68 -0
- package/agent-skills/smrt-code-review/references/review-output.md +31 -0
- package/dist/agent-skills.d.ts +19 -0
- package/dist/agent-skills.d.ts.map +1 -0
- package/dist/index-DF0HSB_8.js +1274 -0
- package/dist/index-DF0HSB_8.js.map +1 -0
- package/dist/index.d.ts +853 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2039 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge/index.d.ts +175 -0
- package/dist/knowledge/index.d.ts.map +1 -0
- package/dist/knowledge.d.ts +2 -0
- package/dist/knowledge.d.ts.map +1 -0
- package/dist/knowledge.js +2 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/tools/generate-smrt-class.d.ts +54 -0
- package/dist/tools/generate-smrt-class.d.ts.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/introspect-project.d.ts +14 -0
- package/dist/tools/introspect-project.d.ts.map +1 -0
- package/dist/tools/review-smrt-project.d.ts +13 -0
- package/dist/tools/review-smrt-project.d.ts.map +1 -0
- package/package.json +66 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @happyvertical/smrt-dev-mcp
|
|
2
|
+
|
|
3
|
+
Tier 2 MCP server for development — code generation, project introspection,
|
|
4
|
+
deterministic SMRT ecosystem knowledge, and portable agent workflows.
|
|
5
|
+
|
|
6
|
+
## Tools
|
|
7
|
+
|
|
8
|
+
| Tool | Purpose |
|
|
9
|
+
|------|---------|
|
|
10
|
+
| `generate-smrt-class` | Generates `@smrt()` class with fields, decorator config, imports |
|
|
11
|
+
| `introspect-project` | Scans project directory for SMRT objects, returns class/field/relationship report |
|
|
12
|
+
| `review-smrt-project` | Advisory downstream ecosystem alignment review for dependencies, storage, app shell, auth/tenancy, and manifest generation |
|
|
13
|
+
| `reflect-knowledge` | Reports deterministic SMRT + HappyVertical SDK knowledge coverage and freshness |
|
|
14
|
+
| `reflect-domain-knowledge` | Reports downstream/domain artifact coverage and freshness |
|
|
15
|
+
| `check-knowledge-freshness` | Runs deterministic agent-doc and stale-reference checks |
|
|
16
|
+
| `check-domain-knowledge` | Alias for deterministic domain artifact freshness checks |
|
|
17
|
+
| `build-review-context` | Builds model-ready SMRT review context and package expert routing |
|
|
18
|
+
| `build-domain-review-context` | Domain-scoped review context builder with `scope`/`package` filters |
|
|
19
|
+
| `smrt-review` | Returns deterministic review findings and a reusable review prompt bundle |
|
|
20
|
+
| `build-architecture-context` | Builds architecture planning context from an idea or docs |
|
|
21
|
+
| `build-domain-architecture-context` | Domain-scoped architecture context builder with `scope`/`package` filters |
|
|
22
|
+
| `smrt-architecture` | Recommends SMRT/SDK packages, object-model sketch, risks, and questions |
|
|
23
|
+
| `list-agent-skills` | Lists bundled harness-agnostic agent skills |
|
|
24
|
+
| `get-agent-skill` | Returns a bundled agent skill as Markdown plus optional references |
|
|
25
|
+
|
|
26
|
+
## Agent Skills
|
|
27
|
+
|
|
28
|
+
Bundled skills live under `agent-skills/`. They are plain Markdown procedures
|
|
29
|
+
with YAML frontmatter (`name` and `description`) and harness-neutral body text.
|
|
30
|
+
Skill-aware harnesses can parse the frontmatter; other harnesses can ignore it.
|
|
31
|
+
|
|
32
|
+
- `agent-skills/smrt-code-review/SKILL.md` — downstream SMRT code review workflow.
|
|
33
|
+
Agents should fetch it with `get-agent-skill`, then call `smrt-review` for
|
|
34
|
+
deterministic context, inspect the actual diff, and produce a findings-first
|
|
35
|
+
review.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```jsonc
|
|
40
|
+
// .mcp.json or Claude Desktop config
|
|
41
|
+
{ "mcpServers": { "smrt-dev-mcp": { "command": "npx", "args": ["-y", "@happyvertical/smrt-dev-mcp"] } } }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For global MCP client config, do not use `pnpm exec smrt-dev-mcp` unless the MCP
|
|
45
|
+
server is always launched from a repo that installs the package. Prefer an
|
|
46
|
+
absolute `node /path/to/node_modules/@happyvertical/smrt-dev-mcp/dist/index.js`
|
|
47
|
+
launcher or a small wrapper script with an absolute Node path.
|
|
48
|
+
|
|
49
|
+
## MCP Tier Context
|
|
50
|
+
|
|
51
|
+
- **Tier 1** (Runtime): auto-generated from `@smrt()` objects — live data operations
|
|
52
|
+
- **Tier 2** (Development): this package — code generation and project analysis
|
|
53
|
+
- **Tier 3** (Docs): `smrt-docs-mcp` — framework documentation access
|
|
54
|
+
|
|
55
|
+
## Key Files
|
|
56
|
+
|
|
57
|
+
- `src/index.ts` — MCP server setup, tool registration
|
|
58
|
+
- `src/knowledge/index.ts` — deterministic SMRT, SDK, and downstream domain knowledge discovery
|
|
59
|
+
- `src/agent-skills.ts` — bundled skill registry and file loader
|
|
60
|
+
- `agent-skills/smrt-code-review/SKILL.md` — downstream SMRT review procedure
|
|
61
|
+
- `src/tools/generate-smrt-class.ts` — class generation logic and package-ready templates
|
|
62
|
+
- `src/tools/introspect-project.ts` — manifest-first project scanning, falling back to `@happyvertical/smrt-scanner`
|
|
63
|
+
- `src/tools/review-smrt-project.ts` — advisory ecosystem-alignment checks for downstream projects
|
|
64
|
+
|
|
65
|
+
## Gotchas
|
|
66
|
+
|
|
67
|
+
- **Read-only**: never writes files or executes generated code
|
|
68
|
+
- **Model-agnostic**: review and architecture tools return deterministic
|
|
69
|
+
findings/context and prompt bundles; they do not call model providers
|
|
70
|
+
- **Domain artifacts first**: discovery must prefer `.smrt/smrt-knowledge.json`,
|
|
71
|
+
then `dist/smrt-knowledge.json`, then source artifacts before raw manifest
|
|
72
|
+
fallback
|
|
73
|
+
- **Skill loading**: bundled skills must be included in `package.json` `files`
|
|
74
|
+
because runtime reads them from the installed package directory
|
|
75
|
+
- **Field type mapping**: `text`, `integer`, `decimal`, `boolean`, `datetime`, `json` — maps to SMRT field helpers (but prefer TypeScript defaults per framework convention)
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright <2025> <Happy Vertical Corporation>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
# @happyvertical/smrt-dev-mcp
|
|
2
|
+
|
|
3
|
+
Development MCP server for the SMRT framework providing code generation,
|
|
4
|
+
project introspection, deterministic ecosystem knowledge, and portable review
|
|
5
|
+
or architecture prompt bundles.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm install @happyvertical/smrt-dev-mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Add to your project-local `.mcp.json`, Codex MCP config, or Claude Desktop
|
|
16
|
+
config:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"mcpServers": {
|
|
21
|
+
"smrt-dev-mcp": {
|
|
22
|
+
"type": "stdio",
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["-y", "@happyvertical/smrt-dev-mcp"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For global MCP client config, prefer a launcher that does not depend on the
|
|
31
|
+
current working directory. Avoid `command = "pnpm"` with
|
|
32
|
+
`args = ["exec", "smrt-dev-mcp"]` in user-level config: MCP clients can start
|
|
33
|
+
servers from repositories that do not install this package, and pnpm can run
|
|
34
|
+
dependency-status or build-approval checks before the MCP server starts.
|
|
35
|
+
|
|
36
|
+
Install the package in a stable location and point Codex at the built server:
|
|
37
|
+
|
|
38
|
+
```toml
|
|
39
|
+
[mcp_servers.smrt-dev-mcp]
|
|
40
|
+
command = "node"
|
|
41
|
+
args = ["/absolute/path/to/node_modules/@happyvertical/smrt-dev-mcp/dist/index.js"]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If your Node runtime is managed by a toolchain, use a tiny absolute wrapper
|
|
45
|
+
instead:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
#!/usr/bin/env sh
|
|
49
|
+
exec /absolute/path/to/node /absolute/path/to/node_modules/@happyvertical/smrt-dev-mcp/dist/index.js "$@"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```toml
|
|
53
|
+
[mcp_servers.smrt-dev-mcp]
|
|
54
|
+
command = "/absolute/path/to/smrt-dev-mcp-wrapper"
|
|
55
|
+
args = []
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Set `DEBUG=true` in the environment to enable diagnostic logging.
|
|
59
|
+
|
|
60
|
+
## Knowledge Boundary
|
|
61
|
+
|
|
62
|
+
`smrt-dev-mcp` is model-agnostic. Its review and architecture tools do not call
|
|
63
|
+
Codex, Claude, or any other model provider directly. They return deterministic
|
|
64
|
+
findings plus a reusable prompt bundle that can be sent to the local model plan
|
|
65
|
+
or provider of your choice.
|
|
66
|
+
|
|
67
|
+
Downstream SMRT packages/apps can publish their own scoped
|
|
68
|
+
`smrt-knowledge.json` artifact. Discovery prefers local
|
|
69
|
+
`.smrt/smrt-knowledge.json`, then `dist/smrt-knowledge.json`, then source
|
|
70
|
+
manifest artifacts before falling back to raw manifest/doc scanning. The runtime
|
|
71
|
+
`manifest.json` stays focused on object registration; `smrt-knowledge.json` is
|
|
72
|
+
the agent/developer contract.
|
|
73
|
+
|
|
74
|
+
After using a model to update package docs or expertise, always run the
|
|
75
|
+
deterministic checker again:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pnpm knowledge:check --strict --format markdown
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use `--format json` when another script needs machine-readable output.
|
|
82
|
+
|
|
83
|
+
## Downstream Review Flow
|
|
84
|
+
|
|
85
|
+
1. Run the downstream app build or dev server so `.smrt/smrt-knowledge.json`
|
|
86
|
+
exists.
|
|
87
|
+
2. Call `reflect-domain-knowledge` to confirm package and SDK coverage.
|
|
88
|
+
3. Call `build-domain-review-context` or `smrt-review` with changed files,
|
|
89
|
+
`scope`, and optional `package`.
|
|
90
|
+
4. Send the returned prompt bundle to Codex, Claude, or another model.
|
|
91
|
+
5. Re-run `check-domain-knowledge` after edits.
|
|
92
|
+
|
|
93
|
+
Equivalent CLI commands are:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
smrt knowledge:review-context --scope package --package content --format markdown
|
|
97
|
+
smrt knowledge:architecture-context "tenant-aware publishing workflow" --format json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Agent Skills
|
|
101
|
+
|
|
102
|
+
The package ships harness-agnostic agent skills under `agent-skills/`.
|
|
103
|
+
|
|
104
|
+
Downstream agents should fetch the review procedure before starting a formal
|
|
105
|
+
SMRT review:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"name": "get-agent-skill",
|
|
110
|
+
"arguments": {
|
|
111
|
+
"name": "smrt-code-review"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The returned `skillMarkdown` is plain Markdown with YAML frontmatter (`name`
|
|
117
|
+
and `description`) and a harness-neutral body. Skill-aware harnesses can parse
|
|
118
|
+
the frontmatter; other MCP-capable harnesses can ignore it, call `smrt-review`
|
|
119
|
+
for deterministic context, inspect the actual diff, and produce a findings-first
|
|
120
|
+
review. Native MCP prompt/resource clients can also load the `smrt-code-review`
|
|
121
|
+
prompt or `smrt-dev-mcp://agent-skills/smrt-code-review` resource.
|
|
122
|
+
|
|
123
|
+
## Available Tools
|
|
124
|
+
|
|
125
|
+
The server exposes these MCP tools:
|
|
126
|
+
|
|
127
|
+
### `generate-smrt-class`
|
|
128
|
+
|
|
129
|
+
Generate a complete SMRT class with `@smrt()` decorator, fields, and imports.
|
|
130
|
+
|
|
131
|
+
| Parameter | Type | Required | Description |
|
|
132
|
+
|-----------|------|----------|-------------|
|
|
133
|
+
| `className` | `string` | Yes | Class name (PascalCase) |
|
|
134
|
+
| `properties` | `array` | Yes | Property definitions (`name`, `type`, `required?`, `nullable?`, `description?`, `defaultValue?`) |
|
|
135
|
+
| `baseClass` | `string` | No | `'SmrtObject'` (default) or `'SmrtCollection'` |
|
|
136
|
+
| `template` | `string` | No | `basic`, `global-catalog`, `optional-catalog`, `tenant-project-object`, `tenant-event-log-object`, or `cross-package-reference` |
|
|
137
|
+
| `tableName` | `string` | No | Explicit `@smrt({ tableName })` value |
|
|
138
|
+
| `conflictColumns` | `string[]` | No | Explicit upsert natural key columns |
|
|
139
|
+
| `tenantScoped` | `boolean/object` | No | Add `@TenantScoped(...)`; object supports `mode`, `field`, and bypass/filter options |
|
|
140
|
+
| `includeTenantIdField` | `boolean` | No | Emit a matching `@tenantId()` field |
|
|
141
|
+
| `relationships` | `array` | No | Relationship definitions for `foreignKey`, `crossPackageRef`, `oneToMany`, or `manyToMany` |
|
|
142
|
+
| `includeCompanionSnippets` | `boolean` | No | Append package wiring notes |
|
|
143
|
+
| `includeApiConfig` | `boolean` | No | Include REST API config (default: true) |
|
|
144
|
+
| `includeMcpConfig` | `boolean` | No | Include MCP config (default: true) |
|
|
145
|
+
| `includeCliConfig` | `boolean` | No | Include CLI config (default: true) |
|
|
146
|
+
|
|
147
|
+
Supported property types: `text`, `integer`, `decimal`, `boolean`, `datetime`, `json`.
|
|
148
|
+
|
|
149
|
+
### `introspect-project`
|
|
150
|
+
|
|
151
|
+
Scan a project directory for SMRT objects and return a manifest-equivalent
|
|
152
|
+
class/field/relationship report. Discovery prefers `.smrt/manifest.json`, then
|
|
153
|
+
`dist/manifest.json`, then `src/manifest/manifest.json`; when no artifact is
|
|
154
|
+
available it falls back to `@happyvertical/smrt-scanner`.
|
|
155
|
+
|
|
156
|
+
| Parameter | Type | Required | Description |
|
|
157
|
+
|-----------|------|----------|-------------|
|
|
158
|
+
| `directory` | `string` | No | Project directory (default: cwd) |
|
|
159
|
+
| `manifestPath` | `string` | No | Explicit manifest artifact path |
|
|
160
|
+
| `includeFields` | `boolean` | No | Include field details |
|
|
161
|
+
| `includeRelationships` | `boolean` | No | Analyze relationships |
|
|
162
|
+
| `includeMethods` | `boolean` | No | Include public method details |
|
|
163
|
+
|
|
164
|
+
### `review-smrt-project`
|
|
165
|
+
|
|
166
|
+
Run an advisory downstream ecosystem review. The tool scans package manifests
|
|
167
|
+
and source imports for missing HappyVertical dependencies, direct storage
|
|
168
|
+
bypasses, custom HTTP shells, custom object manifest generation, local
|
|
169
|
+
auth/tenancy/audit seams, and UI shell drift. It returns deterministic findings
|
|
170
|
+
and suggested follow-up issue titles; it does not modify files.
|
|
171
|
+
|
|
172
|
+
| Parameter | Type | Required | Description |
|
|
173
|
+
|-----------|------|----------|-------------|
|
|
174
|
+
| `directory` | `string` | No | Project directory (default: cwd) |
|
|
175
|
+
| `rootDir` | `string` | No | Compatibility alias for `directory` |
|
|
176
|
+
| `includeSourceEvidence` | `boolean` | No | Include file/line evidence (default: true) |
|
|
177
|
+
| `maxFindings` | `number` | No | Limit findings returned |
|
|
178
|
+
|
|
179
|
+
### `reflect-knowledge`
|
|
180
|
+
|
|
181
|
+
Return package coverage, SDK package coverage, relationship-v2 counts, and
|
|
182
|
+
freshness status from the deterministic SMRT + HappyVertical SDK knowledge
|
|
183
|
+
index.
|
|
184
|
+
|
|
185
|
+
| Parameter | Type | Required | Description |
|
|
186
|
+
|-----------|------|----------|-------------|
|
|
187
|
+
| `rootDir` | `string` | No | Project root directory (default: cwd) |
|
|
188
|
+
|
|
189
|
+
### `reflect-domain-knowledge`
|
|
190
|
+
|
|
191
|
+
Return domain artifact coverage, missing exported artifacts, SDK package
|
|
192
|
+
coverage, relationship-v2 counts, and freshness status.
|
|
193
|
+
|
|
194
|
+
| Parameter | Type | Required | Description |
|
|
195
|
+
|-----------|------|----------|-------------|
|
|
196
|
+
| `rootDir` | `string` | No | Project root directory (default: cwd) |
|
|
197
|
+
| `scope` | `string` | No | `project`, `local`, `package`, or `sdk` |
|
|
198
|
+
| `package` | `string` | No | Package name or short name to focus |
|
|
199
|
+
|
|
200
|
+
### `check-knowledge-freshness`
|
|
201
|
+
|
|
202
|
+
Run the same deterministic freshness checks exposed by `pnpm knowledge:check`.
|
|
203
|
+
|
|
204
|
+
| Parameter | Type | Required | Description |
|
|
205
|
+
|-----------|------|----------|-------------|
|
|
206
|
+
| `rootDir` | `string` | No | Project root directory (default: cwd) |
|
|
207
|
+
| `changed` | `boolean` | No | Limit stale-pattern checks to changed files |
|
|
208
|
+
| `strict` | `boolean` | No | Treat stale-pattern findings as errors |
|
|
209
|
+
|
|
210
|
+
### `check-domain-knowledge`
|
|
211
|
+
|
|
212
|
+
Alias over the deterministic checker that emphasizes downstream
|
|
213
|
+
`smrt-knowledge.json` artifact freshness.
|
|
214
|
+
|
|
215
|
+
| Parameter | Type | Required | Description |
|
|
216
|
+
|-----------|------|----------|-------------|
|
|
217
|
+
| `rootDir` | `string` | No | Project root directory (default: cwd) |
|
|
218
|
+
| `changed` | `boolean` | No | Limit stale-pattern checks to changed files |
|
|
219
|
+
| `strict` | `boolean` | No | Treat stale-pattern findings as errors |
|
|
220
|
+
| `scope` | `string` | No | `project`, `local`, `package`, or `sdk` |
|
|
221
|
+
| `package` | `string` | No | Package name or short name to focus |
|
|
222
|
+
|
|
223
|
+
### `build-review-context`
|
|
224
|
+
|
|
225
|
+
Select relevant SMRT and HappyVertical SDK package expertise for changed files,
|
|
226
|
+
then return a model-ready prompt bundle.
|
|
227
|
+
|
|
228
|
+
| Parameter | Type | Required | Description |
|
|
229
|
+
|-----------|------|----------|-------------|
|
|
230
|
+
| `rootDir` | `string` | No | Project root directory (default: cwd) |
|
|
231
|
+
| `changedFiles` | `string[]` | No | Files to route to package experts |
|
|
232
|
+
| `focus` | `string` | No | Review focus or concern |
|
|
233
|
+
| `documentation` | `string` | No | Additional docs or notes to include |
|
|
234
|
+
|
|
235
|
+
### `build-domain-review-context`
|
|
236
|
+
|
|
237
|
+
Domain-scoped alias for `build-review-context`. Accepts the same fields plus
|
|
238
|
+
`scope` and `package`.
|
|
239
|
+
|
|
240
|
+
### `smrt-review`
|
|
241
|
+
|
|
242
|
+
Return deterministic review findings, a prompt bundle, or both.
|
|
243
|
+
|
|
244
|
+
| Parameter | Type | Required | Description |
|
|
245
|
+
|-----------|------|----------|-------------|
|
|
246
|
+
| `rootDir` | `string` | No | Project root directory (default: cwd) |
|
|
247
|
+
| `changedFiles` | `string[]` | No | Files to route to package experts |
|
|
248
|
+
| `focus` | `string` | No | Review focus or concern |
|
|
249
|
+
| `documentation` | `string` | No | Additional docs or notes to include |
|
|
250
|
+
| `mode` | `string` | No | `findings`, `prompt-bundle`, or `both` |
|
|
251
|
+
|
|
252
|
+
### `build-architecture-context`
|
|
253
|
+
|
|
254
|
+
Select relevant SMRT and SDK package expertise for an idea or documentation,
|
|
255
|
+
then return a model-ready architecture prompt bundle.
|
|
256
|
+
|
|
257
|
+
| Parameter | Type | Required | Description |
|
|
258
|
+
|-----------|------|----------|-------------|
|
|
259
|
+
| `rootDir` | `string` | No | Project root directory (default: cwd) |
|
|
260
|
+
| `idea` | `string` | No | Product or implementation idea |
|
|
261
|
+
| `documentation` | `string` | No | Existing docs or requirements |
|
|
262
|
+
| `focus` | `string` | No | Architecture concern to prioritize |
|
|
263
|
+
|
|
264
|
+
### `build-domain-architecture-context`
|
|
265
|
+
|
|
266
|
+
Domain-scoped alias for `build-architecture-context`. Accepts the same fields
|
|
267
|
+
plus `scope` and `package`.
|
|
268
|
+
|
|
269
|
+
### `smrt-architecture`
|
|
270
|
+
|
|
271
|
+
Return package recommendations, SDK recommendations, an object-model sketch,
|
|
272
|
+
risks, questions, and the reusable architecture prompt bundle.
|
|
273
|
+
|
|
274
|
+
| Parameter | Type | Required | Description |
|
|
275
|
+
|-----------|------|----------|-------------|
|
|
276
|
+
| `rootDir` | `string` | No | Project root directory (default: cwd) |
|
|
277
|
+
| `idea` | `string` | No | Product or implementation idea |
|
|
278
|
+
| `documentation` | `string` | No | Existing docs or requirements |
|
|
279
|
+
| `focus` | `string` | No | Architecture concern to prioritize |
|
|
280
|
+
|
|
281
|
+
### `list-agent-skills`
|
|
282
|
+
|
|
283
|
+
List bundled harness-agnostic agent skills.
|
|
284
|
+
No parameters.
|
|
285
|
+
|
|
286
|
+
### `get-agent-skill`
|
|
287
|
+
|
|
288
|
+
Return a bundled agent skill as Markdown, with optional referenced files.
|
|
289
|
+
|
|
290
|
+
| Parameter | Type | Required | Description |
|
|
291
|
+
|-----------|------|----------|-------------|
|
|
292
|
+
| `name` | `string` | Yes | Skill name. Currently `smrt-code-review` |
|
|
293
|
+
| `includeReferences` | `boolean` | No | Include referenced files (default: true) |
|
|
294
|
+
|
|
295
|
+
## MCP Resources And Prompts
|
|
296
|
+
|
|
297
|
+
Resources:
|
|
298
|
+
|
|
299
|
+
- `smrt://knowledge/project` — composed project knowledge index as JSON.
|
|
300
|
+
- `smrt://knowledge/package/{name}` — package-scoped knowledge as JSON.
|
|
301
|
+
- `smrt-dev-mcp://agent-skills/smrt-code-review` — portable review skill.
|
|
302
|
+
|
|
303
|
+
Prompts:
|
|
304
|
+
|
|
305
|
+
- `domain-code-review` — returns the review prompt bundle.
|
|
306
|
+
- `domain-architecture` — returns the architecture prompt bundle.
|
|
307
|
+
- `smrt-code-review` — returns the harness-agnostic review procedure.
|
|
308
|
+
|
|
309
|
+
## MCP Tier Context
|
|
310
|
+
|
|
311
|
+
- **Tier 1** (Runtime): auto-generated from `@smrt()` objects -- live data operations
|
|
312
|
+
- **Tier 2** (Development): this package -- code generation and project analysis
|
|
313
|
+
- **Tier 3** (Docs): `smrt-docs-mcp` -- framework documentation access
|
|
314
|
+
|
|
315
|
+
## Dependencies
|
|
316
|
+
|
|
317
|
+
- `@modelcontextprotocol/sdk` -- MCP server protocol
|
|
318
|
+
- `@happyvertical/smrt-core` -- manifest and object registry
|
|
319
|
+
- `@happyvertical/smrt-types` -- shared domain knowledge contract
|
|
320
|
+
|
|
321
|
+
## License
|
|
322
|
+
|
|
323
|
+
MIT
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: smrt-code-review
|
|
3
|
+
description: Use when reviewing a downstream SMRT project. Fetch deterministic SMRT and HappyVertical SDK context from smrt-dev-mcp, inspect the actual code diff, and produce a findings-first code review.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SMRT Review
|
|
7
|
+
|
|
8
|
+
Use this skill for code reviews in projects that use SMRT packages or generated
|
|
9
|
+
SMRT surfaces.
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
1. Determine the repository root and changed files.
|
|
14
|
+
- Prefer the user's explicit changed-file list.
|
|
15
|
+
- Otherwise use the active harness's git support or `git diff --name-only`.
|
|
16
|
+
- Include staged files when the user is preparing a commit.
|
|
17
|
+
2. Call MCP tool `smrt-review` from `smrt-dev-mcp` with:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"rootDir": "/absolute/path/to/project",
|
|
22
|
+
"changedFiles": ["relative/path/from/root.ts"],
|
|
23
|
+
"focus": "Review SMRT usage, relationships-v2 patterns, tenancy, generated API/CLI/MCP compatibility, SDK usage, prompt/data safety, and stale docs.",
|
|
24
|
+
"mode": "both"
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. Treat `deterministicFindings` as required review routing, not as the whole
|
|
29
|
+
review. A routing warning means the code needs focused scrutiny; do not
|
|
30
|
+
report it as a defect unless the actual diff confirms a concrete issue.
|
|
31
|
+
4. Read the actual changed diff and any referenced files needed to understand
|
|
32
|
+
behavior. Do not review from the MCP context alone.
|
|
33
|
+
5. Use `promptBundle.contextMarkdown` as current SMRT ecosystem context for
|
|
34
|
+
selected packages and SDKs. When generated facts conflict with authored
|
|
35
|
+
guidance, trust generated facts and flag the doc drift.
|
|
36
|
+
6. Produce a findings-first review. Prioritize correctness, regressions,
|
|
37
|
+
missing tests, generated-surface compatibility, relationship/tenant
|
|
38
|
+
invariants, data exposure, and stale docs.
|
|
39
|
+
7. If code, docs, or package expertise changed, call MCP tool
|
|
40
|
+
`check-knowledge-freshness` with `{ "strict": true }` when available, or
|
|
41
|
+
tell the user to run:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pnpm knowledge:check --strict --format markdown
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Required Review Focus
|
|
48
|
+
|
|
49
|
+
- Relationships-v2: `@foreignKey`, `@crossPackageRef`, `SmrtJunction`,
|
|
50
|
+
`SmrtHierarchical`, polymorphic `(metaType, metaId, role)` links, qualified
|
|
51
|
+
`_meta_type`, UUID id/FK columns, and tenant-guarded relationship loads.
|
|
52
|
+
- Generated surfaces: public exports, CLI commands, REST handlers, generated MCP
|
|
53
|
+
tool names/schemas, and AI-operation compatibility.
|
|
54
|
+
- Tenancy: nullable tenant semantics, tenant context propagation, and explicit
|
|
55
|
+
cross-tenant exceptions.
|
|
56
|
+
- SDK usage: prefer HappyVertical SDK packages for AI, SQL, files, logging,
|
|
57
|
+
secrets, jobs, and external capability adapters.
|
|
58
|
+
- Agent docs: `AGENTS.md` is canonical; `CLAUDE.md` must remain exactly the
|
|
59
|
+
`@AGENTS.md` shim.
|
|
60
|
+
|
|
61
|
+
## Output
|
|
62
|
+
|
|
63
|
+
Lead with findings ordered by severity. Use file and line references when the
|
|
64
|
+
harness can provide them. If no issues are found, say that clearly and mention
|
|
65
|
+
the validation or residual risk. Keep summaries secondary to findings.
|
|
66
|
+
|
|
67
|
+
See `references/review-output.md` for a stricter output template when the user
|
|
68
|
+
asks for a formal review.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# SMRT Review Output
|
|
2
|
+
|
|
3
|
+
Use this stricter template when the user asks for a formal review.
|
|
4
|
+
|
|
5
|
+
## Findings
|
|
6
|
+
|
|
7
|
+
List findings first, ordered by severity. Each finding should include:
|
|
8
|
+
|
|
9
|
+
- severity: blocker, high, medium, or low
|
|
10
|
+
- file and line reference when available
|
|
11
|
+
- the concrete bug, regression, or risk
|
|
12
|
+
- why it matters in SMRT terms
|
|
13
|
+
- the smallest practical fix or validation path
|
|
14
|
+
|
|
15
|
+
## Open Questions
|
|
16
|
+
|
|
17
|
+
Include only questions that block a correct review or implementation decision.
|
|
18
|
+
|
|
19
|
+
## Validation
|
|
20
|
+
|
|
21
|
+
State which checks were run or which checks are still needed. For SMRT doc,
|
|
22
|
+
package, or expertise changes, include deterministic knowledge freshness:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm knowledge:check --strict --format markdown
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Summary
|
|
29
|
+
|
|
30
|
+
Keep the summary brief and secondary. Do not let a summary hide unresolved
|
|
31
|
+
findings.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface AgentSkillSummary {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
path: string;
|
|
5
|
+
references: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface AgentSkillBundle extends AgentSkillSummary {
|
|
8
|
+
skillMarkdown: string;
|
|
9
|
+
referenceFiles: Array<{
|
|
10
|
+
path: string;
|
|
11
|
+
content: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export declare function listAgentSkills(): AgentSkillSummary[];
|
|
15
|
+
export declare function getAgentSkill(options: {
|
|
16
|
+
name: string;
|
|
17
|
+
includeReferences?: boolean;
|
|
18
|
+
}): AgentSkillBundle;
|
|
19
|
+
//# sourceMappingURL=agent-skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-skills.d.ts","sourceRoot":"","sources":["../src/agent-skills.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,KAAK,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;CACJ;AAiBD,wBAAgB,eAAe,IAAI,iBAAiB,EAAE,CAErD;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,GAAG,gBAAgB,CAoBnB"}
|