@lushly-dev/afd-testing weekly downloads statistics
By lushly-dev (4 listings) · npm · MCP servers
Testing utilities for Agent-First Development
@lushly-dev/afd-testing has 6,557 recorded weekly downloads on npm, a decrease of 74.1% over the past 30 days, ranking #1431 of 3,247 tracked listings.
About @lushly-dev/afd-testing
@lushly-dev/afd-testing
Testing utilities for Agent-First Development.
Installation
npm install @lushly-dev/afd-testing zod --save-dev
# or
pnpm add @lushly-dev/afd-testing zod -D
zod (^4.6.6) is a peer dependency, shared with @lushly-dev/afd-server; an application that already depends on it needs no second install.
Overview
This package provides utilities for testing AFD commands:
- Validators: Validate command results and definitions
- Surface Validation: Cross-command semantic quality analysis (similarity, schema overlap, naming, injection detection)
- Test Helpers: Easy command testing with validation
- Assertions: Custom assertions for command results
- Mock Server: In-memory MCP server for testing
- JTBD Scenario Runner: Jobs-to-be-Done scenario testing with YAML files
- Fixtures: Pre-seeded test data with inheritance and overrides
- Step References: Dynamic references between scenario steps
- Scenario Commands: List, evaluate, coverage, create, and suggest scenarios
- MCP Agent Integration: Expose commands as MCP tools with agent hints
Subprocess Scenario Execution
ScenarioExecutor can run each step through the installed afd CLI. The
server URL and transport are passed to each afd call without changing the
developer's saved CLI connection:
import { ScenarioExecutor } from '@lushly-dev/afd-testing';
const executor = new ScenarioExecutor({
cliPath: '/path/to/afd',
serverUrl: 'http://localhost:3100/mcp',
transport: 'http',
});
The wrapper uses the public CLI contract: positional JSON input plus
--format json. Malformed CLI output is reported as a scenario parse error.
Surface Validation (Semantic Quality)
Cross-command analysis that detects semantic collisions, naming ambiguities, schema overlaps, and prompt injection risks. Designed for command sets of 50+ where agents struggle to pick the right tool.
Basic Usage
import { validateCommandSurface } from '@lushly-dev/afd-testing';
const result = validateCommandSurface(commands, {
similarityThreshold: 0.7,
schemaOverlapThreshold: 0.8,
strict: false,
});
console.log(result.valid); // true if no errors (or no errors+warnings in strict mode)
console.log(result.summary); // { commandCount, errorCount, warningCount, infoCount, ... }
console.log(result.findings); // SurfaceFinding[] with rule, severity, message, suggestion
Input Types
validateCommandSurface() accepts both ZodCommandDefinition[] (from @lushly-dev/afd-server) and CommandDefinition[] (from @lushly-dev/afd-core). Input is auto-detected via duck-typing.
Validation Rules
| Rule | Severity | Description |
|---|---|---|
similar-descriptions | Warning | Command pairs with highly similar descriptions (cosine similarity) |
schema-overlap | Warning | Command pairs sharing a high percentage of input fields |
naming-convention | Error | Command names not matching kebab-case domain-action pattern |
naming-collision | Error | Command names that collide when separators are normalized |
missing-category | Info | Commands without a category field |
description-injection | Error | Descriptions containing prompt injection patterns |
description-quality | Warning | Descriptions that are too short or missing action verbs |
orphaned-category | Info | Categories containing only one command |
schema-complexity | Warning/Info | Input schemas too complex for agents (unions, nesting, constraints) |
unresolved-prerequisite | Error | requires entry references a command not in the surface |
circular-prerequisite | Error | Circular dependency cycle in the requires graph |
missing-output-schema | Info | Command does not declare an output schema |
missing-context | Info | Command has no contexts array (when server has configured contexts) |
Options
interface SurfaceValidationOptions {
similarityThreshold?: number; // Default: 0.7 (70% similarity triggers warning)
schemaOverlapThreshold?: number; // Default: 0.8 (80% field overlap triggers warning)
detectInjection?: boolean; // Default: true
checkDescriptionQuality?: boolean; // Default: true
minDescriptionLength?: number; // Default: 20
enforceNaming?: boolean; // Default: true
namingPattern?: RegExp; // Default: /^[a-z][a-z0-9]*-[a-z][a-z0-9-]*$/
skipCategories?: string[]; // Categories to exclude from analysis
strict?: boolean; // Treat warnings as errors
suppressions?: string[]; // Suppress specific findings
additionalInjectionPatterns?: InjectionPattern[]; // Added to the built-in patterns
checkSchemaComplexity?: boolean; // Default: true
schemaComplexityThreshold?: number; // Default: 13 (warning threshold)
}
Suppressions
Suppress findings at the rule level or for specific command pairs:
const result = validateCommandSurface(commands, {
suppressions: [
'missing-category', // Suppress all missing-category findings
'schema-complexity:auth-sign-in', // Suppress for a single command
'similar-descriptions:user-get:user-fetch', // Suppress only this pair (order-independent)
],
});
CLI Integration
# Run surface validation against a connected MCP server
afd validate --surface
# With custom threshold
afd validate --surface --similarity-threshold 0.8
# Skip categories and suppress rules
afd validate --surface --skip-category internal --suppress missing-category
# Strict mode (warnings = errors)
afd validate --surface --strict --verbose
```…
Description from the npm listing.
- afd
- testing
- mcp
- validation
- commands
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm MCP servers plugins
All 20 @lushly-dev/afd-testing alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@lushly-dev/afd-testing. First seen Oct 16, 2026; last successful collection Dec 5, 2026. See the methodology.