5.4 KiB
5.4 KiB
name, description, nextStepFile, outputFile
| name | description | nextStepFile | outputFile |
|---|---|---|---|
| step-01-preflight | Verify prerequisites and detect CI platform | ./step-02-generate-pipeline.md | {test_artifacts}/ci-pipeline-progress.md |
Step 1: Preflight Checks
STEP GOAL
Verify CI prerequisites and determine target CI platform.
MANDATORY EXECUTION RULES
- 📖 Read the entire step file before acting
- ✅ Speak in
{communication_language} - 🚫 Halt if requirements fail
EXECUTION PROTOCOLS:
- 🎯 Follow the MANDATORY SEQUENCE exactly
- 💾 Record outputs before proceeding
- 📖 Load the next step only when instructed
CONTEXT BOUNDARIES:
- Available context: config, loaded artifacts, and knowledge fragments
- Focus: this step's goal only
- Limits: do not execute future steps
- Dependencies: prior steps' outputs (if any)
MANDATORY SEQUENCE
CRITICAL: Follow this sequence exactly. Do not skip, reorder, or improvise.
1. Verify Git Repository
.git/exists- Remote configured (if available)
If missing: HALT with "Git repository required for CI/CD setup."
2. Detect Test Stack Type
Determine the project's test stack type (test_stack_type) using the following algorithm:
- If
test_stack_typeis explicitly set in config (not"auto"), use that value. - Otherwise, auto-detect by scanning project manifests:
- Frontend indicators:
playwright.config.*,cypress.config.*,vite.config.*,next.config.*,src/components/,src/pages/,src/app/ - Backend indicators:
pyproject.toml,pom.xml/build.gradle,go.mod,*.csproj/*.sln,Gemfile,Cargo.toml,jest.config.*,vitest.config.*,src/routes/,src/controllers/,src/api/,Dockerfile,serverless.yml - Both present →
fullstack - Only frontend →
frontend - Only backend →
backend - Cannot determine → default to
fullstackand note assumption
- Frontend indicators:
Record detected test_stack_type in step output.
3. Verify Test Framework
- Check for framework configuration based on detected stack:
- Frontend/Fullstack:
playwright.config.*orcypress.config.*exists - Backend (Node.js):
jest.config.*orvitest.config.*or test scripts inpackage.json - Backend (Python):
pyproject.tomlwith[tool.pytest]orpytest.iniorsetup.cfgwith pytest config - Backend (Java/Kotlin):
pom.xmlwith surefire/failsafe plugins orbuild.gradlewith test task - Backend (Go):
*_test.gofiles present (Go convention — no config file needed) - Backend (C#/.NET):
*.csprojwith xUnit/NUnit/MSTest references - Backend (Ruby):
Gemfilewith rspec or.rspecconfig file
- Frontend/Fullstack:
- If
test_frameworkis"auto", detect from config files and project manifests found - Verify test dependencies are installed (language-appropriate package manager)
If missing: HALT with "Run framework workflow first."
4. Ensure Tests Pass Locally
- Run the main test command based on detected stack and framework:
- Node.js:
npm testornpm run test:e2e - Python:
pytestorpython -m pytest - Java:
mvn testorgradle test - Go:
go test ./... - C#/.NET:
dotnet test - Ruby:
bundle exec rspec
- Node.js:
- If failing: HALT and request fixes before CI setup
5. Detect CI Platform
- If
ci_platformis explicitly set in config (not"auto"), use that value. - Otherwise, scan for existing CI configuration files:
.github/workflows/*.yml→github-actions.gitlab-ci.yml→gitlab-ciJenkinsfile→jenkinsazure-pipelines.yml→azure-devops.harness/*.yaml→harness.circleci/config.yml→circle-ci
- If found, ask whether to update or replace
- If not found, infer from git remote (github.com →
github-actions, gitlab.com →gitlab-ci) - If still unresolved, default to
github-actions
Record detected ci_platform in step output.
6. Read Environment Context
- Read environment context based on detected stack:
- Node.js: Read
.nvmrcif present (default to Node 24+ LTS if missing); readpackage.jsonfor dependency caching strategy - Python: Read
.python-versionorpyproject.tomlfor Python version; notepip/poetry/pipenvfor caching - Java: Read
pom.xml/build.gradlefor Java version; note Maven/Gradle for caching - Go: Read
go.modfor Go version; note Go module cache path - C#/.NET: Read
*.csproj/global.jsonfor .NET SDK version; note NuGet cache - Ruby: Read
.ruby-versionorGemfilefor Ruby version; note Bundler cache
- Node.js: Read
7. Save Progress
Save this step's accumulated work to {outputFile}.
-
If
{outputFile}does not exist (first save), create it with YAML frontmatter:--- stepsCompleted: ['step-01-preflight'] lastStep: 'step-01-preflight' lastSaved: '{date}' ---Then write this step's output below the frontmatter.
-
If
{outputFile}already exists, update:- Add
'step-01-preflight'tostepsCompletedarray (only if not already present) - Set
lastStep: 'step-01-preflight' - Set
lastSaved: '{date}' - Append this step's output to the appropriate section of the document.
- Add
Load next step: {nextStepFile}
🚨 SYSTEM SUCCESS/FAILURE METRICS:
✅ SUCCESS:
- Step completed in full with required outputs
❌ SYSTEM FAILURE:
- Skipped sequence steps or missing outputs Master Rule: Skipping steps is FORBIDDEN.