Update agent-buildkit: Add apidog CLI Commands and Integrate Validators
Objective
Update agent-buildkit with apidog CLI commands and integrate technical-guide validators for enforcing standards across all projects.
Tasks
Add apidog CLI Commands
-
`buildkit apidog sync` - Sync all OpenAPI specs to Apidog -
`buildkit apidog validate` - Validate specs before publishing -
`buildkit apidog publish ` - Publish single spec to Apidog -
`buildkit apidog batch-import` - Batch import multiple specs -
Commands delegate to agent-router apidog service or use Apidog API
Integrate technical-guide Validators
-
Add `@bluefly/technical-guide` as dependency -
Use brand validator in `buildkit validate` commands -
Use API linter in `buildkit openapi lint` -
Import standard schemas for validation
Enhance OpenAPI Commands
-
`buildkit openapi discover` - Scan projects and update registry -
`buildkit openapi info` - Show API registry from technical-guide -
`buildkit openapi lint` - Use technical-guide linter config -
`buildkit openapi validate` - Validate against standards
Update Existing Commands
-
`buildkit openapi sync` - Use distributed spec locations -
`buildkit openapi generate` - Read specs from projects -
Add `--use-registry` flag to read from technical-guide index
CLI Command Examples
```bash
Sync all specs to Apidog
buildkit apidog sync --workspace /path/to/monorepo
Validate before publishing
buildkit apidog validate --spec ./openapi/openapi.yaml
Batch import
buildkit apidog batch-import --project-id 466943
Discover and update registry
buildkit openapi discover --update-registry
Lint with technical-guide standards
buildkit openapi lint --spec ./openapi/openapi.yaml ```
Integration with agent-router
```typescript // CLI commands call agent-router apidog service import axios from 'axios';
async function apidogSync() { const response = await axios.post('http://gateway.local.bluefly.io/api/v1/apidog/batch/plan', { workspaceRoot: process.cwd(), includePatterns: ['**/*.openapi.{yaml,yml}'] });
const planId = response.data.planId; await axios.post('http://gateway.local.bluefly.io/api/v1/apidog/batch/execute', { planId, platformProjectId: '466943' }); } ```
Validator Integration
```typescript import { validateBrand, validateAPISpec } from '@bluefly/technical-guide/validation';
// In buildkit validate command const brandResult = validateBrand(designFile); const apiResult = validateAPISpec(openapiFile); ```
Testing
-
All new CLI commands work correctly -
Validators enforce standards -
Commands integrate with agent-router apidog service -
OpenAPI discovery updates registry -
Lint catches common issues
Related
- Epic: #1
- Depends on: #2 (apidog migration), #5 (registry), #8 (npm package), #9 (agent-router)
- Next: #12 (update all consumers)
Files to Update
- `src/cli/commands/apidog.command.ts` (new file)
- `src/cli/commands/openapi.command.ts` (update)
- `src/services/openapi.service.ts` (update)
- `package.json` (add @bluefly/technical-guide dependency)
Success Criteria
-
✅ All apidog CLI commands work -
✅ Validators integrated and enforced -
✅ OpenAPI discovery updates registry -
✅ Lint catches standards violations -
✅ Commands used in CI/CD pipelines