ln-732-cicd-generator
Type: L3 Worker
Category: 7XX Project Bootstrap
Parent: ln-730-devops-setup
Generates GitHub Actions CI pipeline for automated testing and validation.
Purpose & Scope
Creates CI/CD workflow for GitHub:
- Does: Generate .github/workflows/ci.yml with lint, test, build, docker jobs
- Does NOT: Configure deployment, manage secrets, set up CD pipelines
Inputs
| Input |
Source |
Description |
| Stack Type |
ln-730 coordinator |
backend-dotnet, backend-python |
| Versions |
Auto-detected |
Node.js, .NET or Python versions |
| Frontend Path |
Auto-detected |
Path to frontend directory |
| Build Commands |
Auto-detected |
npm scripts, dotnet/pytest commands |
Outputs
| File |
Purpose |
Template |
.github/workflows/ci.yml |
Main CI pipeline |
github_ci_dotnet.template.yml or github_ci_python.template.yml |
Workflow
Phase 1: Stack Analysis
Determine which template to use:
| Detection |
Backend Template |
.sln or .csproj present |
github_ci_dotnet.template.yml |
requirements.txt or pyproject.toml present |
github_ci_python.template.yml |
Detect commands:
- Frontend: Read scripts from package.json (lint, build, test)
- .NET: Standard dotnet restore/build/test
- Python: pip install, ruff lint, pytest
Phase 2: Variable Substitution
Replace template variables:
| Variable |
Source |
Default |
{{NODE_VERSION}} |
package.json engines |
22 |
{{DOTNET_VERSION}} |
*.csproj TargetFramework |
9.0.x |
{{PYTHON_VERSION}} |
pyproject.toml |
3.12 |
{{FRONTEND_PATH}} |
Directory detection |
src/frontend |
Phase 3: Directory Creation
Create .github/workflows/ directory if not exists.
Phase 4: File Generation
Generate ci.yml from selected template:
- Check if workflow already exists (warn before overwrite)
- Apply variable substitution
- Write to
.github/workflows/ci.yml
- Validate YAML syntax
Generated Pipeline Structure
Jobs Overview
| Job |
Purpose |
Dependencies |
| frontend |
Lint, build, test React/Vite |
None |
| backend |
Build, test .NET or Python |
None |
| docker |
Build images, health checks |
frontend, backend |
Frontend Job Steps
- Checkout code
- Setup Node.js with caching
- Install dependencies (
npm ci)
- Run linter (
npm run lint)
- Build application (
npm run build)
- Run tests (
npm test)
Backend Job Steps (.NET)
- Checkout code
- Setup .NET SDK
- Restore dependencies (
dotnet restore)
- Build (
dotnet build)
- Run tests (
dotnet test)
Backend Job Steps (Python)
- Checkout code
- Setup Python with pip caching
- Install dependencies (
pip install -r requirements.txt)
- Run linter (
ruff check)
- Run tests (
pytest)
Docker Job Steps
- Checkout code
- Build images (
docker compose build)
- Start containers (
docker compose up -d)
- Wait for startup (30 seconds)
- Health check frontend (port 3000)
- Health check backend (port 5000/8000)
- Show logs on failure
- Stop containers (
docker compose down)
Triggers
| Event |
Branches |
| Push |
main, develop |
| Pull Request |
main |
Best Practices Applied
| Practice |
Implementation |
| Dependency caching |
npm cache, pip cache |
| Pinned versions |
actions/checkout@v4, setup-node@v4 |
| Parallel jobs |
frontend and backend run in parallel |
| Fail fast |
docker job waits for both to succeed |
| Clean up |
docker compose down runs always |
| Debug support |
logs shown on failure |
Quality Criteria
Generated workflow must:
Critical Notes
- GitHub Actions Only: This skill generates only GitHub Actions workflows. No Azure/GitLab support.
- Template-based: Use templates from references/. Do NOT hardcode workflow contents.
- Idempotent: Check if .github/workflows/ exists. Warn before overwriting ci.yml.
- Version Detection: Use detected versions, not hardcoded defaults.
Reference Files
| File |
Purpose |
| github_ci.template.yml |
Full template with comments |
| github_ci_dotnet.template.yml |
Compact .NET stack template |
| github_ci_python.template.yml |
Compact Python stack template |
Version: 1.1.0
Last Updated: 2026-01-10
1---2name: ln-732-cicd-generator3description: Generates GitHub Actions CI workflow configuration4---5
6# ln-732-cicd-generator
7
8**Type:** L3 Worker
9**Category:** 7XX Project Bootstrap
10**Parent:** ln-730-devops-setup
11
12Generates GitHub Actions CI pipeline for automated testing and validation.
13
14---
15
16## Purpose & Scope
17
18Creates CI/CD workflow for GitHub:
19- **Does**: Generate .github/workflows/ci.yml with lint, test, build, docker jobs
20- **Does NOT**: Configure deployment, manage secrets, set up CD pipelines
21
22---
23
24## Inputs
25
26| Input | Source | Description |
27|-------|--------|-------------|
28| **Stack Type** | ln-730 coordinator | backend-dotnet, backend-python |
29| **Versions** | Auto-detected | Node.js, .NET or Python versions |
30| **Frontend Path** | Auto-detected | Path to frontend directory |
31| **Build Commands** | Auto-detected | npm scripts, dotnet/pytest commands |
32
33---
34
35## Outputs
36
37| File | Purpose | Template |
38|------|---------|----------|
39| `.github/workflows/ci.yml` | Main CI pipeline | [github_ci_dotnet.template.yml](references/github_ci_dotnet.template.yml) or [github_ci_python.template.yml](references/github_ci_python.template.yml) |
40
41---
42
43## Workflow
44
45### Phase 1: Stack Analysis
46
47Determine which template to use:
48
49| Detection | Backend Template |
50|-----------|------------------|
51| `.sln` or `.csproj` present | github_ci_dotnet.template.yml |
52| `requirements.txt` or `pyproject.toml` present | github_ci_python.template.yml |
53
54Detect commands:
55- Frontend: Read scripts from package.json (lint, build, test)
56- .NET: Standard dotnet restore/build/test
57- Python: pip install, ruff lint, pytest
58
59### Phase 2: Variable Substitution
60
61Replace template variables:
62
63| Variable | Source | Default |
64|----------|--------|---------|
65| `{{NODE_VERSION}}` | package.json engines | 22 |
66| `{{DOTNET_VERSION}}` | *.csproj TargetFramework | 9.0.x |
67| `{{PYTHON_VERSION}}` | pyproject.toml | 3.12 |
68| `{{FRONTEND_PATH}}` | Directory detection | src/frontend |
69
70### Phase 3: Directory Creation
71
72Create `.github/workflows/` directory if not exists.
73
74### Phase 4: File Generation
75
76Generate ci.yml from selected template:
771. Check if workflow already exists (warn before overwrite)
782. Apply variable substitution
793. Write to `.github/workflows/ci.yml`
804. Validate YAML syntax
81
82---
83
84## Generated Pipeline Structure
85
86### Jobs Overview
87
88| Job | Purpose | Dependencies |
89|-----|---------|--------------|
90| **frontend** | Lint, build, test React/Vite | None |
91| **backend** | Build, test .NET or Python | None |
92| **docker** | Build images, health checks | frontend, backend |
93
94### Frontend Job Steps
95
961. Checkout code
972. Setup Node.js with caching
983. Install dependencies (`npm ci`)
994. Run linter (`npm run lint`)
1005. Build application (`npm run build`)
1016. Run tests (`npm test`)
102
103### Backend Job Steps (.NET)
104
1051. Checkout code
1062. Setup .NET SDK
1073. Restore dependencies (`dotnet restore`)
1084. Build (`dotnet build`)
1095. Run tests (`dotnet test`)
110
111### Backend Job Steps (Python)
112
1131. Checkout code
1142. Setup Python with pip caching
1153. Install dependencies (`pip install -r requirements.txt`)
1164. Run linter (`ruff check`)
1175. Run tests (`pytest`)
118
119### Docker Job Steps
120
1211. Checkout code
1222. Build images (`docker compose build`)
1233. Start containers (`docker compose up -d`)
1244. Wait for startup (30 seconds)
1255. Health check frontend (port 3000)
1266. Health check backend (port 5000/8000)
1277. Show logs on failure
1288. Stop containers (`docker compose down`)
129
130---
131
132## Triggers
133
134| Event | Branches |
135|-------|----------|
136| **Push** | main, develop |
137| **Pull Request** | main |
138
139---
140
141## Best Practices Applied
142
143| Practice | Implementation |
144|----------|----------------|
145| **Dependency caching** | npm cache, pip cache |
146| **Pinned versions** | actions/checkout@v4, setup-node@v4 |
147| **Parallel jobs** | frontend and backend run in parallel |
148| **Fail fast** | docker job waits for both to succeed |
149| **Clean up** | docker compose down runs always |
150| **Debug support** | logs shown on failure |
151
152---
153
154## Quality Criteria
155
156Generated workflow must:
157- [ ] Pass YAML syntax validation
158- [ ] Use pinned action versions (not `@latest`)
159- [ ] Include dependency caching
160- [ ] Have health checks for docker job
161- [ ] Clean up resources on completion
162
163---
164
165## Critical Notes
166
1671. **GitHub Actions Only**: This skill generates only GitHub Actions workflows. No Azure/GitLab support.
1682. **Template-based**: Use templates from references/. Do NOT hardcode workflow contents.
1693. **Idempotent**: Check if .github/workflows/ exists. Warn before overwriting ci.yml.
1704. **Version Detection**: Use detected versions, not hardcoded defaults.
171
172---
173
174## Reference Files
175
176| File | Purpose |
177|------|---------|
178| [github_ci.template.yml](references/github_ci.template.yml) | Full template with comments |
179| [github_ci_dotnet.template.yml](references/github_ci_dotnet.template.yml) | Compact .NET stack template |
180| [github_ci_python.template.yml](references/github_ci_python.template.yml) | Compact Python stack template |
181
182---
183
184**Version:** 1.1.0
185**Last Updated:** 2026-01-10