[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F827F19V43SNQ3YYB1VQBH":3,"skill-same:01M6F827F19V43SNQ3YYB1VQBH":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":6,"ownerHtmlUrl":63,"ownerBlogUrl":64,"ownerDescription":65,"updatedAt":66,"install":67,"resources":80},"01M6F827F19V43SNQ3YYB1VQBH","maintainx-ci-integration",null,"Integrate MaintainX API testing into CI\u002FCD pipelines.\nUse when setting up automated testing, configuring CI workflows,\nor implementing continuous integration for MaintainX integrations.\nTrigger with phrases like \"maintainx ci\", \"maintainx github actions\",\n\"maintainx pipeline\", \"maintainx automated testing\", \"maintainx ci\u002Fcd\".","Dicklesworthstone\u002Fpi_agent_rust","Dicklesworthstone","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F35050222?v=4","01M6CG26AR942CSVMN1M5E3DSE","Jeff Emanuel","01M6CG26EPP71PSHW1VDS71121",1992,"MIT","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fmaintainx-pack\u002Fskills\u002Fmaintainx-ci-integration\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"integration","ci","maintainx ci integration","write","when","implementing","CI\u002FCD","io","continuous integration","ci workflows","up","integrate","edit","testing","read","integrations","Bash","api","pipeline","github actions","actions","workflows","2026-11-10 10:12:30",false,"---\nname: maintainx-ci-integration\ndescription: |\n  Integrate MaintainX API testing into CI\u002FCD pipelines.\n  Use when setting up automated testing, configuring CI workflows,\n  or implementing continuous integration for MaintainX integrations.\n  Trigger with phrases like \"maintainx ci\", \"maintainx github actions\",\n  \"maintainx pipeline\", \"maintainx automated testing\", \"maintainx ci\u002Fcd\".\nallowed-tools: Read, Write, Edit, Bash(npm:*), Grep\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# MaintainX CI Integration\n\n## Overview\n\nConfigure continuous integration pipelines for MaintainX integrations with automated testing, security scanning, and quality gates.\n\n## Prerequisites\n\n- Git repository with MaintainX integration\n- CI\u002FCD platform (GitHub Actions, GitLab CI, etc.)\n- Test environment with API access\n\n## Instructions\n\n### Step 1: GitHub Actions Workflow\n\n```yaml\n# .github\u002Fworkflows\u002Fmaintainx-ci.yml\nname: MaintainX Integration CI\n\non:\n  push:\n    branches: [main, develop]\n  pull_request:\n    branches: [main]\n\nenv:\n  NODE_VERSION: '20'\n\njobs:\n  lint:\n    name: Lint & Type Check\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Run ESLint\n        run: npm run lint\n\n      - name: Run TypeScript type check\n        run: npm run typecheck\n\n  unit-tests:\n    name: Unit Tests\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Run unit tests\n        run: npm run test:unit -- --coverage\n\n      - name: Upload coverage\n        uses: codecov\u002Fcodecov-action@v4\n        with:\n          files: .\u002Fcoverage\u002Flcov.info\n          fail_ci_if_error: true\n\n  integration-tests:\n    name: Integration Tests\n    runs-on: ubuntu-latest\n    needs: [lint, unit-tests]\n    # Only run on main branch to avoid rate limits\n    if: github.ref == 'refs\u002Fheads\u002Fmain'\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Run integration tests\n        env:\n          MAINTAINX_API_KEY: ${{ secrets.MAINTAINX_API_KEY_TEST }}\n          NODE_ENV: test\n        run: npm run test:integration\n\n  security-scan:\n    name: Security Scan\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Run npm audit\n        run: npm audit --production --audit-level=high\n\n      - name: Check for secrets\n        uses: trufflesecurity\u002Ftrufflehog@main\n        with:\n          path: .\u002F\n          base: ${{ github.event.repository.default_branch }}\n          extra_args: --only-verified\n\n  build:\n    name: Build\n    runs-on: ubuntu-latest\n    needs: [lint, unit-tests]\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Build\n        run: npm run build\n\n      - name: Upload build artifacts\n        uses: actions\u002Fupload-artifact@v4\n        with:\n          name: dist\n          path: dist\u002F\n```\n\n### Step 2: Test Configuration\n\n```typescript\n\u002F\u002F jest.config.js\nmodule.exports = {\n  preset: 'ts-jest',\n  testEnvironment: 'node',\n  roots: ['\u003CrootDir>\u002Ftests'],\n  collectCoverageFrom: ['src\u002F**\u002F*.ts', '!src\u002F**\u002F*.d.ts'],\n  coverageThreshold: {\n    global: {\n      branches: 80,\n      functions: 80,\n      lines: 80,\n      statements: 80,\n    },\n  },\n  testTimeout: 30000,\n  setupFilesAfterEnv: ['\u003CrootDir>\u002Ftests\u002Fsetup.ts'],\n  testPathIgnorePatterns: ['\u002Fnode_modules\u002F', '\u002Fdist\u002F'],\n\n  \u002F\u002F Test suites\n  projects: [\n    {\n      displayName: 'unit',\n      testMatch: ['\u003CrootDir>\u002Ftests\u002Funit\u002F**\u002F*.test.ts'],\n    },\n    {\n      displayName: 'integration',\n      testMatch: ['\u003CrootDir>\u002Ftests\u002Fintegration\u002F**\u002F*.test.ts'],\n    },\n  ],\n};\n```\n\n```typescript\n\u002F\u002F tests\u002Fsetup.ts\nimport dotenv from 'dotenv';\n\n\u002F\u002F Load test environment\ndotenv.config({ path: '.env.test' });\n\n\u002F\u002F Global test timeout\njest.setTimeout(30000);\n\n\u002F\u002F Global setup\nbeforeAll(() => {\n  \u002F\u002F Verify test environment\n  if (!process.env.MAINTAINX_API_KEY) {\n    console.warn('MAINTAINX_API_KEY not set - integration tests will be skipped');\n  }\n});\n\n\u002F\u002F Global teardown\nafterAll(() => {\n  \u002F\u002F Cleanup test data if needed\n});\n```\n\n### Step 3: Unit Tests with Mocks\n\n```typescript\n\u002F\u002F tests\u002Funit\u002Fclient.test.ts\nimport { MaintainXClient } from '..\u002F..\u002Fsrc\u002Fapi\u002Fmaintainx-client';\nimport axios from 'axios';\n\njest.mock('axios');\nconst mockedAxios = axios as jest.Mocked\u003Ctypeof axios>;\n\ndescribe('MaintainXClient', () => {\n  beforeEach(() => {\n    process.env.MAINTAINX_API_KEY = 'test_api_key';\n    jest.clearAllMocks();\n\n    mockedAxios.create.mockReturnValue({\n      get: jest.fn(),\n      post: jest.fn(),\n      interceptors: {\n        request: { use: jest.fn() },\n        response: { use: jest.fn() },\n      },\n    } as any);\n  });\n\n  describe('constructor', () => {\n    it('should throw if API key not provided', () => {\n      delete process.env.MAINTAINX_API_KEY;\n      expect(() => new MaintainXClient()).toThrow('MAINTAINX_API_KEY is required');\n    });\n\n    it('should create client with valid API key', () => {\n      const client = new MaintainXClient();\n      expect(client).toBeDefined();\n    });\n  });\n\n  describe('getWorkOrders', () => {\n    it('should fetch work orders', async () => {\n      const mockResponse = {\n        data: {\n          workOrders: [{ id: 'wo_1', title: 'Test' }],\n          nextCursor: null,\n        },\n      };\n\n      const client = new MaintainXClient();\n      (client as any).client.get = jest.fn().mockResolvedValue(mockResponse);\n\n      const result = await client.getWorkOrders({ limit: 10 });\n\n      expect(result.workOrders).toHaveLength(1);\n      expect(result.workOrders[0].id).toBe('wo_1');\n    });\n\n    it('should handle pagination parameters', async () => {\n      const client = new MaintainXClient();\n      (client as any).client.get = jest.fn().mockResolvedValue({ data: { workOrders: [] } });\n\n      await client.getWorkOrders({ limit: 50, cursor: 'abc123' });\n\n      expect((client as any).client.get).toHaveBeenCalledWith('\u002Fworkorders', {\n        params: { limit: 50, cursor: 'abc123' },\n      });\n    });\n  });\n\n  describe('createWorkOrder', () => {\n    it('should create work order with required fields', async () => {\n      const mockResponse = {\n        data: { id: 'wo_new', title: 'New WO', status: 'OPEN' },\n      };\n\n      const client = new MaintainXClient();\n      (client as any).client.post = jest.fn().mockResolvedValue(mockResponse);\n\n      const result = await client.createWorkOrder({ title: 'New WO' });\n\n      expect(result.id).toBe('wo_new');\n      expect((client as any).client.post).toHaveBeenCalledWith('\u002Fworkorders', { title: 'New WO' });\n    });\n  });\n});\n```\n\n### Step 4: Integration Tests\n\n```typescript\n\u002F\u002F tests\u002Fintegration\u002Fapi.test.ts\nimport { MaintainXClient } from '..\u002F..\u002Fsrc\u002Fapi\u002Fmaintainx-client';\n\n\u002F\u002F Skip if no API key\nconst describeIfApiKey = process.env.MAINTAINX_API_KEY\n  ? describe\n  : describe.skip;\n\ndescribeIfApiKey('MaintainX API Integration', () => {\n  let client: MaintainXClient;\n  let createdWorkOrderId: string;\n\n  beforeAll(() => {\n    client = new MaintainXClient();\n  });\n\n  afterAll(async () => {\n    \u002F\u002F Cleanup: Delete test work orders\n    \u002F\u002F Note: Implement if delete endpoint is available\n  });\n\n  describe('Work Orders', () => {\n    it('should list work orders', async () => {\n      const response = await client.getWorkOrders({ limit: 5 });\n\n      expect(response).toHaveProperty('workOrders');\n      expect(Array.isArray(response.workOrders)).toBe(true);\n    });\n\n    it('should create a work order', async () => {\n      const testTitle = `CI Test - ${new Date().toISOString()}`;\n\n      const workOrder = await client.createWorkOrder({\n        title: testTitle,\n        description: 'Created by CI integration test',\n        priority: 'LOW',\n      });\n\n      expect(workOrder).toHaveProperty('id');\n      expect(workOrder.title).toBe(testTitle);\n      expect(workOrder.status).toBe('OPEN');\n\n      createdWorkOrderId = workOrder.id;\n    });\n\n    it('should get a single work order', async () => {\n      \u002F\u002F Skip if create didn't work\n      if (!createdWorkOrderId) {\n        console.warn('Skipping: No work order created');\n        return;\n      }\n\n      const workOrder = await client.getWorkOrder(createdWorkOrderId);\n\n      expect(workOrder.id).toBe(createdWorkOrderId);\n    });\n\n    it('should filter work orders by status', async () => {\n      const response = await client.getWorkOrders({\n        status: 'OPEN',\n        limit: 10,\n      });\n\n      response.workOrders.forEach(wo => {\n        expect(wo.status).toBe('OPEN');\n      });\n    });\n  });\n\n  describe('Assets', () => {\n    it('should list assets', async () => {\n      const response = await client.getAssets({ limit: 5 });\n\n      expect(response).toHaveProperty('assets');\n      expect(Array.isArray(response.assets)).toBe(true);\n    });\n  });\n\n  describe('Locations', () => {\n    it('should list locations', async () => {\n      const response = await client.getLocations({ limit: 5 });\n\n      expect(response).toHaveProperty('locations');\n      expect(Array.isArray(response.locations)).toBe(true);\n    });\n  });\n\n  describe('Users', () => {\n    it('should list users', async () => {\n      const response = await client.getUsers({ limit: 5 });\n\n      expect(response).toHaveProperty('users');\n      expect(Array.isArray(response.users)).toBe(true);\n    });\n  });\n});\n```\n\n### Step 5: GitLab CI Configuration\n\n```yaml\n# .gitlab-ci.yml\nstages:\n  - validate\n  - test\n  - build\n  - deploy\n\nvariables:\n  NODE_VERSION: '20'\n\n.node-setup:\n  image: node:${NODE_VERSION}\n  cache:\n    key: ${CI_COMMIT_REF_SLUG}\n    paths:\n      - node_modules\u002F\n\nlint:\n  extends: .node-setup\n  stage: validate\n  script:\n    - npm ci\n    - npm run lint\n    - npm run typecheck\n\nunit-tests:\n  extends: .node-setup\n  stage: test\n  script:\n    - npm ci\n    - npm run test:unit -- --coverage\n  coverage: '\u002FAll files[^|]*\\|[^|]*\\s+([\\d\\.]+)\u002F'\n  artifacts:\n    reports:\n      coverage_report:\n        coverage_format: cobertura\n        path: coverage\u002Fcobertura-coverage.xml\n\nintegration-tests:\n  extends: .node-setup\n  stage: test\n  only:\n    - main\n  script:\n    - npm ci\n    - npm run test:integration\n  variables:\n    MAINTAINX_API_KEY: $MAINTAINX_API_KEY_TEST\n\nsecurity-scan:\n  extends: .node-setup\n  stage: validate\n  script:\n    - npm ci\n    - npm audit --production --audit-level=high\n  allow_failure: true\n\nbuild:\n  extends: .node-setup\n  stage: build\n  script:\n    - npm ci\n    - npm run build\n  artifacts:\n    paths:\n      - dist\u002F\n    expire_in: 1 week\n```\n\n### Step 6: Package.json Scripts\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"tsc\",\n    \"lint\": \"eslint 'src\u002F**\u002F*.ts' 'tests\u002F**\u002F*.ts'\",\n    \"lint:fix\": \"eslint 'src\u002F**\u002F*.ts' 'tests\u002F**\u002F*.ts' --fix\",\n    \"typecheck\": \"tsc --noEmit\",\n    \"test\": \"jest\",\n    \"test:unit\": \"jest --selectProjects unit\",\n    \"test:integration\": \"jest --selectProjects integration\",\n    \"test:watch\": \"jest --watch\",\n    \"test:coverage\": \"jest --coverage\",\n    \"ci\": \"npm run lint && npm run typecheck && npm run test:unit && npm run build\"\n  }\n}\n```\n\n## Output\n\n- GitHub Actions workflow configured\n- GitLab CI pipeline configured\n- Unit tests with mocks\n- Integration tests with real API\n- Security scanning enabled\n\n## Best Practices\n\n1. **Separate test types**: Unit tests run fast on every commit; integration tests on main only\n2. **Use test API keys**: Never use production keys in CI\n3. **Rate limit awareness**: Add delays between integration tests\n4. **Clean up test data**: Delete test work orders after tests\n5. **Cache dependencies**: Speed up CI with npm caching\n\n## Resources\n\n- [GitHub Actions Documentation](https:\u002F\u002Fdocs.github.com\u002Fen\u002Factions)\n- [Jest Documentation](https:\u002F\u002Fjestjs.io\u002F)\n- [MaintainX API Documentation](https:\u002F\u002Fmaintainx.dev\u002F)\n\n## Next Steps\n\nFor deployment automation, see `maintainx-deploy-integration`.\n","# MaintainX CI Integration\n\n## Overview\n\nConfigure continuous integration pipelines for MaintainX integrations with automated testing, security scanning, and quality gates.\n\n## Prerequisites\n\n- Git repository with MaintainX integration\n- CI\u002FCD platform (GitHub Actions, GitLab CI, etc.)\n- Test environment with API access\n\n## Instructions\n\n### Step 1: GitHub Actions Workflow\n\n```yaml\n# .github\u002Fworkflows\u002Fmaintainx-ci.yml\nname: MaintainX Integration CI\n\non:\n  push:\n    branches: [main, develop]\n  pull_request:\n    branches: [main]\n\nenv:\n  NODE_VERSION: '20'\n\njobs:\n  lint:\n    name: Lint & Type Check\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Run ESLint\n        run: npm run lint\n\n      - name: Run TypeScript type check\n        run: npm run typecheck\n\n  unit-tests:\n    name: Unit Tests\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Run unit tests\n        run: npm run test:unit -- --coverage\n\n      - name: Upload coverage\n        uses: codecov\u002Fcodecov-action@v4\n        with:\n          files: .\u002Fcoverage\u002Flcov.info\n          fail_ci_if_error: true\n\n  integration-tests:\n    name: Integration Tests\n    runs-on: ubuntu-latest\n    needs: [lint, unit-tests]\n    # Only run on main branch to avoid rate limits\n    if: github.ref == 'refs\u002Fheads\u002Fmain'\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Run integration tests\n        env:\n          MAINTAINX_API_KEY: ${{ secrets.MAINTAINX_API_KEY_TEST }}\n          NODE_ENV: test\n        run: npm run test:integration\n\n  security-scan:\n    name: Security Scan\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Run npm audit\n        run: npm audit --production --audit-level=high\n\n      - name: Check for secrets\n        uses: trufflesecurity\u002Ftrufflehog@main\n        with:\n          path: .\u002F\n          base: ${{ github.event.repository.default_branch }}\n          extra_args: --only-verified\n\n  build:\n    name: Build\n    runs-on: ubuntu-latest\n    needs: [lint, unit-tests]\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Setup Node.js\n        uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: ${{ env.NODE_VERSION }}\n          cache: 'npm'\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Build\n        run: npm run build\n\n      - name: Upload build artifacts\n        uses: actions\u002Fupload-artifact@v4\n        with:\n          name: dist\n          path: dist\u002F\n```\n\n### Step 2: Test Configuration\n\n```typescript\n\u002F\u002F jest.config.js\nmodule.exports = {\n  preset: 'ts-jest',\n  testEnvironment: 'node',\n  roots: ['\u003CrootDir>\u002Ftests'],\n  collectCoverageFrom: ['src\u002F**\u002F*.ts', '!src\u002F**\u002F*.d.ts'],\n  coverageThreshold: {\n    global: {\n      branches: 80,\n      functions: 80,\n      lines: 80,\n      statements: 80,\n    },\n  },\n  testTimeout: 30000,\n  setupFilesAfterEnv: ['\u003CrootDir>\u002Ftests\u002Fsetup.ts'],\n  testPathIgnorePatterns: ['\u002Fnode_modules\u002F', '\u002Fdist\u002F'],\n\n  \u002F\u002F Test suites\n  projects: [\n    {\n      displayName: 'unit',\n      testMatch: ['\u003CrootDir>\u002Ftests\u002Funit\u002F**\u002F*.test.ts'],\n    },\n    {\n      displayName: 'integration',\n      testMatch: ['\u003CrootDir>\u002Ftests\u002Fintegration\u002F**\u002F*.test.ts'],\n    },\n  ],\n};\n```\n\n```typescript\n\u002F\u002F tests\u002Fsetup.ts\nimport dotenv from 'dotenv';\n\n\u002F\u002F Load test environment\ndotenv.config({ path: '.env.test' });\n\n\u002F\u002F Global test timeout\njest.setTimeout(30000);\n\n\u002F\u002F Global setup\nbeforeAll(() => {\n  \u002F\u002F Verify test environment\n  if (!process.env.MAINTAINX_API_KEY) {\n    console.warn('MAINTAINX_API_KEY not set - integration tests will be skipped');\n  }\n});\n\n\u002F\u002F Global teardown\nafterAll(() => {\n  \u002F\u002F Cleanup test data if needed\n});\n```\n\n### Step 3: Unit Tests with Mocks\n\n```typescript\n\u002F\u002F tests\u002Funit\u002Fclient.test.ts\nimport { MaintainXClient } from '..\u002F..\u002Fsrc\u002Fapi\u002Fmaintainx-client';\nimport axios from 'axios';\n\njest.mock('axios');\nconst mockedAxios = axios as jest.Mocked\u003Ctypeof axios>;\n\ndescribe('MaintainXClient', () => {\n  beforeEach(() => {\n    process.env.MAINTAINX_API_KEY = 'test_api_key';\n    jest.clearAllMocks();\n\n    mockedAxios.create.mockReturnValue({\n      get: jest.fn(),\n      post: jest.fn(),\n      interceptors: {\n        request: { use: jest.fn() },\n        response: { use: jest.fn() },\n      },\n    } as any);\n  });\n\n  describe('constructor', () => {\n    it('should throw if API key not provided', () => {\n      delete process.env.MAINTAINX_API_KEY;\n      expect(() => new MaintainXClient()).toThrow('MAINTAINX_API_KEY is required');\n    });\n\n    it('should create client with valid API key', () => {\n      const client = new MaintainXClient();\n      expect(client).toBeDefined();\n    });\n  });\n\n  describe('getWorkOrders', () => {\n    it('should fetch work orders', async () => {\n      const mockResponse = {\n        data: {\n          workOrders: [{ id: 'wo_1', title: 'Test' }],\n          nextCursor: null,\n        },\n      };\n\n      const client = new MaintainXClient();\n      (client as any).client.get = jest.fn().mockResolvedValue(mockResponse);\n\n      const result = await client.getWorkOrders({ limit: 10 });\n\n      expect(result.workOrders).toHaveLength(1);\n      expect(result.workOrders[0].id).toBe('wo_1');\n    });\n\n    it('should handle pagination parameters', async () => {\n      const client = new MaintainXClient();\n      (client as any).client.get = jest.fn().mockResolvedValue({ data: { workOrders: [] } });\n\n      await client.getWorkOrders({ limit: 50, cursor: 'abc123' });\n\n      expect((client as any).client.get).toHaveBeenCalledWith('\u002Fworkorders', {\n        params: { limit: 50, cursor: 'abc123' },\n      });\n    });\n  });\n\n  describe('createWorkOrder', () => {\n    it('should create work order with required fields', async () => {\n      const mockResponse = {\n        data: { id: 'wo_new', title: 'New WO', status: 'OPEN' },\n      };\n\n      const client = new MaintainXClient();\n      (client as any).client.post = jest.fn().mockResolvedValue(mockResponse);\n\n      const result = await client.createWorkOrder({ title: 'New WO' });\n\n      expect(result.id).toBe('wo_new');\n      expect((client as any).client.post).toHaveBeenCalledWith('\u002Fworkorders', { title: 'New WO' });\n    });\n  });\n});\n```\n\n### Step 4: Integration Tests\n\n```typescript\n\u002F\u002F tests\u002Fintegration\u002Fapi.test.ts\nimport { MaintainXClient } from '..\u002F..\u002Fsrc\u002Fapi\u002Fmaintainx-client';\n\n\u002F\u002F Skip if no API key\nconst describeIfApiKey = process.env.MAINTAINX_API_KEY\n  ? describe\n  : describe.skip;\n\ndescribeIfApiKey('MaintainX API Integration', () => {\n  let client: MaintainXClient;\n  let createdWorkOrderId: string;\n\n  beforeAll(() => {\n    client = new MaintainXClient();\n  });\n\n  afterAll(async () => {\n    \u002F\u002F Cleanup: Delete test work orders\n    \u002F\u002F Note: Implement if delete endpoint is available\n  });\n\n  describe('Work Orders', () => {\n    it('should list work orders', async () => {\n      const response = await client.getWorkOrders({ limit: 5 });\n\n      expect(response).toHaveProperty('workOrders');\n      expect(Array.isArray(response.workOrders)).toBe(true);\n    });\n\n    it('should create a work order', async () => {\n      const testTitle = `CI Test - ${new Date().toISOString()}`;\n\n      const workOrder = await client.createWorkOrder({\n        title: testTitle,\n        description: 'Created by CI integration test',\n        priority: 'LOW',\n      });\n\n      expect(workOrder).toHaveProperty('id');\n      expect(workOrder.title).toBe(testTitle);\n      expect(workOrder.status).toBe('OPEN');\n\n      createdWorkOrderId = workOrder.id;\n    });\n\n    it('should get a single work order', async () => {\n      \u002F\u002F Skip if create didn't work\n      if (!createdWorkOrderId) {\n        console.warn('Skipping: No work order created');\n        return;\n      }\n\n      const workOrder = await client.getWorkOrder(createdWorkOrderId);\n\n      expect(workOrder.id).toBe(createdWorkOrderId);\n    });\n\n    it('should filter work orders by status', async () => {\n      const response = await client.getWorkOrders({\n        status: 'OPEN',\n        limit: 10,\n      });\n\n      response.workOrders.forEach(wo => {\n        expect(wo.status).toBe('OPEN');\n      });\n    });\n  });\n\n  describe('Assets', () => {\n    it('should list assets', async () => {\n      const response = await client.getAssets({ limit: 5 });\n\n      expect(response).toHaveProperty('assets');\n      expect(Array.isArray(response.assets)).toBe(true);\n    });\n  });\n\n  describe('Locations', () => {\n    it('should list locations', async () => {\n      const response = await client.getLocations({ limit: 5 });\n\n      expect(response).toHaveProperty('locations');\n      expect(Array.isArray(response.locations)).toBe(true);\n    });\n  });\n\n  describe('Users', () => {\n    it('should list users', async () => {\n      const response = await client.getUsers({ limit: 5 });\n\n      expect(response).toHaveProperty('users');\n      expect(Array.isArray(response.users)).toBe(true);\n    });\n  });\n});\n```\n\n### Step 5: GitLab CI Configuration\n\n```yaml\n# .gitlab-ci.yml\nstages:\n  - validate\n  - test\n  - build\n  - deploy\n\nvariables:\n  NODE_VERSION: '20'\n\n.node-setup:\n  image: node:${NODE_VERSION}\n  cache:\n    key: ${CI_COMMIT_REF_SLUG}\n    paths:\n      - node_modules\u002F\n\nlint:\n  extends: .node-setup\n  stage: validate\n  script:\n    - npm ci\n    - npm run lint\n    - npm run typecheck\n\nunit-tests:\n  extends: .node-setup\n  stage: test\n  script:\n    - npm ci\n    - npm run test:unit -- --coverage\n  coverage: '\u002FAll files[^|]*\\|[^|]*\\s+([\\d\\.]+)\u002F'\n  artifacts:\n    reports:\n      coverage_report:\n        coverage_format: cobertura\n        path: coverage\u002Fcobertura-coverage.xml\n\nintegration-tests:\n  extends: .node-setup\n  stage: test\n  only:\n    - main\n  script:\n    - npm ci\n    - npm run test:integration\n  variables:\n    MAINTAINX_API_KEY: $MAINTAINX_API_KEY_TEST\n\nsecurity-scan:\n  extends: .node-setup\n  stage: validate\n  script:\n    - npm ci\n    - npm audit --production --audit-level=high\n  allow_failure: true\n\nbuild:\n  extends: .node-setup\n  stage: build\n  script:\n    - npm ci\n    - npm run build\n  artifacts:\n    paths:\n      - dist\u002F\n    expire_in: 1 week\n```\n\n### Step 6: Package.json Scripts\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"tsc\",\n    \"lint\": \"eslint 'src\u002F**\u002F*.ts' 'tests\u002F**\u002F*.ts'\",\n    \"lint:fix\": \"eslint 'src\u002F**\u002F*.ts' 'tests\u002F**\u002F*.ts' --fix\",\n    \"typecheck\": \"tsc --noEmit\",\n    \"test\": \"jest\",\n    \"test:unit\": \"jest --selectProjects unit\",\n    \"test:integration\": \"jest --selectProjects integration\",\n    \"test:watch\": \"jest --watch\",\n    \"test:coverage\": \"jest --coverage\",\n    \"ci\": \"npm run lint && npm run typecheck && npm run test:unit && npm run build\"\n  }\n}\n```\n\n## Output\n\n- GitHub Actions workflow configured\n- GitLab CI pipeline configured\n- Unit tests with mocks\n- Integration tests with real API\n- Security scanning enabled\n\n## Best Practices\n\n1. **Separate test types**: Unit tests run fast on every commit; integration tests on main only\n2. **Use test API keys**: Never use production keys in CI\n3. **Rate limit awareness**: Add delays between integration tests\n4. **Clean up test data**: Delete test work orders after tests\n5. **Cache dependencies**: Speed up CI with npm caching\n\n## Resources\n\n- [GitHub Actions Documentation](https:\u002F\u002Fdocs.github.com\u002Fen\u002Factions)\n- [Jest Documentation](https:\u002F\u002Fjestjs.io\u002F)\n- [MaintainX API Documentation](https:\u002F\u002Fmaintainx.dev\u002F)\n\n## Next Steps\n\nFor deployment automation, see `maintainx-deploy-integration`.\n",{"name":5,"author":54,"license":15,"version":55,"description":56,"allowed-tools":57},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Integrate MaintainX API testing into CI\u002FCD pipelines.\nUse when setting up automated testing, configuring CI workflows,\nor implementing continuous integration for MaintainX integrations.\nTrigger with phrases like \"maintainx ci\", \"maintainx github actions\",\n\"maintainx pipeline\", \"maintainx automated testing\", \"maintainx ci\u002Fcd\".\n","Read, Write, Edit, Bash(npm:*), Grep","main","90b50ed0778745a80fd5bfb13b1843d45b9e82f7","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fmaintainx-pack\u002Fskills\u002Fmaintainx-ci-integration",233,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust","https:\u002F\u002Fgithub.com\u002FDicklesworthstone","https:\u002F\u002Fwww.jeffreyemanuel.com\u002F","Building in NY","2026-11-15 01:54:15",{"source":8,"skillName":5,"commands":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill maintainx-ci-integration",{"tool":73,"command":74},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill maintainx-ci-integration",{"tool":76,"command":77},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill maintainx-ci-integration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fmaintainx-pack\u002Fskills\u002Fmaintainx-ci-integration\u002FSKILL.md",true,[],[82,114,150,170,196,221],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":87,"sourceHtmlUrl":88,"categories":89,"keywords":93,"publishedAt":113},"01M6FCR7G5A005P364Z6ZWCJDP","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FSKILL.md",[90],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",[94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],"theme factory","factory","theme","docs","toolkit","generate","artifacts","SET","fly","slides","landing","html","styling","artifact","pages","themes","with","you","fonts","2026-11-11 15:11:14",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":118,"sourceHtmlUrl":119,"categories":120,"keywords":124,"publishedAt":49},"01M6FEGPPK0ZTKCCM0R3E3KS33","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[121],{"categoryNo":122,"categoryName":123,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[125,126,100,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,105,143,144,145,146,147,148,149],"web artifacts builder","web","artifacts builder","builder","frontend","css","components","react","component","routing","state management","state","shadcn","file","ui","Tools","Tailwind","use","single-file","simple","ui components","multi","for","jsx","suite",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":154,"sourceHtmlUrl":155,"categories":156,"keywords":159,"publishedAt":49},"01M6FEE9VTK1W4GY21AKREJXRG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[157,158],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":122,"categoryName":123,"taxonomyType":21,"taxonomyTypeDesc":22},[40,160,161,129,162,163,126,164,98,165,139,166,167,168,169,110,147],"webapp testing","webapp","screenshots","playwright","debugging","browser","logs","applications","behavior","local",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":174,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":49},"01M6FE20F7ZTQBFWKF4MPJ2SBX","neuropixels-analysis","Neuropixels neural recording analysis. Load SpikeGLX\u002FOpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen\u002FIBL curation, AI-assisted visual analysis, for Neuropixels 1.0\u002F2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FSKILL.md",[],[178,179,180,181,182,183,184,185,142,186,187,188,189,190,191,192,110,193,194,195,147,31],"analysis","neuropixels analysis","spike","metrics","data","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load",{"skillNo":197,"name":198,"nameZh":6,"description":199,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":86,"licenseFileUrl":200,"sourceHtmlUrl":201,"categories":202,"keywords":206,"publishedAt":49},"01M6FDP0PDK6F1GGX395C7625Z","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[203],{"categoryNo":204,"categoryName":205,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[207,208,48,209,210,211,212,213,42,214,215,216,217,218,110,147,219,31,220],"skill creator","creator","create","update","capabilities","knowledge","tool","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":222,"name":223,"nameZh":6,"description":224,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":225,"sourceHtmlUrl":226,"categories":227,"keywords":229,"publishedAt":49},"01M6FDM8Y7VK7NYG9SM7QPA3PW","notebooklm","Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FSKILL.md",[228],{"categoryNo":204,"categoryName":205,"taxonomyType":21,"taxonomyTypeDesc":22},[223,230,231,232,233,234,235,165,236,237,142,238,239,240,241,147,242],"google","browser automation","gemini","automation","auth","code","library","management","only","document","query","Citation","source"]