rootkid0-initializer 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 (86) hide show
  1. package/.opencode/README.md +38 -0
  2. package/.opencode/agents/README.md +12 -0
  3. package/.opencode/agents/architect.md +16 -0
  4. package/.opencode/agents/implementer.md +16 -0
  5. package/.opencode/agents/ops.md +15 -0
  6. package/.opencode/agents/reviewer.md +12 -0
  7. package/.opencode/context.md +36 -0
  8. package/.opencode/mcp/README.md +34 -0
  9. package/.opencode/mcp/servers.recommended.template.json +30 -0
  10. package/.opencode/mcp/servers.template.json +18 -0
  11. package/.opencode/skills/global/SKILL.md +20 -0
  12. package/.opencode/templates/subproject-agents.template.md +20 -0
  13. package/.opencode/templates/subproject-skill.template.md +9 -0
  14. package/01-business/01-business-understanding.md +22 -0
  15. package/01-business/02-problem-statement.md +15 -0
  16. package/01-business/03-as-is-flow.md +17 -0
  17. package/01-business/04-scope-definition.md +17 -0
  18. package/01-business/05-assumptions-risks.md +17 -0
  19. package/01-business/AGENTS.md +32 -0
  20. package/01-business/DISCOVERY-OPERATING-MODEL.md +74 -0
  21. package/01-business/skills/SKILL.md +12 -0
  22. package/02-proposal/01-proposal.md +27 -0
  23. package/02-proposal/AGENTS.md +28 -0
  24. package/02-proposal/PROPOSAL-OPERATING-MODEL.md +77 -0
  25. package/02-proposal/skills/SKILL.md +11 -0
  26. package/03-design/01-architecture-overview.md +17 -0
  27. package/03-design/02-to-be-flow.md +16 -0
  28. package/03-design/03-components.md +12 -0
  29. package/03-design/04-data-model.md +17 -0
  30. package/03-design/05-api-contracts.md +18 -0
  31. package/03-design/06-error-handling.md +19 -0
  32. package/03-design/AGENTS.md +33 -0
  33. package/03-design/DESIGN-OPERATING-MODEL.md +83 -0
  34. package/03-design/skills/SKILL.md +11 -0
  35. package/04-management/01-project-overview.md +17 -0
  36. package/04-management/02-roadmap.md +14 -0
  37. package/04-management/03-backlog.md +11 -0
  38. package/04-management/04-sprints.md +12 -0
  39. package/04-management/05-risks.md +12 -0
  40. package/04-management/06-change-log.md +11 -0
  41. package/04-management/AGENTS.md +33 -0
  42. package/04-management/MANAGEMENT-OPERATING-MODEL.md +83 -0
  43. package/04-management/skills/SKILL.md +11 -0
  44. package/05-development/01-setup.md +13 -0
  45. package/05-development/02-standards.md +12 -0
  46. package/05-development/03-testing.md +12 -0
  47. package/05-development/04-structure.md +11 -0
  48. package/05-development/AGENTS.md +31 -0
  49. package/05-development/DEVELOPMENT-OPERATING-MODEL.md +82 -0
  50. package/05-development/skills/SKILL.md +11 -0
  51. package/06-deployment/01-environments.md +11 -0
  52. package/06-deployment/02-ci-cd.md +13 -0
  53. package/06-deployment/03-config.md +11 -0
  54. package/06-deployment/04-monitoring.md +12 -0
  55. package/06-deployment/AGENTS.md +31 -0
  56. package/06-deployment/DEPLOYMENT-OPERATING-MODEL.md +82 -0
  57. package/06-deployment/skills/SKILL.md +11 -0
  58. package/07-production/01-operations-runbook.md +23 -0
  59. package/07-production/02-incident-management.md +25 -0
  60. package/07-production/03-performance-capacity.md +24 -0
  61. package/07-production/04-continuous-improvement.md +24 -0
  62. package/07-production/AGENTS.md +31 -0
  63. package/07-production/PRODUCTION-OPERATING-MODEL.md +81 -0
  64. package/07-production/skills/SKILL.md +11 -0
  65. package/99-common/01-readme-base.md +16 -0
  66. package/99-common/02-initial-checklist.md +7 -0
  67. package/99-common/03-glossary.md +7 -0
  68. package/99-common/04-release-closure-product-3-4.md +47 -0
  69. package/99-common/05-p1-notion-multi-db-plan.md +126 -0
  70. package/99-common/06-p1-notion-schema-spec.md +189 -0
  71. package/99-common/07-p1-notion-manual-setup-checklist.md +72 -0
  72. package/99-common/AGENTS.md +20 -0
  73. package/99-common/project.config.json +7 -0
  74. package/99-common/skills/SKILL.md +9 -0
  75. package/AGENTS.md +275 -0
  76. package/LICENSE +201 -0
  77. package/README.md +95 -0
  78. package/bin/rootkid0-initializer.js +89 -0
  79. package/package.json +38 -0
  80. package/rootkid0-bootstrap/AGENTS.md +20 -0
  81. package/rootkid0-bootstrap/helpers.sh +106 -0
  82. package/rootkid0-bootstrap/init-project.ps1 +114 -0
  83. package/rootkid0-bootstrap/init-project.sh +71 -0
  84. package/rootkid0-bootstrap/notion-bootstrap.ps1 +162 -0
  85. package/rootkid0-bootstrap/notion-bootstrap.sh +301 -0
  86. package/rootkid0-bootstrap/skills/SKILL.md +9 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # rootkid0-initializer
