agent-core-dev

Guides development of the DI and Scope-based agent-core-v2 engine through staged workflows.

18|8|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/PyModel/pythinker-code --skill agent-core-dev-pymodel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-core-dev
Source: https://github.com/PyModel/pythinker-code/tree/main/.agents/skills/agent-core-dev
Command: npx skills add https://github.com/PyModel/pythinker-code --skill agent-core-dev-pymodel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developing in packages/agent-core-v2 requires strict adherence to a DI × Scope architecture where every service declares an identity, dependencies, and a lifetime; this Skill codifies those rules so you avoid scope violations, cyclic dependencies, and v1-to-v2 porting mistakes. ## Core Features & Use Cases - Staged development workflow: Orient, design, implement, test, and verify services with per-stage rules covering LifecycleScope selection, constructor injection, coded errors, feature flags, and the permission system. - Migration workflows: Port business logic from agent-core (v1) to v2 via semantic splitting, triage individual main-branch commits against v2, and expose v2 domains over server-v2 while keeping the /api/v1 wire contract compatible. - Use Case: When asked to move a v1 session feature into v2, follow the align workflow to split state by identity, assign App/Session/Agent scopes, register scoped services, and port tests using createScopedTestHost. ## Quick Start Use the agent-core-dev skill to add a new Session-scoped service to packages/agent-core-v2 with proper DI registration and tests.

Frequently Asked Questions about agent-core-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new service to agent-core-v2?

Define an interface with a unique createDecorator name and _serviceBrand, implement it with constructor injection via @IX decorators, and register it with registerScopedService at the correct LifecycleScope. Follow the design stage to pick the scope from state identity first.

How do I port a service from agent-core v1 to v2?

Use the align workflow: inventory the v1 class's state and dependencies, split it into semantic units by state identity, assign each unit a LifecycleScope, then re-register with registerScopedService and convert imports to the #/ alias. Never copy the v1 class shape directly.

How do I choose between App, Session, and Agent scope?

Scope follows state identity: global state goes to App, per-sessionId state to Session, and per-agentId state to Agent. Stateless services default to App unless they inject a shorter-lived dependency. Never fake per-session state with a Map at App scope.

Why does my agent-core-v2 service fail with a CyclicDependencyError?

A cycle means knowledge was placed backwards between domains. Refactor by extracting a third service, inverting the notification into an event, or re-scoping; activation timing cannot break a dependency cycle.

How do I test scoped services in agent-core-v2?

Resolve the system under test by interface using ix.get(IX) with TestInstantiationService, or use createScopedTestHost for scope-layer behavior. Shared stubs live under test/, never src/, and teardown goes through one DisposableStore.

When should I use close() versus dispose() for service shutdown?

Use close() for async business shutdown like stopping in-flight work and flushing persistence, called before scope.dispose(). Use dispose() only for synchronous resource cleanup such as event subscriptions and timers, since dispose is never awaited.