@jakkrichm/create-nexus-devflow 2.1.0 → 2.2.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/dist/bin/create-nexus-devflow.js +28 -4
- package/dist/bin/create-nexus-devflow.js.map +1 -1
- package/dist/lib/project-metadata.d.ts +1 -1
- package/dist/lib/project-metadata.js +3 -2
- package/dist/lib/project-metadata.js.map +1 -1
- package/dist/lib/update.js +7 -3
- package/dist/lib/update.js.map +1 -1
- package/package.json +1 -1
- package/template/.agents/skills/adopt/SKILL.md +58 -5
- package/template/.agents/skills/doctor/SKILL.md +23 -16
- package/template/.agents/skills/implement/SKILL.md +2 -2
- package/template/.agents/skills/onboard/SKILL.md +18 -17
- package/template/.agents/skills/rollback/SKILL.md +1 -1
- package/template/.claude/skills/00-explore/SKILL.md +2 -2
- package/template/.claude/skills/10-define/SKILL.md +2 -2
- package/template/.claude/skills/20-spec/SKILL.md +1 -2
- package/template/.claude/skills/30-plan/SKILL.md +1 -2
- package/template/.claude/skills/40-execute/SKILL.md +2 -2
- package/template/.claude/skills/50-verify/SKILL.md +2 -2
- package/template/.claude/skills/60-report/SKILL.md +2 -2
- package/template/.claude/skills/70-deliver/SKILL.md +2 -2
- package/template/.claude/skills/adopt/SKILL.md +191 -75
- package/template/.claude/skills/audit/SKILL.md +267 -133
- package/template/.claude/skills/autopilot/SKILL.md +226 -167
- package/template/.claude/skills/brainstorm/SKILL.md +62 -0
- package/template/.claude/skills/brief/SKILL.md +93 -92
- package/template/.claude/skills/check/SKILL.md +96 -76
- package/template/.claude/skills/ci/SKILL.md +140 -61
- package/template/.claude/skills/complete/SKILL.md +156 -101
- package/template/.claude/skills/convert-any-to-md/SKILL.md +2 -2
- package/template/.claude/skills/convert-any-to-md/references/setup.md +29 -0
- package/template/.claude/skills/convert-any-to-md/scripts/convert_any_to_md.py +487 -0
- package/template/.claude/skills/convert-any-to-md/scripts/requirements.txt +3 -0
- package/template/.claude/skills/debug/SKILL.md +124 -49
- package/template/.claude/skills/devflow/SKILL.md +9 -3
- package/template/.claude/skills/discovery/SKILL.md +150 -129
- package/template/.claude/skills/doctor/SKILL.md +195 -72
- package/template/.claude/skills/feature/SKILL.md +195 -151
- package/template/.claude/skills/fix/SKILL.md +41 -90
- package/template/.claude/skills/idea/SKILL.md +2 -2
- package/template/.claude/skills/implement/SKILL.md +189 -46
- package/template/.claude/skills/onboard/SKILL.md +216 -85
- package/template/.claude/skills/overview/SKILL.md +44 -29
- package/template/.claude/skills/prototype/SKILL.md +82 -27
- package/template/.claude/skills/release/SKILL.md +119 -130
- package/template/.claude/skills/report-html/SKILL.md +2 -2
- package/template/.claude/skills/rollback/SKILL.md +123 -77
- package/template/.claude/skills/status/SKILL.md +109 -0
- package/template/.claude/skills/test/SKILL.md +2 -2
- package/template/.claude/skills/tests/SKILL.md +126 -0
- package/template/.claude/skills/try/SKILL.md +77 -65
- package/template/AGENTS.md +2 -1
- package/template/devflow/build-plan.md +8 -0
- package/template/devflow/history/features/README.md +5 -0
- package/template/devflow/history/fixes/README.md +5 -0
- package/template/devflow/history/rollbacks/README.md +5 -0
|
@@ -1,109 +1,155 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rollback
|
|
3
|
-
description: "[
|
|
3
|
+
description: "[devflow][B] Plan a safe reversal of a completed Blueprint feature using its archived spec and squashed git commit. Finds the exact feature commit, reviews later commits for dependency risk, writes a Type: Rollback spec to devflow/context/current-feature.md, and stops for review before /implement applies any code change. Use when the user runs /rollback, asks to remove or undo a completed feature, or wants to return the app to its pre-feature behavior without erasing Blueprint history."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# rollback -
|
|
6
|
+
# rollback - safely reverse a completed feature
|
|
7
7
|
|
|
8
8
|
Where this sits in the workflow:
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
+ plan)
|
|
14
|
-
```
|
|
10
|
+
completed feature + git history -> [rollback] -> /implement -> /check -> /complete
|
|
11
|
+
(archive + squashed commit) (risk review (reverse (prove) (log + merge)
|
|
12
|
+
+ spec) product diff)
|
|
15
13
|
|
|
16
|
-
This skill
|
|
14
|
+
This skill plans a rollback. It does not change product code, create a branch,
|
|
15
|
+
commit, merge, or push. It identifies the completed feature and its exact git
|
|
16
|
+
commit, checks what changed afterward, writes a guarded rollback spec, then stops
|
|
17
|
+
for review. `/implement` performs the reversal only after the user approves that
|
|
18
|
+
spec.
|
|
17
19
|
|
|
18
20
|
## Input
|
|
19
21
|
|
|
20
|
-
A completed
|
|
22
|
+
A completed feature by build-plan number, name, or archive path, plus an optional
|
|
23
|
+
reason. Examples:
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
rollback
|
|
24
|
-
rollback
|
|
25
|
-
rollback devflow/runs/RUN-001-align-devflow-blueprint
|
|
26
|
-
```
|
|
25
|
+
/rollback 4 because the new export flow is corrupting files
|
|
26
|
+
/rollback "PDF export"
|
|
27
|
+
/rollback devflow/history/features/04-pdf-export.md
|
|
27
28
|
|
|
28
|
-
With no target, list
|
|
29
|
+
With no target, list a short set of recent completed feature archives and ask the
|
|
30
|
+
user to choose. Never silently pick the latest feature. If the reason is missing,
|
|
31
|
+
ask for one before writing the spec because the rollback archive must explain why
|
|
32
|
+
the feature was removed.
|
|
29
33
|
|
|
30
|
-
## Step 0 -
|
|
34
|
+
## Step 0 - preflight
|
|
31
35
|
|
|
32
|
-
Read `AGENTS.md`, `devflow/
|
|
36
|
+
Read `AGENTS.md`, `devflow/build-plan.md`,
|
|
37
|
+
`devflow/context/current-feature.md`, the completed feature archives, and git
|
|
38
|
+
state.
|
|
33
39
|
|
|
34
|
-
Stop before
|
|
40
|
+
Stop before writing when:
|
|
35
41
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
42
|
+
- the directory is not a git repository
|
|
43
|
+
- `current-feature.md` already holds active work
|
|
44
|
+
- the working tree is dirty, including unrelated untracked work
|
|
45
|
+
- the current branch is not the local main or default branch
|
|
46
|
+
- the target is not a checked build-plan feature with a matching archive
|
|
47
|
+
- the archive or its introducing commit cannot be identified unambiguously
|
|
39
48
|
|
|
40
|
-
Do not discard,
|
|
49
|
+
Do not stash, discard, fetch, pull, switch branches, or clean the tree from this
|
|
50
|
+
skill.
|
|
41
51
|
|
|
42
|
-
## Step 1 -
|
|
52
|
+
## Step 1 - resolve the exact feature
|
|
43
53
|
|
|
44
|
-
Match the requested
|
|
54
|
+
Match the requested number or name against both the checked build-plan items and
|
|
55
|
+
`devflow/history/features/*.md`. Exclude the directory README.
|
|
45
56
|
|
|
46
|
-
|
|
47
|
-
git log --grep="RUN-002" --oneline
|
|
48
|
-
```
|
|
57
|
+
Use the archive path to locate the commit that added it:
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
git log --diff-filter=A --format="%H %s" HEAD -- <archive-path>
|
|
51
60
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
Use the newest matching commit reachable from the current branch. Confirm the
|
|
62
|
+
archive was added by that commit, the commit has exactly one parent, and its
|
|
63
|
+
subject and diff are consistent with the requested feature. A merge commit needs
|
|
64
|
+
mainline selection, so stop rather than guessing. If the archive was never
|
|
65
|
+
committed, explain that git cannot reconstruct a safe rollback from it.
|
|
55
66
|
|
|
56
|
-
## Step 2 -
|
|
67
|
+
## Step 2 - separate product changes from Blueprint history
|
|
57
68
|
|
|
58
|
-
Inspect the
|
|
69
|
+
Inspect the target commit and build the product-path set from the files it
|
|
70
|
+
changed. Exclude these protected workflow paths:
|
|
59
71
|
|
|
60
|
-
**Protected Workflow Paths (Never Revert Automatically):**
|
|
61
72
|
- `.agents/**`
|
|
62
73
|
- `.claude/**`
|
|
63
|
-
- `devflow/**`
|
|
64
|
-
- `AGENTS.md`
|
|
65
|
-
-
|
|
74
|
+
- `devflow/**`
|
|
75
|
+
- `AGENTS.md`
|
|
76
|
+
- `CLAUDE.md`
|
|
77
|
+
- `prototypes/**`
|
|
78
|
+
|
|
79
|
+
The rollback must preserve the original feature archive, later planning changes,
|
|
80
|
+
the active rollback spec, adapter skills, and throwaway prototype history. Root
|
|
81
|
+
`README.md` and ordinary app docs are product files unless the project says
|
|
82
|
+
otherwise.
|
|
83
|
+
|
|
84
|
+
If no product paths remain, stop. Do not create an empty rollback that only
|
|
85
|
+
rewrites Blueprint records.
|
|
86
|
+
|
|
87
|
+
## Step 3 - review later-change risk
|
|
88
|
+
|
|
89
|
+
Inspect every commit after the target through `HEAD` that touches one of the
|
|
90
|
+
product paths. Also read later completed feature specs when they mention the
|
|
91
|
+
target, its contracts, routes, data, or files.
|
|
92
|
+
|
|
93
|
+
Classify the result:
|
|
94
|
+
|
|
95
|
+
- **No overlap** - no later commit touched the target product paths.
|
|
96
|
+
- **Overlap, likely compatible** - later edits touched the same paths, but the
|
|
97
|
+
target change can be reversed without removing their behavior.
|
|
98
|
+
- **Dependency risk** - later work appears to require the target's API, schema,
|
|
99
|
+
route, component, or data.
|
|
100
|
+
- **Blocked** - safe behavior after reversal is unclear, data migration would be
|
|
101
|
+
destructive, or a cascading rollback would be required.
|
|
102
|
+
|
|
103
|
+
Path overlap is a warning signal, not proof of dependency. Explain the concrete
|
|
104
|
+
later commit and contract involved. Never silently cascade into reverting other
|
|
105
|
+
features. For a blocked case, stop and ask the user to choose a narrower
|
|
106
|
+
remediation or explicitly plan the dependent rollbacks.
|
|
107
|
+
|
|
108
|
+
## Step 4 - write the rollback spec
|
|
109
|
+
|
|
110
|
+
Write `devflow/context/current-feature.md` using
|
|
111
|
+
`reference/rollback-spec-template.md`. Fill in:
|
|
112
|
+
|
|
113
|
+
- target feature, archive, exact commit, and parent commit
|
|
114
|
+
- user's reason
|
|
115
|
+
- product paths introduced or changed by the target
|
|
116
|
+
- protected workflow paths
|
|
117
|
+
- later commits reviewed and the risk classification
|
|
118
|
+
- compatibility work that is allowed, if any
|
|
119
|
+
- exact verification commands and observable removal criteria
|
|
120
|
+
|
|
121
|
+
The first build step must apply the target commit's product diff in reverse using
|
|
122
|
+
the guarded Type: Rollback behavior in `/implement`. Later steps may repair only
|
|
123
|
+
the specific downstream compatibility issues named in the spec. Do not use a
|
|
124
|
+
rollback as permission for unrelated cleanup.
|
|
125
|
+
|
|
126
|
+
Older installations may not have `devflow/history/rollbacks/` yet because
|
|
127
|
+
updates preserve user history. That is not a planning blocker; `/complete`
|
|
128
|
+
creates the directory when it archives the approved rollback.
|
|
129
|
+
|
|
130
|
+
Red-team the draft before presenting it:
|
|
131
|
+
|
|
132
|
+
- does it preserve all Blueprint history and later plan changes?
|
|
133
|
+
- could it remove data or require a destructive migration?
|
|
134
|
+
- does later code import or call something the target introduced?
|
|
135
|
+
- are the removal criteria observable rather than phrased as "feature gone"?
|
|
136
|
+
- can each compatibility edit be reviewed separately?
|
|
137
|
+
|
|
138
|
+
Tighten the spec, then stop. Summarize the target commit, affected product paths,
|
|
139
|
+
later-change risk, and what the critique changed. Tell the user to review the
|
|
140
|
+
spec, then run `/implement` to create the rollback branch and apply it.
|
|
66
141
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
## Step 3 - Review Later-Commit Risk (Dependency Risk Analysis)
|
|
70
|
-
|
|
71
|
-
Inspect every commit after the target commit through `HEAD` that touches any of the product files.
|
|
72
|
-
|
|
73
|
-
Classify the risk into one of 4 standard categories:
|
|
74
|
-
|
|
75
|
-
| Risk Level | Meaning | Action |
|
|
76
|
-
| :--- | :--- | :--- |
|
|
77
|
-
| **No Overlap** | No subsequent commits touched these product files. | Clean reversal is safe and straightforward. |
|
|
78
|
-
| **Overlap, Compatible** | Later edits touched the same files, but the target code can be cleanly extracted without breaking newer behavior. | Plan selective reverse-patching. |
|
|
79
|
-
| **Dependency Risk** | Subsequent features or bugfixes directly depend on types, APIs, tables, or exports introduced by the target. | Explicitly warn that dependent features will be affected; plan compatibility shims. |
|
|
80
|
-
| **Blocked** | Reversing the target would cause data loss, break database schema, or require a cascading rollback of multiple runs. | Stop and present the blocker to the user for explicit architectural guidance. |
|
|
81
|
-
|
|
82
|
-
## Step 4 - Produce The Guarded Rollback Plan
|
|
83
|
-
|
|
84
|
-
Draft the rollback plan containing:
|
|
85
|
-
|
|
86
|
-
1. **Target Run & Rationale**: Running ID, original commit SHA, author, and reason for reversal.
|
|
87
|
-
2. **Product Files to Revert**: Exact list of application files to modify/delete/restore.
|
|
88
|
-
3. **Protected Paths**: Explicit declaration of preserved history files.
|
|
89
|
-
4. **Risk Classification**: Dependency analysis findings and required compatibility repairs.
|
|
90
|
-
5. **Step-by-Step Reversal Steps**:
|
|
91
|
-
- Step 1: Apply reverse product diff.
|
|
92
|
-
- Step 2: Apply compatibility fixes for downstream dependencies.
|
|
93
|
-
- Step 3: Run project verify command (`npm test`, `npm run check`).
|
|
94
|
-
6. **Acceptance & Verification Criteria**: How to prove the removed behavior is truly gone without breaking existing unaffected features.
|
|
95
|
-
|
|
96
|
-
## Step 5 - Stop For Human Confirmation
|
|
97
|
-
|
|
98
|
-
Present the rollback plan to the user:
|
|
142
|
+
## Rules
|
|
99
143
|
|
|
100
|
-
-
|
|
101
|
-
-
|
|
144
|
+
- Preserve history. Never delete or rewrite the original feature archive.
|
|
145
|
+
- Plan only. This skill writes the rollback spec and nothing else.
|
|
146
|
+
- One completed feature per rollback.
|
|
147
|
+
- Never use `git reset --hard`, force-push, history rewriting, or broad file
|
|
148
|
+
restoration.
|
|
149
|
+
- Never infer permission to cascade into later features or destroy stored data.
|
|
150
|
+
- A rollback still uses `/implement`, `/check`, and `/complete` review gates.
|
|
102
151
|
|
|
103
|
-
##
|
|
152
|
+
## Formatting
|
|
104
153
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- **No Destructive Git Commands**: Never execute `git reset --hard HEAD~N` or `git push --force`. All reversals must be applied as forward commits.
|
|
108
|
-
- **One Target Per Rollback**: Avoid bundling multiple unrelated rollbacks into one pass.
|
|
109
|
-
- **Explicit Human Gate**: Always wait for user approval before applying any reverse diffs to code.
|
|
154
|
+
Format the output to match `devflow/context/ai-interaction.md`: concise,
|
|
155
|
+
scannable markdown with a small risk table when later commits overlap.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: status
|
|
3
|
+
description: "[devflow][B] Show where the project stands: build-plan progress, the current feature's checked and unchecked steps, git state, drift warnings, and the exact next action. Read-only. Use when the user runs /status, asks where things stand, what's next, what's in progress, or is picking work back up after a break or a context clear."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# status - where the project stands right now
|
|
7
|
+
|
|
8
|
+
Where this sits in the workflow:
|
|
9
|
+
|
|
10
|
+
any time -> [status] -> reads build-plan + current-feature + git
|
|
11
|
+
(read-only) prints a short "you are here"
|
|
12
|
+
|
|
13
|
+
This skill answers one question: *where am I?* It reads the files that already
|
|
14
|
+
track progress and prints a short orientation. It is the fast way back in after a
|
|
15
|
+
break, a context clear, or a day away. It never changes anything: no edits, no
|
|
16
|
+
commits, no installs, no builds, no branch changes.
|
|
17
|
+
|
|
18
|
+
Progress in this workflow lives in files, not the chat, so everything this skill
|
|
19
|
+
reports comes from disk and git. That is the point: a fresh session can run
|
|
20
|
+
`/status` and know exactly as much as the last one did.
|
|
21
|
+
|
|
22
|
+
For setup problems, missing files, placeholder plans, adapter drift, or questions
|
|
23
|
+
about whether the Blueprint is installed correctly, run `/doctor` instead.
|
|
24
|
+
|
|
25
|
+
## Input
|
|
26
|
+
|
|
27
|
+
None. `/status` takes no argument.
|
|
28
|
+
|
|
29
|
+
## What it reads
|
|
30
|
+
|
|
31
|
+
Gather these, then summarize. Don't dump file contents; report the distilled
|
|
32
|
+
state.
|
|
33
|
+
|
|
34
|
+
1. **Build plan** - `devflow/build-plan.md`. Count checked vs unchecked leaf
|
|
35
|
+
items. Name the next unchecked leaf, the same target `/feature` would pick,
|
|
36
|
+
and note if a parent item was split into sub-items (`4a`, `4b`, ...).
|
|
37
|
+
2. **Current work** - `devflow/context/current-feature.md`. Is something in
|
|
38
|
+
progress, or is it the reset stub? If a feature, fix, or rollback spec is
|
|
39
|
+
present, report its type and name, which build steps are checked, and the
|
|
40
|
+
first unchecked step where `/implement` resumes.
|
|
41
|
+
3. **Findings** - `devflow/context/findings.md`. Count findings by status and
|
|
42
|
+
report open and fixed counts next to build-plan progress. Call out any P0 or
|
|
43
|
+
P1 still `open` or `fixed` by ID, since those block `/complete`. A missing
|
|
44
|
+
file means no findings.
|
|
45
|
+
4. **Overview freshness** - if `devflow/context/project-overview.md` is missing,
|
|
46
|
+
or if `project-plan.md` or `build-plan.md` appears newer than it by filesystem
|
|
47
|
+
time, mention that `/overview` should run before new feature work.
|
|
48
|
+
5. **Git** - current branch, whether the working tree is clean or has uncommitted
|
|
49
|
+
changes, roughly how many files changed, last commit subject, and whether the
|
|
50
|
+
branch is ahead of its remote. If the directory is not a git repo, say so and
|
|
51
|
+
skip this part rather than failing.
|
|
52
|
+
6. **Progress drift** - flag active spec on `main`, a spec in progress but no
|
|
53
|
+
matching `feature/`, `fix/`, or `rollback/` branch, all spec steps checked but
|
|
54
|
+
not completed, or disagreement between `build-plan.md` and
|
|
55
|
+
`current-feature.md`. A rollback legitimately targets a checked build-plan
|
|
56
|
+
item until `/complete` unchecks it, so do not compare it to the next unchecked
|
|
57
|
+
feature.
|
|
58
|
+
|
|
59
|
+
## Output
|
|
60
|
+
|
|
61
|
+
A short, scannable summary, not a wall of text. Aim for something like:
|
|
62
|
+
|
|
63
|
+
Status: Building feature 4 - PDF export
|
|
64
|
+
Plans: Overview current. Build plan 3 of 9 complete.
|
|
65
|
+
Current work: Step 2 of 3 done. Next step: Download PDF button.
|
|
66
|
+
Findings: 1 open P2 (F-04), 1 fixed P1 awaiting re-review (F-02).
|
|
67
|
+
Git: branch feature/pdf-export, 3 uncommitted files, last commit "feat: widen export helper".
|
|
68
|
+
Watch: F-02 is fixed but not re-reviewed; it blocks /complete until /audit closes it.
|
|
69
|
+
|
|
70
|
+
Next action: run /implement for Step 3.
|
|
71
|
+
|
|
72
|
+
End with a single suggested next action, chosen in this order:
|
|
73
|
+
|
|
74
|
+
- The overview is missing or stale and no feature is in progress -> `/overview`.
|
|
75
|
+
- A spec is in progress with unchecked steps -> `/implement` and name the step.
|
|
76
|
+
- A spec is in progress and all implementation steps are checked -> `/check` if
|
|
77
|
+
proof is not recorded, `/try` if the user wants a manual review path,
|
|
78
|
+
`/implement` when a P0 or P1 finding is still `open` (the repair is an extra
|
|
79
|
+
reviewed step), `/audit` when one is `fixed` and awaiting re-review (both
|
|
80
|
+
block `/complete`), otherwise `/complete`.
|
|
81
|
+
- `current-feature.md` is the reset stub and a P0 or P1 finding is `open` ->
|
|
82
|
+
`/fix <finding id>`; when one is `fixed`, `/audit` to re-review and close it.
|
|
83
|
+
- `current-feature.md` is the reset stub and unchecked build-plan items remain ->
|
|
84
|
+
`/feature` and name the next build-plan item.
|
|
85
|
+
- All build-plan items are checked -> say the current milestone is complete;
|
|
86
|
+
suggest hardening, release, or docs when appropriate, or
|
|
87
|
+
`/feature "new capability"` to propose an addition to the living build plan.
|
|
88
|
+
Do not suggest creating a second build plan.
|
|
89
|
+
|
|
90
|
+
If something is off, include a `Watch:` line before the next action. Catching
|
|
91
|
+
drift is half the value of the command.
|
|
92
|
+
|
|
93
|
+
## Rules
|
|
94
|
+
|
|
95
|
+
- **Read-only, always.** This skill never writes a file, never commits, never runs
|
|
96
|
+
installs, never runs builds or tests, and never switches branches. If the user
|
|
97
|
+
wants to act on what it reports, they run the relevant skill next.
|
|
98
|
+
- **Prefer exact next actions.** Do not end with vague advice like "continue the
|
|
99
|
+
workflow". Name the command and, when useful, the file or step.
|
|
100
|
+
- **Distill, don't dump.** Report the state in a few lines. Do not paste file
|
|
101
|
+
contents back unless the user asks for them.
|
|
102
|
+
- **Be honest about gaps.** If a file is missing or the repo is not initialized,
|
|
103
|
+
say that plainly instead of guessing.
|
|
104
|
+
|
|
105
|
+
## Formatting
|
|
106
|
+
|
|
107
|
+
Format the output to match the project's conventions in
|
|
108
|
+
`devflow/context/ai-interaction.md`: concise, scannable markdown, with lists for
|
|
109
|
+
enumerations and tables for matrices rather than dense paragraphs.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test
|
|
3
|
-
description: "[
|
|
3
|
+
description: "[devflow][B] Test execution, missing test generation, and coverage analysis across unit, integration, and smoke test suites."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Test-Driven Development, Generation & Execution
|
|
@@ -91,4 +91,4 @@ When generating or logging test runs during `40-execute` or `50-verify`:
|
|
|
91
91
|
|
|
92
92
|
- **Classification**: Companion command & Engineering standard
|
|
93
93
|
- **Mainline stages**: `30-plan` (TDD decisions), `40-execute` (TDD execution), `50-verify` (QA gate)
|
|
94
|
-
- **Handoff**: `50-verify`, `Debug`, `autopilot`
|
|
94
|
+
- **Handoff**: `50-verify`, `Debug`, `autopilot`
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tests
|
|
3
|
+
description: "[devflow][B] Add or normalize unit testing for a Blueprint project. Detects the stack, reuses an existing test runner when present, or installs the stack-native unit test runner when missing, then adds one small example test, updates AGENTS.md commands, runs build and tests, and reports the diff. Use when the user runs /tests, invokes $tests, asks to add unit tests, set up unit testing, configure tests, or make tests part of the Blueprint workflow."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# tests - add unit testing to the project
|
|
7
|
+
|
|
8
|
+
Where this sits in the workflow:
|
|
9
|
+
|
|
10
|
+
any time -> [tests] -> test command in AGENTS.md -> /feature + /implement use it
|
|
11
|
+
(setup) (the opt-in testing gate) (logic steps get tests)
|
|
12
|
+
|
|
13
|
+
Testing is optional in the Blueprint until the project declares a real test
|
|
14
|
+
command in `AGENTS.md`. This skill is the explicit setup path. It adds or
|
|
15
|
+
normalizes **unit testing** only; browser automation and end-to-end testing are
|
|
16
|
+
separate setup work.
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
No argument is required. If the user names a runner or stack preference, treat it
|
|
21
|
+
as a preference and verify it against the project files.
|
|
22
|
+
|
|
23
|
+
## Step 1 - inspect the project
|
|
24
|
+
|
|
25
|
+
Read enough files to identify the real setup:
|
|
26
|
+
|
|
27
|
+
- `AGENTS.md` Commands section
|
|
28
|
+
- package or language manifest (`package.json`, `pyproject.toml`, `go.mod`,
|
|
29
|
+
`Cargo.toml`, and similar)
|
|
30
|
+
- existing test config (`vitest.config.*`, `jest.config.*`, `pytest.ini`,
|
|
31
|
+
`phpunit.xml`, language-native config, and similar)
|
|
32
|
+
- existing test files
|
|
33
|
+
- package manager lockfile
|
|
34
|
+
- an existing `Verify` command and `.github/workflows/verify.yml`, when present
|
|
35
|
+
- `devflow/context/coding-standards.md`
|
|
36
|
+
|
|
37
|
+
Do not assume Next.js. Detect the stack from files.
|
|
38
|
+
|
|
39
|
+
## Step 2 - choose the smallest test setup
|
|
40
|
+
|
|
41
|
+
Prefer the existing runner if one is already present. If none exists, choose the
|
|
42
|
+
stack-native unit test runner:
|
|
43
|
+
|
|
44
|
+
- TypeScript or JavaScript app: Vitest by default, unless the project already
|
|
45
|
+
clearly uses Jest or another runner.
|
|
46
|
+
- Python: pytest.
|
|
47
|
+
- Go: built-in `go test`.
|
|
48
|
+
- Rust: built-in `cargo test`.
|
|
49
|
+
- Ruby: the runner already implied by the project, or Minitest when nothing else
|
|
50
|
+
is present.
|
|
51
|
+
- PHP: PHPUnit when the project is Composer-based.
|
|
52
|
+
|
|
53
|
+
If the stack is unclear, stop and ask what runner to use instead of guessing.
|
|
54
|
+
|
|
55
|
+
Keep the setup minimal. Do not add coverage, browser testing, CI, snapshots,
|
|
56
|
+
mock-service layers, or a large test architecture unless the user explicitly asks.
|
|
57
|
+
|
|
58
|
+
## Step 3 - make the setup changes
|
|
59
|
+
|
|
60
|
+
Apply the smallest practical diff:
|
|
61
|
+
|
|
62
|
+
1. Add missing test dependencies or config.
|
|
63
|
+
2. Add or normalize package/script commands.
|
|
64
|
+
3. Add one small example test for real project logic if a suitable function
|
|
65
|
+
exists; otherwise add a tiny helper and test that proves the runner works.
|
|
66
|
+
4. Update the Commands section of `AGENTS.md` with the real test command and,
|
|
67
|
+
when available, the test watch command.
|
|
68
|
+
5. If a `Verify` command already exists, add the real test command to it between
|
|
69
|
+
typecheck and build while preserving any established project checks. Do not
|
|
70
|
+
create verification or CI only because `/tests` was invoked.
|
|
71
|
+
6. Update `devflow/context/coding-standards.md` only if the project needs a
|
|
72
|
+
stack-specific testing note different from the default.
|
|
73
|
+
|
|
74
|
+
Do not write a broad test suite for existing app code. This skill proves the
|
|
75
|
+
testing path and turns on the gate; feature work adds focused tests later.
|
|
76
|
+
|
|
77
|
+
If adding dependencies requires network access, ask for the needed install command
|
|
78
|
+
through the current tool's approval flow. Use the project's package manager.
|
|
79
|
+
|
|
80
|
+
## Step 4 - verify
|
|
81
|
+
|
|
82
|
+
If `AGENTS.md` documents a `Verify` command, run the focused test command and
|
|
83
|
+
then run `Verify` as the final gate. The combined command should now exercise the
|
|
84
|
+
new tests along with its existing typecheck and build checks.
|
|
85
|
+
|
|
86
|
+
If no `Verify` command exists, run the relevant commands from `AGENTS.md`:
|
|
87
|
+
|
|
88
|
+
- the test command
|
|
89
|
+
- the build command, when one exists
|
|
90
|
+
- lint or typecheck only if they are already standard commands and the diff
|
|
91
|
+
touches config or types that should satisfy them
|
|
92
|
+
|
|
93
|
+
An empty suite must not be treated as a pass. If the runner reports no tests, add
|
|
94
|
+
or fix the example test.
|
|
95
|
+
|
|
96
|
+
## Step 5 - report
|
|
97
|
+
|
|
98
|
+
Stop with a concise report:
|
|
99
|
+
|
|
100
|
+
- runner chosen or reused
|
|
101
|
+
- commands added or updated
|
|
102
|
+
- existing verification command updated, or confirmation that none exists
|
|
103
|
+
- example test added
|
|
104
|
+
- verification commands run and whether they passed
|
|
105
|
+
- any follow-up the user should consider
|
|
106
|
+
|
|
107
|
+
Show the diff summary. Do not commit, merge, push, or start product feature work.
|
|
108
|
+
|
|
109
|
+
## Rules
|
|
110
|
+
|
|
111
|
+
- Unit testing only. Do not set up Playwright, Cypress, browser E2E, CI, or
|
|
112
|
+
coverage unless the user explicitly asks.
|
|
113
|
+
- Reuse existing project conventions before adding new tools.
|
|
114
|
+
- Preserve existing CI. This skill may update an existing verification command,
|
|
115
|
+
but it never creates a GitHub workflow on its own.
|
|
116
|
+
- Keep the first test boring and small. It exists to prove the workflow.
|
|
117
|
+
- Once `AGENTS.md` has a test command, later `/feature` and `/implement` runs
|
|
118
|
+
treat tests as the gate for logic-bearing changes.
|
|
119
|
+
- Do not hide install or verification failures. Report exactly what failed and
|
|
120
|
+
what to fix next.
|
|
121
|
+
|
|
122
|
+
## Formatting
|
|
123
|
+
|
|
124
|
+
Format the output to match the project's conventions in
|
|
125
|
+
`devflow/context/ai-interaction.md`: concise, scannable markdown, with lists for
|
|
126
|
+
enumerations and tables for matrices rather than dense paragraphs.
|