@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,330 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Detect directories that should have scoped AGENTS.md files
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
PROJECT_DIR="${1:-.}"
|
|
6
|
+
cd "$PROJECT_DIR"
|
|
7
|
+
|
|
8
|
+
MIN_FILES=5 # Minimum files to warrant scoped AGENTS.md
|
|
9
|
+
|
|
10
|
+
# Get project info
|
|
11
|
+
PROJECT_INFO=$(bash "$(dirname "$0")/detect-project.sh" "$PROJECT_DIR")
|
|
12
|
+
LANGUAGE=$(echo "$PROJECT_INFO" | jq -r '.language')
|
|
13
|
+
|
|
14
|
+
scopes=()
|
|
15
|
+
|
|
16
|
+
# Function to count source files in a directory
|
|
17
|
+
count_source_files() {
|
|
18
|
+
local dir="$1"
|
|
19
|
+
local pattern="$2"
|
|
20
|
+
find "$dir" -maxdepth 3 -type f -name "$pattern" 2>/dev/null | wc -l
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Function to add scope (uses jq for proper JSON escaping)
|
|
24
|
+
add_scope() {
|
|
25
|
+
local path="$1"
|
|
26
|
+
local type="$2"
|
|
27
|
+
local count="$3"
|
|
28
|
+
|
|
29
|
+
scopes+=("$(jq -n --arg p "$path" --arg t "$type" --argjson c "$count" \
|
|
30
|
+
'{path: $p, type: $t, files: $c}')")
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
# Language-specific scope detection
|
|
34
|
+
case "$LANGUAGE" in
|
|
35
|
+
"go")
|
|
36
|
+
# Check common Go directories
|
|
37
|
+
[ -d "internal" ] && {
|
|
38
|
+
count=$(count_source_files "internal" "*.go")
|
|
39
|
+
[ "$count" -ge "$MIN_FILES" ] && add_scope "internal" "backend-go" "$count"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[ -d "pkg" ] && {
|
|
43
|
+
count=$(count_source_files "pkg" "*.go")
|
|
44
|
+
[ "$count" -ge "$MIN_FILES" ] && add_scope "pkg" "backend-go" "$count"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[ -d "cmd" ] && {
|
|
48
|
+
count=$(count_source_files "cmd" "*.go")
|
|
49
|
+
[ "$count" -ge 3 ] && add_scope "cmd" "cli" "$count"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[ -d "examples" ] && {
|
|
53
|
+
count=$(count_source_files "examples" "*.go")
|
|
54
|
+
[ "$count" -ge 3 ] && add_scope "examples" "examples" "$count"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[ -d "testutil" ] && {
|
|
58
|
+
count=$(count_source_files "testutil" "*.go")
|
|
59
|
+
[ "$count" -ge 3 ] && add_scope "testutil" "testing" "$count"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
[ -d "docs" ] && {
|
|
63
|
+
count=$(find docs -type f \( -name "*.md" -o -name "*.rst" \) | wc -l)
|
|
64
|
+
[ "$count" -ge 3 ] && add_scope "docs" "documentation" "$count"
|
|
65
|
+
}
|
|
66
|
+
;;
|
|
67
|
+
|
|
68
|
+
"php")
|
|
69
|
+
# Determine PHP backend type based on framework
|
|
70
|
+
FRAMEWORK=$(echo "$PROJECT_INFO" | jq -r '.framework')
|
|
71
|
+
PROJECT_TYPE=$(echo "$PROJECT_INFO" | jq -r '.type')
|
|
72
|
+
|
|
73
|
+
# Select appropriate backend template
|
|
74
|
+
# Differentiate between extension/bundle (standalone package) vs project (full installation)
|
|
75
|
+
if [ "$PROJECT_TYPE" = "php-typo3-extension" ]; then
|
|
76
|
+
PHP_BACKEND_TYPE="typo3-extension"
|
|
77
|
+
elif [ "$PROJECT_TYPE" = "php-typo3" ]; then
|
|
78
|
+
PHP_BACKEND_TYPE="typo3-project"
|
|
79
|
+
elif [ "$PROJECT_TYPE" = "php-oro-bundle" ]; then
|
|
80
|
+
PHP_BACKEND_TYPE="oro-bundle"
|
|
81
|
+
elif [ "$PROJECT_TYPE" = "php-oro" ]; then
|
|
82
|
+
PHP_BACKEND_TYPE="oro-project"
|
|
83
|
+
elif [ "$FRAMEWORK" = "symfony" ] || [ "$PROJECT_TYPE" = "php-symfony" ]; then
|
|
84
|
+
PHP_BACKEND_TYPE="symfony"
|
|
85
|
+
else
|
|
86
|
+
PHP_BACKEND_TYPE="backend-php"
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
# Check common PHP directories
|
|
90
|
+
[ -d "Classes" ] && {
|
|
91
|
+
count=$(count_source_files "Classes" "*.php")
|
|
92
|
+
[ "$count" -ge "$MIN_FILES" ] && add_scope "Classes" "$PHP_BACKEND_TYPE" "$count"
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[ -d "src" ] && {
|
|
96
|
+
count=$(count_source_files "src" "*.php")
|
|
97
|
+
[ "$count" -ge "$MIN_FILES" ] && add_scope "src" "$PHP_BACKEND_TYPE" "$count"
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[ -d "Tests" ] && {
|
|
101
|
+
count=$(count_source_files "Tests" "*.php")
|
|
102
|
+
if [ "$count" -ge 3 ]; then
|
|
103
|
+
# Use TYPO3-specific testing template for TYPO3 extensions
|
|
104
|
+
if [ "$PROJECT_TYPE" = "php-typo3-extension" ]; then
|
|
105
|
+
add_scope "Tests" "typo3-testing" "$count"
|
|
106
|
+
else
|
|
107
|
+
add_scope "Tests" "testing" "$count"
|
|
108
|
+
fi
|
|
109
|
+
fi
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
[ -d "tests" ] && {
|
|
113
|
+
count=$(count_source_files "tests" "*.php")
|
|
114
|
+
[ "$count" -ge 3 ] && add_scope "tests" "testing" "$count"
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
[ -d "Documentation" ] && {
|
|
118
|
+
count=$(find Documentation -type f \( -name "*.rst" -o -name "*.md" \) | wc -l)
|
|
119
|
+
if [ "$count" -ge 3 ]; then
|
|
120
|
+
# Use TYPO3-specific docs template for TYPO3 extensions
|
|
121
|
+
if [ "$PROJECT_TYPE" = "php-typo3-extension" ]; then
|
|
122
|
+
add_scope "Documentation" "typo3-docs" "$count"
|
|
123
|
+
else
|
|
124
|
+
add_scope "Documentation" "documentation" "$count"
|
|
125
|
+
fi
|
|
126
|
+
fi
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
[ -d "Resources" ] && {
|
|
130
|
+
count=$(find Resources -type f | wc -l)
|
|
131
|
+
[ "$count" -ge 5 ] && add_scope "Resources" "resources" "$count"
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
# Oro-specific: check for Bundle directories within projects
|
|
135
|
+
if [ "$PROJECT_TYPE" = "php-oro" ]; then
|
|
136
|
+
for bundle_dir in src/*/Bundle/*/; do
|
|
137
|
+
[ -d "$bundle_dir" ] && {
|
|
138
|
+
count=$(count_source_files "$bundle_dir" "*.php")
|
|
139
|
+
[ "$count" -ge "$MIN_FILES" ] && add_scope "${bundle_dir%/}" "oro-bundle" "$count"
|
|
140
|
+
}
|
|
141
|
+
done
|
|
142
|
+
fi
|
|
143
|
+
;;
|
|
144
|
+
|
|
145
|
+
"typescript")
|
|
146
|
+
# Check common TypeScript/JavaScript directories
|
|
147
|
+
[ -d "src" ] && {
|
|
148
|
+
count=$(count_source_files "src" "*.ts")
|
|
149
|
+
ts_count=$count
|
|
150
|
+
count=$(count_source_files "src" "*.tsx")
|
|
151
|
+
tsx_count=$count
|
|
152
|
+
|
|
153
|
+
if [ "$tsx_count" -ge "$MIN_FILES" ]; then
|
|
154
|
+
add_scope "src" "frontend-typescript" "$tsx_count"
|
|
155
|
+
elif [ "$ts_count" -ge "$MIN_FILES" ]; then
|
|
156
|
+
add_scope "src" "backend-typescript" "$ts_count"
|
|
157
|
+
fi
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
[ -d "components" ] && {
|
|
161
|
+
count=$(count_source_files "components" "*.tsx")
|
|
162
|
+
[ "$count" -ge "$MIN_FILES" ] && add_scope "components" "frontend-typescript" "$count"
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
[ -d "pages" ] && {
|
|
166
|
+
count=$(count_source_files "pages" "*.tsx")
|
|
167
|
+
[ "$count" -ge 3 ] && add_scope "pages" "frontend-typescript" "$count"
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
[ -d "app" ] && {
|
|
171
|
+
count=$(count_source_files "app" "*.tsx")
|
|
172
|
+
[ "$count" -ge 3 ] && add_scope "app" "frontend-typescript" "$count"
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if [ -d "server" ] || [ -d "backend" ]; then
|
|
176
|
+
dir=$([ -d "server" ] && echo "server" || echo "backend")
|
|
177
|
+
count=$(count_source_files "$dir" "*.ts")
|
|
178
|
+
[ "$count" -ge "$MIN_FILES" ] && add_scope "$dir" "backend-typescript" "$count"
|
|
179
|
+
fi
|
|
180
|
+
|
|
181
|
+
if [ -d "__tests__" ] || [ -d "tests" ]; then
|
|
182
|
+
dir=$([ -d "__tests__" ] && echo "__tests__" || echo "tests")
|
|
183
|
+
count=$(count_source_files "$dir" "*.test.ts")
|
|
184
|
+
[ "$count" -ge 3 ] && add_scope "$dir" "testing" "$count"
|
|
185
|
+
fi
|
|
186
|
+
;;
|
|
187
|
+
|
|
188
|
+
"python")
|
|
189
|
+
# Determine Python template: use python-modern if pyproject.toml with ruff/mypy
|
|
190
|
+
PYTHON_TEMPLATE="backend-python"
|
|
191
|
+
if [ -f "pyproject.toml" ]; then
|
|
192
|
+
if grep -q 'ruff' pyproject.toml 2>/dev/null || grep -q 'mypy' pyproject.toml 2>/dev/null; then
|
|
193
|
+
PYTHON_TEMPLATE="python-modern"
|
|
194
|
+
fi
|
|
195
|
+
fi
|
|
196
|
+
|
|
197
|
+
# Check common Python directories
|
|
198
|
+
[ -d "src" ] && {
|
|
199
|
+
count=$(count_source_files "src" "*.py")
|
|
200
|
+
[ "$count" -ge "$MIN_FILES" ] && add_scope "src" "$PYTHON_TEMPLATE" "$count"
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
[ -d "tests" ] && {
|
|
204
|
+
count=$(count_source_files "tests" "*.py")
|
|
205
|
+
[ "$count" -ge 3 ] && add_scope "tests" "testing" "$count"
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
[ -d "scripts" ] && {
|
|
209
|
+
count=$(count_source_files "scripts" "*.py")
|
|
210
|
+
[ "$count" -ge 3 ] && add_scope "scripts" "cli" "$count"
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
[ -d "docs" ] && {
|
|
214
|
+
count=$(find docs -type f \( -name "*.md" -o -name "*.rst" \) | wc -l)
|
|
215
|
+
[ "$count" -ge 3 ] && add_scope "docs" "documentation" "$count"
|
|
216
|
+
}
|
|
217
|
+
;;
|
|
218
|
+
esac
|
|
219
|
+
|
|
220
|
+
# Check for web subdirectories (cross-language)
|
|
221
|
+
# IMPORTANT: Only create frontend-typescript scopes if Node toolchain exists
|
|
222
|
+
# Either: package.json in scope dir, package.json at root, or lockfile at root
|
|
223
|
+
has_node_toolchain() {
|
|
224
|
+
local scope_dir="$1"
|
|
225
|
+
[ -f "$scope_dir/package.json" ] || \
|
|
226
|
+
[ -f "package.json" ] || \
|
|
227
|
+
[ -f "pnpm-lock.yaml" ] || \
|
|
228
|
+
[ -f "yarn.lock" ] || \
|
|
229
|
+
[ -f "bun.lockb" ] || \
|
|
230
|
+
[ -f "package-lock.json" ]
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
for web_dir in internal/web web frontend client ui; do
|
|
234
|
+
if [ -d "$web_dir" ]; then
|
|
235
|
+
count=$(find "$web_dir" -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) 2>/dev/null | wc -l)
|
|
236
|
+
if [ "$count" -ge "$MIN_FILES" ] && has_node_toolchain "$web_dir"; then
|
|
237
|
+
add_scope "$web_dir" "frontend-typescript" "$count"
|
|
238
|
+
fi
|
|
239
|
+
fi
|
|
240
|
+
done
|
|
241
|
+
|
|
242
|
+
# Check for Claude Code skills (each skill gets its own scope)
|
|
243
|
+
if [ -d "skills" ]; then
|
|
244
|
+
for skill_dir in skills/*/; do
|
|
245
|
+
if [ -f "${skill_dir}SKILL.md" ]; then
|
|
246
|
+
# Count files in skill (sh, md, yaml)
|
|
247
|
+
count=$(find "$skill_dir" -type f \( -name "*.sh" -o -name "*.md" -o -name "*.yaml" -o -name "*.yml" \) 2>/dev/null | wc -l)
|
|
248
|
+
add_scope "${skill_dir%/}" "claude-code-skill" "$count"
|
|
249
|
+
fi
|
|
250
|
+
done
|
|
251
|
+
fi
|
|
252
|
+
|
|
253
|
+
# Check for DDEV local development environment (cross-language)
|
|
254
|
+
if [ -d ".ddev" ]; then
|
|
255
|
+
count=$(find .ddev -type f \( -name "*.yaml" -o -name "*.yml" \) 2>/dev/null | wc -l)
|
|
256
|
+
[ "$count" -ge 1 ] && add_scope ".ddev" "ddev" "$count"
|
|
257
|
+
fi
|
|
258
|
+
|
|
259
|
+
# Check for Docker/container directories (cross-language)
|
|
260
|
+
# These get "docker" scope type for container-focused documentation
|
|
261
|
+
for docker_dir in docker deploy .docker infrastructure infra; do
|
|
262
|
+
if [ -d "$docker_dir" ]; then
|
|
263
|
+
# Count Docker-related files
|
|
264
|
+
count=$(find "$docker_dir" -type f \( -name "Dockerfile*" -o -name "*.dockerfile" -o -name "docker-compose*.yml" -o -name "compose*.yml" -o -name "*.yaml" -o -name "*.sh" \) 2>/dev/null | wc -l)
|
|
265
|
+
[ "$count" -ge 2 ] && add_scope "$docker_dir" "docker" "$count"
|
|
266
|
+
fi
|
|
267
|
+
done
|
|
268
|
+
|
|
269
|
+
# Check for CI/CD configurations (cross-language)
|
|
270
|
+
# GitHub Actions
|
|
271
|
+
if [ -d ".github/workflows" ]; then
|
|
272
|
+
count=$(find .github/workflows -type f -name "*.yml" -o -name "*.yaml" 2>/dev/null | wc -l)
|
|
273
|
+
[ "$count" -ge 1 ] && add_scope ".github/workflows" "github-actions" "$count"
|
|
274
|
+
fi
|
|
275
|
+
|
|
276
|
+
# GitLab CI - use .gitlab directory if exists, otherwise skip (root AGENTS.md covers it)
|
|
277
|
+
if [ -f ".gitlab-ci.yml" ]; then
|
|
278
|
+
if [ -d ".gitlab" ]; then
|
|
279
|
+
count=$(find .gitlab -type f -name "*.yml" 2>/dev/null | wc -l)
|
|
280
|
+
[ "$count" -ge 1 ] && add_scope ".gitlab" "gitlab-ci" "$count"
|
|
281
|
+
fi
|
|
282
|
+
# Note: If no .gitlab/ directory, the root AGENTS.md will mention gitlab-ci.yml
|
|
283
|
+
fi
|
|
284
|
+
|
|
285
|
+
# Concourse CI
|
|
286
|
+
concourse_detected=false
|
|
287
|
+
concourse_dir=""
|
|
288
|
+
for concourse_pattern in "ci/pipeline.yml" "ci/pipeline.yaml" "concourse/pipeline.yml"; do
|
|
289
|
+
if [ -f "$concourse_pattern" ]; then
|
|
290
|
+
concourse_dir=$(dirname "$concourse_pattern")
|
|
291
|
+
concourse_detected=true
|
|
292
|
+
break
|
|
293
|
+
fi
|
|
294
|
+
done
|
|
295
|
+
# Check for pipeline.yml at root - only create scope if ci/ directory exists
|
|
296
|
+
if [ "$concourse_detected" = false ]; then
|
|
297
|
+
if [ -f "pipeline.yml" ] || [ -f "pipeline.yaml" ]; then
|
|
298
|
+
if [ -d "ci" ]; then
|
|
299
|
+
concourse_dir="ci"
|
|
300
|
+
concourse_detected=true
|
|
301
|
+
fi
|
|
302
|
+
# If no ci/ directory, root AGENTS.md will cover the pipeline file
|
|
303
|
+
fi
|
|
304
|
+
fi
|
|
305
|
+
# Also check for *-pipeline.yml at root - only create scope if ci/ directory exists
|
|
306
|
+
if [ "$concourse_detected" = false ]; then
|
|
307
|
+
pipeline_files=$(find . -maxdepth 1 -name "*-pipeline.yml" -o -name "*-pipeline.yaml" 2>/dev/null | wc -l)
|
|
308
|
+
if [ "$pipeline_files" -gt 0 ] && [ -d "ci" ]; then
|
|
309
|
+
concourse_dir="ci"
|
|
310
|
+
concourse_detected=true
|
|
311
|
+
fi
|
|
312
|
+
fi
|
|
313
|
+
if [ "$concourse_detected" = true ] && [ -n "$concourse_dir" ] && [ -d "$concourse_dir" ]; then
|
|
314
|
+
count=$(find "$concourse_dir" -type f \( -name "*.yml" -o -name "*.yaml" -o -name "*.sh" \) 2>/dev/null | wc -l)
|
|
315
|
+
[ "$count" -ge 1 ] && add_scope "$concourse_dir" "concourse" "$count"
|
|
316
|
+
fi
|
|
317
|
+
|
|
318
|
+
# Output JSON
|
|
319
|
+
if [ ${#scopes[@]} -eq 0 ]; then
|
|
320
|
+
echo '{"scopes": []}'
|
|
321
|
+
else
|
|
322
|
+
# Join scopes with commas via explicit loop — avoids IFS= entirely
|
|
323
|
+
# (the opengrep bash.lang.security.ifs-tampering rule flags any
|
|
324
|
+
# IFS= assignment, even inside subshells).
|
|
325
|
+
joined="${scopes[0]}"
|
|
326
|
+
for ((i=1; i<${#scopes[@]}; i++)); do
|
|
327
|
+
joined+=",${scopes[i]}"
|
|
328
|
+
done
|
|
329
|
+
echo "{\"scopes\": [$joined]}"
|
|
330
|
+
fi
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Detect utility files and libraries to prevent reinvention
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
PROJECT_DIR="${1:-.}"
|
|
6
|
+
cd "$PROJECT_DIR"
|
|
7
|
+
|
|
8
|
+
# Check if git is available
|
|
9
|
+
if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
|
10
|
+
echo ""
|
|
11
|
+
exit 0
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
# Get project language
|
|
15
|
+
PROJECT_INFO=$(bash "$(dirname "$0")/detect-project.sh" "$PROJECT_DIR" 2>/dev/null || echo '{"language":"unknown"}')
|
|
16
|
+
LANGUAGE=$(echo "$PROJECT_INFO" | jq -r '.language')
|
|
17
|
+
|
|
18
|
+
# Common utility directory names
|
|
19
|
+
UTIL_DIRS=("utils" "util" "helpers" "helper" "lib" "shared" "common" "pkg")
|
|
20
|
+
|
|
21
|
+
# Find utility directories
|
|
22
|
+
find_util_dirs() {
|
|
23
|
+
for dir in "${UTIL_DIRS[@]}"; do
|
|
24
|
+
[ -d "$dir" ] && echo "$dir"
|
|
25
|
+
[ -d "src/$dir" ] && echo "src/$dir"
|
|
26
|
+
[ -d "internal/$dir" ] && echo "internal/$dir"
|
|
27
|
+
done
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# Extract exports from TypeScript index file
|
|
31
|
+
extract_ts_exports() {
|
|
32
|
+
local file="$1"
|
|
33
|
+
grep -oE "export \{ [^}]+ \}" "$file" 2>/dev/null | \
|
|
34
|
+
sed 's/export { //; s/ }//; s/,/\n/g' | \
|
|
35
|
+
tr -d ' ' | head -10
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
# Extract function names from Go file
|
|
39
|
+
extract_go_exports() {
|
|
40
|
+
local dir="$1"
|
|
41
|
+
find "$dir" -name "*.go" -type f 2>/dev/null | while read -r file; do
|
|
42
|
+
grep -oE "^func [A-Z][a-zA-Z0-9_]*" "$file" 2>/dev/null | \
|
|
43
|
+
sed 's/func //' | head -5
|
|
44
|
+
done | sort -u | head -10
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# Extract function names from Python file
|
|
48
|
+
extract_py_exports() {
|
|
49
|
+
local dir="$1"
|
|
50
|
+
find "$dir" -name "*.py" ! -name "__*" -type f 2>/dev/null | while read -r file; do
|
|
51
|
+
grep -oE "^def [a-z_][a-z0-9_]*" "$file" 2>/dev/null | \
|
|
52
|
+
sed 's/def //' | head -5
|
|
53
|
+
done | sort -u | head -10
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
# Infer utility purpose from name
|
|
57
|
+
infer_purpose() {
|
|
58
|
+
local name="$1"
|
|
59
|
+
case "$name" in
|
|
60
|
+
*date*|*time*|*format*Date*) echo "date/time formatting" ;;
|
|
61
|
+
*http*|*fetch*|*api*|*client*) echo "HTTP requests" ;;
|
|
62
|
+
*log*) echo "logging" ;;
|
|
63
|
+
*valid*|*check*) echo "validation" ;;
|
|
64
|
+
*parse*) echo "parsing" ;;
|
|
65
|
+
*format*) echo "formatting" ;;
|
|
66
|
+
*error*) echo "error handling" ;;
|
|
67
|
+
*auth*|*token*) echo "authentication" ;;
|
|
68
|
+
*cache*) echo "caching" ;;
|
|
69
|
+
*config*) echo "configuration" ;;
|
|
70
|
+
*string*|*str*) echo "string manipulation" ;;
|
|
71
|
+
*file*|*path*) echo "file operations" ;;
|
|
72
|
+
*) echo "utility" ;;
|
|
73
|
+
esac
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# Generate output
|
|
77
|
+
output=""
|
|
78
|
+
|
|
79
|
+
while IFS= read -r dir; do
|
|
80
|
+
[ -z "$dir" ] && continue
|
|
81
|
+
|
|
82
|
+
case "$LANGUAGE" in
|
|
83
|
+
"typescript")
|
|
84
|
+
# Check for index.ts barrel export
|
|
85
|
+
if [ -f "$dir/index.ts" ]; then
|
|
86
|
+
while IFS= read -r export; do
|
|
87
|
+
[ -z "$export" ] && continue
|
|
88
|
+
purpose=$(infer_purpose "$export")
|
|
89
|
+
output="$output| $purpose | \`$export\` | \`$dir/\` |\n"
|
|
90
|
+
done < <(extract_ts_exports "$dir/index.ts")
|
|
91
|
+
fi
|
|
92
|
+
;;
|
|
93
|
+
|
|
94
|
+
"go")
|
|
95
|
+
while IFS= read -r func; do
|
|
96
|
+
[ -z "$func" ] && continue
|
|
97
|
+
purpose=$(infer_purpose "$func")
|
|
98
|
+
output="$output| $purpose | \`$func\` | \`$dir/\` |\n"
|
|
99
|
+
done < <(extract_go_exports "$dir")
|
|
100
|
+
;;
|
|
101
|
+
|
|
102
|
+
"python")
|
|
103
|
+
while IFS= read -r func; do
|
|
104
|
+
[ -z "$func" ] && continue
|
|
105
|
+
purpose=$(infer_purpose "$func")
|
|
106
|
+
output="$output| $purpose | \`$func\` | \`$dir/\` |\n"
|
|
107
|
+
done < <(extract_py_exports "$dir")
|
|
108
|
+
;;
|
|
109
|
+
|
|
110
|
+
"php")
|
|
111
|
+
# List PHP utility classes
|
|
112
|
+
while read -r file; do
|
|
113
|
+
class=$(grep -oE "class [A-Z][a-zA-Z0-9_]+" "$file" 2>/dev/null | head -1 | sed 's/class //')
|
|
114
|
+
[ -n "$class" ] && {
|
|
115
|
+
purpose=$(infer_purpose "$class")
|
|
116
|
+
relpath="${file#./}"
|
|
117
|
+
output="$output| $purpose | \`$class\` | \`$relpath\` |\n"
|
|
118
|
+
}
|
|
119
|
+
done < <(find "$dir" -name "*.php" -type f 2>/dev/null | head -20)
|
|
120
|
+
;;
|
|
121
|
+
esac
|
|
122
|
+
done < <(find_util_dirs)
|
|
123
|
+
|
|
124
|
+
# Check for common utility files at root or src
|
|
125
|
+
for util_file in "utils.ts" "utils.js" "helpers.ts" "helpers.js" "utils.py" "helpers.py"; do
|
|
126
|
+
for prefix in "" "src/"; do
|
|
127
|
+
file="${prefix}${util_file}"
|
|
128
|
+
[ -f "$file" ] && output="$output| utilities | \`$file\` | \`$file\` |\n"
|
|
129
|
+
done
|
|
130
|
+
done
|
|
131
|
+
|
|
132
|
+
# Output (remove empty lines, duplicates)
|
|
133
|
+
echo -e "$output" | sed '/^$/d' | sort -u | head -15
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Extract Architectural Decision Records (ADRs) from common locations
|
|
3
|
+
# Returns JSON with ADR metadata for AGENTS.md generation
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
PROJECT_DIR="${1:-.}"
|
|
7
|
+
cd "$PROJECT_DIR"
|
|
8
|
+
|
|
9
|
+
# Common ADR directory locations
|
|
10
|
+
ADR_DIRS=(
|
|
11
|
+
"docs/adr" "docs/adrs" "docs/decisions" "docs/architecture/decisions"
|
|
12
|
+
"Documentation/ADR" "Documentation/Decisions"
|
|
13
|
+
"adr" "ADR"
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
# Find the first existing ADR directory
|
|
17
|
+
ADR_DIR=""
|
|
18
|
+
for dir in "${ADR_DIRS[@]}"; do
|
|
19
|
+
if [ -d "$dir" ]; then
|
|
20
|
+
ADR_DIR="$dir"
|
|
21
|
+
break
|
|
22
|
+
fi
|
|
23
|
+
done
|
|
24
|
+
|
|
25
|
+
# If no ADR directory found, check for standalone ADR files in docs/
|
|
26
|
+
if [ -z "$ADR_DIR" ]; then
|
|
27
|
+
# Look for ADR-named files anywhere in docs/
|
|
28
|
+
if [ -d "docs" ]; then
|
|
29
|
+
adr_file=$(find docs -maxdepth 2 -type f \( -name "ADR-*.md" -o -name "adr-*.md" -o -name "*-adr-*.md" -o -name "ADR*.rst" \) 2>/dev/null | head -1)
|
|
30
|
+
if [ -n "$adr_file" ]; then
|
|
31
|
+
ADR_DIR=$(dirname "$adr_file")
|
|
32
|
+
fi
|
|
33
|
+
fi
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# No ADRs found
|
|
37
|
+
if [ -z "$ADR_DIR" ]; then
|
|
38
|
+
jq -n '{adr_count: 0, adr_directory: null, adrs: []}'
|
|
39
|
+
exit 0
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
# Collect ADR files
|
|
43
|
+
ADR_FILES=()
|
|
44
|
+
while IFS= read -r -d '' file; do
|
|
45
|
+
ADR_FILES+=("$file")
|
|
46
|
+
done < <(find "$ADR_DIR" -maxdepth 1 -type f \( -name "ADR-*.md" -o -name "adr-*.md" -o -name "*-adr-*.md" -o -name "ADR*.rst" -o -name "adr*.rst" -o -name "*.md" \) -print0 2>/dev/null | sort -z)
|
|
47
|
+
|
|
48
|
+
# Deduplicate and filter — only include files that look like ADRs
|
|
49
|
+
FILTERED_FILES=()
|
|
50
|
+
for file in "${ADR_FILES[@]}"; do
|
|
51
|
+
basename=$(basename "$file")
|
|
52
|
+
# Accept files with ADR in the name, or numbered files (common ADR pattern like 0001-*.md)
|
|
53
|
+
if [[ "$basename" =~ ^[Aa][Dd][Rr][-_] ]] || [[ "$basename" =~ ^[0-9]{3,4}[-_] ]] || [[ "$basename" =~ -[Aa][Dd][Rr][-_] ]]; then
|
|
54
|
+
FILTERED_FILES+=("$file")
|
|
55
|
+
fi
|
|
56
|
+
done
|
|
57
|
+
|
|
58
|
+
if [ ${#FILTERED_FILES[@]} -eq 0 ]; then
|
|
59
|
+
jq -n --arg dir "$ADR_DIR" '{adr_count: 0, adr_directory: $dir, adrs: []}'
|
|
60
|
+
exit 0
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# Extract metadata from each ADR
|
|
64
|
+
ADRS_JSON="[]"
|
|
65
|
+
for file in "${FILTERED_FILES[@]}"; do
|
|
66
|
+
filename=$(basename "$file")
|
|
67
|
+
|
|
68
|
+
# Read file content
|
|
69
|
+
content=$(cat "$file" 2>/dev/null) || continue
|
|
70
|
+
[ -z "$content" ] && continue
|
|
71
|
+
|
|
72
|
+
# Extract title: first heading (# or ##)
|
|
73
|
+
title=""
|
|
74
|
+
while IFS= read -r line; do
|
|
75
|
+
if [[ "$line" =~ ^#{1,2}[[:space:]]+(.*) ]]; then
|
|
76
|
+
title="${BASH_REMATCH[1]}"
|
|
77
|
+
# Strip leading ADR number prefix like "ADR-001:" or "ADR 1:"
|
|
78
|
+
title=$(echo "$title" | sed -E 's/^ADR[-_ ]?[0-9]+:?\s*//i')
|
|
79
|
+
break
|
|
80
|
+
fi
|
|
81
|
+
done <<< "$content"
|
|
82
|
+
[ -z "$title" ] && title="$filename"
|
|
83
|
+
|
|
84
|
+
# Extract status: look for "Status:" line or **Status** pattern
|
|
85
|
+
status="Unknown"
|
|
86
|
+
while IFS= read -r line; do
|
|
87
|
+
# Match patterns like "## Status", then read next non-empty line
|
|
88
|
+
if [[ "$line" =~ ^#{1,3}[[:space:]]+[Ss]tatus ]]; then
|
|
89
|
+
# Read lines after the status heading to find the actual status
|
|
90
|
+
found_heading=false
|
|
91
|
+
while IFS= read -r sline; do
|
|
92
|
+
if [ "$found_heading" = false ]; then
|
|
93
|
+
found_heading=true
|
|
94
|
+
continue
|
|
95
|
+
fi
|
|
96
|
+
# Skip empty lines
|
|
97
|
+
[[ -z "${sline// /}" ]] && continue
|
|
98
|
+
# Extract the status value
|
|
99
|
+
sline=$(echo "$sline" | sed -E 's/^\*\*//;s/\*\*.*$//;s/^- //;s/^`//;s/`$//')
|
|
100
|
+
if [[ "$sline" =~ ^(Accepted|Proposed|Deprecated|Superseded|Rejected|Draft|Approved) ]]; then
|
|
101
|
+
status="${BASH_REMATCH[1]}"
|
|
102
|
+
fi
|
|
103
|
+
break
|
|
104
|
+
done
|
|
105
|
+
break
|
|
106
|
+
fi
|
|
107
|
+
# Match inline patterns: "**Status**: Accepted", "**Status:** Accepted", "Status: Accepted"
|
|
108
|
+
if [[ "$line" =~ \*?\*?[Ss]tatus\*?\*?:?[[:space:]]*(Accepted|Proposed|Deprecated|Superseded|Rejected|Draft|Approved) ]]; then
|
|
109
|
+
status="${BASH_REMATCH[1]}"
|
|
110
|
+
break
|
|
111
|
+
fi
|
|
112
|
+
done <<< "$content"
|
|
113
|
+
|
|
114
|
+
# Extract summary: first paragraph after Context heading, or first paragraph after title
|
|
115
|
+
summary=""
|
|
116
|
+
# Try "Context" section first
|
|
117
|
+
in_context=false
|
|
118
|
+
while IFS= read -r line; do
|
|
119
|
+
if [[ "$line" =~ ^#{1,3}[[:space:]]+(Context|Background) ]]; then
|
|
120
|
+
in_context=true
|
|
121
|
+
continue
|
|
122
|
+
fi
|
|
123
|
+
if [ "$in_context" = true ]; then
|
|
124
|
+
[[ -z "${line// /}" ]] && continue
|
|
125
|
+
# Stop at next heading
|
|
126
|
+
[[ "$line" =~ ^# ]] && break
|
|
127
|
+
# Take the first non-empty, non-heading line
|
|
128
|
+
summary=$(echo "$line" | sed -E 's/^\*\*//;s/\*\*$//;s/^- //')
|
|
129
|
+
# Truncate to ~120 chars
|
|
130
|
+
if [ ${#summary} -gt 120 ]; then
|
|
131
|
+
summary="${summary:0:117}..."
|
|
132
|
+
fi
|
|
133
|
+
break
|
|
134
|
+
fi
|
|
135
|
+
done <<< "$content"
|
|
136
|
+
|
|
137
|
+
# Fallback: first paragraph after title
|
|
138
|
+
if [ -z "$summary" ]; then
|
|
139
|
+
past_title=false
|
|
140
|
+
while IFS= read -r line; do
|
|
141
|
+
if [[ "$line" =~ ^# ]] && [ "$past_title" = false ]; then
|
|
142
|
+
past_title=true
|
|
143
|
+
continue
|
|
144
|
+
fi
|
|
145
|
+
if [ "$past_title" = true ]; then
|
|
146
|
+
[[ -z "${line// /}" ]] && continue
|
|
147
|
+
[[ "$line" =~ ^# ]] && break
|
|
148
|
+
[[ "$line" =~ ^[*-][[:space:]] ]] && continue
|
|
149
|
+
summary=$(echo "$line" | sed -E 's/^\*\*//;s/\*\*$//;s/^- //')
|
|
150
|
+
if [ ${#summary} -gt 120 ]; then
|
|
151
|
+
summary="${summary:0:117}..."
|
|
152
|
+
fi
|
|
153
|
+
break
|
|
154
|
+
fi
|
|
155
|
+
done <<< "$content"
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
# Extract decision: look for "Decision" section
|
|
159
|
+
decision=""
|
|
160
|
+
in_decision=false
|
|
161
|
+
while IFS= read -r line; do
|
|
162
|
+
if [[ "$line" =~ ^#{1,3}[[:space:]]+(Decision|Resolution) ]]; then
|
|
163
|
+
in_decision=true
|
|
164
|
+
continue
|
|
165
|
+
fi
|
|
166
|
+
if [ "$in_decision" = true ]; then
|
|
167
|
+
[[ -z "${line// /}" ]] && continue
|
|
168
|
+
[[ "$line" =~ ^# ]] && break
|
|
169
|
+
[[ "$line" =~ ^\`\`\` ]] && break
|
|
170
|
+
decision=$(echo "$line" | sed -E 's/^\*\*//;s/\*\*$//;s/^- //')
|
|
171
|
+
if [ ${#decision} -gt 150 ]; then
|
|
172
|
+
decision="${decision:0:147}..."
|
|
173
|
+
fi
|
|
174
|
+
break
|
|
175
|
+
fi
|
|
176
|
+
done <<< "$content"
|
|
177
|
+
|
|
178
|
+
# Build JSON entry
|
|
179
|
+
ADRS_JSON=$(echo "$ADRS_JSON" | jq \
|
|
180
|
+
--arg file "$filename" \
|
|
181
|
+
--arg title "$title" \
|
|
182
|
+
--arg status "$status" \
|
|
183
|
+
--arg summary "$summary" \
|
|
184
|
+
--arg decision "$decision" \
|
|
185
|
+
'. + [{file: $file, title: $title, status: $status, summary: $summary, decision: $decision}]')
|
|
186
|
+
done
|
|
187
|
+
|
|
188
|
+
# Output final JSON
|
|
189
|
+
ADR_COUNT=$(echo "$ADRS_JSON" | jq 'length')
|
|
190
|
+
jq -n \
|
|
191
|
+
--argjson count "$ADR_COUNT" \
|
|
192
|
+
--arg dir "$ADR_DIR" \
|
|
193
|
+
--argjson adrs "$ADRS_JSON" \
|
|
194
|
+
'{adr_count: $count, adr_directory: $dir, adrs: $adrs}'
|