mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-14 23:26:39 +03:00
Fix provider script command rendering
Replace heuristic rewrites across executable scripts with one explicit provider marker, render pinned shortcuts per target harness, and remove the personal email from the public publisher manifest. Addresses automated review feedback on PR #363. AI assistance: OpenAI Codex prepared and validated these changes under maintainer direction.
This commit is contained in:
@@ -4,7 +4,6 @@ export function buildCodexPluginManifest(rootManifest) {
|
||||
version: rootManifest.version,
|
||||
description: 'Design and refine frontend interfaces with coding agents.',
|
||||
author: {
|
||||
...rootManifest.author,
|
||||
name: 'Renaissance Geek Inc',
|
||||
url: rootManifest.homepage,
|
||||
},
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
generateYamlFrontmatter,
|
||||
generateYamlDocument,
|
||||
replacePlaceholders,
|
||||
replaceScriptProviderMarker,
|
||||
compileProviderBlocks,
|
||||
stripRuleMarkers,
|
||||
} from '../utils.js';
|
||||
@@ -262,12 +263,7 @@ export function createTransformer(config) {
|
||||
const scriptsOutDir = path.join(skillDir, 'scripts');
|
||||
ensureDir(scriptsOutDir);
|
||||
for (const script of skill.scripts) {
|
||||
const scriptContent = replacePlaceholders(
|
||||
script.content,
|
||||
placeholderKey,
|
||||
[],
|
||||
allSkillNames,
|
||||
);
|
||||
const scriptContent = replaceScriptProviderMarker(script.content, placeholderKey);
|
||||
writeFile(path.join(scriptsOutDir, script.name), scriptContent);
|
||||
scriptCount++;
|
||||
}
|
||||
|
||||
@@ -755,6 +755,22 @@ export function replacePlaceholders(content, provider, commandNames = [], allSki
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the one explicit provider marker allowed in executable skill scripts.
|
||||
*
|
||||
* Do not run replacePlaceholders() across JavaScript source: slash-command
|
||||
* heuristics can collide with regex literals and runtime paths. Scripts import
|
||||
* their command prefix from lib/provider.mjs, whose declaration is replaced
|
||||
* here by an exact string match.
|
||||
*/
|
||||
export function replaceScriptProviderMarker(content, provider) {
|
||||
const placeholders = PROVIDER_PLACEHOLDERS[provider] || PROVIDER_PLACEHOLDERS.cursor;
|
||||
const commandPrefix = placeholders.command_prefix || '/';
|
||||
const marker = "export const IMPECCABLE_COMMAND_PREFIX = '/'; // @impeccable-provider-command-prefix";
|
||||
const rendered = `export const IMPECCABLE_COMMAND_PREFIX = ${JSON.stringify(commandPrefix)};`;
|
||||
return content.replace(marker, rendered);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decide whether a YAML scalar string value must be quoted to survive parsing.
|
||||
*
|
||||
|
||||
@@ -25,11 +25,11 @@ export const SUITES = {
|
||||
triggers: [
|
||||
...COMMON_INFRA_PATTERNS,
|
||||
/^scripts\/(?!benchmark-detector|build-browser-detector|build-extension)/,
|
||||
/^skill\/(SKILL\.src\.md|agents\/|reference\/|scripts\/(cleanup-deprecated|context|context-signals|critique-storage|design-parser|hook|impeccable-paths|is-generated))/,
|
||||
/^skill\/(SKILL\.src\.md|agents\/|reference\/|scripts\/(cleanup-deprecated|context|context-signals|critique-storage|design-parser|hook|impeccable-paths|is-generated|lib\/provider|pin))/,
|
||||
/^site\/(pages|content|components|layouts)\//,
|
||||
/^README(\.npm)?\.md$/,
|
||||
/^cli\/bin\//,
|
||||
/^tests\/(build|cleanup-deprecated|cli-ignores|context|context-signals|critique-storage|design-parser|docs-integrity|github-sheriff|hook|hook-build|impeccable-paths|openai-plugin|shiki-theme|skills-cli|target-args|test-suites|windows-path-fix|zip)\.test\.(js|mjs)$/,
|
||||
/^tests\/(build|cleanup-deprecated|cli-ignores|context|context-signals|critique-storage|design-parser|docs-integrity|github-sheriff|hook|hook-build|impeccable-paths|openai-plugin|pin|shiki-theme|skills-cli|target-args|test-suites|windows-path-fix|zip)\.test\.(js|mjs)$/,
|
||||
/^tests\/lib\//,
|
||||
],
|
||||
commands: [
|
||||
@@ -63,6 +63,7 @@ export const SUITES = {
|
||||
'tests/hook.test.mjs',
|
||||
'tests/impeccable-paths.test.mjs',
|
||||
'tests/openai-plugin.test.mjs',
|
||||
'tests/pin.test.mjs',
|
||||
'tests/target-args.test.mjs',
|
||||
'tests/shiki-theme.test.mjs',
|
||||
'tests/test-suites.test.mjs',
|
||||
|
||||
Reference in New Issue
Block a user