Repository navigation
feat(core-rules): move engineering practices into core rules - #127
Merged
Merged
Conversation
…re rules The constraints skill reaches an agent only if the agent loads it. context/k-core-rules.md is always loaded by all 11 agents, so it now has an "Engineering practices" section after Writing habits: follow codebase patterns, keep backward compatibility, comment the why, structured logging with correlation IDs when adding or changing logging, research unknown systems first, state documented vs inference vs guess, and confirm tests pass. skills/constraints/SKILL.md points at the core rules for these and keeps maker-checker, the gate tiers, severity ordering, and the circuit breaker. Its description keeps the "MUST USE for every interaction" trigger and now says what the skill still defines. Adds 592 bytes per agent (6512 across 11 agents). Verified: - make build: ok - make synth: ok; section present in all 11 dist/claude/agents/*.md; kiro-cli-v2 and kiro-v3 agents reference file://context/k-core-rules.md and dist context copies match the source - cd cli && TMPDIR=/tmp make test: 1779 passed, 0 failed (first run hit the known resolve_cwd_json_envelope flake; passed 3/3 in isolation and on rerun) - make test-skills-sh: 10 passed - make claude-plugin-check: ok - make test-py (venv, pytest 8.3.4, PyYAML 6.0.2): 222 passed - make kiro-power-check (same venv): all passed
knihit
marked this pull request as ready for review
October 28, 2026 02:39
knihit
requested review from
georgebearden,
ihmaws,
shsenior and
simonkrol
as code owners
October 28, 2026 02:39
The promoted rule applied to every logging change, including scripts, CLIs and tests. Restore the service-code scope from the constraints skill and tell agents to follow the existing logging style elsewhere.
The guide still said the core rules hold only the NEVER DO rules and writing habits. Name the Engineering practices section too, and describe the constraints skill by what it keeps: read before edit, maker-checker, severity ordering, the circuit breaker and the quality gate. Update the matching sync-html-content.py entries so their old text is what the bundles carry today, then regenerate both bundles and the manifest.
…before-edit Every agent loads the core rules, orchestrators and non-code agents included. The test rule now covers code changes, and an orchestrator gets the evidence from the specialist instead of running tests. The uncertainty rule applies to unverified claims that matter to a decision. Read-before-edit moves from the constraints skill, and constraints ALWAYS 7 names the NEVER DO rules it points at instead of their numbers.
10 tasks done
ihmaws
previously approved these changes
Oct 28, 2026
Conflicts in docs/index.html and docs/site/user-guide.html: took main's bundles and regenerated them with make guide-html and guide-record. The constraints-row edit in sync-html-content.py now starts from main's text, so it applies on top of main. Verified: make build, make synth, cli make test, test-skills-sh, claude-plugin-check, test-py, kiro-power-check, build-user-guide.sh --check.
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.
Description
The
constraintsskill reaches an agent only when the agent loads it.context/k-core-rules.mdis always loaded by all 11 agents, so the general engineering practices now live there and the skill keeps only the workflow rules.Context:
context/k-core-rules.md: added an## Engineering practicessection after Writing habits, with 8 one-line rules: read the whole file before editing, follow codebase patterns, keep backward compatibility unless the user approves a break, comment the why, structured logging with correlation IDs when adding or changing logging in service code (other code follows its existing logging style), research first when the cause chain is unclear, say whether an unverified claim that matters is documented, inferred, or a guess, and confirm tests pass before calling a code change done. Because every agent loads these, the last two are scoped: non-code agents have no tests to confirm, and an orchestrator gets test evidence from the specialist rather than running tests, which its routing rules forbid. NEVER DO and Writing habits are unchanged.Skills:
skills/constraints/SKILL.md: ALWAYS 1, 2, 4, 5, 6, 7, Unknown Systems, and Acknowledge Uncertainty now point at the core rules instead of restating them, so there is one copy of each rule. Maker-checker, severity ordering, the 2-strike circuit breaker, and the Quality Gate tiers stay in the skill.constraintsdescription: kept theMUST USE for every interactionfirst sentence, because feat(synth): add each Kiro agent's skills and a use rule to its prompt #120 classifies always-apply skills by that prefix and tests it forconstraints. Rewrote the second sentence, which claimed the skill defines rules that now live in the core rules.Docs:
CHANGELOG.md: one bullet under[Unreleased]/### Changed. No VERSION bump.concepts.md,faq.md,appendix/contributing.md,skills.md): the core rules are now described as NEVER DO, writing habits, and engineering practices, and theconstraintsrow lists what the skill keeps. The four matching entries intools/build-user-guide/sync-html-content.pynow take the current bundle text asold; both HTML bundles and the manifest are regenerated.Type of Change
Testing
npm test: 119 of 136 pass. The same 17 tests fail onmain(bb7ef9c) with identical output; they needscripts/brand-config/lib/constants.js, which is not in the tree. This PR does not touch them.cd cli && make test: 1779 passed, 0 failed. The first run hit the known macOS flake inresolve_cwd_json_envelope; that test passed 3 of 3 in isolation and the full rerun passed.cli/is unchanged.make buildandmake synth: ok, wrote 11 agents, 82 skills, 19 SOPs, 2 context files. The new section is in all 11 Claude Code agents; Kiro CLI v2 and v3 agents referencefile://context/k-core-rules.mdand the shipped context copy matches the source.make test-skills-sh(10 passed),make claude-plugin-check(ok),make test-py(222 passed),make kiro-power-check(ok, shellcheck skipped).Size: +859 bytes per agent, 9449 bytes across 11 agents. Claude Code agents each grow by 859 bytes (core rules are inlined); Kiro agent JSONs are byte-identical and the shared context file grows by 859 bytes. The bench below ran at +592 bytes, before the review fixes added read-before-edit and scoped two rules.
Trial merges with fix(orchestrator): tighten the direct-work rules #114 and feat(synth): add each Kiro agent's skills and a use rule to its prompt #120: clean. With fix(orchestrator): tighten the direct-work rules #114 on top, section order in
k-core-rules.mdstays NEVER DO, Writing habits, Engineering practices.Benchmark: no-regression bench,
mainvs this branch, using the isolated harness from feat(orchestrator): mid-task delegation and same-type parallel spawns #95 (fresh fixture and isolated home per run, telemetry off). Claude Code 2.1.310 and Kiro CLI 2.35.1, 2 reps per cell, 32 runs, all intact. I used that harness instead ofnpm run benchmarkso the results compare directly with feat(orchestrator): mid-task delegation and same-type parallel spawns #95.main; rep 1 used 0.84 credits and did not repeat.mainruns failed it in the feat(orchestrator): mid-task delegation and same-type parallel spawns #95 bench.make guide-check: the one failure (configlisted inWITHDRAWN_COMMANDSbut gone fromcli/README.md) also fails on the branch before the docs commit; this PR does not touch it.bash tools/build-user-guide/build-user-guide.sh --check: ok.No new code files, so no SPDX headers needed.
Checklist
Agents Affected
All 11 agents load
k-core-rules.md, so all of them get the new section.Notes for Reviewers
CHANGELOG.mdoverlaps with feat(synth): add each Kiro agent's skills and a use rule to its prompt #120.