mcp-efficiency-engine 0.1.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/.github/CODEOWNERS +40 -0
- package/.github/GITHUB_MCP_INTEGRATION.md +366 -0
- package/.github/ISSUE_TEMPLATE/bug.md +51 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +45 -0
- package/.github/ISSUE_TEMPLATE/question.md +18 -0
- package/.github/agents/backend.agent.md +18 -0
- package/.github/agents/community-manager.agent.md +18 -0
- package/.github/agents/dba.agent.md +18 -0
- package/.github/agents/frontend-agent.agent.md +18 -0
- package/.github/agents/github-repository-manager.agent.md +338 -0
- package/.github/agents/iot.agent.md +20 -0
- package/.github/agents/legacy.agent.md +18 -0
- package/.github/agents/rag-azure.agent.md +18 -0
- package/.github/agents/rag-local.agent.md +18 -0
- package/.github/agents/snapshot.agent.md +18 -0
- package/.github/agents/ux-ui.agent.md +18 -0
- package/.github/agents/wiki-agent.agent.md +23 -0
- package/.github/copilot-instructions.md +44 -0
- package/.github/instructions/always-on-optimization.instructions.md +54 -0
- package/.github/prompts/auto-route.prompt.md +33 -0
- package/.github/prompts/azure-rag.query.prompt.md +19 -0
- package/.github/prompts/backend.fix-bug.prompt.md +13 -0
- package/.github/prompts/cavecrew.prompt.md +16 -0
- package/.github/prompts/caveman-commit.prompt.md +14 -0
- package/.github/prompts/caveman-compress.prompt.md +15 -0
- package/.github/prompts/caveman-debug.prompt.md +13 -0
- package/.github/prompts/caveman-help.prompt.md +11 -0
- package/.github/prompts/caveman-review.prompt.md +15 -0
- package/.github/prompts/caveman-stats.prompt.md +11 -0
- package/.github/prompts/caveman.prompt.md +11 -0
- package/.github/prompts/community.post.prompt.md +14 -0
- package/.github/prompts/dba.query-review.prompt.md +15 -0
- package/.github/prompts/dev.fix-bug.prompt.md +13 -0
- package/.github/prompts/frontend.code.prompt.md +13 -0
- package/.github/prompts/legacy.impact-analysis.prompt.md +14 -0
- package/.github/prompts/project.kickoff-analysis.prompt.md +51 -0
- package/.github/prompts/rag.knowledge-answer.prompt.md +13 -0
- package/.github/prompts/token-saver-review.prompt.md +14 -0
- package/.github/prompts/ux-ui.review.prompt.md +14 -0
- package/.github/pull_request_template.md +71 -0
- package/.github/skills/ahorro-tokens/SKILL.md +36 -0
- package/.github/skills/azure-rag-enterprise/SKILL.md +24 -0
- package/.github/skills/backend-coding/SKILL.md +24 -0
- package/.github/skills/cavecrew/SKILL.md +17 -0
- package/.github/skills/caveman/SKILL.md +25 -0
- package/.github/skills/caveman-commit/SKILL.md +15 -0
- package/.github/skills/caveman-compress/SKILL.md +14 -0
- package/.github/skills/caveman-help/SKILL.md +19 -0
- package/.github/skills/caveman-mode/SKILL.md +43 -0
- package/.github/skills/caveman-review/SKILL.md +16 -0
- package/.github/skills/caveman-stats/SKILL.md +13 -0
- package/.github/skills/community-content/SKILL.md +22 -0
- package/.github/skills/database-analysis/SKILL.md +23 -0
- package/.github/skills/dev-coding/SKILL.md +24 -0
- package/.github/skills/frontend-coding/SKILL.md +24 -0
- package/.github/skills/human-in-the-loop/SKILL.md +47 -0
- package/.github/skills/iot-architecture/SKILL.md +22 -0
- package/.github/skills/legacy-migration/SKILL.md +22 -0
- package/.github/skills/rag-knowledge/SKILL.md +21 -0
- package/.github/skills/token-saver/SKILL.md +36 -0
- package/.github/skills/ux-ui-governance/SKILL.md +24 -0
- package/.github/skills/wiki-tools.json +24 -0
- package/.github/workflows/auto-devlog.yml +56 -0
- package/.github/workflows/auto-manage-issues.yml +64 -0
- package/.github/workflows/auto-sync.yml +54 -0
- package/.github/workflows/autodocs-sync.yml +114 -0
- package/.github/workflows/ci.yml +68 -0
- package/.github/workflows/pages.yml +59 -0
- package/.github/workflows/routing-evals.yml +59 -0
- package/.github/workflows/techriders-coverage-effective.yml +91 -0
- package/.vscode/mcp.json +44 -0
- package/AGENTS.md +160 -0
- package/ARCHITECTURE.md +57 -0
- package/FINAL_USAGE_GUIDE.md +106 -0
- package/LICENSE +21 -0
- package/README.md +385 -0
- package/README_WIKI.md +130 -0
- package/autodocs/README.md +22 -0
- package/autodocs/schema/wiki-node.schema.json +56 -0
- package/autolearning/feedback-loop.md +90 -0
- package/bin/install-host.js +326 -0
- package/bin/mcpee.js +116 -0
- package/context/repomix/repomix.config.json +20 -0
- package/memory/cross-memory-reasoning.md +17 -0
- package/memory/mempry-registry.yml +16 -0
- package/observability/evals/chat-token-usage-report.json +64 -0
- package/observability/evals/chat-token-usage-report.md +33 -0
- package/observability/evals/iteration-value-report.json +76 -0
- package/observability/evals/iteration-value-report.md +39 -0
- package/observability/evals/learning-loop-report.json +268 -0
- package/observability/evals/learning-loop-report.md +37 -0
- package/observability/evals/repo-intake-eval-cases.md +23 -0
- package/observability/evals/routing-eval-cases.json +68 -0
- package/observability/evals/routing-eval-cases.md +25 -0
- package/observability/evals/routing-eval-report.json +72 -0
- package/observability/evaluation.md +34 -0
- package/observability/logs/copilot-usage-ingest-report.json +13 -0
- package/observability/logs/iteration-metrics.jsonl +75 -0
- package/observability/logs/learning-feedback.jsonl +152 -0
- package/observability/logs/routing-decisions.jsonl +333 -0
- package/observability/logs/session/agent-pipeline-preflight-20260701-004146.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260701-005554.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260701-010351.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260704-145829.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260704-150021.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260704-154328.log +8 -0
- package/observability/logs/session/bye-20260629-221513.json +39 -0
- package/observability/logs/session/bye-20260629-221545.json +59 -0
- package/observability/logs/session/bye-20260629-222007.json +52 -0
- package/observability/logs/session/bye-20260629-222133.json +59 -0
- package/observability/logs/session/bye-20260629-222412.json +45 -0
- package/observability/logs/session/bye-20260629-223224.json +52 -0
- package/observability/logs/session/bye-20260629-224050.json +59 -0
- package/observability/logs/session/bye-20260630-105732.json +24 -0
- package/observability/logs/session/bye-20260630-211536.json +87 -0
- package/observability/logs/session/bye-20260630-223423.json +87 -0
- package/observability/logs/session/bye-20260630-232534.json +87 -0
- package/observability/logs/session/bye-20260701-003638.json +126 -0
- package/observability/logs/session/bye-20260701-003849.json +126 -0
- package/observability/logs/session/bye-20260701-004315.json +138 -0
- package/observability/logs/session/bye-20260701-004559.json +76 -0
- package/observability/logs/session/bye-20260701-005913.json +138 -0
- package/observability/logs/session/bye-20260701-010753.json +138 -0
- package/observability/logs/session/bye-20260703-194106.json +24 -0
- package/observability/logs/session/bye-20260703-233443.json +76 -0
- package/observability/logs/session/bye-20260703-233653.json +76 -0
- package/observability/logs/session/bye-20260704-150317.json +152 -0
- package/observability/logs/session/bye-20260704-150929.json +75 -0
- package/observability/logs/session/bye-20260704-151050.json +75 -0
- package/observability/logs/session/bye-20260705-115458.json +165 -0
- package/observability/logs/session/codegraph-status-20260701-004228.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-004310.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-005637.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-005908.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-010444.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-010747.log +39 -0
- package/observability/logs/session/codegraph-status-20260704-150137.log +26 -0
- package/observability/logs/session/codegraph-status-20260704-150313.log +28 -0
- package/observability/logs/session/codegraph-status-20260704-154445.log +26 -0
- package/observability/logs/session/codegraph-status-20260705-115454.log +27 -0
- package/observability/logs/session/codegraph-sync-20260701-004211.log +88 -0
- package/observability/logs/session/codegraph-sync-20260701-004241.log +82 -0
- package/observability/logs/session/codegraph-sync-20260701-005620.log +89 -0
- package/observability/logs/session/codegraph-sync-20260701-005840.log +88 -0
- package/observability/logs/session/codegraph-sync-20260701-010419.log +93 -0
- package/observability/logs/session/codegraph-sync-20260701-010609.log +90 -0
- package/observability/logs/session/codegraph-sync-20260704-145856.log +70 -0
- package/observability/logs/session/codegraph-sync-20260704-150047.log +53 -0
- package/observability/logs/session/codegraph-sync-20260704-150204.log +44 -0
- package/observability/logs/session/codegraph-sync-20260704-154353.log +26 -0
- package/observability/logs/session/codegraph-sync-20260705-115337.log +32 -0
- package/observability/logs/session/hi-20260629-221459.json +38 -0
- package/observability/logs/session/hi-20260629-221945.json +59 -0
- package/observability/logs/session/hi-20260629-222108.json +66 -0
- package/observability/logs/session/hi-20260629-222352.json +45 -0
- package/observability/logs/session/hi-20260629-225719.json +59 -0
- package/observability/logs/session/hi-20260629-233722.json +52 -0
- package/observability/logs/session/hi-20260629-233913.json +198 -0
- package/observability/logs/session/hi-20260630-110156.json +177 -0
- package/observability/logs/session/hi-20260630-191243.json +184 -0
- package/observability/logs/session/hi-20260630-230050.json +234 -0
- package/observability/logs/session/hi-20260630-230523.json +227 -0
- package/observability/logs/session/hi-20260630-230855.json +227 -0
- package/observability/logs/session/hi-20260630-231638.json +227 -0
- package/observability/logs/session/hi-20260630-231756.json +219 -0
- package/observability/logs/session/hi-20260701-002842.json +234 -0
- package/observability/logs/session/hi-20260701-003458.json +282 -0
- package/observability/logs/session/hi-20260701-004233.json +290 -0
- package/observability/logs/session/hi-20260701-004554.json +236 -0
- package/observability/logs/session/hi-20260701-005641.json +290 -0
- package/observability/logs/session/hi-20260701-010450.json +290 -0
- package/observability/logs/session/hi-20260703-233854.json +312 -0
- package/observability/logs/session/hi-20260703-234448.json +318 -0
- package/observability/logs/session/hi-20260704-145907.json +353 -0
- package/observability/logs/session/hi-20260704-150141.json +392 -0
- package/observability/logs/session/hi-20260704-154448.json +392 -0
- package/observability/logs/session/iteration-value-refresh-20260701-004309.log +3 -0
- package/observability/logs/session/iteration-value-refresh-20260701-005907.log +3 -0
- package/observability/logs/session/iteration-value-refresh-20260701-010747.log +3 -0
- package/observability/logs/session/iteration-value-refresh-20260704-150312.log +3 -0
- package/observability/logs/session/iteration-value-refresh-20260705-115453.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260701-004309.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260701-005906.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260701-010745.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260704-150309.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260705-115450.log +3 -0
- package/observability/logs/session/project-notes-refresh-20260701-004227.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-004308.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-005636.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-005906.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-010443.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-010744.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260704-150133.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260704-150309.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260704-154442.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260705-115449.log +1 -0
- package/observability/logs/session/repo-intake-20260701-004218.log +6 -0
- package/observability/logs/session/repo-intake-20260701-005626.log +6 -0
- package/observability/logs/session/repo-intake-20260701-010433.log +6 -0
- package/observability/logs/session/repo-intake-20260704-150053.log +6 -0
- package/observability/logs/session/repo-intake-20260704-154404.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260701-004247.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260701-005847.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260701-010615.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260704-150209.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260705-115342.log +6 -0
- package/observability/logs/session/repo-registry-validation-20260701-004234.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260701-004556.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260701-005833.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260701-010601.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260704-150155.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260705-115323.log +2 -0
- package/observability/logs/session/repomix-refresh-20260701-003823.log +4236 -0
- package/observability/logs/session/repomix-refresh-20260701-004251.log +4275 -0
- package/observability/logs/session/repomix-refresh-20260701-005850.log +4248 -0
- package/observability/logs/session/repomix-refresh-20260701-010619.log +6531 -0
- package/observability/logs/session/repomix-refresh-20260704-150239.log +652 -0
- package/observability/logs/session/repomix-refresh-20260705-115419.log +178 -0
- package/observability/logs/session/routing-evals-20260701-004221.log +2 -0
- package/observability/logs/session/routing-evals-20260701-004235.log +2 -0
- package/observability/logs/session/routing-evals-20260701-005629.log +2 -0
- package/observability/logs/session/routing-evals-20260701-005834.log +2 -0
- package/observability/logs/session/routing-evals-20260701-010437.log +2 -0
- package/observability/logs/session/routing-evals-20260701-010603.log +2 -0
- package/observability/logs/session/routing-evals-20260704-150125.log +2 -0
- package/observability/logs/session/routing-evals-20260704-150157.log +2 -0
- package/observability/logs/session/routing-evals-20260704-154434.log +2 -0
- package/observability/logs/session/routing-evals-20260705-115327.log +2 -0
- package/observability/logs/session/sibling-discovery-refresh-20260701-004250.log +3 -0
- package/observability/logs/session/sibling-discovery-refresh-20260701-005850.log +3 -0
- package/observability/logs/session/sibling-discovery-refresh-20260701-010618.log +3 -0
- package/observability/logs/session/sibling-discovery-refresh-20260704-150238.log +3 -0
- package/observability/logs/session/sibling-discovery-refresh-20260705-115418.log +3 -0
- package/observability/logs.schema.json +95 -0
- package/observability/logs.schema.md +26 -0
- package/observability/metrics.md +35 -0
- package/observability/routing-evaluator.md +37 -0
- package/observability/scoring-rubric.md +38 -0
- package/optimization/ALWAYS_ON_OPTIMIZATION.md +98 -0
- package/optimization/caveman-mode.md +62 -0
- package/optimization/examples/login-bug.md +25 -0
- package/optimization/examples/sla-query.md +25 -0
- package/optimization/optimization-routing.md +30 -0
- package/optimization/policies/response-style.policy.md +45 -0
- package/optimization/policies/token-budget.policy.md +28 -0
- package/optimization/profiles/always-on.profile.md +19 -0
- package/optimization/profiles/architecture.profile.md +20 -0
- package/optimization/profiles/debug.profile.md +20 -0
- package/optimization/profiles/enterprise-rag.profile.md +20 -0
- package/optimization/profiles/training.profile.md +20 -0
- package/optimization/token-saver.md +58 -0
- package/orchestrator/corporate-routing.md +51 -0
- package/orchestrator/decision-matrix.md +33 -0
- package/orchestrator/fallback.md +29 -0
- package/orchestrator/repo-routing.md +58 -0
- package/orchestrator/router.md +75 -0
- package/orchestrator/wiki/__init__.py +5 -0
- package/orchestrator/wiki/graph_consolidator.py +506 -0
- package/orchestrator/wiki/incremental_engine.py +57 -0
- package/orchestrator/wiki/plugin_manager.py +40 -0
- package/package.json +70 -0
- package/policies/context-policy.md +25 -0
- package/policies/cost-policy.md +25 -0
- package/policies/repo-intake-policy.md +36 -0
- package/policies/security-policy.md +25 -0
- package/repo-intake/README.md +81 -0
- package/repo-intake/templates/agent.template.md +4 -0
- package/repo-intake/templates/context-manifest.template.md +4 -0
- package/repo-intake/templates/skill.template.md +3 -0
- package/repo-registry/repos.schema.json +102 -0
- package/repo-registry/repos.template.json +26 -0
- package/requirements.txt +1 -0
- package/scripts/README.md +109 -0
- package/scripts/__init__.py +0 -0
- package/scripts/bootstrap-portable.cmd +4 -0
- package/scripts/bootstrap-portable.ps1 +90 -0
- package/scripts/context/azure-rag-mcp-adapter.py +1 -0
- package/scripts/context/build-graphify.ps1 +1 -0
- package/scripts/context/build-repomix.ps1 +1 -0
- package/scripts/discovery/discover-boost-repos.cmd +4 -0
- package/scripts/discovery/discover-boost-repos.py +186 -0
- package/scripts/discovery/refresh-project-notes.py +179 -0
- package/scripts/github/INSTALL.md +295 -0
- package/scripts/github/README.md +455 -0
- package/scripts/github/apply-boost-templates.ps1 +163 -0
- package/scripts/github/apply-single-repo.ps1 +85 -0
- package/scripts/github/create-devlog.ps1 +380 -0
- package/scripts/github/manage-issues.ps1 +332 -0
- package/scripts/github/sync-repo.ps1 +267 -0
- package/scripts/intake/agent-pipeline-preflight.py +151 -0
- package/scripts/intake/init-template-registry.cmd +4 -0
- package/scripts/intake/init-template-registry.ps1 +258 -0
- package/scripts/intake/repo-intake.py +354 -0
- package/scripts/intake/resolve-routing.py +620 -0
- package/scripts/intake/run-repo-intake.cmd +4 -0
- package/scripts/intake/run-repo-intake.ps1 +46 -0
- package/scripts/intake/run-routing-evals.py +147 -0
- package/scripts/intake/validate-database-routing.py +91 -0
- package/scripts/intake/validate-rag-routing.py +85 -0
- package/scripts/intake/validate-repo-registry.ps1 +20 -0
- package/scripts/intake/validate-repo-registry.py +286 -0
- package/scripts/intake/validate-security.py +170 -0
- package/scripts/learning/autolearning-gate.py +71 -0
- package/scripts/learning/chat-token-usage-report.py +326 -0
- package/scripts/learning/ingest-copilot-session-usage.py +421 -0
- package/scripts/learning/iteration-value-report.py +275 -0
- package/scripts/learning/learning-loop-report.py +272 -0
- package/scripts/learning/record-iteration-metrics.py +116 -0
- package/scripts/learning/record-learning-feedback.py +91 -0
- package/scripts/ops/bye.ps1 +620 -0
- package/scripts/ops/compare-demo-results.ps1 +826 -0
- package/scripts/ops/demo1.ps1 +11 -0
- package/scripts/ops/demo2.ps1 +11 -0
- package/scripts/ops/demo3.ps1 +11 -0
- package/scripts/ops/demo4.ps1 +11 -0
- package/scripts/ops/hi.ps1 +1045 -0
- package/scripts/ops/llm-token-probe.py +164 -0
- package/scripts/ops/run-all-demos.ps1 +39 -0
- package/scripts/ops/run-demo-block.ps1 +85 -0
- package/scripts/ops/run-demo-session.ps1 +532 -0
- package/scripts/setup/optimize-engines.ps1 +183 -0
- package/scripts/setup/setup-codegraph.ps1 +3 -0
- package/scripts/setup/setup-gitnexus.ps1 +3 -0
- package/scripts/setup/setup-graphify.ps1 +2 -0
- package/scripts/setup/setup-prerequisites.ps1 +205 -0
- package/scripts/setup/start-gitnexus.ps1 +71 -0
- package/scripts/setup/validate-context.ps1 +361 -0
- package/scripts/wiki/__init__.py +0 -0
- package/scripts/wiki/compiler_main.py +189 -0
- package/scripts/wiki/normalizer.py +206 -0
- package/scripts/wiki/providers/base_provider.py +25 -0
- package/scripts/wiki/providers/codegraph_provider.py +49 -0
- package/scripts/wiki/providers/graphify_provider.py +49 -0
- package/scripts/wiki/providers/repo_content_provider.py +408 -0
- package/scripts/wiki/query_autodocs.py +60 -0
- package/scripts/wiki/validator.py +183 -0
- package/scripts/wiki/wiki_compiler.py +5 -0
- package/specs/architecture.spec.md +32 -0
- package/specs/azure-rag.spec.md +28 -0
- package/specs/coding-standards.spec.md +24 -0
- package/specs/database.spec.md +29 -0
- package/specs/migration.spec.md +26 -0
- package/specs/observability.spec.md +24 -0
- package/specs/optimization.spec.md +31 -0
- package/specs/rag.spec.md +30 -0
- package/specs/repo-intake.spec.md +25 -0
- package/specs/routing.spec.md +24 -0
- package/specs/security.spec.md +30 -0
- package/specs/wiki/provider-contract.json +33 -0
- package/specs/wiki/unified-knowledge-graph.json +25 -0
- package/templates/BOOST_README_TEMPLATE.md +96 -0
- package/templates/CODEOWNERS_TEMPLATE.txt +29 -0
- package/templates/LICENSE_MIT_TEMPLATE.txt +21 -0
- package/templates/PERSONAL_README_TEMPLATE.md +90 -0
- package/templates/README_boost_RAG_Azure.md +46 -0
- package/templates/README_boost_azure_iot_edge.md +48 -0
- package/templates/README_boost_backend.md +47 -0
- package/templates/README_boost_dba.md +57 -0
- package/templates/ci.yml.template +73 -0
- package/tooling/tooling.manifest.json +72 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
import re
|
|
6
|
+
from datetime import datetime, timezone
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def utc_now() -> str:
|
|
12
|
+
return datetime.now(timezone.utc).isoformat()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def load_registry(path: Path) -> dict[str, Any]:
|
|
16
|
+
content = path.read_text(encoding="utf-8")
|
|
17
|
+
if content.lstrip().startswith("{"):
|
|
18
|
+
return json.loads(content)
|
|
19
|
+
raise ValueError("Registry must be JSON-first in current setup.")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def slug_name(folder_name: str) -> str:
|
|
23
|
+
name = folder_name.lower().replace("-", "_")
|
|
24
|
+
name = re.sub(r"[^a-z0-9_]+", "_", name)
|
|
25
|
+
name = re.sub(r"_+", "_", name).strip("_")
|
|
26
|
+
if not name.startswith("boost_"):
|
|
27
|
+
name = f"boost_{name}"
|
|
28
|
+
return name
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def infer_domain(folder_name: str) -> str:
|
|
32
|
+
token = folder_name.lower()
|
|
33
|
+
if "dba" in token or "sql" in token or "db" in token:
|
|
34
|
+
return "dba"
|
|
35
|
+
if "iot" in token or "edge" in token:
|
|
36
|
+
return "iot"
|
|
37
|
+
if "rag" in token or "azure" in token:
|
|
38
|
+
return "azure-rag"
|
|
39
|
+
if "legacy" in token or "migration" in token:
|
|
40
|
+
return "legacy"
|
|
41
|
+
return "dev"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def default_engines(domain: str) -> dict[str, str]:
|
|
45
|
+
if domain == "dba":
|
|
46
|
+
return {"knowledge": "graphify", "execution": "none", "snapshot": "repomix"}
|
|
47
|
+
if domain == "iot":
|
|
48
|
+
return {"knowledge": "graphify", "execution": "gitnexus", "snapshot": "repomix"}
|
|
49
|
+
if domain == "azure-rag":
|
|
50
|
+
return {"knowledge": "azure-rag-builder", "execution": "none", "snapshot": "repomix"}
|
|
51
|
+
if domain == "legacy":
|
|
52
|
+
return {"knowledge": "gitnexus", "execution": "none", "snapshot": "repomix"}
|
|
53
|
+
return {"knowledge": "codegraph", "execution": "none", "snapshot": "repomix"}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def build_candidate(folder: Path, review_ticket_prefix: str, idx: int) -> dict[str, Any]:
|
|
57
|
+
folder_name = folder.name
|
|
58
|
+
repo_name = slug_name(folder_name)
|
|
59
|
+
domain = infer_domain(folder_name)
|
|
60
|
+
return {
|
|
61
|
+
"name": repo_name,
|
|
62
|
+
"domain": domain,
|
|
63
|
+
"version": "1.0.0",
|
|
64
|
+
"location": f"../{folder_name}",
|
|
65
|
+
"type": "local",
|
|
66
|
+
"dependencies": [],
|
|
67
|
+
"approval": {
|
|
68
|
+
"status": "approved",
|
|
69
|
+
"approved_by": "platform-team",
|
|
70
|
+
"approved_date": datetime.now().date().isoformat(),
|
|
71
|
+
"review_ticket": f"{review_ticket_prefix}-{1000 + idx}",
|
|
72
|
+
},
|
|
73
|
+
"engines": default_engines(domain),
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def main() -> int:
|
|
78
|
+
parser = argparse.ArgumentParser(description="Discover sibling boost_* repos and generate onboarding proposal.")
|
|
79
|
+
parser.add_argument("--root", default="C:/repo", help="Parent folder containing sibling repos")
|
|
80
|
+
parser.add_argument("--registry", default="repo-registry/repos.yml", help="Registry file path")
|
|
81
|
+
parser.add_argument("--output", default="repo-intake/generated/reports/boost-discovery-proposal.json")
|
|
82
|
+
parser.add_argument("--apply", action="store_true", help="Apply candidates directly to registry")
|
|
83
|
+
parser.add_argument("--review-ticket-prefix", default="PLATFORM", help="Prefix used for generated review tickets")
|
|
84
|
+
args = parser.parse_args()
|
|
85
|
+
|
|
86
|
+
repo_root = Path(__file__).resolve().parents[2]
|
|
87
|
+
registry_path = (repo_root / args.registry).resolve()
|
|
88
|
+
registry = load_registry(registry_path)
|
|
89
|
+
|
|
90
|
+
prefix = str(registry.get("governance", {}).get("repo_name_prefix", "boost_"))
|
|
91
|
+
root = Path(args.root)
|
|
92
|
+
if not root.exists():
|
|
93
|
+
print(f"Root path not found: {root}")
|
|
94
|
+
return 1
|
|
95
|
+
|
|
96
|
+
existing_names = {
|
|
97
|
+
str(r.get("name", ""))
|
|
98
|
+
for r in registry.get("repos", [])
|
|
99
|
+
if isinstance(r, dict)
|
|
100
|
+
}
|
|
101
|
+
existing_locations = {
|
|
102
|
+
str(r.get("location", ""))
|
|
103
|
+
for r in registry.get("repos", [])
|
|
104
|
+
if isinstance(r, dict)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
siblings = [
|
|
108
|
+
p for p in root.iterdir()
|
|
109
|
+
if p.is_dir() and p.name.startswith(prefix) and p.name != repo_root.name
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
candidates: list[dict[str, Any]] = []
|
|
113
|
+
skipped: list[dict[str, str]] = []
|
|
114
|
+
idx = 1
|
|
115
|
+
for folder in sorted(siblings, key=lambda x: x.name.lower()):
|
|
116
|
+
candidate = build_candidate(folder=folder, review_ticket_prefix=args.review_ticket_prefix, idx=idx)
|
|
117
|
+
idx += 1
|
|
118
|
+
|
|
119
|
+
if candidate["name"] in existing_names:
|
|
120
|
+
skipped.append({"folder": folder.name, "reason": "already_registered_name"})
|
|
121
|
+
continue
|
|
122
|
+
if candidate["location"] in existing_locations:
|
|
123
|
+
skipped.append({"folder": folder.name, "reason": "already_registered_location"})
|
|
124
|
+
continue
|
|
125
|
+
candidates.append(candidate)
|
|
126
|
+
|
|
127
|
+
proposal = {
|
|
128
|
+
"timestamp": utc_now(),
|
|
129
|
+
"root": str(root).replace("\\", "/"),
|
|
130
|
+
"prefix": prefix,
|
|
131
|
+
"registry": str(registry_path).replace("\\", "/"),
|
|
132
|
+
"existing_count": len(existing_names),
|
|
133
|
+
"candidates_count": len(candidates),
|
|
134
|
+
"skipped_count": len(skipped),
|
|
135
|
+
"candidates": candidates,
|
|
136
|
+
"skipped": skipped,
|
|
137
|
+
"apply_mode": bool(args.apply),
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
out_path = (repo_root / args.output).resolve()
|
|
141
|
+
out_path.parent.mkdir(parents=True, exist_ok=True)
|
|
142
|
+
out_path.write_text(json.dumps(proposal, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
|
|
143
|
+
|
|
144
|
+
md_path = out_path.with_suffix(".md")
|
|
145
|
+
lines = [
|
|
146
|
+
"# Boost Discovery Proposal",
|
|
147
|
+
"",
|
|
148
|
+
f"- timestamp: {proposal['timestamp']}",
|
|
149
|
+
f"- candidates: {proposal['candidates_count']}",
|
|
150
|
+
f"- skipped: {proposal['skipped_count']}",
|
|
151
|
+
"",
|
|
152
|
+
"## Candidates",
|
|
153
|
+
"",
|
|
154
|
+
]
|
|
155
|
+
if candidates:
|
|
156
|
+
for c in candidates:
|
|
157
|
+
lines.append(f"- {c['name']} ({c['domain']}) -> {c['location']}")
|
|
158
|
+
else:
|
|
159
|
+
lines.append("- none")
|
|
160
|
+
lines.extend(["", "## Skipped", ""])
|
|
161
|
+
if skipped:
|
|
162
|
+
for s in skipped:
|
|
163
|
+
lines.append(f"- {s['folder']}: {s['reason']}")
|
|
164
|
+
else:
|
|
165
|
+
lines.append("- none")
|
|
166
|
+
md_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
|
167
|
+
|
|
168
|
+
if args.apply and candidates:
|
|
169
|
+
registry_repos = registry.get("repos", [])
|
|
170
|
+
if not isinstance(registry_repos, list):
|
|
171
|
+
print("Registry repos field is invalid.")
|
|
172
|
+
return 1
|
|
173
|
+
registry_repos.extend(candidates)
|
|
174
|
+
registry["repos"] = registry_repos
|
|
175
|
+
registry_path.write_text(json.dumps(registry, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
|
|
176
|
+
print(f"Applied {len(candidates)} candidates to registry.")
|
|
177
|
+
else:
|
|
178
|
+
print("Dry-run mode. No registry changes applied.")
|
|
179
|
+
|
|
180
|
+
print(f"Proposal JSON: {out_path}")
|
|
181
|
+
print(f"Proposal MD: {md_path}")
|
|
182
|
+
return 0
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
if __name__ == "__main__":
|
|
186
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
from datetime import datetime, timezone
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
AUTO_START = "<!-- AUTO-GENERATED:START -->"
|
|
10
|
+
AUTO_END = "<!-- AUTO-GENERATED:END -->"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def utc_now() -> str:
|
|
14
|
+
return datetime.now(timezone.utc).isoformat()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def load_json(path: Path) -> dict[str, Any]:
|
|
18
|
+
if not path.exists():
|
|
19
|
+
return {}
|
|
20
|
+
try:
|
|
21
|
+
data = json.loads(path.read_text(encoding="utf-8"))
|
|
22
|
+
except Exception:
|
|
23
|
+
return {}
|
|
24
|
+
return data if isinstance(data, dict) else {}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def get_number(value: Any, default: float = 0.0) -> float:
|
|
28
|
+
if isinstance(value, (int, float)):
|
|
29
|
+
return float(value)
|
|
30
|
+
return default
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def upsert_auto_section(path: Path, title: str, body_lines: list[str]) -> None:
|
|
34
|
+
header = f"# {title}\n\n"
|
|
35
|
+
auto_block = [AUTO_START, *body_lines, AUTO_END, ""]
|
|
36
|
+
auto_text = "\n".join(auto_block)
|
|
37
|
+
|
|
38
|
+
if not path.exists():
|
|
39
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
40
|
+
path.write_text(header + auto_text, encoding="utf-8")
|
|
41
|
+
return
|
|
42
|
+
|
|
43
|
+
text = path.read_text(encoding="utf-8")
|
|
44
|
+
if not text.strip():
|
|
45
|
+
text = header
|
|
46
|
+
|
|
47
|
+
if AUTO_START in text and AUTO_END in text:
|
|
48
|
+
start = text.index(AUTO_START)
|
|
49
|
+
end = text.index(AUTO_END) + len(AUTO_END)
|
|
50
|
+
new_text = text[:start].rstrip() + "\n\n" + auto_text
|
|
51
|
+
else:
|
|
52
|
+
new_text = text.rstrip() + "\n\n" + auto_text
|
|
53
|
+
|
|
54
|
+
path.write_text(new_text, encoding="utf-8")
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def build_decisions_lines(routing: dict[str, Any], learning: dict[str, Any], value: dict[str, Any]) -> list[str]:
|
|
58
|
+
cases_total = int(routing.get("cases_total", 0) or 0)
|
|
59
|
+
cases_passed = int(routing.get("cases_passed", 0) or 0)
|
|
60
|
+
|
|
61
|
+
health = learning.get("health", {}) if isinstance(learning.get("health", {}), dict) else {}
|
|
62
|
+
fallback_ok = bool(health.get("fallback_ok", False))
|
|
63
|
+
grounded_ok = bool(health.get("grounded_ok", False))
|
|
64
|
+
confidence_ok = bool(health.get("confidence_ok", False))
|
|
65
|
+
|
|
66
|
+
assessment = value.get("assessment", {}) if isinstance(value.get("assessment", {}), dict) else {}
|
|
67
|
+
has_value_signal = bool(assessment.get("has_value_signal", False))
|
|
68
|
+
|
|
69
|
+
lines = [
|
|
70
|
+
f"- updated_at: {utc_now()}",
|
|
71
|
+
f"- decision: mantener routing gate activo (routing-evals {cases_passed}/{cases_total} passed).",
|
|
72
|
+
f"- decision: priorizar reduccion de fallback si health.fallback_ok={fallback_ok}.",
|
|
73
|
+
f"- decision: mantener evidencia obligatoria mientras health.grounded_ok={grounded_ok}.",
|
|
74
|
+
f"- decision: mantener confidence floor mientras health.confidence_ok={confidence_ok}.",
|
|
75
|
+
f"- decision: usar value-per-iteration para priorizacion (has_value_signal={has_value_signal}).",
|
|
76
|
+
]
|
|
77
|
+
return lines
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def build_glossary_lines(learning: dict[str, Any], value: dict[str, Any]) -> list[str]:
|
|
81
|
+
kpis = learning.get("kpis", {}) if isinstance(learning.get("kpis", {}), dict) else {}
|
|
82
|
+
vkpis = value.get("kpis", {}) if isinstance(value.get("kpis", {}), dict) else {}
|
|
83
|
+
|
|
84
|
+
fallback_rate = round(get_number(kpis.get("fallback_rate")) * 100.0, 2)
|
|
85
|
+
grounded_rate = round(get_number(kpis.get("grounded_rate")) * 100.0, 2)
|
|
86
|
+
success_rate = round(get_number(kpis.get("success_rate")) * 100.0, 2)
|
|
87
|
+
coverage_rate = round(get_number(vkpis.get("metrics_coverage_rate")) * 100.0, 2)
|
|
88
|
+
tokens_per_success = get_number(vkpis.get("tokens_per_confirmed_success"))
|
|
89
|
+
|
|
90
|
+
lines = [
|
|
91
|
+
f"- updated_at: {utc_now()}",
|
|
92
|
+
f"- fallback_rate: porcentaje de rutas en fallback. valor_actual={fallback_rate}%.",
|
|
93
|
+
f"- grounded_rate: porcentaje de rutas con fuentes validas. valor_actual={grounded_rate}%.",
|
|
94
|
+
f"- confirmed_success_rate: tasa de exito con feedback confirmado. valor_actual={success_rate}%.",
|
|
95
|
+
f"- metrics_coverage_rate: porcentaje de eventos con metricas. valor_actual={coverage_rate}%.",
|
|
96
|
+
f"- tokens_per_confirmed_success: tokens medios por exito confirmado. valor_actual={tokens_per_success}.",
|
|
97
|
+
"- value_signal: indicador de que hay datos suficientes para optimizacion por iteracion.",
|
|
98
|
+
]
|
|
99
|
+
return lines
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def build_risks_lines(learning: dict[str, Any], value: dict[str, Any]) -> list[str]:
|
|
103
|
+
total_events = int(learning.get("total_events", 0) or 0)
|
|
104
|
+
pending_events = int(learning.get("pending_events", 0) or 0)
|
|
105
|
+
|
|
106
|
+
kpis = learning.get("kpis", {}) if isinstance(learning.get("kpis", {}), dict) else {}
|
|
107
|
+
thresholds = learning.get("thresholds", {}) if isinstance(learning.get("thresholds", {}), dict) else {}
|
|
108
|
+
|
|
109
|
+
fallback_rate = get_number(kpis.get("fallback_rate"))
|
|
110
|
+
grounded_rate = get_number(kpis.get("grounded_rate"))
|
|
111
|
+
confidence_avg = get_number(kpis.get("confidence_avg"))
|
|
112
|
+
|
|
113
|
+
fallback_max = get_number(thresholds.get("fallback_rate_max"), 0.2)
|
|
114
|
+
grounded_min = get_number(thresholds.get("grounded_rate_min"), 0.8)
|
|
115
|
+
confidence_min = get_number(thresholds.get("confidence_avg_min"), 0.8)
|
|
116
|
+
|
|
117
|
+
vkpis = value.get("kpis", {}) if isinstance(value.get("kpis", {}), dict) else {}
|
|
118
|
+
metrics_coverage_rate = get_number(vkpis.get("metrics_coverage_rate"))
|
|
119
|
+
confirmed_feedback_rate = get_number(vkpis.get("confirmed_feedback_rate"))
|
|
120
|
+
|
|
121
|
+
risks: list[str] = [f"- updated_at: {utc_now()}"]
|
|
122
|
+
|
|
123
|
+
if fallback_rate > fallback_max:
|
|
124
|
+
risks.append(
|
|
125
|
+
f"- high_fallback: fallback_rate={round(fallback_rate * 100.0, 2)}% supera max={round(fallback_max * 100.0, 2)}%."
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
if grounded_rate < grounded_min:
|
|
129
|
+
risks.append(
|
|
130
|
+
f"- low_grounding: grounded_rate={round(grounded_rate * 100.0, 2)}% por debajo de min={round(grounded_min * 100.0, 2)}%."
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
if confidence_avg < confidence_min:
|
|
134
|
+
risks.append(f"- low_confidence: confidence_avg={round(confidence_avg, 3)} por debajo de min={confidence_min}.")
|
|
135
|
+
|
|
136
|
+
if pending_events > 0:
|
|
137
|
+
pending_pct = round((pending_events / total_events) * 100.0, 2) if total_events > 0 else 0.0
|
|
138
|
+
risks.append(f"- pending_feedback: pending_events={pending_events}/{total_events} ({pending_pct}%).")
|
|
139
|
+
|
|
140
|
+
if metrics_coverage_rate < 1.0:
|
|
141
|
+
risks.append(f"- incomplete_metrics: metrics_coverage_rate={round(metrics_coverage_rate * 100.0, 2)}%.")
|
|
142
|
+
|
|
143
|
+
if confirmed_feedback_rate < 1.0:
|
|
144
|
+
risks.append(f"- incomplete_feedback: confirmed_feedback_rate={round(confirmed_feedback_rate * 100.0, 2)}%.")
|
|
145
|
+
|
|
146
|
+
if len(risks) == 1:
|
|
147
|
+
risks.append("- no_critical_risks_detected: umbrales clave en rango.")
|
|
148
|
+
|
|
149
|
+
return risks
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def main() -> int:
|
|
153
|
+
parser = argparse.ArgumentParser(description="Refresh context/project-notes from observability reports.")
|
|
154
|
+
parser.add_argument("--routing", default="observability/evals/routing-eval-report.json")
|
|
155
|
+
parser.add_argument("--learning", default="observability/evals/learning-loop-report.json")
|
|
156
|
+
parser.add_argument("--value", default="observability/evals/iteration-value-report.json")
|
|
157
|
+
parser.add_argument("--notes-dir", default="context/project-notes")
|
|
158
|
+
args = parser.parse_args()
|
|
159
|
+
|
|
160
|
+
repo_root = Path(__file__).resolve().parents[2]
|
|
161
|
+
routing = load_json((repo_root / args.routing).resolve())
|
|
162
|
+
learning = load_json((repo_root / args.learning).resolve())
|
|
163
|
+
value = load_json((repo_root / args.value).resolve())
|
|
164
|
+
|
|
165
|
+
notes_dir = (repo_root / args.notes_dir).resolve()
|
|
166
|
+
decisions = notes_dir / "decisions.md"
|
|
167
|
+
glossary = notes_dir / "glossary.md"
|
|
168
|
+
known_risks = notes_dir / "known-risks.md"
|
|
169
|
+
|
|
170
|
+
upsert_auto_section(decisions, "Decisions", build_decisions_lines(routing, learning, value))
|
|
171
|
+
upsert_auto_section(glossary, "Glossary", build_glossary_lines(learning, value))
|
|
172
|
+
upsert_auto_section(known_risks, "Known Risks", build_risks_lines(learning, value))
|
|
173
|
+
|
|
174
|
+
print(f"Project notes refreshed in: {notes_dir}")
|
|
175
|
+
return 0
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
if __name__ == "__main__":
|
|
179
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# Guía de Instalación y Uso — GitHub MCP Scripts
|
|
2
|
+
|
|
3
|
+
## ✅ Lo que NECESITAS
|
|
4
|
+
|
|
5
|
+
Solo necesitas estas dos cosas:
|
|
6
|
+
|
|
7
|
+
1. **GitHub CLI (`gh`)** — Disponible en todas las plataformas
|
|
8
|
+
2. **PowerShell 7+** — Para ejecutar scripts
|
|
9
|
+
|
|
10
|
+
## ❌ Lo que NO NECESITAS
|
|
11
|
+
|
|
12
|
+
- ~~`npm install -g @github/mcp-github-server`~~ (no existe en npm registry)
|
|
13
|
+
- ~~MCP Server local~~ (no es necesario para estos scripts)
|
|
14
|
+
|
|
15
|
+
Los scripts usan `gh` CLI que ya está optimizado para GitHub.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Instalación Rápida
|
|
20
|
+
|
|
21
|
+
### Opción 1: Windows (Recomendado)
|
|
22
|
+
|
|
23
|
+
```powershell
|
|
24
|
+
# 1. Instalar GitHub CLI
|
|
25
|
+
winget install GitHub.cli
|
|
26
|
+
|
|
27
|
+
# 2. Instalar PowerShell 7 (si no tienes)
|
|
28
|
+
winget install Microsoft.PowerShell
|
|
29
|
+
|
|
30
|
+
# 3. Reinicia terminal
|
|
31
|
+
|
|
32
|
+
# 4. Login
|
|
33
|
+
gh auth login
|
|
34
|
+
|
|
35
|
+
# 5. Configura token (permanente)
|
|
36
|
+
$env:GITHUB_TOKEN = "ghp_xxxxxxxxxxxxxxxxxxxx"
|
|
37
|
+
Add-Content $PROFILE "`n`$env:GITHUB_TOKEN = 'ghp_xxxxxxxxxxxxxxxxxxxx'"
|
|
38
|
+
|
|
39
|
+
# 6. Verifica
|
|
40
|
+
gh auth status
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Opción 2: macOS
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# 1. Instalar GitHub CLI
|
|
47
|
+
brew install gh
|
|
48
|
+
|
|
49
|
+
# 2. PowerShell (opcional, ya tienes bash)
|
|
50
|
+
brew install powershell
|
|
51
|
+
|
|
52
|
+
# 3. Login
|
|
53
|
+
gh auth login
|
|
54
|
+
|
|
55
|
+
# 4. Configura token
|
|
56
|
+
echo 'export GITHUB_TOKEN="ghp_xxxxxxxxxxxxxxxxxxxx"' >> ~/.zshrc
|
|
57
|
+
source ~/.zshrc
|
|
58
|
+
|
|
59
|
+
# 5. Verifica
|
|
60
|
+
gh auth status
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Opción 3: Linux (Ubuntu/Debian)
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 1. Instalar GitHub CLI
|
|
67
|
+
sudo apt install gh
|
|
68
|
+
|
|
69
|
+
# 2. Instalar PowerShell
|
|
70
|
+
sudo apt install powershell
|
|
71
|
+
|
|
72
|
+
# 3. Login
|
|
73
|
+
gh auth login
|
|
74
|
+
|
|
75
|
+
# 4. Configura token
|
|
76
|
+
echo 'export GITHUB_TOKEN="ghp_xxxxxxxxxxxxxxxxxxxx"' >> ~/.bashrc
|
|
77
|
+
source ~/.bashrc
|
|
78
|
+
|
|
79
|
+
# 5. Verifica
|
|
80
|
+
gh auth status
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Crear GitHub Personal Access Token (PAT)
|
|
86
|
+
|
|
87
|
+
1. **GitHub Settings:**
|
|
88
|
+
- https://github.com/settings/tokens
|
|
89
|
+
|
|
90
|
+
2. **Generate new token (classic):**
|
|
91
|
+
- Name: `MCP Efficiency Engine`
|
|
92
|
+
- Scopes: `repo`, `workflow`
|
|
93
|
+
- Expiration: 30 days (renovar después)
|
|
94
|
+
|
|
95
|
+
3. **Copiar token:**
|
|
96
|
+
```
|
|
97
|
+
ghp_xxxxxxxxxxxxxxxxxxxx
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
4. **Guardar en tu sistema:**
|
|
101
|
+
- Windows: `cmdkey /add:github.com /user:username /pass:ghp_xxxx`
|
|
102
|
+
- macOS/Linux: `echo 'export GITHUB_TOKEN="ghp_xxxx"' >> ~/.bashrc`
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Usar los Scripts Localmente
|
|
107
|
+
|
|
108
|
+
### Paso 1: Clonar Repo
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
git clone https://github.com/Sertxito/mcp-efficiency-engine.git
|
|
112
|
+
cd mcp-efficiency-engine
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Paso 2: Ejecutar Scripts
|
|
116
|
+
|
|
117
|
+
#### Sincronizar Repos (Preview)
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
# Ver qué haría sin hacer cambios
|
|
121
|
+
pwsh scripts/github/sync-repo.ps1 -FilesPattern "projects/**" -DryRun
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Generar DevLog
|
|
125
|
+
|
|
126
|
+
```powershell
|
|
127
|
+
# Generar devlog con últimos 20 commits
|
|
128
|
+
pwsh scripts/github/create-devlog.ps1 -CommitsToAnalyze 20
|
|
129
|
+
|
|
130
|
+
# Ver preview sin crear archivo
|
|
131
|
+
pwsh scripts/github/create-devlog.ps1 -DryRun
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### Gestionar Issues
|
|
135
|
+
|
|
136
|
+
```powershell
|
|
137
|
+
# Asignar Copilot a issues sin asignar
|
|
138
|
+
pwsh scripts/github/manage-issues.ps1 -Action assign
|
|
139
|
+
|
|
140
|
+
# Solicitar reviews de Copilot en PRs
|
|
141
|
+
pwsh scripts/github/manage-issues.ps1 -Action review
|
|
142
|
+
|
|
143
|
+
# Auto-cerrar issues resueltas
|
|
144
|
+
pwsh scripts/github/manage-issues.ps1 -Action close
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Uso en GitHub Actions (CI/CD)
|
|
150
|
+
|
|
151
|
+
Los workflows ya están configurados. Se ejecutan automáticamente:
|
|
152
|
+
|
|
153
|
+
| Workflow | Trigger | Qué Hace |
|
|
154
|
+
|----------|---------|---------|
|
|
155
|
+
| **auto-sync.yml** | Push a main (projects/) | Sincroniza cambios a boost_sertxIA |
|
|
156
|
+
| **auto-devlog.yml** | Push a main | Genera devlog de commits |
|
|
157
|
+
| **auto-manage-issues.yml** | Lunes 9 AM | Gestiona issues automáticamente |
|
|
158
|
+
|
|
159
|
+
### Trigger Manual
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Desde tu terminal local
|
|
163
|
+
gh workflow run auto-sync.yml -r main
|
|
164
|
+
gh workflow run auto-devlog.yml -r main
|
|
165
|
+
gh workflow run auto-manage-issues.yml -r main
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Ver Resultados
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Ver workflows en ejecución
|
|
172
|
+
gh workflow list
|
|
173
|
+
|
|
174
|
+
# Ver runs de un workflow
|
|
175
|
+
gh run list
|
|
176
|
+
|
|
177
|
+
# Ver logs de un run
|
|
178
|
+
gh run view <run-id> --log
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Troubleshooting
|
|
184
|
+
|
|
185
|
+
### Error: "GitHub CLI not found"
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Instalar
|
|
189
|
+
# Windows
|
|
190
|
+
winget install GitHub.cli
|
|
191
|
+
|
|
192
|
+
# macOS
|
|
193
|
+
brew install gh
|
|
194
|
+
|
|
195
|
+
# Linux
|
|
196
|
+
sudo apt install gh
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Error: "Not authenticated"
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Login
|
|
203
|
+
gh auth login
|
|
204
|
+
|
|
205
|
+
# Verificar
|
|
206
|
+
gh auth status
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Error: "Token expired or invalid"
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# Renovar token en: https://github.com/settings/tokens
|
|
213
|
+
# Guardar nueva vez:
|
|
214
|
+
$env:GITHUB_TOKEN = "ghp_nuevo_token"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Error: "Rate limit exceeded"
|
|
218
|
+
|
|
219
|
+
GitHub API tiene límites:
|
|
220
|
+
- **Unauthenticated:** 60 requests/hora
|
|
221
|
+
- **Authenticated:** 5,000 requests/hora
|
|
222
|
+
|
|
223
|
+
Si ves este error, espera 1 hora o reduce cantidad de operaciones.
|
|
224
|
+
|
|
225
|
+
### Error: "Permission denied"
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Verificar permisos del token
|
|
229
|
+
gh auth status
|
|
230
|
+
|
|
231
|
+
# El token debe tener:
|
|
232
|
+
# - repo (acceso a repositorios)
|
|
233
|
+
# - workflow (permisos para workflows)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Cambios Clave Desde v1.0
|
|
239
|
+
|
|
240
|
+
### Setup Simplificado
|
|
241
|
+
|
|
242
|
+
- ✅ Eliminado requisito de `npm install -g @github/mcp-github-server`
|
|
243
|
+
- ✅ Solo necesitas `gh` CLI (disponible everywhere)
|
|
244
|
+
- ✅ Funciona en CI/CD sin configuración extra
|
|
245
|
+
|
|
246
|
+
### Workflows Añadidos
|
|
247
|
+
|
|
248
|
+
- ✅ `auto-sync.yml` — Sincronización automática
|
|
249
|
+
- ✅ `auto-devlog.yml` — DevLog automático
|
|
250
|
+
- ✅ `auto-manage-issues.yml` — Gestión de issues
|
|
251
|
+
|
|
252
|
+
### Documentación
|
|
253
|
+
|
|
254
|
+
- ✅ Guía de instalación simplificada
|
|
255
|
+
- ✅ Troubleshooting actualizado
|
|
256
|
+
- ✅ Ejemplos de uso locales + CI/CD
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Próximos Pasos
|
|
261
|
+
|
|
262
|
+
1. **Instalar localmente:**
|
|
263
|
+
```powershell
|
|
264
|
+
winget install GitHub.cli
|
|
265
|
+
gh auth login
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
2. **Test un script:**
|
|
269
|
+
```powershell
|
|
270
|
+
pwsh scripts/github/manage-issues.ps1 -Action assign -DryRun
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
3. **Verificar workflows activos:**
|
|
274
|
+
```bash
|
|
275
|
+
gh workflow list
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
4. **Personalizar según necesidad:**
|
|
279
|
+
- Editar `.github/workflows/*.yml`
|
|
280
|
+
- Ajustar triggers (schedules, paths)
|
|
281
|
+
- Agregar más acciones
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Referencias
|
|
286
|
+
|
|
287
|
+
- [GitHub CLI Documentation](https://cli.github.com/)
|
|
288
|
+
- [GitHub REST API](https://docs.github.com/en/rest)
|
|
289
|
+
- [Scripts README](./README.md)
|
|
290
|
+
- [GitHub MCP Integration Guide](../.github/GITHUB_MCP_INTEGRATION.md)
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
**Última actualización:** 2026-07-04
|
|
295
|
+
**Estado:** ✅ Guía completa + Workflows listos para usar
|