@synapta/skills 0.1.1 → 0.2.0
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.
- package/dist/index.js +11 -4
- package/package.json +3 -4
- package/skills/ATTRIBUTION.md +80 -0
- package/skills/accessibility-audit/SKILL.md +325 -0
- package/skills/accessibility-audit/reference/wcag-checklist.md +103 -0
- package/skills/apns-notifier/SKILL.md +86 -0
- package/skills/approval-policy-enforcer/SKILL.md +66 -0
- package/skills/apps-sdk-builder/LICENSE.txt +201 -0
- package/skills/apps-sdk-builder/SKILL.md +328 -0
- package/skills/apps-sdk-builder/agents/openai.yaml +13 -0
- package/skills/apps-sdk-builder/references/app-archetypes.md +132 -0
- package/skills/apps-sdk-builder/references/apps-sdk-docs-workflow.md +135 -0
- package/skills/apps-sdk-builder/references/interactive-state-sync-patterns.md +113 -0
- package/skills/apps-sdk-builder/references/repo-contract-and-validation.md +93 -0
- package/skills/apps-sdk-builder/references/search-fetch-standard.md +67 -0
- package/skills/apps-sdk-builder/references/upstream-example-workflow.md +79 -0
- package/skills/apps-sdk-builder/references/window-openai-patterns.md +79 -0
- package/skills/apps-sdk-builder/scripts/scaffold_node_ext_apps.mjs +606 -0
- package/skills/architecture-selector/SKILL.md +64 -0
- package/skills/backlog-planner/SKILL.md +68 -0
- package/skills/carplay-entitlement-checker/SKILL.md +82 -0
- package/skills/concept-deepener/SKILL.md +86 -0
- package/skills/concept-discovery/SKILL.md +517 -0
- package/skills/concept-discovery/assets/sample-analysis.json +81 -0
- package/skills/concept-discovery/expected_outputs/sample-enum-dictionary.md +25 -0
- package/skills/concept-discovery/expected_outputs/sample-page-user-list.md +83 -0
- package/skills/concept-discovery/expected_outputs/sample-prd-readme.md +43 -0
- package/skills/concept-discovery/references/framework-patterns.md +228 -0
- package/skills/concept-discovery/references/prd-quality-checklist.md +65 -0
- package/skills/concept-discovery/scripts/codebase_analyzer.py +732 -0
- package/skills/concept-discovery/scripts/prd_scaffolder.py +435 -0
- package/skills/dast-zap/SKILL.md +453 -0
- package/skills/dast-zap/assets/.gitkeep +9 -0
- package/skills/dast-zap/assets/github_action.yml +207 -0
- package/skills/dast-zap/assets/gitlab_ci.yml +226 -0
- package/skills/dast-zap/assets/zap_automation.yaml +196 -0
- package/skills/dast-zap/assets/zap_context.xml +192 -0
- package/skills/dast-zap/references/EXAMPLE.md +40 -0
- package/skills/dast-zap/references/api_testing_guide.md +475 -0
- package/skills/dast-zap/references/authentication_guide.md +431 -0
- package/skills/dast-zap/references/false_positive_handling.md +427 -0
- package/skills/dast-zap/references/owasp_mapping.md +255 -0
- package/skills/dep-sbom-scan/SKILL.md +466 -0
- package/skills/deploy-cloudflare/SKILL.md +930 -0
- package/skills/deploy-docker/SKILL.md +55 -0
- package/skills/deploy-fly/SKILL.md +228 -0
- package/skills/deploy-k8s/SKILL.md +108 -0
- package/skills/deploy-k8s/assets/logo.png +0 -0
- package/skills/deploy-k8s/docs/README.md +29 -0
- package/skills/deploy-k8s/docs/SUMMARY.md +56 -0
- package/skills/deploy-k8s/docs/advanced/token-efficiency.md +61 -0
- package/skills/deploy-k8s/docs/architecture/multi-tenancy.md +96 -0
- package/skills/deploy-k8s/docs/architecture/storage-and-state.md +102 -0
- package/skills/deploy-k8s/docs/architecture/workload-patterns.md +87 -0
- package/skills/deploy-k8s/docs/book.json +16 -0
- package/skills/deploy-k8s/docs/community/changelog.md +34 -0
- package/skills/deploy-k8s/docs/community/contributing.md +67 -0
- package/skills/deploy-k8s/docs/core-concepts/failure-modes.md +153 -0
- package/skills/deploy-k8s/docs/core-concepts/philosophy.md +83 -0
- package/skills/deploy-k8s/docs/core-concepts/workflow.md +124 -0
- package/skills/deploy-k8s/docs/examples/bad-patterns.md +47 -0
- package/skills/deploy-k8s/docs/examples/do-dont-checklist.md +37 -0
- package/skills/deploy-k8s/docs/examples/good-patterns.md +49 -0
- package/skills/deploy-k8s/docs/failure-modes/api-drift.md +104 -0
- package/skills/deploy-k8s/docs/failure-modes/fragile-rollouts.md +99 -0
- package/skills/deploy-k8s/docs/failure-modes/insecure-workload-defaults.md +80 -0
- package/skills/deploy-k8s/docs/failure-modes/network-exposure.md +98 -0
- package/skills/deploy-k8s/docs/failure-modes/privilege-sprawl.md +91 -0
- package/skills/deploy-k8s/docs/failure-modes/resource-starvation.md +85 -0
- package/skills/deploy-k8s/docs/getting-started/installation.md +152 -0
- package/skills/deploy-k8s/docs/getting-started/quick-start.md +115 -0
- package/skills/deploy-k8s/docs/guides/helm-patterns.md +71 -0
- package/skills/deploy-k8s/docs/guides/kustomize-patterns.md +65 -0
- package/skills/deploy-k8s/docs/guides/observability.md +67 -0
- package/skills/deploy-k8s/docs/guides/security-hardening.md +59 -0
- package/skills/deploy-k8s/docs/guides/validation-and-policy.md +66 -0
- package/skills/deploy-k8s/docs/integrations/mcp-integration.md +52 -0
- package/skills/deploy-k8s/docs/package-lock.json +2892 -0
- package/skills/deploy-k8s/docs/package.json +13 -0
- package/skills/deploy-k8s/references/api-drift.md +298 -0
- package/skills/deploy-k8s/references/conditional/aks-patterns.md +70 -0
- package/skills/deploy-k8s/references/conditional/eks-patterns.md +79 -0
- package/skills/deploy-k8s/references/conditional/gitops-controllers.md +71 -0
- package/skills/deploy-k8s/references/conditional/gke-patterns.md +74 -0
- package/skills/deploy-k8s/references/conditional/observability-stacks.md +80 -0
- package/skills/deploy-k8s/references/conditional/openshift-patterns.md +67 -0
- package/skills/deploy-k8s/references/daemonset-operator-patterns.md +155 -0
- package/skills/deploy-k8s/references/deployment-patterns.md +146 -0
- package/skills/deploy-k8s/references/do-dont-patterns.md +87 -0
- package/skills/deploy-k8s/references/examples-bad.md +282 -0
- package/skills/deploy-k8s/references/examples-good.md +440 -0
- package/skills/deploy-k8s/references/fragile-rollouts.md +303 -0
- package/skills/deploy-k8s/references/helm-patterns.md +203 -0
- package/skills/deploy-k8s/references/insecure-workload-defaults.md +300 -0
- package/skills/deploy-k8s/references/job-patterns.md +120 -0
- package/skills/deploy-k8s/references/kustomize-patterns.md +239 -0
- package/skills/deploy-k8s/references/multi-tenancy.md +343 -0
- package/skills/deploy-k8s/references/network-exposure.md +481 -0
- package/skills/deploy-k8s/references/observability.md +302 -0
- package/skills/deploy-k8s/references/privilege-sprawl.md +273 -0
- package/skills/deploy-k8s/references/resource-starvation.md +374 -0
- package/skills/deploy-k8s/references/security-hardening.md +209 -0
- package/skills/deploy-k8s/references/stateful-patterns.md +130 -0
- package/skills/deploy-k8s/references/storage-and-state.md +330 -0
- package/skills/deploy-k8s/references/validation-and-policy.md +242 -0
- package/skills/deploy-railway/SKILL.md +235 -0
- package/skills/deploy-railway/references/analyze-db-mongo.md +84 -0
- package/skills/deploy-railway/references/analyze-db-mysql.md +254 -0
- package/skills/deploy-railway/references/analyze-db-postgres.md +479 -0
- package/skills/deploy-railway/references/analyze-db-redis.md +208 -0
- package/skills/deploy-railway/references/analyze-db.md +344 -0
- package/skills/deploy-railway/references/configure.md +309 -0
- package/skills/deploy-railway/references/deploy.md +195 -0
- package/skills/deploy-railway/references/operate.md +214 -0
- package/skills/deploy-railway/references/request.md +248 -0
- package/skills/deploy-railway/references/setup.md +312 -0
- package/skills/deploy-railway/scripts/analyze-mongo.py +1549 -0
- package/skills/deploy-railway/scripts/analyze-mysql.py +1195 -0
- package/skills/deploy-railway/scripts/analyze-postgres.py +3058 -0
- package/skills/deploy-railway/scripts/analyze-redis.py +1090 -0
- package/skills/deploy-railway/scripts/dal.py +671 -0
- package/skills/deploy-railway/scripts/enable-pg-stats.py +170 -0
- package/skills/deploy-railway/scripts/pg-extensions.py +370 -0
- package/skills/deploy-railway/scripts/railway-api.sh +52 -0
- package/skills/deploy-ssh/SKILL.md +91 -0
- package/skills/deploy-vercel/SKILL.md +304 -0
- package/skills/deploy-vercel/resources/deploy-codex.sh +301 -0
- package/skills/deploy-vercel/resources/deploy.sh +301 -0
- package/skills/docs-runbooks/SKILL.md +399 -0
- package/skills/drive-status-renderer/SKILL.md +62 -0
- package/skills/iac-scan/SKILL.md +680 -0
- package/skills/iac-scan/assets/.gitkeep +9 -0
- package/skills/iac-scan/assets/checkov_config.yaml +94 -0
- package/skills/iac-scan/assets/github_actions.yml +199 -0
- package/skills/iac-scan/assets/gitlab_ci.yml +218 -0
- package/skills/iac-scan/assets/pre_commit_config.yaml +92 -0
- package/skills/iac-scan/references/EXAMPLE.md +40 -0
- package/skills/iac-scan/references/compliance_mapping.md +237 -0
- package/skills/iac-scan/references/custom_policies.md +460 -0
- package/skills/iac-scan/references/suppression_guide.md +431 -0
- package/skills/incident-briefing/SKILL.md +66 -0
- package/skills/incident-triage/SKILL.md +481 -0
- package/{LICENSE → skills/mcp-builder/LICENSE.txt} +15 -14
- package/skills/mcp-builder/SKILL.md +244 -0
- package/skills/mcp-builder/reference/evaluation.md +602 -0
- package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
- package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
- package/skills/mcp-builder/scripts/connections.py +151 -0
- package/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/skills/mobile-pairing/SKILL.md +52 -0
- package/skills/ops-sre/SKILL.md +297 -0
- package/skills/playwright-qa/LICENSE.txt +201 -0
- package/skills/playwright-qa/NOTICE.txt +14 -0
- package/skills/playwright-qa/SKILL.md +156 -0
- package/skills/playwright-qa/agents/openai.yaml +6 -0
- package/skills/playwright-qa/assets/playwright-small.svg +3 -0
- package/skills/playwright-qa/assets/playwright.png +0 -0
- package/skills/playwright-qa/references/cli.md +116 -0
- package/skills/playwright-qa/references/workflows.md +95 -0
- package/skills/playwright-qa/scripts/playwright_cli.sh +25 -0
- package/skills/release-publish/SKILL.md +85 -0
- package/skills/repo-bootstrap/SKILL.md +92 -0
- package/skills/repo-bootstrap/assets/example-workflows/validate-agents.yml +89 -0
- package/skills/repo-bootstrap/assets/root-thin.md +141 -0
- package/skills/repo-bootstrap/assets/root-verbose.md +149 -0
- package/skills/repo-bootstrap/assets/scoped/backend-go.md +107 -0
- package/skills/repo-bootstrap/assets/scoped/backend-php.md +94 -0
- package/skills/repo-bootstrap/assets/scoped/backend-python.md +84 -0
- package/skills/repo-bootstrap/assets/scoped/backend-typescript.md +89 -0
- package/skills/repo-bootstrap/assets/scoped/claude-code-skill.md +101 -0
- package/skills/repo-bootstrap/assets/scoped/cli.md +83 -0
- package/skills/repo-bootstrap/assets/scoped/concourse.md +196 -0
- package/skills/repo-bootstrap/assets/scoped/ddev.md +68 -0
- package/skills/repo-bootstrap/assets/scoped/docker.md +160 -0
- package/skills/repo-bootstrap/assets/scoped/documentation.md +98 -0
- package/skills/repo-bootstrap/assets/scoped/examples.md +96 -0
- package/skills/repo-bootstrap/assets/scoped/frontend-typescript.md +88 -0
- package/skills/repo-bootstrap/assets/scoped/github-actions.md +174 -0
- package/skills/repo-bootstrap/assets/scoped/gitlab-ci.md +174 -0
- package/skills/repo-bootstrap/assets/scoped/oro-bundle.md +209 -0
- package/skills/repo-bootstrap/assets/scoped/oro-project.md +170 -0
- package/skills/repo-bootstrap/assets/scoped/python-modern.md +170 -0
- package/skills/repo-bootstrap/assets/scoped/resources.md +96 -0
- package/skills/repo-bootstrap/assets/scoped/skill-repo.md +139 -0
- package/skills/repo-bootstrap/assets/scoped/symfony.md +168 -0
- package/skills/repo-bootstrap/assets/scoped/testing.md +87 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-docs.md +103 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-extension.md +133 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-project.md +137 -0
- package/skills/repo-bootstrap/assets/scoped/typo3-testing.md +80 -0
- package/skills/repo-bootstrap/checkpoints.yaml +279 -0
- package/skills/repo-bootstrap/evals/evals.json +385 -0
- package/skills/repo-bootstrap/references/ai-contribution-guidelines.md +63 -0
- package/skills/repo-bootstrap/references/ai-tool-compatibility.md +223 -0
- package/skills/repo-bootstrap/references/directory-coverage.md +82 -0
- package/skills/repo-bootstrap/references/examples/coding-agent-cli/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/coding-agent-cli/go.mod +3 -0
- package/skills/repo-bootstrap/references/examples/coding-agent-cli/scripts-AGENTS.md +389 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/.env.example +13 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/AGENTS.md +91 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/package.json +33 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/pnpm-lock.yaml +3 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/AGENTS.md +91 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/config.ts +28 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/controllers/userController.ts +74 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/index.ts +26 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/middleware/errorHandler.ts +45 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/middleware/requestLogger.ts +18 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/routes/health.ts +18 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/routes/users.ts +13 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/utils/errors.ts +40 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/src/utils/logger.ts +14 -0
- package/skills/repo-bootstrap/references/examples/express-api-ts/tsconfig.json +24 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/.env.example +19 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/AGENTS.md +92 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/pyproject.toml +88 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/AGENTS.md +85 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/__init__.py +3 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/config.py +49 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/main.py +66 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/__init__.py +13 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/item.py +43 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/models/user.py +40 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/__init__.py +5 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/health.py +20 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/items.py +61 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/routes/users.py +55 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/__init__.py +6 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/item_service.py +77 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/src/services/user_service.py +69 -0
- package/skills/repo-bootstrap/references/examples/fastapi-app/uv.lock +4 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/.scopes +3 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/AGENTS.md +86 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/admin/package.json +20 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/admin/src/App.tsx +5 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/cmd/api/main.go +7 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/go.mod +2 -0
- package/skills/repo-bootstrap/references/examples/go-api-with-react-admin/main.go +7 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/.scopes +3 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/AGENTS.md +89 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/go.mod +2 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/AGENTS.md +90 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/package.json +17 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/App.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Button.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Footer.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Header.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/internal/web/src/Sidebar.tsx +1 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/main.go +7 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/package-lock.json +0 -0
- package/skills/repo-bootstrap/references/examples/go-with-internal-web-tsx/package.json +12 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/go.mod +3 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/internal-AGENTS.md +371 -0
- package/skills/repo-bootstrap/references/examples/ldap-selfservice/internal-web-AGENTS.md +448 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/.scopes +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/AGENTS.md +91 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/composer.json +8 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/package.json +15 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/pnpm-lock.yaml +0 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/src/Controller.php +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/AGENTS.md +92 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/package.json +26 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/App.tsx +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Button.tsx +10 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Footer.tsx +9 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/Header.tsx +9 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/src/main.tsx +3 -0
- package/skills/repo-bootstrap/references/examples/php-with-frontend/web/tsconfig.json +13 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/AGENTS.md +75 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/package.json +7 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/packages/web/package.json +11 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/packages/web/src/index.ts +11 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/pnpm-lock.yaml +42 -0
- package/skills/repo-bootstrap/references/examples/pnpm-workspace/pnpm-workspace.yaml +2 -0
- package/skills/repo-bootstrap/references/examples/simple-ldap-go/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/simple-ldap-go/examples-AGENTS.md +45 -0
- package/skills/repo-bootstrap/references/examples/simple-ldap-go/go.mod +3 -0
- package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/AGENTS.md +70 -0
- package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/Classes-AGENTS.md +392 -0
- package/skills/repo-bootstrap/references/examples/t3x-rte-ckeditor-image/composer.json +8 -0
- package/skills/repo-bootstrap/references/feedback-memory-schema.md +135 -0
- package/skills/repo-bootstrap/references/git-hooks-setup.md +79 -0
- package/skills/repo-bootstrap/references/output-structure.md +124 -0
- package/skills/repo-bootstrap/references/scripts-guide.md +175 -0
- package/skills/repo-bootstrap/references/verification-guide.md +137 -0
- package/skills/repo-bootstrap/scripts/analyze-git-history.sh +315 -0
- package/skills/repo-bootstrap/scripts/check-freshness.sh +230 -0
- package/skills/repo-bootstrap/scripts/detect-golden-samples.sh +161 -0
- package/skills/repo-bootstrap/scripts/detect-heuristics.sh +93 -0
- package/skills/repo-bootstrap/scripts/detect-project.sh +486 -0
- package/skills/repo-bootstrap/scripts/detect-scopes.sh +330 -0
- package/skills/repo-bootstrap/scripts/detect-utilities.sh +133 -0
- package/skills/repo-bootstrap/scripts/extract-adrs.sh +194 -0
- package/skills/repo-bootstrap/scripts/extract-agent-configs.sh +331 -0
- package/skills/repo-bootstrap/scripts/extract-architecture-rules.sh +522 -0
- package/skills/repo-bootstrap/scripts/extract-ci-commands.sh +385 -0
- package/skills/repo-bootstrap/scripts/extract-ci-rules.sh +384 -0
- package/skills/repo-bootstrap/scripts/extract-commands.sh +358 -0
- package/skills/repo-bootstrap/scripts/extract-documentation.sh +308 -0
- package/skills/repo-bootstrap/scripts/extract-github-rulesets.sh +96 -0
- package/skills/repo-bootstrap/scripts/extract-github-settings.sh +88 -0
- package/skills/repo-bootstrap/scripts/extract-ide-settings.sh +228 -0
- package/skills/repo-bootstrap/scripts/extract-platform-files.sh +290 -0
- package/skills/repo-bootstrap/scripts/extract-quality-configs.sh +442 -0
- package/skills/repo-bootstrap/scripts/generate-agents.sh +2424 -0
- package/skills/repo-bootstrap/scripts/generate-file-map.sh +153 -0
- package/skills/repo-bootstrap/scripts/lib/config-root.sh +211 -0
- package/skills/repo-bootstrap/scripts/lib/summary.sh +244 -0
- package/skills/repo-bootstrap/scripts/lib/template.sh +397 -0
- package/skills/repo-bootstrap/scripts/validate-structure.sh +324 -0
- package/skills/repo-bootstrap/scripts/verify-commands.sh +615 -0
- package/skills/repo-bootstrap/scripts/verify-content.sh +302 -0
- package/skills/schema-api-contracts/SKILL.md +56 -0
- package/skills/secret-hygiene/SKILL.md +511 -0
- package/skills/secret-hygiene/assets/.gitkeep +9 -0
- package/skills/secret-hygiene/assets/config-balanced.toml +81 -0
- package/skills/secret-hygiene/assets/config-custom.toml +178 -0
- package/skills/secret-hygiene/assets/config-strict.toml +48 -0
- package/skills/secret-hygiene/assets/github-action.yml +181 -0
- package/skills/secret-hygiene/assets/gitlab-ci.yml +257 -0
- package/skills/secret-hygiene/assets/precommit-config.yaml +70 -0
- package/skills/secret-hygiene/references/EXAMPLE.md +40 -0
- package/skills/secret-hygiene/references/compliance_mapping.md +538 -0
- package/skills/secret-hygiene/references/detection_rules.md +276 -0
- package/skills/secret-hygiene/references/false_positives.md +598 -0
- package/skills/secret-hygiene/references/remediation_guide.md +530 -0
- package/skills/stack-selector/SKILL.md +56 -0
- package/skills/telegram-control/SKILL.md +110 -0
- package/skills/telegram-control/references/architecture.md +184 -0
- package/skills/telegram-control/references/convex.md +173 -0
- package/skills/telegram-control/references/error_handling.md +212 -0
- package/skills/telegram-control/references/initial_setup.md +165 -0
- package/skills/telegram-control/references/telegram_api.md +156 -0
- package/skills/telegram-control/scripts/cancel_message.ts +53 -0
- package/skills/telegram-control/scripts/list_scheduled.ts +103 -0
- package/skills/telegram-control/scripts/logger.ts +121 -0
- package/skills/telegram-control/scripts/proxy-util.ts +11 -0
- package/skills/telegram-control/scripts/schedule_message.ts +216 -0
- package/skills/telegram-control/scripts/send_message.ts +115 -0
- package/skills/telegram-control/scripts/setup.ts +185 -0
- package/skills/telegram-control/scripts/types.ts +75 -0
- package/skills/telegram-control/scripts/view_history.ts +74 -0
- package/skills/test-strategy/SKILL.md +352 -0
- package/skills/threat-model/SKILL.md +303 -0
- package/skills/threat-model/examples/example-output.md +196 -0
- package/skills/threat-model/template.md +96 -0
- package/skills/ts-lint/SKILL.md +80 -0
- package/skills/ui-flow/SKILL.md +668 -0
- package/skills/voice-command-router/SKILL.md +51 -0
- package/skills/widget-live-activity-sync/SKILL.md +66 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Redis Analysis
|
|
2
|
+
|
|
3
|
+
This reference covers Redis-specific metrics, tuning, and analysis guidance.
|
|
4
|
+
For common analysis patterns (output structure, collection status handling, performance thinking), see [analyze-db.md](analyze-db.md).
|
|
5
|
+
|
|
6
|
+
## What the Script Collects
|
|
7
|
+
|
|
8
|
+
**Via SSH (`INFO ALL`):**
|
|
9
|
+
- **Overview:** version, uptime, connected/blocked clients, rejected connections
|
|
10
|
+
- **Memory:** used/RSS/peak memory, fragmentation ratio, maxmemory, eviction policy
|
|
11
|
+
- **Throughput:** ops/sec, total commands processed, total connections
|
|
12
|
+
- **Cache Performance:** keyspace hits/misses, hit rate, expired/evicted keys
|
|
13
|
+
- **Persistence:** RDB last save time/status, AOF enabled/status
|
|
14
|
+
- **Command Stats:** per-command call count, avg latency, total time (sorted by calls)
|
|
15
|
+
- **Keyspace:** per-database key count, expires, avg TTL
|
|
16
|
+
- **Slow Log:** count via `SLOWLOG LEN` + actual entries via `SLOWLOG GET 20` (command, duration, timestamp)
|
|
17
|
+
- **Biggest Keys:** via `redis-cli --bigkeys` — runs **remotely over SSH** on the Railway service, not locally
|
|
18
|
+
|
|
19
|
+
**Via Railway API:** Same infrastructure metrics (disk, CPU, memory, network with **7d and 24h trends**).
|
|
20
|
+
|
|
21
|
+
## Presentation Template
|
|
22
|
+
|
|
23
|
+
Present Redis analysis using grouped stat cards that mirror the sections below. Each section is a labeled group with key-value stat cards. Flag values with status indicators (healthy/warning/critical) using the thresholds table.
|
|
24
|
+
|
|
25
|
+
### Full Report (SSH + Metrics + Logs all succeeded)
|
|
26
|
+
|
|
27
|
+
**Overview**
|
|
28
|
+
| Version | Uptime | Connected Clients | Blocked Clients | Rejected Connections | Total Keys |
|
|
29
|
+
|---------|--------|-------------------|-----------------|----------------------|------------|
|
|
30
|
+
| 7.2.4 | 14d 6h | 23 | 0 | 0 | 48,291 |
|
|
31
|
+
|
|
32
|
+
Flag: blocked clients > 0 = warning, rejected connections > 0 = critical.
|
|
33
|
+
|
|
34
|
+
**Memory**
|
|
35
|
+
| Used Memory | RSS Memory | Peak Memory | Fragmentation Ratio | Max Memory | Eviction Policy |
|
|
36
|
+
|-------------|------------|-------------|---------------------|------------|-----------------|
|
|
37
|
+
| 12.4 MB | 18.2 MB | 15.1 MB | 1.47 | Unlimited | noeviction |
|
|
38
|
+
|
|
39
|
+
Flag: fragmentation > 1.5 = warning, > 2.0 or < 1.0 = critical. Evicted keys > 0 with noeviction = problem.
|
|
40
|
+
|
|
41
|
+
**Throughput**
|
|
42
|
+
| Ops/sec | Total Commands | Total Connections | Slow Log Entries |
|
|
43
|
+
|---------|----------------|-------------------|------------------|
|
|
44
|
+
| 1,240 | 8.4M | 12,491 | 3 |
|
|
45
|
+
|
|
46
|
+
Flag: slow log > 100 = warning.
|
|
47
|
+
|
|
48
|
+
**Cache Performance**
|
|
49
|
+
| Hit Rate | Hits | Misses | Expired Keys | Evicted Keys |
|
|
50
|
+
|----------|------|--------|--------------|--------------|
|
|
51
|
+
| 97.2% | 6.1M | 178K | 892K | 0 |
|
|
52
|
+
|
|
53
|
+
Flag: hit rate >= 95% = healthy, 80-95% = warning, < 80% = critical. Evicted > 0 = warning.
|
|
54
|
+
|
|
55
|
+
**Persistence**
|
|
56
|
+
| RDB Last Save | RDB Status | AOF Enabled | AOF Rewrite Status |
|
|
57
|
+
|---------------|------------|-------------|-------------------|
|
|
58
|
+
| 2 min ago | ok | Yes | ok |
|
|
59
|
+
|
|
60
|
+
Flag: RDB status != ok = critical. AOF rewrite status != ok = critical.
|
|
61
|
+
|
|
62
|
+
**Command Stats** (top 20 by calls)
|
|
63
|
+
| Command | Calls | Avg Latency | Total Time |
|
|
64
|
+
|---------|-------|-------------|------------|
|
|
65
|
+
| GET | 4.2M | 3.1µs | 13.0s |
|
|
66
|
+
| SET | 2.1M | 4.8µs | 10.1s |
|
|
67
|
+
| HGET | 890K | 5.2µs | 4.6s |
|
|
68
|
+
| EXPIRE | 620K | 2.1µs | 1.3s |
|
|
69
|
+
|
|
70
|
+
**Slow Log Entries** (if collected — up to 20 most recent)
|
|
71
|
+
| # | Timestamp | Duration | Command |
|
|
72
|
+
|---|-----------|----------|---------|
|
|
73
|
+
| 1 | 2m ago | 12.3ms | GET user:session:abc123... |
|
|
74
|
+
| 2 | 5m ago | 10.1ms | GET cache:render:page/home... |
|
|
75
|
+
| 3 | 12m ago | 8.7ms | HGETALL product:catalog:main |
|
|
76
|
+
|
|
77
|
+
Analysis: correlate slow commands with command stats and big keys. If slowlog shows GET and bigkeys shows large strings, the diagnosis is "large values causing high GET latency" — confirmed without user intervention.
|
|
78
|
+
|
|
79
|
+
**Biggest Keys** (if collected — one per type)
|
|
80
|
+
| Type | Key | Size/Count |
|
|
81
|
+
|------|-----|------------|
|
|
82
|
+
| string | cache:render:page/dashboard | 2.1 MB |
|
|
83
|
+
| hash | user:sessions | 14,291 fields |
|
|
84
|
+
| list | queue:notifications | 8,402 items |
|
|
85
|
+
|
|
86
|
+
Analysis: large keys cause latency spikes on read/write/delete. Cross-reference with slowlog — if the slow commands target these keys, that's the root cause. If bigkeys shows nothing large (all < 1KB), latency issues are likely volume-driven, not value-size-driven.
|
|
87
|
+
|
|
88
|
+
**Keyspace**
|
|
89
|
+
| Database | Keys | Expires | Avg TTL |
|
|
90
|
+
|----------|------|---------|---------|
|
|
91
|
+
| db0 | 48,291 | 31,204 | 2.4h |
|
|
92
|
+
|
|
93
|
+
**Infrastructure (7d + 24h)** — show both windows so trends can be compared:
|
|
94
|
+
|
|
95
|
+
**7-Day Trends**
|
|
96
|
+
| Metric | Current | Avg | Min | Max | Trend |
|
|
97
|
+
|--------|---------|-----|-----|-----|-------|
|
|
98
|
+
| CPU | 0.01 vCPU | 0.01 | 0.00 | 0.10 | stable |
|
|
99
|
+
| Memory | 70 MB | 40 MB | 30 MB | 90 MB | stable |
|
|
100
|
+
| Disk | 1.1 GB | 1.11 GB | 1.07 GB | 1.16 GB | stable |
|
|
101
|
+
|
|
102
|
+
**Last 24 Hours**
|
|
103
|
+
| Metric | Current | Avg | Min | Max | Trend |
|
|
104
|
+
|--------|---------|-----|-----|-----|-------|
|
|
105
|
+
| CPU | 0.01 vCPU | 0.01 | 0.00 | 0.07 | stable |
|
|
106
|
+
| Memory | 70 MB | 55 MB | 30 MB | 90 MB | increasing (+58%) |
|
|
107
|
+
| Disk | 1.1 GB | 1.11 GB | 1.07 GB | 1.16 GB | stable |
|
|
108
|
+
|
|
109
|
+
Compare: "Memory increasing in 24h but stable over 7d → temporary spike, not a sustained trend."
|
|
110
|
+
|
|
111
|
+
Do NOT show cpu_limit/memory_limit columns or utilization %. Railway auto-scales — these limits are just the ceiling. See [analyze-db.md](analyze-db.md) autoscale rules.
|
|
112
|
+
|
|
113
|
+
### Partial Report (Introspection failed, only Metrics + Logs)
|
|
114
|
+
|
|
115
|
+
When introspection fails, you have NO Redis INFO data — all overview, memory, throughput, cache, persistence, command stats, and keyspace fields will be null/empty.
|
|
116
|
+
|
|
117
|
+
**NEVER suggest running `redis-cli` without pointing to the remote Railway service host.** There is no local Redis instance — all redis-cli commands must target the Railway service. If you cannot connect, the fix is to restore remote access (see `analyze-db.md`), not to run commands locally.
|
|
118
|
+
|
|
119
|
+
**You MUST:**
|
|
120
|
+
1. State clearly: "Redis introspection failed — could not connect to the service"
|
|
121
|
+
2. Show collection status errors
|
|
122
|
+
3. Show ONLY infrastructure metrics and log analysis — do not show empty stat card sections
|
|
123
|
+
4. Do NOT produce recommendations based on null Redis metrics
|
|
124
|
+
|
|
125
|
+
**Show the infrastructure table** (same as full report).
|
|
126
|
+
|
|
127
|
+
**Analyze logs thoroughly:**
|
|
128
|
+
- AOF rewrite frequency and growth % triggers
|
|
129
|
+
- fsync warnings ("disk is busy?")
|
|
130
|
+
- OOM warnings
|
|
131
|
+
- Connection errors
|
|
132
|
+
- Startup/restart events (note these are normal during deploys)
|
|
133
|
+
- Summarize with counts: "Analyzed 1000 lines: 18 AOF rewrites, 1 fsync warning, 0 errors"
|
|
134
|
+
|
|
135
|
+
**State what you cannot determine** without SSH:
|
|
136
|
+
- Connection health (clients, blocked, rejected)
|
|
137
|
+
- Memory usage and fragmentation
|
|
138
|
+
- Cache hit rate
|
|
139
|
+
- Eviction status
|
|
140
|
+
- Command workload profile
|
|
141
|
+
- Keyspace composition
|
|
142
|
+
- Slow log entries and actual slow commands
|
|
143
|
+
- Biggest keys per type
|
|
144
|
+
|
|
145
|
+
## Redis Performance Patterns
|
|
146
|
+
|
|
147
|
+
**Memory Fragmentation Pattern:**
|
|
148
|
+
- `mem_fragmentation_ratio > 1.5` = memory is fragmented, RSS much higher than used
|
|
149
|
+
- Caused by frequent small key deletions creating memory holes
|
|
150
|
+
- Fix: restart Redis, or enable `activedefrag yes` (Redis 4.0+)
|
|
151
|
+
- Ratio < 1.0 means Redis is using swap — critical performance issue
|
|
152
|
+
|
|
153
|
+
**Cache Thrashing Pattern:**
|
|
154
|
+
- Hit rate < 80% + evicted keys > 0 = working set exceeds maxmemory
|
|
155
|
+
- Check maxmemory_policy — `noeviction` will reject writes, `allkeys-lru` will evict
|
|
156
|
+
- If maxmemory is 0 (unlimited), Redis will consume all RAM until OOM killed
|
|
157
|
+
|
|
158
|
+
**Connection Rejection Pattern:**
|
|
159
|
+
- rejected_connections > 0 = maxclients limit hit
|
|
160
|
+
- Check connected_clients vs maxclients default (10,000)
|
|
161
|
+
- Blocked clients = operations waiting on BLPOP/BRPOP/WAIT
|
|
162
|
+
|
|
163
|
+
**Persistence Risk Pattern:**
|
|
164
|
+
- RDB last save failed + no AOF = data loss risk on restart
|
|
165
|
+
- Check disk space if saves are failing
|
|
166
|
+
- Long time since last save = more data at risk
|
|
167
|
+
|
|
168
|
+
**AOF Rewrite Churn Pattern:**
|
|
169
|
+
- Frequent AOF rewrites (every 1-2 hours) with high growth % triggers (100-800%)
|
|
170
|
+
- Indicates high write-to-data-size ratio — small dataset with heavy writes
|
|
171
|
+
- Check Fork CoW size to gauge actual data size vs AOF overhead
|
|
172
|
+
- If rewrites are fast (<1s) and CoW is small (<10 MB), this is noisy but harmless
|
|
173
|
+
- If rewrites are slow or CoW is large, investigate write patterns
|
|
174
|
+
|
|
175
|
+
**Disk Sawtooth Pattern:**
|
|
176
|
+
- Disk usage oscillating in a regular pattern = AOF growing between rewrites, then compacting
|
|
177
|
+
- Normal behavior — the baseline is volume overhead + AOF base file
|
|
178
|
+
- If the amplitude is growing over time, data size is increasing
|
|
179
|
+
|
|
180
|
+
## Redis Thresholds
|
|
181
|
+
|
|
182
|
+
| Metric | Healthy | Warning | Critical |
|
|
183
|
+
|--------|---------|---------|----------|
|
|
184
|
+
| Hit rate | >95% | 80-95% | <80% |
|
|
185
|
+
| Fragmentation ratio | 1.0-1.5 | 1.5-2.0 | >2.0 or <1.0 |
|
|
186
|
+
| Evicted keys | 0 | >0 | Growing rapidly |
|
|
187
|
+
| Blocked clients | 0 | 1-5 | >5 |
|
|
188
|
+
| Connected clients | <80% maxclients | 80-90% | >90% |
|
|
189
|
+
|
|
190
|
+
## Redis Command Stats Analysis
|
|
191
|
+
|
|
192
|
+
The top commands by call count reveal the workload pattern:
|
|
193
|
+
- **GET/SET dominant** = simple key-value cache
|
|
194
|
+
- **HGET/HSET dominant** = hash-based data model (sessions, objects)
|
|
195
|
+
- **LPUSH/RPOP dominant** = queue pattern
|
|
196
|
+
- **High KEYS/SCAN** = application iterating keys (potential performance issue at scale)
|
|
197
|
+
- **High latency on simple commands** (>100µs for GET) = memory pressure or CPU saturation
|
|
198
|
+
|
|
199
|
+
## Redis Autoscale Note
|
|
200
|
+
|
|
201
|
+
See [analyze-db.md](analyze-db.md) for full autoscale rules. For Redis specifically:
|
|
202
|
+
- If `maxmemory` is set, compare it against actual memory usage — not the Railway memory limit.
|
|
203
|
+
- If `maxmemory` is 0 (unlimited), Redis will grow until the OS kills it. This is the default Railway config and works fine with autoscaling — Redis uses what it needs and Railway scales the container.
|
|
204
|
+
- Do NOT recommend setting maxmemory to a fraction of the Railway memory limit — the limit is the autoscale ceiling, not fixed allocation.
|
|
205
|
+
|
|
206
|
+
## Validated against
|
|
207
|
+
|
|
208
|
+
- Redis INFO command, SLOWLOG LEN, SLOWLOG GET, and --bigkeys
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
# Database Analysis
|
|
2
|
+
|
|
3
|
+
## Your Role
|
|
4
|
+
|
|
5
|
+
You are a database performance expert. The script collects raw data - your job is to **think deeply** about what you see, identify root causes, correlate symptoms, and explain the "why" behind problems.
|
|
6
|
+
|
|
7
|
+
**Don't just report metrics. Analyze them.**
|
|
8
|
+
|
|
9
|
+
## Context Resolution
|
|
10
|
+
|
|
11
|
+
The user's request is the source of truth. Use this decision table:
|
|
12
|
+
|
|
13
|
+
| What the user provided | Action |
|
|
14
|
+
|------------------------|--------|
|
|
15
|
+
| Railway URL | Extract IDs directly from the URL — do NOT run `railway status --json` |
|
|
16
|
+
| Service name + environment name | Proceed — intent is clear. Resolve IDs via API. |
|
|
17
|
+
| Service name only (no environment) | Find the service by name via API. If multiple matches exist across projects, ask: "Which project do you mean?" Otherwise confirm: "Do you mean `<service>` in `<project>` / `<env>`?" — only proceed on confirmation |
|
|
18
|
+
| Raw UUID(s) | Resolve to human-readable names via API, then confirm before running |
|
|
19
|
+
| Vague request ("analyze my database", "check postgres") | Run `railway status --json` to see what's linked. If it's a database service, confirm: "Do you mean `<service>` in `<project>` / `<env>`?". If it's not a database service or nothing is linked, ask: "Which service and environment should I analyze?" |
|
|
20
|
+
| No context at all | List workspaces (`railway whoami --json`), then projects (`railway project list --json`), then environments and services for the chosen project, narrowing down until you have a specific service and environment |
|
|
21
|
+
|
|
22
|
+
`railway status --json` is a hint to form a specific question, not a trigger to act without confirmation.
|
|
23
|
+
|
|
24
|
+
**When the user provides a Railway URL**, extract IDs directly from it:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
https://railway.com/project/<PROJECT_ID>/service/<SERVICE_ID>?environmentId=<ENV_ID>
|
|
28
|
+
https://railway.com/project/<PROJECT_ID>/service/<SERVICE_ID>/database?environmentId=<ENV_ID>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then query the API for the service name and database type in a **single call**:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
scripts/railway-api.sh \
|
|
35
|
+
'query getServiceAndConfig($serviceId: String!, $environmentId: String!) {
|
|
36
|
+
service(id: $serviceId) { name }
|
|
37
|
+
environment(id: $environmentId) {
|
|
38
|
+
config(decryptVariables: false)
|
|
39
|
+
}
|
|
40
|
+
}' \
|
|
41
|
+
'{"serviceId": "<SERVICE_ID>", "environmentId": "<ENV_ID>"}'
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
From the response, get:
|
|
45
|
+
- **Service name**: `data.service.name`
|
|
46
|
+
- **Database image**: `data.environment.config.services.<SERVICE_ID>.source.image`
|
|
47
|
+
|
|
48
|
+
Then match the image to the database type:
|
|
49
|
+
|
|
50
|
+
| Image pattern | Database Type |
|
|
51
|
+
|--------------|---------------|
|
|
52
|
+
| `postgres*`, `ghcr.io/railway/postgres*` | PostgreSQL |
|
|
53
|
+
| `mysql*`, `ghcr.io/railway/mysql*` | MySQL |
|
|
54
|
+
| `redis*`, `ghcr.io/railway/redis*`, `railwayapp/redis*` | Redis |
|
|
55
|
+
| `mongo*`, `ghcr.io/railway/mongo*` | MongoDB |
|
|
56
|
+
|
|
57
|
+
**If `environmentId` is empty in the URL** (e.g., `?environmentId=` or no query param at all), skip the `environment.config` query — it requires a valid ID. Instead, list the project's environments:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
scripts/railway-api.sh \
|
|
61
|
+
'query getEnvs($id: String!) { project(id: $id) { environments { edges { node { id name } } } } }' \
|
|
62
|
+
'{"id": "<PROJECT_ID>"}'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use the `production` environment by default. If multiple non-PR environments exist and the user hasn't specified one, ask which environment to analyze.
|
|
66
|
+
|
|
67
|
+
## Database Type Detection and Script Selection
|
|
68
|
+
|
|
69
|
+
| Database Type | Script |
|
|
70
|
+
|---------------|--------|
|
|
71
|
+
| PostgreSQL | `scripts/analyze-postgres.py` |
|
|
72
|
+
| MySQL | `scripts/analyze-mysql.py` |
|
|
73
|
+
| Redis | `scripts/analyze-redis.py` |
|
|
74
|
+
| MongoDB | `scripts/analyze-mongo.py` |
|
|
75
|
+
|
|
76
|
+
**All scripts share the same CLI interface** (use the script name from the table above):
|
|
77
|
+
```bash
|
|
78
|
+
python3 scripts/analyze-<script>.py \
|
|
79
|
+
--service <name> \
|
|
80
|
+
--json \
|
|
81
|
+
--project-id <project-id> \
|
|
82
|
+
--environment-id <env-id> \
|
|
83
|
+
--service-id <service-id>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Common options across all scripts:
|
|
87
|
+
- `--json` — JSON output for programmatic processing
|
|
88
|
+
- `--quiet` — Suppress progress messages
|
|
89
|
+
- `--skip-logs` — Skip log collection
|
|
90
|
+
- `--metrics-hours <N>` — Hours of metrics history (default: 24, max: 168)
|
|
91
|
+
- `--step <step>` — Debug individual collection steps (ssh-test, query, logs, metrics)
|
|
92
|
+
|
|
93
|
+
## Before You Analyze: Check Collection Status
|
|
94
|
+
|
|
95
|
+
**ALWAYS check `collection_status` and `errors[]` FIRST before interpreting any data.** The script collects data from multiple independent sources. Any of them can fail.
|
|
96
|
+
|
|
97
|
+
### Decision Table
|
|
98
|
+
|
|
99
|
+
| database_query | metrics_api | logs_api | Report Type |
|
|
100
|
+
|---------------|-------------|----------|-------------|
|
|
101
|
+
| success | success | success | Full analysis — use all sections |
|
|
102
|
+
| success | error | success | Full analysis — note missing infrastructure metrics |
|
|
103
|
+
| **error** | success | success | **Partial report** — only infrastructure metrics + log analysis. NO performance conclusions. |
|
|
104
|
+
| **error** | error | success | **Logs-only report** — state what logs show, note everything else failed. NO diagnosis. |
|
|
105
|
+
| **error** | **error** | **error** | **Collection failure** — report the errors, do not analyze. |
|
|
106
|
+
|
|
107
|
+
### When database_query failed — SSH key errors
|
|
108
|
+
|
|
109
|
+
If the error contains `"No SSH keys found"` or `"SSH key registration required"`, handle it proactively — don't just tell the user to fix it themselves.
|
|
110
|
+
|
|
111
|
+
**If error contains `"Key found but not registered"` or `"No SSH keys found"`:**
|
|
112
|
+
|
|
113
|
+
Run these two commands to understand what's available:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
railway ssh keys # list keys already registered with Railway
|
|
117
|
+
ls ~/.ssh/*.pub 2>/dev/null # list local public keys
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Then present the user with their options and ask which to use:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
SSH introspection needs a registered key. Here's what I found:
|
|
124
|
+
|
|
125
|
+
Registered with Railway: <list from `railway ssh keys`, or "none">
|
|
126
|
+
Local keys available: <list from ~/.ssh/*.pub, or "none">
|
|
127
|
+
|
|
128
|
+
Options:
|
|
129
|
+
1. Register a local key — `railway ssh keys add` (uses your default key)
|
|
130
|
+
2. Import from GitHub — `railway ssh keys github`
|
|
131
|
+
3. Generate a new key — `ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_railway`
|
|
132
|
+
|
|
133
|
+
Which would you like to do?
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Once the user chooses and the key is registered, re-run the full analysis.
|
|
137
|
+
|
|
138
|
+
### When database_query failed — CLI outdated or missing
|
|
139
|
+
|
|
140
|
+
If the error contains `"--native SSH flag is not supported"` or `"Railway CLI not found"`, the script detected an unrecoverable CLI problem. Tell the user directly:
|
|
141
|
+
|
|
142
|
+
- **Outdated CLI:** "Your Railway CLI doesn't support native SSH. Update it: `npm i -g @railway/cli@latest` or `brew upgrade railway`"
|
|
143
|
+
- **Missing CLI:** "Railway CLI not installed. Install it: `npm i -g @railway/cli` or `brew install railway`"
|
|
144
|
+
|
|
145
|
+
Then ask if they'd like to proceed with a partial analysis (metrics + logs only) while they update, or wait until the CLI is fixed and re-run the full analysis.
|
|
146
|
+
|
|
147
|
+
### When database_query failed — other SSH errors
|
|
148
|
+
|
|
149
|
+
This means SSH could not reach the database or the query failed. You have NO connection stats, NO cache hit ratios, NO vacuum health, NO query performance data. All those fields will be null/empty.
|
|
150
|
+
|
|
151
|
+
**You MUST:**
|
|
152
|
+
1. State clearly: "Database introspection failed — SSH could not connect to the service"
|
|
153
|
+
2. Show the `collection_status` errors
|
|
154
|
+
3. Show only the data that DID succeed (metrics, logs)
|
|
155
|
+
4. Do NOT produce recommendations based on null metrics
|
|
156
|
+
5. Do NOT diagnose performance issues from logs alone
|
|
157
|
+
|
|
158
|
+
**Partial report template:**
|
|
159
|
+
```
|
|
160
|
+
Service: <name>
|
|
161
|
+
Status: Data collection partially failed
|
|
162
|
+
|
|
163
|
+
## Collection Status
|
|
164
|
+
| Source | Status |
|
|
165
|
+
|--------|--------|
|
|
166
|
+
| Database Query (SSH) | ERROR: <error from collection_status> |
|
|
167
|
+
| Metrics API | <status> |
|
|
168
|
+
| Logs API | <status> |
|
|
169
|
+
|
|
170
|
+
## Available Data
|
|
171
|
+
<Show metrics and log summary from sources that succeeded>
|
|
172
|
+
|
|
173
|
+
## What We Cannot Determine
|
|
174
|
+
<List what requires the database query: connection health, cache performance, vacuum health, query analysis, etc.>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Output Structure: Data First, Actions Second
|
|
178
|
+
|
|
179
|
+
**Always present information in this order:**
|
|
180
|
+
|
|
181
|
+
### 1. Context Header
|
|
182
|
+
```
|
|
183
|
+
Service: <name> (<project> <environment>)
|
|
184
|
+
Status: <deployment health>, <RAM>, <disk used>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 2. Consolidated Data Tables
|
|
188
|
+
|
|
189
|
+
Before any analysis, show the raw metrics in tables so the user sees their actual state. The DB-specific reference defines exactly which tables to show for each database type — present the relevant health sections first, then connections, then query performance.
|
|
190
|
+
|
|
191
|
+
**Logs & Active Issues:**
|
|
192
|
+
- Parse the `recent_logs` array (1000 lines of raw logs) - don't just check if empty
|
|
193
|
+
- Summarize: "Analyzed 1000 log lines: 3 errors (connection timeouts), 0 critical issues"
|
|
194
|
+
- Show specific concerning log entries if found
|
|
195
|
+
- **Categorize log entries**: group by type (errors, warnings, connection events, replication, crashes/restarts)
|
|
196
|
+
- **Count patterns**: note if a single type dominates the log output
|
|
197
|
+
- **Quote actual log lines** for errors — don't just say "errors found", show the exact message so the user can search their codebase
|
|
198
|
+
|
|
199
|
+
### 3. Analysis
|
|
200
|
+
|
|
201
|
+
After showing the data, explain the chain of causation. Connect the dots between tables.
|
|
202
|
+
|
|
203
|
+
### 4. Recommended Actions
|
|
204
|
+
|
|
205
|
+
Group by urgency. For databases that support configuration changes without restart vs those that require one, call that out explicitly.
|
|
206
|
+
|
|
207
|
+
### 5. Expected Outcomes
|
|
208
|
+
|
|
209
|
+
What metrics should change after fixes.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
**Why this order matters:**
|
|
214
|
+
- Users can verify the data matches their understanding
|
|
215
|
+
- They see the full picture before being told what to do
|
|
216
|
+
- Actions have context - they know WHY each fix is recommended
|
|
217
|
+
- No valuable data is hidden in prose or omitted
|
|
218
|
+
|
|
219
|
+
## CRITICAL: Use the Actual Data
|
|
220
|
+
|
|
221
|
+
**NEVER fabricate or assume values.** The script outputs JSON with exact numbers. Before stating any metric:
|
|
222
|
+
|
|
223
|
+
1. **Read the actual JSON output** - Don't truncate or skim
|
|
224
|
+
2. **Quote the exact values** - e.g., `"max": 5000` not "100"
|
|
225
|
+
3. **Investigate outliers** - Dig into any field that seems unusually high or low
|
|
226
|
+
|
|
227
|
+
Common errors to avoid (all database types):
|
|
228
|
+
- **Not parsing `recent_logs`** - always analyze the raw log lines, don't just report "no errors"
|
|
229
|
+
- **Diagnosing performance issues from logs when all metrics are null** — logs show what happened, not how the database is performing
|
|
230
|
+
- **Treating startup/restart log entries as evidence of failure** — databases restart for many normal reasons (deploys, config changes, scaling)
|
|
231
|
+
- **Producing recommendations when all database metrics are null** — if `collection_status.database_query` is "error", you have no basis for tuning advice
|
|
232
|
+
|
|
233
|
+
See the DB-specific reference for additional errors to avoid per database type.
|
|
234
|
+
|
|
235
|
+
## Running the Analysis
|
|
236
|
+
|
|
237
|
+
Pass project, environment, and service IDs directly — no `railway link` needed:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# From plugins/railway/skills/use-railway directory:
|
|
241
|
+
# Use the script name from the "Database Type Detection" table above
|
|
242
|
+
python3 scripts/analyze-postgres.py --service <name> --json \
|
|
243
|
+
--project-id <project-id> --environment-id <env-id> --service-id <service-id>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
All three IDs come from the URL (see "Context: URL First" above). The service name comes from the API query.
|
|
247
|
+
|
|
248
|
+
**Options:**
|
|
249
|
+
- `--metrics-hours <N>` — Hours of metrics history to fetch (default: 24, max: 168). Use `--metrics-hours 168` for 7-day trends, `--metrics-hours 1` for recent snapshot.
|
|
250
|
+
|
|
251
|
+
**SSH retry:** The script automatically retries SSH connectivity up to 3 times with increasing timeouts (30s, 60s, 90s). Each individual SSH command (database query, slowlog, bigkeys, etc.) also retries up to 3 times on failure — covering transient errors like `exec request failed on channel 0`. Progress is logged to stderr.
|
|
252
|
+
|
|
253
|
+
**Output:** Progress messages go to stderr. JSON results go to stdout. Do not redirect or pipe stderr — just run the command as-is and read the full output.
|
|
254
|
+
|
|
255
|
+
### Resolving environment by name
|
|
256
|
+
|
|
257
|
+
If the URL has no `environmentId` and the user specifies an environment by name (e.g., "production"), resolve it:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
scripts/railway-api.sh \
|
|
261
|
+
'query getProject($id: String!) {
|
|
262
|
+
project(id: $id) {
|
|
263
|
+
environments { edges { node { id name } } }
|
|
264
|
+
}
|
|
265
|
+
}' \
|
|
266
|
+
'{"id": "<PROJECT_ID>"}'
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Match the environment name (case-insensitive) to get the `environmentId`.
|
|
270
|
+
|
|
271
|
+
### Debugging individual steps
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# Use the script name from the "Database Type Detection" table above
|
|
275
|
+
python3 scripts/analyze-postgres.py --service <name> \
|
|
276
|
+
--project-id <pid> --environment-id <eid> --service-id <sid> \
|
|
277
|
+
--step ssh-test # Test SSH connectivity
|
|
278
|
+
--step query # Run only the database query
|
|
279
|
+
--step metrics # Fetch only API metrics
|
|
280
|
+
--step logs # Fetch only logs
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Database-Specific References
|
|
284
|
+
|
|
285
|
+
After running the script and checking collection status, load the reference for the specific database type:
|
|
286
|
+
|
|
287
|
+
| Database | Reference | What It Covers |
|
|
288
|
+
|----------|-----------|----------------|
|
|
289
|
+
| PostgreSQL | [analyze-db-postgres.md](analyze-db-postgres.md) | What psql collects, log analysis checklist, tuning formulas, vacuum priority, pg_stat_statements, applying fixes |
|
|
290
|
+
| MySQL | [analyze-db-mysql.md](analyze-db-mysql.md) | All 12 metric sections (overview, query throughput, InnoDB, efficiency, buffer pool, I/O, network, locks, cache, top queries, tables, active queries), patterns, tuning |
|
|
291
|
+
| Redis | [analyze-db-redis.md](analyze-db-redis.md) | INFO ALL metrics, memory fragmentation, cache thrashing, persistence, command stats |
|
|
292
|
+
| MongoDB | [analyze-db-mongo.md](analyze-db-mongo.md) | serverStatus, WiredTiger cache, query efficiency, connection saturation, oplog |
|
|
293
|
+
|
|
294
|
+
**Always load the DB-specific reference** — it contains the metric sections, thresholds, and tuning knowledge needed for proper analysis.
|
|
295
|
+
|
|
296
|
+
## Infrastructure Metrics (All Database Types)
|
|
297
|
+
|
|
298
|
+
All scripts collect the same infrastructure metrics via Railway API:
|
|
299
|
+
|
|
300
|
+
**Metrics History (`metrics_history`):**
|
|
301
|
+
The script fetches **7 days** (168 hours) of time-series data from Railway's metrics API by default and produces **two analysis windows**:
|
|
302
|
+
|
|
303
|
+
```json
|
|
304
|
+
{
|
|
305
|
+
"metrics_history": {
|
|
306
|
+
"windows": {
|
|
307
|
+
"7d": { "window_hours": 168, "metrics": { "cpu": {...}, "memory": {...}, ... } },
|
|
308
|
+
"24h": { "window_hours": 24, "metrics": { "cpu": {...}, "memory": {...}, ... } }
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Each window independently computes:
|
|
315
|
+
- **Summary stats**: current, min, max, avg for each metric
|
|
316
|
+
- **Trend analysis**: compares first-quarter avg to last-quarter avg — reports direction (increasing/decreasing/stable) and % change
|
|
317
|
+
- **Spike detection**: flags values > avg + 2*stddev with timestamps of peaks
|
|
318
|
+
- **Downsampled series**: ~48 data points per window
|
|
319
|
+
|
|
320
|
+
Available metrics: CPU, memory (with limits), disk, network RX/TX.
|
|
321
|
+
|
|
322
|
+
**Comparing windows reveals whether a trend is new or sustained:**
|
|
323
|
+
- "Memory increasing in 24h but stable over 7d" → temporary spike, likely a batch job
|
|
324
|
+
- "Memory increasing in both 24h AND 7d" → sustained growth, may need investigation
|
|
325
|
+
- "CPU spike in 24h, no spikes in 7d" → new issue
|
|
326
|
+
- "Disk growing over 7d" → data accumulation trend
|
|
327
|
+
|
|
328
|
+
Use `--metrics-hours N` to change the long window (default: 168, max: 168). The 24h window is always produced when the long window is > 24h.
|
|
329
|
+
|
|
330
|
+
### Railway auto-scales vertically
|
|
331
|
+
|
|
332
|
+
Railway services auto-scale CPU, RAM, and disk based on actual usage. Users do NOT pick or control resource sizes. The `cpu_limit` and `memory_limit` values from metrics are the **autoscale ceiling** (typically 32 vCPU / 32 GB), not user-provisioned allocations. Users are billed for actual usage, not the ceiling.
|
|
333
|
+
|
|
334
|
+
**Rules for ALL database types:**
|
|
335
|
+
- **Never say "right-size the instance"** or suggest reducing CPU/RAM — it's not a user action.
|
|
336
|
+
- **Never flag low utilization % against the limit as waste** — a service showing 0.01 vCPU / 70 MB actual usage against a 32 vCPU / 32 GB ceiling is normal, not over-provisioned.
|
|
337
|
+
- **Disk does NOT auto-scale** — Railway volumes have a fixed capacity. Paid users (Hobby and Pro) can expand them live without downtime, but it requires a manual resize. Flag high disk utilization as actionable. Users are billed for actual disk utilization, not the full volume size.
|
|
338
|
+
- **Focus on actual usage values**, not the ratio to limits. Analyze whether 70 MB of memory is healthy for this workload — don't compare it to the 32 GB ceiling.
|
|
339
|
+
- When tuning database parameters (shared_buffers, innodb_buffer_pool_size, maxmemory, etc.), base recommendations on the **current actual RAM** from `metrics_history.memory`, not the limit.
|
|
340
|
+
|
|
341
|
+
## Validated against
|
|
342
|
+
|
|
343
|
+
- Docs: [ssh.md](https://docs.railway.com/cli/ssh), [logs.md](https://docs.railway.com/cli/logs), [metrics.md](https://docs.railway.com/cli/metrics), [api docs](https://docs.railway.com/api/llms-docs.md)
|
|
344
|
+
- Local scripts: [analyze-postgres.py](../scripts/analyze-postgres.py), [analyze-mysql.py](../scripts/analyze-mysql.py), [analyze-redis.py](../scripts/analyze-redis.py), [analyze-mongo.py](../scripts/analyze-mongo.py), [dal.py](../scripts/dal.py)
|