BAIEnterprise Digitalization · AI Application Development中文EN

Extracting Capabilities from a Development Project

Date: 2026-11-03Category: Agent Framework ResearchTags: Capability extraction · Pack · Runtime · Governance

The full process of taking one working consulting project apart into reusable FDE capabilities: value judgment, asset inventory, scenario contracts, a tool-governance chain, two Runtimes, Provider refactoring, and Pack/Profile extraction — then proving reuse with a second scenario.

Extracting Capabilities from a Development Project

The essence of this process is not “moving the original project’s code out”, but gradually turning a working development project into:

FDE delivery capabilities that can be identified, assembled, governed, verified, and transferred.

1. The value judgment first: what is worth extracting

The criterion is not “how complex is the code”, but whether it satisfies all of the following at once:

  1. Will it recur across multiple client projects?
  2. Is it independent of specific client materials, pages, databases, and business objects?
  3. Can stable inputs, outputs, and boundaries be defined for it?
  4. Can it be tested, audited, and replaced?
  5. Can it lower the delivery cost or risk of future projects?

So the first things identified were not specific business features, but the recurring common problems of development:

  • How an Agent runs, pauses, resumes, and cancels;
  • How tools are authorized, approved, restricted, and audited;
  • How tasks are decomposed, planned, and replanned;
  • How materials are retrieved, cited, and turned into evidence;
  • How results are versioned, rolled back, and traced;
  • How client systems connect through adapters;
  • How to separate offline tests, real models, external services, and human acceptance.

What is not extracted is equally explicit:

  • Real client materials, keys, and runtime databases;
  • The original project’s UI;
  • The consulting project’s ORM and business objects;
  • Default local paths and module-level globals;
  • Processes, templates, and fields specific to one client;
  • One-off implementations that cannot be reused or verified.

That produced the first principle:

Extract “stable patterns and governance boundaries”, not “the project site itself”.

The related boundary record is in the consulting-research Pack extraction record.

2. The extraction path actually taken

1. Inventory the assets first, instead of refactoring directly

Split the original development project’s contents into:

  • Runtime and execution flows;
  • Tools and external connections;
  • Data, RAG, Memory, Artifact;
  • Quality, evaluation, and audit;
  • Business processes and domain methods;
  • UI, client configuration, and project data.

For each capability, record its source, dependencies, risks, whether it contains client information, and whether it depends on legacy globals.

2. Establish scenario contracts first

Use ScenarioSpec to declare explicitly:

  • Scenario identity and version;
  • Whether it uses the Full or Direct Runtime;
  • Which tools, Skills, and Packs it needs;
  • Required inputs;
  • Model round and run constraints;
  • Tenant, Scope, and permission boundaries.

A scenario declaration is only an “application to use capabilities” — it cannot directly grant permissions, nor trigger execution.

3. Take tool execution out of the Agent main flow

Form a unified chain:

Tool Schema
  → Parameter validation
  → Scope / Tenant check
  → Risk judgment
  → Human approval
  → Sandbox execution
  → Result validation
  → Audit and Trace

This step separates “the model wants to call a tool” from “the tool is actually allowed to execute”, so the LLM never decides permissions itself.

4. Build two Runtimes

  • Direct Runtime: for simple tasks, low-latency interaction, tool loops, and explicit approval;
  • Full Runtime: for complex research, planning, quality checks, long flows, and multi-stage delivery.

Both share tool governance, Checkpoint, Artifact, evidence, and run metrics. On recovery, the original Scenario, Pack, Runtime, and tenant binding must be preserved — the execution mode must never be silently switched.

5. Refactor implementations into Provider, Service, and Adapter

Content that was hardcoded in the original project was gradually turned into injectable interfaces:

  • RAGProvider
  • MemoryProvider
  • ArtifactBackend
  • SkillProvider
  • ConnectorAdapter
  • ExecutionSandboxAdapter
  • ClaimLedger
  • QuotaLedger
  • AlertSink

That way the Runtime depends only on contracts, and client projects inject their concrete knowledge base, database, MCP, HTTP, Git, or object-storage implementations.

6. Extract domain experience into Packs and Profiles

For consulting V2/V3, the extraction was not a migration of business code but a “semantic split”:

