Repository navigation
feat: package rules — choose which articles ship as rules (0.7.104) - #116
Merged
Merged
Conversation
kbPackage accepts rules: exclude ships matching standards/test articles under guides/, alwaysApply marks rules every session needs, and limits sets the size check. The build only warns when rules exceed the limits, and asks to upgrade an older workspace SDK first. The context Skill and guides tell the Agent to propose changes to the user before editing src/index.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Knowledge packages put every
standardsandtestarticle underrules/. AI tools may load package rules into every session, so a package whose standards held long reference tables put about 260 KB into every Claude Code session. Which articles are binding rules is the author's decision, so this change lets the package declaration say it, and the build only warns.Changes
kbPackage({ rules }).excludeships matchingstandards/testarticles underguides/instead ofrules/.alwaysApplywritesalwaysApply: trueinto the frontmatter of rules every session needs, replacing a value the article declared.limits(fileKb16,totalKb64 by default) sets the size check. Patterns are knowledge paths with*/**globs.context package buildadds arulesreport to the package summary when a rule file or therules/total exceeds the limits: the files, their sizes and an instruction forsrc/index.ts. The output is unchanged. When the workspace SDK is older than the CLI (and would ignorerules), the report carriesversion_alignmentand asks to upgrade the SDK first.standardsandtestfor short binding rules. ThecontextSkill tells the Agent to proposerulessettings from the report, changesrc/index.tsonly after the user agrees, and rebuild. Package outputs guide and project API reference document the option.select.includemoved toknowledgePathPatterns.tsand is shared.Compatibility
kbPackage.rulesand optionalrulesfield in the package build summary. No workspace file or CLI JSON field is removed or changed.ruleskeep their build fingerprint, so upgrading the CLI does not rebuild them, and their output is unchanged.rules; the report says so throughversion_alignment.Verification
packageRules.integration.test.ts: oversized rule only warns;excludemoves the article toguides/and removes the oldrules/file;alwaysApplyis written once (replacing an existing value); an older SDK pin addsversion_alignment. NewokfTypesand SDK validation cases.bun run build,bun run verify(typecheck, lint, all package tests),release:prepare(0.7.104). One unrelated test (projectPendingSourceUpdate) failed once under load in Git fixture setup and passes alone.Checklist
bun run verifypasses (full CI below).🤖 Generated with Claude Code