@vfarcic/dot-ai 0.161.0 β†’ 0.162.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -83,6 +83,7 @@ Generate 25+ governance, legal, and automation files (LICENSE, CODE_OF_CONDUCT,
83
83
  Access curated prompts as native slash commands (`/dot-ai:prompt-name`) in your coding agent for consistent workflows across projects:
84
84
  - **PRD Management**: Create, track, and complete Product Requirements Documents (`prd-create`, `prd-next`, `prd-done`, etc.)
85
85
  - **Dockerfile Generation**: Generate production-ready, secure multi-stage Dockerfiles for any project (`generate-dockerfile`)
86
+ - **CI/CD Generation**: Generate intelligent CI/CD workflows through interactive conversation (`generate-cicd`)
86
87
 
87
88
  πŸ“– [Learn more β†’](./docs/guides/mcp-prompts-guide.md)
88
89
 
@@ -833,7 +833,7 @@ Please try again or modify your policy description.`,
833
833
  const capabilityService = new capability_vector_service_1.CapabilityVectorService(collection);
834
834
  // Use existing searchCapabilities function - no fallback, let it throw if it fails
835
835
  const searchResults = await capabilityService.searchCapabilities(searchQuery, {
836
- limit: 40 // Reduced to manage token count
836
+ limit: 35 // Reduced to manage token count (Haiku max: 180K tokens)
837
837
  });
838
838
  if (searchResults.length === 0) {
839
839
  throw new Error(`No relevant capabilities found for policy description: "${policyDescription}"`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vfarcic/dot-ai",
3
- "version": "0.161.0",
3
+ "version": "0.162.0",
4
4
  "description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
5
5
  "mcpName": "io.github.vfarcic/dot-ai",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,310 @@
1
+ ---
2
+ name: generate-cicd
3
+ description: Generate intelligent CI/CD workflows through interactive conversation by analyzing repository structure and user preferences
4
+ category: development
5
+ ---
6
+
7
+ # Generate CI/CD Workflows
8
+
9
+ Generate appropriate CI/CD workflows for the current project through an interactive conversation. This prompt analyzes your entire repository, presents findings, asks about workflow preferences, and generates workflows based on your confirmed choices.
10
+
11
+ ## Instructions
12
+
13
+ You are helping a developer set up CI/CD workflows for their project. Unlike template-based generators, you will:
14
+
15
+ 1. **Analyze** the entire repository - source code, automation, configs, docs, existing CI
16
+ 2. **Present findings** and workflow options to the user for decision-making
17
+ 3. **Generate** workflows based on confirmed user choices
18
+
19
+ This interactive model is essential because CI/CD workflows involve **policy decisions** (PR vs direct push, release triggers, deployment strategy) that cannot be deduced from code aloneβ€”they reflect team preferences and organizational policies.
20
+
21
+ ### Key Rules
22
+
23
+ **Verify everything**: Before adding any step, secret, or configuration, verify it by examining the actual codebase. Never assume. Ask when uncertain.
24
+
25
+ **Always present workflow choices**: CI/CD involves policy decisions that require user input. Even if you detect tests and a Dockerfile, you cannot know whether tests should run on PR or main, what triggers releases, which registry to use, or how to deploy. These are workflow choices that require user input.
26
+
27
+ ---
28
+
29
+ ## Best Practices
30
+
31
+ Apply these practices when generating workflows.
32
+
33
+ ### Use Project Automation, Not Inline Commands
34
+
35
+ CI workflows should call project automation, not contain inline command logic.
36
+
37
+ ```yaml
38
+ # ❌ BAD - Logic in CI, can't run locally the same way
39
+ - run: |
40
+ jest --coverage --ci
41
+ eslint src/ --format=stylish
42
+
43
+ # βœ… GOOD - CI calls project automation
44
+ - run: npm test
45
+ - run: npm run lint
46
+ ```
47
+
48
+ **Why**: Local/CI parity, CI platform portability, easier debugging, single source of truth.
49
+
50
+ **When project automation doesn't exist**, ask the user:
51
+
52
+ ```text
53
+ I didn't find automation for [operation]. Would you like me to:
54
+ 1. Add it to the project (recommended for local/CI parity)
55
+ 2. Use inline command in workflow
56
+ ```
57
+
58
+ ### Actions for Infrastructure, Project Commands for Logic
59
+
60
+ | Category | Examples | Approach |
61
+ |----------|----------|----------|
62
+ | **CI Infrastructure** | checkout, setup runtime, cache, registry login | βœ… Use actions |
63
+ | **Project Logic** | build, test, lint, docker build, deploy | βœ… Use project automation |
64
+
65
+ ### Secret Handling
66
+
67
+ Secrets are only accessible from the org/owner that has them configured. Fork PRs cannot access base repo secrets.
68
+
69
+ Use conditional to skip steps when secrets unavailable:
70
+
71
+ ```yaml
72
+ - name: Run integration tests
73
+ if: secrets.API_KEY != ''
74
+ run: npm run test:integration
75
+ env:
76
+ API_KEY: ${{ secrets.API_KEY }}
77
+ ```
78
+
79
+ When the generated workflow requires secrets, document them clearly:
80
+
81
+ ```markdown
82
+ ## Required Secrets
83
+
84
+ | Secret Name | Description | How to Create |
85
+ |-------------|-------------|---------------|
86
+ | `REGISTRY_USERNAME` | Container registry username | Your registry account username |
87
+ | `REGISTRY_TOKEN` | Container registry access token | Registry settings > Access Tokens |
88
+
89
+ **To create secrets via CLI:**
90
+ gh secret set REGISTRY_USERNAME
91
+ gh secret set REGISTRY_TOKEN
92
+ ```
93
+
94
+ Show the `gh secret set` commands as guidance, but do NOT execute them.
95
+
96
+ ### Security
97
+
98
+ | Practice | Description |
99
+ |----------|-------------|
100
+ | **Minimal permissions** | Use `permissions:` block, grant only what's needed |
101
+ | **OIDC over long-lived tokens** | For cloud providers, prefer OIDC federation |
102
+ | **Pin action versions** | Use SHA or version tags, never `@latest` |
103
+ | **Disable credential persistence** | Use `persist-credentials: false` on `actions/checkout` |
104
+ | **Prevent script injection** | Never interpolate untrusted inputs (branch names, PR titles) directly into `run:` commands |
105
+ | **Avoid `pull_request_target`** | This trigger has access to secrets but can checkout fork code - dangerous combination |
106
+ | **Environment protection** | Use GitHub environments with required reviewers for production deployments |
107
+
108
+ ### Testing
109
+
110
+ | Practice | Description |
111
+ |----------|-------------|
112
+ | **Fail fast** | Run quick checks (lint) before slow ones (tests) |
113
+ | **Test before build** | Don't waste time building if tests fail |
114
+ | **Parallel jobs** | Run independent checks concurrently |
115
+ | **Test matrix** | Consider multiple versions/platforms if relevant |
116
+
117
+ ### Caching
118
+
119
+ Implement appropriate caching based on detected package manager and lock files.
120
+
121
+ ---
122
+
123
+ ## Process
124
+
125
+ **IMPORTANT**: Execute this process SEQUENTIALLY. Each step may change the direction of the conversation. Do NOT batch all questions upfront - ask questions one phase at a time and wait for user responses before proceeding.
126
+
127
+ The workflow follows three phases:
128
+
129
+ ```text
130
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
131
+ β”‚ PHASE 1: ANALYZE β”‚
132
+ β”‚ Discover what CAN be built/tested/deployed β”‚
133
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
134
+ ↓
135
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
136
+ β”‚ PHASE 2: PRESENT & ASK β”‚
137
+ β”‚ Show findings + present workflow choices for user decision β”‚
138
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
139
+ ↓
140
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
141
+ β”‚ PHASE 3: GENERATE β”‚
142
+ β”‚ Create workflows based on confirmed user choices β”‚
143
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
144
+ ```
145
+
146
+ ### Step 0: Determine CI Platform (BLOCKING GATE)
147
+
148
+ **CRITICAL**: This is a blocking gate. Ask about CI platform FIRST and ALONE. Do NOT ask any other questions or perform any analysis until the user confirms they want GitHub Actions.
149
+
150
+ Ask the user which CI/CD platform they use. Present ONLY these options:
151
+
152
+ 1. **GitHub Actions**
153
+ 2. **Other**
154
+
155
+ **If GitHub Actions** β†’ Proceed to Step 1 (analysis)
156
+
157
+ **If Other** β†’ STOP. Ask which platform they use, then respond:
158
+
159
+ ```text
160
+ [Platform] is not yet supported. Would you like me to open a feature
161
+ request issue at https://github.com/dot-ai-app/dot-ai/issues so we
162
+ can prioritize adding it?
163
+
164
+ 1. Yes, open a feature request
165
+ 2. No, I'll use a different approach
166
+ ```
167
+
168
+ Then handle the user's response (create issue or end conversation). Do NOT proceed to repository analysis for unsupported platforms.
169
+
170
+ ### Step 1: Comprehensive Repository Analysis
171
+
172
+ **Analyze everything. The entire repository is context.**
173
+
174
+ #### 1.1 Language and Framework Detection
175
+
176
+ - Identify primary language(s) from source files and dependency manifests
177
+ - Detect frameworks from dependencies
178
+ - Note version requirements
179
+
180
+ #### 1.2 Discover and Understand Existing Automation
181
+
182
+ Find what automation exists and **read scripts to understand how they work** - what arguments they accept, what they handle internally, how they should be called. Don't just note that a script exists; understand it.
183
+
184
+ - If automation exists for a task β†’ use it in the generated workflow
185
+ - Only generate raw commands if no existing automation found
186
+ - When multiple automation options exist β†’ ask the user
187
+
188
+ **Why this matters**: Existing automation often handles setup, fixtures, environment variables, and cleanup that raw commands would miss. The maintainers chose their build system for a reason.
189
+
190
+ #### 1.3 Existing CI Analysis
191
+
192
+ Check for existing CI configuration. If found:
193
+ - Analyze what's already configured and why
194
+ - During Step 2, ask user whether to update existing workflows or create new ones
195
+
196
+ #### 1.4 Container and Registry Detection
197
+
198
+ - Check for Dockerfile and container configuration
199
+ - Search for registry references in existing CI, automation, or docs
200
+ - If no Dockerfile but project could benefit from containerization, suggest using `/generate-dockerfile` prompt
201
+
202
+ #### 1.5 Branching and Release Strategy
203
+
204
+ - Check for patterns in existing CI triggers
205
+ - Look at git tags for versioning patterns
206
+ - Check documentation for workflow hints
207
+
208
+ #### 1.6 Environment and Secrets
209
+
210
+ - Find environment variable documentation or examples
211
+ - Search code for required environment variables
212
+ - Identify what secrets the workflow will need
213
+
214
+ #### 1.7 App Definition Detection
215
+
216
+ Identify how the application is packaged for deployment:
217
+ - Helm charts
218
+ - Kustomize configurations
219
+ - Plain Kubernetes manifests
220
+ - Container-only (no K8s deployment)
221
+
222
+ #### 1.8 Deployment Mechanism Detection
223
+
224
+ Identify how the application is deployed:
225
+ - GitOps (ArgoCD, Flux)
226
+ - Direct deployment (Helm, kubectl)
227
+ - Manual deployment
228
+ - External system
229
+
230
+ **For GitOps**:
231
+ - CI must NOT deploy directly - it updates manifests, GitOps controller syncs
232
+ - Determine if GitOps resources (ArgoCD Application, Flux Kustomization) exist
233
+ - If not, may need to create them (same repo or separate cluster-config repo)
234
+ - Determine where manifests live for image tag updates
235
+
236
+ If unclear, ask user during Step 2.
237
+
238
+ #### 1.9 Tool Manager Detection
239
+
240
+ Check for existing tool/environment managers (DevBox, mise, asdf, etc.). If found, use them automatically. If none, will ask user during interactive Q&A.
241
+
242
+ ### Step 2: Present Findings for Confirmation
243
+
244
+ **Before generating workflows, present analysis summary.** Include only what's relevant to this project - the example below is illustrative, not a template to fill out:
245
+
246
+ ```markdown
247
+ ## Analysis Summary
248
+
249
+ I analyzed your repository and found:
250
+
251
+ **Language/Framework**: Node.js 20 with Express
252
+ **Build Command**: `npm run build` (from package.json)
253
+ **Test Command**: `npm test` (from package.json)
254
+ **Existing CI**: GitHub Actions workflow found (ci.yml)
255
+
256
+ **App Definition**: Helm chart in `charts/myapp/`
257
+ **Deployment Mechanism**: GitOps with ArgoCD
258
+
259
+ Is this correct? Would you like to change anything?
260
+ ```
261
+
262
+ **User can**:
263
+ - Confirm findings β†’ proceed to workflow choices
264
+ - Correct mistakes
265
+ - Clarify ambiguities
266
+
267
+ ### Step 3: Present Workflow Choices
268
+
269
+ **Present choices relevant to this project based on analysis.** These are policy decisions that require user input. Only ask about what's applicable - for example, don't ask about container registry if there's no Dockerfile, or deployment strategy if it's a library.
270
+
271
+ Common choices include:
272
+ - **PR Workflow**: What should run on pull requests?
273
+ - **Release Trigger**: What triggers a release build?
274
+ - **Release Validation**: Should release workflow re-run checks that already passed in PR? (Re-run all = safest/slowest, Skip validation = fastest, Security scans only = compromise)
275
+ - **Container Registry**: Where to push images? (if containerized)
276
+ - **Environment Setup**: Native GitHub Actions or DevBox?
277
+ - **Deployment Strategy**: GitOps, direct, or manual? (if deployed)
278
+
279
+ Ask clarifying questions as needed:
280
+ - If branching strategy unclear: "Do you use feature branches with pull requests, or push directly to main?"
281
+ - If multiple automation options exist: "I found multiple ways to run tests. Which is the primary test command?"
282
+ - If GitOps detected but repo location unclear: "Where are your GitOps manifests stored - same repository or separate?"
283
+
284
+ ### Step 4: Generate Workflow(s)
285
+
286
+ Generate appropriate workflow(s) based on analysis and confirmed user choices.
287
+
288
+ ### Step 5: Validate Generated Workflow
289
+
290
+ Before presenting to user:
291
+
292
+ 1. **Syntax validation**: Ensure valid YAML and GitHub Actions syntax
293
+ 2. **Reference check**: Verify referenced automation exists
294
+ 3. **Secret documentation**: List required secrets clearly
295
+ 4. **Permission check**: Ensure permissions block is minimal
296
+ 5. **Deployment check**: Verify deployment steps match selected mechanism
297
+
298
+ ### Step 6: Present to User
299
+
300
+ Provide:
301
+
302
+ 1. **Generated workflow file(s)** with explanatory comments
303
+ 2. **Summary** of what was detected and decisions made
304
+ 3. **Required secrets** to configure (with setup guidance)
305
+ 4. **Required permissions and settings** - Based on what the workflow does, identify what permissions or repository settings are needed and provide instructions to configure them. Don't wait for the workflow to fail - tell users upfront what to configure.
306
+
307
+ ### Step 7: Validate
308
+
309
+ After user approves, commit the workflows following the project's established process. Trigger the workflows, monitor runs, and iterate on any failures until they pass.
310
+