[v1.0.0] Extract reference data to reduce SKILL.md token usage - #31
Draft
Adi-ty wants to merge 13 commits into
Draft
[v1.0.0] Extract reference data to reduce SKILL.md token usage#31Adi-ty wants to merge 13 commits into
Adi-ty wants to merge 13 commits into
Conversation
Move the existing wp-tooling package into an npm workspace and add placeholder package slots for future lint, Tailwind, skills, PHPCS, and PHPStan packages.
Move scaffolds, docs, orphaned tests into node-packages/wp-tooling/. Fix evals SKILLS_DIR path. Fix .gitignore build/ pattern to exclude scaffold dirs.
Extract @rtcamp/eslint-config, @rtcamp/stylelint-config, and @rtcamp/tailwind-config from @rtcamp/wp-tooling into separate npm workspace packages. Clean break — remove config exports and peerDependencies from wp-tooling. Update wp-tooling's eslint.config.js to consume @rtcamp/eslint-config. Repoint lint scaffolds to reference the new packages (eslint.config.js dest, stylelint extends path, npm_dev_dependencies)
…ntory
Add a central inventory so a scaffold's whole scaffold.json plus templates can live in an owning repo (e.g. rtCamp/wp-shared-workflows), with wp-tooling holding only a one-line pointer per remote scaffold.
- inventory.js: parse/validate inventory.json; entry -> thin remote record
- fetch.js: zero-dep fetchRemoteFile() over raw.githubusercontent.com, with
on-disk caching for immutable refs (tags / full SHAs)
- cache.js + cli/commands/cache.js: `wp-tooling cache clear`
- errors.js: extract ScaffoldError; add EFETCHFAIL (network/HTTP) distinct
from EBADSCAFFOLD (bad/invalid manifest)
- registry.js: scan() overlays inventory as origin:'remote' records; execute()
lazily hydrates + validates the remote manifest, then prefetches templates
(offline-safe re-runs; dry-run fetches the manifest only)
- list.js: remote rows (kind:'template', origin:'remote', counts:null), offline
- validate.js: recognise remote ids offline; opt-in --remote fetches +
schema-validates each manifest at its pinned ref
- docs + scaffold skill updated for the remote path
…es + an index - fetch.js: fetchRemoteFile() over raw.githubusercontent with ETag-validated caching (If-None-Match -> 304 serves cache; offline falls back to cache, HTTP errors surface); readCached() for offline id recognition - registry.js: scan() discovers via sources -> index (offline-tolerant); execute() hydrates + validates the remote manifest, then fetches templates - validate.js: sources-shape offline (+ remote ids from a cached index); --remote fetches each index + manifest and schema-validates - list.js: remote rows (origin 'remote', counts null) + a warnings array - cache.js / cli: `wp-tooling cache clear`; new error code EFETCHFAIL - docs + scaffold skill updated; dormant by default (no sources.json ships)
Two additive engine capabilities plus supporting scaffolds, tests and docs. All backward-compatible: execute() result shape is unchanged (only the new engine.inputs / scaffold.kind fields), and the feature block never surfaces in the add/execute path. discover_from input resolution: - Engine resolves scaffold inputs from composer.json / package.json / .wp-tooling.json with precedence supplied -> discovered -> default, and is fail-safe (missing or malformed files fall through to the default). - New `transform: json-escape` for derived inputs (psr4 autoload key). - Annotate bundled scaffolds (psr4, wp/*) with discover_from. Feature toggle layer: - Optional `feature` block (config_key, owned_files, confirm_remove, gitignore) with TTY-free enable/disable/status verbs, persisted in .wp-tooling.json. New `wp-tooling features` CLI command. - setup/tailwind ships as a toggleable feature. UI: - New `style` helper (TTY-aware ANSI, no-ops in non-TTY output). - terminal.js: stdin close now rejects in-flight readers with CancelledError instead of resolving '' (fixes infinite re-prompt under required validators). Other: - phpstan scaffold points at the dedicated rtcamp/wp-phpstan baseline and drops the hardcoded level. - Extract shared add/features CLI helpers into cli-support.js.
- CHANGELOG: discover_from input discovery + feature toggle layer under ## Unreleased - .claude/issues/29-remote-scaffold-sources.md: decision log + verification for PR #30
…sclosure layout Move heavy reference tables (canonical layout, per-kind test checklist, TDD loop, engine errors, adaptive wiring, Phase A/B tables, detection commands, PSR-4 wiring, report template) into references/ subdirectories so each is loaded on demand rather than always in context. Main SKILL.md shrinks from 230→136 lines (scaffold) and 382→140 lines (setup) while the full instruction set is preserved verbatim across SKILL.md + references.
- Updated adaptive wiring documentation for clarity and conciseness. - Enhanced canonical layout reference with usage context. - Revised engine error codes documentation for better understanding of error handling. - Improved TDD loop instructions to emphasize step-by-step execution. - Clarified integration test checklist with specific assertions for each kind. - Expanded setup skill documentation to include detailed parsing and detection instructions. - Streamlined phase A and phase B setup references for better usability. - Updated PSR-4 wiring guide to ensure accurate application of autoloading. - Enhanced final report template for clearer output and formatting rules.
AnuragVasanwala
self-requested a review
June 15, 2026 04:32
Adi-ty
force-pushed
the
v1.0.0/task/remote-scaffold-inventory
branch
from
June 15, 2026 10:18
d01d2e9 to
5273ae7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
references/*.mdfiles, loaded on demandscaffold/SKILL.md: 230 → ~110 lines (canonical layout, engine errors, TDD loop, test checklist, adaptive wiring moved to references)setup/SKILL.md: 382 → ~105 lines (detection commands, Phase A/B tables, PSR-4 wiring, report template, PHPCS/test ref tables moved to references)Closes
Closes #
Changes
scaffold/SKILL.md
Read references/canonical-layout.mdRead references/test-checklist.mdRead references/adaptive-wiring.mdRead references/tdd-loop.mdRead references/engine-errors.mdsetup/SKILL.md
Read references/detection-commands.mdRead references/phase-a-setup.mdandphase-b-features.mdRead references/phase-a-setup.mdRead references/psr4-wiring.mdRead references/report-template.md