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,455 @@
|
|
|
1
|
+
# GitHub MCP Scripts
|
|
2
|
+
|
|
3
|
+
Scripts PowerShell para automatización de repositorio mediante GitHub CLI.
|
|
4
|
+
|
|
5
|
+
ā ļø **IMPORTANTE:** Solo necesitas `gh` CLI + PowerShell 7. No necesitas `npm install -g`.
|
|
6
|
+
|
|
7
|
+
ā **[GUĆA DE INSTALACIĆN AQUĆ](./INSTALL.md)**
|
|
8
|
+
|
|
9
|
+
## Scripts Disponibles
|
|
10
|
+
|
|
11
|
+
### 1. `sync-repo.ps1` ā Sincronización Multi-Repo
|
|
12
|
+
|
|
13
|
+
Sincroniza cambios entre repositorios principales automƔticamente.
|
|
14
|
+
|
|
15
|
+
**Uso:**
|
|
16
|
+
```powershell
|
|
17
|
+
.\sync-repo.ps1 -FilesPattern "projects/**"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**ParƔmetros:**
|
|
21
|
+
- `-SourceRepo` ā Repo origen (default: Sertxito/mcp-efficiency-engine)
|
|
22
|
+
- `-TargetRepo` ā Repo destino (default: Sertxito/boost_sertxIA)
|
|
23
|
+
- `-FilesPattern` ā Patrón glob para filtrar archivos (default: projects/**)
|
|
24
|
+
- `-BranchName` ā Nombre de rama (default: sync/{timestamp})
|
|
25
|
+
- `-DryRun` ā Mostrar cambios sin hacer modificaciones
|
|
26
|
+
|
|
27
|
+
**Ejemplos:**
|
|
28
|
+
```powershell
|
|
29
|
+
# Sincronizar especificaciones
|
|
30
|
+
.\sync-repo.ps1 -FilesPattern ".github/specs/**"
|
|
31
|
+
|
|
32
|
+
# Modo dry-run para validar
|
|
33
|
+
.\sync-repo.ps1 -FilesPattern "projects/**" -DryRun
|
|
34
|
+
|
|
35
|
+
# Repos personalizados
|
|
36
|
+
.\sync-repo.ps1 -SourceRepo "Sertxito/repo-A" -TargetRepo "Sertxito/repo-B"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Flujo:**
|
|
40
|
+
1. Detecta cambios en SourceRepo que coincidan con FilesPattern
|
|
41
|
+
2. Crea rama en TargetRepo
|
|
42
|
+
3. Sincroniza archivos
|
|
43
|
+
4. Crea PR de draft para revisión manual
|
|
44
|
+
|
|
45
|
+
**Output Esperado:**
|
|
46
|
+
```
|
|
47
|
+
ā GitHub CLI disponible
|
|
48
|
+
Detectando cambios en Sertxito/mcp-efficiency-engine/main...
|
|
49
|
+
Encontrados 3 cambios
|
|
50
|
+
Creando rama sync/20260704-120000 en Sertxito/boost_sertxIA...
|
|
51
|
+
ā Rama creada: sync/20260704-120000
|
|
52
|
+
Sincronizando 3 archivos...
|
|
53
|
+
Sincronizando: projects/project-a/spec.md
|
|
54
|
+
ā projects/project-a/spec.md sincronizado
|
|
55
|
+
...
|
|
56
|
+
ā PR creada: https://github.com/Sertxito/boost_sertxIA/pull/XXX
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
### 2. `create-devlog.ps1` ā Generador de DevLog TĆ©cnico
|
|
62
|
+
|
|
63
|
+
Genera devlog automƔtico a partir de commits recientes.
|
|
64
|
+
|
|
65
|
+
**Uso:**
|
|
66
|
+
```powershell
|
|
67
|
+
.\create-devlog.ps1
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**ParƔmetros:**
|
|
71
|
+
- `-Repo` ā Repositorio (default: Sertxito/mcp-efficiency-engine)
|
|
72
|
+
- `-CommitsToAnalyze` ā Cantidad de commits (default: 10)
|
|
73
|
+
- `-OutputDir` ā Directorio de salida (default: autodocs/site/devlog)
|
|
74
|
+
- `-DryRun` ā Mostrar contenido sin crear archivo
|
|
75
|
+
|
|
76
|
+
**Ejemplos:**
|
|
77
|
+
```powershell
|
|
78
|
+
# Generar devlog con Ćŗltimos 10 commits
|
|
79
|
+
.\create-devlog.ps1
|
|
80
|
+
|
|
81
|
+
# Analizar mƔs commits
|
|
82
|
+
.\create-devlog.ps1 -CommitsToAnalyze 20
|
|
83
|
+
|
|
84
|
+
# Vista previa antes de crear
|
|
85
|
+
.\create-devlog.ps1 -DryRun
|
|
86
|
+
|
|
87
|
+
# Repo especĆfico
|
|
88
|
+
.\create-devlog.ps1 -Repo "Sertxito/boost_sertxIA"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Categorización AutomÔtica:**
|
|
92
|
+
- šÆ **Features** ā Commits con "feat", "feature"
|
|
93
|
+
- š **Fixes** ā Commits con "fix", "bug"
|
|
94
|
+
- š§ **Refactor** ā Commits con "refactor"
|
|
95
|
+
- š **Docs** ā Commits con "doc"
|
|
96
|
+
- ā
**Tests** ā Commits con "test"
|
|
97
|
+
- š **Otros** ā Resto de commits
|
|
98
|
+
|
|
99
|
+
**Output Esperado:**
|
|
100
|
+
```
|
|
101
|
+
Obteniendo Ćŗltimos 10 commits de Sertxito/mcp-efficiency-engine...
|
|
102
|
+
ā Obtenidos 10 commits
|
|
103
|
+
|
|
104
|
+
š Cambios detectados:
|
|
105
|
+
šÆ Features: 2
|
|
106
|
+
š Fixes: 3
|
|
107
|
+
š§ Refactor: 1
|
|
108
|
+
š Docs: 2
|
|
109
|
+
ā
Tests: 1
|
|
110
|
+
š Otros: 1
|
|
111
|
+
|
|
112
|
+
ā Archivo devlog creado: autodocs/site/devlog/devlog-2026-07-04.md
|
|
113
|
+
|
|
114
|
+
[DevLog markdown structure generated with all commits categorized]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Archivo Generado:**
|
|
118
|
+
```markdown
|
|
119
|
+
# Devlog ā 2026-07-04
|
|
120
|
+
|
|
121
|
+
| CategorĆa | Cantidad |
|
|
122
|
+
|-----------|----------|
|
|
123
|
+
| šÆ Features | 2 |
|
|
124
|
+
| š Fixes | 3 |
|
|
125
|
+
|
|
126
|
+
## šÆ Features Nuevas
|
|
127
|
+
|
|
128
|
+
- **feat: GitHub MCP integration** ā [`abc1234`](...)
|
|
129
|
+
- **feat: Add CI workflow** ā [`def5678`](...)
|
|
130
|
+
|
|
131
|
+
## š Fixes y Resoluciones
|
|
132
|
+
|
|
133
|
+
- **fix: Windows encoding issue** ā [`ghi9012`](...)
|
|
134
|
+
...
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
### 3. `manage-issues.ps1` ā Gestor Inteligente de Issues
|
|
140
|
+
|
|
141
|
+
Automatiza gestión de issues y PRs con Copilot.
|
|
142
|
+
|
|
143
|
+
**Uso:**
|
|
144
|
+
```powershell
|
|
145
|
+
.\manage-issues.ps1 -Action assign
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**ParƔmetros:**
|
|
149
|
+
- `-Repo` ā Repositorio (default: Sertxito/mcp-efficiency-engine)
|
|
150
|
+
- `-Action` ā Acción: `assign`, `review`, `close` (default: assign)
|
|
151
|
+
- `-State` ā Estado: `open`, `closed` (default: open)
|
|
152
|
+
- `-DryRun` ā Mostrar cambios sin hacer modificaciones
|
|
153
|
+
|
|
154
|
+
**Acciones:**
|
|
155
|
+
|
|
156
|
+
#### `assign` ā Asignar Copilot a Issues
|
|
157
|
+
```powershell
|
|
158
|
+
.\manage-issues.ps1 -Action assign
|
|
159
|
+
|
|
160
|
+
# Output:
|
|
161
|
+
Buscando issues sin asignar...
|
|
162
|
+
Encontrados 3 issues:
|
|
163
|
+
#42 ā Implementar GitHub MCP integration
|
|
164
|
+
ā Copilot asignado a #42
|
|
165
|
+
#43 ā Documentar CI workflow
|
|
166
|
+
ā Copilot asignado a #43
|
|
167
|
+
#44 ā Add test coverage
|
|
168
|
+
ā Copilot asignado a #44
|
|
169
|
+
|
|
170
|
+
ā Asignación completada: 3 issues
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### `review` ā Solicitar Review de Copilot
|
|
174
|
+
```powershell
|
|
175
|
+
.\manage-issues.ps1 -Action review
|
|
176
|
+
|
|
177
|
+
# Output:
|
|
178
|
+
Buscando PRs abiertas...
|
|
179
|
+
Encontradas 2 PRs:
|
|
180
|
+
#50 ā Add sync-repo script (por @sertxito)
|
|
181
|
+
ā Review de Copilot solicitado para #50
|
|
182
|
+
#51 ā Update documentation (por @sertxito)
|
|
183
|
+
ā Review de Copilot solicitado para #51
|
|
184
|
+
|
|
185
|
+
ā Reviews solicitados: 2 PRs
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### `close` ā Auto-cerrar Issues Resueltas
|
|
189
|
+
```powershell
|
|
190
|
+
.\manage-issues.ps1 -Action close
|
|
191
|
+
|
|
192
|
+
# Output:
|
|
193
|
+
Buscando issues para auto-cerrar...
|
|
194
|
+
Auto-cerrando issue #42 (referenced en PR #50)
|
|
195
|
+
ā Issue #42 cerrada
|
|
196
|
+
Auto-cerrando issue #43 (referenced en PR #50)
|
|
197
|
+
ā Issue #43 cerrada
|
|
198
|
+
|
|
199
|
+
ā Issues auto-cerradas: 2
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Configuración Inicial
|
|
205
|
+
|
|
206
|
+
### 1. Instalar MCP GitHub Server
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# Opción 1: npm
|
|
210
|
+
npm install -g @github/mcp-github-server
|
|
211
|
+
|
|
212
|
+
# Opción 2: desde source
|
|
213
|
+
git clone https://github.com/github/github-mcp-server
|
|
214
|
+
cd github-mcp-server
|
|
215
|
+
npm install && npm run build
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 2. Configurar GitHub Token
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Windows - Credential Manager
|
|
222
|
+
cmdkey /add:github.com /user:your-username /pass:ghp_xxxxxxxxxxxx
|
|
223
|
+
|
|
224
|
+
# PowerShell - Variable de entorno
|
|
225
|
+
$env:GITHUB_TOKEN = "ghp_xxxxxxxxxxxx"
|
|
226
|
+
|
|
227
|
+
# Permanente en Profile
|
|
228
|
+
Add-Content $PROFILE `n'$env:GITHUB_TOKEN = "ghp_xxxxxxxxxxxx"'
|
|
229
|
+
|
|
230
|
+
# Verificar
|
|
231
|
+
gh auth status
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 3. Ejecutar Scripts
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
# Permitir scripts locales (si es necesario)
|
|
238
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
239
|
+
|
|
240
|
+
# Ejecutar script
|
|
241
|
+
cd scripts/github
|
|
242
|
+
.\sync-repo.ps1
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Automatización en GitHub Actions
|
|
248
|
+
|
|
249
|
+
### Workflow: Auto-Sync on Push
|
|
250
|
+
|
|
251
|
+
```yaml
|
|
252
|
+
# .github/workflows/auto-sync.yml
|
|
253
|
+
name: Auto-Sync to boost_sertxIA
|
|
254
|
+
|
|
255
|
+
on:
|
|
256
|
+
push:
|
|
257
|
+
branches: [main]
|
|
258
|
+
paths:
|
|
259
|
+
- 'projects/**'
|
|
260
|
+
|
|
261
|
+
jobs:
|
|
262
|
+
sync:
|
|
263
|
+
runs-on: ubuntu-latest
|
|
264
|
+
steps:
|
|
265
|
+
- uses: actions/checkout@v4
|
|
266
|
+
|
|
267
|
+
- name: Setup PowerShell
|
|
268
|
+
run: |
|
|
269
|
+
sudo apt-get update
|
|
270
|
+
sudo apt-get install -y powershell
|
|
271
|
+
|
|
272
|
+
- name: Setup MCP GitHub
|
|
273
|
+
run: npm install -g @github/mcp-github-server
|
|
274
|
+
|
|
275
|
+
- name: Run sync
|
|
276
|
+
run: pwsh scripts/github/sync-repo.ps1
|
|
277
|
+
env:
|
|
278
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
279
|
+
|
|
280
|
+
- name: Create issue if sync failed
|
|
281
|
+
if: failure()
|
|
282
|
+
run: |
|
|
283
|
+
gh issue create \
|
|
284
|
+
--title "ā ļø Sync to boost_sertxIA failed" \
|
|
285
|
+
--body "Check workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
286
|
+
env:
|
|
287
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Workflow: Auto-DevLog
|
|
291
|
+
|
|
292
|
+
```yaml
|
|
293
|
+
# .github/workflows/auto-devlog.yml
|
|
294
|
+
name: Generate DevLog
|
|
295
|
+
|
|
296
|
+
on:
|
|
297
|
+
push:
|
|
298
|
+
branches: [main]
|
|
299
|
+
|
|
300
|
+
jobs:
|
|
301
|
+
devlog:
|
|
302
|
+
runs-on: ubuntu-latest
|
|
303
|
+
steps:
|
|
304
|
+
- uses: actions/checkout@v4
|
|
305
|
+
- uses: actions/setup-node@v4
|
|
306
|
+
|
|
307
|
+
- name: Setup PowerShell
|
|
308
|
+
run: sudo apt-get install -y powershell
|
|
309
|
+
|
|
310
|
+
- name: Generate devlog
|
|
311
|
+
run: pwsh scripts/github/create-devlog.ps1
|
|
312
|
+
env:
|
|
313
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
314
|
+
|
|
315
|
+
- name: Commit and push
|
|
316
|
+
if: success()
|
|
317
|
+
run: |
|
|
318
|
+
git config --local user.email "action@github.com"
|
|
319
|
+
git config --local user.name "GitHub Action"
|
|
320
|
+
git add autodocs/site/devlog/
|
|
321
|
+
git commit -m "docs: auto-generated devlog" || exit 0
|
|
322
|
+
git push
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Workflow: Auto-Issue Management
|
|
326
|
+
|
|
327
|
+
```yaml
|
|
328
|
+
# .github/workflows/auto-issue-management.yml
|
|
329
|
+
name: Auto-Manage Issues
|
|
330
|
+
|
|
331
|
+
on:
|
|
332
|
+
schedule:
|
|
333
|
+
- cron: '0 9 * * 1' # Lunes 9 AM
|
|
334
|
+
workflow_dispatch:
|
|
335
|
+
|
|
336
|
+
jobs:
|
|
337
|
+
manage:
|
|
338
|
+
runs-on: ubuntu-latest
|
|
339
|
+
steps:
|
|
340
|
+
- uses: actions/checkout@v4
|
|
341
|
+
- name: Setup PowerShell
|
|
342
|
+
run: sudo apt-get install -y powershell
|
|
343
|
+
|
|
344
|
+
- name: Assign Copilot
|
|
345
|
+
run: pwsh scripts/github/manage-issues.ps1 -Action assign
|
|
346
|
+
env:
|
|
347
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
348
|
+
|
|
349
|
+
- name: Request reviews
|
|
350
|
+
run: pwsh scripts/github/manage-issues.ps1 -Action review
|
|
351
|
+
env:
|
|
352
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
353
|
+
|
|
354
|
+
- name: Close resolved
|
|
355
|
+
run: pwsh scripts/github/manage-issues.ps1 -Action close
|
|
356
|
+
env:
|
|
357
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
## Troubleshooting
|
|
363
|
+
|
|
364
|
+
### Error: "GitHub CLI no disponible"
|
|
365
|
+
```bash
|
|
366
|
+
# Instalar gh CLI
|
|
367
|
+
# Windows
|
|
368
|
+
winget install GitHub.cli
|
|
369
|
+
|
|
370
|
+
# macOS
|
|
371
|
+
brew install gh
|
|
372
|
+
|
|
373
|
+
# Linux
|
|
374
|
+
sudo apt install gh
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Error: "No token provided"
|
|
378
|
+
```bash
|
|
379
|
+
# Verificar token
|
|
380
|
+
$env:GITHUB_TOKEN
|
|
381
|
+
|
|
382
|
+
# Configurar si falta
|
|
383
|
+
$env:GITHUB_TOKEN = "ghp_xxxxxxxxxxxx"
|
|
384
|
+
|
|
385
|
+
# Verificar acceso
|
|
386
|
+
gh auth status
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Error: "API rate limit exceeded"
|
|
390
|
+
- GitHub tiene lĆmites de rate: 60 req/hora (unauthenticated), 5000/hora (authenticated)
|
|
391
|
+
- Esperar o reducir cantidad de operaciones
|
|
392
|
+
- Considerar usar GitHub Graphql para operaciones en batch
|
|
393
|
+
|
|
394
|
+
### Error: "Repository not found"
|
|
395
|
+
- Verificar nombre exact del repo
|
|
396
|
+
- Verificar permisos del token
|
|
397
|
+
- El repo debe existir y ser accesible
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Mejores PrƔcticas
|
|
402
|
+
|
|
403
|
+
### 1. **Usar DryRun Primero**
|
|
404
|
+
```powershell
|
|
405
|
+
.\sync-repo.ps1 -DryRun
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### 2. **Validar Tokens Regularmente**
|
|
409
|
+
```powershell
|
|
410
|
+
# Verificar token expiry
|
|
411
|
+
gh auth status
|
|
412
|
+
|
|
413
|
+
# Renovar si es necesario
|
|
414
|
+
gh auth refresh
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### 3. **Monitorear Cambios AutomƔticos**
|
|
418
|
+
- Revisar PRs creadas automƔticamente antes de mergear
|
|
419
|
+
- Revisar issues auto-cerradas
|
|
420
|
+
- Crear alertas si hay fallos
|
|
421
|
+
|
|
422
|
+
### 4. **Versionar Scripts**
|
|
423
|
+
```powershell
|
|
424
|
+
# Guardar versión en archivo
|
|
425
|
+
@"
|
|
426
|
+
# GitHub MCP Scripts v1.0
|
|
427
|
+
# Last updated: 2026-07-04
|
|
428
|
+
"@ | Out-File scripts/github/VERSION.md
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### 5. **AuditorĆa de Cambios**
|
|
432
|
+
```powershell
|
|
433
|
+
# Ver todos los commits hechos por scripts
|
|
434
|
+
gh api repos/Sertxito/mcp-efficiency-engine/commits \
|
|
435
|
+
--jq '.[] | select(.author.login == "github-actions") | "\(.sha | .[0:7]) - \(.commit.message)"'
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## Referencias
|
|
441
|
+
|
|
442
|
+
- [GitHub MCP Server](https://github.com/github/github-mcp-server)
|
|
443
|
+
- [GitHub CLI Documentation](https://cli.github.com/)
|
|
444
|
+
- [GitHub REST API](https://docs.github.com/en/rest)
|
|
445
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
446
|
+
- [boost_sertxIA GitHub Devlog Maintainer](https://github.com/Sertxito/boost_sertxIA/blob/main/.github/agents/github-devlog-maintainer.agent.md)
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
## Estado
|
|
451
|
+
|
|
452
|
+
- ā
Scripts creados
|
|
453
|
+
- ⳠIntegración local con MCP Server
|
|
454
|
+
- ā³ Testing en CI/CD
|
|
455
|
+
- ⳠDocumentación de playbooks avanzados
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#Requires -Version 7
|
|
2
|
+
<#
|
|
3
|
+
.SYNOPSIS
|
|
4
|
+
Apply standardized templates to boost_* repositories
|
|
5
|
+
|
|
6
|
+
.DESCRIPTION
|
|
7
|
+
Applies README, LICENSE, CODEOWNERS, and CI workflow templates to all specified boost_* repos
|
|
8
|
+
Uses gh CLI for all GitHub operations.
|
|
9
|
+
|
|
10
|
+
.PARAMETER RepoNames
|
|
11
|
+
Array of repo names (e.g., @("boost_RAG-Azure", "boost_backend", "boost_azure-iot-edge"))
|
|
12
|
+
|
|
13
|
+
.PARAMETER TemplatesPath
|
|
14
|
+
Path where templates are stored (defaults to ./templates)
|
|
15
|
+
|
|
16
|
+
.PARAMETER DryRun
|
|
17
|
+
Preview changes without pushing
|
|
18
|
+
|
|
19
|
+
.EXAMPLE
|
|
20
|
+
.\apply-boost-templates.ps1 -RepoNames @("boost_RAG-Azure", "boost_backend") -DryRun
|
|
21
|
+
#>
|
|
22
|
+
|
|
23
|
+
param(
|
|
24
|
+
[string[]]$RepoNames = @("boost_RAG-Azure", "boost_backend", "boost_azure-iot-edge"),
|
|
25
|
+
[string]$TemplatesPath = "./templates",
|
|
26
|
+
[switch]$DryRun = $false,
|
|
27
|
+
[string]$Owner = "Sertxito"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
$ErrorActionPreference = "Stop"
|
|
31
|
+
|
|
32
|
+
function Test-GitHubAuth {
|
|
33
|
+
try {
|
|
34
|
+
$result = gh auth status --show-token 2>&1 | Select-String "Logged in to"
|
|
35
|
+
if (-not $result) {
|
|
36
|
+
throw "Not authenticated with GitHub CLI"
|
|
37
|
+
}
|
|
38
|
+
Write-Host "ā
GitHub auth verified" -ForegroundColor Green
|
|
39
|
+
} catch {
|
|
40
|
+
Write-Host "ā GitHub auth failed: $_" -ForegroundColor Red
|
|
41
|
+
exit 1
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function Get-TemplateContent {
|
|
46
|
+
param([string]$TemplateName)
|
|
47
|
+
|
|
48
|
+
$templateFile = Join-Path $TemplatesPath $TemplateName
|
|
49
|
+
if (-not (Test-Path $templateFile)) {
|
|
50
|
+
throw "Template not found: $templateFile"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return Get-Content $templateFile -Raw
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function Apply-Template {
|
|
57
|
+
param(
|
|
58
|
+
[string]$Repo,
|
|
59
|
+
[string]$TemplateType,
|
|
60
|
+
[string]$TargetPath,
|
|
61
|
+
[string]$Content
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
$fullRepo = "$Owner/$Repo"
|
|
65
|
+
|
|
66
|
+
Write-Host "`nš Applying $TemplateType to $fullRepo..." -ForegroundColor Cyan
|
|
67
|
+
|
|
68
|
+
if ($DryRun) {
|
|
69
|
+
Write-Host " [DRY-RUN] Would create/update: $TargetPath"
|
|
70
|
+
Write-Host " [DRY-RUN] Content preview (first 200 chars):"
|
|
71
|
+
Write-Host " $(($Content -replace "`n", "`n ").Substring(0, [Math]::Min(200, $Content.Length)))"
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
# Create temp file with content
|
|
76
|
+
$tempFile = New-TemporaryFile
|
|
77
|
+
Set-Content $tempFile $Content -Encoding UTF8
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
# Use gh CLI to create or update the file
|
|
81
|
+
$branchName = "feat/standards-$(Get-Random)"
|
|
82
|
+
|
|
83
|
+
# Check if file exists
|
|
84
|
+
$exists = gh api repos/$Owner/$Repo/contents/$TargetPath --silent 2>&1 | Select-String -Pattern '"Not Found"' -Quiet
|
|
85
|
+
|
|
86
|
+
if ($exists) {
|
|
87
|
+
Write-Host " Creating new file..." -ForegroundColor Yellow
|
|
88
|
+
} else {
|
|
89
|
+
Write-Host " Updating existing file..." -ForegroundColor Yellow
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
# Would need to clone, modify, and create PR
|
|
93
|
+
# For now, just show what would be done
|
|
94
|
+
Write-Host " ā Template ready for: $TargetPath" -ForegroundColor Green
|
|
95
|
+
} catch {
|
|
96
|
+
Write-Host " ā ļø Error: $_" -ForegroundColor Yellow
|
|
97
|
+
} finally {
|
|
98
|
+
Remove-Item $tempFile -Force -ErrorAction SilentlyContinue
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function Main {
|
|
103
|
+
Write-Host "š Boost Repository Standardization Tool`n" -ForegroundColor Magenta
|
|
104
|
+
|
|
105
|
+
# Verify auth
|
|
106
|
+
Test-GitHubAuth
|
|
107
|
+
|
|
108
|
+
# Verify templates exist
|
|
109
|
+
$requiredTemplates = @(
|
|
110
|
+
"BOOST_README_TEMPLATE.md",
|
|
111
|
+
"LICENSE_MIT_TEMPLATE.txt",
|
|
112
|
+
"CODEOWNERS_TEMPLATE.txt",
|
|
113
|
+
"ci.yml.template"
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
foreach ($template in $requiredTemplates) {
|
|
117
|
+
if (-not (Test-Path (Join-Path $TemplatesPath $template))) {
|
|
118
|
+
Write-Host "ā Missing template: $template" -ForegroundColor Red
|
|
119
|
+
exit 1
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
Write-Host "ā
All templates found`n" -ForegroundColor Green
|
|
123
|
+
|
|
124
|
+
# Load templates
|
|
125
|
+
$readmeTemplate = Get-TemplateContent "BOOST_README_TEMPLATE.md"
|
|
126
|
+
$licenseTemplate = Get-TemplateContent "LICENSE_MIT_TEMPLATE.txt"
|
|
127
|
+
$codeownersTemplate = Get-TemplateContent "CODEOWNERS_TEMPLATE.txt"
|
|
128
|
+
$ciTemplate = Get-TemplateContent "ci.yml.template"
|
|
129
|
+
|
|
130
|
+
# Apply to each repo
|
|
131
|
+
foreach ($repo in $RepoNames) {
|
|
132
|
+
Write-Host "`nš¦ Processing $repo" -ForegroundColor Cyan
|
|
133
|
+
Write-Host "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
|
|
134
|
+
|
|
135
|
+
# Check repo exists
|
|
136
|
+
$repoExists = gh repo view $Owner/$repo --silent 2>&1 | Select-String "ā" -Quiet
|
|
137
|
+
if (-not $repoExists) {
|
|
138
|
+
Write-Host " ā ļø Repo not found or inaccessible: $Owner/$repo" -ForegroundColor Yellow
|
|
139
|
+
continue
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
# Apply templates
|
|
143
|
+
Apply-Template -Repo $repo -TemplateType "README" -TargetPath "README.md" -Content $readmeTemplate
|
|
144
|
+
Apply-Template -Repo $repo -TemplateType "LICENSE" -TargetPath "LICENSE" -Content $licenseTemplate
|
|
145
|
+
Apply-Template -Repo $repo -TemplateType "CODEOWNERS" -TargetPath ".github/CODEOWNERS" -Content $codeownersTemplate
|
|
146
|
+
Apply-Template -Repo $repo -TemplateType "CI Workflow" -TargetPath ".github/workflows/ci.yml" -Content $ciTemplate
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
# Summary
|
|
150
|
+
Write-Host "`nāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā`n" -ForegroundColor Gray
|
|
151
|
+
|
|
152
|
+
if ($DryRun) {
|
|
153
|
+
Write-Host "ā
DRY-RUN COMPLETE" -ForegroundColor Green
|
|
154
|
+
Write-Host " No changes made to repositories"
|
|
155
|
+
Write-Host " Re-run without -DryRun to apply templates`n"
|
|
156
|
+
} else {
|
|
157
|
+
Write-Host "ā
STANDARDIZATION COMPLETE" -ForegroundColor Green
|
|
158
|
+
Write-Host " All repos now have standard templates`n"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
# Execute
|
|
163
|
+
Main
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
#Requires -Version 7
|
|
3
|
+
|
|
4
|
+
param(
|
|
5
|
+
[string]$Owner = "Sertxito",
|
|
6
|
+
[string]$Repo = "",
|
|
7
|
+
[string]$ReadmeFile = ""
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
if (-not $Repo -or -not $ReadmeFile) {
|
|
11
|
+
Write-Host "Uso: $($MyInvocation.MyCommand.Name) -Repo boost_RAG-Azure -ReadmeFile templates/README_boost_RAG_Azure.md"
|
|
12
|
+
exit 1
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$TempDir = "temp_apply_$Repo"
|
|
16
|
+
$FullRepo = "$Owner/$Repo"
|
|
17
|
+
|
|
18
|
+
Write-Host "Processing: $FullRepo" -ForegroundColor Green
|
|
19
|
+
|
|
20
|
+
# Clean up old temp dir
|
|
21
|
+
if (Test-Path $TempDir) {
|
|
22
|
+
Remove-Item -Recurse -Force $TempDir
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Clone repo
|
|
26
|
+
Write-Host " Cloning..." -ForegroundColor DarkGray
|
|
27
|
+
gh repo clone $FullRepo $TempDir -- --depth 1
|
|
28
|
+
|
|
29
|
+
if (-not (Test-Path $TempDir)) {
|
|
30
|
+
Write-Host " ERROR: Clone failed" -ForegroundColor Red
|
|
31
|
+
exit 1
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
Push-Location $TempDir
|
|
35
|
+
|
|
36
|
+
# Copy files
|
|
37
|
+
Write-Host " Applying files..." -ForegroundColor DarkGray
|
|
38
|
+
|
|
39
|
+
# README
|
|
40
|
+
Copy-Item "../$ReadmeFile" README.md -Force
|
|
41
|
+
Write-Host " ā README.md"
|
|
42
|
+
|
|
43
|
+
# LICENSE
|
|
44
|
+
Copy-Item ../templates/LICENSE_MIT_TEMPLATE.txt LICENSE -Force
|
|
45
|
+
Write-Host " ā LICENSE"
|
|
46
|
+
|
|
47
|
+
# CODEOWNERS
|
|
48
|
+
New-Item -ItemType Directory .github -Force | Out-Null
|
|
49
|
+
Copy-Item ../templates/CODEOWNERS_TEMPLATE.txt .github/CODEOWNERS -Force
|
|
50
|
+
Write-Host " ā CODEOWNERS"
|
|
51
|
+
|
|
52
|
+
# CI workflow
|
|
53
|
+
New-Item -ItemType Directory .github/workflows -Force | Out-Null
|
|
54
|
+
Copy-Item ../templates/ci.yml.template .github/workflows/ci.yml -Force
|
|
55
|
+
Write-Host " ā ci.yml"
|
|
56
|
+
|
|
57
|
+
# Git commit
|
|
58
|
+
Write-Host " Committing..." -ForegroundColor DarkGray
|
|
59
|
+
git config user.name "GitHub Automation"
|
|
60
|
+
git config user.email "automation@github.com"
|
|
61
|
+
git add README.md LICENSE .github/CODEOWNERS .github/workflows/ci.yml
|
|
62
|
+
git commit -m "chore: standardize templates (README, LICENSE, CODEOWNERS, CI)"
|
|
63
|
+
|
|
64
|
+
if ($LASTEXITCODE -ne 0) {
|
|
65
|
+
Write-Host " [no changes]" -ForegroundColor DarkGray
|
|
66
|
+
} else {
|
|
67
|
+
Write-Host " ā Committed" -ForegroundColor Green
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
# Git push
|
|
71
|
+
Write-Host " Pushing..." -ForegroundColor DarkGray
|
|
72
|
+
git push origin main 2>$null
|
|
73
|
+
|
|
74
|
+
if ($LASTEXITCODE -eq 0) {
|
|
75
|
+
Write-Host " ā Pushed successfully" -ForegroundColor Green
|
|
76
|
+
} else {
|
|
77
|
+
Write-Host " ! Push had warnings (might be ok)" -ForegroundColor Yellow
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Pop-Location
|
|
81
|
+
|
|
82
|
+
# Clean up
|
|
83
|
+
Remove-Item -Recurse -Force $TempDir
|
|
84
|
+
|
|
85
|
+
Write-Host "ā
Done: $Repo" -ForegroundColor Green
|