mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-23 08:31:44 +01:00
A disabled_skills verify entry keeps /build-check off, and gstack stops claiming verify prompts (#4593) (#4719)
A `disabled_skills: verify` entry now turns off `/build-check`, and gstack's router and skill description no longer claim prompts that say "verify my change". Why: this finishes the #4593 rename, so Claude Code's built-in `/verify` gets those prompts and an old opt-out keeps working. What you do: nothing. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
9d758432eb
commit
c2da82e49c
17 files changed
+117
-27
No files matched your search
@@ -217,7 +217,7 @@ whenever a routing rule below matches, subject to "When to invoke, and when not
|
||||
- User asks to write a skill, improve or slim a skill, or add a lesson to a named skill → invoke `/write-skill`
|
||||
- User asks about visual polish, design audit of a live site, "this looks off" → invoke `/design-review`
|
||||
- User asks to audit the live developer experience, time-to-hello-world → invoke `/devex-review`
|
||||
- User asks to run the checks, make the tests pass, "verify my change", "check my work" while building → invoke `/build-check`
|
||||
- User asks to run the checks, make the tests pass, "check my work" while building → invoke `/build-check`
|
||||
- User asks to ship, push, create a PR, "let's land this", "send it" → invoke `/ship` (deploying is `/land-and-deploy`, below)
|
||||
- User asks to merge + deploy + verify as one flow → tell them to type `/land-and-deploy`; never merge or deploy by hand
|
||||
- User asks to rebase or revive an old PR, "modernize this PR", whether a stale PR is still worth landing → tell them to type `/modernize`
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ whenever a routing rule below matches, subject to "When to invoke, and when not
|
||||
- User asks to write a skill, improve or slim a skill, or add a lesson to a named skill → invoke `/write-skill`
|
||||
- User asks about visual polish, design audit of a live site, "this looks off" → invoke `/design-review`
|
||||
- User asks to audit the live developer experience, time-to-hello-world → invoke `/devex-review`
|
||||
- User asks to run the checks, make the tests pass, "verify my change", "check my work" while building → invoke `/build-check`
|
||||
- User asks to run the checks, make the tests pass, "check my work" while building → invoke `/build-check`
|
||||
- User asks to ship, push, create a PR, "let's land this", "send it" → invoke `/ship` (deploying is `/land-and-deploy`, below)
|
||||
- User asks to merge + deploy + verify as one flow → tell them to type `/land-and-deploy`; never merge or deploy by hand
|
||||
- User asks to rebase or revive an old PR, "modernize this PR", whether a stale PR is still worth landing → tell them to type `/modernize`
|
||||
|
||||
@@ -1047,8 +1047,10 @@ $_gstack_legacy_root"
|
||||
done
|
||||
done
|
||||
_clean=""
|
||||
_renamed="$( [ -f "$(dirname "$0")/gstack-install-registry.sh" ] && . "$(dirname "$0")/gstack-install-registry.sh" 2>/dev/null && printf '%s' "${GSTACK_RENAMED_SKILLS:-}" || true)"
|
||||
for _x in $(printf '%s' "$VALUE" | tr ',' ' ' | tr -d "\"'"); do
|
||||
_x="${_x#/}"
|
||||
for _r in $_renamed; do [ "${_x#gstack-}" = "${_r%%:*}" ] && _x="${_r#*:}"; done
|
||||
case "$_x" in
|
||||
gstack|gstack-upgrade)
|
||||
echo "Error: $_x cannot be disabled (it is how gstack upgrades and routes). Existing value left unchanged." >&2
|
||||
|
||||
@@ -354,6 +354,23 @@ gstack_disabled_normalize() {
|
||||
# (test/retired-skills.test.ts).
|
||||
GSTACK_RETIRED_SKILLS="investigate verify"
|
||||
|
||||
# GSTACK_RENAMED_SKILLS — old:new skill names. A user's disabled_skills entry
|
||||
# under an old name still turns off the skill's new name (#4593). Same map as
|
||||
# RENAMED_SKILLS in scripts/discover-skills.ts.
|
||||
GSTACK_RENAMED_SKILLS="verify:build-check"
|
||||
|
||||
# gstack_disabled_config VALUE — gstack_disabled_normalize for the user's own
|
||||
# disabled_skills value, with each renamed skill mapped to its new name. Only
|
||||
# the config value is mapped: the retired list keeps its old names.
|
||||
gstack_disabled_config() {
|
||||
local out=" " n r
|
||||
for n in $(gstack_disabled_normalize "$1"); do
|
||||
for r in $GSTACK_RENAMED_SKILLS; do [ "$n" = "${r%%:*}" ] && n="${r#*:}"; done
|
||||
case "$out" in *" $n "*) ;; *) out="$out$n " ;; esac
|
||||
done
|
||||
printf '%s' "$out"
|
||||
}
|
||||
|
||||
# GSTACK_CREW_SKILLS — the gstack-on-Capy skills (crew/README.md). Only a Capy
|
||||
# machine registers them; anywhere else they get no entry on any host and an
|
||||
# existing gstack-owned entry is removed, like a retired skill. Same list as
|
||||
|
||||
+10
-4
@@ -70,7 +70,7 @@ PREFIX=$("$GSTACK_CONFIG" get skill_prefix 2>/dev/null || echo "false")
|
||||
DISABLED=" "
|
||||
if [ -f "$SCRIPT_DIR/gstack-install-registry.sh" ]; then
|
||||
. "$SCRIPT_DIR/gstack-install-registry.sh"
|
||||
DISABLED="$(gstack_disabled_normalize "$("$GSTACK_CONFIG" get disabled_skills 2>/dev/null || true)")"
|
||||
DISABLED="$(gstack_disabled_config "$("$GSTACK_CONFIG" get disabled_skills 2>/dev/null || true)")"
|
||||
fi
|
||||
# Retired skills, and the crew skills off a Capy machine
|
||||
# (GSTACK_UNREGISTERED_SKILLS), lose their entry the same way; only the user's
|
||||
@@ -107,7 +107,7 @@ RENDER_DIR="${RENDER_DIR:-$GSTACK_STATE_ROOT/render/claude}"
|
||||
# refreshed in place. WEAK (byte-identity with our source, or gen-skill-docs'
|
||||
# two-line banner on a real file) proves only that the SKILL.md came from us:
|
||||
# it authorizes touching that one file, never deleting the directory, and a
|
||||
# differing file is moved to $GSTACK_STATE_ROOT/backups/skills/<ts>/
|
||||
# differing file is moved to $GSTACK_STATE_ROOT/backups/skills/<ts>.<random>/
|
||||
# before we link over it (a user who started their own skill from a gstack
|
||||
# SKILL.md looks exactly like a pre-marker legacy copy).
|
||||
#
|
||||
@@ -231,12 +231,18 @@ _report_foreign() {
|
||||
}
|
||||
|
||||
# Weakly-proven real files we would otherwise overwrite go here, one summary
|
||||
# line at the end. mv, not cp: the link that follows needs the path free.
|
||||
BACKUP_ROOT="$GSTACK_STATE_ROOT/backups/skills/$(date +%Y%m%dT%H%M%S)"
|
||||
# line at the end. mv, not cp: the link that follows needs the path free. The
|
||||
# folder is made on first use with mktemp, so two runs in the same second never
|
||||
# share it and one run's backup can't overwrite another's.
|
||||
BACKUP_ROOT=""
|
||||
BACKED_UP=()
|
||||
_backup_skill_md() {
|
||||
# Non-zero when the file could NOT be moved: the caller leaves the entry alone.
|
||||
local file="$1" name="$2"
|
||||
if [ -z "$BACKUP_ROOT" ]; then
|
||||
mkdir -p "$GSTACK_STATE_ROOT/backups/skills" 2>/dev/null || return 1
|
||||
BACKUP_ROOT="$(mktemp -d "$GSTACK_STATE_ROOT/backups/skills/$(date +%Y%m%dT%H%M%S).XXXXXX" 2>/dev/null)" || return 1
|
||||
fi
|
||||
mkdir -p "$BACKUP_ROOT/$name" 2>/dev/null || return 1
|
||||
mv -f "$file" "$BACKUP_ROOT/$name/SKILL.md" 2>/dev/null || return 1
|
||||
BACKED_UP+=("$name")
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
name: build-check
|
||||
preamble-tier: 1
|
||||
version: 0.1.0
|
||||
description: "Use when coding: run the checks and tests /ship picks until green. Use for: verify my change, run the checks, make the tests pass. (gstack)"
|
||||
description: "Use when coding: run the checks and tests /ship picks until green. Use for: run the checks, make the tests pass, make it green. (gstack)"
|
||||
triggers:
|
||||
- verify my change
|
||||
- run the checks
|
||||
- make the tests pass
|
||||
- make it green
|
||||
|
||||
@@ -5,10 +5,9 @@ version: 0.1.0
|
||||
description: |
|
||||
Use when coding: run the checks and tests /ship picks until green.
|
||||
Build loop: run the repo's checks and the tests /ship would pick, fix, repeat.
|
||||
Never green when no test covers a change. Fits "verify", "check my work", "run
|
||||
the checks", "make it green", or after each change before /ship. (gstack)
|
||||
Never green when no test covers a change. Fits "check my work", "run the
|
||||
checks", "make it green", or after each change before /ship. (gstack)
|
||||
triggers:
|
||||
- verify my change
|
||||
- run the checks
|
||||
- make the tests pass
|
||||
- make it green
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
bump: patch
|
||||
---
|
||||
**A `disabled_skills: verify` entry now turns off `/build-check`, and gstack no longer claims prompts that say "verify" (#4593).** gstack renamed `/verify` to `/build-check` so Claude Code's built-in `/verify` works again. If your config still says `disabled_skills: verify`, gstack now reads it as `build-check`, so the skill stays off after you upgrade. `/build-check`'s description and the prompt router no longer list "verify my change", which leaves prompts about verifying to Claude Code's own skill. When setup or an upgrade moves an edited skill file aside, each run now gets its own backup folder, so two runs in the same second can't overwrite each other's backups.
|
||||
@@ -63,12 +63,12 @@ The hook replaces the `## Skill routing` section gstack used to offer for your p
|
||||
|
||||
`gstack-skill-route --explain` shows what the hook would do, with the switch on or off. It never injects anything.
|
||||
|
||||
$ gstack-skill-route --explain "run the checks and verify my change"
|
||||
$ gstack-skill-route --explain "run the checks and make it green"
|
||||
switch: skill_routing on (default)
|
||||
threshold: 0.66
|
||||
skills: 63 scanned in /home/you/.claude/skills
|
||||
candidates:
|
||||
1.00 /build-check "verify my change" (2 words, gstack)
|
||||
1.00 /build-check "run the checks" (2 words, gstack)
|
||||
0.50 /review "review my changes" (1 words, gstack)
|
||||
route: /build-check
|
||||
hint: gstack skill routing (UserPromptSubmit hook; ...
|
||||
|
||||
+1
-1
@@ -674,7 +674,7 @@ It asks once before running any repo command (`gstack-checks trust`) and asks ag
|
||||
|
||||
`/build-check` was called `/verify` until this release. Claude Code ships its own `/verify` skill, which checks a change end to end by running your app, and an installed skill with the same name hid it. Since Claude Code 2.1.286 the name alone also made Claude Code run gstack's skill right before every commit (#4593). Upgrading removes gstack's old `verify` and `gstack-verify` entries on every host, but never a `verify` skill of your own, so `/verify` opens Claude Code's built-in again and the before-every-commit instruction goes away.
|
||||
|
||||
`/build-check quick` (or `pre-commit`) runs a quick check-only pass instead of the loop: one `gstack-checks quick` call that runs the same checks and selected tests, edits nothing, adds no tests, asks nothing and skips gstack's startup steps, then ends with one line, `VERIFY PASS`, `VERIFY FAIL` or `VERIFY skipped: <reason>`. A check that runs out of time is a `FAIL` (`<check> TIMEOUT`). The checks share one `--timeout` budget, and the test stage starts with what is left. A skip (no `origin` to select tests against, commands you haven't trusted yet, nothing declared) lets the commit go ahead; a `FAIL` makes the model stop and ask you before committing. Nothing starts this pass before a commit on its own any more, so the old `verify_before_commit` setting is retired: it does nothing, and a config file that still sets it keeps working. A `disabled_skills` entry of `verify` no longer matches anything; write `build-check` instead.
|
||||
`/build-check quick` (or `pre-commit`) runs a quick check-only pass instead of the loop: one `gstack-checks quick` call that runs the same checks and selected tests, edits nothing, adds no tests, asks nothing and skips gstack's startup steps, then ends with one line, `VERIFY PASS`, `VERIFY FAIL` or `VERIFY skipped: <reason>`. A check that runs out of time is a `FAIL` (`<check> TIMEOUT`). The checks share one `--timeout` budget, and the test stage starts with what is left. A skip (no `origin` to select tests against, commands you haven't trusted yet, nothing declared) lets the commit go ahead; a `FAIL` makes the model stop and ask you before committing. Nothing starts this pass before a commit on its own any more, so the old `verify_before_commit` setting is retired: it does nothing, and a config file that still sets it keeps working. A `disabled_skills` entry of `verify` (or `gstack-verify`) is read as `build-check`, so a skill you turned off under its old name stays off after you upgrade.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { unregisteredSkills } from '../scripts/discover-skills';
|
||||
import { RENAMED_SKILLS, unregisteredSkills } from '../scripts/discover-skills';
|
||||
import { bunIsolationArgs } from './bun-isolation';
|
||||
import { runBashSync } from './script-invocation';
|
||||
import { readConfigKey } from './state-root';
|
||||
@@ -236,7 +236,7 @@ function skillDirs(root: string, triggersByName = new Map<string, string[]>()):
|
||||
/** The skills a target's payload carries: the host render (made for this checkout as the install root) or the checkout's committed Claude render. */
|
||||
export function sourceSkills(target: Target, checkout: string, scratch: string, env: Env = process.env): SkillEntry[] {
|
||||
const disabled = (readConfigKey('disabled_skills', env) ?? '').replace(/["']/g, '').split(/[\s,]+/)
|
||||
.map(n => n.replace(/^\//, '')).filter(n => n && n !== 'gstack' && n !== 'gstack-upgrade').map(n => n.replace(/^gstack-/, ''));
|
||||
.map(n => n.replace(/^\//, '')).filter(n => n && n !== 'gstack' && n !== 'gstack-upgrade').map(n => n.replace(/^gstack-/, '')).map(n => RENAMED_SKILLS[n] ?? n);
|
||||
const off = [...unregisteredSkills(), ...disabled];
|
||||
const registered = (s: SkillEntry) => !off.includes(s.name.replace(/^gstack-/, ''));
|
||||
if (target.render === 'claude') return skillDirs(checkout).filter(s => s.name !== 'gstack' && registered(s));
|
||||
|
||||
@@ -20,6 +20,13 @@ const SKIP = new Set(['node_modules', '.git', 'dist']);
|
||||
*/
|
||||
export const RETIRED_SKILLS = ['investigate', 'verify'];
|
||||
|
||||
/**
|
||||
* Old skill name → new name. A user's disabled_skills entry under the old name
|
||||
* still turns off the renamed skill (#4593). Same map as GSTACK_RENAMED_SKILLS
|
||||
* in bin/gstack-install-registry.sh.
|
||||
*/
|
||||
export const RENAMED_SKILLS: Readonly<Record<string, string>> = { verify: 'build-check' };
|
||||
|
||||
/**
|
||||
* Review skills /autoplan reads as a phase methodology from its own directory
|
||||
* on external hosts: each renders a second time beside gstack-autoplan/SKILL.md
|
||||
|
||||
@@ -27,6 +27,7 @@ import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
import { readConfigKey } from '../lib/state-root';
|
||||
import { RENAMED_SKILLS } from './discover-skills';
|
||||
import { loadGbrainOverride, runGeneration } from './gen-skill-docs';
|
||||
import { resolveModel } from './models';
|
||||
import { ModuleError, type ModuleSelection } from './modules';
|
||||
@@ -152,7 +153,7 @@ export async function installLoadout(request: InstallRequest): Promise<InstallRe
|
||||
const gbrainDetected = loadGbrainOverride(true);
|
||||
const disabledSkills = [...new Set((readConfigKey('disabled_skills') ?? '').replace(/["']/g, '').split(/[\s,]+/)
|
||||
.map(n => n.replace(/^\//, '')).filter(n => n !== 'gstack' && n !== 'gstack-upgrade')
|
||||
.map(n => n.replace(/^gstack-/, '')).filter(n => /^[a-z0-9-]+$/.test(n)))].sort();
|
||||
.map(n => n.replace(/^gstack-/, '')).map(n => RENAMED_SKILLS[n] ?? n).filter(n => /^[a-z0-9-]+$/.test(n)))].sort();
|
||||
const identity = {
|
||||
loadout: selection.name,
|
||||
excluded: [...selection.excluded].sort(),
|
||||
|
||||
@@ -618,7 +618,7 @@ EOF
|
||||
echo "Upgrade summary:"
|
||||
fi
|
||||
gstack_install_registry_render < "$_RF_SUMMARY"
|
||||
_rf_disabled="$(gstack_disabled_normalize "$("$SOURCE_GSTACK_DIR/bin/gstack-config" get disabled_skills 2>/dev/null || true)")"
|
||||
_rf_disabled="$(gstack_disabled_config "$("$SOURCE_GSTACK_DIR/bin/gstack-config" get disabled_skills 2>/dev/null || true)")"
|
||||
if [ "$_rf_disabled" != " " ]; then
|
||||
echo " disabled skills (not registered on any host):$_rf_disabled"
|
||||
fi
|
||||
@@ -940,7 +940,7 @@ _record_skill_copies() {
|
||||
# marker) means we created the entry and may delete or refresh it whole; WEAK
|
||||
# (byte-identity with our source, or the two-line generated banner on a real
|
||||
# file) covers only that SKILL.md — never the directory — and a differing
|
||||
# weakly-proven file is moved to $GSTACK_STATE_ROOT/backups/skills/<ts>/
|
||||
# weakly-proven file is moved to $GSTACK_STATE_ROOT/backups/skills/<ts>.<random>/
|
||||
# before we install over it. An entry is OURS
|
||||
# when: it is a symlink resolving into the gstack payload / render dir (or any
|
||||
# path with a `gstack` segment, the convention cleanup and gstack-uninstall
|
||||
@@ -1020,13 +1020,18 @@ _claude_entry_owned_strongly() {
|
||||
return 1
|
||||
}
|
||||
# Weakly-proven real files we would otherwise overwrite are moved here (mv, so
|
||||
# the path is free for the link); the final summary prints one line.
|
||||
_SKILL_BACKUP_ROOT="$GSTACK_STATE_ROOT/backups/skills/$(date +%Y%m%dT%H%M%S)"
|
||||
# the path is free for the link); the final summary prints one line. The folder
|
||||
# is made on first use with mktemp, so two runs in the same second never share it.
|
||||
_SKILL_BACKUP_ROOT=""
|
||||
_BACKED_UP_SKILL_MDS=()
|
||||
_backup_skill_md() {
|
||||
# Returns non-zero when the file could NOT be moved: the caller must then
|
||||
# leave the entry untouched (a failed backup is never a license to overwrite).
|
||||
local file="$1" name="$2"
|
||||
if [ -z "$_SKILL_BACKUP_ROOT" ]; then
|
||||
mkdir -p "$GSTACK_STATE_ROOT/backups/skills" 2>/dev/null || return 1
|
||||
_SKILL_BACKUP_ROOT="$(mktemp -d "$GSTACK_STATE_ROOT/backups/skills/$(date +%Y%m%dT%H%M%S).XXXXXX" 2>/dev/null)" || return 1
|
||||
fi
|
||||
mkdir -p "$_SKILL_BACKUP_ROOT/$name" 2>/dev/null || return 1
|
||||
mv -f "$file" "$_SKILL_BACKUP_ROOT/$name/SKILL.md" 2>/dev/null || return 1
|
||||
_BACKED_UP_SKILL_MDS+=("$name")
|
||||
@@ -1476,7 +1481,7 @@ fi
|
||||
# it keep working. Missing or empty = every skill enabled (#1206). Linkers test
|
||||
# membership inline with "${_DISABLED_SKILLS:- }", so a linker extracted on its
|
||||
# own (tests) behaves as "nothing disabled".
|
||||
_USER_DISABLED_SKILLS="$(gstack_disabled_normalize "$("$GSTACK_CONFIG" get disabled_skills 2>/dev/null || true)")"
|
||||
_USER_DISABLED_SKILLS="$(gstack_disabled_config "$("$GSTACK_CONFIG" get disabled_skills 2>/dev/null || true)")"
|
||||
# Retired skills, and the crew skills off a Capy machine
|
||||
# (GSTACK_UNREGISTERED_SKILLS), take the same no-entry path on every host; only
|
||||
# the user's own list is reported and passed to the router.
|
||||
|
||||
@@ -17,7 +17,7 @@ import { runGeneration } from '../scripts/gen-skill-docs';
|
||||
|
||||
const ROOT = path.resolve(import.meta.dir, '..');
|
||||
const REGISTRY = path.join(ROOT, 'bin', 'gstack-install-registry.sh');
|
||||
const BINS = ['gstack-config', 'gstack-relink', 'gstack-patch-names', 'gstack-skill-name.sh', 'gstack-state-root.sh', 'gstack-install-registry.sh'];
|
||||
const BINS = ['gstack-config', 'gstack-lock.sh', 'gstack-relink', 'gstack-patch-names', 'gstack-skill-name.sh', 'gstack-state-root.sh', 'gstack-install-registry.sh'];
|
||||
const PLAN_ENG = 'plan-eng-review'; // pregate-literal: GST-2726 took plan-eng-review off GSTACK_RETIRED_SKILLS; investigate stays retired
|
||||
|
||||
test('setup and gstack-relink retire the same skills as the generator', () => {
|
||||
@@ -31,12 +31,12 @@ describe('gstack-relink after an upgrade removed /investigate (GST-1717)', () =>
|
||||
let tmp: string;
|
||||
let install: string;
|
||||
let skills: string;
|
||||
const relink = () => spawnSync('bash', [path.join(install, 'bin', 'gstack-relink')], {
|
||||
const relink = (extra: NodeJS.ProcessEnv = {}) => spawnSync('bash', [path.join(install, 'bin', 'gstack-relink')], {
|
||||
encoding: 'utf8',
|
||||
timeout: 60_000,
|
||||
env: {
|
||||
...process.env, GSTACK_HOME: path.join(tmp, 'state'), GSTACK_STATE_ROOT: '', GSTACK_STATE_DIR: '',
|
||||
GSTACK_INSTALL_DIR: install, GSTACK_SKILLS_DIR: skills, GSTACK_SETUP_RUNNING: '',
|
||||
GSTACK_INSTALL_DIR: install, GSTACK_SKILLS_DIR: skills, GSTACK_SETUP_RUNNING: '', ...extra,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -89,6 +89,55 @@ describe('gstack-relink after an upgrade removed /investigate (GST-1717)', () =>
|
||||
expect(backups.map(f => fs.readFileSync(f, 'utf8'))).toEqual([edited]);
|
||||
});
|
||||
|
||||
test('two relinks in the same second keep both backups (#4593)', () => {
|
||||
const shim = path.join(tmp, 'shim');
|
||||
fs.mkdirSync(shim);
|
||||
fs.writeFileSync(path.join(shim, 'date'), '#!/bin/sh\necho 20261122T120000\n');
|
||||
fs.chmodSync(path.join(shim, 'date'), 0o755);
|
||||
const sameSecond = { PATH: `${shim}${path.delimiter}${process.env.PATH}` };
|
||||
const edits = ['FIRST EDIT', 'SECOND EDIT'].map(e => `---\nname: investigate\ndescription: test\n---\n<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->\n<!-- Regenerate: bun run gen:skill-docs -->\n${e}\n`);
|
||||
for (const edited of edits) {
|
||||
fs.mkdirSync(path.join(skills, 'investigate'), { recursive: true });
|
||||
fs.writeFileSync(path.join(skills, 'investigate', 'SKILL.md'), edited);
|
||||
const r = relink(sameSecond);
|
||||
expect(r.status, r.stderr).toBe(0);
|
||||
}
|
||||
const root = path.join(tmp, 'state', 'backups', 'skills');
|
||||
const backups = fs.readdirSync(root).map(stamp => path.join(root, stamp, 'investigate', 'SKILL.md')).filter(f => fs.existsSync(f));
|
||||
expect(backups.map(f => fs.readFileSync(f, 'utf8')).sort()).toEqual([...edits].sort());
|
||||
});
|
||||
|
||||
test('a disabled_skills entry of verify still turns off build-check (#4593)', () => {
|
||||
fs.mkdirSync(path.join(install, 'build-check'));
|
||||
fs.writeFileSync(path.join(install, 'build-check', 'SKILL.md'), '---\nname: build-check\ndescription: test\n---\n# build-check\n');
|
||||
fs.mkdirSync(path.join(tmp, 'state'), { recursive: true });
|
||||
fs.writeFileSync(path.join(tmp, 'state', 'config.yaml'), 'disabled_skills: verify\n');
|
||||
const r = relink();
|
||||
expect(r.status, r.stderr).toBe(0);
|
||||
expect(fs.existsSync(path.join(skills, 'build-check', 'SKILL.md'))).toBe(false);
|
||||
expect(fs.existsSync(path.join(skills, 'ship', 'SKILL.md'))).toBe(true);
|
||||
});
|
||||
|
||||
test('gstack-config set disabled_skills verify stores build-check (#4593)', () => {
|
||||
fs.mkdirSync(path.join(install, 'build-check'));
|
||||
fs.writeFileSync(path.join(install, 'build-check', 'SKILL.md'), '---\nname: build-check\ndescription: test\n---\n# build-check\n');
|
||||
const r = spawnSync('bash', [path.join(install, 'bin', 'gstack-config'), 'set', 'disabled_skills', 'verify,ship'], {
|
||||
encoding: 'utf8',
|
||||
timeout: 60_000,
|
||||
env: { ...process.env, GSTACK_HOME: path.join(tmp, 'state'), GSTACK_STATE_ROOT: '', GSTACK_STATE_DIR: '', GSTACK_INSTALL_DIR: install, GSTACK_SKILLS_DIR: skills, GSTACK_SETUP_RUNNING: '1' },
|
||||
});
|
||||
expect(r.status, r.stderr).toBe(0);
|
||||
expect(fs.readFileSync(path.join(tmp, 'state', 'config.yaml'), 'utf8')).toMatch(/^disabled_skills: build-check,ship$/m);
|
||||
});
|
||||
|
||||
test('the retired verify name is not mapped: build-check stays on when nothing disables it', () => {
|
||||
fs.mkdirSync(path.join(install, 'build-check'));
|
||||
fs.writeFileSync(path.join(install, 'build-check', 'SKILL.md'), '---\nname: build-check\ndescription: test\n---\n# build-check\n');
|
||||
const r = relink();
|
||||
expect(r.status, r.stderr).toBe(0);
|
||||
expect(fs.existsSync(path.join(skills, 'build-check', 'SKILL.md'))).toBe(true);
|
||||
});
|
||||
|
||||
test("a marked gstack-investigate directory keeps the user's files and backs up its real SKILL.md", () => {
|
||||
fs.mkdirSync(path.join(skills, 'gstack-investigate'));
|
||||
fs.writeFileSync(path.join(skills, 'gstack-investigate', '.gstack-owned'), '');
|
||||
|
||||
@@ -86,7 +86,7 @@ describe('discovery-target descriptions (GST-1088)', () => {
|
||||
['test the site and fix what you find', 'qa'],
|
||||
['can you qa test this page', 'qa'],
|
||||
['run the checks and make it green', 'build-check'],
|
||||
['verify my change', 'build-check'],
|
||||
['make the tests pass', 'build-check'],
|
||||
];
|
||||
for (const [prompt, want] of PROMPTS) {
|
||||
test('untold prompt "' + prompt + '" carries ' + (want ? 'a ' + want + ' trigger and no other' : 'no') + ' target trigger', () => {
|
||||
|
||||
@@ -294,12 +294,13 @@ describe('installed skills beside gstack (GST-3123)', () => {
|
||||
'What does this print?\n~~~sh\nrun the checks || echo broken\n~~~',
|
||||
'What does this print?\n```\nrun the checks\n````\nmore\n````',
|
||||
'rename `handleError` to `onError`',
|
||||
'verify my change',
|
||||
]) {
|
||||
expect([text, names(text)]).toEqual([text, []]);
|
||||
expect([text, names(text, 'codex')]).toEqual([text, []]);
|
||||
}
|
||||
for (const [text, skill] of [
|
||||
['run the checks', 'build-check'], ['verify my change in `src/app.ts`', 'build-check'], ['run the checks, then `git push`', 'build-check'],
|
||||
['run the checks', 'build-check'], ['run the checks on `src/app.ts`', 'build-check'], ['run the checks, then `git push`', 'build-check'],
|
||||
['an unclosed ` backtick: run the checks', 'build-check'], ['```\nmake check\n```\nrun the checks on that', 'build-check'],
|
||||
['review this pr before I merge `feature/login`', 'review'], ['please review my changes to `lib/auth.ts`', 'review'],
|
||||
]) {
|
||||
|
||||
Reference in new issue
Block a user