@codebehind/agent-workflow 1.1.12 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebehind/agent-workflow",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "Scaffold the agent-workflow spec-driven delivery framework into any repo",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,340 @@
1
+ ---
2
+ name: bootstrap-meta-repo
3
+ description: Scaffold a new meta-repo — gather project info, create README/CLAUDE.md/package.json/docs structure, register git submodules, and commit the initial scaffold.
4
+ ---
5
+
6
+ Use this skill when the user wants to bootstrap a new meta-repository after running `npx @codebehind/agent-workflow init`.
7
+
8
+ ## What is a meta-repo
9
+
10
+ A meta-repo is a coordination repository that contains no application code. It holds:
11
+ - Shared AI instructions (`CLAUDE.md`, `AGENTS.md`, `.claude/`)
12
+ - Shared documentation (`docs/`)
13
+ - Shared scripts (`scripts/`)
14
+ - Git submodule references to application repositories (`repos/`)
15
+ - npm versioning for the overall platform (`package.json`)
16
+
17
+ ## Objective
18
+
19
+ Gather project information from the user, scaffold all standard meta-repo files, register git submodules, update `AGENTS.md` to meta-repo mode, and commit the initial scaffold as a clean first commit.
20
+
21
+ ## Phase 1 — Gather inputs
22
+
23
+ If the user invoked this skill with no arguments or incomplete information, ask for the following before proceeding. Accept everything as a single pasted block if the user provides it upfront.
24
+
25
+ | Input | Required | Example |
26
+ |-------|----------|---------|
27
+ | Project name | yes | `Aurora` |
28
+ | npm package name | yes | `@aurora/meta` |
29
+ | One-sentence description | yes | `Enterprise DMS for document OCR, signing, and archiving` |
30
+ | Domain description | yes | Key concepts, features, target users — used to populate CLAUDE.md and docs |
31
+ | Submodules list | yes (at least 1) | For each: folder name under `repos/`, git URL, short purpose |
32
+ | Tech stack per submodule | no | Used for the Conventions section of CLAUDE.md |
33
+
34
+ If submodules are not provided at all, proceed without registering them and note this in the final report.
35
+
36
+ Ask only for what is missing — do not repeat questions the user already answered.
37
+
38
+ ## Phase 2 — Scaffold files
39
+
40
+ Create the files listed below. **Skip any file that already exists and has non-placeholder content** — log it as skipped in the final report.
41
+
42
+ ### README.md
43
+
44
+ ```markdown
45
+ # <Project Name> — Meta Repository
46
+
47
+ <Project description>
48
+
49
+ ## Project Repositories
50
+
51
+ | Folder | Purpose | URL |
52
+ |--------|---------|-----|
53
+ | `repos/<folder>/` | <purpose> | [GitLab](<url>) |
54
+
55
+ ## Repository Structure
56
+
57
+ \`\`\`
58
+ <project-slug>-meta/
59
+ ├── CLAUDE.md # AI agent instructions for this project
60
+ ├── README.md # This file
61
+ ├── package.json # Versioning and shared npm tooling
62
+ ├── docs/
63
+ │ ├── architecture/ # Architecture overviews and diagrams
64
+ │ ├── decisions/ # Architecture Decision Records (ADRs)
65
+ │ └── functional/ # Functional and domain documentation
66
+ ├── scripts/ # Shared orchestration scripts
67
+ ├── .claude/ # Claude Code configuration and skills
68
+ │ ├── settings.json
69
+ │ └── skills/
70
+ └── repos/ # Git submodules — one per service
71
+ └── <folder>/
72
+ \`\`\`
73
+
74
+ ## Getting Started
75
+
76
+ ### Clone with submodules
77
+
78
+ \`\`\`bash
79
+ git clone --recurse-submodules <meta-repo-url>
80
+ \`\`\`
81
+
82
+ Or, after a plain clone:
83
+
84
+ \`\`\`bash
85
+ npm run submodules:init
86
+ \`\`\`
87
+
88
+ ### Install shared tooling
89
+
90
+ \`\`\`bash
91
+ npm install
92
+ \`\`\`
93
+
94
+ ### Update all submodules to latest
95
+
96
+ \`\`\`bash
97
+ npm run submodules:update
98
+ \`\`\`
99
+
100
+ ## Versioning
101
+
102
+ This meta repository follows [Semantic Versioning](https://semver.org/). The version in `package.json` represents the overall <Project Name> platform version.
103
+ ```
104
+
105
+ ### CLAUDE.md
106
+
107
+ ```markdown
108
+ # <Project Name> — Claude Agent Instructions
109
+
110
+ This is the meta repository for the <Project Name> platform. Read this file before working on any part of the project.
111
+
112
+ ## Project Overview
113
+
114
+ <Project description — 2-3 sentences from the domain description provided>
115
+
116
+ ## Repository Map
117
+
118
+ All service repositories are available as git submodules under `repos/`:
119
+
120
+ | Submodule path | Service |
121
+ |---|---|
122
+ | `repos/<folder>/` | <purpose> |
123
+
124
+ ## Domain Concepts
125
+
126
+ <Bullet list of key domain terms derived from the domain description>
127
+
128
+ ## Conventions
129
+
130
+ - ADRs (Architecture Decision Records) live in `docs/decisions/` using the template at `docs/decisions/ADR-template.md`
131
+ - Shared scripts live in `scripts/` and must be POSIX-compatible shell unless a specific runtime is justified
132
+ - All inter-service API contracts must be documented in `docs/architecture/`
133
+ - When adding a new service repository, register it as a submodule under `repos/` and document it here and in `README.md`
134
+ - Commit style: conventional commits (`feat:`, `fix:`, `chore:`, etc.)
135
+
136
+ ## Working Across Repositories
137
+
138
+ When a change spans multiple services:
139
+ 1. Open the relevant submodule(s) under `repos/`
140
+ 2. Work in feature branches within each submodule
141
+ 3. Update the submodule pointer in this repo once the downstream branches are merged
142
+ 4. Document any cross-cutting API or schema changes in `docs/architecture/`
143
+
144
+ ## AI Agent Notes
145
+
146
+ - Prefer reading existing docs and ADRs before proposing architectural changes
147
+ - When unsure about a domain term, refer to the Domain Concepts section above
148
+ - Do not modify submodule content directly through this repo — always work inside the submodule directory
149
+ - Shared scripts in `scripts/` should remain idempotent and safe to re-run
150
+ ```
151
+
152
+ ### package.json
153
+
154
+ ```json
155
+ {
156
+ "name": "<npm-package-name>",
157
+ "version": "0.1.0",
158
+ "description": "<description>",
159
+ "private": true,
160
+ "scripts": {
161
+ "submodules:init": "git submodule update --init --recursive",
162
+ "submodules:update": "git submodule update --remote --merge",
163
+ "submodules:status": "git submodule status"
164
+ },
165
+ "engines": {
166
+ "node": ">=20"
167
+ }
168
+ }
169
+ ```
170
+
171
+ ### docs/architecture/overview.md
172
+
173
+ ```markdown
174
+ # Architecture Overview
175
+
176
+ ## System Overview
177
+
178
+ <Fill in: high-level description of how the system components fit together>
179
+
180
+ ## Services
181
+
182
+ | Service | Submodule | Responsibility |
183
+ |---------|-----------|----------------|
184
+ | <name> | `repos/<folder>/` | <responsibility> |
185
+
186
+ ## Inter-service Communication
187
+
188
+ <Fill in: how services communicate — REST, events, shared DB, etc.>
189
+
190
+ ## Key Architectural Decisions
191
+
192
+ See `docs/decisions/` for Architecture Decision Records.
193
+ ```
194
+
195
+ ### docs/decisions/ADR-template.md
196
+
197
+ ```markdown
198
+ # ADR-NNN: <Title>
199
+
200
+ **Status:** proposed | accepted | deprecated | superseded
201
+
202
+ **Date:** YYYY-MM-DD
203
+
204
+ ## Context
205
+
206
+ <What is the issue we are addressing? What are the forces at play?>
207
+
208
+ ## Decision
209
+
210
+ <What is the change we are making?>
211
+
212
+ ## Consequences
213
+
214
+ <What are the resulting positive and negative outcomes of this decision?>
215
+ ```
216
+
217
+ ### docs/functional/domain-overview.md
218
+
219
+ ```markdown
220
+ # Domain Overview
221
+
222
+ <Populate with the domain description provided by the user — key concepts, features, and user roles>
223
+
224
+ ## Key Concepts
225
+
226
+ <Derived from the domain description — define the core entities and terms>
227
+
228
+ ## Features
229
+
230
+ <List of key product features>
231
+
232
+ ## User Roles
233
+
234
+ <List of roles/actors if applicable>
235
+ ```
236
+
237
+ ### .gitignore
238
+
239
+ ```
240
+ # Dependencies
241
+ node_modules/
242
+
243
+ # OS
244
+ .DS_Store
245
+ Thumbs.db
246
+
247
+ # Editor
248
+ .idea/
249
+ .vscode/
250
+ *.swp
251
+ *.swo
252
+
253
+ # Logs
254
+ *.log
255
+ npm-debug.log*
256
+
257
+ # Build outputs
258
+ dist/
259
+ build/
260
+ ```
261
+
262
+ ## Phase 3 — Update AGENTS.md
263
+
264
+ `AGENTS.md` already exists (created by `npx @codebehind/agent-workflow init`). Update the `## Repo Mode` section:
265
+
266
+ 1. Replace the mode declaration line from `**Mode:** single-repo` to `**Mode:** meta-repo`
267
+ 2. Fill in the submodule table (replacing the comment placeholder):
268
+ ```markdown
269
+ | Directory | GitLab project URL |
270
+ |---|---|
271
+ | repos/<folder>/ | <git-url> |
272
+ ```
273
+ 3. Replace the single-repo description block with the meta-repo description:
274
+ ```markdown
275
+ **Meta-repo:** Specs, plans, docs, and artifacts live here. Application code lives in `repos/<module>/` submodules (see table above). Never commit application code directly to this repo. Each affected submodule gets its own MR in its own GitLab project. Reference submodule MR URLs in the meta-repo MR description. When running acceptance proof (UI, API), navigate into the relevant `repos/<module>/` directory to start the app and capture evidence; save artifacts back here under `.agent-workflow/artifacts/`.
276
+ ```
277
+ 4. Remove all HTML comment blocks (`<!-- ... -->`) from the Repo Mode section.
278
+
279
+ If `AGENTS.md` does not exist, create it from scratch using the meta-repo variant of the standard template.
280
+
281
+ ## Phase 4 — Register git submodules
282
+
283
+ For each submodule in the provided list, run:
284
+
285
+ ```bash
286
+ git submodule add <git-url> repos/<folder-name>
287
+ ```
288
+
289
+ Run sequentially. If a submodule add fails (inaccessible repo, wrong URL, already registered), log the error and continue with the remaining submodules — do not abort.
290
+
291
+ If no submodules were provided, create `repos/.gitkeep` so the directory is tracked by git.
292
+
293
+ ## Phase 5 — Commit
294
+
295
+ Stage all created and modified files:
296
+
297
+ ```bash
298
+ git add README.md CLAUDE.md package.json .gitignore AGENTS.md docs/ repos/
299
+ ```
300
+
301
+ If `.gitmodules` was created (submodules registered):
302
+ ```bash
303
+ git add .gitmodules
304
+ ```
305
+
306
+ Commit:
307
+ ```bash
308
+ git commit -m "chore: bootstrap meta-repo scaffold"
309
+ ```
310
+
311
+ ## Phase 6 — Final report
312
+
313
+ Output a summary containing:
314
+
315
+ **Created files:**
316
+ - List each file created with its path
317
+
318
+ **Skipped files (already existed):**
319
+ - List each file that was skipped
320
+
321
+ **Submodules registered:**
322
+ - List each successfully registered submodule
323
+
324
+ **Submodule failures (if any):**
325
+ - List each submodule that failed to register with the error message
326
+
327
+ **Next steps:**
328
+ 1. Review the generated files and fill in any `<placeholder>` values
329
+ 2. If any submodules failed, run `git submodule add <url> repos/<folder>` manually
330
+ 3. Push as the `main` branch: `git push -u origin main`
331
+ 4. Open the GitLab project and configure branch protection
332
+
333
+ ## Edge cases
334
+
335
+ - **File already exists with real content**: skip it, log as skipped — never overwrite
336
+ - **AGENTS.md missing**: create from scratch in meta-repo mode
337
+ - **No submodules provided**: skip Phase 4, create `repos/.gitkeep`, note in report
338
+ - **Submodule add fails**: log the failure, continue, report at end
339
+ - **Partial user input**: ask only for missing fields, not the full set again
340
+ - **User provides info upfront as a pasted block** (e.g., existing project description prompt): parse it directly without asking questions