@thecraftlab/pipecraft-skill 0.47.10
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 +59 -0
- package/SKILL.md +208 -0
- package/bin.js +35 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Pipecraft agent skill
|
|
2
|
+
|
|
3
|
+
Teaches an AI coding assistant how to drive [Pipecraft](https://pipecraft.thecraftlab.dev),
|
|
4
|
+
the trunk-based CI/CD workflow generator for GitHub Actions.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npx @thecraftlab/pipecraft-skill # install into this project
|
|
10
|
+
npx @thecraftlab/pipecraft-skill --list # show which tools this project uses
|
|
11
|
+
npx @thecraftlab/pipecraft-skill --uninstall
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Every flag of `pipecraft skill` works here; this package forwards to it.
|
|
15
|
+
|
|
16
|
+
If you already have the CLI, `npx pipecraft skill` does the same thing with one fewer
|
|
17
|
+
package.
|
|
18
|
+
|
|
19
|
+
Via [OpenSkills](https://www.npmjs.com/package/openskills), which reads `SKILL.md` straight
|
|
20
|
+
from the repository:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx openskills install the-craftlab/pipecraft
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Where it goes
|
|
27
|
+
|
|
28
|
+
| Tool | File | Written as |
|
|
29
|
+
| ---------------- | ----------------------------------- | ---------------------- |
|
|
30
|
+
| Claude Code | `.claude/skills/pipecraft/SKILL.md` | whole file |
|
|
31
|
+
| Cursor | `.cursorrules` | block inside your file |
|
|
32
|
+
| GitHub Copilot | `.github/copilot-instructions.md` | block inside your file |
|
|
33
|
+
| Windsurf | `.windsurfrules` | block inside your file |
|
|
34
|
+
| Cline / Roo Code | `.clinerules` | block inside your file |
|
|
35
|
+
| Codex | `AGENTS.md` | block inside your file |
|
|
36
|
+
|
|
37
|
+
Five of those files are yours and may already hold your own instructions. Pipecraft writes
|
|
38
|
+
only between `<!-- pipecraft:start -->` and `<!-- pipecraft:end -->` and changes nothing
|
|
39
|
+
outside those markers. Reinstalling replaces that block in place; `--uninstall` removes it
|
|
40
|
+
and leaves the rest of the file.
|
|
41
|
+
|
|
42
|
+
Without `--target`, the command installs for the tools whose files or directories already
|
|
43
|
+
exist in the project, and installs every format when it finds none.
|
|
44
|
+
|
|
45
|
+
## What the skill covers
|
|
46
|
+
|
|
47
|
+
- Setting Pipecraft up from scratch, and what `init` asks
|
|
48
|
+
- Configuring domains, branch flows, and promotion
|
|
49
|
+
- `validate` against `doctor`, and which to reach for
|
|
50
|
+
- Reading generated workflows, and which jobs are yours to edit
|
|
51
|
+
- The behaviours that surprise people: `autoPromote` controls the merge rather than the PR,
|
|
52
|
+
and only commits GitHub itself authored will promote
|
|
53
|
+
|
|
54
|
+
`SKILL.md` in this package is the same file the repository carries at
|
|
55
|
+
`skills/pipecraft-cli/SKILL.md`. There is one copy, so the two cannot disagree.
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
MIT
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pipecraft
|
|
3
|
+
description: Help users set up, configure, and use the Pipecraft CLI for GitHub Actions workflow generation. Assists with CI/CD setup, workflow generation, branch promotion, domain configuration, and troubleshooting. Invoke when users ask about trunk-based development, GitHub Actions pipelines, or Pipecraft configuration.
|
|
4
|
+
argument-hint: '[command|question]'
|
|
5
|
+
allowed-tools: Read, Grep, Glob, Bash(pipecraft *), Bash(npx pipecraft *), Bash(cat .pipecraftrc*), Bash(ls -la .pipecraftrc* .github/workflows/pipeline.yml 2>/dev/null), Edit, Write
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Pipecraft CLI Assistant
|
|
9
|
+
|
|
10
|
+
Help users with **Pipecraft** - a trunk-based CI/CD workflow generator for GitHub Actions.
|
|
11
|
+
|
|
12
|
+
<!-- claude-only:start -->
|
|
13
|
+
|
|
14
|
+
## Current Project State
|
|
15
|
+
|
|
16
|
+
- Pipecraft version: !`pipecraft --version 2>/dev/null || echo "not installed"`
|
|
17
|
+
- Config file: !`ls .pipecraftrc* 2>/dev/null | head -1 || echo "none found"`
|
|
18
|
+
- Pipeline exists: !`test -f .github/workflows/pipeline.yml && echo "yes" || echo "no"`
|
|
19
|
+
- Current branch: !`git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "not a git repo"`
|
|
20
|
+
|
|
21
|
+
<!-- claude-only:end -->
|
|
22
|
+
|
|
23
|
+
**Documentation:** https://pipecraft.thecraftlab.dev
|
|
24
|
+
**GitHub:** https://github.com/the-craftlab/pipecraft
|
|
25
|
+
|
|
26
|
+
## Commands Reference
|
|
27
|
+
|
|
28
|
+
| Command | Purpose | Key Flags |
|
|
29
|
+
| ---------------------------- | ------------------------------- | ---------------------------------------------------- |
|
|
30
|
+
| `pipecraft init` | Create `.pipecraftrc` config | `--yes`, `--force`, `--with-versioning` |
|
|
31
|
+
| `pipecraft generate` | Generate workflows | `--dry-run`, `--verbose`, `--debug`, `--skip-checks` |
|
|
32
|
+
| `pipecraft validate` | Check config syntax | - |
|
|
33
|
+
| `pipecraft doctor` | Health check entire setup | - |
|
|
34
|
+
| `pipecraft get-config <key>` | Read config value | `--format json\|raw` |
|
|
35
|
+
| `pipecraft setup` | Create branches from branchFlow | `--force` |
|
|
36
|
+
| `pipecraft setup-github` | Configure GitHub permissions | `--apply` |
|
|
37
|
+
| `pipecraft version` | Version management | `--check` |
|
|
38
|
+
| `pipecraft skill` | Install this skill for AI tools | `--list`, `--uninstall`, `--target`, `--global` |
|
|
39
|
+
|
|
40
|
+
### validate vs doctor
|
|
41
|
+
|
|
42
|
+
| Command | Scope | When to use |
|
|
43
|
+
| ---------- | ------------------ | --------------------------------------------- |
|
|
44
|
+
| `validate` | Config syntax only | After editing config, before `generate` |
|
|
45
|
+
| `doctor` | Entire setup | Troubleshooting, health checks, after cloning |
|
|
46
|
+
|
|
47
|
+
## Configuration
|
|
48
|
+
|
|
49
|
+
### Config File Locations
|
|
50
|
+
|
|
51
|
+
Pipecraft searches (via cosmiconfig):
|
|
52
|
+
|
|
53
|
+
1. `--config <path>` flag
|
|
54
|
+
2. `.pipecraftrc` (YAML or JSON) **recommended**
|
|
55
|
+
3. `.pipecraftrc.json`, `.pipecraftrc.yaml`, `.pipecraftrc.yml`
|
|
56
|
+
4. `.pipecraftrc.js`, `pipecraft.config.js`
|
|
57
|
+
5. `"pipecraft"` key in `package.json`
|
|
58
|
+
|
|
59
|
+
### JSON Schema
|
|
60
|
+
|
|
61
|
+
Add to config for IDE validation:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"$schema": "https://raw.githubusercontent.com/the-craftlab/pipecraft/main/.pipecraft-schema.json"
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Required Fields
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
ciProvider: github # Only 'github' fully supported
|
|
73
|
+
mergeStrategy: fast-forward # or 'merge'
|
|
74
|
+
requireConventionalCommits: true
|
|
75
|
+
initialBranch: develop # MUST be first in branchFlow
|
|
76
|
+
finalBranch: main # MUST be last in branchFlow
|
|
77
|
+
branchFlow: [develop, main] # Ordered promotion path
|
|
78
|
+
domains:
|
|
79
|
+
app:
|
|
80
|
+
paths: ['src/**']
|
|
81
|
+
description: 'App code'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Optional Fields
|
|
85
|
+
|
|
86
|
+
| Field | Type | Default | Purpose |
|
|
87
|
+
| -------------------- | ------------- | -------- | --------------------------------------------------------- |
|
|
88
|
+
| `autoPromote` | bool/object | `false` | Auto-promote between branches |
|
|
89
|
+
| `mergeMethod` | string/object | `auto` | `merge`, `squash`, `rebase` |
|
|
90
|
+
| `actionSourceMode` | string | `local` | `local`, `remote`, `source` |
|
|
91
|
+
| `actionVersion` | string | `v1` | Version for remote actions |
|
|
92
|
+
| `versioning.enabled` | bool | - | Enable release-it versioning |
|
|
93
|
+
| `semver.bumpRules` | object | built-in | Commit type → bump size, e.g. `feat: minor`, `fix: patch` |
|
|
94
|
+
|
|
95
|
+
### Domain Configuration
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
domains:
|
|
99
|
+
api:
|
|
100
|
+
paths: ['packages/api/**', 'libs/shared/**']
|
|
101
|
+
description: 'Backend API'
|
|
102
|
+
prefixes: [test, deploy, remote-test] # Optional job prefixes
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Reserved Domain Names (Cannot Use)
|
|
106
|
+
|
|
107
|
+
`version`, `changes`, `gate`, `tag`, `promote`, `release`
|
|
108
|
+
|
|
109
|
+
### Deprecated Fields
|
|
110
|
+
|
|
111
|
+
| Deprecated | Use Instead |
|
|
112
|
+
| ---------------------- | ------------------------- |
|
|
113
|
+
| `testable: true` | `prefixes: [test]` |
|
|
114
|
+
| `deployable: true` | `prefixes: [deploy]` |
|
|
115
|
+
| `remoteTestable: true` | `prefixes: [remote-test]` |
|
|
116
|
+
| `autoMerge` | `autoPromote` |
|
|
117
|
+
|
|
118
|
+
## Typical Workflows
|
|
119
|
+
|
|
120
|
+
### New Project Setup
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
pipecraft init # Create config
|
|
124
|
+
# Edit .pipecraftrc
|
|
125
|
+
pipecraft validate # Check config
|
|
126
|
+
pipecraft generate # Create workflows
|
|
127
|
+
pipecraft setup # Create branches
|
|
128
|
+
pipecraft setup-github # GitHub permissions
|
|
129
|
+
git add .github/ .pipecraftrc
|
|
130
|
+
git commit -m "chore: add Pipecraft CI/CD"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Debugging
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
pipecraft doctor # Health check
|
|
137
|
+
pipecraft validate # Config syntax
|
|
138
|
+
pipecraft generate --dry-run # Preview mode
|
|
139
|
+
pipecraft generate --debug # Maximum detail
|
|
140
|
+
pipecraft get-config branchFlow # Inspect values
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Common Errors
|
|
144
|
+
|
|
145
|
+
| Error | Fix |
|
|
146
|
+
| ------------------------------------------- | ------------------------------------------------------------ |
|
|
147
|
+
| "initialBranch must be first in branchFlow" | Reorder branchFlow array |
|
|
148
|
+
| "finalBranch must be last in branchFlow" | Reorder branchFlow array |
|
|
149
|
+
| "Reserved job name used as domain" | Rename domain (not version/changes/gate/tag/promote/release) |
|
|
150
|
+
| "Configuration not found" | Run `pipecraft init` |
|
|
151
|
+
| "Pre-flight checks failed" | Check git status, use `--skip-checks` |
|
|
152
|
+
|
|
153
|
+
## Branch Flow Patterns
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
# Two-stage (simple)
|
|
157
|
+
branchFlow: [develop, main]
|
|
158
|
+
|
|
159
|
+
# Three-stage (recommended)
|
|
160
|
+
branchFlow: [develop, staging, main]
|
|
161
|
+
autoPromote:
|
|
162
|
+
staging: true
|
|
163
|
+
main: false
|
|
164
|
+
|
|
165
|
+
# Enterprise
|
|
166
|
+
branchFlow: [develop, staging, uat, production]
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Generated Files
|
|
170
|
+
|
|
171
|
+
- `.github/workflows/pipeline.yml` - Main CI/CD workflow
|
|
172
|
+
- `.github/actions/*/action.yml` - Reusable actions (if `actionSourceMode: local`)
|
|
173
|
+
- `.github/workflows/enforce-pr-target.yml` - PR targeting rules
|
|
174
|
+
- `.github/workflows/pr-title-check.yml` - Conventional commit validation
|
|
175
|
+
- `.release-it.cjs` - Version management config
|
|
176
|
+
|
|
177
|
+
## Managed vs Custom Jobs
|
|
178
|
+
|
|
179
|
+
**Pipecraft manages:** `changes`, `version`, `gate`, `tag`, `promote`, `release`
|
|
180
|
+
|
|
181
|
+
**You customize:** Everything between `# <--START CUSTOM JOBS-->` and `# <--END CUSTOM JOBS-->` markers.
|
|
182
|
+
|
|
183
|
+
## Questions to Ask Users
|
|
184
|
+
|
|
185
|
+
1. **Project type:** Monorepo or single app?
|
|
186
|
+
2. **Branch strategy:** How many stages? (develop/main vs develop/staging/main)
|
|
187
|
+
3. **Domains:** What parts need separate CI jobs?
|
|
188
|
+
4. **Auto-promotion:** Should code auto-advance between branches?
|
|
189
|
+
|
|
190
|
+
## Behaviour that surprises agents
|
|
191
|
+
|
|
192
|
+
**A direct push does not release.** `tag`, `release` and `promote` only run for commits
|
|
193
|
+
GitHub authored (merged PRs) or a `workflow_dispatch`. A hand-pushed commit is tested, the
|
|
194
|
+
version is reported, and those three jobs skip. Run the workflow from the Actions tab to
|
|
195
|
+
release it deliberately.
|
|
196
|
+
|
|
197
|
+
**Domain job bodies are the user's.** Pipecraft writes a placeholder marked
|
|
198
|
+
`# TODO: Replace with your <domain> test logic` and no install or test commands. Jobs that
|
|
199
|
+
only echo are not broken; they are unfilled.
|
|
200
|
+
|
|
201
|
+
**`enforce-pr-target.yml` and `pr-title-check.yml` are overwritten on every generate.** Never
|
|
202
|
+
edit them; change the config. `pipeline.yml` preserves custom jobs between its
|
|
203
|
+
`# <--START CUSTOM JOBS-->` markers.
|
|
204
|
+
|
|
205
|
+
**A domain with no `prefixes` generates no jobs.** Check with `pipecraft generate --dry-run`,
|
|
206
|
+
which lists the domain jobs the config produces.
|
|
207
|
+
|
|
208
|
+
**`doctor` exits 1 when it finds errors.** A non-zero exit means it ran and found problems, not that the command is broken.
|
package/bin.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `npx @thecraftlab/pipecraft-skill` installs the Pipecraft skill.
|
|
5
|
+
*
|
|
6
|
+
* The installation itself belongs to `pipecraft skill`, which knows all six target formats,
|
|
7
|
+
* writes into a marked block so it never destroys a rules file the user owns, and can
|
|
8
|
+
* uninstall exactly what it wrote. This forwards to it rather than carrying a second
|
|
9
|
+
* implementation that would drift from the first.
|
|
10
|
+
*
|
|
11
|
+
* The previous version of this package ran `install-skill.js` from a `postinstall` hook. A
|
|
12
|
+
* hook is the wrong mechanism twice over: `files` omitted the script, so every install
|
|
13
|
+
* failed on a missing module, and pnpm blocks postinstall for unapproved dependencies by
|
|
14
|
+
* default, so the installs that did resolve would have done nothing.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { spawnSync } from 'child_process'
|
|
18
|
+
import { createRequire } from 'module'
|
|
19
|
+
|
|
20
|
+
const require = createRequire(import.meta.url)
|
|
21
|
+
|
|
22
|
+
let cli
|
|
23
|
+
try {
|
|
24
|
+
cli = require.resolve('pipecraft/dist/cli/index.js')
|
|
25
|
+
} catch {
|
|
26
|
+
console.error('Could not resolve the pipecraft CLI, which this package depends on.')
|
|
27
|
+
console.error('Install it and run the command directly: npx pipecraft skill')
|
|
28
|
+
process.exit(1)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const result = spawnSync(process.execPath, [cli, 'skill', ...process.argv.slice(2)], {
|
|
32
|
+
stdio: 'inherit'
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
process.exit(result.status ?? 1)
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thecraftlab/pipecraft-skill",
|
|
3
|
+
"version": "0.47.10",
|
|
4
|
+
"description": "Agent skill for Pipecraft, the trunk-based CI/CD workflow generator for GitHub Actions",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pipecraft",
|
|
7
|
+
"claude-code",
|
|
8
|
+
"claude-skill",
|
|
9
|
+
"agent-skill",
|
|
10
|
+
"skill",
|
|
11
|
+
"cursor",
|
|
12
|
+
"copilot",
|
|
13
|
+
"windsurf",
|
|
14
|
+
"codex",
|
|
15
|
+
"ci-cd",
|
|
16
|
+
"github-actions",
|
|
17
|
+
"workflow-generator"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://pipecraft.thecraftlab.dev",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/the-craftlab/pipecraft.git",
|
|
23
|
+
"directory": "skills/pipecraft-cli"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": {
|
|
27
|
+
"name": "The Craft Lab",
|
|
28
|
+
"url": "https://thecraftlab.dev"
|
|
29
|
+
},
|
|
30
|
+
"bin": {
|
|
31
|
+
"pipecraft-skill": "bin.js"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"SKILL.md",
|
|
35
|
+
"README.md",
|
|
36
|
+
"bin.js"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"pipecraft": "0.47.10"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.0.0"
|
|
43
|
+
}
|
|
44
|
+
}
|