mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-20 18:16:30 +03:00
Consolidate skills + add patterns source file
Major changes: - Consolidate 8 design skills into single frontend-design skill with 7 reference files - Add source/patterns.md as single source of truth for patterns/antipatterns - Patterns are merged into skill during build, served via API for website - Website now dynamically renders both "What TO Do" and "What NOT to Do" sections - Update build system to handle directory-based skills with references - Add /api/patterns endpoint to server - Refactor website with new Antidote section layout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
99f1091f20
commit
2181137d04
@@ -3,31 +3,55 @@ import { cleanDir, ensureDir, writeFile } from '../utils.js';
|
||||
|
||||
/**
|
||||
* Cursor Transformer (Downgraded - No Frontmatter/Args)
|
||||
*
|
||||
*
|
||||
* Strips all frontmatter and metadata, outputs body only.
|
||||
* Cursor doesn't support arguments or frontmatter.
|
||||
* Reference files are inlined into the main skill file.
|
||||
*/
|
||||
export function transformCursor(commands, skills, distDir) {
|
||||
export function transformCursor(commands, skills, distDir, patterns = null) {
|
||||
const cursorDir = path.join(distDir, 'cursor');
|
||||
const commandsDir = path.join(cursorDir, '.cursor/commands');
|
||||
const rulesDir = path.join(cursorDir, '.cursor/rules');
|
||||
|
||||
|
||||
cleanDir(cursorDir);
|
||||
ensureDir(commandsDir);
|
||||
ensureDir(rulesDir);
|
||||
|
||||
|
||||
// Commands: Body only (no frontmatter)
|
||||
for (const command of commands) {
|
||||
const outputPath = path.join(commandsDir, `${command.name}.md`);
|
||||
writeFile(outputPath, command.body);
|
||||
}
|
||||
|
||||
// Skills: Body only (no frontmatter)
|
||||
|
||||
// Skills: Body only (with references inlined)
|
||||
let refCount = 0;
|
||||
for (const skill of skills) {
|
||||
let content = skill.body;
|
||||
|
||||
// Merge patterns body into frontend-design skill (before Domain Reference Files section)
|
||||
if (skill.name === 'frontend-design' && patterns && patterns.body) {
|
||||
const insertPoint = content.indexOf('---\n\n## Domain Reference Files');
|
||||
if (insertPoint > -1) {
|
||||
content = content.slice(0, insertPoint) + '\n\n' + patterns.body + '\n\n' + content.slice(insertPoint);
|
||||
} else {
|
||||
content += '\n\n' + patterns.body;
|
||||
}
|
||||
}
|
||||
|
||||
// Inline reference files if they exist
|
||||
if (skill.references && skill.references.length > 0) {
|
||||
const refSections = skill.references.map(ref => {
|
||||
refCount++;
|
||||
return `\n\n---\n\n## Reference: ${ref.name}\n\n${ref.content}`;
|
||||
});
|
||||
content += refSections.join('');
|
||||
}
|
||||
|
||||
const outputPath = path.join(rulesDir, `${skill.name}.md`);
|
||||
writeFile(outputPath, skill.body);
|
||||
writeFile(outputPath, content);
|
||||
}
|
||||
|
||||
console.log(`✓ Cursor: ${commands.length} commands, ${skills.length} skills (downgraded)`);
|
||||
|
||||
const refInfo = refCount > 0 ? ` (${refCount} refs inlined)` : '';
|
||||
console.log(`✓ Cursor: ${commands.length} commands, ${skills.length} skills (downgraded)${refInfo}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user