2
+
3
+ Repo base para inicializar proyectos con una estructura estandar por fases.
4
+
5
+ ## Estructura actual
6
+
7
+ - `rootkid0-bootstrap/` scripts para crear un nuevo proyecto.
8
+ - `AGENTS.md` indice canonico para seleccionar roles de agentes.
9
+ - `.opencode/` contexto global, MCP centralizado y agentes por rol.
10
+ - `01-business/` descubrimiento y contexto del problema.
11
+ - `02-proposal/` propuesta de solucion.
12
+ - `03-design/` decisiones de arquitectura y diseno.
13
+ - `04-management/` planeacion y seguimiento.
14
+ - `05-development/` setup, estandares y testing.
15
+ - `06-deployment/` entornos, CI/CD y monitoreo.
16
+ - `07-production/` operacion, incidentes y mejora continua.
17
+ - `99-common/` checklist, glosario y configuracion base.
18
+
19
+ ## Planeacion P1 - Notion template (multi-DB)
20
+
21
+ - `99-common/05-p1-notion-multi-db-plan.md` plan de arquitectura, relaciones, vistas, ritual y DoD.
22
+ - `99-common/06-p1-notion-schema-spec.md` especificacion detallada de schema por DB y propiedades.
23
+ - `99-common/07-p1-notion-manual-setup-checklist.md` checklist ejecutable para setup manual en Notion.
24
+
25
+ Cada subproyecto trabaja con su `AGENTS.md` local y su `skills/` local.
26
+
27
+ ## Modelo OpenCode aplicado
28
+
29
+ - 1 contexto global: `.opencode/context.md`
30
+ - Skills globales y locales:
31
+ - Global: `.opencode/skills/global/SKILL.md`
32
+ - Local: `<subproyecto>/skills/SKILL.md`
33
+ - MCP centralizado: `.opencode/mcp/servers.template.json`
34
+ - Entrypoint de roles: `AGENTS.md`.
35
+ - Agentes por rol: `.opencode/agents/`
36
+
37
+ ## Modelo local por subproyecto
38
+
39
+ - `AGENTS.md` local para scope y reglas del area.
40
+ - `skills/SKILL.md` local para convenciones de ejecucion.
41
+ - Sin `.opencode/` local en subproyectos.
42
+
43
+ ## Uso rapido
44
+
45
+ ### NPX (recomendado)
46
+
47
+ ```bash
48
+ npx rootkid0-initializer my-project
49
+
50
+ # Opcional: configurar MCP global baseline
51
+ npx rootkid0-initializer --setup-mcp my-project
52
+ ```
53
+
54
+ ### Uso directo de scripts (fallback)
55
+
56
+ #### Bash
57
+
58
+ ```bash
59
+ chmod +x rootkid0-bootstrap/init-project.sh
60
+ ./rootkid0-bootstrap/init-project.sh my-project
61
+
62
+ # Opcional: configurar MCP global baseline
63
+ ./rootkid0-bootstrap/init-project.sh --setup-mcp my-project
64
+ ```
65
+
66
+ #### PowerShell
67
+
68
+ ```powershell
69
+ ./rootkid0-bootstrap/init-project.ps1 my-project
70
+
71
+ # Opcional: configurar MCP global baseline
72
+ ./rootkid0-bootstrap/init-project.ps1 -SetupMcp my-project
73
+ ```
74
+
75
+ El script crea una carpeta nueva con la estructura actual del repositorio, excluye `rootkid0-bootstrap/` y `automation/`, reemplaza `{{PROJECT_NAME}}`, mantiene `AGENTS.md`, genera un README inicial y ejecuta bootstrap automatico de Notion.
76
+
77
+ ## Setup automatico de Notion (MVP)
78
+
79
+ El init ejecuta bootstrap Notion automaticamente despues de crear el proyecto. Requisitos obligatorios:
80
+
81
+ - MCP global en `~/.config/opencode/mcp-servers.json`.
82
+ - Entrada `servers.notion` presente en ese archivo.
83
+ - Variables de entorno:
84
+ - `NOTION_TOKEN` (obligatoria)
85
+ - `NOTION_PARENT_PAGE_ID` (obligatoria)
86
+ - `NOTION_WORKSPACE_NAME` (opcional)
87
+
88
+ Resultado del bootstrap:
89
+
90
+ - Crea pagina raiz del proyecto en Notion.
91
+ - Crea paginas por fase: `01-business` a `07-production` y `99-common`.
92
+ - Crea secciones placeholder del modelo multi-DB: `Projects`, `Phases`, `Deliverables`, `Backlog`, `Risks`, `Decisions`, `Incidents`.
93
+ - Guarda IDs generados en `99-common/notion-bootstrap.output.json` dentro del proyecto creado.
94
+
95
+ MCP recomendados para configurar: `context7`, `engram`, `notion`.
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require("node:child_process");
4
+ const path = require("node:path");
5
+
6
+ const argv = process.argv.slice(2);
7
+ let projectName = "";
8
+ let setupMcp = false;
9
+
10
+ function printHelp() {
11
+ console.log("Uso: rootkid0-initializer [--setup-mcp] <project-name>");
12
+ console.log("");
13
+ console.log("Ejemplos:");
14
+ console.log(" npx rootkid0-initializer my-project");
15
+ console.log(" npx rootkid0-initializer --setup-mcp my-project");
16
+ }
17
+
18
+ for (const arg of argv) {
19
+ if (arg === "-h" || arg === "--help") {
20
+ printHelp();
21
+ process.exit(0);
22
+ }
23
+
24
+ if (arg === "--setup-mcp") {
25
+ setupMcp = true;
26
+ continue;
27
+ }
28
+
29
+ if (arg.startsWith("-")) {
30
+ console.error(`Error: opcion no reconocida '${arg}'`);
31
+ printHelp();
32
+ process.exit(1);
33
+ }
34
+
35
+ if (!projectName) {
36
+ projectName = arg;
37
+ continue;
38
+ }
39
+
40
+ console.error(`Error: argumento no reconocido '${arg}'`);
41
+ printHelp();
42
+ process.exit(1);
43
+ }
44
+
45
+ const packageRoot = path.resolve(__dirname, "..");
46
+ let command = "";
47
+ let commandArgs = [];
48
+
49
+ if (process.platform === "win32") {
50
+ const psScript = path.join(packageRoot, "rootkid0-bootstrap", "init-project.ps1");
51
+ command = "powershell";
52
+ commandArgs = ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", psScript];
53
+
54
+ if (setupMcp) {
55
+ commandArgs.push("-SetupMcp");
56
+ }
57
+
58
+ if (projectName) {
59
+ commandArgs.push(projectName);
60
+ }
61
+ } else {
62
+ const shScript = path.join(packageRoot, "rootkid0-bootstrap", "init-project.sh");
63
+ command = "bash";
64
+ commandArgs = [shScript];
65
+
66
+ if (setupMcp) {
67
+ commandArgs.push("--setup-mcp");
68
+ }
69
+
70
+ if (projectName) {
71
+ commandArgs.push(projectName);
72
+ }
73
+ }
74
+
75
+ const result = spawnSync(command, commandArgs, {
76
+ stdio: "inherit",
77
+ cwd: process.cwd()
78
+ });
79
+
80
+ if (result.error) {
81
+ console.error(`Error ejecutando bootstrap: ${result.error.message}`);
82
+ process.exit(1);
83
+ }
84
+
85
+ if (typeof result.status === "number") {
86
+ process.exit(result.status);
87
+ }
88
+
89
+ process.exit(1);
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "rootkid0-initializer",
3
+ "version": "0.1.0",
4
+ "description": "CLI para inicializar proyectos rootkid0 sin subcomando init.",
5
+ "license": "MIT",
6
+ "type": "commonjs",
7
+ "bin": {
8
+ "rootkid0-initializer": "bin/rootkid0-initializer.js"
9
+ },
10
+ "files": [
11
+ "bin/",
12
+ "rootkid0-bootstrap/",
13
+ ".opencode/",
14
+ "01-business/",
15
+ "02-proposal/",
16
+ "03-design/",
17
+ "04-management/",
18
+ "05-development/",
19
+ "06-deployment/",
20
+ "07-production/",
21
+ "99-common/",
22
+ "AGENTS.md",
23
+ "README.md",
24
+ "LICENSE"
25
+ ],
26
+ "scripts": {
27
+ "check": "node bin/rootkid0-initializer.js --help"
28
+ },
29
+ "keywords": [
30
+ "bootstrap",
31
+ "initializer",
32
+ "opencode",
33
+ "rootkid"
34
+ ],
35
+ "engines": {
36
+ "node": ">=18"
37
+ }
38
+ }
@@ -0,0 +1,20 @@
1
+ # AGENTS
2
+
3
+ Entrypoint local para trabajo en `rootkid0-bootstrap`.
4
+
5
+ ## Scope
6
+
7
+ Scripts de inicializacion de proyectos (PowerShell y Bash).
8
+
9
+ ## Reglas locales
10
+
11
+ - Garantizar compatibilidad entre PS1 y SH.
12
+ - Mantener salida de uso simple y consistente.
13
+
14
+ ## Orden de carga recomendado
15
+
16
+ 1. Contexto global: `.opencode/context.md`
17
+ 2. AGENTS local: `rootkid0-bootstrap/AGENTS.md`
18
+ 3. Skill global: `.opencode/skills/global/SKILL.md`
19
+ 4. Skill local: `rootkid0-bootstrap/skills/SKILL.md`
20
+ 5. Rol: `AGENTS.md` (raiz)
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ validate_project_name() {
6
+ local project_name="${1:-}"
7
+
8
+ if [[ -z "$project_name" ]]; then
9
+ echo "Error: Debes indicar un nombre de proyecto." >&2
10
+ return 1
11
+ fi
12
+
13
+ if [[ ! "$project_name" =~ ^[a-zA-Z0-9][a-zA-Z0-9_-]{1,49}$ ]]; then
14
+ echo "Error: Nombre invalido. Usa 2-50 caracteres (letras, numeros, guion y guion bajo)." >&2
15
+ return 1
16
+ fi
17
+ }
18
+
19
+ copy_baseline() {
20
+ local repo_root="$1"
21
+ local destination="$2"
22
+
23
+ mkdir -p "$destination"
24
+
25
+ local item
26
+ for item in "$repo_root"/* "$repo_root"/.[!.]* "$repo_root"/..?*; do
27
+ [[ -e "$item" ]] || continue
28
+
29
+ local name
30
+ name="$(basename "$item")"
31
+
32
+ case "$name" in
33
+ rootkid0-bootstrap|rootkid-bootstrap|bootstrap|automation|.git|README.md|desktop.ini)
34
+ continue
35
+ ;;
36
+ esac
37
+
38
+ cp -R "$item" "$destination/"
39
+ done
40
+ }
41
+
42
+ replace_project_placeholders() {
43
+ local destination="$1"
44
+ local project_name="$2"
45
+
46
+ while IFS= read -r -d '' file; do
47
+ sed -i.bak "s/{{PROJECT_NAME}}/$project_name/g" "$file"
48
+ rm -f "$file.bak"
49
+ done < <(find "$destination" -type f \( -name "*.md" -o -name "*.txt" -o -name "*.json" -o -name "*.yml" -o -name "*.yaml" -o -name "*.ini" -o -name "*.cfg" \) -print0)
50
+ }
51
+
52
+ setup_global_mcp_config() {
53
+ local repo_root="$1"
54
+ local template_file="$repo_root/.opencode/mcp/servers.template.json"
55
+ local target_dir="$HOME/.config/opencode"
56
+ local target_file="$target_dir/mcp-servers.json"
57
+ local backup_file
58
+
59
+ if [[ ! -f "$template_file" ]]; then
60
+ echo "Aviso: No se encontro $template_file. Se omite setup MCP." >&2
61
+ return 0
62
+ fi
63
+
64
+ mkdir -p "$target_dir"
65
+
66
+ if [[ -f "$target_file" ]]; then
67
+ backup_file="$target_file.bak.$(date +%Y%m%d%H%M%S)"
68
+ cp "$target_file" "$backup_file"
69
+ echo "Backup MCP creado: $backup_file"
70
+ fi
71
+
72
+ cp "$template_file" "$target_file"
73
+ echo "MCP global actualizado: $target_file"
74
+ echo "Recomendado: configurar context7, engram y notion usando:"
75
+ echo " $repo_root/.opencode/mcp/servers.recommended.template.json"
76
+ }
77
+
78
+ generate_project_readme() {
79
+ local destination="$1"
80
+ local project_name="$2"
81
+
82
+ cat > "$destination/README.md" <<EOF
83
+ # $project_name
84
+
85
+ Proyecto inicializado desde rootkid0-initializer.
86
+
87
+ ## Que incluye
88
+
89
+ - Estructura base por fases: \`01-business/\` a \`07-production/\` y \`99-common/\`.
90
+ - Plantillas markdown con placeholders ya resueltos para tu proyecto.
91
+ - Configuracion inicial en \`99-common/project.config.json\`.
92
+ - Integracion OpenCode MVP (\`AGENTS.md\`, \`.opencode/\`, AGENTS locales, skills, MCP y agentes por rol).
93
+ - Setup automatico de Notion (MVP): pagina raiz, fases y secciones del modelo multi-DB.
94
+ - Salida de IDs Notion en \`99-common/notion-bootstrap.output.json\`.
95
+
96
+ ## Siguientes pasos
97
+
98
+ 1. Completa los markdown de \`01-business/\` a \`07-production/\`.
99
+ 2. Ajusta \`99-common/project.config.json\` segun tu stack y contexto.
100
+ 3. Revisa \`AGENTS.md\` como entrypoint de roles.
101
+ 4. Revisa \`.opencode/README.md\` para el flujo global + subproyectos.
102
+ 5. Revisa \`.opencode/mcp/README.md\` para prerequisitos MCP + Notion.
103
+ 6. Verifica \`99-common/notion-bootstrap.output.json\`.
104
+ 7. Versiona cambios con Git y define tu backlog inicial.
105
+ EOF
106
+ }
@@ -0,0 +1,114 @@
1
+ param(
2
+ [Parameter(Position = 0)]
3
+ [string]$ProjectName,
4
+ [switch]$SetupMcp
5
+ )
6
+
7
+ Set-StrictMode -Version Latest
8
+ $ErrorActionPreference = "Stop"
9
+
10
+ if ([string]::IsNullOrWhiteSpace($ProjectName)) {
11
+ $ProjectName = Read-Host "Nombre del proyecto"
12
+ }
13
+
14
+ if ($ProjectName -notmatch '^[a-zA-Z0-9][a-zA-Z0-9_-]{1,49}$') {
15
+ throw "Nombre invalido. Usa 2-50 caracteres (letras, numeros, guion y guion bajo)."
16
+ }
17
+
18
+ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
19
+ $repoRoot = Split-Path -Parent $scriptDir
20
+ $destination = Join-Path (Get-Location).Path $ProjectName
21
+
22
+ if (Test-Path $destination) {
23
+ throw "Ya existe la carpeta $destination"
24
+ }
25
+
26
+ Write-Host "Creando proyecto: $ProjectName"
27
+ New-Item -Path $destination -ItemType Directory | Out-Null
28
+
29
+ $excludedItems = @("rootkid0-bootstrap", "rootkid-bootstrap", "bootstrap", "automation", ".git", "README.md", "desktop.ini")
30
+ $itemsToCopy = Get-ChildItem -Path $repoRoot -Force |
31
+ Where-Object { $excludedItems -notcontains $_.Name }
32
+
33
+ foreach ($item in $itemsToCopy) {
34
+ Copy-Item -Path $item.FullName -Destination $destination -Recurse -Force
35
+ }
36
+
37
+ $extensions = @(".md", ".txt", ".json", ".yml", ".yaml", ".ini", ".cfg")
38
+ Get-ChildItem -Path $destination -Recurse -File |
39
+ Where-Object { $extensions -contains $_.Extension.ToLowerInvariant() } |
40
+ ForEach-Object {
41
+ $content = Get-Content -Path $_.FullName -Raw
42
+ $updated = $content.Replace("{{PROJECT_NAME}}", $ProjectName)
43
+ if ($updated -ne $content) {
44
+ Set-Content -Path $_.FullName -Value $updated -NoNewline
45
+ }
46
+ }
47
+
48
+ $templatePath = Join-Path $repoRoot ".opencode/mcp/servers.template.json"
49
+ $recommendedPath = Join-Path $repoRoot ".opencode/mcp/servers.recommended.template.json"
50
+
51
+ if ($SetupMcp) {
52
+ if (Test-Path $templatePath) {
53
+ $globalMcpDir = Join-Path $HOME ".config/opencode"
54
+ $globalMcpFile = Join-Path $globalMcpDir "mcp-servers.json"
55
+
56
+ New-Item -Path $globalMcpDir -ItemType Directory -Force | Out-Null
57
+
58
+ if (Test-Path $globalMcpFile) {
59
+ $stamp = Get-Date -Format "yyyyMMddHHmmss"
60
+ $backupPath = "$globalMcpFile.bak.$stamp"
61
+ Copy-Item -Path $globalMcpFile -Destination $backupPath -Force
62
+ Write-Host "Backup MCP creado: $backupPath"
63
+ }
64
+
65
+ Copy-Item -Path $templatePath -Destination $globalMcpFile -Force
66
+ Write-Host "MCP global actualizado: $globalMcpFile"
67
+
68
+ if (Test-Path $recommendedPath) {
69
+ Write-Host "Recomendado: configurar context7, engram y notion usando:"
70
+ Write-Host " $recommendedPath"
71
+ }
72
+ }
73
+ else {
74
+ Write-Warning "No se encontro plantilla MCP en $templatePath. Se omite setup MCP."
75
+ }
76
+ }
77
+
78
+ & (Join-Path $scriptDir "notion-bootstrap.ps1") -ProjectName $ProjectName -ProjectDir $destination
79
+
80
+ $readmePath = Join-Path $destination "README.md"
81
+ $readmeContent = @"
82
+ # $ProjectName
83
+
84
+ Proyecto inicializado desde rootkid0-initializer.
85
+
86
+ ## Que incluye
87
+
88
+ - Estructura base por fases: `01-business/` a `07-production/` y `99-common/`.
89
+ - Plantillas markdown con placeholders ya resueltos para tu proyecto.
90
+ - Configuracion inicial en `99-common/project.config.json`.
91
+ - Integracion OpenCode MVP (`AGENTS.md`, `.opencode/`, AGENTS locales, skills, MCP y agentes por rol).
92
+ - Setup automatico de Notion (MVP): pagina raiz, fases y secciones del modelo multi-DB.
93
+ - Salida de IDs Notion en `99-common/notion-bootstrap.output.json`.
94
+
95
+ ## Siguientes pasos
96
+
97
+ 1. Completa los markdown de `01-business/` a `07-production/`.
98
+ 2. Ajusta `99-common/project.config.json` segun tu stack y contexto.
99
+ 3. Revisa `AGENTS.md` como entrypoint de roles.
100
+ 4. Revisa `.opencode/README.md` para el flujo global + subproyectos.
101
+ 5. Revisa `.opencode/mcp/README.md` para prerequisitos MCP + Notion.
102
+ 6. Verifica `99-common/notion-bootstrap.output.json`.
103
+ 7. Versiona cambios con Git y define tu backlog inicial.
104
+ "@
105
+ Set-Content -Path $readmePath -Value $readmeContent
106
+
107
+ Write-Host ""
108
+ Write-Host "Proyecto creado en: $destination"
109
+ Write-Host "Siguientes pasos:"
110
+ Write-Host " 1) Set-Location `"$ProjectName`""
111
+ Write-Host " 2) Completar 01-business/ a 07-production/"
112
+ Write-Host " 3) Ajustar 99-common/project.config.json"
113
+ Write-Host " 4) Revisar AGENTS.md y .opencode/README.md"
114
+ Write-Host " 5) Revisar 99-common/notion-bootstrap.output.json"