@softure-ai/skills 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +71 -2
- package/WORKFLOW.md +308 -0
- package/package.json +31 -4
- package/rules/AGENTS.md +78 -0
- package/scripts/install.mjs +151 -0
- package/scripts/uninstall.mjs +49 -0
- package/skills/softure-archive/SKILL.md +100 -0
- package/skills/softure-code-review/SKILL.md +124 -0
- package/skills/softure-frame/SKILL.md +113 -0
- package/skills/softure-impl-review/SKILL.md +150 -0
- package/skills/softure-implement/SKILL.md +141 -0
- package/skills/softure-init/SKILL.md +131 -0
- package/skills/softure-lesson/SKILL.md +99 -0
- package/skills/softure-new/SKILL.md +127 -0
- package/skills/softure-plan/SKILL.md +157 -0
- package/skills/softure-plan/references/progress-format.md +79 -0
- package/skills/softure-plan-review/SKILL.md +152 -0
- package/skills/softure-prd/SKILL.md +132 -0
- package/skills/softure-research/SKILL.md +165 -0
- package/skills/softure-roadmap/SKILL.md +128 -0
- package/skills/softure-rule-review/SKILL.md +121 -0
- package/skills/softure-shape/SKILL.md +128 -0
- package/skills/softure-worktree/SKILL.md +888 -0
- package/skills/softure-worktree/scripts/wt-integration.sh +59 -0
- package/skills/softure-worktree/scripts/wt-open.sh +57 -0
- package/skills/softure-worktree/scripts/wt-roadmap.py +301 -0
- package/skills/softure-worktree/scripts/wt-status.sh +70 -0
- package/skills/softure-worktree/scripts/wt_config.py +109 -0
- package/skills/softure-worktree-manager/SKILL.md +553 -0
- package/skills/softure-worktree-manager/scripts/wm-launch.sh +52 -0
- package/skills/softure-worktree-manager/scripts/wm-report.sh +45 -0
- package/skills/softure-worktree-manager/scripts/wm-resume.sh +132 -0
- package/skills/softure-worktree-manager/scripts/wm-watch.sh +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SOFTURE
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SOFTURE SKILLS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Agent skills (Claude Code and other `SKILL.md` agents) for building software in a
|
|
4
|
+
spec-driven chain: every step leaves a durable artifact the next one reads, and two
|
|
5
|
+
orchestrators run whole roadmaps in parallel git worktrees.
|
|
6
|
+
|
|
7
|
+
Package: [`@softure-ai/skills`](https://www.npmjs.com/package/@softure-ai/skills) · License: MIT ·
|
|
8
|
+
Sister repos: [SOFTURE/AI](https://github.com/SOFTURE/AI) (app modules `@softure-ai/*`),
|
|
9
|
+
[COMMON](https://github.com/SOFTURE/COMMON), [API](https://github.com/SOFTURE/API).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm i -D @softure-ai/skills # postinstall copies skills into .claude/skills/
|
|
15
|
+
# or, without adding a dependency:
|
|
16
|
+
npx @softure-ai/skills
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
What the installer does (idempotent; re-run on every `npm install`):
|
|
20
|
+
|
|
21
|
+
| Artifact | Destination |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `skills/softure-*` | `.claude/skills/softure-*/` |
|
|
24
|
+
| `rules/AGENTS.md` | managed block in `AGENTS.md` (or `CLAUDE.md` if only that exists) |
|
|
25
|
+
| ignore entries | managed block in `.gitignore`: installed skills are restored by `npm install`, not committed |
|
|
26
|
+
| manifest | `.claude/softure-skills.json` |
|
|
27
|
+
|
|
28
|
+
It never overwrites a skill folder it did not install. Flags: `--dry-run`, `--target <dir>`,
|
|
29
|
+
`--no-gitignore` (commit the skills instead). Uninstall:
|
|
30
|
+
`node node_modules/@softure-ai/skills/scripts/uninstall.mjs`.
|
|
31
|
+
|
|
32
|
+
## The chain
|
|
33
|
+
|
|
34
|
+
See [WORKFLOW.md](WORKFLOW.md) for the full contract: artifacts, statuses, formats and
|
|
35
|
+
autonomous mode.
|
|
36
|
+
|
|
37
|
+
| Stage | Skill | Produces |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| setup | `softure-init` | `context/` + `context/workflow.json` (commands, branch, language) |
|
|
40
|
+
| discovery | `softure-shape` | `context/foundation/shape-notes.md` |
|
|
41
|
+
| | `softure-frame` | challenge what to build: `frame.md` |
|
|
42
|
+
| | `softure-prd` | `context/foundation/prd.md` |
|
|
43
|
+
| | `softure-roadmap` | `context/foundation/roadmap.md` |
|
|
44
|
+
| delivery | `softure-new` | `context/changes/<id>/change.md` |
|
|
45
|
+
| | `softure-research` | `research.md` |
|
|
46
|
+
| | `softure-plan` | `plan.md` with `## Progress` |
|
|
47
|
+
| | `softure-plan-review` | `reviews/plan-review.md` |
|
|
48
|
+
| | `softure-implement` | code, one commit per phase |
|
|
49
|
+
| | `softure-impl-review` | `reviews/impl-review.md` + fixes |
|
|
50
|
+
| | `softure-archive` | `context/archive/<date>-<id>/` |
|
|
51
|
+
| orchestration | `softure-worktree` | one change end to end in its own worktree; merge on your signal |
|
|
52
|
+
| | `softure-worktree-manager` | several worktrees in parallel; merges them one by one |
|
|
53
|
+
| hygiene | `softure-code-review` | review of a diff against conventions |
|
|
54
|
+
| | `softure-lesson` | numbered rule in `lessons.md` |
|
|
55
|
+
| | `softure-rule-review` | audit of AGENTS.md / CLAUDE.md / skills |
|
|
56
|
+
|
|
57
|
+
Every interactive skill accepts `--auto`: it decides instead of asking and records each
|
|
58
|
+
decision in the artifact. The orchestrators always use it.
|
|
59
|
+
|
|
60
|
+
## Releasing
|
|
61
|
+
|
|
62
|
+
Bump `version` in `package.json` and merge to the main branch. The workflow validates the
|
|
63
|
+
package, test-installs it into a scratch project, and publishes to npm with provenance, but
|
|
64
|
+
only if that version is not published yet.
|
|
65
|
+
|
|
66
|
+
Publishing uses npm **trusted publishing (OIDC)**: the trusted publisher on npmjs.com is
|
|
67
|
+
`SOFTURE/SKILLS` → `release.yml`, and no token is stored. An `NPM_TOKEN` secret (a granular
|
|
68
|
+
token with "Bypass 2FA") is only needed when bootstrapping a brand-new package, before its
|
|
69
|
+
trusted publisher can be configured.
|
|
70
|
+
|
|
71
|
+
`node scripts/validate.mjs` is the release gate: frontmatter, the `softure-` prefix, and no
|
|
72
|
+
third-party course branding in any shipped file.
|
package/WORKFLOW.md
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# SOFTURE workflow: the contract every `softure-*` skill follows
|
|
2
|
+
|
|
3
|
+
This file is the single source of truth for the delivery workflow. Every skill in `skills/`
|
|
4
|
+
reads and writes **only** the artifacts defined here, in the formats defined here. Orchestrators
|
|
5
|
+
(`softure-worktree`, `softure-worktree-manager`) and scripts parse these formats. Change the
|
|
6
|
+
format here first, then in every skill that touches it.
|
|
7
|
+
|
|
8
|
+
## 1. The chain
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
discovery (once per product / per roadmap)
|
|
12
|
+
softure-init → softure-shape → softure-prd → softure-roadmap
|
|
13
|
+
↑ softure-frame (challenge the problem at any point)
|
|
14
|
+
|
|
15
|
+
delivery (once per change)
|
|
16
|
+
softure-new → softure-research → [softure-frame] → softure-plan → softure-plan-review
|
|
17
|
+
→ softure-implement (phase by phase) → softure-impl-review → softure-lesson? → softure-archive
|
|
18
|
+
|
|
19
|
+
orchestration
|
|
20
|
+
softure-worktree one change, end to end, in its own git worktree; merges on the owner's signal
|
|
21
|
+
softure-worktree-manager several changes in parallel, merging them one by one
|
|
22
|
+
|
|
23
|
+
hygiene (any time)
|
|
24
|
+
softure-code-review review a diff against the project conventions
|
|
25
|
+
softure-rule-review audit AI rule files (AGENTS.md, CLAUDE.md, skills) for drift and contradictions
|
|
26
|
+
softure-lesson turn a repeated mistake into a numbered rule
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Each step produces a durable artifact the next step reads. A step never starts without its
|
|
30
|
+
upstream artifact. When the artifact is missing, the skill says which skill produces it and stops.
|
|
31
|
+
|
|
32
|
+
## 2. Project configuration: `context/workflow.json`
|
|
33
|
+
|
|
34
|
+
`softure-init` creates it. Every skill reads it. No skill hard-codes commands, branch names
|
|
35
|
+
or languages.
|
|
36
|
+
|
|
37
|
+
```jsonc
|
|
38
|
+
{
|
|
39
|
+
"language": "en", // ISO code (e.g. "pl"): language of artifacts and reports (skills themselves are English)
|
|
40
|
+
"mainBranch": "master",
|
|
41
|
+
"gates": { // run before every implementation commit; all must pass
|
|
42
|
+
"typecheck": "npx tsc --noEmit",
|
|
43
|
+
"lint": "npm run lint",
|
|
44
|
+
"test": "npm test"
|
|
45
|
+
},
|
|
46
|
+
"integration": { // optional: the slow, full suite
|
|
47
|
+
"local": "npm run test:integration:full",
|
|
48
|
+
"remote": null // e.g. a script that runs the suite on CI and waits: "bash scripts/ci-integration.sh"
|
|
49
|
+
},
|
|
50
|
+
"migrations": { // optional: lets orchestrators detect collisions between parallel changes
|
|
51
|
+
"dir": "drizzle",
|
|
52
|
+
"pattern": "^[0-9]{4}_.*\\.sql$",
|
|
53
|
+
"regenerate": "npm run db:generate"
|
|
54
|
+
},
|
|
55
|
+
"worktree": {
|
|
56
|
+
"setup": ["npm ci", "cp ../{repo}/.env .env"], // run inside a fresh worktree
|
|
57
|
+
"maxParallel": 4
|
|
58
|
+
},
|
|
59
|
+
"release": { "owner": true }, // releases and deploys are never done by skills when true
|
|
60
|
+
"research": { // optional: extra knowledge sources softure-research should consult
|
|
61
|
+
"sources": ["docs/", "context/foundation/prd.md"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 3. Artifacts
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
context/
|
|
70
|
+
workflow.json
|
|
71
|
+
foundation/
|
|
72
|
+
shape-notes.md softure-shape (frontmatter: session, status, created, updated; optional `## Frame` from softure-frame)
|
|
73
|
+
prd.md softure-prd (frontmatter: version, status: draft | accepted, source, updated)
|
|
74
|
+
roadmap.md softure-roadmap (§5)
|
|
75
|
+
roadmaps/<YYYY-MM-DD>-<slug>.md previous roadmaps, archived by softure-roadmap
|
|
76
|
+
lessons.md softure-lesson (§7)
|
|
77
|
+
changes/<change-id>/
|
|
78
|
+
change.md softure-new (§4)
|
|
79
|
+
research.md softure-research
|
|
80
|
+
frame.md softure-frame (optional)
|
|
81
|
+
plan.md softure-plan (§6)
|
|
82
|
+
reviews/
|
|
83
|
+
plan-review.md softure-plan-review
|
|
84
|
+
impl-review.md softure-impl-review
|
|
85
|
+
code-review.md softure-code-review (when run on a change)
|
|
86
|
+
archive/<YYYY-MM-DD>-<change-id>/ softure-archive (date = change.md `created`)
|
|
87
|
+
backlog/ ideas and deferred findings not on the roadmap yet:
|
|
88
|
+
<topic>.md (flat list, see below) or <group>/<id>/change.md (a prepared change;
|
|
89
|
+
when picked up it is moved to changes/<id>/backlog-input.md)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`change-id` is kebab-case, ASCII, at most 40 characters, unique across `changes/` and `archive/`.
|
|
93
|
+
|
|
94
|
+
**Headings are fixed English** in every artifact (`## Intent`, `## Progress`, `## Done`, `## Owner decisions and checks`, …),
|
|
95
|
+
regardless of `language`. Scripts and orchestrators find sections by these headings. Only the prose under them is
|
|
96
|
+
written in `language`.
|
|
97
|
+
|
|
98
|
+
**Backlog** (`context/backlog/<topic>.md`) collects deferred review findings and ideas that are not roadmap items yet.
|
|
99
|
+
Append entries as `- [ ] <YYYY-MM-DD> <source change-id or review>: <finding> (<severity>) <evidence path>`.
|
|
100
|
+
|
|
101
|
+
## 4. `change.md`
|
|
102
|
+
|
|
103
|
+
```markdown
|
|
104
|
+
---
|
|
105
|
+
change_id: pending-states
|
|
106
|
+
title: "One sentence: the outcome, not the activity"
|
|
107
|
+
status: new
|
|
108
|
+
roadmap_item: FC-10 # or null
|
|
109
|
+
branch: null # set by softure-worktree: change branch / worktree path
|
|
110
|
+
created: 2026-10-01
|
|
111
|
+
updated: 2026-10-01
|
|
112
|
+
archived_at: null
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Intent
|
|
116
|
+
What must be true when this change is done, and for whom.
|
|
117
|
+
|
|
118
|
+
## Context
|
|
119
|
+
Where it comes from (roadmap item, feedback quoted verbatim, incident), what is known today.
|
|
120
|
+
|
|
121
|
+
## Constraints
|
|
122
|
+
Files this change owns exclusively, things it must not touch, deadlines.
|
|
123
|
+
|
|
124
|
+
## Notes
|
|
125
|
+
Free-form. Orchestrators append signals here.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Status values (exact strings, in this order):**
|
|
129
|
+
|
|
130
|
+
| status | set by | meaning / resume point |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
| `new` | softure-new | next: research |
|
|
133
|
+
| `preparing` | softure-research | research written; next: frame (optional) or plan |
|
|
134
|
+
| `planned` | softure-plan | next: plan review |
|
|
135
|
+
| `plan_reviewed` | softure-plan-review | next: implement phase 1 |
|
|
136
|
+
| `implementing` | softure-implement | resume at the first `- [ ]` in plan.md Progress |
|
|
137
|
+
| `implemented` | softure-implement | all phases done; next: impl review |
|
|
138
|
+
| `impl_reviewed` | softure-impl-review | next: triage, integration, archive |
|
|
139
|
+
| `archived` | softure-archive | folder moved to archive |
|
|
140
|
+
|
|
141
|
+
Every skill that changes `status` also sets `updated`.
|
|
142
|
+
`softure-frame` leaves the status unchanged (`preparing`). When `softure-plan-review` finds a CRITICAL issue the plan
|
|
143
|
+
cannot fix, the status stays `planned` and the finding names the step to redo (`research` or `plan`). Orchestrators
|
|
144
|
+
read that finding before re-running plan-review.
|
|
145
|
+
|
|
146
|
+
## 5. `roadmap.md`
|
|
147
|
+
|
|
148
|
+
```markdown
|
|
149
|
+
---
|
|
150
|
+
project: "Name"
|
|
151
|
+
roadmap: short-slug
|
|
152
|
+
version: 1
|
|
153
|
+
status: draft | ready | done
|
|
154
|
+
prd_version: 4
|
|
155
|
+
updated: 2026-10-01
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
# Roadmap <slug>: <theme>
|
|
159
|
+
|
|
160
|
+
> Run-wide orders, read by orchestrators (not parsed):
|
|
161
|
+
> - Push main branch: no | at the end
|
|
162
|
+
> - Parallelism: up to 4 at once
|
|
163
|
+
|
|
164
|
+
## At a glance
|
|
165
|
+
|
|
166
|
+
| ID | Change | Outcome | Depends on | Mode | Status |
|
|
167
|
+
| --- | --- | --- | --- | --- | --- |
|
|
168
|
+
| **FC-1** | `landing-hero-balance` | hero 50/50, chart readable without text | — | autonomous | ready |
|
|
169
|
+
|
|
170
|
+
## Order
|
|
171
|
+
Why this order; which items may run in parallel and which files each one owns.
|
|
172
|
+
|
|
173
|
+
## Items
|
|
174
|
+
|
|
175
|
+
### FC-1: Hero in balance
|
|
176
|
+
- **Change ID:** `landing-hero-balance`
|
|
177
|
+
- **Status:** ready
|
|
178
|
+
- **Outcome:** …
|
|
179
|
+
- **Prerequisites:** …
|
|
180
|
+
- **Unknowns:** questions research must answer
|
|
181
|
+
- **Risk:** …
|
|
182
|
+
- **Baseline:** how we measure before/after
|
|
183
|
+
- **PRD refs:** …
|
|
184
|
+
|
|
185
|
+
## Before the next release
|
|
186
|
+
- [ ] what must happen before the next release/deploy (env var, manual migration step, …) (**FC-1**)
|
|
187
|
+
|
|
188
|
+
## Owner decisions and checks
|
|
189
|
+
- [ ] **FC-1**: what waits for the owner (Manual 2.4). <evidence path>
|
|
190
|
+
|
|
191
|
+
## Done
|
|
192
|
+
- **FC-0** `some-change`: one line; archived in `archive/2026-09-30-some-change/`
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
`Mode` is `autonomous` (an orchestrator may run it end to end) or `owner` (needs the owner at the keyboard).
|
|
196
|
+
In `--auto`, decisions go to a `## Decisions (auto)` section at the end of roadmap.md.
|
|
197
|
+
`softure-archive` owns the transition to `done` / `done_code`: it rewrites the row and the item block and appends to
|
|
198
|
+
`## Done`. Orchestrators only write `in_progress` and `ready_to_merge`. They fall back to writing `done` themselves
|
|
199
|
+
only when the archive step did not.
|
|
200
|
+
Each item block may carry `- **Input:** <path>` (e.g. the change folder), which tells research where its brief lives.
|
|
201
|
+
`change.md` is defined **only** in §4. softure-roadmap `--open-changes` and softure-new write the same format.
|
|
202
|
+
|
|
203
|
+
Parsing rules (scripts depend on them):
|
|
204
|
+
- Item IDs match `[A-Z]+-\d+`. A table row starts with `| **<ID>** | \`<change-id>\` |`, and the
|
|
205
|
+
**last cell is the status**. Exactly one row per change-id.
|
|
206
|
+
- **Status vocabulary:**
|
|
207
|
+
- `proposed`: may be dropped.
|
|
208
|
+
- `ready`
|
|
209
|
+
- `blocked (<why>)`
|
|
210
|
+
- `in_progress (<stage>, since <YYYY-MM-DD>; <where>)`
|
|
211
|
+
- `ready_to_merge (since <YYYY-MM-DD>; <where>)`
|
|
212
|
+
- `done`
|
|
213
|
+
- `done_code (<YYYY-MM-DD>; waiting: <what>)`: merged, waits for a release or an owner check.
|
|
214
|
+
- **Stages** (first token inside the parentheses of `in_progress`): `research`, `frame`, `plan`,
|
|
215
|
+
`plan-review`, `implement N/M`, `impl-review`, `integration`, `archive`.
|
|
216
|
+
- The item block mirrors the row status in `- **Status:** …` directly under `- **Change ID:**`.
|
|
217
|
+
|
|
218
|
+
## 6. `plan.md`
|
|
219
|
+
|
|
220
|
+
```markdown
|
|
221
|
+
# Plan: <change-id>
|
|
222
|
+
|
|
223
|
+
Input: change.md, research.md[, frame.md]
|
|
224
|
+
|
|
225
|
+
## Goal
|
|
226
|
+
## Approach (chosen option and why; rejected options in one line each)
|
|
227
|
+
## Phase 1: <title>
|
|
228
|
+
**Discipline:** TDD | test-after. **Files:** …
|
|
229
|
+
Steps, then "Done when" criteria.
|
|
230
|
+
## Phase 2: …
|
|
231
|
+
## Risks and rollback
|
|
232
|
+
## Decisions (auto) (only when produced in autonomous mode)
|
|
233
|
+
|
|
234
|
+
## Progress
|
|
235
|
+
|
|
236
|
+
> `- [ ]` pending, `- [x]` done. A phase ends with ` — <commit sha>` on its done items. Never rename items.
|
|
237
|
+
|
|
238
|
+
### Phase 1: <title>
|
|
239
|
+
|
|
240
|
+
#### Automated
|
|
241
|
+
- [ ] 1.1 <criterion a machine can check>
|
|
242
|
+
- [ ] 1.2 Gates green (typecheck, lint, test)
|
|
243
|
+
|
|
244
|
+
#### Manual
|
|
245
|
+
- [ ] 1.3 <criterion only a human can check>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Rules:
|
|
249
|
+
- `## Progress` is the **only** execution state. No sidecar files.
|
|
250
|
+
- It is the last section of the file, with one `### Phase N:` per `## Phase N:`.
|
|
251
|
+
- Only `softure-implement` ticks boxes.
|
|
252
|
+
- **The resume point is the first `- [ ]` under an `#### Automated` heading.** Open Manual items never block resuming.
|
|
253
|
+
They are carried to the roadmap's `## Owner decisions and checks` at archive time.
|
|
254
|
+
- Notation:
|
|
255
|
+
- done: `- [x] N.M text — <sha>`;
|
|
256
|
+
- a Manual item the agent verified itself: `- [x] N.M text — <sha> (verified by agent: <how>)`;
|
|
257
|
+
- dropped mid-flight: `- [x] ~~N.M text~~ — dropped: <reason>`.
|
|
258
|
+
- SHA: the phase commit is created first, then the SHA is written into Progress by amending that commit before
|
|
259
|
+
anything is pushed. If the commit is already pushed, record it in a separate `docs(<change-id>): progress p<N>` commit.
|
|
260
|
+
- A plan has **no open questions**. Unresolved ones go back to research or to the owner.
|
|
261
|
+
|
|
262
|
+
## 7. `lessons.md`
|
|
263
|
+
|
|
264
|
+
```markdown
|
|
265
|
+
# Lessons
|
|
266
|
+
|
|
267
|
+
## L-001: <the rule, imperative, one line>
|
|
268
|
+
**Why:** the concrete incident (what happened, what it cost).
|
|
269
|
+
**How to apply:** when it applies, and what to do differently.
|
|
270
|
+
**Applies to:** paths / areas / skills.
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Numbers are never reused. Under parallel work, the next number is the maximum over the main
|
|
274
|
+
branch and all worktrees, plus one.
|
|
275
|
+
|
|
276
|
+
## 8. Autonomous mode
|
|
277
|
+
|
|
278
|
+
Every interactive skill accepts `--auto` (orchestrators always pass it). In `--auto`:
|
|
279
|
+
- never ask the user;
|
|
280
|
+
- take the recommended option;
|
|
281
|
+
- choose the safer option when risk is unclear;
|
|
282
|
+
- record each decision under `## Decisions (auto)` in the artifact being written:
|
|
283
|
+
`- <question> → <choice> (<one-line reason>)`;
|
|
284
|
+
- stop and escalate only for:
|
|
285
|
+
1. destructive or irreversible actions (data loss, force-push, production);
|
|
286
|
+
2. scope that contradicts change.md;
|
|
287
|
+
3. a missing secret or access the agent cannot obtain.
|
|
288
|
+
|
|
289
|
+
## 9. Commits
|
|
290
|
+
|
|
291
|
+
- Implementation: `<type>(<change-id>): <phase title> (p<N>)`. Type is `feat`, `fix`, `refactor`,
|
|
292
|
+
`test`, `docs` or `chore`.
|
|
293
|
+
- Review fixes: `fix(<change-id>): address impl review`.
|
|
294
|
+
- Progress bookkeeping (only when amending is impossible): `docs(<change-id>): progress p<N>`.
|
|
295
|
+
- Archive: `chore(archive): close <change-id>`.
|
|
296
|
+
- Roadmap stage updates: `docs(roadmap): <ID> <stage>`.
|
|
297
|
+
- Lessons: `docs(lessons): L-<NNN> <title>`. Rule-file edits: `docs(rules): <what>`.
|
|
298
|
+
- Merge of a worktree branch: `Merge <change-id> (<ID>): <outcome>`.
|
|
299
|
+
|
|
300
|
+
## 10. SOFTURE modules first
|
|
301
|
+
|
|
302
|
+
Before planning any generic capability, `softure-research` and `softure-plan` check the
|
|
303
|
+
**SOFTURE AI module catalog** (`@softure-ai/*`, https://github.com/SOFTURE/AI). Generic
|
|
304
|
+
capabilities include auth, sessions, roles, feature switches, mail, unsubscribe, waitlist,
|
|
305
|
+
MCP access tokens, billing/trial, GDPR export/delete, consent, channel analytics, health
|
|
306
|
+
checks and UI primitives. If a module covers the need, the plan uses the module, configured
|
|
307
|
+
through `softure.config.ts`. If a module almost covers it, the plan records the gap as an
|
|
308
|
+
issue for SOFTURE/AI instead of re-implementing it locally.
|
package/package.json
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/skills",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SOFTURE agent skills: a spec-driven delivery workflow (shape → prd → roadmap → plan → implement → review) plus parallel worktree orchestration",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/SOFTURE/SKILLS.git"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"skills/",
|
|
13
|
+
"rules/",
|
|
14
|
+
"WORKFLOW.md",
|
|
15
|
+
"scripts/install.mjs",
|
|
16
|
+
"scripts/uninstall.mjs",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"bin": {
|
|
20
|
+
"softure-skills": "scripts/install.mjs"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"postinstall": "node scripts/install.mjs --postinstall",
|
|
24
|
+
"validate": "node scripts/validate.mjs"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=20"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"provenance": true
|
|
32
|
+
}
|
|
33
|
+
}
|
package/rules/AGENTS.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# SOFTURE workflow and conventions
|
|
2
|
+
|
|
3
|
+
Installed by `@softure-ai/skills`. Project-specific rules outside this block take precedence,
|
|
4
|
+
except the language rule below, which always applies.
|
|
5
|
+
|
|
6
|
+
## Language: English in everything you write to the repository (mandatory)
|
|
7
|
+
|
|
8
|
+
Code, identifiers, comments, commit messages, script and log output, error messages, file and
|
|
9
|
+
folder names, configuration keys, and agent or skill instructions are written in **English**.
|
|
10
|
+
This holds even when the conversation with the user is in another language.
|
|
11
|
+
|
|
12
|
+
- A request in another language still produces English code. Do not carry the conversation
|
|
13
|
+
language into the code.
|
|
14
|
+
- The only exception is user-facing product copy. It lives in message dictionaries
|
|
15
|
+
(e.g. `messages/pl.ts`), never inline in code.
|
|
16
|
+
- When you touch a file with non-English code, comments or identifiers, translate them in the
|
|
17
|
+
same change.
|
|
18
|
+
- Before every commit, scan the diff for non-English text outside message dictionaries. Any hit
|
|
19
|
+
is a failing gate, just like a red test.
|
|
20
|
+
|
|
21
|
+
## How work flows
|
|
22
|
+
|
|
23
|
+
Work happens as a chain of skills. Each one leaves a file in `context/` that the next one reads.
|
|
24
|
+
The full contract is in `node_modules/@softure-ai/skills/WORKFLOW.md`.
|
|
25
|
+
|
|
26
|
+
- **Product:** `softure-init` → `softure-shape` → `softure-prd` → `softure-roadmap`. Use
|
|
27
|
+
`softure-frame` whenever the problem itself is in doubt.
|
|
28
|
+
- **One change:** `softure-new` → `softure-research` → `softure-plan` → `softure-plan-review` →
|
|
29
|
+
`softure-implement` → `softure-impl-review` → `softure-archive`.
|
|
30
|
+
- **In parallel:** `softure-worktree` runs one change end to end in its own worktree.
|
|
31
|
+
`softure-worktree-manager` runs several at once and merges them.
|
|
32
|
+
- **Any time:** `softure-code-review`, `softure-rule-review`, `softure-lesson`.
|
|
33
|
+
|
|
34
|
+
Execution state lives only in the `## Progress` section of `plan.md`. Commands, the main branch
|
|
35
|
+
and the artifact language come from `context/workflow.json`. Before building anything generic
|
|
36
|
+
(auth, mail, feature switches, billing, GDPR, analytics, UI primitives), check the
|
|
37
|
+
`@softure-ai/*` modules.
|
|
38
|
+
|
|
39
|
+
## Conventions
|
|
40
|
+
|
|
41
|
+
**Code**
|
|
42
|
+
- Name things by what they do: functions start with a verb, booleans read as questions
|
|
43
|
+
(`isActive`, `hasAccess`), constants are UPPER_SNAKE_CASE, and a file is named after its main export.
|
|
44
|
+
- One function does one job. More than three inputs become an options object. Return early
|
|
45
|
+
instead of nesting.
|
|
46
|
+
- Functions that read (`get*`, `find*`, `is*`) have no side effects.
|
|
47
|
+
|
|
48
|
+
**TypeScript**
|
|
49
|
+
- External data enters as `unknown` and is narrowed with a schema (zod) at the boundary.
|
|
50
|
+
- Model alternatives as discriminated unions, not as bags of optional fields.
|
|
51
|
+
- `any` and non-null assertions need a comment that says why.
|
|
52
|
+
|
|
53
|
+
**Errors**
|
|
54
|
+
- Every awaited call either handles its failure or deliberately lets it propagate. Nothing is
|
|
55
|
+
swallowed silently.
|
|
56
|
+
- Error messages name the operation and the input that failed. Users never see stack traces
|
|
57
|
+
or internal paths.
|
|
58
|
+
- Expected failures are returned as values (result types). Exceptions are for bugs.
|
|
59
|
+
|
|
60
|
+
**Data**
|
|
61
|
+
- An invariant that can be a database constraint is one. Code checks are a second line, not the only one.
|
|
62
|
+
- SQL is always parameterized. Migrations move forward only and say how to roll back.
|
|
63
|
+
- A write that depends on a read happens in one transaction, with a conditional `UPDATE` or a lock.
|
|
64
|
+
|
|
65
|
+
**Security**
|
|
66
|
+
- Secrets come from the environment and are never logged.
|
|
67
|
+
- Every server action and route checks authorization, not just a session.
|
|
68
|
+
- Public endpoints are rate-limited and validate their input.
|
|
69
|
+
|
|
70
|
+
**React / Next.js**
|
|
71
|
+
- Server components by default. Use client components only for interaction.
|
|
72
|
+
- User-visible text, including `aria-label`, goes through the project's message layer.
|
|
73
|
+
- Styling uses design tokens. Raw colours and magic sizes are not allowed.
|
|
74
|
+
|
|
75
|
+
**Tests**
|
|
76
|
+
- A test name states the behaviour. Each test builds and cleans up its own data.
|
|
77
|
+
- Assert exact values. Cover empty, boundary and failure cases.
|
|
78
|
+
- A bug fix starts with a test that fails without it.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Installs SOFTURE skills into a consumer project:
|
|
3
|
+
// skills/<name>/ -> <project>/.claude/skills/<name>/
|
|
4
|
+
// rules/AGENTS.md -> managed block in AGENTS.md (or CLAUDE.md when only that exists)
|
|
5
|
+
// managed block in .gitignore, so installed skills are restored by `npm install`, never committed
|
|
6
|
+
// manifest -> <project>/.claude/softure-skills.json (drives updates and uninstall)
|
|
7
|
+
//
|
|
8
|
+
// Flags: --postinstall (never fails the host install), --dry-run, --target <dir>, --no-gitignore
|
|
9
|
+
|
|
10
|
+
import fs from "node:fs";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
|
|
14
|
+
const PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
15
|
+
const PACKAGE = JSON.parse(fs.readFileSync(path.join(PACKAGE_ROOT, "package.json"), "utf8"));
|
|
16
|
+
const MANIFEST_PATH = path.join(".claude", "softure-skills.json");
|
|
17
|
+
const BLOCK_BEGIN = "<!-- softure-skills:begin (managed by @softure-ai/skills, do not edit) -->";
|
|
18
|
+
const BLOCK_END = "<!-- softure-skills:end -->";
|
|
19
|
+
const GITIGNORE_BEGIN = "# softure-skills:begin (managed by @softure-ai/skills)";
|
|
20
|
+
const GITIGNORE_END = "# softure-skills:end";
|
|
21
|
+
|
|
22
|
+
function parseArgs(argv) {
|
|
23
|
+
const options = { isPostinstall: false, isDryRun: false, target: null, shouldIgnore: true };
|
|
24
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
25
|
+
const arg = argv[index];
|
|
26
|
+
if (arg === "--postinstall") options.isPostinstall = true;
|
|
27
|
+
else if (arg === "--dry-run") options.isDryRun = true;
|
|
28
|
+
else if (arg === "--no-gitignore") options.shouldIgnore = false;
|
|
29
|
+
else if (arg === "--target") options.target = argv[++index];
|
|
30
|
+
else throw new Error(`Unknown flag: ${arg}`);
|
|
31
|
+
}
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function resolveProjectRoot(options) {
|
|
36
|
+
if (options.target) return path.resolve(options.target);
|
|
37
|
+
// npm sets INIT_CWD to the directory where `npm install` was run.
|
|
38
|
+
return path.resolve(process.env.INIT_CWD ?? process.cwd());
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function readManifest(projectRoot) {
|
|
42
|
+
const file = path.join(projectRoot, MANIFEST_PATH);
|
|
43
|
+
if (!fs.existsSync(file)) return { skills: [] };
|
|
44
|
+
return JSON.parse(fs.readFileSync(file, "utf8"));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function listPackageSkills() {
|
|
48
|
+
const skillsDir = path.join(PACKAGE_ROOT, "skills");
|
|
49
|
+
return fs
|
|
50
|
+
.readdirSync(skillsDir, { withFileTypes: true })
|
|
51
|
+
.filter((entry) => entry.isDirectory() && fs.existsSync(path.join(skillsDir, entry.name, "SKILL.md")))
|
|
52
|
+
.map((entry) => entry.name)
|
|
53
|
+
.sort();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function replaceManagedBlock(content, begin, end, body) {
|
|
57
|
+
const block = body === null ? "" : `${begin}\n${body.trim()}\n${end}`;
|
|
58
|
+
const start = content.indexOf(begin);
|
|
59
|
+
const stop = content.indexOf(end);
|
|
60
|
+
if (start !== -1 && stop > start) {
|
|
61
|
+
const before = content.slice(0, start).trimEnd();
|
|
62
|
+
const after = content.slice(stop + end.length).trimStart();
|
|
63
|
+
return [before, block, after].filter(Boolean).join("\n\n") + "\n";
|
|
64
|
+
}
|
|
65
|
+
if (body === null) return content;
|
|
66
|
+
return (content.trimEnd() ? content.trimEnd() + "\n\n" : "") + block + "\n";
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function install(options) {
|
|
70
|
+
const projectRoot = resolveProjectRoot(options);
|
|
71
|
+
if (projectRoot === PACKAGE_ROOT) {
|
|
72
|
+
console.log("[softure-skills] running inside the package itself, nothing to install");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const previous = readManifest(projectRoot);
|
|
77
|
+
const skills = listPackageSkills();
|
|
78
|
+
const skillsRoot = path.join(projectRoot, ".claude", "skills");
|
|
79
|
+
const actions = [];
|
|
80
|
+
|
|
81
|
+
for (const name of skills) {
|
|
82
|
+
const target = path.join(skillsRoot, name);
|
|
83
|
+
const isOurs = previous.skills.includes(name);
|
|
84
|
+
if (fs.existsSync(target) && !isOurs) {
|
|
85
|
+
actions.push(`skip ${name} (folder exists and is not managed by this package)`);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
actions.push(`install ${name}`);
|
|
89
|
+
if (!options.isDryRun) {
|
|
90
|
+
fs.rmSync(target, { recursive: true, force: true });
|
|
91
|
+
fs.cpSync(path.join(PACKAGE_ROOT, "skills", name), target, { recursive: true });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
for (const name of previous.skills.filter((skill) => !skills.includes(skill))) {
|
|
96
|
+
actions.push(`remove ${name} (no longer shipped)`);
|
|
97
|
+
if (!options.isDryRun) fs.rmSync(path.join(skillsRoot, name), { recursive: true, force: true });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const rulesSource = path.join(PACKAGE_ROOT, "rules", "AGENTS.md");
|
|
101
|
+
const agentsFile = path.join(projectRoot, "AGENTS.md");
|
|
102
|
+
const claudeFile = path.join(projectRoot, "CLAUDE.md");
|
|
103
|
+
const rulesTarget = fs.existsSync(agentsFile) || !fs.existsSync(claudeFile) ? agentsFile : claudeFile;
|
|
104
|
+
if (fs.existsSync(rulesSource)) {
|
|
105
|
+
actions.push(`rules block -> ${path.relative(projectRoot, rulesTarget)}`);
|
|
106
|
+
if (!options.isDryRun) {
|
|
107
|
+
const existing = fs.existsSync(rulesTarget) ? fs.readFileSync(rulesTarget, "utf8") : "";
|
|
108
|
+
const rules = fs.readFileSync(rulesSource, "utf8");
|
|
109
|
+
fs.writeFileSync(rulesTarget, replaceManagedBlock(existing, BLOCK_BEGIN, BLOCK_END, rules));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const installed = skills.filter((name) => !actions.includes(`skip ${name} (folder exists and is not managed by this package)`));
|
|
114
|
+
if (options.shouldIgnore) {
|
|
115
|
+
const gitignore = path.join(projectRoot, ".gitignore");
|
|
116
|
+
const lines = [...installed.map((name) => `/.claude/skills/${name}/`), `/${MANIFEST_PATH}`].join("\n");
|
|
117
|
+
actions.push("gitignore block (installed skills are restored by npm install)");
|
|
118
|
+
if (!options.isDryRun) {
|
|
119
|
+
const existing = fs.existsSync(gitignore) ? fs.readFileSync(gitignore, "utf8") : "";
|
|
120
|
+
fs.writeFileSync(gitignore, replaceManagedBlock(existing, GITIGNORE_BEGIN, GITIGNORE_END, lines));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (!options.isDryRun) {
|
|
125
|
+
fs.mkdirSync(path.join(projectRoot, ".claude"), { recursive: true });
|
|
126
|
+
const manifest = {
|
|
127
|
+
package: PACKAGE.name,
|
|
128
|
+
version: PACKAGE.version,
|
|
129
|
+
installedAt: new Date().toISOString(),
|
|
130
|
+
skills: installed,
|
|
131
|
+
rulesTarget: path.relative(projectRoot, rulesTarget),
|
|
132
|
+
gitignore: options.shouldIgnore,
|
|
133
|
+
};
|
|
134
|
+
fs.writeFileSync(path.join(projectRoot, MANIFEST_PATH), JSON.stringify(manifest, null, 2) + "\n");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const prefix = options.isDryRun ? "[softure-skills] (dry run)" : "[softure-skills]";
|
|
138
|
+
for (const action of actions) console.log(`${prefix} ${action}`);
|
|
139
|
+
console.log(`${prefix} ${PACKAGE.name}@${PACKAGE.version} -> ${projectRoot}`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
try {
|
|
143
|
+
install(parseArgs(process.argv.slice(2)));
|
|
144
|
+
} catch (error) {
|
|
145
|
+
const isPostinstall = process.argv.includes("--postinstall");
|
|
146
|
+
console.error(`[softure-skills] install failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
147
|
+
// A broken skills copy must never break the host project's `npm install`.
|
|
148
|
+
process.exit(isPostinstall ? 0 : 1);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export { replaceManagedBlock };
|