Skip to content

Golden rules (humans & agents)

These rules keep the monorepo buildable, type-safe, and easy for agents to navigate. AGENTS.md at the repo root stays short — this file is the expanded checklist.

  • Routes are auto-prefixed with /plugins/{sanitized-name}; register plugins with relative paths via defineRoute() + registerRoutes(scope, ...) on the Fastify scope passed to register.
  • Use dependsOn so services load before dependents.
  • Plugin uses schemaVersion: '1.0' and register(scope: FastifyInstance, context: PluginContext) — see Plugins guide, ADR 0001: layering and plugin boundaries, and ADR 0002: HTTP framework.
Plugin nameHTTP prefix
@agent-detective/jira-adapter/plugins/agent-detective-jira-adapter
@agent-detective/linear-adapter/plugins/agent-detective-linear-adapter
my-plugin/plugins/my-plugin
{
name: '@agent-detective/my-adapter',
dependsOn: ['@agent-detective/local-repos-plugin'],
register(app, context) {
const localReposService = context.getService<LocalReposService>(
'@agent-detective/local-repos-plugin',
);
// localReposService.localRepos, localReposService.buildRepoContext
},
}

Full definitions: packages/types/src/index.ts. Shapes you touch most often:

  • Pluginname, version, schemaVersion: '1.0', optional schema, dependsOn, register(app, context) (may return controller objects for OpenAPI).
  • PluginContextagentRunner, enqueue, config, logger, controllers, events, registerService / getService, agents and capabilities, registerTaskQueue, onShutdown.
  • TaskEventsource, type, payload, optional timestamp.