IAPL rename, scripted: preferred names in src, bin, scripts, services, tests; bin files and skill folders moved
Replaced by an explicit list of forms only (ten exported names, runtime env names, project file names and marks, commands, skill names, the log prefix, the brand in prose). Package name, import paths, routes, CSS tokens, data attributes, custom keys, context flags, the cookie and kv keys are not touched. package.json keeps the five old bin names beside the five new ones. The old names stop working in this commit and come back as aliases in the next; docs follow. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
414a4702df
commit
0a4f001797
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
// ipal-blocks — the block library's command line.
|
||||
// pnpm exec ipal-blocks list → the library blocks
|
||||
// pnpm exec ipal-blocks eject faq → src/blocks/Faq/{config.ts,Component.tsx}
|
||||
// pnpm exec ipal-blocks eject faq --dest src/blocks --dry-run
|
||||
// iapl-blocks — the block library's command line.
|
||||
// pnpm exec iapl-blocks list → the library blocks
|
||||
// pnpm exec iapl-blocks eject faq → src/blocks/Faq/{config.ts,Component.tsx}
|
||||
// pnpm exec iapl-blocks eject faq --dest src/blocks --dry-run
|
||||
// Eject copies one block's source into the project, with its imports pointing at the
|
||||
// package entries, so the project owns it: same slug and data shape, no migration.
|
||||
// Then: use the ejected builder in Pages.layout instead of the library one, pass the ejected
|
||||
@@ -23,7 +23,7 @@ const libRoot = join(pkgRoot, 'src/modules/block-library')
|
||||
const blocksRoot = join(libRoot, 'blocks')
|
||||
|
||||
if (!command || command === '--help' || command === '-h') {
|
||||
console.log('Usage: ipal-blocks list | ipal-blocks eject <block> [--dest src/blocks] [--dry-run]')
|
||||
console.log('Usage: iapl-blocks list | iapl-blocks eject <block> [--dest src/blocks] [--dry-run]')
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ if (command === 'list') {
|
||||
}
|
||||
|
||||
if (command !== 'eject' || !slug) {
|
||||
console.error('Usage: ipal-blocks eject <block>')
|
||||
console.error('Usage: iapl-blocks eject <block>')
|
||||
process.exit(1)
|
||||
}
|
||||
if (!slugs.includes(slug)) {
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env node
|
||||
// ipal-doctor — checks a site against the ipal-kit team rules and lists every gap with a fix hint
|
||||
// iapl-doctor — checks a site against the IAPL team rules and lists every gap with a fix hint
|
||||
// (docs/doctor.md). Static by default: reads files, writes nothing (except a first-seen date in
|
||||
// ipal-doctor.json outside CI).
|
||||
// pnpm exec ipal-doctor → this project, human-readable
|
||||
// pnpm exec ipal-doctor --strict --offline → CI on a new site: any finding fails
|
||||
// pnpm exec ipal-doctor --deep --url http://localhost:3000
|
||||
// pnpm exec ipal-doctor --json > doctor.json
|
||||
// pnpm dlx --package=@intecion/ipal-kit@latest ipal-doctor → the newest rules
|
||||
// iapl-doctor.json outside CI).
|
||||
// pnpm exec iapl-doctor → this project, human-readable
|
||||
// pnpm exec iapl-doctor --strict --offline → CI on a new site: any finding fails
|
||||
// pnpm exec iapl-doctor --deep --url http://localhost:3000
|
||||
// pnpm exec iapl-doctor --json > doctor.json
|
||||
// pnpm dlx --package=@intecion/ipal-kit@latest iapl-doctor → the newest rules
|
||||
// Exit: 0 ok · 1 findings · 2 could not run · 3 a rule crashed.
|
||||
|
||||
import { dirname, join } from 'node:path'
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/usr/bin/env node
|
||||
// ipal-skills — copies the ipal-kit agent skills into the project.
|
||||
// pnpm exec ipal-skills → ./.agents/skills/ipal-*
|
||||
// pnpm exec ipal-skills --dry-run → show what would change
|
||||
// pnpm exec ipal-skills --dest .claude/skills
|
||||
// pnpm exec ipal-skills --no-pointer → skills only, leave AGENTS.md / CLAUDE.md alone
|
||||
// pnpm exec ipal-skills --external → also the vendored third-party skills (ext-*, pinned, text only)
|
||||
// pnpm exec ipal-skills --external ext-accessibility,ext-payload → only those
|
||||
// Only folders named ipal-* are touched; the project's own skills stay as they are.
|
||||
// ipal-* folders that no longer exist in the package are removed (renamed/retired skills).
|
||||
// ext-* folders are touched only with --external, and only those carrying ipal-kit's SOURCE.md.
|
||||
// AGENTS.md (and CLAUDE.md) get a marked ipal-kit block pointing at the guide — only the
|
||||
// iapl-skills — copies the IAPL agent skills into the project.
|
||||
// pnpm exec iapl-skills → ./.agents/skills/iapl-*
|
||||
// pnpm exec iapl-skills --dry-run → show what would change
|
||||
// pnpm exec iapl-skills --dest .claude/skills
|
||||
// pnpm exec iapl-skills --no-pointer → skills only, leave AGENTS.md / CLAUDE.md alone
|
||||
// pnpm exec iapl-skills --external → also the vendored third-party skills (ext-*, pinned, text only)
|
||||
// pnpm exec iapl-skills --external ext-accessibility,ext-payload → only those
|
||||
// Only folders named iapl-* are touched; the project's own skills stay as they are.
|
||||
// iapl-* folders that no longer exist in the package are removed (renamed/retired skills).
|
||||
// ext-* folders are touched only with --external, and only those carrying IAPL's SOURCE.md.
|
||||
// AGENTS.md (and CLAUDE.md) get a marked IAPL block pointing at the guide — only the
|
||||
// text between the markers is ever rewritten; the project's own content stays as it is.
|
||||
|
||||
import { createHash } from 'node:crypto'
|
||||
@@ -19,7 +19,7 @@ import { fileURLToPath } from 'node:url'
|
||||
|
||||
const args = process.argv.slice(2)
|
||||
if (args.includes('--help') || args.includes('-h')) {
|
||||
console.log('Usage: ipal-skills [--dest <dir>] [--dry-run] [--no-pointer] [--external [ext-a,ext-b]]\nDefault dest: .agents/skills')
|
||||
console.log('Usage: iapl-skills [--dest <dir>] [--dry-run] [--no-pointer] [--external [ext-a,ext-b]]\nDefault dest: .agents/skills')
|
||||
process.exit(0)
|
||||
}
|
||||
const dryRun = args.includes('--dry-run')
|
||||
@@ -30,21 +30,21 @@ const externalPick = externalArg >= 0 && args[externalArg + 1] && !args[external
|
||||
: null
|
||||
const destArg = args.indexOf('--dest')
|
||||
const destValue = destArg >= 0 ? args[destArg + 1] : '.agents/skills'
|
||||
// A missing value would resolve to cwd and remove every ipal-* folder there.
|
||||
// A missing value would resolve to cwd and remove every iapl-* folder there.
|
||||
if (!destValue || destValue.startsWith('-')) {
|
||||
console.error('ipal-skills: --dest needs a directory, e.g. --dest .claude/skills')
|
||||
console.error('iapl-skills: --dest needs a directory, e.g. --dest .claude/skills')
|
||||
process.exit(1)
|
||||
}
|
||||
const dest = resolve(process.cwd(), destValue)
|
||||
if (dest === resolve(process.cwd())) {
|
||||
console.error('ipal-skills: --dest must be a subdirectory, not the project root')
|
||||
console.error('iapl-skills: --dest must be a subdirectory, not the project root')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const pkgRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const src = join(pkgRoot, 'docs', 'agent', 'skills')
|
||||
if (!existsSync(src)) {
|
||||
console.error(`ipal-skills: no skills found in ${src} — is @intecion/ipal-kit installed with docs?`)
|
||||
console.error(`iapl-skills: no skills found in ${src} — is @intecion/ipal-kit installed with docs?`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ const manifest = externalArg >= 0 ? JSON.parse(readFileSync(join(extSrc, 'manife
|
||||
const known = manifest.skills.map((skill) => skill.name)
|
||||
const unknown = (externalPick ?? []).filter((name) => !known.includes(name))
|
||||
if (unknown.length) {
|
||||
console.error(`ipal-skills: unknown external skill(s): ${unknown.join(', ')} — available: ${known.join(', ')}`)
|
||||
console.error(`iapl-skills: unknown external skill(s): ${unknown.join(', ')} — available: ${known.join(', ')}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ for (const name of shipped) {
|
||||
}
|
||||
}
|
||||
for (const name of retired) {
|
||||
console.log(`remove ${name} (no longer in ipal-kit)`)
|
||||
console.log(`remove ${name} (no longer in IAPL)`)
|
||||
if (!dryRun) rmSync(join(dest, name), { recursive: true, force: true })
|
||||
}
|
||||
console.log(`${dryRun ? '[dry-run] ' : ''}${shipped.length} skill(s) → ${dest}`)
|
||||
@@ -90,12 +90,12 @@ if (externalArg >= 0) {
|
||||
const files = filesOf(from).sort()
|
||||
const tampered = files.filter((f) => skill.files[f] !== createHash('sha256').update(readFileSync(join(from, f))).digest('hex'))
|
||||
if (tampered.length || files.length !== Object.keys(skill.files).length) {
|
||||
console.error(`ipal-skills: ${skill.name} does not match manifest.json (${tampered.join(', ') || 'file list'}) — skipped`)
|
||||
console.error(`iapl-skills: ${skill.name} does not match manifest.json (${tampered.join(', ') || 'file list'}) — skipped`)
|
||||
process.exitCode = 1
|
||||
continue
|
||||
}
|
||||
if (existsSync(join(dest, skill.name)) && !ours(skill.name)) {
|
||||
console.warn(`skip ${skill.name} (a folder of that name exists and is not from ipal-kit)`)
|
||||
console.warn(`skip ${skill.name} (a folder of that name exists and is not from IAPL)`)
|
||||
continue
|
||||
}
|
||||
console.log(`${existsSync(join(dest, skill.name)) ? 'update' : 'add '} ${skill.name} (${skill.publisher}, ${skill.license}, ${skill.commit.slice(0, 12)})`)
|
||||
@@ -108,7 +108,7 @@ if (externalArg >= 0) {
|
||||
? readdirSync(dest).filter((n) => n.startsWith('ext-') && !known.includes(n) && ours(n))
|
||||
: []
|
||||
for (const name of retiredExt) {
|
||||
console.log(`remove ${name} (no longer in ipal-kit)`)
|
||||
console.log(`remove ${name} (no longer in IAPL)`)
|
||||
if (!dryRun) rmSync(join(dest, name), { recursive: true, force: true })
|
||||
}
|
||||
}
|
||||
@@ -117,24 +117,24 @@ if (externalArg >= 0) {
|
||||
// AGENTS.md is read by Codex/Cursor/Antigravity, CLAUDE.md by Claude Code (which also
|
||||
// follows `@AGENTS.md` imports, so a CLAUDE.md that imports AGENTS.md needs no copy).
|
||||
if (pointer) {
|
||||
const START = '<!-- ipal-kit:start -->'
|
||||
const END = '<!-- ipal-kit:end -->'
|
||||
const START = '<!-- iapl:start -->'
|
||||
const END = '<!-- iapl:end -->'
|
||||
const version = JSON.parse(readFileSync(join(pkgRoot, 'package.json'), 'utf8')).version
|
||||
const skillsDir = relative(process.cwd(), dest).split('\\').join('/')
|
||||
const block = [
|
||||
START,
|
||||
`## ipal-kit ${version} — agent guide`,
|
||||
`## IAPL ${version} — agent guide`,
|
||||
'',
|
||||
'<!-- Managed by `pnpm exec ipal-skills` — edits between the markers are overwritten. -->',
|
||||
'<!-- Managed by `pnpm exec iapl-skills` — edits between the markers are overwritten. -->',
|
||||
'This project is built on `@intecion/ipal-kit` (a Payload CMS 3 plugin). Before you write code:',
|
||||
'',
|
||||
'1. Rules: `node_modules/@intecion/ipal-kit/docs/agent/AGENT.md`.',
|
||||
`2. Everything the plugin provides (options, env vars, routes, layout, hooks, collections, globals, every export): the \`ipal-reference\` skill — \`${skillsDir}/ipal-reference/SKILL.md\`.`,
|
||||
`3. New project or missing foundation: the \`ipal-setup\` skill; a whole site: \`ipal-site\`. All skills: \`${skillsDir}/\`.`,
|
||||
`2. Everything the plugin provides (options, env vars, routes, layout, hooks, collections, globals, every export): the \`iapl-reference\` skill — \`${skillsDir}/iapl-reference/SKILL.md\`.`,
|
||||
`3. New project or missing foundation: the \`iapl-setup\` skill; a whole site: \`iapl-site\`. All skills: \`${skillsDir}/\`.`,
|
||||
'4. Module details: `node_modules/@intecion/ipal-kit/docs/<module>.md`.',
|
||||
'5. ipal-kit first: if the plugin has it, use it. Broken or not enough → report it with the `ipal-plugin-gap` skill and wait for the owner — no hand-built replacement, never patch `node_modules`.',
|
||||
'5. IAPL first: if the plugin has it, use it. Broken or not enough → report it with the `iapl-plugin-gap` skill and wait for the owner — no hand-built replacement, never patch `node_modules`.',
|
||||
'6. Before you set up a site: ask the owner the architecture questions (AGENT.md "Ask before you build") and wait for the answers; record them under "Project decisions".',
|
||||
'7. ipal-kit docs, this guide and the skills are in English; write rules, AGENTS.md entries and gap reports in English.',
|
||||
'7. IAPL docs, this guide and the skills are in English; write rules, AGENTS.md entries and gap reports in English.',
|
||||
END,
|
||||
].join('\n')
|
||||
const upsert = (file, { create }) => {
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env node
|
||||
// ipal-tokens — the brand's design tokens: src/design/tokens.ts → src/design/tokens.css,
|
||||
// iapl-tokens — the brand's design tokens: src/design/tokens.ts → src/design/tokens.css,
|
||||
// plus a WCAG contrast check (docs/design-tokens.md).
|
||||
// pnpm exec ipal-tokens → write src/design/tokens.css, print the contrast report
|
||||
// pnpm exec ipal-tokens --check → fail when the CSS is out of date (CI, ipal-doctor)
|
||||
// pnpm exec ipal-tokens --in x.ts --out y.css --warn-only
|
||||
// pnpm exec iapl-tokens → write src/design/tokens.css, print the contrast report
|
||||
// pnpm exec iapl-tokens --check → fail when the CSS is out of date (CI, iapl-doctor)
|
||||
// pnpm exec iapl-tokens --in x.ts --out y.css --warn-only
|
||||
|
||||
import { dirname, join } from 'node:path'
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url'
|
||||
@@ -1,17 +1,17 @@
|
||||
#!/usr/bin/env node
|
||||
// ipal-kit — the plugin's command line.
|
||||
// IAPL — the plugin's command line.
|
||||
// pnpm dlx @intecion/ipal-kit@<version> create intecion.com → a new client site (docs/project-starter.md)
|
||||
// pnpm exec ipal-kit create intecion.com --dir ../intecioncom-web --answers answers.json
|
||||
// pnpm exec iapl create intecion.com --dir ../intecioncom-web --answers answers.json
|
||||
// `pnpm dlx <package>` runs the bin named after the package, so every subcommand lives here.
|
||||
// The other tools keep their own bins: ipal-skills, ipal-blocks, ipal-tokens, ipal-doctor.
|
||||
// The other tools keep their own bins: iapl-skills, iapl-blocks, iapl-tokens, iapl-doctor.
|
||||
|
||||
import { dirname, join } from 'node:path'
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url'
|
||||
|
||||
const USAGE = `Usage: ipal-kit <command> [options]
|
||||
create <domain> a new client site from the reference site (ipal-kit create --help)
|
||||
const USAGE = `Usage: IAPL <command> [options]
|
||||
create <domain> a new client site from the reference site (iapl create --help)
|
||||
|
||||
Other tools: ipal-skills, ipal-blocks, ipal-tokens, ipal-doctor`
|
||||
Other tools: iapl-skills, iapl-blocks, iapl-tokens, iapl-doctor`
|
||||
|
||||
const [command, ...args] = process.argv.slice(2)
|
||||
if (command !== 'create') {
|
||||
Reference in New Issue
Block a user