PRD: Chunk 2 — Core Instructions #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PRD: Chunk 2 — Core Instructions
Problem Statement
Claude Code runs without any domain conventions or coding standards — every session starts from scratch. The placeholder
core/instructions/global.mdexists but contains no content.providers/claude-code/CLAUDE.mdhas only one rule and no communication or behavior guidelines. There are no rules about how code should be written, how commits should be structured, or how tests should be approached. The agent has no basis for challenging bad ideas, explaining decisions, or behaving consistently across sessions.Separately,
docs/has no consistent naming convention. As workflow artifacts accumulate (PRDs, ARDs, Bug Briefs), there is no predictable place to find them.Solution
Write three topic-specific instruction files (
coding.md,git.md,testing.md) that the agent reads on demand. Updateproviders/claude-code/CLAUDE.mdwith a proper always-on section covering communication style and behavior rules. Retire the placeholderglobal.md. Establish the subdirectory-by-type naming convention fordocs/and migrate the existing PRD into it.This gives the agent real conventions to follow from every session forward, and gives humans a clean, navigable document structure as the repo grows.
User Stories
docs/, so that I can navigate artifacts without guessing where they live.global.mdretired, so that there is no ambiguity about where instruction content lives.CLAUDE.mdto include a load trigger for each file, so that the agent knows when to read each instruction file without requiring frontmatter.Implementation Decisions
Module 1 —
providers/claude-code/CLAUDE.md(rewrite)The source file deployed to
~/.claude/CLAUDE.mdviainstall.sh. Rewritten with two top-level sections replacing the current sparse content.Always-on / Communication:
Always-on / Behavior:
On-demand content index (inline load triggers to guide agent judgment):
~/.claude/core/when invokedModule 2 —
core/instructions/coding.md(new, thin draft)Plain markdown. On-demand. Read when writing, editing, or reviewing code.
Key rules for the thin draft:
Module 3 —
core/instructions/git.md(new, thin draft)Plain markdown. On-demand. Read when doing git operations. Includes conventional commits convention.
Key rules for the thin draft:
--no-verify) — hooks are the automated QA gate; bypassing them breaks the pipelinefeat:,fix:,docs:,chore:,refactor:,test:Module 4 —
core/instructions/testing.md(new, thin draft)Plain markdown. On-demand. Read when writing or running tests.
Key rules for the thin draft:
Module 5 —
core/instructions/global.md(retire)Delete this file. It is a placeholder stub with no content. The content index in
providers/claude-code/CLAUDE.mdwill be updated to point to the three topic files instead.install.shcopiescore/wholesale, so deletion automatically removes the deployed file on next install.Module 6 —
docs/restructureCreate subdirectories by artifact type. Migrate the one existing PRD.
New structure:
Migration:
docs/prd-chunk-1.md→docs/prd/chunk-1.md. No other files need moving.install.sh
No changes required. It copies
core/wholesale and deploysproviders/claude-code/CLAUDE.mdverbatim. Adding new files tocore/instructions/and deletingglobal.mdtakes effect automatically on next install run.Testing Decisions
Instruction files and CLAUDE.md content cannot be unit tested. A well-formed file is not the same as an effective file — the test is whether the agent actually follows the rule in a real session.
Approach: Each issue carries a short acceptance criteria checklist. After committing the issue, the developer opens a new Claude session and exercises the relevant behaviour. The issue is closed only when the behaviour is confirmed.
What a good test looks like:
Prior art: Chunk 1 used the same approach — manual smoke test in a new session to verify the always-on rule was in effect. Chunk 2 formalises this as per-issue acceptance criteria.
No automated tests for this chunk. Automated QA applies to tooling (scripts, hooks); behavioural QA for content is always human-executed.
Out of Scope
docs/VISION.mdfile path does not change — it stays atdocs/VISION.md, not moved into a subdirectoryFurther Notes
install.shcopiescore/wholesale — adding or removing files incore/instructions/automatically affects what is deployed on the next install run. No install script changes are needed for this chunk.docs/prd/convention. The migration ofdocs/prd-chunk-1.mdis a Chunk 2 deliverable, not a precondition for writing this PRD.