feat: add prismic gen slice-index and regenerate index files on slice updates - #258
Open
angeloashmore wants to merge 5 commits into
Open
feat: add prismic gen slice-index and regenerate index files on slice updates#258angeloashmore wants to merge 5 commits into
prismic gen slice-index and regenerate index files on slice updates#258angeloashmore wants to merge 5 commits into
Conversation
The adapter regenerated the index file only on slice create and delete. A renamed slice kept its old component name in the index file. Now updateSlice regenerates the index file, the same as createSlice and deleteSlice. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The command regenerates the slice index file of each slice library. Use it to repair stale or hand-edited index files without a model change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
angeloashmore
force-pushed
the
aa/gen-index
branch
from
August 14, 2026 01:39
4d42d8b to
4cecfc1
Compare
prismic gen index and regenerate index files on slice updatesprismic gen slice-index and regenerate index files on slice updates
The eval gives an agent a slice index file that does not contain the project's slice. The agent must run `prismic gen slice-index` to regenerate the file. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The default test slice ID contains a dash. A dash makes an invalid key in the generated components map. Some agents saw the invalid ID as part of the fault and recreated the slice with a new ID. Now the fixture uses a snake_case ID, so the stale index is the only fault. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The eval used a snake_case slice ID to work around unquoted keys in the generated index file. PR #259 quotes IDs that are not valid identifiers, so the standard test slice works. Run the eval only after this branch includes that fix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
angeloashmore
marked this pull request as ready for review
August 14, 2026 02:25
lihbr
approved these changes
Aug 14, 2026
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.
Resolves:
Description
The CLI regenerated slice index files only when a slice was created or deleted. A slice update did not regenerate them. For example, a renamed slice kept its old component name in the index file.
This PR makes
updateSliceregenerate the index file of the changed library. Now every slice change (create, update, delete) regenerates the index file.This PR also adds a new command:
prismic gen slice-index. The command regenerates the slice index file of each slice library. Use it to repair a stale or hand-edited index file without a model change. For example, it converts index files that Slice Machine generated to the CLI format.Checklist
Preview
A project with more than one slice library prints the count:
How to QA 1
This PR is published to npm as
prismic@pr-258. You can run it in a project withnpx, with no installation.npx prismic@pr-258 slice edit <id> --name <NewName>. Make sure that the index file shows the new component name.npx prismic@pr-258 gen slice-index. Make sure that the CLI regenerates the file.🤖 Generated with Claude Code
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