@passioncode-ai/fabric-agent-adapter 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: creating-fabric-agents
3
+ description: Use when designing and building a NEW agent or provider that must be Fabric-compatible from its first commit — «создай агента, совместимого с фабрикой Passion Code», «новый агент под Fabric», "create a fabric-compatible agent", "build a new Fabric provider", "fabric-ready agent from scratch". Runs the intake grill (capability, named consumer, workflow-or-agent, MCP/A2A/local-runner profile, effect declarations), distils source projects into a knowledge pack whose recorded failures become planted eval fixtures, scaffolds the pinned contract bundle, and sets the two-clock eval expectation with the conformance report. NOT for adapting an existing project (use adapting-projects-to-fabric), building the Fabric host or orchestrator, or generic agent design where Fabric compatibility is not part of the request.
4
+ license: MIT
5
+ compatibility: Requires filesystem access and Python 3.9+. Exact schema checks additionally need git, Node.js, pnpm, and the pinned private fabric-agent-contract checkout. Works without those tools in an explicitly degraded structural-check mode. Ships in one plugin with adapting-projects-to-fabric, whose scripts it reuses.
6
+ metadata:
7
+ author: passioncode-ai
8
+ version: "0.3.1"
9
+ contract-version: "0.1.0"
10
+ contract-commit: "20a818e648a4c09a60df0126d11626922e8b9094"
11
+ ---
12
+
13
+ # Creating Fabric-compatible agents
14
+
15
+ Design a new agent so that Fabric compatibility is a property of its first commit, not a
16
+ retrofit. The sibling skill `adapting-projects-to-fabric` wraps an interface that already
17
+ exists; this one runs the stages that come *before* an interface exists — the intake
18
+ grill and the knowledge intake — then hands the scaffolding and verification to the same
19
+ pinned machinery, so both doors lead into one pipeline.
20
+
21
+ ## Boundary
22
+
23
+ Use this skill to design and build a new provider. Do not use it to:
24
+
25
+ - adapt a project that already has a stable API, MCP/A2A surface, or CLI — that is
26
+ `adapting-projects-to-fabric`, and entering there skips nothing;
27
+ - design the Fabric host, registry, scheduler, admission service, or binding runtime;
28
+ - build a generic agent with no Fabric requirement — nothing here helps a project that
29
+ will never be a provider;
30
+ - claim admission: the deliverable is an admission-ready provider bundle, never a
31
+ connected provider.
32
+
33
+ ## Step 0 — the intake grill
34
+
35
+ No file is created until every row has an answer. An answer of "later" fails the grill.
36
+
37
+ | Question | The gate |
38
+ |---|---|
39
+ | **What capability?** | one capability, named as `domain.action` (optionally `@surface`), with input and output shapes statable now |
40
+ | **Who calls it?** | **a named consumer** — the project, schedule, or workflow that will actually invoke this capability. No consumer, no agent: a role that "would be useful" is a catalogue entry, not a build order |
41
+ | **Workflow or agent?** | if every step can be named now, build a deterministic workflow behind the capability and skip the autonomy — an agent buys flexibility with latency, cost, and a new failure class, and that price needs a reason |
42
+ | **Which profile?** | `mcp` when Fabric owns planning and retries and the capability has a schema; `a2a` when the provider owns its task lifecycle end to end; `local-runner` when it is a terminal agent Fabric drives. When unsure, the sibling skill's profile-selection reference is the decision record |
43
+ | **What effects?** | declare anything money-, deletion-, or publication-adjacent now — the host's floor and grants are designed against these declarations, and one discovered late invalidates the admission |
44
+ | **Which tenancy?** | record whether the agent assumes one operator; the assumption is cheap to write down and expensive to excavate |
45
+
46
+ ## Step 1 — the knowledge intake
47
+
48
+ If the estate holds prior art — a project that did this job, an audit that names its
49
+ failures, a retro — distil it before writing code:
50
+
51
+ 1. Name the sources: repositories, `docs/`, audits, retrospectives, with references.
52
+ 2. Extract **patterns** (what worked, each citing its origin) and **traps** (recorded
53
+ failures and dead ends).
54
+ 3. **Convert every trap into a planted eval fixture.** The new agent is not done until
55
+ it has been watched rejecting the exact defects its predecessors were burned by —
56
+ knowledge transfers as a check, not as prose.
57
+ 4. Record the pack in the new project as `docs/knowledge-pack.md` with its sources, so
58
+ the provenance of every borrowed decision survives the person who borrowed it.
59
+
60
+ Skipping this step because there is no prior art is legal; skipping it because reading
61
+ is slower than generating is how the same collector truncates at the same row limit
62
+ twice.
63
+
64
+ ## Step 2 — the project skeleton
65
+
66
+ Create the minimal project: repository, `README.md` naming the capability and its
67
+ consumer, and the eval **observables** — for each requirement, the pass/fail criterion
68
+ that would show it met, written now, before the implementation. The input corpus is NOT
69
+ authored now: it grows from real traces once the provider runs, and the step-1 fixtures
70
+ are its seed because a source project's recorded failures count as production.
71
+
72
+ ## Step 3 — scaffold the provider bundle
73
+
74
+ Reuse the sibling skill's scaffolder against the new skeleton with the profile chosen at
75
+ step 0:
76
+
77
+ ```bash
78
+ python3 <plugin-dir>/skills/adapting-projects-to-fabric/scripts/adapt_project.py \
79
+ scaffold <project-root> --profile <mcp|a2a|local-runner> \
80
+ --provider-id <stable-uri> --provider-name "<name>" \
81
+ --capability-id <stable-uri> --capability-name <domain.action> \
82
+ --schema-base <immutable-base-uri>
83
+ ```
84
+
85
+ Pin exactly contract `0.1.0` at commit `20a818e648a4c09a60df0126d11626922e8b9094` and
86
+ read the pinned guide before implementing protocol details. If this skill is installed
87
+ without its sibling, the scaffolder is absent: create the bundle by hand from the pinned
88
+ contract's `docs/guides/connecting-compatible-agents.md` and mark the structural check
89
+ `NOT_RUN` — do not reconstruct normative rules from memory.
90
+
91
+ The generated placeholders are deliberate blockers; a bundle still containing one is not
92
+ ready for admission.
93
+
94
+ ## Step 4 — implement against the observables
95
+
96
+ Build the capability behind the chosen surface. Keep model choice and internal reasoning
97
+ outside the contract; expose typed outcomes, evidence, and protocol-visible state. Every
98
+ provider output is untrusted until schemas and semantic assertions pass. The step-2
99
+ observables are the definition of done; an observable attached after the code exists
100
+ lets the output decide what counts as success.
101
+
102
+ ## Step 5 — check, report, and set the canary expectation
103
+
104
+ Run the sibling skill's `check` (structural, then exact when the contract checkout is
105
+ available) and complete `fabric/FABRIC-CONFORMANCE.md` with dated receipts, exactly as
106
+ its workflow steps 5–7 prescribe — this skill adds no second verification path on
107
+ purpose. Then record one expectation the report must carry:
108
+
109
+ > When a Fabric host admits this provider, it enters under a **canary binding** — a
110
+ > checker on its output and a budget cap — regardless of who wrote it. Unsupervised
111
+ > operation is a later, recorded promotion citing eval results and run history.
112
+
113
+ ## Completion format
114
+
115
+ Report: capability, consumer, profile with the step-0 grill answers; the knowledge pack
116
+ and which traps became fixtures; created files; contract version and commit; the gate
117
+ table with `PASS`, `FAIL`, `NOT_RUN`, or `NOT_VERIFIED`; remaining placeholders; and the
118
+ exact next command. Never summarize the outcome as "Fabric-compatible" unless every
119
+ required admission gate passed against the real provider.