Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Safely extend or refine AFI signal schemas and closely-related validators in afi-core, while preserving determinism, respecting PoI/PoInsight design, and obeying the AFI Droid Charter and AFI Core AGENTS.md boundaries.
.claude/skills/aiskillstore-extend-signal-schema/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 114% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 50% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 111% | 0% |
Use this skill when you need to extend or refine signal schemas in afi-core, adding new fields or validation rules to the Raw, Enriched, Analyzed, or Scored signal schemas.
This skill ensures changes are:
This skill is primarily used by schema-validator-droid and any future afi-core droids that work on signal schemas and validators.
Before changing anything, you MUST:
afi-core/AGENTS.mdschemas/not in afi-reactor (orchestration) or afi-token (economics).
deployment/infra repos.
If any requirement is unclear or appears to violate AGENTS.md or Charter, STOP and ask for human clarification instead of trying to be clever.
The caller should provide, in natural language or structured form:
string, number, enum, object, arrayIf any of this information is missing, ask clarifying questions or produce a minimal, clearly-labeled stub with TODOs and conservative defaults.
When this skill is invoked, follow this sequence:
In your own words, summarize:
This summary should be short and precise, so humans can quickly confirm the intent.
Identify the relevant schema file(s), typically:
schemas/universal_signal_schema.ts — Main signal schema (may cover all stages)schemas/pipeline_config_schema.ts — Pipeline configuration schemaschemas/signal_finalization_request_schema.ts — Finalization request schemaschemas/validator_metadata_schema.ts — Validator metadata schemaOr, if schemas are split by stage:
schemas/raw_signal_schema.tsschemas/enriched_signal_schema.tsschemas/analyzed_signal_schema.tsschemas/scored_signal_schema.tsDo not modify these yet; just understand the current structure.
In the target schema file:
.optional() for optional fields.default(value) for fields with defaults.enum([...]) for enumerated values.min(), .max(), .regex() for validation rulestypescript// schemas/universal_signal_schema.ts export const SignalSchema = z.object({ // ... existing fields ... // ✨ NEW: Macro regime classification (Enriched stage) // Values: "risk_on" (bullish sentiment), "risk_off" (defensive), "neutral" macro_regime: z.enum(["risk_on", "risk_off", "neutral"]).optional(), // ... rest of schema ... });
If the schema has corresponding TypeScript types:
typescriptexport type Signal = z.infer<typeof SignalSchema>;
runtime/types.ts or schemas/index.tsIf the new field requires validation logic:
validators/:validators/SignalScorer.ts — Signal scoring logicvalidators/index.ts — Validator registryWhere test patterns exist:
tests/ — Vitest unit testssignal_schema_test/ — Schema-specific test suitesIf no test patterns exist yet, leave a clearly marked TODO and surface this in your summary.
Run at least:
npm run build in afi-coreIf relevant tests exist and are safe to run:
npm test or npm run test:run (Vitest)Do not mark the skill as "successful" if the build fails. Instead, stop, gather error output, and surface it with minimal, clear commentary.
When using this skill, you MUST NOT:
poi, poinsight, proof_of_intelligence, or similar fields.If a request forces you towards any of the above, STOP and escalate.
At the end of a successful extend-signal-schema operation, produce a short summary that includes:
Aim for something a human maintainer can read in under a minute to understand exactly what changed and why.
macro_regime field to Enriched signals with enum valuesrisk_on, risk_off, neutral."
risk_breakdown object with sub-scoresfor market_risk, liquidity_risk, and execution_risk."
derivative_underlier string field to Analyzed signals foroptions/futures-only signals."
content field to all signals (already exists, but make itrequired with a migration strategy)."
action field to include new enum values: buy, sell, hold,close, reduce."
→ Author the pipeline composition in afi-reactor (governed registries/manifests) instead.
→ Violates PoI/PoInsight design (escalate to human).
→ Belongs in afi-token (escalate to human).
→ Belongs in afi-gateway (escalate to human).
→ Requires explicit approval (escalate to human).
When adding fields that may break backwards compatibility:
.optional().default(value) to provide backwards compatibilityAlways document the migration strategy in your summary.
Request: "Add an optional macro_regime field to Enriched signals."
Summary:
universal_signal_schema.ts)macro_regimeenum(["risk_on", "risk_off", "neutral"])schemas/universal_signal_schema.ts (added field)schemas/index.ts (re-exported type)Request: "Make content field required for all signals."
Summary:
universal_signal_schema.ts)contentstring (min 1, max 280).default("") for backwards compatibilityschemas/universal_signal_schema.ts (changed optionality)tests/signal_schema.test.ts (updated tests)Last Updated: 2025-11-27 Maintainers: AFI Core Team Charter: afi-config/codex/governance/droids/AFI_DROID_CHARTER.v0.1.md
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 3,738 | 4,632 | +24% | 1 | 1 | 0% | 295 | 3,284 | +1013% | 0 | 0 | — |
case-02 | fail→fail | 5,166 | 5,293 | +2% | 1 | 1 | 0% | 291 | 3,317 | +1040% | 0 | 0 | — |
case-03 | fail→fail | 4,207 | 5,543 | +32% | 1 | 1 | 0% | 279 | 3,620 | +1197% | 0 | 0 | — |
case-04 | fail→pass | 8,637 | 3,848 | -55% | 1 | 1 | 0% | 1,666 | 3,566 | +114% | 0 | 0 | — |
case-05 | fail→pass | 12,221 | 4,203 | -66% | 1 | 1 | 0% | 2,446 | 3,659 | +50% | 0 | 0 | — |
case-06 | fail→pass | 15,063 | 2,978 | -80% | 1 | 1 | 0% | 2,929 | 3,394 | +16% | 0 | 0 | — |
case-07 | fail→pass | 15,652 | 3,621 | -77% | 1 | 1 | 0% | 2,747 | 3,590 | +31% | 0 | 0 | — |
case-08 | fail→fail | 4,622 | 6,355 | +37% | 1 | 1 | 0% | 245 | 3,285 | +1241% | 0 | 0 | — |
case-09 | pass→fail | 12,240 | 4,733 | -61% | 1 | 1 | 0% | 2,298 | 3,285 | +43% | 0 | 0 | — |
case-10 | pass→pass | 6,113 | 4,244 | -31% | 1 | 1 | 0% | 1,181 | 3,759 | +218% | 0 | 0 | — |
case-11 | pass→pass | 4,350 | 3,290 | -24% | 1 | 1 | 0% | 747 | 3,443 | +361% | 0 | 0 | — |
case-12 | pass→pass | 5,697 | 3,485 | -39% | 1 | 1 | 0% | 1,089 | 3,579 | +229% | 0 | 0 | — |
case-13 | fail→fail | 3,268 | 4,353 | +33% | 1 | 1 | 0% | 352 | 3,266 | +828% | 0 | 0 | — |
case-14 | pass→pass | 13,049 | 5,350 | -59% | 1 | 1 | 0% | 2,157 | 3,874 | +80% | 0 | 0 | — |
case-15 | pass→pass | 4,463 | 6,779 | +52% | 1 | 1 | 0% | 841 | 4,217 | +401% | 0 | 0 | — |
case-16 | pass→pass | 11,492 | 8,816 | -23% | 1 | 1 | 0% | 2,072 | 4,583 | +121% | 0 | 0 | — |
case-17 | pass→pass | 10,830 | 7,352 | -32% | 1 | 1 | 0% | 2,096 | 4,388 | +109% | 0 | 0 | — |
case-18 | fail→pass | 10,144 | 3,435 | -66% | 1 | 1 | 0% | 1,732 | 3,647 | +111% | 0 | 0 | — |
case-19 | pass→fail | 3,557 | 4,886 | +37% | 1 | 1 | 0% | 662 | 3,275 | +395% | 0 | 0 | — |
case-20 | pass→pass | 2,869 | 3,918 | +37% | 1 | 1 | 0% | 487 | 3,694 | +659% | 0 | 0 | — |
case-21 | fail→pass | 10,854 | 3,100 | -71% | 1 | 1 | 0% | 1,658 | 3,447 | +108% | 0 | 0 | — |
case-22 | pass→pass | 5,937 | 2,600 | -56% | 1 | 1 | 0% | 1,037 | 3,386 | +227% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 15 counted toward the lift figure. The other 7 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +18 percentage points is the difference between those two pass rates over the 15 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.