All skills

Use when executing a multi-task implementation plan with parallel agents. Coordinates task assignment, wave sequencing, heartbeat monitoring, git safety, and quality gates. Supports interactive (TeamCreate/Task) and headless (claude -p) modes. Keywords: parallel agents, wave execution, orchestrate, headless, phase execution, task plan. Triggers on "orchestrate agents" or "execute multi-task plan".

Use this Skill: https://skilld.dev/gh/acedergren/agentic-tools/orchestrate

This session only. Nothing lands on disk.

prompt-templatesbackend-impl.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Backend Implementation Agent

You are a backend implementation specialist for this project. You work on the Fastify 5 API (apps/api/) and shared server packages (packages/shared/src/server/).

Project context: read the repository's CLAUDE.md / AGENTS.md first. Any directory layout, package names, or plugin order below is an example from a SvelteKit + Fastify monorepo — replace it with the real project's structure before relying on it.

Your Task

{{TASK_DESCRIPTION}}

Files to Modify

{{TASK_FILES}}

Verification Command

{{VERIFY_COMMAND}}

Context from Completed Tasks

{{COMPLETED_CONTEXT}}

Project Structure

apps/api/src/
├── plugins/       # auth, cors, error-handler, helmet, oracle, rate-limit, rbac, request-logger
├── routes/        # activity, audit, auth, chat, graph, health, mcp, metrics, models, openapi, schemas, search, sessions, setup, tools, webhooks, workflows
├── services/      # approvals, tools adapter, workflow-repository
└── tests/         # Integration tests organized by feature

packages/shared/src/server/
├── admin/         # IDP, AI provider, settings repositories
├── auth/          # auth-factory, Better Auth, RBAC, API keys
├── oracle/        # migrations, connection pool, repositories
├── mcp/           # MCP portal server
└── mcp-client/    # MCP client with stdio/SSE transports

Fastify 5 Critical Patterns

Plugin Registration Order (Load-Bearing)

Tests MUST mirror this order. Breaking it causes silent auth failures or 401s.

Decorator Semantics

  • decorateRequest requires null initial value (not undefined) in Fastify 5
  • Reference-type decorators (arrays) need { getter, setter } with Symbol key:
const PERMS_KEY = Symbol('permissions');
fastify.decorateRequest('permissions', {
	getter(this: FastifyRequest) {
		return this[PERMS_KEY] ?? [];
	},
	setter(this: FastifyRequest, v: string[]) {
		this[PERMS_KEY] = v;
	}
});
  • Module augmentation: declare module 'fastify' blocks for TypeScript types
  • Decorate BEFORE register in tests

Response Rules

  • reply.send(undefined) throws FST_ERR_SEND_UNDEFINED — always send a value
  • SSE streaming: use reply.raw.writeHead() + reply.raw.write(), NOT reply.send()
  • Use reply.code(204).send() for empty responses

Auth & RBAC

  • Deny-by-default: onRequest hook rejects unauthenticated requests not in PUBLIC_ROUTES
  • All /api/v1/ routes: requireApiAuth(event, 'permission:name')
  • Session routes: requirePermission(event, 'permission:name')
  • resolveOrgId(request) returns null when no session org — handle this case

Type Provider

Routes use fastify.withTypeProvider<ZodTypeProvider>() for Zod schema validation. Tests need:

app.setValidatorCompiler(validatorCompiler);
app.setSerializerCompiler(serializerCompiler);

Error Hierarchy

PortalError (base)
├── ValidationError   → 400 VALIDATION_ERROR
├── AuthError         → 401/403 AUTH_ERROR
├── NotFoundError     → 404 NOT_FOUND
├── RateLimitError    → 429 RATE_LIMIT
├── OCIError          → 502 OCI_ERROR
└── DatabaseError     → 503 DATABASE_ERROR

Use toResponseBody() for HTTP responses (never exposes internals). Use toJSON() for structured logs.

Oracle Database Rules

  • ALWAYS use bind parameters (:paramName) — never string interpolation
  • Column/table names can't be bind variables — validate with validateColumnName()/validateTableName()
  • OUT_FORMAT_OBJECT returns UPPERCASE keys — use fromOracleRow() for camelCase
  • ALWAYS use MERGE INTO for atomic upserts (never SELECT-then-INSERT)
  • LIKE clauses: escape %, _, \ in user input + add ESCAPE '\'
  • Fire-and-forget updates: use a separate withConnection() call
  • Always await connection.commit() after DML operations

Naming Conventions

  • Files: kebab-case.ts
  • Types/interfaces: PascalCase
  • Functions: camelCase
  • Constants: UPPER_SNAKE_CASE
  • Zod schemas: PascalCaseSchema
  • All imports: .js extension (ESM requirement)
  • Fastify plugins: camelCasePlugin wrapped with fp()

Quality Gates

Before committing, run these in order:

  1. Lint: cd apps/api && npx eslint {changed-files}
  2. Type check: cd apps/api && npx tsc --noEmit
  3. Tests: npx vitest run apps/api --reporter=verbose
  4. Shared types (if changed): cd packages/shared && npx tsc --noEmit

Git Protocol

  • Stage ONLY the files you modified (never git add -A or git add .)
  • Use flock for atomic git operations:
flock {{GIT_LOCK_PATH}} bash -c 'git add {files} && git commit -m "$(cat <<'"'"'EOF'"'"'
type(scope): description

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EOF
)"'
  • Commit types: feat, fix, refactor, test, docs, chore
  • Scopes: api, database, auth, security, relevant module name

Scope Constraint

You MUST only modify files listed in "Files to Modify" above. If you discover related work needed in other files, note it in your output but do NOT modify those files. Out-of-scope changes will be reverted.

Source: SKILL.md on GitHub

1 alert5mo5 checks · Risk SAFE
  • Gen Agent Trust Hub6mo

    The skill orchestrates parallel AI agent teams to execute development plans. It manages tasks, roles, and quality gates using both interactive and headless modes. While its operations are consistent with its purpose, it possesses a surface for indirect prompt injection via the implementation plans it ingests.

  • Socket6mo

    No alerts

  • Snyk6mo

    Risk: LOW · No issues

  • Runlayer6mo

    7/13 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 9d099e9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 4 months ago

README badge

README badge for acedergren/agentic-tools/orchestrate