Skip to content

docs(design): Replace tool and prompt policies with design intent, checks, and a build-tools skill - #4050

Merged
dcramer merged 4 commits into
mainfrom
policies/tool-and-prompt-practices
Nov 23, 2026
Merged

dcramer merged 4 commits into
mainfrom
policies/tool-and-prompt-practices

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Replaces four policies with design intent, deterministic checks, and a repo skill. The policies were policies/tool-design.md, agent-steering.md, system-prompt.md, and prompt-markers.md. @dcramer confirmed the exact text of every design/ line.

  • Design: design/tools.md and design/prompts.md state the goals and rules of model-facing tools and prompts. These rules come from practices that Claude Code (2.1.330) and Codex (openai/codex@ba1c17f9) both follow.
    • New in design/tools.md: arguments that contradict each other fail the call, targets are IDs or stored names, the runtime sets actor/destination/credentials, and one value has one name.
    • New in design/prompts.md: core behavior doesn't depend on SOUL.md/WORLD.md, plugin guidance is stable, tags grant nothing, sources never share a block, authors come from the platform, each input kind has one tag, and text never uses a fixed agent name.
    • The design/tools.md gap about error repair text is gone, since fix(tools): Name the fix in model-facing tool error messages #4058 closed it.
  • Skill: .agents/skills/build-tools/ holds the how-to for tools, prompt sections, and prompt tags: where a rule lives, layout, schemas, descriptions, results and errors, and tags. references/sources.md holds the first-party sources.
  • Code comments:
    • The system prompt block map and the prompt mode rules now live in the header of system-prompt-rules.ts.
    • The context message and cache rules are in prompt.ts.
    • The untrusted-input rules are in input-tags.ts.
    • The escaping table is in prompt-tags.ts.
    • The structured and content result modes are in zod-tool.ts.
  • Checks:
    • ast-grep no-raw-tool-definitions: tools must use zodTool or definePluginTool.
    • oxlint prompt-tag-attributes: tags are kebab-case, and attributes are snake_case or <provider>.<field>, with no ts and no *_ms.
    • param-missing-description in check-tool-descriptions: every input field has describe(). The 26 existing fields are in tool-param-descriptions-baseline.txt. tool-schema-ast.mjs now resolves .js imports and shared param helpers, so these counts are accurate.

Renames that the naming check needed:

  • message tag attribute ts → sent_at (thread context).
  • MCP catalog child tag available_tool_count → available-tool-count.
  • The AGENTS.md INSTRUCTIONS wrapper is an explicit exception, because it keeps the Codex format.

AGENTS.md, CONTRIBUTING.md, other policies, check scripts, and ast-grep rule comments now point to the design docs or the skill.

via @dcramer.

--

View Session [Sentry]

…nd Codex

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 22, 2026 11:36pm UTC

Request Review

@dcramer dcramer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should follow our design documentation and not live in policies

@blacksmith-sh

This comment has been minimized.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@sentry-junior sentry-junior Bot changed the title docs(policies): Add tool and prompt practices shared by Claude Code and Codex docs(design): Add tools and prompts design docs Nov 22, 2026
@sentry-junior

sentry-junior Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Moved to design/tools.md and design/prompts.md, using the text you confirmed in Slack. I reverted the policy edits, so the policies match main again.

@dcramer

dcramer commented Nov 22, 2026

Copy link
Copy Markdown
Member

This should be something where we can remove the policies and replace them with clear design intent, and then add deterministic checks where it makes sense or other verification skills for building and maintaining tools in the repository

@dcramer
dcramer marked this pull request as ready for review November 22, 2026 22:34
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 22, 2026
sentry-junior Bot and others added 2 commits November 22, 2026 23:04
…mpt-practices

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
…ecks, and a build-tools skill

Move the rules of policies/tool-design.md, agent-steering.md,
system-prompt.md, and prompt-markers.md to design/tools.md and
design/prompts.md, the new build-tools repo skill, code comments next to
the code they govern, and four checks:

- ast-grep no-raw-tool-definitions
- tag and attribute naming in the oxlint prompt-tag-attributes rule
- param-missing-description in check-tool-descriptions, with a baseline
- unit tests for the prompt tag helpers

Rename the message tag attribute ts to sent_at and the MCP catalog child
tag available_tool_count to available-tool-count to follow the naming
rules. The Codex INSTRUCTIONS wrapper keeps its name.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@github-actions github-actions Bot added risk: high PR risk score: high and removed risk: medium PR risk score: medium labels Nov 22, 2026
@sentry-junior sentry-junior Bot changed the title docs(design): Add tools and prompts design docs docs(design): Replace tool and prompt policies with design intent, checks, and a build-tools skill Nov 22, 2026
@sentry-junior

sentry-junior Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

@dcramer Done in 26c3652bf. The four policies are gone (tool-design.md, agent-steering.md, system-prompt.md, prompt-markers.md). Their rules went here:

  • Intent: the 11 lines you approved are in design/tools.md and design/prompts.md. The errors gap is gone, since fix(tools): Name the fix in model-facing tool error messages #4058 closed it.
  • Checks:
    • ast-grep no-raw-tool-definitions
    • tag and attribute naming in oxlint prompt-tag-attributes
    • param-missing-description in check-tool-descriptions, with a baseline of the 26 existing fields
    • unit tests for the prompt tag helpers
  • How-to: the new repo skill .agents/skills/build-tools/ covers where a rule lives, schemas, descriptions, results and errors, prompt sections, tags, and how to verify a tool. Its sources are in references/sources.md.
  • Code comments: the block map and prompt mode rules are in the header of system-prompt-rules.ts. The rest sit next to the code they govern: prompt.ts, input-tags.ts, prompt-tags.ts, zod-tool.ts.

The naming check needed three changes. The message attribute ts is now sent_at, and available_tool_count is now available-tool-count. INSTRUCTIONS is an explicit exception because it keeps the Codex format.

@blacksmith-sh

blacksmith-sh Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Found 3 test failures on Blacksmith runners:

Failures

Test View Logs
[classic] › packages/junior-dashboard/e2e/
conversations-outline.spec.ts:54:1 › jumps to a far message from the outline
View Logs
[classic] › packages/junior-dashboard/e2e/
conversations-read-position-links.spec.ts:12:1 › opens links outside the loaded rows fr
om the page around them
View Logs
[inbox] › packages/junior-dashboard/e2e/inbox/
settings.spec.ts:244:3 › new UI › shows a push notification that has no tag @new
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dcramer
dcramer merged commit b7ea1ff into main Nov 23, 2026
80 of 88 checks passed
@dcramer
dcramer deleted the policies/tool-and-prompt-practices branch November 23, 2026 00:10

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 26c3652b Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant