Skip to content

docs: DOC-1395: Devin skill to write better code examples - #8340

Open
elijahpetty wants to merge 2 commits into
deephaven:mainfrom
elijahpetty:epetty-1395-better-code-skill
Open

docs: DOC-1395: Devin skill to write better code examples#8340
elijahpetty wants to merge 2 commits into
deephaven:mainfrom
elijahpetty:epetty-1395-better-code-skill

Conversation

@elijahpetty

Copy link
Copy Markdown
Contributor

This skill has the agent actually run code examples with Deephaven MCP to make sure they work before handing them off to a human.

@elijahpetty elijahpetty self-assigned this Aug 7, 2026
@elijahpetty elijahpetty added documentation Improvements or additions to documentation NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. labels Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

No docs changes detected for 0151639

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Devin guidance for creating and validating Deephaven documentation examples against live workers.

Changes:

  • Adds a detailed verification and debugging skill.
  • Adds a concise workflow entry point.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
.devin/workflows/verified-example.md Defines the verification workflow.
.devin/skills/verified-code-example/SKILL.md Provides worker, execution, diagnosis, and cleanup instructions.
Suppressed comments (4)

.devin/skills/verified-code-example/SKILL.md:46

  • Both MCP tools accept the session as id; session_id is not part of their contracts. As written, environment discovery fails for every selected worker.
mcp1_session_pip_list(session_id="<session_id>")
mcp1_session_tables_list(session_id="<session_id>")

.devin/skills/verified-code-example/SKILL.md:65

  • session_script_run requires the session argument to be named id. With session_id, the workflow cannot execute the example, which defeats the skill's primary verification step.
mcp1_session_script_run(session_id="<session_id>", script="<the example, verbatim>")

.devin/skills/verified-code-example/SKILL.md:73

  • These calls use the unsupported session_id argument, and the schema tool is actually singular (session_table_schema) and accepts one table_name, not table_names. This output-verification block cannot run against the current Deephaven MCP API.
mcp1_session_tables_list(session_id="<session_id>")
mcp1_session_table_data(session_id="<session_id>", table_name="<table>", max_rows=10)
mcp1_session_tables_schema(session_id="<session_id>", table_names=["<table>"])

.devin/skills/verified-code-example/SKILL.md:78

  • Renaming every published variable with a unique prefix conflicts with the reference-doc convention requiring table names source and result (docs/python/templates/_style-guide.md:70 and _reference-template.md:57-62) and with the requirement to execute the published code verbatim. Prefix only verification-only artifacts; use an isolated worker or ask before running when published names collide.
Use a unique prefix for table and variable names so you do not collide with the user's existing session state, and mention any names you created in your final response.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

2. Pick a candidate session. Prefer a `COMMUNITY` session whose `programming_language` matches the example language. Verify it is actually reachable:

```
mcp1_session_details(session_id="<session_id>", attempt_to_connect=true)
```
mcp0_docs_chat(
prompt="<the error message, plus the line that produced it, plus what the code is trying to do>",
programming_language="python",
**If no session is reachable, stop and prompt the user.** Do not write the example, do not guess, and do not silently skip verification. Tell the user exactly what is missing and offer the ways to get a worker running:

- Start the local server from this repo: `./gradlew server-jetty-app:run` (add `-Pgroovy` for a Groovy worker). The PSK is printed in the startup log.
- Or start a container: `docker compose up` from the repo root.

## 3. Write the example

Follow the repo documentation style guide at `docs/python/templates/_style-guide.md`.
- Include every import the snippet needs. A reader must be able to paste the block and run it.
- Use meaningful variable and table names.
- Keep the example self-contained: generate or synthesize its own data unless the point of the example is reading from a specific external source.
- Match the fenced-block attributes the docs use (`python`, `python skip-test`, `python syntax`, `python test-set=N order=...`) to how the example will actually be tested.

3. Follow the skill's steps in order. The non-negotiable parts:
- Confirm a live Deephaven worker over MCP **before** writing any code. If none is reachable, stop and prompt the user to start one.
- Run the exact example you intend to publish, then inspect its output — not just its exit code.
mcp1_session_details(session_id="<session_id>", attempt_to_connect=true)
```

3. Check the response. Continue only if `success` is `true`, `available` is `true`, and `liveness_status` is `"ONLINE"`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants