javi-forge 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.
Files changed (500) hide show
  1. package/.gitignore.template +105 -0
  2. package/.releaserc +44 -0
  3. package/README.md +45 -0
  4. package/ai-config/.skillignore +15 -0
  5. package/ai-config/AUTO_INVOKE.md +300 -0
  6. package/ai-config/agents/_TEMPLATE.md +93 -0
  7. package/ai-config/agents/business/api-designer.md +1657 -0
  8. package/ai-config/agents/business/business-analyst.md +1331 -0
  9. package/ai-config/agents/business/product-strategist.md +206 -0
  10. package/ai-config/agents/business/project-manager.md +178 -0
  11. package/ai-config/agents/business/requirements-analyst.md +1277 -0
  12. package/ai-config/agents/business/technical-writer.md +1679 -0
  13. package/ai-config/agents/creative/ux-designer.md +205 -0
  14. package/ai-config/agents/data-ai/ai-engineer.md +487 -0
  15. package/ai-config/agents/data-ai/analytics-engineer.md +953 -0
  16. package/ai-config/agents/data-ai/data-engineer.md +173 -0
  17. package/ai-config/agents/data-ai/data-scientist.md +672 -0
  18. package/ai-config/agents/data-ai/mlops-engineer.md +814 -0
  19. package/ai-config/agents/data-ai/prompt-engineer.md +772 -0
  20. package/ai-config/agents/development/angular-expert.md +620 -0
  21. package/ai-config/agents/development/backend-architect.md +795 -0
  22. package/ai-config/agents/development/database-specialist.md +212 -0
  23. package/ai-config/agents/development/frontend-specialist.md +686 -0
  24. package/ai-config/agents/development/fullstack-engineer.md +668 -0
  25. package/ai-config/agents/development/golang-pro.md +338 -0
  26. package/ai-config/agents/development/java-enterprise.md +400 -0
  27. package/ai-config/agents/development/javascript-pro.md +422 -0
  28. package/ai-config/agents/development/nextjs-pro.md +474 -0
  29. package/ai-config/agents/development/python-pro.md +570 -0
  30. package/ai-config/agents/development/react-pro.md +487 -0
  31. package/ai-config/agents/development/rust-pro.md +246 -0
  32. package/ai-config/agents/development/spring-boot-4-expert.md +326 -0
  33. package/ai-config/agents/development/typescript-pro.md +336 -0
  34. package/ai-config/agents/development/vue-specialist.md +605 -0
  35. package/ai-config/agents/infrastructure/cloud-architect.md +472 -0
  36. package/ai-config/agents/infrastructure/deployment-manager.md +358 -0
  37. package/ai-config/agents/infrastructure/devops-engineer.md +455 -0
  38. package/ai-config/agents/infrastructure/incident-responder.md +519 -0
  39. package/ai-config/agents/infrastructure/kubernetes-expert.md +705 -0
  40. package/ai-config/agents/infrastructure/monitoring-specialist.md +674 -0
  41. package/ai-config/agents/infrastructure/performance-engineer.md +658 -0
  42. package/ai-config/agents/orchestrator.md +241 -0
  43. package/ai-config/agents/quality/accessibility-auditor.md +1204 -0
  44. package/ai-config/agents/quality/code-reviewer-compact.md +123 -0
  45. package/ai-config/agents/quality/code-reviewer.md +363 -0
  46. package/ai-config/agents/quality/dependency-manager.md +743 -0
  47. package/ai-config/agents/quality/e2e-test-specialist.md +1005 -0
  48. package/ai-config/agents/quality/performance-tester.md +1086 -0
  49. package/ai-config/agents/quality/security-auditor.md +133 -0
  50. package/ai-config/agents/quality/test-engineer.md +453 -0
  51. package/ai-config/agents/specialists/api-designer.md +87 -0
  52. package/ai-config/agents/specialists/backend-architect.md +73 -0
  53. package/ai-config/agents/specialists/code-reviewer.md +77 -0
  54. package/ai-config/agents/specialists/db-optimizer.md +75 -0
  55. package/ai-config/agents/specialists/devops-engineer.md +83 -0
  56. package/ai-config/agents/specialists/documentation-writer.md +78 -0
  57. package/ai-config/agents/specialists/frontend-developer.md +75 -0
  58. package/ai-config/agents/specialists/performance-analyst.md +82 -0
  59. package/ai-config/agents/specialists/refactor-specialist.md +74 -0
  60. package/ai-config/agents/specialists/security-auditor.md +74 -0
  61. package/ai-config/agents/specialists/test-engineer.md +81 -0
  62. package/ai-config/agents/specialists/ux-consultant.md +76 -0
  63. package/ai-config/agents/specialized/agent-generator.md +1190 -0
  64. package/ai-config/agents/specialized/blockchain-developer.md +149 -0
  65. package/ai-config/agents/specialized/code-migrator.md +892 -0
  66. package/ai-config/agents/specialized/context-manager.md +978 -0
  67. package/ai-config/agents/specialized/documentation-writer.md +1078 -0
  68. package/ai-config/agents/specialized/ecommerce-expert.md +1756 -0
  69. package/ai-config/agents/specialized/embedded-engineer.md +1714 -0
  70. package/ai-config/agents/specialized/error-detective.md +1034 -0
  71. package/ai-config/agents/specialized/fintech-specialist.md +1659 -0
  72. package/ai-config/agents/specialized/freelance-project-planner-v2.md +1988 -0
  73. package/ai-config/agents/specialized/freelance-project-planner-v3.md +2136 -0
  74. package/ai-config/agents/specialized/freelance-project-planner-v4.md +4503 -0
  75. package/ai-config/agents/specialized/freelance-project-planner.md +722 -0
  76. package/ai-config/agents/specialized/game-developer.md +1963 -0
  77. package/ai-config/agents/specialized/healthcare-dev.md +1620 -0
  78. package/ai-config/agents/specialized/mobile-developer.md +188 -0
  79. package/ai-config/agents/specialized/parallel-plan-executor.md +506 -0
  80. package/ai-config/agents/specialized/plan-executor.md +485 -0
  81. package/ai-config/agents/specialized/solo-dev-planner-modular/00-INDEX.md +485 -0
  82. package/ai-config/agents/specialized/solo-dev-planner-modular/01-CORE.md +3493 -0
  83. package/ai-config/agents/specialized/solo-dev-planner-modular/02-SELF-CORRECTION.md +778 -0
  84. package/ai-config/agents/specialized/solo-dev-planner-modular/03-PROGRESSIVE-SETUP.md +918 -0
  85. package/ai-config/agents/specialized/solo-dev-planner-modular/04-DEPLOYMENT.md +1537 -0
  86. package/ai-config/agents/specialized/solo-dev-planner-modular/05-TESTING.md +2633 -0
  87. package/ai-config/agents/specialized/solo-dev-planner-modular/06-OPERATIONS.md +5610 -0
  88. package/ai-config/agents/specialized/solo-dev-planner-modular/INSTALL.md +335 -0
  89. package/ai-config/agents/specialized/solo-dev-planner-modular/QUICK-REFERENCE.txt +215 -0
  90. package/ai-config/agents/specialized/solo-dev-planner-modular/README.md +260 -0
  91. package/ai-config/agents/specialized/solo-dev-planner-modular/START-HERE.md +379 -0
  92. package/ai-config/agents/specialized/solo-dev-planner-modular/WORKFLOW-DIAGRAM.md +355 -0
  93. package/ai-config/agents/specialized/solo-dev-planner-modular/solo-dev-planner.md +279 -0
  94. package/ai-config/agents/specialized/template-writer.md +347 -0
  95. package/ai-config/agents/specialized/test-runner.md +99 -0
  96. package/ai-config/agents/specialized/vibekanban-smart-worker.md +244 -0
  97. package/ai-config/agents/specialized/wave-executor.md +138 -0
  98. package/ai-config/agents/specialized/workflow-optimizer.md +1114 -0
  99. package/ai-config/commands/git/changelog.md +32 -0
  100. package/ai-config/commands/git/ci-local.md +70 -0
  101. package/ai-config/commands/git/commit.md +35 -0
  102. package/ai-config/commands/git/fix-issue.md +23 -0
  103. package/ai-config/commands/git/pr-create.md +42 -0
  104. package/ai-config/commands/git/pr-review.md +50 -0
  105. package/ai-config/commands/git/worktree.md +39 -0
  106. package/ai-config/commands/refactoring/cleanup.md +24 -0
  107. package/ai-config/commands/refactoring/dead-code.md +40 -0
  108. package/ai-config/commands/refactoring/extract.md +31 -0
  109. package/ai-config/commands/testing/e2e.md +30 -0
  110. package/ai-config/commands/testing/tdd.md +36 -0
  111. package/ai-config/commands/testing/test-coverage.md +30 -0
  112. package/ai-config/commands/testing/test-fix.md +24 -0
  113. package/ai-config/commands/workflow/generate-agents-md.md +85 -0
  114. package/ai-config/commands/workflow/planning.md +47 -0
  115. package/ai-config/commands/workflows/compound.md +89 -0
  116. package/ai-config/commands/workflows/plan.md +77 -0
  117. package/ai-config/commands/workflows/review.md +78 -0
  118. package/ai-config/commands/workflows/work.md +75 -0
  119. package/ai-config/config.yaml +18 -0
  120. package/ai-config/hooks/_TEMPLATE.md +96 -0
  121. package/ai-config/hooks/block-dangerous-commands.md +75 -0
  122. package/ai-config/hooks/commit-guard.md +90 -0
  123. package/ai-config/hooks/context-loader.md +73 -0
  124. package/ai-config/hooks/improve-prompt.md +91 -0
  125. package/ai-config/hooks/learning-log.md +72 -0
  126. package/ai-config/hooks/model-router.md +86 -0
  127. package/ai-config/hooks/secret-scanner.md +64 -0
  128. package/ai-config/hooks/skill-validator.md +102 -0
  129. package/ai-config/hooks/task-artifact.md +114 -0
  130. package/ai-config/hooks/validate-workflow.md +100 -0
  131. package/ai-config/prompts/base.md +71 -0
  132. package/ai-config/prompts/modes/debug.md +34 -0
  133. package/ai-config/prompts/modes/deploy.md +40 -0
  134. package/ai-config/prompts/modes/research.md +32 -0
  135. package/ai-config/prompts/modes/review.md +33 -0
  136. package/ai-config/prompts/review-policy.md +79 -0
  137. package/ai-config/skills/_TEMPLATE.md +157 -0
  138. package/ai-config/skills/backend/api-gateway/SKILL.md +254 -0
  139. package/ai-config/skills/backend/bff-concepts/SKILL.md +239 -0
  140. package/ai-config/skills/backend/bff-spring/SKILL.md +364 -0
  141. package/ai-config/skills/backend/chi-router/SKILL.md +396 -0
  142. package/ai-config/skills/backend/error-handling/SKILL.md +255 -0
  143. package/ai-config/skills/backend/exceptions-spring/SKILL.md +323 -0
  144. package/ai-config/skills/backend/fastapi/SKILL.md +302 -0
  145. package/ai-config/skills/backend/gateway-spring/SKILL.md +390 -0
  146. package/ai-config/skills/backend/go-backend/SKILL.md +457 -0
  147. package/ai-config/skills/backend/gradle-multimodule/SKILL.md +274 -0
  148. package/ai-config/skills/backend/graphql-concepts/SKILL.md +352 -0
  149. package/ai-config/skills/backend/graphql-spring/SKILL.md +398 -0
  150. package/ai-config/skills/backend/grpc-concepts/SKILL.md +283 -0
  151. package/ai-config/skills/backend/grpc-spring/SKILL.md +445 -0
  152. package/ai-config/skills/backend/jwt-auth/SKILL.md +412 -0
  153. package/ai-config/skills/backend/notifications-concepts/SKILL.md +259 -0
  154. package/ai-config/skills/backend/recommendations-concepts/SKILL.md +261 -0
  155. package/ai-config/skills/backend/search-concepts/SKILL.md +263 -0
  156. package/ai-config/skills/backend/search-spring/SKILL.md +375 -0
  157. package/ai-config/skills/backend/spring-boot-4/SKILL.md +172 -0
  158. package/ai-config/skills/backend/websockets/SKILL.md +532 -0
  159. package/ai-config/skills/data-ai/ai-ml/SKILL.md +423 -0
  160. package/ai-config/skills/data-ai/analytics-concepts/SKILL.md +195 -0
  161. package/ai-config/skills/data-ai/analytics-spring/SKILL.md +340 -0
  162. package/ai-config/skills/data-ai/duckdb-analytics/SKILL.md +440 -0
  163. package/ai-config/skills/data-ai/langchain/SKILL.md +238 -0
  164. package/ai-config/skills/data-ai/mlflow/SKILL.md +302 -0
  165. package/ai-config/skills/data-ai/onnx-inference/SKILL.md +290 -0
  166. package/ai-config/skills/data-ai/powerbi/SKILL.md +352 -0
  167. package/ai-config/skills/data-ai/pytorch/SKILL.md +274 -0
  168. package/ai-config/skills/data-ai/scikit-learn/SKILL.md +321 -0
  169. package/ai-config/skills/data-ai/vector-db/SKILL.md +301 -0
  170. package/ai-config/skills/database/graph-databases/SKILL.md +218 -0
  171. package/ai-config/skills/database/graph-spring/SKILL.md +361 -0
  172. package/ai-config/skills/database/pgx-postgres/SKILL.md +512 -0
  173. package/ai-config/skills/database/redis-cache/SKILL.md +343 -0
  174. package/ai-config/skills/database/sqlite-embedded/SKILL.md +388 -0
  175. package/ai-config/skills/database/timescaledb/SKILL.md +320 -0
  176. package/ai-config/skills/docs/api-documentation/SKILL.md +293 -0
  177. package/ai-config/skills/docs/docs-spring/SKILL.md +377 -0
  178. package/ai-config/skills/docs/mustache-templates/SKILL.md +190 -0
  179. package/ai-config/skills/docs/technical-docs/SKILL.md +447 -0
  180. package/ai-config/skills/frontend/astro-ssr/SKILL.md +441 -0
  181. package/ai-config/skills/frontend/frontend-design/SKILL.md +54 -0
  182. package/ai-config/skills/frontend/frontend-web/SKILL.md +368 -0
  183. package/ai-config/skills/frontend/mantine-ui/SKILL.md +396 -0
  184. package/ai-config/skills/frontend/tanstack-query/SKILL.md +439 -0
  185. package/ai-config/skills/frontend/zod-validation/SKILL.md +417 -0
  186. package/ai-config/skills/frontend/zustand-state/SKILL.md +350 -0
  187. package/ai-config/skills/infrastructure/chaos-engineering/SKILL.md +244 -0
  188. package/ai-config/skills/infrastructure/chaos-spring/SKILL.md +378 -0
  189. package/ai-config/skills/infrastructure/devops-infra/SKILL.md +435 -0
  190. package/ai-config/skills/infrastructure/docker-containers/SKILL.md +420 -0
  191. package/ai-config/skills/infrastructure/kubernetes/SKILL.md +456 -0
  192. package/ai-config/skills/infrastructure/opentelemetry/SKILL.md +546 -0
  193. package/ai-config/skills/infrastructure/traefik-proxy/SKILL.md +474 -0
  194. package/ai-config/skills/infrastructure/woodpecker-ci/SKILL.md +315 -0
  195. package/ai-config/skills/mobile/ionic-capacitor/SKILL.md +504 -0
  196. package/ai-config/skills/mobile/mobile-ionic/SKILL.md +448 -0
  197. package/ai-config/skills/prompt-improver/SKILL.md +125 -0
  198. package/ai-config/skills/quality/ghagga-review/SKILL.md +216 -0
  199. package/ai-config/skills/references/hooks-patterns/SKILL.md +238 -0
  200. package/ai-config/skills/references/mcp-servers/SKILL.md +275 -0
  201. package/ai-config/skills/references/plugins-reference/SKILL.md +110 -0
  202. package/ai-config/skills/references/skills-reference/SKILL.md +420 -0
  203. package/ai-config/skills/references/subagent-templates/SKILL.md +193 -0
  204. package/ai-config/skills/systems-iot/modbus-protocol/SKILL.md +410 -0
  205. package/ai-config/skills/systems-iot/mqtt-rumqttc/SKILL.md +408 -0
  206. package/ai-config/skills/systems-iot/rust-systems/SKILL.md +386 -0
  207. package/ai-config/skills/systems-iot/tokio-async/SKILL.md +324 -0
  208. package/ai-config/skills/testing/playwright-e2e/SKILL.md +289 -0
  209. package/ai-config/skills/testing/testcontainers/SKILL.md +299 -0
  210. package/ai-config/skills/testing/vitest-testing/SKILL.md +381 -0
  211. package/ai-config/skills/workflow/ci-local-guide/SKILL.md +118 -0
  212. package/ai-config/skills/workflow/claude-automation-recommender/SKILL.md +299 -0
  213. package/ai-config/skills/workflow/claude-md-improver/SKILL.md +158 -0
  214. package/ai-config/skills/workflow/finishing-a-development-branch/SKILL.md +117 -0
  215. package/ai-config/skills/workflow/git-github/SKILL.md +334 -0
  216. package/ai-config/skills/workflow/git-github/references/examples.md +160 -0
  217. package/ai-config/skills/workflow/git-workflow/SKILL.md +214 -0
  218. package/ai-config/skills/workflow/ide-plugins/SKILL.md +277 -0
  219. package/ai-config/skills/workflow/ide-plugins-intellij/SKILL.md +401 -0
  220. package/ai-config/skills/workflow/obsidian-brain-workflow/SKILL.md +199 -0
  221. package/ai-config/skills/workflow/using-git-worktrees/SKILL.md +100 -0
  222. package/ai-config/skills/workflow/verification-before-completion/SKILL.md +73 -0
  223. package/ai-config/skills/workflow/wave-workflow/SKILL.md +178 -0
  224. package/ci-local/README.md +170 -0
  225. package/ci-local/ci-local.sh +297 -0
  226. package/ci-local/hooks/commit-msg +74 -0
  227. package/ci-local/hooks/pre-commit +162 -0
  228. package/ci-local/hooks/pre-push +41 -0
  229. package/ci-local/install.sh +49 -0
  230. package/ci-local/semgrep.yml +214 -0
  231. package/dist/commands/analyze.d.ts +9 -0
  232. package/dist/commands/analyze.d.ts.map +1 -0
  233. package/dist/commands/analyze.js +55 -0
  234. package/dist/commands/analyze.js.map +1 -0
  235. package/dist/commands/analyze.test.d.ts +2 -0
  236. package/dist/commands/analyze.test.d.ts.map +1 -0
  237. package/dist/commands/analyze.test.js +145 -0
  238. package/dist/commands/analyze.test.js.map +1 -0
  239. package/dist/commands/doctor.d.ts +7 -0
  240. package/dist/commands/doctor.d.ts.map +1 -0
  241. package/dist/commands/doctor.js +158 -0
  242. package/dist/commands/doctor.js.map +1 -0
  243. package/dist/commands/doctor.test.d.ts +2 -0
  244. package/dist/commands/doctor.test.d.ts.map +1 -0
  245. package/dist/commands/doctor.test.js +200 -0
  246. package/dist/commands/doctor.test.js.map +1 -0
  247. package/dist/commands/init.d.ts +9 -0
  248. package/dist/commands/init.d.ts.map +1 -0
  249. package/dist/commands/init.js +283 -0
  250. package/dist/commands/init.js.map +1 -0
  251. package/dist/commands/init.test.d.ts +2 -0
  252. package/dist/commands/init.test.d.ts.map +1 -0
  253. package/dist/commands/init.test.js +271 -0
  254. package/dist/commands/init.test.js.map +1 -0
  255. package/dist/commands/sync.d.ts +8 -0
  256. package/dist/commands/sync.d.ts.map +1 -0
  257. package/dist/commands/sync.js +201 -0
  258. package/dist/commands/sync.js.map +1 -0
  259. package/dist/constants.d.ts +21 -0
  260. package/dist/constants.d.ts.map +1 -0
  261. package/dist/constants.js +57 -0
  262. package/dist/constants.js.map +1 -0
  263. package/dist/e2e/aggressive.e2e.test.d.ts +2 -0
  264. package/dist/e2e/aggressive.e2e.test.d.ts.map +1 -0
  265. package/dist/e2e/aggressive.e2e.test.js +350 -0
  266. package/dist/e2e/aggressive.e2e.test.js.map +1 -0
  267. package/dist/e2e/commands.e2e.test.d.ts +2 -0
  268. package/dist/e2e/commands.e2e.test.d.ts.map +1 -0
  269. package/dist/e2e/commands.e2e.test.js +213 -0
  270. package/dist/e2e/commands.e2e.test.js.map +1 -0
  271. package/dist/index.d.ts +3 -0
  272. package/dist/index.d.ts.map +1 -0
  273. package/dist/index.js +82 -0
  274. package/dist/index.js.map +1 -0
  275. package/dist/lib/common.d.ts +17 -0
  276. package/dist/lib/common.d.ts.map +1 -0
  277. package/dist/lib/common.js +111 -0
  278. package/dist/lib/common.js.map +1 -0
  279. package/dist/lib/common.test.d.ts +2 -0
  280. package/dist/lib/common.test.d.ts.map +1 -0
  281. package/dist/lib/common.test.js +316 -0
  282. package/dist/lib/common.test.js.map +1 -0
  283. package/dist/lib/frontmatter.d.ts +18 -0
  284. package/dist/lib/frontmatter.d.ts.map +1 -0
  285. package/dist/lib/frontmatter.js +61 -0
  286. package/dist/lib/frontmatter.js.map +1 -0
  287. package/dist/lib/frontmatter.test.d.ts +2 -0
  288. package/dist/lib/frontmatter.test.d.ts.map +1 -0
  289. package/dist/lib/frontmatter.test.js +257 -0
  290. package/dist/lib/frontmatter.test.js.map +1 -0
  291. package/dist/lib/template.d.ts +24 -0
  292. package/dist/lib/template.d.ts.map +1 -0
  293. package/dist/lib/template.js +78 -0
  294. package/dist/lib/template.js.map +1 -0
  295. package/dist/lib/template.test.d.ts +2 -0
  296. package/dist/lib/template.test.d.ts.map +1 -0
  297. package/dist/lib/template.test.js +201 -0
  298. package/dist/lib/template.test.js.map +1 -0
  299. package/dist/types/index.d.ts +48 -0
  300. package/dist/types/index.d.ts.map +1 -0
  301. package/dist/types/index.js +2 -0
  302. package/dist/types/index.js.map +1 -0
  303. package/dist/ui/AnalyzeUI.d.ts +7 -0
  304. package/dist/ui/AnalyzeUI.d.ts.map +1 -0
  305. package/dist/ui/AnalyzeUI.js +100 -0
  306. package/dist/ui/AnalyzeUI.js.map +1 -0
  307. package/dist/ui/App.d.ts +13 -0
  308. package/dist/ui/App.d.ts.map +1 -0
  309. package/dist/ui/App.js +100 -0
  310. package/dist/ui/App.js.map +1 -0
  311. package/dist/ui/CIContext.d.ts +9 -0
  312. package/dist/ui/CIContext.d.ts.map +1 -0
  313. package/dist/ui/CIContext.js +9 -0
  314. package/dist/ui/CIContext.js.map +1 -0
  315. package/dist/ui/CISelector.d.ts +8 -0
  316. package/dist/ui/CISelector.d.ts.map +1 -0
  317. package/dist/ui/CISelector.js +45 -0
  318. package/dist/ui/CISelector.js.map +1 -0
  319. package/dist/ui/Doctor.d.ts +3 -0
  320. package/dist/ui/Doctor.d.ts.map +1 -0
  321. package/dist/ui/Doctor.js +89 -0
  322. package/dist/ui/Doctor.js.map +1 -0
  323. package/dist/ui/Header.d.ts +8 -0
  324. package/dist/ui/Header.d.ts.map +1 -0
  325. package/dist/ui/Header.js +30 -0
  326. package/dist/ui/Header.js.map +1 -0
  327. package/dist/ui/MemorySelector.d.ts +8 -0
  328. package/dist/ui/MemorySelector.d.ts.map +1 -0
  329. package/dist/ui/MemorySelector.js +46 -0
  330. package/dist/ui/MemorySelector.js.map +1 -0
  331. package/dist/ui/NameInput.d.ts +8 -0
  332. package/dist/ui/NameInput.d.ts.map +1 -0
  333. package/dist/ui/NameInput.js +69 -0
  334. package/dist/ui/NameInput.js.map +1 -0
  335. package/dist/ui/OptionSelector.d.ts +12 -0
  336. package/dist/ui/OptionSelector.d.ts.map +1 -0
  337. package/dist/ui/OptionSelector.js +69 -0
  338. package/dist/ui/OptionSelector.js.map +1 -0
  339. package/dist/ui/Progress.d.ts +11 -0
  340. package/dist/ui/Progress.d.ts.map +1 -0
  341. package/dist/ui/Progress.js +58 -0
  342. package/dist/ui/Progress.js.map +1 -0
  343. package/dist/ui/StackSelector.d.ts +9 -0
  344. package/dist/ui/StackSelector.d.ts.map +1 -0
  345. package/dist/ui/StackSelector.js +65 -0
  346. package/dist/ui/StackSelector.js.map +1 -0
  347. package/dist/ui/Summary.d.ts +12 -0
  348. package/dist/ui/Summary.d.ts.map +1 -0
  349. package/dist/ui/Summary.js +114 -0
  350. package/dist/ui/Summary.js.map +1 -0
  351. package/dist/ui/SyncUI.d.ts +10 -0
  352. package/dist/ui/SyncUI.d.ts.map +1 -0
  353. package/dist/ui/SyncUI.js +64 -0
  354. package/dist/ui/SyncUI.js.map +1 -0
  355. package/dist/ui/Welcome.d.ts +7 -0
  356. package/dist/ui/Welcome.d.ts.map +1 -0
  357. package/dist/ui/Welcome.js +45 -0
  358. package/dist/ui/Welcome.js.map +1 -0
  359. package/dist/ui/theme.d.ts +10 -0
  360. package/dist/ui/theme.d.ts.map +1 -0
  361. package/dist/ui/theme.js +9 -0
  362. package/dist/ui/theme.js.map +1 -0
  363. package/modules/engram/.gitignore-snippet.txt +6 -0
  364. package/modules/engram/.mcp-config-snippet.json +11 -0
  365. package/modules/engram/README.md +146 -0
  366. package/modules/engram/install-engram.sh +216 -0
  367. package/modules/ghagga/.env.example +43 -0
  368. package/modules/ghagga/README.md +153 -0
  369. package/modules/ghagga/docker-compose.yml +80 -0
  370. package/modules/ghagga/setup-ghagga.sh +139 -0
  371. package/modules/memory-simple/.project/NOTES.md +22 -0
  372. package/modules/memory-simple/README.md +23 -0
  373. package/modules/obsidian-brain/.obsidian/app.json +23 -0
  374. package/modules/obsidian-brain/.obsidian/appearance.json +5 -0
  375. package/modules/obsidian-brain/.obsidian/bookmarks.json +34 -0
  376. package/modules/obsidian-brain/.obsidian/community-plugins.json +1 -0
  377. package/modules/obsidian-brain/.obsidian/core-plugins-migration.json +21 -0
  378. package/modules/obsidian-brain/.obsidian/core-plugins.json +18 -0
  379. package/modules/obsidian-brain/.obsidian/daily-notes.json +5 -0
  380. package/modules/obsidian-brain/.obsidian/graph.json +37 -0
  381. package/modules/obsidian-brain/.obsidian/hotkeys.json +14 -0
  382. package/modules/obsidian-brain/.obsidian/plugins/dataview/data.json +25 -0
  383. package/modules/obsidian-brain/.obsidian/plugins/obsidian-kanban/data.json +29 -0
  384. package/modules/obsidian-brain/.obsidian/plugins/templater-obsidian/data.json +18 -0
  385. package/modules/obsidian-brain/.obsidian/snippets/project-memory.css +71 -0
  386. package/modules/obsidian-brain/.obsidian-gitignore-snippet.txt +8 -0
  387. package/modules/obsidian-brain/.project/Attachments/.gitkeep +0 -0
  388. package/modules/obsidian-brain/.project/Memory/BLOCKERS.md +78 -0
  389. package/modules/obsidian-brain/.project/Memory/CONTEXT.md +102 -0
  390. package/modules/obsidian-brain/.project/Memory/DASHBOARD.md +73 -0
  391. package/modules/obsidian-brain/.project/Memory/DECISIONS.md +87 -0
  392. package/modules/obsidian-brain/.project/Memory/KANBAN.md +15 -0
  393. package/modules/obsidian-brain/.project/Memory/README.md +61 -0
  394. package/modules/obsidian-brain/.project/Memory/WAVES.md +78 -0
  395. package/modules/obsidian-brain/.project/Sessions/TEMPLATE.md +99 -0
  396. package/modules/obsidian-brain/.project/Templates/ADR.md +33 -0
  397. package/modules/obsidian-brain/.project/Templates/Blocker.md +21 -0
  398. package/modules/obsidian-brain/.project/Templates/Session.md +88 -0
  399. package/modules/obsidian-brain/README.md +268 -0
  400. package/modules/obsidian-brain/new-wave.sh +182 -0
  401. package/package.json +51 -0
  402. package/schemas/agent.schema.json +34 -0
  403. package/schemas/ai-config.schema.json +28 -0
  404. package/schemas/skill.schema.json +44 -0
  405. package/src/commands/analyze.test.ts +145 -0
  406. package/src/commands/analyze.ts +69 -0
  407. package/src/commands/doctor.test.ts +208 -0
  408. package/src/commands/doctor.ts +163 -0
  409. package/src/commands/init.test.ts +298 -0
  410. package/src/commands/init.ts +285 -0
  411. package/src/constants.ts +69 -0
  412. package/src/e2e/aggressive.e2e.test.ts +557 -0
  413. package/src/e2e/commands.e2e.test.ts +298 -0
  414. package/src/index.tsx +106 -0
  415. package/src/lib/common.test.ts +318 -0
  416. package/src/lib/common.ts +127 -0
  417. package/src/lib/frontmatter.test.ts +291 -0
  418. package/src/lib/frontmatter.ts +77 -0
  419. package/src/lib/template.test.ts +226 -0
  420. package/src/lib/template.ts +99 -0
  421. package/src/types/index.ts +53 -0
  422. package/src/ui/AnalyzeUI.tsx +133 -0
  423. package/src/ui/App.tsx +175 -0
  424. package/src/ui/CIContext.tsx +25 -0
  425. package/src/ui/CISelector.tsx +72 -0
  426. package/src/ui/Doctor.tsx +122 -0
  427. package/src/ui/Header.tsx +48 -0
  428. package/src/ui/MemorySelector.tsx +73 -0
  429. package/src/ui/NameInput.tsx +82 -0
  430. package/src/ui/OptionSelector.tsx +100 -0
  431. package/src/ui/Progress.tsx +88 -0
  432. package/src/ui/StackSelector.tsx +101 -0
  433. package/src/ui/Summary.tsx +134 -0
  434. package/src/ui/Welcome.tsx +54 -0
  435. package/src/ui/theme.ts +10 -0
  436. package/stryker.config.json +19 -0
  437. package/tasks/_TEMPLATE/files-edited.md +3 -0
  438. package/tasks/_TEMPLATE/plan.md +3 -0
  439. package/tasks/_TEMPLATE/research.md +3 -0
  440. package/tasks/_TEMPLATE/verification.md +5 -0
  441. package/templates/common/dependabot/cargo.yml +11 -0
  442. package/templates/common/dependabot/github-actions.yml +16 -0
  443. package/templates/common/dependabot/gomod.yml +15 -0
  444. package/templates/common/dependabot/gradle.yml +15 -0
  445. package/templates/common/dependabot/header.yml +3 -0
  446. package/templates/common/dependabot/maven.yml +15 -0
  447. package/templates/common/dependabot/npm.yml +20 -0
  448. package/templates/common/dependabot/pip.yml +11 -0
  449. package/templates/dependabot.yml +162 -0
  450. package/templates/github/ci-go.yml +41 -0
  451. package/templates/github/ci-java.yml +45 -0
  452. package/templates/github/ci-monorepo.yml +150 -0
  453. package/templates/github/ci-node.yml +42 -0
  454. package/templates/github/ci-python.yml +42 -0
  455. package/templates/github/ci-rust.yml +42 -0
  456. package/templates/github/dependabot-automerge.yml +40 -0
  457. package/templates/gitlab/gitlab-ci-go.yml +88 -0
  458. package/templates/gitlab/gitlab-ci-java.yml +79 -0
  459. package/templates/gitlab/gitlab-ci-monorepo.yml +126 -0
  460. package/templates/gitlab/gitlab-ci-node.yml +63 -0
  461. package/templates/gitlab/gitlab-ci-python.yml +147 -0
  462. package/templates/gitlab/gitlab-ci-rust.yml +67 -0
  463. package/templates/global/claude-settings.json +98 -0
  464. package/templates/global/codex-config.toml +8 -0
  465. package/templates/global/copilot-instructions/base-rules.instructions.md +13 -0
  466. package/templates/global/copilot-instructions/sdd-orchestrator.instructions.md +37 -0
  467. package/templates/global/gemini-commands/cleanup.toml +20 -0
  468. package/templates/global/gemini-commands/commit.toml +15 -0
  469. package/templates/global/gemini-commands/dead-code.toml +22 -0
  470. package/templates/global/gemini-commands/plan.toml +30 -0
  471. package/templates/global/gemini-commands/review.toml +17 -0
  472. package/templates/global/gemini-commands/sdd-apply.toml +22 -0
  473. package/templates/global/gemini-commands/sdd-ff.toml +14 -0
  474. package/templates/global/gemini-commands/sdd-new.toml +21 -0
  475. package/templates/global/gemini-commands/sdd-verify.toml +21 -0
  476. package/templates/global/gemini-commands/tdd.toml +26 -0
  477. package/templates/global/gemini-settings.json +8 -0
  478. package/templates/global/opencode-config.json +44 -0
  479. package/templates/global/sdd-instructions.md +47 -0
  480. package/templates/global/sdd-orchestrator-claude.md +46 -0
  481. package/templates/global/sdd-orchestrator-copilot.md +34 -0
  482. package/templates/renovate.json +69 -0
  483. package/templates/woodpecker/monorepo/backend.yml +34 -0
  484. package/templates/woodpecker/monorepo/frontend.yml +34 -0
  485. package/templates/woodpecker/monorepo/summary.yml +25 -0
  486. package/templates/woodpecker/woodpecker-go.yml +51 -0
  487. package/templates/woodpecker/woodpecker-java.yml +67 -0
  488. package/templates/woodpecker/woodpecker-node.yml +47 -0
  489. package/templates/woodpecker/woodpecker-python.yml +108 -0
  490. package/templates/woodpecker/woodpecker-rust.yml +57 -0
  491. package/tsconfig.json +19 -0
  492. package/vitest.config.ts +16 -0
  493. package/workflows/reusable-build-go.yml +111 -0
  494. package/workflows/reusable-build-java.yml +120 -0
  495. package/workflows/reusable-build-node.yml +145 -0
  496. package/workflows/reusable-build-python.yml +159 -0
  497. package/workflows/reusable-build-rust.yml +135 -0
  498. package/workflows/reusable-docker.yml +120 -0
  499. package/workflows/reusable-ghagga-review.yml +165 -0
  500. package/workflows/reusable-release.yml +91 -0
@@ -0,0 +1,1988 @@
1
+ ---
2
+ name: freelance-project-planner-v2
3
+ description: Especialista en análisis de proyectos existentes con integración GitHub MCP para automatización completa
4
+ trigger: >
5
+ freelance v2, GitHub MCP, project planning, automated issues, milestone automation,
6
+ GitHub integration, kanban XP, project setup automation
7
+ category: specialized
8
+ color: green
9
+ tools: Write, Read, MultiEdit, Bash, Grep, Glob, GitHub_MCP
10
+ config:
11
+ model: sonnet
12
+ mcp_servers:
13
+ - github
14
+ metadata:
15
+ version: "2.0"
16
+ updated: "2026-02"
17
+ ---
18
+
19
+ ## 🔗 Integración GitHub MCP
20
+
21
+ Este agente utiliza **GitHub Model Context Protocol (MCP)** para automatizar completamente la gestión del proyecto en GitHub, eliminando el trabajo manual y acelerando el setup.
22
+
23
+ ### Capacidades GitHub MCP Habilitadas
24
+
25
+ #### 1. **Gestión de Repositorio**
26
+ - Crear repositorio automáticamente si no existe
27
+ - Configurar ramas (main, develop, staging)
28
+ - Setup de branch protection rules
29
+ - Configurar webhooks y notificaciones
30
+
31
+ #### 2. **Issues y Project Management**
32
+ - Crear issues automáticamente desde el backlog
33
+ - Aplicar labels y milestones
34
+ - Asignar issues y configurar proyectos
35
+ - Linkear issues relacionados
36
+
37
+ #### 3. **Pull Requests**
38
+ - Crear PRs con templates optimizados
39
+ - Asignar reviewers automáticamente
40
+ - Configurar auto-merge conditions
41
+ - Linkear issues con PRs
42
+
43
+ #### 4. **GitHub Actions**
44
+ - Crear workflows de CI/CD
45
+ - Configurar secrets y variables
46
+ - Setup de deploy automático
47
+ - Notificaciones de build status
48
+
49
+ #### 5. **Documentación**
50
+ - Commit de toda la documentación generada
51
+ - Update de README automático
52
+ - Sync de CHANGELOG
53
+ - Wiki setup opcional
54
+
55
+ Eres un especialista en planificación de proyectos para desarrolladores freelance que analiza proyectos existentes y crea una estrategia de desarrollo iterativa usando una metodología híbrida optimizada de Kanban + Extreme Programming.
56
+
57
+ ## Metodología Core: Kanban Light + XP Adaptado
58
+
59
+ ### Framework Híbrido para Freelancers
60
+ - **Gestión de Flujo**: Kanban con WIP limitado y priorización dinámica
61
+ - **Calidad Técnica**: Prácticas selectivas de XP (TDD crítico, CI/CD, refactorización)
62
+ - **Entrega Continua**: Demos frecuentes con feedback rápido del cliente
63
+ - **Overhead Mínimo**: Sin ceremonias innecesarias, foco en desarrollo
64
+
65
+ ## GitHub MCP Automation Layer
66
+
67
+ ### 1. Setup Completo Automatizado con MCP
68
+ ```typescript
69
+ class GitHubMCPIntegration {
70
+ private mcp: GitHubMCPClient;
71
+
72
+ async setupProjectInGitHub(
73
+ projectAnalysis: ProjectAnalysis,
74
+ plan: DevelopmentPlan
75
+ ): Promise<GitHubSetup> {
76
+
77
+ // 1. Crear o validar repositorio
78
+ const repo = await this.ensureRepository(projectAnalysis);
79
+
80
+ // 2. Configurar estructura de ramas
81
+ await this.setupBranches(repo);
82
+
83
+ // 3. Crear issues desde backlog
84
+ const issues = await this.createIssuesFromBacklog(repo, plan.kanbanBoard);
85
+
86
+ // 4. Setup GitHub Projects (Kanban Board)
87
+ const project = await this.createGitHubProject(repo, plan);
88
+
89
+ // 5. Configurar GitHub Actions
90
+ await this.setupCICD(repo, projectAnalysis.techStack);
91
+
92
+ // 6. Commit documentación
93
+ await this.commitDocumentation(repo, plan.documentation);
94
+
95
+ // 7. Setup PR templates
96
+ await this.setupPRTemplates(repo);
97
+
98
+ return {
99
+ repository: repo,
100
+ project: project,
101
+ issues: issues,
102
+ workflows: await this.listWorkflows(repo)
103
+ };
104
+ }
105
+
106
+ private async ensureRepository(analysis: ProjectAnalysis): Promise<Repository> {
107
+ // Verificar si el repo existe
108
+ const repoName = analysis.name;
109
+ let repo;
110
+
111
+ try {
112
+ repo = await this.mcp.getRepository(repoName);
113
+ console.log(`✅ Repositorio existente encontrado: ${repo.full_name}`);
114
+ } catch (error) {
115
+ // Crear nuevo repositorio
116
+ console.log(`📦 Creando nuevo repositorio: ${repoName}`);
117
+ repo = await this.mcp.createRepository({
118
+ name: repoName,
119
+ description: analysis.description || `Proyecto freelance: ${repoName}`,
120
+ private: true,
121
+ has_issues: true,
122
+ has_projects: true,
123
+ has_wiki: false,
124
+ auto_init: false
125
+ });
126
+ console.log(`✅ Repositorio creado: ${repo.html_url}`);
127
+ }
128
+
129
+ return repo;
130
+ }
131
+
132
+ private async setupBranches(repo: Repository): Promise<void> {
133
+ const branches = ['develop', 'staging'];
134
+
135
+ for (const branch of branches) {
136
+ try {
137
+ await this.mcp.createBranch(repo, {
138
+ ref: `refs/heads/${branch}`,
139
+ sha: await this.getMainBranchSHA(repo)
140
+ });
141
+ console.log(`✅ Rama creada: ${branch}`);
142
+ } catch (error) {
143
+ console.log(`ℹ️ Rama ${branch} ya existe`);
144
+ }
145
+ }
146
+
147
+ // Proteger rama main
148
+ await this.mcp.updateBranchProtection(repo, 'main', {
149
+ required_status_checks: {
150
+ strict: true,
151
+ contexts: ['ci/tests', 'ci/lint']
152
+ },
153
+ enforce_admins: false,
154
+ required_pull_request_reviews: {
155
+ required_approving_review_count: 1
156
+ },
157
+ restrictions: null
158
+ });
159
+ console.log(`🔒 Branch protection configurado en main`);
160
+ }
161
+
162
+ private async createIssuesFromBacklog(
163
+ repo: Repository,
164
+ kanbanBoard: KanbanBoard
165
+ ): Promise<Issue[]> {
166
+ const issues: Issue[] = [];
167
+ const labelMap = await this.ensureLabels(repo);
168
+
169
+ for (const task of kanbanBoard.columns.backlog) {
170
+ const labels = this.mapTaskLabels(task, labelMap);
171
+
172
+ const issue = await this.mcp.createIssue(repo, {
173
+ title: task.title,
174
+ body: this.formatIssueBody(task),
175
+ labels: labels,
176
+ assignees: [], // Auto-assign al freelancer si está configurado
177
+ milestone: task.milestone ? await this.getOrCreateMilestone(repo, task.milestone) : undefined
178
+ });
179
+
180
+ console.log(`📝 Issue creado: #${issue.number} - ${task.title}`);
181
+ issues.push(issue);
182
+ }
183
+
184
+ return issues;
185
+ }
186
+
187
+ private formatIssueBody(task: Task): string {
188
+ return `
189
+ ## Descripción
190
+ ${task.description}
191
+
192
+ ## Tipo
193
+ ${task.type}
194
+
195
+ ## Prioridad
196
+ ${task.priority}
197
+
198
+ ## Estimación
199
+ ⏱️ ${task.estimate}
200
+
201
+ ## Criterios de Aceptación
202
+ ${task.acceptanceCriteria?.map(c => `- [ ] ${c}`).join('\n') || 'N/A'}
203
+
204
+ ${task.technicalNotes ? `\n## Notas Técnicas\n${task.technicalNotes}` : ''}
205
+
206
+ ${task.tags ? `\n## Tags\n${task.tags.map(t => `\`${t}\``).join(' ')}` : ''}
207
+
208
+ ---
209
+ _Generado automáticamente por freelance-project-planner_
210
+ `;
211
+ }
212
+
213
+ private async ensureLabels(repo: Repository): Promise<Map<string, Label>> {
214
+ const requiredLabels = [
215
+ { name: 'feature', color: '0E8A16', description: 'Nueva funcionalidad' },
216
+ { name: 'bugfix', color: 'D73A4A', description: 'Corrección de bug' },
217
+ { name: 'technical', color: '1D76DB', description: 'Deuda técnica o refactoring' },
218
+ { name: 'documentation', color: '0075CA', description: 'Mejoras en documentación' },
219
+ { name: 'P0', color: 'B60205', description: 'Prioridad crítica' },
220
+ { name: 'P1', color: 'D93F0B', description: 'Prioridad alta' },
221
+ { name: 'P2', color: 'FBCA04', description: 'Prioridad media' },
222
+ { name: 'P3', color: 'C5DEF5', description: 'Prioridad baja' },
223
+ { name: 'wip', color: 'FEF2C0', description: 'Work in progress' },
224
+ { name: 'blocked', color: 'B60205', description: 'Bloqueado' },
225
+ { name: 'ready', color: '0E8A16', description: 'Listo para trabajar' }
226
+ ];
227
+
228
+ const labelMap = new Map<string, Label>();
229
+
230
+ for (const labelConfig of requiredLabels) {
231
+ try {
232
+ const label = await this.mcp.createLabel(repo, labelConfig);
233
+ labelMap.set(label.name, label);
234
+ console.log(`🏷️ Label creado: ${label.name}`);
235
+ } catch (error) {
236
+ // Label ya existe, obtenerlo
237
+ const label = await this.mcp.getLabel(repo, labelConfig.name);
238
+ labelMap.set(label.name, label);
239
+ }
240
+ }
241
+
242
+ return labelMap;
243
+ }
244
+
245
+ private async createGitHubProject(
246
+ repo: Repository,
247
+ plan: DevelopmentPlan
248
+ ): Promise<Project> {
249
+ // Crear GitHub Project (Kanban Board)
250
+ const project = await this.mcp.createProject(repo, {
251
+ name: `${repo.name} - Development Board`,
252
+ body: 'Tablero Kanban para gestión del proyecto freelance'
253
+ });
254
+
255
+ console.log(`📊 GitHub Project creado: ${project.name}`);
256
+
257
+ // Crear columnas del tablero
258
+ const columns = [
259
+ { name: '📋 Backlog', automation: 'none' },
260
+ { name: '✅ Ready', automation: 'none' },
261
+ { name: '🔨 In Progress (WIP: 2)', automation: 'none' },
262
+ { name: '👀 Review', automation: 'none' },
263
+ { name: '✅ Done', automation: 'to_done' }
264
+ ];
265
+
266
+ for (const col of columns) {
267
+ await this.mcp.createProjectColumn(project, col);
268
+ console.log(`📌 Columna creada: ${col.name}`);
269
+ }
270
+
271
+ return project;
272
+ }
273
+
274
+ private async setupCICD(repo: Repository, techStack: TechStack): Promise<void> {
275
+ // Generar workflows basados en el tech stack
276
+ const workflows = this.generateWorkflows(techStack);
277
+
278
+ for (const [filename, content] of Object.entries(workflows)) {
279
+ await this.mcp.createOrUpdateFile(repo, {
280
+ path: `.github/workflows/${filename}`,
281
+ message: `chore: add ${filename} workflow`,
282
+ content: content,
283
+ branch: 'main'
284
+ });
285
+ console.log(`⚙️ Workflow creado: ${filename}`);
286
+ }
287
+
288
+ // Configurar secrets necesarios si se especifican
289
+ console.log(`ℹ️ Recuerda configurar los siguientes secrets en GitHub:`);
290
+ console.log(` - DEPLOY_TOKEN (para deployment automático)`);
291
+ console.log(` - CODECOV_TOKEN (para code coverage)`);
292
+ }
293
+
294
+ private generateWorkflows(techStack: TechStack): Record<string, string> {
295
+ const workflows: Record<string, string> = {};
296
+
297
+ // CI Workflow principal
298
+ workflows['ci.yml'] = this.generateCIWorkflow(techStack);
299
+
300
+ // Deploy workflow
301
+ workflows['deploy.yml'] = this.generateDeployWorkflow(techStack);
302
+
303
+ // Dependabot auto-merge (opcional)
304
+ workflows['dependabot-auto-merge.yml'] = this.generateDependabotWorkflow();
305
+
306
+ return workflows;
307
+ }
308
+
309
+ private generateCIWorkflow(techStack: TechStack): string {
310
+ const isNode = techStack.backend?.includes('node') || techStack.frontend?.includes('react');
311
+ const isPython = techStack.backend?.includes('python') || techStack.backend?.includes('django');
312
+
313
+ if (isNode) {
314
+ return `name: CI Pipeline
315
+
316
+ on:
317
+ push:
318
+ branches: [main, develop]
319
+ pull_request:
320
+ branches: [main, develop]
321
+
322
+ jobs:
323
+ test:
324
+ runs-on: ubuntu-latest
325
+
326
+ steps:
327
+ - uses: actions/checkout@v4
328
+
329
+ - name: Setup Node.js
330
+ uses: actions/setup-node@v4
331
+ with:
332
+ node-version: '20'
333
+ cache: 'npm'
334
+
335
+ - name: Install dependencies
336
+ run: npm ci
337
+
338
+ - name: Lint
339
+ run: npm run lint
340
+
341
+ - name: Type Check
342
+ run: npm run type-check
343
+ continue-on-error: true
344
+
345
+ - name: Unit Tests
346
+ run: npm run test:unit
347
+
348
+ - name: Build
349
+ run: npm run build
350
+
351
+ - name: Upload coverage
352
+ uses: codecov/codecov-action@v3
353
+ with:
354
+ token: \${{ secrets.CODECOV_TOKEN }}
355
+ fail_ci_if_error: false
356
+
357
+ security:
358
+ runs-on: ubuntu-latest
359
+ steps:
360
+ - uses: actions/checkout@v4
361
+
362
+ - name: Security Audit
363
+ run: npm audit --audit-level=high
364
+ continue-on-error: true
365
+ `;
366
+ }
367
+
368
+ if (isPython) {
369
+ return `name: CI Pipeline
370
+
371
+ on:
372
+ push:
373
+ branches: [main, develop]
374
+ pull_request:
375
+ branches: [main, develop]
376
+
377
+ jobs:
378
+ test:
379
+ runs-on: ubuntu-latest
380
+
381
+ steps:
382
+ - uses: actions/checkout@v4
383
+
384
+ - name: Setup Python
385
+ uses: actions/setup-python@v5
386
+ with:
387
+ python-version: '3.11'
388
+ cache: 'pip'
389
+
390
+ - name: Install dependencies
391
+ run: |
392
+ pip install -r requirements.txt
393
+ pip install pytest pytest-cov flake8
394
+
395
+ - name: Lint
396
+ run: flake8 . --max-line-length=100
397
+
398
+ - name: Run tests
399
+ run: pytest --cov=. --cov-report=xml
400
+
401
+ - name: Upload coverage
402
+ uses: codecov/codecov-action@v3
403
+ with:
404
+ token: \${{ secrets.CODECOV_TOKEN }}
405
+ fail_ci_if_error: false
406
+ `;
407
+ }
408
+
409
+ return '# Configure based on your tech stack';
410
+ }
411
+
412
+ private async commitDocumentation(
413
+ repo: Repository,
414
+ documentation: Documentation
415
+ ): Promise<void> {
416
+ const files = [
417
+ { path: 'README.md', content: documentation.readme },
418
+ { path: 'CONTRIBUTING.md', content: documentation.contributing },
419
+ { path: 'docs/ARCHITECTURE.md', content: documentation.architecture },
420
+ { path: 'docs/SETUP.md', content: documentation.setup },
421
+ { path: 'docs/DEPLOYMENT.md', content: documentation.deployment }
422
+ ];
423
+
424
+ for (const file of files) {
425
+ try {
426
+ await this.mcp.createOrUpdateFile(repo, {
427
+ path: file.path,
428
+ message: `docs: update ${file.path}`,
429
+ content: file.content,
430
+ branch: 'main'
431
+ });
432
+ console.log(`📄 Documentación commiteada: ${file.path}`);
433
+ } catch (error) {
434
+ console.error(`❌ Error al commitear ${file.path}:`, error.message);
435
+ }
436
+ }
437
+ }
438
+
439
+ private async setupPRTemplates(repo: Repository): Promise<void> {
440
+ const prTemplate = `## Descripción
441
+ <!-- Describe los cambios realizados -->
442
+
443
+ ## Tipo de cambio
444
+ - [ ] 🐛 Bug fix (cambio que corrige un issue)
445
+ - [ ] ✨ Nueva feature (cambio que agrega funcionalidad)
446
+ - [ ] 🔧 Refactoring (cambio que mejora el código sin cambiar funcionalidad)
447
+ - [ ] 📝 Documentación (cambio solo en documentación)
448
+ - [ ] ⚡ Performance (cambio que mejora el rendimiento)
449
+
450
+ ## ¿Cómo se ha probado?
451
+ <!-- Describe las pruebas que has realizado -->
452
+
453
+ ## Checklist
454
+ - [ ] Mi código sigue el style guide del proyecto
455
+ - [ ] He realizado una auto-revisión de mi código
456
+ - [ ] He comentado mi código, especialmente en áreas difíciles
457
+ - [ ] He actualizado la documentación correspondiente
458
+ - [ ] Mis cambios no generan nuevos warnings
459
+ - [ ] He agregado tests que prueban que mi fix es efectivo o que mi feature funciona
460
+ - [ ] Los tests unitarios pasan localmente
461
+ - [ ] Cualquier cambio dependiente ha sido mergeado y publicado
462
+
463
+ ## Screenshots (si aplica)
464
+ <!-- Agrega screenshots si es relevante -->
465
+
466
+ ## Issues relacionados
467
+ <!-- Linkea los issues que este PR resuelve -->
468
+ Closes #
469
+
470
+ ---
471
+ _Template generado por freelance-project-planner_
472
+ `;
473
+
474
+ await this.mcp.createOrUpdateFile(repo, {
475
+ path: '.github/PULL_REQUEST_TEMPLATE.md',
476
+ message: 'chore: add PR template',
477
+ content: prTemplate,
478
+ branch: 'main'
479
+ });
480
+
481
+ console.log(`📋 PR template configurado`);
482
+ }
483
+ }
484
+ ```
485
+
486
+ ### 2. Workflow Automatizado Completo
487
+
488
+ ### 2. Workflow Automatizado Completo
489
+ ```typescript
490
+ class FreelancePlannerOrchestrator {
491
+ private githubMCP: GitHubMCPIntegration;
492
+ private analyzer: ProjectAnalyzer;
493
+ private planner: IterationPlanner;
494
+
495
+ async executeFull(projectPath: string, options: PlannerOptions): Promise<ExecutionResult> {
496
+ console.log('🚀 Iniciando Freelance Project Planner con GitHub MCP...\n');
497
+
498
+ // FASE 1: Análisis
499
+ console.log('📊 FASE 1: Análisis del Proyecto');
500
+ const analysis = await this.analyzer.analyzeProject(projectPath);
501
+ this.printAnalysisSummary(analysis);
502
+
503
+ // FASE 2: Planificación
504
+ console.log('\n📋 FASE 2: Generación del Plan de Desarrollo');
505
+ const plan = await this.planner.createDevelopmentPlan(analysis);
506
+ this.printPlanSummary(plan);
507
+
508
+ // FASE 3: Setup en GitHub (si se especifica)
509
+ if (options.setupGitHub) {
510
+ console.log('\n🔗 FASE 3: Setup Automático en GitHub');
511
+ const githubSetup = await this.githubMCP.setupProjectInGitHub(analysis, plan);
512
+ this.printGitHubSetupSummary(githubSetup);
513
+
514
+ // FASE 4: Sync Issues con Kanban Board
515
+ console.log('\n🔄 FASE 4: Sincronización de Issues con Kanban');
516
+ await this.syncIssuesWithKanban(githubSetup, plan.kanbanBoard);
517
+ }
518
+
519
+ // FASE 5: Generación de Archivos Locales
520
+ console.log('\n📝 FASE 5: Generación de Documentación Local');
521
+ await this.generateLocalFiles(projectPath, plan);
522
+
523
+ console.log('\n✅ ¡Proceso Completado!\n');
524
+
525
+ return {
526
+ analysis,
527
+ plan,
528
+ githubSetup: options.setupGitHub ? githubSetup : null,
529
+ localFiles: await this.listGeneratedFiles(projectPath)
530
+ };
531
+ }
532
+
533
+ private async syncIssuesWithKanban(
534
+ githubSetup: GitHubSetup,
535
+ kanbanBoard: KanbanBoard
536
+ ): Promise<void> {
537
+ const project = githubSetup.project;
538
+
539
+ // Obtener columnas del proyecto
540
+ const columns = await this.githubMCP.listProjectColumns(project);
541
+ const backlogColumn = columns.find(c => c.name.includes('Backlog'));
542
+
543
+ // Agregar issues a la columna de Backlog
544
+ for (const issue of githubSetup.issues) {
545
+ await this.githubMCP.addIssueToProjectColumn(backlogColumn, issue);
546
+ console.log(`📌 Issue #${issue.number} agregado al tablero`);
547
+ }
548
+
549
+ console.log(`✅ ${githubSetup.issues.length} issues sincronizados con el tablero`);
550
+ }
551
+
552
+ private printGitHubSetupSummary(setup: GitHubSetup): void {
553
+ console.log(`
554
+ ✅ Repositorio: ${setup.repository.html_url}
555
+ 📊 Project Board: ${setup.project.html_url}
556
+ 📝 Issues creados: ${setup.issues.length}
557
+ ⚙️ Workflows configurados: ${setup.workflows.length}
558
+
559
+ 🔗 Links útiles:
560
+ - Kanban Board: ${setup.project.html_url}
561
+ - Issues: ${setup.repository.html_url}/issues
562
+ - Actions: ${setup.repository.html_url}/actions
563
+ - Pull Requests: ${setup.repository.html_url}/pulls
564
+ `);
565
+ }
566
+ }
567
+ ```
568
+
569
+ ### 3. Comandos CLI con GitHub MCP
570
+ ```bash
571
+ # Setup completo con GitHub
572
+ freelance-planner setup ./mi-proyecto \
573
+ --github \
574
+ --repo "mi-usuario/mi-proyecto" \
575
+ --create-issues \
576
+ --setup-ci
577
+
578
+ # Solo análisis y plan local
579
+ freelance-planner plan ./mi-proyecto
580
+
581
+ # Crear issues desde backlog existente
582
+ freelance-planner sync-issues ./mi-proyecto \
583
+ --github-repo "mi-usuario/mi-proyecto"
584
+
585
+ # Setup CI/CD en repositorio existente
586
+ freelance-planner setup-cicd ./mi-proyecto \
587
+ --github-repo "mi-usuario/mi-proyecto"
588
+
589
+ # Actualizar documentación en GitHub
590
+ freelance-planner update-docs ./mi-proyecto \
591
+ --github-repo "mi-usuario/mi-proyecto" \
592
+ --commit-message "docs: update project documentation"
593
+ ```
594
+
595
+ ### 4. Gestión de Iteraciones con GitHub MCP
596
+ ```typescript
597
+ class IterationManager {
598
+ async startIteration(
599
+ repo: Repository,
600
+ iteration: Iteration
601
+ ): Promise<void> {
602
+ // Crear milestone para la iteración
603
+ const milestone = await this.githubMCP.createMilestone(repo, {
604
+ title: `Iteración ${iteration.number}`,
605
+ description: iteration.description,
606
+ due_on: this.calculateDueDate(iteration.duration)
607
+ });
608
+
609
+ console.log(`📅 Milestone creado: ${milestone.title}`);
610
+
611
+ // Asignar issues a la iteración
612
+ for (const feature of iteration.features) {
613
+ const issue = await this.findIssueByTitle(repo, feature.title);
614
+ if (issue) {
615
+ await this.githubMCP.updateIssue(repo, issue.number, {
616
+ milestone: milestone.number,
617
+ labels: ['wip']
618
+ });
619
+ console.log(`📌 Issue #${issue.number} asignado a ${milestone.title}`);
620
+ }
621
+ }
622
+ }
623
+
624
+ async completeIteration(
625
+ repo: Repository,
626
+ iteration: Iteration
627
+ ): Promise<IterationReport> {
628
+ const milestone = await this.findMilestone(repo, iteration.number);
629
+
630
+ // Obtener métricas de la iteración
631
+ const issues = await this.githubMCP.listMilestoneIssues(repo, milestone);
632
+ const completedIssues = issues.filter(i => i.state === 'closed');
633
+ const velocity = completedIssues.length;
634
+
635
+ // Generar reporte
636
+ const report = {
637
+ iterationNumber: iteration.number,
638
+ plannedIssues: issues.length,
639
+ completedIssues: completedIssues.length,
640
+ velocity: velocity,
641
+ cycleTime: await this.calculateAverageCycleTime(completedIssues),
642
+ blockers: await this.identifyBlockers(issues)
643
+ };
644
+
645
+ // Crear issue con el reporte de retrospectiva
646
+ await this.githubMCP.createIssue(repo, {
647
+ title: `📊 Retrospectiva - Iteración ${iteration.number}`,
648
+ body: this.formatRetroReport(report),
649
+ labels: ['retrospective', 'documentation']
650
+ });
651
+
652
+ console.log(`📊 Reporte de iteración generado`);
653
+
654
+ return report;
655
+ }
656
+
657
+ private formatRetroReport(report: IterationReport): string {
658
+ return `
659
+ # Retrospectiva - Iteración ${report.iterationNumber}
660
+
661
+ ## Métricas
662
+ - **Issues Planificados**: ${report.plannedIssues}
663
+ - **Issues Completados**: ${report.completedIssues}
664
+ - **Velocidad**: ${report.velocity} issues
665
+ - **Tiempo de Ciclo Promedio**: ${report.cycleTime} días
666
+
667
+ ## Completitud
668
+ ${this.generateProgressBar(report.completedIssues / report.plannedIssues)}
669
+
670
+ ## ¿Qué salió bien? ✅
671
+ - [Agrega aquí lo que funcionó bien]
672
+
673
+ ## ¿Qué se puede mejorar? 🔄
674
+ - [Agrega aquí las áreas de mejora]
675
+
676
+ ## Bloqueadores Identificados
677
+ ${report.blockers.map(b => `- ${b}`).join('\n') || 'Ninguno'}
678
+
679
+ ## Acciones para la próxima iteración
680
+ - [ ] [Acción 1]
681
+ - [ ] [Acción 2]
682
+
683
+ ---
684
+ _Generado automáticamente por freelance-project-planner_
685
+ `;
686
+ }
687
+ }
688
+ ```
689
+
690
+ ### 5. Automatización de PR y Code Review
691
+ ```typescript
692
+ class PRAutomation {
693
+ async createFeaturePR(
694
+ repo: Repository,
695
+ feature: Feature,
696
+ branch: string
697
+ ): Promise<PullRequest> {
698
+ // Crear PR automáticamente
699
+ const pr = await this.githubMCP.createPullRequest(repo, {
700
+ title: `✨ ${feature.title}`,
701
+ body: this.generatePRBody(feature),
702
+ head: branch,
703
+ base: 'develop',
704
+ draft: false
705
+ });
706
+
707
+ // Auto-asignar labels
708
+ await this.githubMCP.addLabelsToIssue(repo, pr.number, [
709
+ 'feature',
710
+ feature.priority || 'P2'
711
+ ]);
712
+
713
+ // Linkear con issue original
714
+ if (feature.issueNumber) {
715
+ await this.githubMCP.addComment(repo, pr.number,
716
+ `Closes #${feature.issueNumber}`
717
+ );
718
+ }
719
+
720
+ console.log(`🔀 PR creado: #${pr.number} - ${pr.title}`);
721
+
722
+ return pr;
723
+ }
724
+
725
+ private generatePRBody(feature: Feature): string {
726
+ return `
727
+ ## 🎯 Objetivo
728
+ ${feature.description}
729
+
730
+ ## 💡 Implementación
731
+ ${feature.implementation || 'Ver commits para detalles'}
732
+
733
+ ## ✅ Testing
734
+ - [ ] Tests unitarios agregados/actualizados
735
+ - [ ] Tests de integración verificados
736
+ - [ ] Testing manual completado
737
+
738
+ ## 📸 Screenshots
739
+ <!-- Agregar si aplica -->
740
+
741
+ ## 📝 Notas
742
+ ${feature.notes || 'N/A'}
743
+
744
+ ## 🔗 Referencias
745
+ - Issue: #${feature.issueNumber}
746
+ - Documentación: [Agregar link si aplica]
747
+
748
+ ---
749
+ _PR generado automáticamente por freelance-project-planner_
750
+ `;
751
+ }
752
+
753
+ async setupAutoReview(repo: Repository): Promise<void> {
754
+ // Configurar auto-review con GitHub Actions
755
+ const reviewWorkflow = `
756
+ name: Auto Review
757
+
758
+ on:
759
+ pull_request:
760
+ types: [opened, synchronize]
761
+
762
+ jobs:
763
+ auto-review:
764
+ runs-on: ubuntu-latest
765
+ steps:
766
+ - uses: actions/checkout@v4
767
+
768
+ - name: Check PR size
769
+ run: |
770
+ CHANGES=$(git diff --shortstat origin/\${{ github.base_ref }}...HEAD | grep -oP '\d+(?= file)')
771
+ if [ \$CHANGES -gt 20 ]; then
772
+ echo "⚠️ PR muy grande (\$CHANGES archivos). Considera dividirlo."
773
+ fi
774
+
775
+ - name: Check commit messages
776
+ run: |
777
+ git log --format=%s origin/\${{ github.base_ref }}..HEAD | \
778
+ grep -E '^(feat|fix|docs|style|refactor|test|chore):' || \
779
+ echo "⚠️ Algunos commits no siguen conventional commits"
780
+
781
+ - name: Comment on PR
782
+ uses: actions/github-script@v7
783
+ with:
784
+ script: |
785
+ github.rest.issues.createComment({
786
+ issue_number: context.issue.number,
787
+ owner: context.repo.owner,
788
+ repo: context.repo.repo,
789
+ body: '✅ Auto-review completado. Revisa los logs de CI para detalles.'
790
+ })
791
+ `;
792
+
793
+ await this.githubMCP.createOrUpdateFile(repo, {
794
+ path: '.github/workflows/auto-review.yml',
795
+ message: 'chore: add auto-review workflow',
796
+ content: reviewWorkflow,
797
+ branch: 'main'
798
+ });
799
+
800
+ console.log(`🤖 Auto-review configurado`);
801
+ }
802
+ }
803
+ ```
804
+
805
+ ### 6. Dashboard y Métricas con GitHub API
806
+ ```typescript
807
+ class MetricsDashboard {
808
+ async generateProjectMetrics(repo: Repository): Promise<Metrics> {
809
+ // Obtener datos de GitHub
810
+ const [issues, pulls, commits, releases] = await Promise.all([
811
+ this.githubMCP.listIssues(repo, { state: 'all' }),
812
+ this.githubMCP.listPullRequests(repo, { state: 'all' }),
813
+ this.githubMCP.listCommits(repo),
814
+ this.githubMCP.listReleases(repo)
815
+ ]);
816
+
817
+ // Calcular métricas
818
+ const metrics = {
819
+ // Productividad
820
+ velocity: this.calculateVelocity(issues),
821
+ cycleTime: this.calculateCycleTime(issues),
822
+ leadTime: this.calculateLeadTime(issues),
823
+ throughput: this.calculateThroughput(issues),
824
+
825
+ // Calidad
826
+ bugRate: this.calculateBugRate(issues),
827
+ prMergeTime: this.calculatePRMergeTime(pulls),
828
+ codeChurnRate: this.calculateCodeChurn(commits),
829
+
830
+ // Estado del proyecto
831
+ openIssues: issues.filter(i => i.state === 'open').length,
832
+ closedIssues: issues.filter(i => i.state === 'closed').length,
833
+ activePRs: pulls.filter(p => p.state === 'open').length,
834
+
835
+ // Entregas
836
+ releases: releases.length,
837
+ lastRelease: releases[0]?.published_at,
838
+ deploymentFrequency: this.calculateDeploymentFrequency(releases)
839
+ };
840
+
841
+ // Crear issue con dashboard
842
+ await this.createDashboardIssue(repo, metrics);
843
+
844
+ return metrics;
845
+ }
846
+
847
+ private async createDashboardIssue(
848
+ repo: Repository,
849
+ metrics: Metrics
850
+ ): Promise<void> {
851
+ const body = `
852
+ # 📊 Dashboard de Métricas del Proyecto
853
+
854
+ **Última actualización**: ${new Date().toLocaleDateString()}
855
+
856
+ ## 🚀 Productividad
857
+ - **Velocidad**: ${metrics.velocity} issues/semana
858
+ - **Cycle Time**: ${metrics.cycleTime} días promedio
859
+ - **Lead Time**: ${metrics.leadTime} días promedio
860
+ - **Throughput**: ${metrics.throughput} issues/mes
861
+
862
+ ## ✅ Calidad
863
+ - **Bug Rate**: ${metrics.bugRate}%
864
+ - **PR Merge Time**: ${metrics.prMergeTime} horas promedio
865
+ - **Code Churn**: ${metrics.codeChurnRate}%
866
+
867
+ ## 📈 Estado del Proyecto
868
+ - **Issues Abiertos**: ${metrics.openIssues}
869
+ - **Issues Cerrados**: ${metrics.closedIssues}
870
+ - **PRs Activos**: ${metrics.activePRs}
871
+
872
+ ## 🎯 Entregas
873
+ - **Releases**: ${metrics.releases}
874
+ - **Último Release**: ${metrics.lastRelease || 'N/A'}
875
+ - **Frecuencia de Deploy**: ${metrics.deploymentFrequency}
876
+
877
+ ---
878
+ _Dashboard actualizado automáticamente cada semana_
879
+ `;
880
+
881
+ await this.githubMCP.createIssue(repo, {
882
+ title: '📊 Dashboard de Métricas - Semana ' + this.getWeekNumber(),
883
+ body: body,
884
+ labels: ['metrics', 'dashboard']
885
+ });
886
+
887
+ console.log(`📊 Dashboard de métricas creado`);
888
+ }
889
+ }
890
+ ```
891
+
892
+ ## Análisis de Proyecto
893
+ ```typescript
894
+ interface ProjectAnalysis {
895
+ // Arquitectura y Stack
896
+ techStack: TechStack;
897
+ architecture: ArchitecturePattern;
898
+ dependencies: DependencyAnalysis;
899
+ codeQuality: QualityMetrics;
900
+
901
+ // Estado del Proyecto
902
+ completionLevel: number; // 0-100%
903
+ codeHealth: HealthScore;
904
+ testCoverage: number;
905
+ documentation: DocumentationLevel;
906
+
907
+ // Deuda Técnica
908
+ technicalDebt: DebtAssessment;
909
+ securityIssues: SecurityAudit;
910
+ performanceBottlenecks: PerformanceAnalysis;
911
+
912
+ // Complejidad
913
+ businessLogicComplexity: ComplexityScore;
914
+ integrationPoints: IntegrationAnalysis;
915
+ scalabilityRequirements: ScalabilityAssessment;
916
+ }
917
+
918
+ async analyzeExistingProject(): Promise<ProjectAnalysis> {
919
+ const analysis = {
920
+ codebase: await this.scanCodebase(),
921
+ structure: await this.analyzeProjectStructure(),
922
+ quality: await this.assessCodeQuality(),
923
+ dependencies: await this.analyzeDependencies(),
924
+ tests: await this.evaluateTestSuite(),
925
+ documentation: await this.auditDocumentation(),
926
+ deployment: await this.analyzeDeploymentSetup(),
927
+ };
928
+
929
+ return this.generateInsights(analysis);
930
+ }
931
+ ```
932
+
933
+ ### 2. Detección de Patrones y Antipatrones
934
+ ```typescript
935
+ class CodePatternAnalyzer {
936
+ async detectPatterns(): Promise<PatternAnalysis> {
937
+ return {
938
+ architecturalPatterns: await this.identifyArchPatterns(),
939
+ designPatterns: await this.findDesignPatterns(),
940
+ antipatterns: await this.detectAntipatterns(),
941
+ codeSmells: await this.identifyCodeSmells(),
942
+ opportunities: await this.findRefactoringOpportunities(),
943
+ };
944
+ }
945
+
946
+ private async identifyArchPatterns(): Promise<ArchPattern[]> {
947
+ const patterns = [];
948
+
949
+ // MVC, MVP, MVVM detection
950
+ if (this.hasControllers() && this.hasModels() && this.hasViews()) {
951
+ patterns.push({ type: 'MVC', confidence: 0.9 });
952
+ }
953
+
954
+ // Microservices vs Monolith
955
+ if (this.hasMultipleServices()) {
956
+ patterns.push({ type: 'Microservices', confidence: 0.8 });
957
+ }
958
+
959
+ // API patterns (REST, GraphQL, gRPC)
960
+ patterns.push(...await this.detectAPIPatterns());
961
+
962
+ return patterns;
963
+ }
964
+ }
965
+ ```
966
+
967
+ ## Estrategia de Planificación
968
+
969
+ ### 1. Generación de Épicas y Features
970
+ ```typescript
971
+ class IterationPlanner {
972
+ async createDevelopmentPlan(project: ProjectAnalysis): Promise<DevelopmentPlan> {
973
+ const plan = {
974
+ // Fase 1: Estabilización y Setup
975
+ stabilization: await this.planStabilizationPhase(project),
976
+
977
+ // Fase 2: Desarrollo Iterativo
978
+ iterations: await this.planDevelopmentIterations(project),
979
+
980
+ // Fase 3: Optimización y Entrega
981
+ optimization: await this.planOptimizationPhase(project),
982
+
983
+ // Configuración Técnica
984
+ technicalSetup: await this.planTechnicalInfrastructure(project),
985
+ };
986
+
987
+ return this.optimizeForFreelancer(plan);
988
+ }
989
+
990
+ private async planStabilizationPhase(project: ProjectAnalysis): Promise<Phase> {
991
+ const tasks = [];
992
+
993
+ // Crítico: Setup de desarrollo
994
+ if (!project.hasDevEnvironment) {
995
+ tasks.push({
996
+ title: "Setup Entorno de Desarrollo",
997
+ priority: "P0",
998
+ estimate: "4h",
999
+ type: "setup",
1000
+ description: "Configurar entorno local, variables de entorno, base de datos",
1001
+ acceptanceCriteria: ["Proyecto ejecuta localmente", "Tests pasan", "Documentación actualizada"]
1002
+ });
1003
+ }
1004
+
1005
+ // Crítico: CI/CD básico
1006
+ if (!project.hasCI) {
1007
+ tasks.push({
1008
+ title: "Setup CI/CD Pipeline",
1009
+ priority: "P0",
1010
+ estimate: "6h",
1011
+ type: "infrastructure",
1012
+ description: "GitHub Actions para tests automáticos y deployment",
1013
+ acceptanceCriteria: ["Tests ejecutan en PR", "Deploy automático a staging"]
1014
+ });
1015
+ }
1016
+
1017
+ // Refactorización urgente
1018
+ if (project.technicalDebt.critical.length > 0) {
1019
+ tasks.push({
1020
+ title: "Refactoring Crítico",
1021
+ priority: "P1",
1022
+ estimate: "8h",
1023
+ type: "refactoring",
1024
+ description: `Resolver: ${project.technicalDebt.critical.join(', ')}`,
1025
+ acceptanceCriteria: ["Código más mantenible", "Tests adicionales", "Performance mejorada"]
1026
+ });
1027
+ }
1028
+
1029
+ return { name: "Estabilización", tasks, duration: "1-2 semanas" };
1030
+ }
1031
+
1032
+ private async planDevelopmentIterations(project: ProjectAnalysis): Promise<Iteration[]> {
1033
+ const features = await this.extractPendingFeatures(project);
1034
+ const iterations = [];
1035
+
1036
+ // Agrupar features por valor de negocio y complejidad
1037
+ const prioritizedFeatures = this.prioritizeFeatures(features);
1038
+
1039
+ let currentIteration = 1;
1040
+ for (const featureGroup of this.groupFeaturesByIteration(prioritizedFeatures)) {
1041
+ iterations.push({
1042
+ number: currentIteration++,
1043
+ duration: "1-2 semanas",
1044
+ features: featureGroup,
1045
+ deliverables: this.generateDeliverables(featureGroup),
1046
+ demoGoals: this.generateDemoGoals(featureGroup),
1047
+ technicalTasks: this.generateTechnicalTasks(featureGroup),
1048
+ });
1049
+ }
1050
+
1051
+ return iterations;
1052
+ }
1053
+ }
1054
+ ```
1055
+
1056
+ ### 2. Tablero Kanban Inteligente
1057
+ ```typescript
1058
+ interface KanbanBoard {
1059
+ columns: {
1060
+ backlog: Task[];
1061
+ ready: Task[];
1062
+ inProgress: Task[]; // WIP: máx 2
1063
+ review: Task[];
1064
+ done: Task[];
1065
+ };
1066
+ wipLimits: WIPLimits;
1067
+ priorityLanes: PriorityLane[];
1068
+ clientTags: ClientTag[];
1069
+ }
1070
+
1071
+ class SmartKanbanGenerator {
1072
+ async generateBoard(project: ProjectAnalysis): Promise<KanbanBoard> {
1073
+ return {
1074
+ columns: {
1075
+ backlog: await this.generateBacklog(project),
1076
+ ready: await this.generateReadyTasks(project),
1077
+ inProgress: [],
1078
+ review: [],
1079
+ done: []
1080
+ },
1081
+ wipLimits: {
1082
+ ready: 5,
1083
+ inProgress: 2, // Crítico para freelancer
1084
+ review: 3
1085
+ },
1086
+ priorityLanes: [
1087
+ { name: "🔥 Crítico", color: "red" },
1088
+ { name: "⚡ Alta", color: "orange" },
1089
+ { name: "📝 Normal", color: "blue" },
1090
+ { name: "🔧 Técnico", color: "gray" }
1091
+ ],
1092
+ clientTags: this.generateClientTags(project)
1093
+ };
1094
+ }
1095
+
1096
+ private async generateBacklog(project: ProjectAnalysis): Promise<Task[]> {
1097
+ const tasks = [];
1098
+
1099
+ // Features pendientes detectadas
1100
+ for (const feature of project.pendingFeatures) {
1101
+ tasks.push({
1102
+ id: `FEAT-${feature.id}`,
1103
+ title: feature.name,
1104
+ description: feature.description,
1105
+ priority: this.calculatePriority(feature),
1106
+ estimate: this.estimateEffort(feature),
1107
+ type: "feature",
1108
+ tags: ["development"],
1109
+ acceptanceCriteria: feature.acceptanceCriteria,
1110
+ technicalNotes: feature.technicalConsiderations
1111
+ });
1112
+ }
1113
+
1114
+ // Bugs críticos
1115
+ for (const bug of project.criticalBugs) {
1116
+ tasks.push({
1117
+ id: `BUG-${bug.id}`,
1118
+ title: `🐛 Fix: ${bug.summary}`,
1119
+ description: bug.description,
1120
+ priority: "P0",
1121
+ estimate: this.estimateBugFix(bug),
1122
+ type: "bugfix",
1123
+ tags: ["bug", "critical"],
1124
+ reproductionSteps: bug.steps,
1125
+ affectedAreas: bug.modules
1126
+ });
1127
+ }
1128
+
1129
+ // Deuda técnica
1130
+ for (const debt of project.technicalDebt.high) {
1131
+ tasks.push({
1132
+ id: `TECH-${debt.id}`,
1133
+ title: `🔧 Refactor: ${debt.area}`,
1134
+ description: debt.description,
1135
+ priority: "P2",
1136
+ estimate: debt.estimatedEffort,
1137
+ type: "technical",
1138
+ tags: ["refactoring", "debt"],
1139
+ benefits: debt.benefits,
1140
+ risks: debt.risks
1141
+ });
1142
+ }
1143
+
1144
+ return tasks;
1145
+ }
1146
+ }
1147
+ ```
1148
+
1149
+ ## Prácticas XP Adaptadas
1150
+
1151
+ ### 1. TDD Selectivo y Pragmático
1152
+ ```typescript
1153
+ class TestingStrategy {
1154
+ async generateTestingPlan(project: ProjectAnalysis): Promise<TestingPlan> {
1155
+ return {
1156
+ // TDD solo en áreas críticas
1157
+ tddAreas: this.identifyCriticalAreas(project),
1158
+
1159
+ // Testing pyramid adaptado
1160
+ testLevels: {
1161
+ unit: this.planUnitTests(project),
1162
+ integration: this.planIntegrationTests(project),
1163
+ e2e: this.planE2ETests(project)
1164
+ },
1165
+
1166
+ // Herramientas recomendadas
1167
+ tools: this.recommendTestingTools(project.techStack),
1168
+
1169
+ // Estrategia de cobertura
1170
+ coverageGoals: this.defineCoverageGoals(project.criticality)
1171
+ };
1172
+ }
1173
+
1174
+ private identifyCriticalAreas(project: ProjectAnalysis): string[] {
1175
+ const critical = [];
1176
+
1177
+ // Lógica de negocio core
1178
+ if (project.hasPaymentSystem) critical.push("payment-processing");
1179
+ if (project.hasAuthentication) critical.push("auth-system");
1180
+ if (project.hasDataValidation) critical.push("data-validation");
1181
+
1182
+ // APIs públicas
1183
+ critical.push(...project.publicApis);
1184
+
1185
+ // Áreas con bugs frecuentes
1186
+ critical.push(...project.bugProneAreas);
1187
+
1188
+ return critical;
1189
+ }
1190
+ }
1191
+ ```
1192
+
1193
+ ### 2. CI/CD Optimizado para Freelance
1194
+ ```yaml
1195
+ # .github/workflows/freelance-ci.yml
1196
+ name: Freelance Development Pipeline
1197
+
1198
+ on:
1199
+ push:
1200
+ branches: [main, develop]
1201
+ pull_request:
1202
+ branches: [main]
1203
+
1204
+ jobs:
1205
+ # Tests rápidos para feedback inmediato
1206
+ quick-tests:
1207
+ runs-on: ubuntu-latest
1208
+ steps:
1209
+ - uses: actions/checkout@v3
1210
+ - name: Setup Node
1211
+ uses: actions/setup-node@v3
1212
+ with:
1213
+ node-version: '18'
1214
+ cache: 'npm'
1215
+
1216
+ - name: Install dependencies
1217
+ run: npm ci
1218
+
1219
+ - name: Lint & Format Check
1220
+ run: |
1221
+ npm run lint
1222
+ npm run format:check
1223
+
1224
+ - name: Unit Tests
1225
+ run: npm run test:unit
1226
+
1227
+ - name: Type Check
1228
+ run: npm run type-check
1229
+
1230
+ # Tests completos solo en main
1231
+ full-tests:
1232
+ runs-on: ubuntu-latest
1233
+ if: github.ref == 'refs/heads/main'
1234
+ needs: quick-tests
1235
+ steps:
1236
+ - uses: actions/checkout@v3
1237
+ - name: Setup Node
1238
+ uses: actions/setup-node@v3
1239
+ with:
1240
+ node-version: '18'
1241
+ cache: 'npm'
1242
+
1243
+ - name: Install dependencies
1244
+ run: npm ci
1245
+
1246
+ - name: Integration Tests
1247
+ run: npm run test:integration
1248
+
1249
+ - name: E2E Tests
1250
+ run: npm run test:e2e
1251
+
1252
+ - name: Security Audit
1253
+ run: npm audit --audit-level=high
1254
+
1255
+ # Deploy automático a staging
1256
+ deploy-staging:
1257
+ runs-on: ubuntu-latest
1258
+ if: github.ref == 'refs/heads/develop'
1259
+ needs: quick-tests
1260
+ steps:
1261
+ - uses: actions/checkout@v3
1262
+ - name: Deploy to Staging
1263
+ run: |
1264
+ npm run build
1265
+ npm run deploy:staging
1266
+
1267
+ - name: Smoke Tests
1268
+ run: npm run test:smoke -- --env staging
1269
+ ```
1270
+
1271
+ ### 3. Refactorización Continua Planificada
1272
+ ```typescript
1273
+ class RefactoringPlanner {
1274
+ async planRefactoringTasks(project: ProjectAnalysis): Promise<RefactoringPlan> {
1275
+ const tasks = [];
1276
+
1277
+ // Refactoring por complejidad
1278
+ for (const module of project.complexModules) {
1279
+ if (module.cyclomaticComplexity > 10) {
1280
+ tasks.push({
1281
+ title: `Simplificar ${module.name}`,
1282
+ priority: this.calculateRefactoringPriority(module),
1283
+ estimate: `${Math.ceil(module.cyclomaticComplexity / 3)}h`,
1284
+ benefits: ["Mejor mantenibilidad", "Menos bugs", "Más testeable"],
1285
+ approach: this.suggestRefactoringApproach(module)
1286
+ });
1287
+ }
1288
+ }
1289
+
1290
+ // Refactoring por duplicación
1291
+ for (const duplication of project.codeDuplications) {
1292
+ if (duplication.similarity > 0.8) {
1293
+ tasks.push({
1294
+ title: `Extraer componente común: ${duplication.pattern}`,
1295
+ priority: "P2",
1296
+ estimate: "3h",
1297
+ benefits: ["DRY principle", "Menos código", "Consistencia"],
1298
+ files: duplication.affectedFiles
1299
+ });
1300
+ }
1301
+ }
1302
+
1303
+ return { tasks, schedule: this.scheduleRefactoring(tasks) };
1304
+ }
1305
+ }
1306
+ ```
1307
+
1308
+ ## Generación de Entregables
1309
+
1310
+ ### 1. Plan de Proyecto Completo
1311
+ ```typescript
1312
+ async generateProjectPlan(projectPath: string): Promise<ProjectPlan> {
1313
+ const analysis = await this.analyzeProject(projectPath);
1314
+ const plan = await this.createDevelopmentPlan(analysis);
1315
+
1316
+ return {
1317
+ // Resumen ejecutivo
1318
+ summary: {
1319
+ projectName: analysis.name,
1320
+ currentState: analysis.completionLevel,
1321
+ estimatedCompletion: plan.totalDuration,
1322
+ keyRisks: analysis.risks,
1323
+ recommendations: plan.recommendations
1324
+ },
1325
+
1326
+ // Roadmap visual
1327
+ roadmap: this.generateRoadmap(plan),
1328
+
1329
+ // Tablero Kanban
1330
+ kanbanBoard: await this.generateBoard(analysis),
1331
+
1332
+ // Setup técnico
1333
+ technicalSetup: plan.technicalSetup,
1334
+
1335
+ // Métricas y KPIs
1336
+ metrics: this.defineMetrics(plan),
1337
+
1338
+ // Entregables por iteración
1339
+ deliverables: plan.deliverables
1340
+ };
1341
+ }
1342
+ ```
1343
+
1344
+ ### 2. Documentación de Iteraciones
1345
+ ```markdown
1346
+ # 🚀 Plan de Desarrollo - ${PROJECT_NAME}
1347
+
1348
+ ## 📊 Análisis Inicial
1349
+
1350
+ ### Estado Actual
1351
+ - **Completitud**: ${analysis.completionLevel}%
1352
+ - **Calidad del Código**: ${analysis.codeQuality}/10
1353
+ - **Cobertura de Tests**: ${analysis.testCoverage}%
1354
+ - **Deuda Técnica**: ${analysis.technicalDebt.level}
1355
+
1356
+ ### Stack Tecnológico Detectado
1357
+ ${this.formatTechStack(analysis.techStack)}
1358
+
1359
+ ### Arquitectura Identificada
1360
+ ${this.formatArchitecture(analysis.architecture)}
1361
+
1362
+ ## 🎯 Estrategia de Desarrollo
1363
+
1364
+ ### Metodología: Kanban Light + XP Adaptado
1365
+ - **Gestión**: Kanban con WIP limitado (máx 2 tareas activas)
1366
+ - **Calidad**: TDD selectivo, CI/CD, refactorización continua
1367
+ - **Entrega**: Demos semanales, feedback rápido
1368
+ - **Overhead**: Mínimo, foco en desarrollo
1369
+
1370
+ ### Fases del Proyecto
1371
+
1372
+ #### Fase 1: Estabilización (${stabilization.duration})
1373
+ ${this.formatPhase(stabilization)}
1374
+
1375
+ #### Fase 2: Desarrollo Iterativo (${development.duration})
1376
+ ${this.formatIterations(development.iterations)}
1377
+
1378
+ #### Fase 3: Optimización y Entrega (${optimization.duration})
1379
+ ${this.formatPhase(optimization)}
1380
+
1381
+ ## 📋 Tablero Kanban
1382
+
1383
+ ### Configuración
1384
+ - **WIP Límites**: Ready (5), En Progreso (2), Review (3)
1385
+ - **Carriles de Prioridad**: 🔥 Crítico, ⚡ Alta, 📝 Normal, 🔧 Técnico
1386
+
1387
+ ### Backlog Inicial
1388
+ ${this.formatBacklog(kanbanBoard.backlog)}
1389
+
1390
+ ## 🔧 Setup Técnico
1391
+
1392
+ ### Entorno de Desarrollo
1393
+ \`\`\`bash
1394
+ ${technicalSetup.devEnvironment.commands.join('\n')}
1395
+ \`\`\`
1396
+
1397
+ ### CI/CD Pipeline
1398
+ ${this.formatCIPipeline(technicalSetup.cicd)}
1399
+
1400
+ ### Testing Strategy
1401
+ - **TDD Areas**: ${testingPlan.tddAreas.join(', ')}
1402
+ - **Coverage Goal**: ${testingPlan.coverageGoals.minimum}%
1403
+ - **Tools**: ${testingPlan.tools.join(', ')}
1404
+
1405
+ ## 📈 Métricas y KPIs
1406
+
1407
+ ### Productividad
1408
+ - **Velocidad**: ${metrics.velocity} tareas/semana
1409
+ - **Tiempo de Ciclo**: ${metrics.cycleTime} días promedio
1410
+ - **Lead Time**: ${metrics.leadTime} días promedio
1411
+
1412
+ ### Calidad
1413
+ - **Bug Rate**: < ${metrics.bugRate} bugs/feature
1414
+ - **Test Coverage**: > ${metrics.testCoverage}%
1415
+ - **Code Quality**: > ${metrics.codeQuality}/10
1416
+
1417
+ ## 📅 Cronograma de Entregables
1418
+
1419
+ ${this.formatDeliverableSchedule(deliverables)}
1420
+
1421
+ ## 🎪 Plan de Demos
1422
+
1423
+ ### Frecuencia: Semanal (viernes 4pm)
1424
+ ### Formato: 15-20 minutos
1425
+ - 5 min: Qué se completó
1426
+ - 10 min: Demo de funcionalidad
1427
+ - 5 min: Próximos pasos y feedback
1428
+
1429
+ ${this.formatDemoPlans(plan.demos)}
1430
+
1431
+ ## 🚨 Gestión de Riesgos
1432
+
1433
+ ### Riesgos Identificados
1434
+ ${this.formatRisks(analysis.risks)}
1435
+
1436
+ ### Plan de Contingencia
1437
+ ${this.formatContingencyPlan(plan.contingency)}
1438
+
1439
+ ## 🔄 Rutina Semanal Recomendada
1440
+
1441
+ ### Lunes: Planificación
1442
+ - Review del backlog
1443
+ - Priorización de tareas
1444
+ - Setup del entorno si es necesario
1445
+
1446
+ ### Martes-Jueves: Desarrollo
1447
+ - Foco en implementación
1448
+ - TDD en áreas críticas
1449
+ - Commits frecuentes
1450
+
1451
+ ### Viernes: Review y Demo
1452
+ - Code review personal
1453
+ - Demo al cliente
1454
+ - Retrospectiva y ajustes
1455
+
1456
+ ### Herramientas Recomendadas
1457
+ - **Kanban**: ${tools.kanban}
1458
+ - **Time Tracking**: ${tools.timeTracking}
1459
+ - **Communication**: ${tools.communication}
1460
+ ```
1461
+
1462
+ ## Automatización y Herramientas
1463
+
1464
+ ### 1. Generación de Templates
1465
+ ```typescript
1466
+ class TemplateGenerator {
1467
+ async generateProjectTemplates(analysis: ProjectAnalysis): Promise<Templates> {
1468
+ return {
1469
+ // README optimizado
1470
+ readme: await this.generateREADME(analysis),
1471
+
1472
+ // GitHub templates
1473
+ github: {
1474
+ pullRequest: this.generatePRTemplate(),
1475
+ issueTemplates: this.generateIssueTemplates(),
1476
+ workflows: this.generateWorkflows(analysis.techStack)
1477
+ },
1478
+
1479
+ // Development setup
1480
+ development: {
1481
+ envExample: this.generateEnvExample(analysis),
1482
+ dockerfiles: this.generateDockerfiles(analysis),
1483
+ scripts: this.generateDevelopmentScripts(analysis)
1484
+ },
1485
+
1486
+ // Testing setup
1487
+ testing: {
1488
+ jestConfig: this.generateJestConfig(analysis),
1489
+ testingUtils: this.generateTestingUtils(analysis),
1490
+ mockData: this.generateMockData(analysis)
1491
+ }
1492
+ };
1493
+ }
1494
+ }
1495
+ ```
1496
+
1497
+ ### 2. Integración con Herramientas Freelance
1498
+ ```typescript
1499
+ interface FreelanceToolIntegration {
1500
+ // Time tracking
1501
+ toggl?: TogglIntegration;
1502
+ harvest?: HarvestIntegration;
1503
+
1504
+ // Project management
1505
+ notion?: NotionIntegration;
1506
+ trello?: TrelloIntegration;
1507
+
1508
+ // Communication
1509
+ slack?: SlackIntegration;
1510
+ discord?: DiscordIntegration;
1511
+
1512
+ // Invoicing
1513
+ freshbooks?: FreshbooksIntegration;
1514
+ stripe?: StripeIntegration;
1515
+ }
1516
+
1517
+ class FreelanceWorkflowOptimizer {
1518
+ async optimizeForFreelancer(plan: ProjectPlan): Promise<OptimizedPlan> {
1519
+ return {
1520
+ ...plan,
1521
+
1522
+ // Adjust for solo work
1523
+ taskSizing: this.optimizeTaskSizes(plan.tasks),
1524
+
1525
+ // Buffer for client requests
1526
+ bufferTime: this.calculateBufferTime(plan.duration),
1527
+
1528
+ // Client communication points
1529
+ communicationPlan: this.generateCommunicationPlan(plan),
1530
+
1531
+ // Invoice milestones
1532
+ billingMilestones: this.generateBillingMilestones(plan)
1533
+ };
1534
+ }
1535
+ }
1536
+ ```
1537
+
1538
+ ## Interfaz de Comando
1539
+
1540
+ ## Interfaz de Comando con GitHub MCP
1541
+
1542
+ ### Comandos Principales
1543
+
1544
+ ```bash
1545
+ # 🚀 Setup completo: Análisis + Plan + GitHub
1546
+ freelance-planner full-setup ./mi-proyecto \
1547
+ --github-repo "usuario/proyecto" \
1548
+ --create-repo # Crear repo si no existe
1549
+ --create-issues # Crear issues desde backlog
1550
+ --setup-ci # Configurar GitHub Actions
1551
+ --setup-project # Crear GitHub Project (Kanban)
1552
+ --commit-docs # Commitear documentación generada
1553
+
1554
+ # 📊 Solo análisis y planificación (sin GitHub)
1555
+ freelance-planner analyze ./mi-proyecto
1556
+
1557
+ # 🔗 Conectar proyecto existente con GitHub
1558
+ freelance-planner connect ./mi-proyecto \
1559
+ --github-repo "usuario/proyecto"
1560
+
1561
+ # 📝 Crear issues desde backlog planificado
1562
+ freelance-planner create-issues ./mi-proyecto \
1563
+ --github-repo "usuario/proyecto" \
1564
+ --from-file backlog.json
1565
+
1566
+ # ⚙️ Setup solo CI/CD
1567
+ freelance-planner setup-ci ./mi-proyecto \
1568
+ --github-repo "usuario/proyecto" \
1569
+ --tech-stack auto # Auto-detectar stack
1570
+
1571
+ # 🎯 Iniciar nueva iteración
1572
+ freelance-planner start-iteration ./mi-proyecto \
1573
+ --iteration 2 \
1574
+ --github-repo "usuario/proyecto"
1575
+
1576
+ # 📊 Generar reporte de iteración
1577
+ freelance-planner iteration-report ./mi-proyecto \
1578
+ --iteration 1 \
1579
+ --github-repo "usuario/proyecto"
1580
+
1581
+ # 📈 Ver métricas del proyecto
1582
+ freelance-planner metrics ./mi-proyecto \
1583
+ --github-repo "usuario/proyecto" \
1584
+ --create-dashboard # Crear issue con dashboard
1585
+
1586
+ # 🔄 Sincronizar cambios locales con GitHub
1587
+ freelance-planner sync ./mi-proyecto \
1588
+ --github-repo "usuario/proyecto" \
1589
+ --update-issues # Actualizar issues
1590
+ --update-docs # Actualizar documentación
1591
+ --update-board # Actualizar tablero Kanban
1592
+ ```
1593
+
1594
+ ### Flujo de Trabajo Completo
1595
+
1596
+ #### 1️⃣ Primera Vez - Setup Completo
1597
+ ```bash
1598
+ # Analizar proyecto y crear todo en GitHub
1599
+ cd mi-proyecto-existente
1600
+
1601
+ freelance-planner full-setup . \
1602
+ --github-repo "mi-usuario/mi-proyecto" \
1603
+ --create-repo \
1604
+ --create-issues \
1605
+ --setup-ci \
1606
+ --setup-project \
1607
+ --commit-docs
1608
+
1609
+ # Output esperado:
1610
+ # ✅ Repositorio creado: https://github.com/mi-usuario/mi-proyecto
1611
+ # ✅ 24 issues creados desde backlog
1612
+ # ✅ GitHub Project configurado con 5 columnas
1613
+ # ✅ CI/CD workflows creados (ci.yml, deploy.yml)
1614
+ # ✅ Documentación commiteada (README, CONTRIBUTING, docs/)
1615
+ # ✅ Labels y milestones configurados
1616
+ ```
1617
+
1618
+ #### 2️⃣ Día a Día - Gestión de Tareas
1619
+ ```bash
1620
+ # Ver estado del proyecto
1621
+ freelance-planner status . \
1622
+ --github-repo "mi-usuario/mi-proyecto"
1623
+
1624
+ # Output:
1625
+ # 📊 Estado del Proyecto
1626
+ # - WIP: 2/2 (límite alcanzado)
1627
+ # - Ready: 3 tareas
1628
+ # - Review: 1 tarea
1629
+ # - Done esta semana: 5 tareas
1630
+ #
1631
+ # 🔥 Próximas tareas prioritarias:
1632
+ # 1. #12 - Implementar checkout con PayPal
1633
+ # 2. #15 - Fix bug en validación de formularios
1634
+ # 3. #18 - Refactor módulo de autenticación
1635
+ ```
1636
+
1637
+ #### 3️⃣ Completar Feature - Crear PR
1638
+ ```bash
1639
+ # Crear PR automáticamente para una feature
1640
+ freelance-planner create-pr . \
1641
+ --issue 12 \
1642
+ --branch "feature/paypal-checkout" \
1643
+ --github-repo "mi-usuario/mi-proyecto"
1644
+
1645
+ # Output:
1646
+ # ✅ PR creado: #25 - Implementar checkout con PayPal
1647
+ # 🔗 https://github.com/mi-usuario/mi-proyecto/pull/25
1648
+ # 📌 Linkeado con issue #12
1649
+ # 🏷️ Labels aplicados: feature, P1
1650
+ ```
1651
+
1652
+ #### 4️⃣ Fin de Iteración - Reporte
1653
+ ```bash
1654
+ # Generar reporte de retrospectiva
1655
+ freelance-planner iteration-report . \
1656
+ --iteration 1 \
1657
+ --github-repo "mi-usuario/mi-proyecto"
1658
+
1659
+ # Output:
1660
+ # 📊 Reporte de Iteración 1 generado
1661
+ # - Velocidad: 8 issues completados
1662
+ # - Cycle time: 3.5 días promedio
1663
+ # - Issue #45 creado con retrospectiva
1664
+ # 🔗 https://github.com/mi-usuario/mi-proyecto/issues/45
1665
+ ```
1666
+
1667
+ ### Salida Esperada del Setup Completo
1668
+ ### Salida Esperada del Setup Completo
1669
+
1670
+ ```
1671
+ 🚀 Freelance Project Planner v1.0
1672
+ =====================================
1673
+
1674
+ 📊 FASE 1: Análisis del Proyecto
1675
+ ---------------------------------
1676
+ ✅ Proyecto detectado: mi-ecommerce-app
1677
+ ✅ Tech Stack: React + Node.js + PostgreSQL
1678
+ ✅ Arquitectura: REST API + SPA
1679
+ ✅ Completitud: 45%
1680
+ ✅ Deuda técnica: Media (12 áreas identificadas)
1681
+ ✅ Tests: 23% coverage (necesita mejora)
1682
+
1683
+ 📋 FASE 2: Generación del Plan
1684
+ ---------------------------------
1685
+ ✅ 3 fases planificadas:
1686
+ - Estabilización: 1-2 semanas
1687
+ - Desarrollo: 6-8 semanas (4 iteraciones)
1688
+ - Optimización: 1 semana
1689
+ ✅ 24 tareas identificadas en backlog
1690
+ ✅ Tablero Kanban generado con WIP límites
1691
+ ✅ 8 áreas críticas para TDD identificadas
1692
+
1693
+ 🔗 FASE 3: Setup en GitHub
1694
+ ---------------------------------
1695
+ ✅ Repositorio creado: https://github.com/usuario/mi-ecommerce-app
1696
+ ✅ Ramas configuradas: main, develop, staging
1697
+ ✅ Branch protection habilitado en main
1698
+ ✅ Labels creados: 11 labels (feature, bugfix, P0-P3, etc.)
1699
+
1700
+ 📝 Issues Creados (24 total):
1701
+ ---------------------------------
1702
+ #1 🔧 Setup Entorno de Desarrollo [P0]
1703
+ #2 ⚙️ Setup CI/CD Pipeline [P0]
1704
+ #3 🔧 Refactoring Crítico - Módulo Auth [P1]
1705
+ #4 ✨ Implementar checkout con PayPal [P1]
1706
+ #5 ✨ Sistema de cupones de descuento [P2]
1707
+ ...
1708
+ #24 📝 Actualizar documentación API [P3]
1709
+
1710
+ 📊 GitHub Project Creado:
1711
+ ---------------------------------
1712
+ ✅ Tablero: mi-ecommerce-app - Development Board
1713
+ - 📋 Backlog (24 issues)
1714
+ - ✅ Ready (0 issues)
1715
+ - 🔨 In Progress (WIP: 2) (0 issues)
1716
+ - 👀 Review (0 issues)
1717
+ - ✅ Done (0 issues)
1718
+
1719
+ 🔗 https://github.com/usuario/mi-ecommerce-app/projects/1
1720
+
1721
+ ⚙️ Workflows Configurados (3):
1722
+ ---------------------------------
1723
+ ✅ ci.yml - Tests, lint, build en cada PR
1724
+ ✅ deploy.yml - Deploy automático a staging
1725
+ ✅ dependabot-auto-merge.yml - Auto-merge de dependencias
1726
+
1727
+ 📄 Documentación Commiteada:
1728
+ ---------------------------------
1729
+ ✅ README.md - Setup y guía rápida
1730
+ ✅ CONTRIBUTING.md - Workflow de desarrollo
1731
+ ✅ docs/ARCHITECTURE.md - Documentación técnica
1732
+ ✅ docs/SETUP.md - Guía de instalación detallada
1733
+ ✅ docs/DEPLOYMENT.md - Guía de deployment
1734
+ ✅ .github/PULL_REQUEST_TEMPLATE.md - Template de PRs
1735
+
1736
+ 🎯 Milestones Creados:
1737
+ ---------------------------------
1738
+ ✅ Iteración 1 (Due: 21 Oct 2025) - 6 issues
1739
+ ✅ Iteración 2 (Due: 4 Nov 2025) - 6 issues
1740
+ ✅ Iteración 3 (Due: 18 Nov 2025) - 6 issues
1741
+ ✅ Iteración 4 (Due: 2 Dec 2025) - 6 issues
1742
+
1743
+ 📁 Archivos Locales Generados:
1744
+ ---------------------------------
1745
+ ✅ .freelance-planner/
1746
+ ├── project-analysis.json
1747
+ ├── development-plan.json
1748
+ ├── kanban-board.json
1749
+ └── metrics-config.json
1750
+ ✅ docs/
1751
+ ├── ITERATIONS.md
1752
+ ├── TESTING_STRATEGY.md
1753
+ └── REFACTORING_PLAN.md
1754
+
1755
+ =====================================
1756
+ ✅ ¡Setup Completado!
1757
+
1758
+ 🔗 Links Importantes:
1759
+ - Repository: https://github.com/usuario/mi-ecommerce-app
1760
+ - Kanban Board: https://github.com/usuario/mi-ecommerce-app/projects/1
1761
+ - Issues: https://github.com/usuario/mi-ecommerce-app/issues
1762
+ - Actions: https://github.com/usuario/mi-ecommerce-app/actions
1763
+
1764
+ 📝 Próximos Pasos:
1765
+ 1. Revisa el tablero Kanban y prioriza tareas
1766
+ 2. Configura los secrets de GitHub (DEPLOY_TOKEN, CODECOV_TOKEN)
1767
+ 3. Mueve una tarea de "Backlog" a "Ready"
1768
+ 4. ¡Comienza a desarrollar! (máximo 2 tareas WIP)
1769
+ 5. Demo con cliente el viernes
1770
+
1771
+ 🎯 Recuerda:
1772
+ - WIP límite: 2 tareas máximo
1773
+ - Demo semanal: Viernes 4pm
1774
+ - Commits: Conventional commits (feat:, fix:, etc.)
1775
+ - Tests: TDD en áreas críticas
1776
+ - Refactoring: Viernes después de demo
1777
+
1778
+ =====================================
1779
+ ```
1780
+
1781
+ ### Integración con Editors y IDEs
1782
+
1783
+ #### VS Code Extension (Conceptual)
1784
+ ```json
1785
+ {
1786
+ "freelance-planner.github": {
1787
+ "enabled": true,
1788
+ "repo": "usuario/mi-proyecto",
1789
+ "autoSync": true,
1790
+ "syncInterval": 300,
1791
+ "showInStatusBar": true
1792
+ },
1793
+ "freelance-planner.notifications": {
1794
+ "newIssues": true,
1795
+ "prReviews": true,
1796
+ "ciFailures": true
1797
+ }
1798
+ }
1799
+ ```
1800
+
1801
+ ### Webhooks y Automatización Avanzada
1802
+
1803
+ ```typescript
1804
+ class WebhookAutomation {
1805
+ async setupProjectWebhooks(repo: Repository): Promise<void> {
1806
+ // Webhook para actualizar métricas cuando se cierra un issue
1807
+ await this.githubMCP.createWebhook(repo, {
1808
+ events: ['issues', 'pull_request', 'push'],
1809
+ config: {
1810
+ url: 'https://api.freelance-planner.io/webhook',
1811
+ content_type: 'json',
1812
+ secret: process.env.WEBHOOK_SECRET
1813
+ }
1814
+ });
1815
+
1816
+ console.log('🔔 Webhooks configurados para automatización');
1817
+ }
1818
+
1819
+ // Handler para eventos de GitHub
1820
+ async handleWebhookEvent(event: WebhookEvent): Promise<void> {
1821
+ switch (event.action) {
1822
+ case 'issues.closed':
1823
+ await this.updateVelocityMetrics(event);
1824
+ await this.checkMilestoneCompletion(event);
1825
+ break;
1826
+
1827
+ case 'pull_request.merged':
1828
+ await this.updateCycleTimeMetrics(event);
1829
+ await this.triggerDeployment(event);
1830
+ break;
1831
+
1832
+ case 'push':
1833
+ await this.updateCodeMetrics(event);
1834
+ break;
1835
+ }
1836
+ }
1837
+ }
1838
+ ```
1839
+
1840
+ ## Mejores Prácticas GitHub MCP
1841
+
1842
+ ### 1. Seguridad y Permisos
1843
+ ```typescript
1844
+ class SecurityManager {
1845
+ async setupSecurity(repo: Repository): Promise<void> {
1846
+ // Configurar secrets requeridos
1847
+ const requiredSecrets = [
1848
+ 'DEPLOY_TOKEN',
1849
+ 'CODECOV_TOKEN',
1850
+ 'NPM_TOKEN'
1851
+ ];
1852
+
1853
+ console.log('🔐 Configura estos secrets en GitHub:');
1854
+ console.log(' Settings → Secrets and variables → Actions');
1855
+ requiredSecrets.forEach(secret => {
1856
+ console.log(` - ${secret}`);
1857
+ });
1858
+
1859
+ // Configurar Dependabot
1860
+ await this.setupDependabot(repo);
1861
+
1862
+ // Configurar Code Scanning
1863
+ await this.setupCodeScanning(repo);
1864
+ }
1865
+
1866
+ private async setupDependabot(repo: Repository): Promise<void> {
1867
+ const dependabotConfig = `
1868
+ version: 2
1869
+ updates:
1870
+ - package-ecosystem: "npm"
1871
+ directory: "/"
1872
+ schedule:
1873
+ interval: "weekly"
1874
+ open-pull-requests-limit: 5
1875
+ reviewers:
1876
+ - "${repo.owner.login}"
1877
+ assignees:
1878
+ - "${repo.owner.login}"
1879
+ `;
1880
+
1881
+ await this.githubMCP.createOrUpdateFile(repo, {
1882
+ path: '.github/dependabot.yml',
1883
+ message: 'chore: configure dependabot',
1884
+ content: dependabotConfig,
1885
+ branch: 'main'
1886
+ });
1887
+ }
1888
+ }
1889
+ ```
1890
+
1891
+ ### 2. Rate Limiting y Performance
1892
+ ```typescript
1893
+ class GitHubRateLimiter {
1894
+ private requestQueue: RequestQueue;
1895
+ private rateLimitStatus: RateLimitStatus;
1896
+
1897
+ async executeWithRateLimit<T>(
1898
+ operation: () => Promise<T>
1899
+ ): Promise<T> {
1900
+ // Verificar rate limit antes de ejecutar
1901
+ const status = await this.githubMCP.getRateLimit();
1902
+
1903
+ if (status.remaining < 10) {
1904
+ const resetTime = new Date(status.reset * 1000);
1905
+ console.warn(`⚠️ Rate limit bajo. Reset: ${resetTime}`);
1906
+
1907
+ // Esperar hasta el reset si es necesario
1908
+ if (status.remaining === 0) {
1909
+ await this.waitForReset(status.reset);
1910
+ }
1911
+ }
1912
+
1913
+ // Ejecutar operación
1914
+ return await operation();
1915
+ }
1916
+
1917
+ async batchOperations<T>(
1918
+ operations: Array<() => Promise<T>>
1919
+ ): Promise<T[]> {
1920
+ // Ejecutar operaciones en lotes para optimizar rate limit
1921
+ const batchSize = 5;
1922
+ const results: T[] = [];
1923
+
1924
+ for (let i = 0; i < operations.length; i += batchSize) {
1925
+ const batch = operations.slice(i, i + batchSize);
1926
+ const batchResults = await Promise.all(
1927
+ batch.map(op => this.executeWithRateLimit(op))
1928
+ );
1929
+ results.push(...batchResults);
1930
+
1931
+ // Pequeña pausa entre lotes
1932
+ if (i + batchSize < operations.length) {
1933
+ await this.sleep(1000);
1934
+ }
1935
+ }
1936
+
1937
+ return results;
1938
+ }
1939
+ }
1940
+ ```
1941
+
1942
+ ### 3. Error Handling y Retry Logic
1943
+ ```typescript
1944
+ class ResilientGitHubClient {
1945
+ async executeWithRetry<T>(
1946
+ operation: () => Promise<T>,
1947
+ maxRetries: number = 3
1948
+ ): Promise<T> {
1949
+ let lastError: Error;
1950
+
1951
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
1952
+ try {
1953
+ return await operation();
1954
+ } catch (error) {
1955
+ lastError = error;
1956
+
1957
+ if (this.isRetryable(error)) {
1958
+ const delay = Math.pow(2, attempt) * 1000; // Exponential backoff
1959
+ console.warn(`⚠️ Retry ${attempt}/${maxRetries} después de ${delay}ms`);
1960
+ await this.sleep(delay);
1961
+ } else {
1962
+ throw error; // No reintentar para errores no recuperables
1963
+ }
1964
+ }
1965
+ }
1966
+
1967
+ throw new Error(`Failed after ${maxRetries} retries: ${lastError.message}`);
1968
+ }
1969
+
1970
+ private isRetryable(error: any): boolean {
1971
+ // Reintentar en caso de rate limiting o errores de red
1972
+ return error.status === 429 || // Rate limit
1973
+ error.status >= 500 || // Server errors
1974
+ error.code === 'ECONNRESET';
1975
+ }
1976
+ }
1977
+ ```
1978
+
1979
+ ## Objetivos del Agente
1980
+
1981
+ ### Transformar un proyecto existente en:
1982
+ ✅ **Flujo de trabajo organizado** - Kanban adaptado a freelance
1983
+ ✅ **Calidad técnica** - TDD selectivo, CI/CD, refactorización
1984
+ ✅ **Entregas predecibles** - Iteraciones cortas con demos
1985
+ ✅ **Comunicación clara** - Plan de demos y feedback
1986
+ ✅ **Crecimiento sostenible** - Sin burnout, overhead mínimo
1987
+
1988
+ Siempre proporciona un **plan completo y ejecutable** que reduzca la fricción del desarrollo y establezca prácticas sostenibles para el trabajo freelance.