buildwithjpegg 1.0.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/.claude-plugin/marketplace.json +18 -0
- package/.claude-plugin/plugin.json +12 -0
- package/.codex/INSTALL.md +67 -0
- package/.opencode/INSTALL.md +118 -0
- package/.opencode/plugins/buildwithjpegg.js +95 -0
- package/LICENSE +24 -0
- package/README.md +134 -0
- package/RELEASE-NOTES.md +7 -0
- package/agents/code-reviewer.md +48 -0
- package/commands/evaluate.md +6 -0
- package/commands/run-build.md +6 -0
- package/commands/write-blueprint.md +6 -0
- package/hooks/hooks.json +16 -0
- package/hooks/run-hook.cmd +43 -0
- package/hooks/session-start.sh +46 -0
- package/lib/skills-core.js +208 -0
- package/package.json +39 -0
- package/rules/conventions.md +22 -0
- package/rules/git.md +18 -0
- package/rules/mcp-servers.md +28 -0
- package/rules/platform.md +10 -0
- package/rules/stack.md +29 -0
- package/rules/testing.md +18 -0
- package/rules/ui-ux.md +151 -0
- package/rules/workflow.md +48 -0
- package/skills/auto-release/SKILL.md +176 -0
- package/skills/blueprint/SKILL.md +116 -0
- package/skills/build/SKILL.md +84 -0
- package/skills/ci-loop/SKILL.md +98 -0
- package/skills/craft-skill/SKILL.md +655 -0
- package/skills/craft-skill/anthropic-best-practices.md +1150 -0
- package/skills/craft-skill/examples/CLAUDE_MD_TESTING.md +189 -0
- package/skills/craft-skill/graphviz-conventions.dot +172 -0
- package/skills/craft-skill/persuasion-principles.md +187 -0
- package/skills/craft-skill/render-graphs.js +168 -0
- package/skills/craft-skill/testing-skills-with-subagents.md +384 -0
- package/skills/delegate/SKILL.md +242 -0
- package/skills/delegate/code-quality-reviewer-prompt.md +20 -0
- package/skills/delegate/implementer-prompt.md +78 -0
- package/skills/delegate/spec-reviewer-prompt.md +61 -0
- package/skills/draft-prs/SKILL.md +132 -0
- package/skills/evaluate/SKILL.md +96 -0
- package/skills/fan-out/SKILL.md +180 -0
- package/skills/handle-review/SKILL.md +213 -0
- package/skills/onboard/SKILL.md +95 -0
- package/skills/pr-stack/SKILL.md +112 -0
- package/skills/pre-ship/SKILL.md +139 -0
- package/skills/root-cause/CREATION-LOG.md +119 -0
- package/skills/root-cause/SKILL.md +296 -0
- package/skills/root-cause/condition-based-waiting-example.ts +158 -0
- package/skills/root-cause/condition-based-waiting.md +115 -0
- package/skills/root-cause/defense-in-depth.md +122 -0
- package/skills/root-cause/find-polluter.sh +63 -0
- package/skills/root-cause/root-cause-tracing.md +169 -0
- package/skills/root-cause/test-academic.md +14 -0
- package/skills/root-cause/test-pressure-1.md +58 -0
- package/skills/root-cause/test-pressure-2.md +68 -0
- package/skills/root-cause/test-pressure-3.md +69 -0
- package/skills/seek-review/SKILL.md +105 -0
- package/skills/seek-review/code-reviewer.md +146 -0
- package/skills/test-first/SKILL.md +371 -0
- package/skills/test-first/testing-anti-patterns.md +299 -0
- package/skills/worktree/SKILL.md +218 -0
- package/skills/wrap-up/SKILL.md +200 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auto-release
|
|
3
|
+
description: One-time setup that wires semantic-release into a repository for automated versioning, changelog generation, and GitHub releases from conventional commits. Use when setting up a new repo that will be publicly released.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Semantic Release Setup
|
|
8
|
+
|
|
9
|
+
Automates version bumping, changelog generation, and GitHub release creation from conventional commit history.
|
|
10
|
+
|
|
11
|
+
**Announce at start:** "Setting up semantic-release for automated versioning."
|
|
12
|
+
|
|
13
|
+
## What This Does
|
|
14
|
+
|
|
15
|
+
After setup, every merge to `main` that contains at least one `feat:` or `fix:` commit will:
|
|
16
|
+
- Determine the next version automatically (`feat` → minor, `fix` → patch, `BREAKING CHANGE` → major)
|
|
17
|
+
- Generate/update `CHANGELOG.md`
|
|
18
|
+
- Bump the version in `package.json` (or equivalent config files)
|
|
19
|
+
- Create a GitHub release with generated release notes
|
|
20
|
+
- Tag the commit with the version
|
|
21
|
+
|
|
22
|
+
## Step 1: Identify the project type
|
|
23
|
+
|
|
24
|
+
Check what config files exist to determine version file locations:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
ls package.json pyproject.toml Cargo.toml tauri.conf.json 2>/dev/null
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Note which files contain version numbers -- they all need to be updated on release.
|
|
31
|
+
|
|
32
|
+
## Step 2: Install semantic-release
|
|
33
|
+
|
|
34
|
+
For Node.js projects (or projects using it as a dev tool):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm add -D semantic-release \
|
|
38
|
+
@semantic-release/changelog \
|
|
39
|
+
@semantic-release/git \
|
|
40
|
+
@semantic-release/github \
|
|
41
|
+
@semantic-release/exec
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For Python projects without a package.json, create a minimal one:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"name": "<project-name>",
|
|
49
|
+
"private": true,
|
|
50
|
+
"devDependencies": {}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then run the pnpm install above.
|
|
55
|
+
|
|
56
|
+
## Step 3: Create `.releaserc.json`
|
|
57
|
+
|
|
58
|
+
Adapt to the project's version file locations:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"branches": ["main"],
|
|
63
|
+
"plugins": [
|
|
64
|
+
"@semantic-release/commit-analyzer",
|
|
65
|
+
"@semantic-release/release-notes-generator",
|
|
66
|
+
[
|
|
67
|
+
"@semantic-release/changelog",
|
|
68
|
+
{
|
|
69
|
+
"changelogFile": "CHANGELOG.md"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"@semantic-release/exec",
|
|
74
|
+
{
|
|
75
|
+
"prepareCmd": "node .semantic-release/bump-versions.js ${nextRelease.version}"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
"@semantic-release/git",
|
|
80
|
+
{
|
|
81
|
+
"assets": ["CHANGELOG.md", "package.json", "<other version files>"],
|
|
82
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"@semantic-release/github"
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Step 4: Create version bump script
|
|
91
|
+
|
|
92
|
+
For projects with multiple version files, create `.semantic-release/bump-versions.js`:
|
|
93
|
+
|
|
94
|
+
```javascript
|
|
95
|
+
const fs = require('fs');
|
|
96
|
+
const version = process.argv[2];
|
|
97
|
+
|
|
98
|
+
// Example: bump version in tauri.conf.json
|
|
99
|
+
const tauriConf = JSON.parse(fs.readFileSync('src-tauri/tauri.conf.json', 'utf8'));
|
|
100
|
+
tauriConf.version = version;
|
|
101
|
+
fs.writeFileSync('src-tauri/tauri.conf.json', JSON.stringify(tauriConf, null, 2));
|
|
102
|
+
|
|
103
|
+
// Example: bump version in Cargo.toml (simple string replace)
|
|
104
|
+
let cargo = fs.readFileSync('src-tauri/Cargo.toml', 'utf8');
|
|
105
|
+
cargo = cargo.replace(/^version = ".*"/m, `version = "${version}"`);
|
|
106
|
+
fs.writeFileSync('src-tauri/Cargo.toml', cargo);
|
|
107
|
+
|
|
108
|
+
console.log(`Bumped to ${version}`);
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Adapt this to the actual version files in the project.
|
|
112
|
+
|
|
113
|
+
## Step 5: Add GitHub Actions workflow
|
|
114
|
+
|
|
115
|
+
Create `.github/workflows/release.yml`:
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
name: Release
|
|
119
|
+
|
|
120
|
+
on:
|
|
121
|
+
push:
|
|
122
|
+
branches:
|
|
123
|
+
- main
|
|
124
|
+
|
|
125
|
+
permissions:
|
|
126
|
+
contents: write
|
|
127
|
+
issues: write
|
|
128
|
+
pull-requests: write
|
|
129
|
+
|
|
130
|
+
jobs:
|
|
131
|
+
release:
|
|
132
|
+
runs-on: ubuntu-latest
|
|
133
|
+
steps:
|
|
134
|
+
- uses: actions/checkout@v4
|
|
135
|
+
with:
|
|
136
|
+
fetch-depth: 0
|
|
137
|
+
persist-credentials: false
|
|
138
|
+
|
|
139
|
+
- uses: actions/setup-node@v4
|
|
140
|
+
with:
|
|
141
|
+
node-version: 20
|
|
142
|
+
|
|
143
|
+
- name: Install dependencies
|
|
144
|
+
run: pnpm install --frozen-lockfile
|
|
145
|
+
|
|
146
|
+
- name: Release
|
|
147
|
+
env:
|
|
148
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
149
|
+
run: pnpm exec semantic-release
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Note:** If the existing release workflow already handles binary builds (Tauri, native apps), integrate semantic-release as the version-determination step that runs *before* the build, not as a replacement for the entire workflow. In that case, use `semantic-release` in `--dry-run` mode to get the next version, pass it to the build, then tag after a successful build.
|
|
153
|
+
|
|
154
|
+
## Step 6: Add `CHANGELOG.md` to `.gitignore` exceptions
|
|
155
|
+
|
|
156
|
+
If `CHANGELOG.md` is currently gitignored, remove it. semantic-release commits it.
|
|
157
|
+
|
|
158
|
+
## Step 7: Verify
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Dry run to confirm configuration is valid
|
|
162
|
+
pnpm exec semantic-release --dry-run
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Check output for errors. Common issues:
|
|
166
|
+
- Missing `GITHUB_TOKEN` locally (expected -- it runs in CI only)
|
|
167
|
+
- Version files not found by bump script
|
|
168
|
+
- Branch name mismatch
|
|
169
|
+
|
|
170
|
+
## What NOT to change
|
|
171
|
+
|
|
172
|
+
Do not modify the existing deploy/release scripts unless the user explicitly asks. semantic-release adds automated versioning on top of the existing workflow -- it does not replace CI/CD pipelines or build processes.
|
|
173
|
+
|
|
174
|
+
## After Setup
|
|
175
|
+
|
|
176
|
+
The manual version bump step in `deploy-application.sh` (or equivalent) can be removed once you confirm semantic-release is working correctly. Do not remove it until at least one automated release has succeeded.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint
|
|
3
|
+
description: Use when you have a spec or requirements for a multi-step task, before touching code
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing Plans
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
|
|
11
|
+
|
|
12
|
+
Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
|
|
13
|
+
|
|
14
|
+
**Announce at start:** "I'm using the blueprint skill to create the implementation plan."
|
|
15
|
+
|
|
16
|
+
**Context:** This should be run in a dedicated worktree (created by evaluate skill).
|
|
17
|
+
|
|
18
|
+
**Save plans to:** `docs/plans/YYYY-MM-DD-<feature-name>.md`
|
|
19
|
+
|
|
20
|
+
## Bite-Sized Task Granularity
|
|
21
|
+
|
|
22
|
+
**Each step is one action (2-5 minutes):**
|
|
23
|
+
- "Write the failing test" - step
|
|
24
|
+
- "Run it to make sure it fails" - step
|
|
25
|
+
- "Implement the minimal code to make the test pass" - step
|
|
26
|
+
- "Run the tests and make sure they pass" - step
|
|
27
|
+
- "Commit" - step
|
|
28
|
+
|
|
29
|
+
## Plan Document Header
|
|
30
|
+
|
|
31
|
+
**Every plan MUST start with this header:**
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
# [Feature Name] Implementation Plan
|
|
35
|
+
|
|
36
|
+
> **For Claude:** REQUIRED SUB-SKILL: Use jpegg:build to implement this plan task-by-task.
|
|
37
|
+
|
|
38
|
+
**Goal:** [One sentence describing what this builds]
|
|
39
|
+
|
|
40
|
+
**Architecture:** [2-3 sentences about approach]
|
|
41
|
+
|
|
42
|
+
**Tech Stack:** [Key technologies/libraries]
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Task Structure
|
|
48
|
+
|
|
49
|
+
````markdown
|
|
50
|
+
### Task N: [Component Name]
|
|
51
|
+
|
|
52
|
+
**Files:**
|
|
53
|
+
- Create: `exact/path/to/file.py`
|
|
54
|
+
- Modify: `exact/path/to/existing.py:123-145`
|
|
55
|
+
- Test: `tests/exact/path/to/test.py`
|
|
56
|
+
|
|
57
|
+
**Step 1: Write the failing test**
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
def test_specific_behavior():
|
|
61
|
+
result = function(input)
|
|
62
|
+
assert result == expected
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Step 2: Run test to verify it fails**
|
|
66
|
+
|
|
67
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
68
|
+
Expected: FAIL with "function not defined"
|
|
69
|
+
|
|
70
|
+
**Step 3: Write minimal implementation**
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
def function(input):
|
|
74
|
+
return expected
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Step 4: Run test to verify it passes**
|
|
78
|
+
|
|
79
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
80
|
+
Expected: PASS
|
|
81
|
+
|
|
82
|
+
**Step 5: Commit**
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git add tests/path/test.py src/path/file.py
|
|
86
|
+
git commit -m "feat: add specific feature"
|
|
87
|
+
```
|
|
88
|
+
````
|
|
89
|
+
|
|
90
|
+
## Remember
|
|
91
|
+
- Exact file paths always
|
|
92
|
+
- Complete code in plan (not "add validation")
|
|
93
|
+
- Exact commands with expected output
|
|
94
|
+
- Reference relevant skills with @ syntax
|
|
95
|
+
- DRY, YAGNI, TDD, frequent commits
|
|
96
|
+
|
|
97
|
+
## Execution Handoff
|
|
98
|
+
|
|
99
|
+
After saving the plan, offer execution choice:
|
|
100
|
+
|
|
101
|
+
**"Plan complete and saved to `docs/plans/<filename>.md`. Two execution options:**
|
|
102
|
+
|
|
103
|
+
**1. Subagent-Driven (this session)** - I dispatch fresh subagent per task, review between tasks, fast iteration
|
|
104
|
+
|
|
105
|
+
**2. Parallel Session (separate)** - Open new session with build, batch execution with checkpoints
|
|
106
|
+
|
|
107
|
+
**Which approach?"**
|
|
108
|
+
|
|
109
|
+
**If Subagent-Driven chosen:**
|
|
110
|
+
- **REQUIRED SUB-SKILL:** Use jpegg:delegate
|
|
111
|
+
- Stay in this session
|
|
112
|
+
- Fresh subagent per task + code review
|
|
113
|
+
|
|
114
|
+
**If Parallel Session chosen:**
|
|
115
|
+
- Guide them to open new session in worktree
|
|
116
|
+
- **REQUIRED SUB-SKILL:** New session uses jpegg:build
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build
|
|
3
|
+
description: Use when you have a written implementation plan to execute in a separate session with review checkpoints
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Executing Plans
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Load plan, review critically, execute tasks in batches, report for review between batches.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Batch execution with checkpoints for architect review.
|
|
13
|
+
|
|
14
|
+
**Announce at start:** "I'm using the build skill to implement this plan."
|
|
15
|
+
|
|
16
|
+
## The Process
|
|
17
|
+
|
|
18
|
+
### Step 1: Load and Review Plan
|
|
19
|
+
1. Read plan file
|
|
20
|
+
2. Review critically - identify any questions or concerns about the plan
|
|
21
|
+
3. If concerns: Raise them with your human partner before starting
|
|
22
|
+
4. If no concerns: Create TodoWrite and proceed
|
|
23
|
+
|
|
24
|
+
### Step 2: Execute Batch
|
|
25
|
+
**Default: First 3 tasks**
|
|
26
|
+
|
|
27
|
+
For each task:
|
|
28
|
+
1. Mark as in_progress
|
|
29
|
+
2. Follow each step exactly (plan has bite-sized steps)
|
|
30
|
+
3. Run verifications as specified
|
|
31
|
+
4. Mark as completed
|
|
32
|
+
|
|
33
|
+
### Step 3: Report
|
|
34
|
+
When batch complete:
|
|
35
|
+
- Show what was implemented
|
|
36
|
+
- Show verification output
|
|
37
|
+
- Say: "Ready for feedback."
|
|
38
|
+
|
|
39
|
+
### Step 4: Continue
|
|
40
|
+
Based on feedback:
|
|
41
|
+
- Apply changes if needed
|
|
42
|
+
- Execute next batch
|
|
43
|
+
- Repeat until complete
|
|
44
|
+
|
|
45
|
+
### Step 5: Complete Development
|
|
46
|
+
|
|
47
|
+
After all tasks complete and verified:
|
|
48
|
+
- Announce: "I'm using the wrap-up skill to complete this work."
|
|
49
|
+
- **REQUIRED SUB-SKILL:** Use jpegg:wrap-up
|
|
50
|
+
- Follow that skill to verify tests, present options, execute choice
|
|
51
|
+
|
|
52
|
+
## When to Stop and Ask for Help
|
|
53
|
+
|
|
54
|
+
**STOP executing immediately when:**
|
|
55
|
+
- Hit a blocker mid-batch (missing dependency, test fails, instruction unclear)
|
|
56
|
+
- Plan has critical gaps preventing starting
|
|
57
|
+
- You don't understand an instruction
|
|
58
|
+
- Verification fails repeatedly
|
|
59
|
+
|
|
60
|
+
**Ask for clarification rather than guessing.**
|
|
61
|
+
|
|
62
|
+
## When to Revisit Earlier Steps
|
|
63
|
+
|
|
64
|
+
**Return to Review (Step 1) when:**
|
|
65
|
+
- Partner updates the plan based on your feedback
|
|
66
|
+
- Fundamental approach needs rethinking
|
|
67
|
+
|
|
68
|
+
**Don't force through blockers** - stop and ask.
|
|
69
|
+
|
|
70
|
+
## Remember
|
|
71
|
+
- Review plan critically first
|
|
72
|
+
- Follow plan steps exactly
|
|
73
|
+
- Don't skip verifications
|
|
74
|
+
- Reference skills when plan says to
|
|
75
|
+
- Between batches: just report and wait
|
|
76
|
+
- Stop when blocked, don't guess
|
|
77
|
+
- Never start implementation on main/master branch without explicit user consent
|
|
78
|
+
|
|
79
|
+
## Integration
|
|
80
|
+
|
|
81
|
+
**Required workflow skills:**
|
|
82
|
+
- **jpegg:worktree** - REQUIRED: Set up isolated workspace before starting
|
|
83
|
+
- **jpegg:blueprint** - Creates the plan this skill executes
|
|
84
|
+
- **jpegg:wrap-up** - Complete development after all tasks
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ci-loop
|
|
3
|
+
description: Use after creating a PR to monitor CI and automatically fix failures before reporting back. Fires automatically after PR creation. Do not report the PR as ready until CI is green.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CI Watch and Fix
|
|
7
|
+
|
|
8
|
+
**Announce at start:** "Monitoring CI for this PR -- will fix any failures before reporting back."
|
|
9
|
+
|
|
10
|
+
## Current PR Context
|
|
11
|
+
- Branch: !`git branch --show-current`
|
|
12
|
+
- Open PRs: !`gh pr list --head $(git branch --show-current) --json number,title,url,statusCheckRollup 2>/dev/null`
|
|
13
|
+
|
|
14
|
+
## Process
|
|
15
|
+
|
|
16
|
+
### Step 1: Wait for CI to start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
gh run list --branch $(git branch --show-current) --limit 5
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If no runs found yet, wait 15 seconds and retry. CI may not have triggered immediately after push.
|
|
23
|
+
|
|
24
|
+
### Step 2: Watch the run
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Get the most recent run ID
|
|
28
|
+
RUN_ID=$(gh run list --branch $(git branch --show-current) --limit 1 --json databaseId -q '.[0].databaseId')
|
|
29
|
+
|
|
30
|
+
# Watch it to completion
|
|
31
|
+
gh run watch $RUN_ID
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Step 3: Check the result
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
gh run view $RUN_ID --json conclusion -q '.conclusion'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**If `success`:** Report back. CI is green. PR is ready for review.
|
|
41
|
+
|
|
42
|
+
**If `failure`:** Proceed to Step 4.
|
|
43
|
+
|
|
44
|
+
**If `cancelled` or `skipped`:** Note it and report -- do not attempt to fix.
|
|
45
|
+
|
|
46
|
+
### Step 4: Diagnose the failure
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Get failed job details
|
|
50
|
+
gh run view $RUN_ID --log-failed
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Read the full failure output. Identify:
|
|
54
|
+
- Which job failed
|
|
55
|
+
- The exact error message and file/line if available
|
|
56
|
+
- Whether it is a test failure, lint error, type error, or build error
|
|
57
|
+
|
|
58
|
+
### Step 5: Fix the failure
|
|
59
|
+
|
|
60
|
+
Apply the minimal fix. Do not refactor surrounding code.
|
|
61
|
+
|
|
62
|
+
For test failures: check if the test expectation is wrong (requirement changed) or the implementation is wrong. Fix the right one.
|
|
63
|
+
|
|
64
|
+
For lint/type errors: fix the specific violation only.
|
|
65
|
+
|
|
66
|
+
After fixing:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git add <changed files>
|
|
70
|
+
git commit -m "fix: address CI failure -- <brief description>"
|
|
71
|
+
git push
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Step 6: Repeat
|
|
75
|
+
|
|
76
|
+
Go back to Step 1. Watch the new run triggered by the push.
|
|
77
|
+
|
|
78
|
+
**Attempt limit:** After 3 fix attempts with continued failures, stop and report:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
CI is still failing after 3 fix attempts.
|
|
82
|
+
|
|
83
|
+
Failing job: <name>
|
|
84
|
+
Error: <message>
|
|
85
|
+
|
|
86
|
+
Cannot resolve automatically -- needs your attention.
|
|
87
|
+
PR: <url>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## When CI is Green
|
|
91
|
+
|
|
92
|
+
Report back concisely:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
CI passed. PR is ready for review: <url>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Do not summarize what was fixed unless asked.
|