Original project asset General capability after extraction
Research planning Request, WorkItem, task types and dependencies
Question planning Workflow Profile, stage inputs/outputs and completion conditions
Method packs Versionable Methods and Skills
Retrieval results Evidence, Claim, Citation contracts
Quality evaluation Deterministic Quality Rules and Quality Gates
V2/V3 flows human_led, agent_led, and human checkpoints
Version boundaries Explicit governance policies; the Agent may not widen scope on its own

The consulting-research Profile finally takes this shape:

Intake
→ Research planning
→ Question research
→ Evidence review
→ Synthesis
→ Quality review
→ Human confirmation
→ Publication

The Profile defines process semantics and governance boundaries; industry terminology, client templates, retrieval strategies, and connectors stay in the Pack or Adapter.

7. Verify “real reusability” with a second scenario

Finish consulting research first, then verify with bidding, legal, and academic research:

  • Which capabilities stay in the shared layer;
  • Which capabilities belong in a domain Pack;
  • Whether the Profile granularity is stable;
  • Whether the scenario can be swapped without modifying the Runtime core.

This is the key step for judging whether the abstraction is right.

3. The resulting FDE capability map

Six layers of capability

Layer Main capabilities
Client application layer RuntimeService, CLI, run, recovery, later client Web/API/review workbenches
Scenario & domain Pack layer Scenario, Pack, Profile, Tool, Skill, Rule, Template, Evaluation, Method
Runtime layer Full/Direct Runtime, planning, tool loop, approval, cancel, Checkpoint, recovery
Tool & system connection layer Tool Registry, authorization, Sandbox, SubAgent, HTTP/MCP/database/Git Adapters
Data, knowledge & memory layer RAG, source governance, index lifecycle, Evidence, Citation, Claim Ledger, Memory, Artifact
Run & infrastructure layer Task/Run/Thread, Worker, Lease, Fencing, storage, backup, deployment, and cost governance

Three cross-cutting capabilities

  1. Identity and security governance: Tenant, Scope, authorization, approval, redaction, and audit;
  2. Quality and evaluation: quality gates, retrieval evaluation, Pack evaluation, layered real-model and human evaluation;
  3. Observability and operations: Trace, events, metrics, cost, failure classification, replay, and alerting.

The local capability catalog now contains:

  • 2 Runtimes;
  • 21 Tools;
  • 14 Shared Capabilities;
  • 7 Packs;
  • 4 Workflow Profiles;
  • 18 Skills;
  • 17 Rules;
  • 18 Templates;
  • 13 Evaluations;
  • 1 Method.

No Adapter bound to a specific client system exists yet. Real models, client databases, production Sandboxes, Postgres HA, and human quality acceptance belong to target-environment acceptance and should not be treated as already completed in the local code.

The full catalog is in the FDE capability catalog; the extraction stage records are in the FDE capability map.

4. How to invoke it in the future

For a new project, instead of designing an Agent from scratch, invoke in this order:

Read the capability catalog
  ↓
Judge task type and complexity
  ↓
Choose Direct / Full Runtime
  ↓
Choose an existing Pack / Profile
  ↓
Declare the needed Shared Capabilities, Tools, Skills
  ↓
Inject client Adapters, material permissions, and model Providers
  ↓
validate
  ↓
run
  ↓
Quality gate, human confirmation, and publication

Common entry points:

uv run python -m agent_core.cli catalog
uv run python -m agent_core.cli catalog --kind pack
uv run python -m agent_core.cli catalog --kind shared_capability

uv run python -m agent_core.cli pack-validate --pack consulting-research
uv run python -m agent_core.cli pack-release-check --pack consulting-research

uv run python -m agent_core.cli validate --scenario scenario.json
uv run python -m agent_core.cli run --scenario scenario.json --request "客户任务"
uv run python -m agent_core.cli resume --scenario scenario.json \
  --thread-id THREAD_ID --decision approve \
  --checkpoint-db runtime/checkpoints.db

The minimal delivery unit of a new project is a Pack:

manifest.yaml
profile.py
contracts.py
rules.py
templates.py
evaluation.py
skills/
adapters/
CHANGELOG.md

In the end, the method compresses into one sentence:

First judge which experience has cross-project value, then split it into Runtime, Shared Capability, Pack, Profile, Adapter, and governance rules, and finally prove — through scenario assembly and layered acceptance — that it really can be reused.