Repository navigation
Description
Summary
Add native agents.toml support so any junior-prod install can declare external skill sources using the standard dotagents format. Junior fetches and materializes those skills at deploy time; existing skill discovery picks them up without further configuration.
Background
dotagents (@sentry/dotagents) is a tool Sentry maintains that reads agents.toml and fetches SKILL.md directories from GitHub, GitLab, or well-known HTTPS sources. It's the canonical way to declare and share skills across agent tools (Claude, Cursor, Codex, etc.).
Junior already has a layered skill discovery system (app/skills/, plugins, SKILL_DIRS). This feature adds agents.toml as a first-class source in that system — no plugins to install, no manual build steps.
Design
Config location
app/agents.toml — standard dotagents TOML format, no YAML variant. Junior invokes dotagents with cwd = homeDir().
version = 1
[trust]
github_orgs = ["getsentry"]
[[skills]]
name = "find-bugs"
source = "getsentry/skills"
[[skills]]
name = "commit"
source = "getsentry/[email protected]" # pin ref for reproducibilityManaged directory
Materialized skills land in app/.agents/skills/ (dotagents default). This is gitignored and dotagents-managed. It is separate from app/skills/ (user/plugin-authored) to keep ownership clear.
Skill root ordering (deterministic)
additionalRoots(explicit)SKILL_DIRSenvapp/skills/(user-authored)- Plugin roots
app/.agents/skills/(dotagents-managed)
Duplicate skill names: first discovery wins (existing behavior). Collisions across roots should be logged as a warning.
Lifecycle: when does sync happen?
At deploy time via the snapshot pre-step:
// cli/snapshot-warmup.ts
export async function runSnapshotCreate(log) {
await maybeSyncAgentsToml({ log, cwd: homeDir(), required: true });
// ... existing snapshot code
}Explicitly via a new CLI command:
node cli.js agents-sync
NOT lazily during discoverSkills() — skills must exist on the host before request time; fetching on the skill discovery path would block prompt construction.
NOT automatically during server startup in production by default. If agents.toml exists but app/.agents/skills/ is missing, log a clear actionable warning.
Dependency
@sentry/dotagents added to dependencies of @sentry/junior (not npx). Junior invokes the installed binary, not a global command.
Error handling
- Snapshot step: if
agents.tomlexists anddotagents installfails → fail the snapshot command (declared skills are part of app behavior) - Runtime discovery: if
agents.tomlexists but.agents/skills/is absent → warn, continue without dotagents skills (don't crash a live deployment over a missing generated directory)
Security considerations
- Document that production installs should use
[trust]and pin refs — moving refs are not reproducible across deploys - Log installed skill names and their sources after sync
- Run non-interactively
- No network access at request time
Pre-implementation verification needed
Before coding, confirm:
- Does
@sentry/dotagentsexpose a stable programmatic API, or is CLI-only the contract? Shell-out is fine, but we need the right invocation flags. - Does
dotagents installhave a skills-only mode? Running underapp/may generate MCP/hook/subagent configs for other tools (Claude, Cursor, etc.) that we don't need and shouldn't create. - Does the deployment pipeline always run
node cli.js snapshot? If not, snapshot-only sync is insufficient. - Is
homeDir()/app/writable during snapshot execution? Verify thatapp/.agents/skills/can be created at that lifecycle point. - Current duplicate skill behavior — confirm whether later-discovered roots can overwrite earlier ones; locking down the ordering is required.
Acceptance criteria
- Fresh deploy with
app/agents.toml→ dotagents skills appear in<available-skills>with no extra config -
loadSkillcan load a dotagents-materialized skill from the sandbox copy -
node cli.js agents-syncworks standalone (safe to re-run) - Snapshot step fails with a clear error if
agents.tomlexists and install fails - No
agents.toml→ zero behavioral change - Duplicate skill names across roots are deterministic and logged
-
app/.agents/gitignore guidance in docs - Trust + ref-pinning best practices documented
- Tests: snapshot wiring, CLI sync, root inclusion, missing
agents.tomlno-op, collision logging
--
Activity
fix(github-issues): ban conventional commit prefixes in issue titles (#…