Order of operations
- Start
stacknext dev. - Install the skill and managed instructions.
- Configure MCP.
- Ask the agent to call
get_project_summarybefore investigating.
.stacknext/run.json contains a bearer token and must
never be committed.
Managed AGENTS.md instructions
<!-- BEGIN STACKNEXT AGENT RULES --> and
<!-- END STACKNEXT AGENT RULES -->. Existing content is preserved, repeated
runs are idempotent, and line endings are kept. --skip-agents explicitly skips
the block, which is also the default.
The block tells an agent to:
- Read the local documentation entry point listed in the block.
- Read the docs for each StackNext package involved in the task, listing only packages that are actually installed.
- Confirm the installed version in the adjacent
package.json. - Prefer local docs over external docs or model memory.
- Not assume undocumented APIs, configuration or internal packages exist.
- Use the read-only MCP tools for runtime investigation.
- Follow the
stacknext-debuggingskill for deeper workflows. - Treat diagnostics and comparisons as evidence, not confirmed causes.
- Verify against the installed implementation and tests.
- A missing
AGENTS.mdis created. - An existing file is never overwritten.
- Content outside the markers is preserved byte-for-byte, including CRLF.
- The block is replaced in place on later runs.
- Duplicate or partial markers cause a clear error; the file is not modified.
- No client config or global instruction file is touched.
--agents writes AGENTS.md only. Tools that read CLAUDE.md,
.cursor/rules/, GEMINI.md or a proprietary file need a manual copy of the
same block. StackNext does not silently modify files it does not own.
Re-run stacknext init --agents after upgrading StackNext. Only the managed
block changes. To remove it, delete the block between the markers, or delete
AGENTS.md when it contains nothing else.
Agent Skill
The skill ships inside
@stacknext/cli; the command copies the whole directory,
including references/. Do not copy only SKILL.md. --force replaces an
existing copy and stacknext skill path prints the bundled location. The skill
is also available from
skills/stacknext-debugging
in the repository.
It covers runtime errors, slow requests, database activity, diagnostics,
regression evidence, snapshots, coverage checks and the evidence-first report
format. It does not grant new capabilities, replace the MCP server or duplicate
the package API reference. After upgrading StackNext, reinstall the skill with
--force so the workflow and tool list match.
MCP server configuration
Startstacknext dev first, then configure the client to run:
.stacknext/run.json and exposes twenty read-only
tools plus five prompts. See the MCP server for the generic JSON form and
the MCP tools reference for the full surface.
OpenCode
Create or editopencode.json in the project root. OpenCode V2 stores servers
under mcp.servers:
codemode: false exposes the twenty StackNext tools directly instead of
grouping them behind OpenCode’s Code Mode. If you prefer Code Mode, omit the
field and call the grouped tools as tools.stacknext.<tool>.
You can also add the entry with the CLI:
opencode mcp list. OpenCode watches configuration
files and applies changes without a restart.
Codex
Add the server to your Codex configuration (~/.codex/config.toml for a user
configuration, or the project configuration file your Codex version supports):
instructions during initialization.
Claude Code
Add the server with the Claude Code CLI:.mcp.json:
CLAUDE.md for project instructions. If you want the managed
StackNext block there, copy it from AGENTS.md after running
init --agents. Do not put the bearer token in CLAUDE.md or .mcp.json.
Supported clients
Any MCP client that can launch a local stdio server can use the same command.
Do not use SSE, HTTP or a remote proxy. The server refuses non-loopback
collector URLs, and the collector binds to loopback only.
Verify
In a client session, ask:meta.connection.instrumentation: "connected". If the tool
does not appear, check the client’s MCP logs and the absolute path. Restart the
client after restarting stacknext dev, because the token changes.
Boundaries
- Every MCP tool is read-only. The server cannot capture, save, compare, delete or edit anything.
- The skill shapes an investigation but cannot bypass redaction or add capabilities.
- The connected client may log or transmit tool results under its own policy. StackNext does not control the client. Review that policy before using a hosted model with project telemetry.
- A client is listed as supported only after a recorded end-to-end check. See agent compatibility testing.