mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-07 05:56:41 +02:00
docs+test: SKILL authoring guidance + regression tests
Adds "Writing SKILL templates" section to CLAUDE.md explaining that templates are prompts, not scripts. Adds validation test catching hardcoded 'main' in git commands, and resolver content test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -131,6 +131,27 @@ describe('gen-skill-docs', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('BASE_BRANCH_DETECT resolver', () => {
|
||||
// Find a generated SKILL.md that uses the placeholder (ship is guaranteed to)
|
||||
const shipContent = fs.readFileSync(path.join(ROOT, 'ship', 'SKILL.md'), 'utf-8');
|
||||
|
||||
test('resolver output contains PR base detection command', () => {
|
||||
expect(shipContent).toContain('gh pr view --json baseRefName');
|
||||
});
|
||||
|
||||
test('resolver output contains repo default branch detection command', () => {
|
||||
expect(shipContent).toContain('gh repo view --json defaultBranchRef');
|
||||
});
|
||||
|
||||
test('resolver output contains fallback to main', () => {
|
||||
expect(shipContent).toMatch(/fall\s*back\s+to\s+`main`/i);
|
||||
});
|
||||
|
||||
test('resolver output uses "the base branch" phrasing', () => {
|
||||
expect(shipContent).toContain('the base branch');
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Quality evals — catch description regressions.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user