@stacknext/cli 0.9.0 → 0.11.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/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/agent-setup.md +120 -0
- package/docs/commands.md +192 -0
- package/docs/configuration.md +100 -0
- package/docs/index.md +142 -0
- package/docs/packages.md +71 -0
- package/docs/skill.md +75 -0
- package/docs/troubleshooting.md +84 -0
- package/package.json +8 -7
- package/skills/stacknext-debugging/SKILL.md +20 -1
- package/skills/stacknext-debugging/references/documentation.md +69 -0
- package/skills/stacknext-debugging/references/setup.md +9 -3
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.
|
|
1
|
+
export declare const CLI_VERSION = "0.11.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,WAAW,CAAA"}
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.
|
|
1
|
+
export const CLI_VERSION = '0.11.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAA"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Agent setup
|
|
3
|
+
description: Install StackNext agent instructions, the Agent Skill and the MCP server.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent setup
|
|
7
|
+
|
|
8
|
+
StackNext has three complementary agent surfaces. They do not replace one
|
|
9
|
+
another.
|
|
10
|
+
|
|
11
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
12
|
+
|
|
13
|
+
<!-- coderabbit-ai-generated-section:v1:6cb91359416b90497c8a30b4e48bca6633004719cf0d0075494ac3fd6e33f50a -->
|
|
14
|
+
|
|
15
|
+
| Surface | Purpose | Command |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| Local package documentation | Version-matched API reference | Ships in the seven documented packages |
|
|
18
|
+
| Managed `AGENTS.md` block | Short project rules and documentation pointers | `stacknext init --agents` |
|
|
19
|
+
| Agent Skill | Detailed evidence-first workflows | `stacknext skill install` |
|
|
20
|
+
| MCP server | Read-only runtime evidence | `stacknext mcp` |
|
|
21
|
+
|
|
22
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
23
|
+
|
|
24
|
+
## 1. Local documentation
|
|
25
|
+
|
|
26
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
27
|
+
|
|
28
|
+
<!-- coderabbit-ai-generated-section:v1:5322f074c4bd22377289b52567028ebfbba0bcf2a8678742f28a42cbc3ec8e3c -->
|
|
29
|
+
|
|
30
|
+
The seven packages listed in `DOCUMENTED_PACKAGES` ship `docs/`:
|
|
31
|
+
`@stacknext/cli`, `@stacknext/next`, `@stacknext/core`,
|
|
32
|
+
`@stacknext/regression`, `@stacknext/playwright`, `@stacknext/drizzle` and
|
|
33
|
+
`@stacknext/prisma`. Start with the CLI package's
|
|
34
|
+
`docs/index.md`; the managed block below records its actual path, which may be
|
|
35
|
+
at the workspace root. The generated [package index](packages.md) lists the
|
|
36
|
+
documented packages and which docs to read.
|
|
37
|
+
|
|
38
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
39
|
+
|
|
40
|
+
No command is needed; the docs are part of the package archive.
|
|
41
|
+
|
|
42
|
+
## 2. Managed `AGENTS.md` block
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
stacknext init --agents
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This adds a marked block to the project's `AGENTS.md`:
|
|
49
|
+
|
|
50
|
+
```md
|
|
51
|
+
<!-- BEGIN STACKNEXT AGENT RULES -->
|
|
52
|
+
...
|
|
53
|
+
<!-- END STACKNEXT AGENT RULES -->
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Safety properties:
|
|
57
|
+
|
|
58
|
+
- An existing `AGENTS.md` is never overwritten.
|
|
59
|
+
- Content outside the markers is preserved byte-for-byte (line endings are
|
|
60
|
+
preserved).
|
|
61
|
+
- Re-running updates only the block; it never duplicates it.
|
|
62
|
+
- If only one marker exists, the file is left unchanged and the command fails
|
|
63
|
+
with a clear error instead of guessing.
|
|
64
|
+
- If no `AGENTS.md` exists, one is created.
|
|
65
|
+
- `--skip-agents` is an explicit opt-out for scripts. Agent setup is off by
|
|
66
|
+
default.
|
|
67
|
+
|
|
68
|
+
The block points agents at available package docs and the current StackNext
|
|
69
|
+
version. If no package docs are found, it says so instead of referencing
|
|
70
|
+
nonexistent paths.
|
|
71
|
+
|
|
72
|
+
## 3. Agent Skill
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
stacknext skill install --client opencode
|
|
76
|
+
stacknext skill install --client codex
|
|
77
|
+
stacknext skill install --client claude-code
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
| Client | Project path |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| OpenCode | `.opencode/skills/stacknext-debugging` |
|
|
83
|
+
| Codex | `.agents/skills/stacknext-debugging` |
|
|
84
|
+
| Claude Code | `.claude/skills/stacknext-debugging` |
|
|
85
|
+
|
|
86
|
+
`stacknext skill path` prints the bundled directory and version. `--force`
|
|
87
|
+
replaces an existing skill copy; without it, an existing destination is left
|
|
88
|
+
untouched and the command exits 1.
|
|
89
|
+
|
|
90
|
+
## 4. MCP server
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
stacknext dev # collector must be running
|
|
94
|
+
stacknext mcp # stdio server
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
98
|
+
|
|
99
|
+
<!-- coderabbit-ai-generated-section:v1:95c82a21ffd412dd8a9b62c44104a3f93a3959e02214cd944fb055ce979258e0 -->
|
|
100
|
+
|
|
101
|
+
Configure the client to start the command from the app directory. See
|
|
102
|
+
[commands](commands.md) for `stacknext mcp` and
|
|
103
|
+
[troubleshooting](troubleshooting.md) for client connection issues.
|
|
104
|
+
|
|
105
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
106
|
+
|
|
107
|
+
## Recommended order
|
|
108
|
+
|
|
109
|
+
1. Install and initialize StackNext.
|
|
110
|
+
2. Run `stacknext init --agents` if the project uses `AGENTS.md`.
|
|
111
|
+
3. Install the skill for the client you use.
|
|
112
|
+
4. Configure the MCP server.
|
|
113
|
+
5. Start `stacknext dev` before the agent investigates.
|
|
114
|
+
|
|
115
|
+
## What StackNext does not do
|
|
116
|
+
|
|
117
|
+
- It does not modify `CLAUDE.md`, `.cursor/rules`, Copilot instructions or
|
|
118
|
+
global client configuration.
|
|
119
|
+
- It does not install the skill without an explicit client flag.
|
|
120
|
+
- It does not add MCP configuration automatically to arbitrary clients.
|
package/docs/commands.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Commands
|
|
3
|
+
description: Complete reference for the stacknext CLI commands and options.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commands
|
|
7
|
+
|
|
8
|
+
Run `stacknext <command> --help` for the installed version's exact flags. All
|
|
9
|
+
commands run from a Next.js application directory unless stated otherwise.
|
|
10
|
+
|
|
11
|
+
## `stacknext init`
|
|
12
|
+
|
|
13
|
+
Configure a project. Writes `stacknext.config.json` and generated
|
|
14
|
+
`instrumentation.ts`/`.js` only when absent; never overwrites user files.
|
|
15
|
+
|
|
16
|
+
| Option | Meaning |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `--install` | Install `@stacknext/next` with the detected package manager. |
|
|
19
|
+
| `--agents` | Add or update the managed StackNext block in `AGENTS.md`. |
|
|
20
|
+
| `--skip-agents` | Explicitly skip the managed block (the default). |
|
|
21
|
+
|
|
22
|
+
## `stacknext dev`
|
|
23
|
+
|
|
24
|
+
Start the loopback collector and dashboard, then run the app's `dev` script.
|
|
25
|
+
|
|
26
|
+
| Option | Meaning |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `--open` | Open the dashboard in the default browser. |
|
|
29
|
+
| `--quiet` | Reduce startup output. |
|
|
30
|
+
| `--token <token>` | Use an existing token (16+ characters). |
|
|
31
|
+
|
|
32
|
+
`dev` writes `.stacknext/run.json` with mode `0600` and removes it on graceful
|
|
33
|
+
shutdown. Stop it with SIGINT/SIGTERM, not `SIGKILL`.
|
|
34
|
+
|
|
35
|
+
## `stacknext status`
|
|
36
|
+
|
|
37
|
+
Print the runtime, collector connection and current counts.
|
|
38
|
+
|
|
39
|
+
| Option | Meaning |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `--json` | Machine-readable output. |
|
|
42
|
+
|
|
43
|
+
## `stacknext doctor`
|
|
44
|
+
|
|
45
|
+
Check Node.js, Next.js, the App Router, config, instrumentation, adapters,
|
|
46
|
+
dashboard build, runtime file permissions and collector health.
|
|
47
|
+
|
|
48
|
+
| Option | Meaning |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `--json` | Machine-readable result with `checks`, `failures`, `warnings`. |
|
|
51
|
+
|
|
52
|
+
Exit code is `1` when a check fails.
|
|
53
|
+
|
|
54
|
+
## `stacknext coverage`
|
|
55
|
+
|
|
56
|
+
Show what the current retention window observed. Evidence, not a score.
|
|
57
|
+
|
|
58
|
+
| Option | Meaning |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `--json` | Machine-readable `CoverageReport`. |
|
|
61
|
+
|
|
62
|
+
## `stacknext diagnose`
|
|
63
|
+
|
|
64
|
+
List deterministic findings or show one finding.
|
|
65
|
+
|
|
66
|
+
| Option | Meaning |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `--id <finding-id>` | Show one finding and its related trace. |
|
|
69
|
+
| `--trace-id <trace-id>` | Findings that reference a trace. |
|
|
70
|
+
| `--category <category>` | `database`, `http`, `performance`, `errors`, `runtime`. |
|
|
71
|
+
| `--severity <severity>` | `info`, `warning`, `error`. |
|
|
72
|
+
| `--status <status>` | `observed`, `possible`, `insufficient-evidence`. |
|
|
73
|
+
| `--rule <rule-id>` | One of the six rule ids. |
|
|
74
|
+
| `--route <route>` | Route substring. |
|
|
75
|
+
| `--since <time>` / `--until <time>` | ISO timestamp or epoch ms. |
|
|
76
|
+
| `--limit <n>` / `--offset <n>` | Pagination. |
|
|
77
|
+
| `-q, --q <text>` | Search text. |
|
|
78
|
+
| `--json` | Machine-readable output. |
|
|
79
|
+
|
|
80
|
+
## `stacknext capture`
|
|
81
|
+
|
|
82
|
+
Run a test command and save correlated telemetry as a run.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
stacknext capture --name baseline -- pnpm exec playwright test --workers=1
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
| Option | Meaning |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `--name <name>` | Run name. |
|
|
91
|
+
| `--project <name>` | Project name override. |
|
|
92
|
+
| `--attach` | Require an existing `stacknext dev` collector. |
|
|
93
|
+
| `--url <url>` | Attach to a specific loopback collector. |
|
|
94
|
+
| `--token <token>` | Token for `--url`. |
|
|
95
|
+
| `--json` | Machine-readable result. |
|
|
96
|
+
| `--quiet` | Reduce output. |
|
|
97
|
+
|
|
98
|
+
A successful child with incomplete telemetry exits `3`.
|
|
99
|
+
|
|
100
|
+
## `stacknext runs`
|
|
101
|
+
|
|
102
|
+
| Command | Options | Purpose |
|
|
103
|
+
| --- | --- | --- |
|
|
104
|
+
| `runs list` | `--limit`, `--offset`, `--json` | List live and saved runs. |
|
|
105
|
+
| `runs show <run-id>` | `--json` | Show one run and its samples. |
|
|
106
|
+
|
|
107
|
+
## `stacknext baseline`
|
|
108
|
+
|
|
109
|
+
| Command | Options | Purpose |
|
|
110
|
+
| --- | --- | --- |
|
|
111
|
+
| `baseline save <run-id>` | `--name <name>`, `--notes <text>`, `--overwrite`, `--json` | Save a completed run. |
|
|
112
|
+
| `baseline list` | `--limit`, `--offset`, `--json` | List baselines. |
|
|
113
|
+
| `baseline show <baseline-id>` | `--json` | Show one baseline. |
|
|
114
|
+
| `baseline remove <baseline-id>` | `--yes`, `--json` | Permanently remove one baseline. |
|
|
115
|
+
|
|
116
|
+
`--name` is required. Only a completed run can become a baseline.
|
|
117
|
+
|
|
118
|
+
## `stacknext compare`
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
stacknext compare <baseline-id> <candidate-run-id>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
| Option | Meaning |
|
|
125
|
+
| --- | --- |
|
|
126
|
+
| `--json` | Machine-readable result. |
|
|
127
|
+
| `--ignore-environment` | Compare despite environment differences (warning retained). |
|
|
128
|
+
| `--min-samples <n>` | Minimum verified samples per side (default 3). |
|
|
129
|
+
| `--duration-regression-pct <n>` | Default 20. |
|
|
130
|
+
| `--duration-regression-ms <n>` | Default 25. |
|
|
131
|
+
| `--duration-improvement-pct <n>` | Default 20. |
|
|
132
|
+
| `--duration-improvement-ms <n>` | Default 25. |
|
|
133
|
+
| `--count-regression-min <n>` | Default 1. |
|
|
134
|
+
| `--fail-on <status>` | Exit 1 for `regression`, `inconclusive` or `any`. |
|
|
135
|
+
| `--no-save` | Do not persist the comparison. |
|
|
136
|
+
|
|
137
|
+
Comparisons are report-only by default. `inconclusive` is not a pass.
|
|
138
|
+
|
|
139
|
+
## `stacknext snapshot`
|
|
140
|
+
|
|
141
|
+
| Command | Options | Purpose |
|
|
142
|
+
| --- | --- | --- |
|
|
143
|
+
| `snapshot save` | `--label`, `--json` | Freeze the current sample. |
|
|
144
|
+
| `snapshot list` | `--limit`, `--offset`, `--json` | List snapshots. |
|
|
145
|
+
| `snapshot show <id>` | `--json` | Show a summary or full payload. |
|
|
146
|
+
| `snapshot export <id>` | `-o, --output`, `--stdout`, `--force` | Export redacted JSON. |
|
|
147
|
+
| `snapshot import <file>` | `--label`, `--json` | Import and re-redact. |
|
|
148
|
+
| `snapshot delete <id>` | `--yes`, `--json` | Delete one snapshot. |
|
|
149
|
+
|
|
150
|
+
`snapshots` is an alias for `snapshot`.
|
|
151
|
+
|
|
152
|
+
## `stacknext export`
|
|
153
|
+
|
|
154
|
+
| Option | Meaning |
|
|
155
|
+
| --- | --- |
|
|
156
|
+
| `-o, --output <file>` | Output path. |
|
|
157
|
+
| `--stdout` | Write JSON to stdout. |
|
|
158
|
+
| `--force` | Overwrite an existing output file. |
|
|
159
|
+
|
|
160
|
+
## `stacknext mcp`
|
|
161
|
+
|
|
162
|
+
Start the read-only stdio MCP server.
|
|
163
|
+
|
|
164
|
+
| Option | Meaning |
|
|
165
|
+
| --- | --- |
|
|
166
|
+
| `--collector <url>` | Collector URL (defaults to runtime state). |
|
|
167
|
+
| `--token <token>` | Bearer token (defaults to runtime state). |
|
|
168
|
+
|
|
169
|
+
## `stacknext skill`
|
|
170
|
+
|
|
171
|
+
| Command | Options | Purpose |
|
|
172
|
+
| --- | --- | --- |
|
|
173
|
+
| `skill path` | `--json` | Print the bundled skill directory and version. |
|
|
174
|
+
| `skill install` | `--client opencode\|codex\|claude-code`, `--dir`, `--force`, `--json` | Copy the skill into a project. |
|
|
175
|
+
|
|
176
|
+
## `stacknext uninstall`
|
|
177
|
+
|
|
178
|
+
Print a removal plan unless `--yes` is passed.
|
|
179
|
+
|
|
180
|
+
| Option | Meaning |
|
|
181
|
+
| --- | --- |
|
|
182
|
+
| `--yes` | Apply the plan. |
|
|
183
|
+
| `--keep-config` | Preserve `stacknext.config.json`. |
|
|
184
|
+
| `--remove-data` | Remove `.stacknext` saved data (refused while running). |
|
|
185
|
+
| `--json` | Machine-readable report. |
|
|
186
|
+
|
|
187
|
+
## Global
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
stacknext --version
|
|
191
|
+
stacknext --help
|
|
192
|
+
```
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Configuration
|
|
3
|
+
description: stacknext.config.json, runtime state, ports and environment variables.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Configuration
|
|
7
|
+
|
|
8
|
+
## Project config
|
|
9
|
+
|
|
10
|
+
`stacknext init` creates `stacknext.config.json` at the application root. The
|
|
11
|
+
full schema, defaults and validation rules live in
|
|
12
|
+
the `@stacknext/core` package's `docs/configuration.md` (follow its relative path
|
|
13
|
+
in `packages.md`).
|
|
14
|
+
|
|
15
|
+
Minimal generated example:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"projectName": "my-app",
|
|
20
|
+
"dashboard": { "port": 4400 },
|
|
21
|
+
"collector": { "maxSpans": 5000, "retentionMs": 600000 },
|
|
22
|
+
"instrumentation": { "verbose": false, "captureFetch": true, "captureErrors": true },
|
|
23
|
+
"privacy": {
|
|
24
|
+
"captureHeaders": false,
|
|
25
|
+
"captureRequestBodies": false,
|
|
26
|
+
"captureSqlParameters": false,
|
|
27
|
+
"redactSensitiveData": true
|
|
28
|
+
},
|
|
29
|
+
"database": { "drizzle": false, "prisma": false },
|
|
30
|
+
"slowRequestMs": 500
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Missing fields are filled with defaults when loaded. Unknown fields are
|
|
35
|
+
rejected. Privacy capture flags must remain `false` and redaction must remain
|
|
36
|
+
`true`.
|
|
37
|
+
|
|
38
|
+
## Runtime state
|
|
39
|
+
|
|
40
|
+
While `stacknext dev` runs:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
.stacknext/
|
|
44
|
+
├── .gitignore
|
|
45
|
+
├── run.json # mode 0600, contains the bearer token
|
|
46
|
+
├── snapshots/
|
|
47
|
+
├── runs/
|
|
48
|
+
├── baselines/
|
|
49
|
+
└── comparisons/
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`run.json` is written on startup and removed on graceful shutdown. If a process
|
|
53
|
+
is killed, the file can be stale; `stacknext doctor` detects a dead pid. Never
|
|
54
|
+
commit or share `run.json`.
|
|
55
|
+
|
|
56
|
+
`.stacknext` is created with mode `0700`; saved records use `0600`.
|
|
57
|
+
|
|
58
|
+
## Ports
|
|
59
|
+
|
|
60
|
+
- Preferred dashboard/collector port: 4400.
|
|
61
|
+
- If busy, StackNext tries the next 25 ports.
|
|
62
|
+
- The example app listens on 4402 by default.
|
|
63
|
+
|
|
64
|
+
The collector binds only to `127.0.0.1` or `localhost` and rejects non-loopback
|
|
65
|
+
`Host` headers.
|
|
66
|
+
|
|
67
|
+
## Environment variables
|
|
68
|
+
|
|
69
|
+
| Variable | Used by | Meaning |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| `STACKNEXT_COLLECTOR_URL` | app, Playwright | Loopback collector URL. |
|
|
72
|
+
| `STACKNEXT_TOKEN` | app, capture | Bearer token. |
|
|
73
|
+
| `STACKNEXT_PROJECT_NAME` | app | Project name. |
|
|
74
|
+
| `STACKNEXT_SERVICE_NAME` | app | OTel service name. |
|
|
75
|
+
| `STACKNEXT_NEXT_VERSION` | app | Next.js version for environment checks. |
|
|
76
|
+
| `STACKNEXT_CAPTURE_FETCH` | app | `0` drops fetch spans. |
|
|
77
|
+
| `STACKNEXT_CAPTURE_ERRORS` | app | `0` disables error collection. |
|
|
78
|
+
| `STACKNEXT_DEBUG` | app, CLI | `1` enables debug logs. |
|
|
79
|
+
| `NEXT_OTEL_VERBOSE` | app | `1` enables documented verbose Next.js spans. |
|
|
80
|
+
| `STACKNEXT_TEST_RUN_ID` | Playwright | Active run id. |
|
|
81
|
+
| `STACKNEXT_CAPTURE_SETTLE_MS` | Playwright | Probe delay (default 500). |
|
|
82
|
+
| `STACKNEXT_CAPTURE_TIMEOUT_MS` | Playwright | Probe timeout (default 5000). |
|
|
83
|
+
| `STACKNEXT_PACK_DIR` | release scripts | Archive output directory. |
|
|
84
|
+
|
|
85
|
+
`stacknext dev` exports the first group to the Next.js child process. An
|
|
86
|
+
explicit value wins over the config; for example `NEXT_OTEL_VERBOSE=0` disables
|
|
87
|
+
verbose tracing even when `instrumentation.verbose` is `true`.
|
|
88
|
+
|
|
89
|
+
## Config ownership
|
|
90
|
+
|
|
91
|
+
- `stacknext dev` reads and validates the config.
|
|
92
|
+
- `stacknext doctor` reports invalid fields with issue paths.
|
|
93
|
+
- `stacknext uninstall` removes the config unless `--keep-config` is passed.
|
|
94
|
+
- Regression and snapshots record the resolved config with their evidence.
|
|
95
|
+
|
|
96
|
+
## Related
|
|
97
|
+
|
|
98
|
+
- [@stacknext/core configuration](../../core/docs/configuration.md)
|
|
99
|
+
- [Agent setup](agent-setup.md)
|
|
100
|
+
- [Troubleshooting](troubleshooting.md)
|
package/docs/index.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: StackNext local documentation
|
|
3
|
+
description: Entry point and package index for the version-matched StackNext documentation installed with @stacknext/cli.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# StackNext local documentation
|
|
7
|
+
|
|
8
|
+
This directory ships inside the installed `@stacknext/cli` package. It is the
|
|
9
|
+
fastest way for a developer or coding agent to find documentation that matches
|
|
10
|
+
the installed StackNext version, without network access.
|
|
11
|
+
|
|
12
|
+
## Start here
|
|
13
|
+
|
|
14
|
+
1. Read [commands](commands.md) for the CLI surface.
|
|
15
|
+
2. Read [configuration](configuration.md) for `stacknext.config.json`.
|
|
16
|
+
3. Read [agent setup](agent-setup.md) when configuring an AI client.
|
|
17
|
+
4. Read the package document for every package involved in the task.
|
|
18
|
+
|
|
19
|
+
The generated [package index](packages.md) lists the documented packages, their
|
|
20
|
+
versions, their role and the path to each package's own documentation.
|
|
21
|
+
|
|
22
|
+
## Version matching
|
|
23
|
+
|
|
24
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
25
|
+
|
|
26
|
+
<!-- coderabbit-ai-generated-section:v1:e6af214d2a4b32adab7521d25e5832f83653a892caaf39c3eddbd1f46461e7a6 -->
|
|
27
|
+
|
|
28
|
+
Packages currently shipping a `docs/` directory include package-specific
|
|
29
|
+
documentation in the same npm archive as their code. That documentation
|
|
30
|
+
therefore matches the installed version by construction.
|
|
31
|
+
|
|
32
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
33
|
+
|
|
34
|
+
Check a version before relying on an API:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
node -p "require('@stacknext/next/package.json').version"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Read the `package.json` next to the package's `docs/` directory. Do not assume
|
|
41
|
+
that this documentation matches a different release or the project's main
|
|
42
|
+
branch.
|
|
43
|
+
|
|
44
|
+
## Locating package documentation
|
|
45
|
+
|
|
46
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
47
|
+
|
|
48
|
+
<!-- coderabbit-ai-generated-section:v1:e89f29adfff1f8925389640671146bfdf24816a645149772ceb1d2ad0c5288cd -->
|
|
49
|
+
|
|
50
|
+
Package docs ship inside installed packages that currently include a `docs/` directory. Start from this CLI `docs/`
|
|
51
|
+
directory and use the relative paths in the generated
|
|
52
|
+
[package index](packages.md), because optional and internal packages may not sit
|
|
53
|
+
at the app's root `node_modules` path.
|
|
54
|
+
|
|
55
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
56
|
+
|
|
57
|
+
Direct integration packages are normally at the app root when installed there:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
node_modules/@stacknext/cli/docs/index.md
|
|
61
|
+
node_modules/@stacknext/next/docs/index.md
|
|
62
|
+
node_modules/@stacknext/drizzle/docs/index.md
|
|
63
|
+
node_modules/@stacknext/prisma/docs/index.md
|
|
64
|
+
node_modules/@stacknext/playwright/docs/index.md
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
68
|
+
|
|
69
|
+
<!-- coderabbit-ai-generated-section:v1:a2a2d1bacf1a7101a5884977852db99861650a2a201f6dffdf985fa4ec246abe -->
|
|
70
|
+
|
|
71
|
+
`@stacknext/core` and `@stacknext/regression` are installed through the CLI
|
|
72
|
+
and ship documentation. In a pnpm workspace, locate their docs using the
|
|
73
|
+
relative paths listed in `packages.md`. The CLI also installs
|
|
74
|
+
`@stacknext/diagnostics`, `@stacknext/mcp` and `@stacknext/dashboard`, which
|
|
75
|
+
do not currently ship `docs/` directories.
|
|
76
|
+
|
|
77
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
78
|
+
|
|
79
|
+
If neither the direct path nor the relative index path exists, the package is
|
|
80
|
+
not available to this project. Do not invent its documentation path or assume
|
|
81
|
+
its APIs are available.
|
|
82
|
+
|
|
83
|
+
## Which package to read
|
|
84
|
+
|
|
85
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
86
|
+
|
|
87
|
+
<!-- coderabbit-ai-generated-section:v1:cce8643ce7fa90852e67d36250d2daa286bf00bf29c08506b2ca194409f5b5a8 -->
|
|
88
|
+
|
|
89
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
90
|
+
|
|
91
|
+
<!-- coderabbit-ai-generated-section:v1:4ccde9b676836098da0c0e0810b43c6306a967030d387f11f30aed3a2b950eab -->
|
|
92
|
+
|
|
93
|
+
| Task | Read |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| Install, configure or run StackNext | `cli`, `next` |
|
|
96
|
+
| Change `instrumentation.ts` or manual spans | `next` |
|
|
97
|
+
| Work with shared types, redaction, transport or snapshots | `core` |
|
|
98
|
+
| Change or interpret diagnostic findings | CLI [commands](commands.md) |
|
|
99
|
+
| Work with Playwright capture, baselines or comparisons | `playwright`, `regression` |
|
|
100
|
+
| Add Drizzle query evidence | `drizzle` |
|
|
101
|
+
| Add Prisma query evidence | `prisma` |
|
|
102
|
+
| Configure an MCP client or use runtime evidence | CLI [agent setup](agent-setup.md) |
|
|
103
|
+
|
|
104
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
105
|
+
|
|
106
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
107
|
+
|
|
108
|
+
## Optional and internal packages
|
|
109
|
+
|
|
110
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
111
|
+
|
|
112
|
+
<!-- coderabbit-ai-generated-section:v1:a2dd9b11290d93c4f272aa68aa40252cdb2bb1e42b5f87e52a85da57d3345086 -->
|
|
113
|
+
|
|
114
|
+
- **Public integration packages:** `@stacknext/cli`, `@stacknext/next`,
|
|
115
|
+
`@stacknext/playwright`, `@stacknext/drizzle`, `@stacknext/prisma`.
|
|
116
|
+
- **Installed by the CLI:** `@stacknext/core`, `@stacknext/diagnostics`,
|
|
117
|
+
`@stacknext/regression`, `@stacknext/mcp`, `@stacknext/dashboard`.
|
|
118
|
+
- Optional packages are only present when the project installed them. Never
|
|
119
|
+
instruct an agent to read a package directory that is not installed.
|
|
120
|
+
- Internal packages that ship `docs/` are documented for maintainers;
|
|
121
|
+
applications should not install them directly.
|
|
122
|
+
|
|
123
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
124
|
+
|
|
125
|
+
## Rules for coding agents
|
|
126
|
+
|
|
127
|
+
- Prefer this local documentation over model memory or online documentation for
|
|
128
|
+
the installed version.
|
|
129
|
+
- Verify the package version before using an API or example.
|
|
130
|
+
- Do not assume undocumented exports, configuration keys or integrations exist.
|
|
131
|
+
- For runtime investigation, use the StackNext MCP tools where available.
|
|
132
|
+
- Follow the installed `stacknext-debugging` Agent Skill for evidence-first
|
|
133
|
+
workflows.
|
|
134
|
+
- Treat diagnostic findings as evidence, not confirmed root causes.
|
|
135
|
+
- Treat `inconclusive` regression comparisons as inconclusive, not passes.
|
|
136
|
+
|
|
137
|
+
## More documentation
|
|
138
|
+
|
|
139
|
+
- [Agent setup](agent-setup.md) — `stacknext init --agents`, MCP and skills.
|
|
140
|
+
- [Skill installation](skill.md) — supported clients and paths.
|
|
141
|
+
- [Troubleshooting](troubleshooting.md) — missing telemetry, ports and clients.
|
|
142
|
+
- [Package index](packages.md) — generated list of installed package docs.
|
package/docs/packages.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Installed package documentation
|
|
3
|
+
description: Generated index of the documented StackNext packages and their local documentation paths.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- Generated by scripts/sync-docs.mjs. Do not edit this file. -->
|
|
7
|
+
|
|
8
|
+
# Installed package documentation
|
|
9
|
+
|
|
10
|
+
This index is generated from the packages that ship documentation. It does
|
|
11
|
+
not mean every package is installed in a project. Check the path before
|
|
12
|
+
reading: optional packages can be absent.
|
|
13
|
+
|
|
14
|
+
Versions in this table are the versions of the package that produced this
|
|
15
|
+
archive. Read the `version` field in the package.json next to the docs
|
|
16
|
+
directory to confirm the installed version.
|
|
17
|
+
|
|
18
|
+
| Package | Version | Visibility | Role | Documentation |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| `@stacknext/cli` | 0.11.0 | public | CLI, collector and dashboard host | `index.md` |
|
|
21
|
+
| `@stacknext/next` | 0.11.0 | public | Next.js instrumentation | `../../next/docs/index.md` |
|
|
22
|
+
| `@stacknext/core` | 0.11.0 | internal | Shared base package | `../../core/docs/index.md` |
|
|
23
|
+
| `@stacknext/diagnostics` | 0.11.0 | internal | Diagnostic engine | `@stacknext/diagnostics/docs/index.md (resolve from CLI)` |
|
|
24
|
+
| `@stacknext/regression` | 0.11.0 | internal | Regression data model | `../../regression/docs/index.md` |
|
|
25
|
+
| `@stacknext/playwright` | 0.11.0 | public | Playwright fixture | `../../playwright/docs/index.md` |
|
|
26
|
+
| `@stacknext/drizzle` | 0.11.0 | public | Database adapter | `../../drizzle/docs/index.md` |
|
|
27
|
+
| `@stacknext/prisma` | 0.11.0 | public | Database adapter | `../../prisma/docs/index.md` |
|
|
28
|
+
| `@stacknext/mcp` | 0.11.0 | internal | Read-only MCP server | `@stacknext/mcp/docs/index.md (resolve from CLI)` |
|
|
29
|
+
| `@stacknext/dashboard` | 0.11.0 | internal | Static dashboard | `@stacknext/dashboard/docs/index.md (resolve from CLI)` |
|
|
30
|
+
|
|
31
|
+
## How to use this index
|
|
32
|
+
|
|
33
|
+
Starting from `node_modules/@stacknext/cli/docs/`, read `index.md`. For every
|
|
34
|
+
other package with a relative path, use the table. For example:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
node_modules/@stacknext/cli/docs/index.md
|
|
38
|
+
../../next/docs/index.md # from node_modules/@stacknext/cli/docs/
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Do not assume an internal package is at the app-root `node_modules` path.
|
|
42
|
+
For diagnostics, MCP and dashboard, resolve the package from the installed
|
|
43
|
+
CLI so the docs match its dependency version, including hoisted installs.
|
|
44
|
+
Run this from the project directory:
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
const { createRequire } = require('node:module')
|
|
48
|
+
const { dirname, join } = require('node:path')
|
|
49
|
+
const cliRequire = createRequire(require.resolve('@stacknext/cli/package.json'))
|
|
50
|
+
for (const name of ['@stacknext/diagnostics', '@stacknext/mcp', '@stacknext/dashboard']) {
|
|
51
|
+
console.log(join(dirname(cliRequire.resolve(`${name}/package.json`)), 'docs', 'index.md'))
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If resolution fails, the dependency is unavailable. Do not instruct an
|
|
56
|
+
agent to read a missing package directory.
|
|
57
|
+
|
|
58
|
+
## Public, optional and internal packages
|
|
59
|
+
|
|
60
|
+
- **Public integration packages** are intended for direct installation when
|
|
61
|
+
the project uses the corresponding feature.
|
|
62
|
+
- **Internal packages** are installed as dependencies of the CLI or another
|
|
63
|
+
package. Their docs are for maintainers and advanced contributors.
|
|
64
|
+
- Optional packages (`@stacknext/playwright`, `@stacknext/drizzle` and
|
|
65
|
+
`@stacknext/prisma`) are only present when explicitly installed.
|
|
66
|
+
|
|
67
|
+
## Related
|
|
68
|
+
|
|
69
|
+
- `index.md` — local documentation entry point.
|
|
70
|
+
- `agent-setup.md` — managed AGENTS.md, MCP and skill setup.
|
|
71
|
+
- `commands.md` — CLI reference.
|
package/docs/skill.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Agent Skill
|
|
3
|
+
description: The bundled stacknext-debugging skill, supported clients and installation behavior.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Skill
|
|
7
|
+
|
|
8
|
+
`@stacknext/cli` ships the portable Agent Skill at:
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
node_modules/@stacknext/cli/skills/stacknext-debugging/
|
|
12
|
+
├── SKILL.md
|
|
13
|
+
└── references/
|
|
14
|
+
├── documentation.md
|
|
15
|
+
├── setup.md
|
|
16
|
+
├── tools.md
|
|
17
|
+
└── workflows.md
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The repository's `skills/stacknext-debugging/` directory is the canonical
|
|
21
|
+
source. It is copied into the CLI archive before packing.
|
|
22
|
+
|
|
23
|
+
## What it covers
|
|
24
|
+
|
|
25
|
+
- local documentation discovery and version checks;
|
|
26
|
+
- the twenty read-only MCP tools;
|
|
27
|
+
- evidence-first workflows for errors, slow requests, database activity,
|
|
28
|
+
diagnostic findings, regression records and snapshots;
|
|
29
|
+
- mandatory reasoning rules: observation versus causation, null durations,
|
|
30
|
+
overlapping spans, coverage gaps, `inconclusive` comparisons and the
|
|
31
|
+
difference between a snapshot and live telemetry.
|
|
32
|
+
|
|
33
|
+
The skill does not duplicate full package API references. It points to the
|
|
34
|
+
installed package docs for those.
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
stacknext skill path
|
|
40
|
+
stacknext skill path --json
|
|
41
|
+
stacknext skill install --client opencode
|
|
42
|
+
stacknext skill install --client codex
|
|
43
|
+
stacknext skill install --client claude-code
|
|
44
|
+
stacknext skill install --client codex --dir ./apps/my-app
|
|
45
|
+
stacknext skill install --client codex --force
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Behavior
|
|
49
|
+
|
|
50
|
+
- `skill path` prints the bundled directory, or `{ path, version }` with
|
|
51
|
+
`--json`.
|
|
52
|
+
- `skill install` copies the whole directory into the client's project path.
|
|
53
|
+
- An existing destination is not replaced without `--force`; the command exits
|
|
54
|
+
`1` and reports the path.
|
|
55
|
+
- `--dir` selects the project root; it defaults to the current directory.
|
|
56
|
+
- Unsupported clients throw with the three supported names.
|
|
57
|
+
|
|
58
|
+
## Version alignment
|
|
59
|
+
|
|
60
|
+
`SKILL.md` frontmatter contains `metadata.version`, which must equal the
|
|
61
|
+
StackNext package version. The release workflow and package archive validation
|
|
62
|
+
enforce this. The repository skill is updated by the release preparation script
|
|
63
|
+
along with package versions.
|
|
64
|
+
|
|
65
|
+
## Portable format
|
|
66
|
+
|
|
67
|
+
`SKILL.md` follows the Agent Skills specification with YAML frontmatter and a
|
|
68
|
+
concise body. Details live in `references/`. Keep it portable: no
|
|
69
|
+
client-specific syntax in the canonical skill and no claim of support without a
|
|
70
|
+
recorded test in `docs/agent-testing.md`.
|
|
71
|
+
|
|
72
|
+
## Client paths
|
|
73
|
+
|
|
74
|
+
See [Agent setup](agent-setup.md) for the project paths and the recommended
|
|
75
|
+
installation order.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Troubleshooting
|
|
3
|
+
description: Fix missing telemetry, port conflicts, stale runtime state, MCP and agent setup problems.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Troubleshooting
|
|
7
|
+
|
|
8
|
+
## Start with doctor
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
stacknext doctor
|
|
12
|
+
stacknext doctor --json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
It checks Node.js, Next.js, the App Router, configuration, instrumentation,
|
|
16
|
+
adapters, dashboard build, runtime file permissions and collector health. It
|
|
17
|
+
exits `1` when a check fails.
|
|
18
|
+
|
|
19
|
+
## Dashboard is empty
|
|
20
|
+
|
|
21
|
+
1. Confirm you started the app with `stacknext dev`, not `next dev`.
|
|
22
|
+
2. Make a request after the app is ready.
|
|
23
|
+
3. Run `stacknext status --json` and check `runtime` and `connections`.
|
|
24
|
+
4. Run `stacknext coverage`. `active` means connected but not exercised;
|
|
25
|
+
`configured` means no app is connected.
|
|
26
|
+
5. Inspect `instrumentation.ts` and the app logs with `STACKNEXT_DEBUG=1`.
|
|
27
|
+
|
|
28
|
+
## Port already in use
|
|
29
|
+
|
|
30
|
+
The dashboard prefers 4400 and tries the next 25 ports. Check the URL printed by
|
|
31
|
+
`stacknext dev`. The example app uses 4402 by default. Stop orphaned `next dev`
|
|
32
|
+
processes on ports 4400–4425 before restarting.
|
|
33
|
+
|
|
34
|
+
## Stale `.stacknext/run.json`
|
|
35
|
+
|
|
36
|
+
If `stacknext dev` crashes or is killed, `doctor` reports a stale pid. Restart
|
|
37
|
+
`stacknext dev`; it replaces the state. Do not reuse or share the token.
|
|
38
|
+
|
|
39
|
+
## Stop the server cleanly
|
|
40
|
+
|
|
41
|
+
Send SIGINT or SIGTERM to `stacknext dev`. It closes the collector, stops the
|
|
42
|
+
app child and removes `.stacknext/run.json`. `SIGKILL` skips cleanup and can
|
|
43
|
+
leave the state file behind.
|
|
44
|
+
|
|
45
|
+
## MCP client cannot connect
|
|
46
|
+
|
|
47
|
+
- Start `stacknext dev` before the client starts the server.
|
|
48
|
+
- Run `stacknext mcp` from the app directory, or pass `--collector` and
|
|
49
|
+
`--token`.
|
|
50
|
+
- Ensure stdout is not mixed with logs. The server writes logs to stderr.
|
|
51
|
+
- Check that the collector URL is loopback. Remote URLs are rejected.
|
|
52
|
+
- Restart the client after changing its MCP configuration.
|
|
53
|
+
|
|
54
|
+
## `stacknext init --agents` fails
|
|
55
|
+
|
|
56
|
+
- If `AGENTS.md` contains only one of the two markers, the command refuses to
|
|
57
|
+
guess and leaves the file unchanged. Restore or remove the partial block.
|
|
58
|
+
- Check file permissions.
|
|
59
|
+
- `--skip-agents` skips the operation; it is the default when `--agents` is not
|
|
60
|
+
passed.
|
|
61
|
+
|
|
62
|
+
## Skill installation refuses to overwrite
|
|
63
|
+
|
|
64
|
+
The destination already exists. Review it, then use `--force` to replace it, or
|
|
65
|
+
choose another project directory with `--dir`.
|
|
66
|
+
|
|
67
|
+
## Capture exits 3
|
|
68
|
+
|
|
69
|
+
The test command succeeded but telemetry correlation is incomplete. Inspect
|
|
70
|
+
`stacknext runs show <run-id> --json` and the sample reasons. Do not interpret
|
|
71
|
+
the run as a pass. See
|
|
72
|
+
`node_modules/@stacknext/playwright/docs/troubleshooting.md`.
|
|
73
|
+
|
|
74
|
+
## Verbose tracing is slower
|
|
75
|
+
|
|
76
|
+
`NEXT_OTEL_VERBOSE=1` adds spans and dev-server work. Use it for short
|
|
77
|
+
investigations, not permanently. Set `NEXT_OTEL_VERBOSE=0` to override
|
|
78
|
+
`instrumentation.verbose: true`.
|
|
79
|
+
|
|
80
|
+
## Package versions do not match
|
|
81
|
+
|
|
82
|
+
Run `stacknext --version` and compare all `@stacknext/*` entries in the lockfile.
|
|
83
|
+
All ten packages are released at one version. Mismatched versions are
|
|
84
|
+
unsupported.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacknext/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Local-first runtime debugging, diagnostics and Playwright regression testing for Next.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
-
"skills"
|
|
12
|
+
"skills",
|
|
13
|
+
"docs"
|
|
13
14
|
],
|
|
14
15
|
"main": "./dist/index.js",
|
|
15
16
|
"types": "./dist/index.d.ts",
|
|
@@ -22,11 +23,11 @@
|
|
|
22
23
|
"./package.json": "./package.json"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@stacknext/core": "0.
|
|
26
|
-
"@stacknext/dashboard": "0.
|
|
27
|
-
"@stacknext/diagnostics": "0.
|
|
28
|
-
"@stacknext/mcp": "0.
|
|
29
|
-
"@stacknext/regression": "0.
|
|
26
|
+
"@stacknext/core": "0.11.0",
|
|
27
|
+
"@stacknext/dashboard": "0.11.0",
|
|
28
|
+
"@stacknext/diagnostics": "0.11.0",
|
|
29
|
+
"@stacknext/mcp": "0.11.0",
|
|
30
|
+
"@stacknext/regression": "0.11.0",
|
|
30
31
|
"commander": "14.0.3",
|
|
31
32
|
"zod": "4.6.7"
|
|
32
33
|
},
|
|
@@ -4,7 +4,7 @@ description: Investigate Next.js App Router runtime behavior with StackNext's lo
|
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Next.js 15 or 16 App Router on the Node.js runtime, with a local StackNext collector. No cloud account, AI API key, or remote service is required.
|
|
6
6
|
metadata:
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.11.0"
|
|
8
8
|
author: StackNext
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -77,6 +77,24 @@ run SQL or call an AI service.
|
|
|
77
77
|
route/method plus 30-second fallback. Say "correlated" rather than "caused"
|
|
78
78
|
when the link is fallback-based.
|
|
79
79
|
|
|
80
|
+
## Documentation sources
|
|
81
|
+
|
|
82
|
+
The package API reference lives in the installed npm archives, not in this
|
|
83
|
+
skill. Before using an API, configuration key or command that you are not
|
|
84
|
+
certain about:
|
|
85
|
+
|
|
86
|
+
1. Read the CLI package's `docs/index.md` and `docs/packages.md`. Resolve it from
|
|
87
|
+
the app directory; in a workspace the CLI may be hoisted to the root.
|
|
88
|
+
2. Read the docs for every package involved in the task.
|
|
89
|
+
3. Confirm the version in the package.json next to those docs. Prefer the local
|
|
90
|
+
docs over the website or model memory; they match the installed version.
|
|
91
|
+
4. If a documented path does not resolve, that package is not available. Do not
|
|
92
|
+
reference it or assume its APIs are available.
|
|
93
|
+
|
|
94
|
+
This skill owns investigation procedure and reasoning rules. Package docs own
|
|
95
|
+
the technical reference. See `references/documentation.md` for discovery,
|
|
96
|
+
version checks and optional-package handling.
|
|
97
|
+
|
|
80
98
|
## Tool map
|
|
81
99
|
|
|
82
100
|
| Goal | Tool |
|
|
@@ -304,3 +322,4 @@ as current live telemetry.
|
|
|
304
322
|
- `references/tools.md` — tool arguments, response shapes and `meta`.
|
|
305
323
|
- `references/workflows.md` — detailed investigation playbooks and report examples.
|
|
306
324
|
- `references/setup.md` — install, MCP configuration, skill locations and troubleshooting.
|
|
325
|
+
- `references/documentation.md` — local package docs, version checks and optional packages.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Documentation discovery
|
|
2
|
+
|
|
3
|
+
Package documentation ships inside each installed StackNext npm package. It
|
|
4
|
+
describes the installed version, not the latest website release.
|
|
5
|
+
|
|
6
|
+
## Read in this order
|
|
7
|
+
|
|
8
|
+
1. The CLI package's `docs/index.md` — entry point and index. Resolve it from the
|
|
9
|
+
app directory; in a workspace it may be hoisted to the workspace root.
|
|
10
|
+
2. The CLI package's `docs/packages.md` — package table with versions,
|
|
11
|
+
visibility, roles and relative paths.
|
|
12
|
+
3. The `docs/index.md` of every package involved in the task.
|
|
13
|
+
|
|
14
|
+
The paths in `packages.md` are relative to the CLI docs directory. Check that a
|
|
15
|
+
directory exists before reading it. Optional packages (`@stacknext/playwright`,
|
|
16
|
+
`@stacknext/drizzle`, `@stacknext/prisma`) may be absent.
|
|
17
|
+
|
|
18
|
+
## Confirm the version
|
|
19
|
+
|
|
20
|
+
Read the package's own `package.json` next to the docs directory, or ask the
|
|
21
|
+
user to run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
node -p "require('@stacknext/next/package.json').version"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If the local docs are missing, do not invent API details. Say which package
|
|
28
|
+
version is installed and use only behavior visible in the installed
|
|
29
|
+
implementation or tests. The website at the project repository is a conceptual
|
|
30
|
+
and cross-package reference; it may describe a newer release.
|
|
31
|
+
|
|
32
|
+
## What each reference owns
|
|
33
|
+
|
|
34
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
35
|
+
|
|
36
|
+
<!-- coderabbit-ai-generated-section:v1:288ca3f0efa2b410cf1f3bece0fab59bbb1407b61e1f2e543eda24a9230e58d8 -->
|
|
37
|
+
|
|
38
|
+
<!-- coderabbit-ai-generated:v1 -->
|
|
39
|
+
|
|
40
|
+
<!-- coderabbit-ai-generated-section:v1:a8fa35dd707530ebdf92d07c80b1058c90cff608b5fd3bf71a1c4876289a1632 -->
|
|
41
|
+
|
|
42
|
+
| Need | Read |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| Configuration, wire types, redaction | `@stacknext/core/docs` |
|
|
45
|
+
| Registration, manual spans, actions | `@stacknext/next/docs` |
|
|
46
|
+
| Diagnostic rules and evidence | `@stacknext/diagnostics/docs` (only when the package ships documentation) |
|
|
47
|
+
| Capture, baseline and comparison formats | `@stacknext/regression/docs` |
|
|
48
|
+
| Fixture and correlation | `@stacknext/playwright/docs` |
|
|
49
|
+
| CLI commands and local index | `@stacknext/cli/docs` |
|
|
50
|
+
| MCP tools, prompts and security | `@stacknext/mcp/docs` (only when the package ships documentation) |
|
|
51
|
+
| Query adapters | `@stacknext/drizzle/docs`, `@stacknext/prisma/docs` |
|
|
52
|
+
|
|
53
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
54
|
+
|
|
55
|
+
<!-- /coderabbit-ai-generated:v1 -->
|
|
56
|
+
|
|
57
|
+
The skill owns procedures. The package docs own API details. Do not copy large
|
|
58
|
+
API tables into a report; cite the package and page you used.
|
|
59
|
+
|
|
60
|
+
## If the project has no local docs
|
|
61
|
+
|
|
62
|
+
Older installations may not include `docs/` in the package archive. Then:
|
|
63
|
+
|
|
64
|
+
1. Tell the user the installed package lacks local documentation.
|
|
65
|
+
2. Use `stacknext` CLI help and the installed TypeScript declarations.
|
|
66
|
+
3. Do not assume an API exists because the website shows it for another
|
|
67
|
+
version.
|
|
68
|
+
4. Suggest upgrading the packages, or running `stacknext init --agents` after
|
|
69
|
+
upgrading to refresh managed project instructions.
|
|
@@ -15,9 +15,15 @@ pnpm exec stacknext dev
|
|
|
15
15
|
`dev` starts the collector and the app's own `dev` script, then writes
|
|
16
16
|
`.stacknext/run.json` with a short-lived bearer token. Leave it running.
|
|
17
17
|
|
|
18
|
-
If the project is not set up yet
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
If the project is not set up yet:
|
|
19
|
+
|
|
20
|
+
1. Read the CLI package's `docs/index.md` and the Next.js package's
|
|
21
|
+
`docs/installation.md` for the installed version. Resolve the CLI from the app
|
|
22
|
+
directory; it may be hoisted to the workspace root.
|
|
23
|
+
2. Run `pnpm exec stacknext init` in the app. Add `--agents` if the user wants a
|
|
24
|
+
managed StackNext block in `AGENTS.md`.
|
|
25
|
+
3. In a StackNext source checkout, run `pnpm install && pnpm build` first and
|
|
26
|
+
see `docs/getting-started/quickstart.md`.
|
|
21
27
|
|
|
22
28
|
Check the collector and instrumentation:
|
|
23
29
|
|