create-claude-rails 0.4.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,21 +1,39 @@
1
1
  # Claude on Rails
2
2
 
3
- Opinionated process scaffolding for Claude Code projects.
3
+ Process scaffolding for Claude Code projects, by a guy who'd rather
4
+ talk to Claude than write code.
4
5
 
5
6
  One command gives you a session loop (orient/debrief), work tracking,
6
7
  structured planning, an audit system with expert perspectives, and
7
8
  enforcement hooks — all configured through conversational onboarding.
9
+ Most of it was built by Claude. I just complained until it worked.
8
10
 
9
- ## Quick Start
11
+ ## Install
12
+
13
+ Open a terminal, `cd` into your project folder, and run:
14
+
15
+ ```bash
16
+ curl -fsSL https://raw.githubusercontent.com/orenmagid/claude-on-rails/main/install.sh | bash
17
+ ```
18
+
19
+ That's it. No Node.js, no npm, no git required — just a terminal.
20
+
21
+ Then open [Claude Code](https://claude.ai/code) in the same folder and
22
+ say `/onboard`. It'll interview you about your project and set everything
23
+ up based on your answers.
24
+
25
+ ### For developers
26
+
27
+ If you have Node.js installed and want interactive module selection,
28
+ database setup, or the full install:
10
29
 
11
30
  ```bash
12
31
  npx create-claude-rails
13
32
  ```
14
33
 
15
- That's it. The CLI walks you through module selection, copies skill files,
34
+ The CLI walks you through module selection, copies skill files,
16
35
  sets up hooks, and optionally installs a local SQLite work tracker. When
17
- it's done, open Claude Code and run `/onboard` — it interviews you about
18
- your project and generates the context layer that makes everything work.
36
+ it's done, open Claude Code and run `/onboard`.
19
37
 
20
38
  ## What You Get
21
39
 
@@ -36,9 +54,9 @@ you already use GitHub Issues, Linear, or something else.
36
54
  - **`/execute`** — step-through execution with checkpoints and guardrails.
37
55
 
38
56
  ### Audit System (opt-in)
39
- 15 expert perspectives (security, accessibility, data integrity,
40
- performance, etc.) that analyze your codebase and produce structured
41
- findings. Triage UI for reviewing results.
57
+ 20 expert perspectives (security, accessibility, data integrity,
58
+ performance, architecture, process, etc.) that analyze your codebase and
59
+ produce structured findings. Triage UI for reviewing results.
42
60
 
43
61
  ### Compliance Stack (opt-in)
44
62
  Scoped instructions in `.claude/rules/` that load by file path. An
@@ -102,8 +120,14 @@ scripts/
102
120
 
103
121
  ## Upgrading
104
122
 
123
+ Re-run the installer to pick up new versions:
124
+
105
125
  ```bash
106
- npx create-claude-rails # re-run to add modules
126
+ # Shell installer (re-downloads latest)
127
+ curl -fsSL https://raw.githubusercontent.com/orenmagid/claude-on-rails/main/install.sh | bash
128
+
129
+ # npm installer (if using Node.js)
130
+ npx create-claude-rails
107
131
  ```
108
132
 
109
133
  In Claude Code, run `/cor-upgrade` for conversational merge of upstream
@@ -121,8 +145,14 @@ starts from zero. Orient/debrief creates continuity. Planning with
121
145
  perspectives catches problems before they ship. The enforcement pipeline
122
146
  turns recurring mistakes into permanent fixes.
123
147
 
124
- None of this requires you to be a developer. The onboarding interview
125
- meets you where you are, and the system adapts based on what you tell it.
148
+ None of this requires you to be a developer. I'm barely one myself. The
149
+ onboarding interview meets you where you are, and the system adapts
150
+ based on what you tell it.
151
+
152
+ This is very much a work in progress. Things will break. The session
153
+ loop is solid; everything else is still finding its shape. If you try it
154
+ and something's weird, that's not you — it's probably me. Or Claude.
155
+ We're figuring it out together.
126
156
 
127
157
  ## License
128
158
 
package/lib/cli.js CHANGED
@@ -500,6 +500,23 @@ async function run() {
500
500
  }
501
501
  }
502
502
 
503
+ // --- Clean up files removed upstream ---
504
+ if (Object.keys(existingManifest).length > 0) {
505
+ let totalRemoved = 0;
506
+ for (const oldPath of Object.keys(existingManifest)) {
507
+ if (!allManifest[oldPath]) {
508
+ const fullPath = path.join(projectDir, oldPath);
509
+ if (fs.existsSync(fullPath)) {
510
+ if (!flags.dryRun) fs.unlinkSync(fullPath);
511
+ totalRemoved++;
512
+ }
513
+ }
514
+ }
515
+ if (totalRemoved > 0) {
516
+ console.log(` 🧹 Removed ${totalRemoved} file${totalRemoved === 1 ? '' : 's'} no longer in upstream`);
517
+ }
518
+ }
519
+
503
520
  // --- Write metadata ---
504
521
  if (!flags.dryRun) {
505
522
  createMetadata(projectDir, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-claude-rails",
3
- "version": "0.4.2",
3
+ "version": "0.5.1",
4
4
  "description": "Claude on Rails — opinionated process scaffolding for Claude Code projects",
5
5
  "bin": {
6
6
  "create-claude-rails": "bin/create-claude-rails.js"
@@ -2,24 +2,22 @@
2
2
  model: opus
3
3
  name: cor-upgrade
4
4
  description: |
5
- Conversational upgrade when new Claude on Rails skeletons arrive. Detects current
6
- adoption state, diffs against upstream, and for each change walks through
7
- an intelligent merge conversation not mechanical copy. Intelligence is
8
- the merge strategy. Use when: "cor-upgrade", "update CoR", "new skeletons",
9
- "/cor-upgrade".
5
+ Conversational upgrade when Claude on Rails updates. Runs the installer to
6
+ mechanically update all upstream-owned files, then walks through what changed
7
+ conversationallyexplaining improvements, handling _context.md updates,
8
+ new phase file opportunities, and schema migrations. Intelligence is the
9
+ merge strategy for the parts that need it. Use when: "cor-upgrade",
10
+ "update CoR", "new skeletons", "/cor-upgrade".
10
11
  related:
11
12
  - type: file
12
- path: .claude/skills/cor-upgrade/phases/detect-current.md
13
- role: "Inventory current adoption state"
13
+ path: .claude/skills/cor-upgrade/phases/pre-upgrade.md
14
+ role: "Pre-upgrade checks and state capture"
14
15
  - type: file
15
- path: .claude/skills/cor-upgrade/phases/diff-upstream.md
16
- role: "Semantic diff against upstream CoR"
16
+ path: .claude/skills/cor-upgrade/phases/explain-changes.md
17
+ role: "How to explain what changed"
17
18
  - type: file
18
- path: .claude/skills/cor-upgrade/phases/merge.md
19
- role: "Intelligent merge strategythe core of the skill"
20
- - type: file
21
- path: .claude/skills/cor-upgrade/phases/apply.md
22
- role: "Apply approved changes"
19
+ path: .claude/skills/cor-upgrade/phases/adapt.md
20
+ role: "Handle non-manifest concerns_context.md, phase files, schema"
23
21
  ---
24
22
 
25
23
  # /cor-upgrade — Conversational Claude on Rails Upgrade
@@ -27,34 +25,30 @@ related:
27
25
  ## Purpose
28
26
 
29
27
  This is the methodology's central claim made operational: **intelligence
30
- is the merge strategy.**
31
-
32
- Traditional frameworks distribute as code. You install a new version,
33
- run a migration script, resolve merge conflicts in config files, and hope
34
- nothing breaks. The upgrade path is mechanical diff, patch, pray. This
35
- works for code because code has precise semantics. It fails for process
36
- because process is always adapted to context.
37
-
38
- AI-native methodology distributes as conversation. The upstream CoR
39
- package publishes new skeletons, updated defaults, additional perspectives,
40
- schema migrations. But the project has already adapted those skeletons —
41
- customized phase files, tuned perspectives, extended workflows. A
42
- mechanical merge would destroy the adaptations. A manual merge would
43
- require the user to understand both what changed upstream and how their
44
- project diverged, then mentally compose the two. Neither works.
45
-
46
- The upgrade skill reads both sides the upstream change and the
47
- downstream context and translates improvements into the project's
48
- idiom. It explains what changed and why, examines how the project
49
- currently handles that area, and proposes an adaptation that preserves
50
- local customizations while incorporating upstream improvements. The
51
- user confirms, modifies, or rejects each proposal. Nothing is applied
52
- silently.
28
+ is the merge strategy** — but only where intelligence is needed.
29
+
30
+ CoR upgrades have two layers:
31
+
32
+ 1. **Mechanical layer.** Skeleton SKILL.md files, hook scripts, utility
33
+ scripts these are upstream-owned and tracked in `.corrc.json`. The
34
+ installer overwrites them deterministically. No conversation needed.
35
+ The upstream guard hook (PreToolUse on Edit|Write) enforces this
36
+ boundary at runtime Claude cannot accidentally modify these files.
37
+
38
+ 2. **Conversational layer.** Everything the installer can't handle:
39
+ explaining what changed and why, updating `_context.md` sections that
40
+ new features reference, identifying new phase file opportunities,
41
+ running schema migrations, adapting project context to upstream
42
+ improvements. This is where intelligence is the merge strategy.
43
+
44
+ The old approach tried to use conversation for everything including
45
+ mechanical file updates. That was fragile. Now the installer handles
46
+ the deterministic parts, and this skill focuses entirely on the parts
47
+ that actually need reasoning.
53
48
 
54
49
  This is a **skeleton skill** using the `phases/` directory pattern. The
55
- orchestration (detect, diff, merge, apply) is generic. Your project
56
- defines specifics — where upstream lives, what's adopted, how to
57
- present changes — in phase files under `phases/`.
50
+ orchestration is generic. Your project defines specifics in phase files
51
+ under `phases/`.
58
52
 
59
53
  ### Phase File Protocol
60
54
 
@@ -70,126 +64,170 @@ The skeleton always does something reasonable when a phase file is absent.
70
64
  Phase files customize, not enable. Use `skip: true` when you actively
71
65
  don't want a phase to run — not even the default.
72
66
 
73
- ### Skeleton/Extension Separation
74
-
75
- This skill understands a critical boundary: **skeleton SKILL.md files may
76
- update, but phase files are NEVER overwritten by upstream changes.**
77
-
78
- Skeleton files (SKILL.md) contain the generic orchestration — the workflow
79
- steps, the phase protocol, the default behaviors. These are authored by
80
- CoR and may improve over time. When upstream publishes a better skeleton,
81
- the upgrade skill can propose replacing it.
82
-
83
- Phase files contain the project's customizations — what specific files to
84
- read, what specific APIs to call, what specific checks to run. These are
85
- authored by the project adopter (you and Claude together). Upstream has
86
- no knowledge of them and no authority to change them. Even if upstream
87
- adds a new phase file as an example or default, it never overwrites an
88
- existing project phase file.
89
-
90
- This separation is what makes upgrades safe. The skeleton evolves; the
91
- customizations persist. The merge intelligence sits at the boundary
92
- between the two.
93
-
94
- ## Workflow
95
-
96
- ### 1. Detect Current State
67
+ ### Write Protection
97
68
 
98
- Read `phases/detect-current.md` for how to inventory the project's
99
- current CoR adoption.
69
+ Manifest-tracked files (skeleton SKILL.md files, hooks, scripts) are
70
+ protected by the upstream guard hook. Claude cannot Edit or Write to
71
+ them during normal operation. This is intentional — these files are
72
+ upstream-owned and should only change through the installer.
100
73
 
101
- **Default (absent/empty):** Scan the project for CoR artifacts:
102
- - For each skill in `.claude/skills/`: is it a CoR skeleton? Which
103
- phase files are customized vs using defaults vs explicitly skipped?
104
- - Which perspectives are adopted? Which groups configured?
105
- - What hooks are installed from CoR?
106
- - What pib-db schema version is in use (check for known columns)?
107
- - What's in `memory/patterns/`?
74
+ **What this means for upgrades:**
75
+ - The installer (running via Bash as a Node.js/shell process) bypasses
76
+ the hook because it doesn't use Claude's Edit/Write tools
77
+ - After the installer runs, all manifest-tracked files are current
78
+ - This skill then handles everything the installer doesn't touch:
79
+ _context.md, phase files, schema, and explanation
108
80
 
109
- Output: a structured manifest of current adoption state, consumed by
110
- the diff phase.
111
-
112
- ### 2. Diff Against Upstream
113
-
114
- Read `phases/diff-upstream.md` for how to compare the project's state
115
- against the upstream CoR package.
116
-
117
- **Default (absent/empty):** Look for `.pib-upstream/` in the project
118
- root (staged by `npx create-claude-rails upgrade`). For each
119
- adopted skeleton: perform a semantic diff of SKILL.md — section by
120
- section, not line by line. Identify new phases, changed workflows,
121
- updated defaults. For non-adopted skills: list what's new and available.
122
- For perspectives: detect new or updated ones in upstream. For schema:
123
- compare `pib-db-schema.sql` columns against the project's actual DB
124
- tables.
125
-
126
- Output: a categorized list of changes, each tagged with a change
127
- category (see below).
128
-
129
- ### 3. Merge — The Intelligence
130
-
131
- Read `phases/merge.md` for how to handle each detected change. This is
132
- the core of the skill — where conversation replaces mechanical patching.
133
-
134
- **Default (absent/empty):** For each change detected in the diff phase:
135
-
136
- 1. **Explain** what changed and why. Read the upstream change, infer its
137
- purpose from context (commit messages, surrounding documentation,
138
- the change itself). Don't just say "line 47 changed" — say "the
139
- orient skeleton now includes a calendar-check phase because projects
140
- found that missing upcoming deadlines was a recurring failure mode."
141
-
142
- 2. **Examine** how the project currently handles this area. Read the
143
- relevant phase files, skill definitions, and configuration. Understand
144
- the project's adaptation before proposing anything.
145
-
146
- 3. **Propose** an adaptation. Based on the change category (see below),
147
- recommend one of: adopt as-is, adapt to fit the project's patterns,
148
- or skip with a reason. Explain what each option would mean concretely.
149
-
150
- 4. **Dialogue.** The user decides. This is conversation, not mechanical
151
- merge. If the user wants something different from what you proposed,
152
- co-author the adaptation together.
81
+ ### Skeleton/Extension Separation
153
82
 
154
- #### Change Categories
83
+ Skeleton files (SKILL.md, hooks, scripts) are upstream-owned, manifest-
84
+ tracked, and write-protected. They evolve through the installer.
155
85
 
156
- Each detected change falls into one of six categories. The category
157
- determines the default merge strategy:
86
+ Phase files and _context.md are project-owned. They are NEVER in the
87
+ manifest, NEVER write-protected, and NEVER overwritten by the installer.
88
+ They evolve through conversation — this skill, /onboard, or direct
89
+ editing.
158
90
 
159
- | # | Category | Default Strategy |
160
- |---|----------|-----------------|
161
- | 1 | **New default behavior** — a phase the project uses defaults for gains a new default | Auto-adopt. The project was already trusting upstream defaults; the new default is strictly additive. Mention it but don't require confirmation. |
162
- | 2 | **Changed default behavior** — a phase the project uses defaults for has its default modified | Explain + propose. The project trusted the old default; the new one is different. Show what changed and let the user decide. |
163
- | 3 | **New phase added to skeleton** — upstream added a phase that didn't exist before | Explain what the phase does, propose opt-in. New phases start as "absent" (using default or skipped), so adoption is always explicit. |
164
- | 4 | **Changed skeleton workflow** — the SKILL.md orchestration itself changed | The most sensitive category. Examine the project's phase files and any custom phases. Co-author the adaptation — don't just replace the skeleton. |
165
- | 5 | **New skeleton skill available** — upstream published a skill the project hasn't adopted | Present what the skill does, what problem it solves, what adoption would involve. User decides whether and when to adopt. |
166
- | 6 | **Schema migration** — upstream schema has new columns or tables | Detect the difference, generate ALTER TABLE / CREATE TABLE SQL, present for review, apply only after explicit confirmation. |
91
+ This separation is enforced mechanically (manifest + hook), not just
92
+ by convention. The upgrade is safe because the boundary is real.
167
93
 
168
- **CRITICAL:** Phase files are NEVER overwritten. The merge handles
169
- skeleton SKILL.md updates and new capabilities. Project-specific
170
- customizations in phase files are sacred — they represent the project's
171
- adaptation of the methodology to its own context. If an upstream change
172
- would interact with a phase file's content (e.g., a skeleton now
173
- references a concept the phase file also addresses), the merge proposes
174
- a collaborative edit, not a replacement.
94
+ ## Workflow
175
95
 
176
- ### 4. Apply Approved Changes
96
+ ### 1. Pre-Upgrade Snapshot
177
97
 
178
- Read `phases/apply.md` for how to apply the changes the user approved
179
- in the merge phase.
98
+ Read `phases/pre-upgrade.md` for pre-upgrade checks.
180
99
 
181
100
  **Default (absent/empty):**
182
- - For skeleton-only changes: copy the updated SKILL.md from upstream,
183
- preserving the project's phase files untouched.
184
- - For changes that interact with phase files: make collaborative edits
185
- as approved in the merge dialogue show the diff before writing.
186
- - For schema migrations: run the approved SQL against the project's DB.
187
- - For new skills: copy the skeleton SKILL.md, create an empty `phases/`
188
- directory. The project customizes from there.
189
- - Commit after each logical group of changes with a clear message
190
- describing what was upgraded and why.
191
- - Present a summary: what was applied, what was skipped (with reasons),
192
- what the user might want to review or customize next.
101
+ - Read `.corrc.json` to capture the current version and module set
102
+ - Note which phase files exist and have content (these won't be touched)
103
+ - Note any `_context.md` sections that may need updating
104
+ - If the project has a work tracker DB, note the current schema
105
+
106
+ Output: a snapshot of the project's current state, used to explain
107
+ what changed after the installer runs.
108
+
109
+ ### 2. Run the Installer
110
+
111
+ Run the installer via Bash to mechanically update all upstream files:
112
+
113
+ ```
114
+ # Shell installer (re-downloads latest from npm registry)
115
+ curl -fsSL https://raw.githubusercontent.com/orenmagid/claude-on-rails/main/install.sh | bash
116
+
117
+ # Or npm installer (if Node.js available)
118
+ npx create-claude-rails
119
+ ```
120
+
121
+ The installer:
122
+ - Overwrites all manifest-tracked files (skeletons, hooks, scripts)
123
+ - Preserves files NOT in the manifest (phase files, _context.md)
124
+ - Updates `.corrc.json` with new version, hashes, and any new files
125
+ - Adds new skills/hooks/scripts that didn't exist in the old version
126
+
127
+ **This is a Bash command, not an Edit/Write operation.** It bypasses
128
+ the upstream guard hook because it runs as a separate process using
129
+ the filesystem directly. This is by design — the installer is the
130
+ authorized update path for manifest-tracked files.
131
+
132
+ ### 3. Explain What Changed
133
+
134
+ Read `phases/explain-changes.md` for how to present changes.
135
+
136
+ **Default (absent/empty):** Compare the pre-upgrade snapshot against
137
+ the new state:
138
+
139
+ 1. **Version jump.** What version did we come from? What version are
140
+ we on now?
141
+
142
+ 2. **Changed skeletons.** For each SKILL.md that the installer updated,
143
+ explain what changed and why — not line-by-line diffs, but semantic
144
+ summaries. "The debrief skill now includes an upstream feedback phase
145
+ that surfaces CoR friction during debrief sessions." "The plan skill's
146
+ critique step now pulls from more perspectives by default."
147
+
148
+ 3. **New files.** Any skills, hooks, or scripts that were added for the
149
+ first time. Explain what they do and whether they need any setup.
150
+
151
+ 4. **New phase opportunities.** If new skeletons reference phase files
152
+ that the project doesn't have yet, mention them as opportunities.
153
+ "The orient skeleton now supports a `calendar-check.md` phase — you
154
+ could create one to check upcoming deadlines."
155
+
156
+ 5. **Deprecations or removals.** If anything was removed upstream,
157
+ explain why and what replaces it.
158
+
159
+ Walk through each category conversationally. The user should understand
160
+ what they're getting, not just that files changed.
161
+
162
+ ### 4. Adapt Non-Manifest Concerns
163
+
164
+ Read `phases/adapt.md` for how to handle the conversational layer.
165
+
166
+ **Default (absent/empty):** After explaining changes, handle anything
167
+ the installer couldn't:
168
+
169
+ #### _context.md Updates
170
+ If new skeletons reference `_context.md § Section` names that the
171
+ project's `_context.md` doesn't have, propose adding them. New features
172
+ often depend on context sections — e.g., a new perspective might
173
+ reference `§ Friction Captures` which the project hasn't defined yet.
174
+ Show the section template from `_context-template.md` and help the
175
+ user fill it in.
176
+
177
+ #### Phase File Opportunities
178
+ For each skeleton that changed, check its phase files against the
179
+ project's `phases/` directory. There are three cases:
180
+
181
+ 1. **Existing phase file, workflow changed around it.** The project
182
+ customized this phase and the skeleton shifted. Discuss the
183
+ implications: "The orient skeleton reorganized its steps — your
184
+ custom `health-checks.md` phase still works, but it now runs
185
+ earlier in the workflow. Is that okay?"
186
+
187
+ 2. **New phase the skeleton now references.** The upstream added a
188
+ phase that didn't exist before. Explain what the default behavior
189
+ is and what customizing it would look like. Don't push — just
190
+ surface the opportunity. "The debrief skeleton now has an
191
+ `upstream-feedback` step. It runs by default — here's what it does.
192
+ If you ever want to change that behavior, you'd create
193
+ `phases/upstream-feedback.md`."
194
+
195
+ 3. **Existing default that changed meaningfully.** The project uses
196
+ the default (no phase file) and the default behavior shifted. The
197
+ project gets the improvement automatically, but mention it so they
198
+ know. If the new default does something they might not want, suggest
199
+ creating a phase file to customize or skip it. "The plan skeleton's
200
+ default research phase now reads test files too. You've been using
201
+ the default — you'll get this automatically. If that's too noisy,
202
+ create `phases/research.md` to scope it."
203
+
204
+ 4. **Default that won't fit the project.** Read `_context.md` and
205
+ compare against what the default actually does. If there's a
206
+ mismatch, say so and offer to create the phase file now. "The
207
+ orient skeleton added a `work-scan` phase. The default reads git
208
+ history — but your `_context.md` says you use Linear. The default
209
+ won't see your tickets. Want to create `phases/work-scan.md` that
210
+ checks Linear?" This isn't speculation — it's reading both sides
211
+ and spotting the gap.
212
+
213
+ **Don't enumerate every absent phase file.** That's `/onboard`'s job.
214
+ The upgrade skill only surfaces phase opportunities that are *relevant
215
+ to what changed* in this upgrade — including cases where the project's
216
+ context makes a default obviously insufficient.
217
+
218
+ #### Schema Migrations
219
+ If the upstream schema has new columns or tables:
220
+ - Detect the difference between the shipped schema and the project's DB
221
+ - Generate `ALTER TABLE` / `CREATE TABLE` SQL
222
+ - Present for review
223
+ - Apply only after explicit confirmation
224
+
225
+ #### New Module Adoption
226
+ If the upgrade added modules the project hadn't installed before,
227
+ walk through what they do and whether to keep them.
228
+
229
+ Present a summary when done: what was mechanically updated, what was
230
+ adapted conversationally, what the user might want to customize next.
193
231
 
194
232
  ### 5. Discover Custom Phases
195
233
 
@@ -202,23 +240,21 @@ the workflow. Execute them at their declared position.
202
240
 
203
241
  | Phase | Absent = | What it customizes |
204
242
  |-------|----------|-------------------|
205
- | `detect-current.md` | Default: scan .claude/skills/, perspectives, hooks, DB | How to inventory adoption state |
206
- | `diff-upstream.md` | Default: compare against .pib-upstream/ (staged by CLI) | Where upstream lives and how to diff |
207
- | `merge.md` | Default: explain + examine + propose for each change | How to handle each change category |
208
- | `apply.md` | Default: copy skeletons, collaborative edits, SQL migrations | How to apply approved changes |
243
+ | `pre-upgrade.md` | Default: read .corrc.json, note phase files, note _context.md | Pre-upgrade state capture |
244
+ | `explain-changes.md` | Default: semantic summary of version jump, changed skeletons, new files | How to present what changed |
245
+ | `adapt.md` | Default: _context.md sections, phase implications, schema, new modules | How to handle non-manifest concerns |
209
246
 
210
247
  ## Proactive Trigger
211
248
 
212
249
  The upgrade skill doesn't have to wait for the user to invoke it.
213
- Orient can detect when upstream CoR files are newer than the project's
214
- adopted copies and surface "CoR updates available" in the briefing.
250
+ Orient can detect when upstream CoR has a newer version than what's
251
+ in `.corrc.json` and surface "CoR updates available" in the briefing.
215
252
  This is a hint, not a blocker — the user decides when to run /cor-upgrade.
216
253
 
217
- To enable this, a project's orient `phases/health-checks.md` or a
218
- custom orient phase can compare modification times between upstream
219
- skeleton SKILL.md files and their adopted counterparts. When drift is
220
- detected, orient mentions it. When the user is ready, they invoke
221
- /cor-upgrade and the full conversational merge begins.
254
+ The drift check script (`scripts/cor-drift-check.cjs`) can also detect
255
+ if manifest-tracked files have been modified outside the installer,
256
+ though the upstream guard hook should prevent this during normal
257
+ Claude Code operation.
222
258
 
223
259
  ## Extending
224
260
 
@@ -238,29 +274,29 @@ Examples of phases mature projects add:
238
274
  ## Calibration
239
275
 
240
276
  **Core failure this targets:** Process improvements published upstream
241
- never reach adopted projects, or reach them as destructive overwrites
242
- that erase hard-won customizations.
277
+ never reach adopted projects, or reach them but nobody understands
278
+ what changed.
243
279
 
244
280
  ### Without Skill (Bad)
245
281
 
246
- New CoR skeletons arrive. The user manually diffs files, trying to
247
- figure out what changed. Some changes are obviousa new skill directory
248
- appeared. Others are subtle a default behavior in an existing skeleton
249
- shifted. The user copies files they think are updated, accidentally
250
- overwrites a phase file they'd customized, doesn't notice a schema
251
- migration is needed. Three sessions later, a skill fails because it
252
- references a DB column that doesn't exist yet. The customization they
253
- spent two sessions tuning is gone, replaced by the upstream default.
282
+ New CoR version is out. The user re-runs the installer. Files update
283
+ silently. The user has no idea what changedwas it just bug fixes?
284
+ New features? Did a skill they rely on change its workflow? They also
285
+ don't realize the new debrief skill references a Friction Captures`
286
+ section in _context.md that their project doesn't have, so the upstream
287
+ feedback phase silently does nothing. Three weeks later they wonder
288
+ why no friction is being captured.
254
289
 
255
290
  ### With Skill (Good)
256
291
 
257
- New CoR skeletons arrive. The user runs `/cor-upgrade`. Claude inventories
258
- what's adopted, diffs against upstream, and walks through each change:
259
- "The orient skeleton added a calendar-check phase. Your project doesn't
260
- have calendar integration, so this would be a no-op skip it for now?"
261
- "The debrief skeleton's default inventory behavior now includes checking
262
- for uncommitted stash entries. You're using the default here, so this
263
- improvement applies automatically." "There's a new schema column for
264
- deferred trigger conditions. Here's the ALTER TABLE want me to apply
265
- it?" Nothing is lost. Everything is explained. The project gets better
266
- without getting broken.
292
+ New CoR version is out. The user runs `/cor-upgrade`. The installer
293
+ updates all upstream files mechanically fast, deterministic, safe
294
+ (phase files untouched). Then Claude explains: "You went from v0.4.1
295
+ to v0.5.0. The big change: debrief now has an upstream feedback phase
296
+ that captures CoR friction. It references `_context.md § Friction
297
+ Captures` let's add that section to your context file." "The plan
298
+ skill's critique step now uses three perspectives instead of one. Your
299
+ existing phase files are fine this is a default behavior change."
300
+ "There's a new `investigate` skill for deep-dive debugging. Want to
301
+ try it?" Everything is explained. Non-manifest concerns are handled.
302
+ The project gets better without confusion.
@@ -1,86 +0,0 @@
1
- # Apply — Execute Approved Changes
2
-
3
- Apply the changes approved during the merge conversation. Each change
4
- type has a specific application method.
5
-
6
- When this file is absent or empty, the default behavior is: apply each
7
- approved change using the type-appropriate method below, commit after
8
- each logical group, and present a summary. To explicitly skip applying
9
- (dry-run mode where merge proposes but nothing is written), write only
10
- `skip: true`.
11
-
12
- ## Application Methods
13
-
14
- ### Skeleton SKILL.md Updates
15
-
16
- Copy the updated SKILL.md from upstream to the project's `.claude/skills/`
17
- directory. The project's `phases/` directory is untouched — only the
18
- skeleton orchestration file changes.
19
-
20
- Before copying, verify:
21
- - The project's phase files still exist and are intact
22
- - The new skeleton's phase references match the phase files that exist
23
- - If the new skeleton references a phase the project doesn't have,
24
- note it (the project will use the default behavior)
25
-
26
- ### Phase File Collaborative Edits
27
-
28
- When a merge proposal includes changes to a phase file (always with
29
- user approval):
30
- - Show the exact diff before writing
31
- - Make the edit
32
- - Read back the result so the user can verify
33
-
34
- Never bulk-replace a phase file. Edits are surgical and approved.
35
-
36
- ### Schema Migrations
37
-
38
- - Present the SQL one more time before executing
39
- - Run the migration against the project's database
40
- - Verify the schema change took effect (query the table structure)
41
- - If migration fails, report the error — don't retry or attempt fixes
42
- without user input
43
-
44
- ### New Skills
45
-
46
- - Copy the skeleton SKILL.md from upstream
47
- - Create an empty `phases/` directory
48
- - Do NOT copy upstream example phase files — the project starts fresh
49
- and customizes from the skeleton's defaults
50
- - Note the new skill in the summary so the user knows to customize it
51
-
52
- ### New Perspectives
53
-
54
- - Copy new perspective files to the project's perspective directory
55
- - If the project has a group configuration, note the new perspective
56
- but don't auto-add it to any group — the user decides placement
57
-
58
- ### New Hooks or Rules
59
-
60
- - Present the hook/rule configuration
61
- - Add to `.claude/settings.json` or `.claude/rules/` after confirmation
62
- - If the project has existing hooks that might conflict, flag it
63
-
64
- ## Commit Strategy
65
-
66
- Commit after each logical group of changes:
67
- - All skeleton updates in one commit
68
- - Schema migrations in a separate commit (easy to revert)
69
- - New skills in a separate commit
70
- - Phase file edits in a separate commit (clearly separated from
71
- skeleton changes)
72
-
73
- Commit messages should describe what was upgraded:
74
- "Upgrade orient + debrief skeletons from upstream CoR"
75
- "Add trigger_condition column (CoR schema migration)"
76
- "Adopt /validate skill from CoR"
77
-
78
- ## Summary
79
-
80
- After all changes are applied, present:
81
- - **Applied:** what was changed, with commit references
82
- - **Skipped:** what the user chose not to adopt, with their reasons
83
- (useful context for the next upgrade)
84
- - **Review next:** suggestions for customization — new skills that
85
- need phase files, new phases that might benefit from project-specific
86
- content, perspectives to consider adding to groups
@@ -1,82 +0,0 @@
1
- # Detect Current — Inventory Claude on Rails Adoption State
2
-
3
- Build a structured manifest of the project's current CoR adoption. This
4
- manifest is consumed by the diff-upstream phase to determine what has
5
- changed.
6
-
7
- When this file is absent or empty, the default behavior is: read
8
- `.corrc.json` for version and module metadata, then scan the project's
9
- `.claude/skills/`, perspectives, hooks, and database for CoR artifacts.
10
- To explicitly skip detection, write only `skip: true`.
11
-
12
- ## What to Inventory
13
-
14
- ### Package Metadata (.corrc.json)
15
-
16
- Read `.corrc.json` from the project root. This file is written by the
17
- CLI installer (`npx create-claude-rails`) and contains:
18
-
19
- - **`version`** — the installed package version (for diff-upstream comparison)
20
- - **`installedAt`** — when the install or last upgrade happened
21
- - **`modules`** — which module groups were selected (boolean map)
22
- - **`skipped`** — modules the user opted out of, with reasons
23
- - **`upstreamPackage`** — the npm package name (`create-claude-rails`)
24
-
25
- If `.corrc.json` is missing, this is either a pre-npm adoption or a
26
- manual install. Note this in the manifest — the diff-upstream phase
27
- needs to know whether version comparison is possible or if it must fall
28
- back to pure filesystem diffing.
29
-
30
- ### Skills
31
-
32
- For each directory in `.claude/skills/`:
33
- - **Is it a CoR skeleton?** Compare the SKILL.md against the upstream
34
- upstream templates directory. If it matches a known skeleton
35
- (by name or by frontmatter `name` field), it's a CoR skill.
36
- - **Phase file status:** For each phase file the skeleton defines, check
37
- whether the project's copy is: absent (using default), empty (using
38
- default), contains `skip: true` (opted out), or contains custom content
39
- (project-specific adaptation).
40
- - **Custom phases:** Any phase files in the project's `phases/` directory
41
- that the skeleton doesn't define are project extensions.
42
-
43
- ### Perspectives
44
-
45
- - Which perspective groups exist in `.claude/skills/perspectives/`?
46
- - Which perspectives are listed in each group's `_group.yaml`?
47
- - Which perspectives have project-customized content vs upstream defaults?
48
-
49
- ### Hooks
50
-
51
- - Read `.claude/settings.json` (or `.claude/settings.local.json`).
52
- - Identify which hooks were installed as part of CoR adoption vs
53
- project-specific additions.
54
-
55
- ### Database Schema
56
-
57
- - If the project uses `pib-db`, check the actual DB schema against
58
- known CoR columns. Record which tables and columns exist.
59
- - Note the effective schema version (inferred from which columns are
60
- present, not from a version number).
61
-
62
- ### Memory and Patterns
63
-
64
- - Count files in `memory/patterns/` and `memory/archive/`.
65
- - Note whether the enforcement pipeline is active (patterns have
66
- `enforcement` frontmatter fields).
67
-
68
- ## Output Format
69
-
70
- Produce a structured manifest (in conversation, not a file) listing:
71
- - **Package version** from `.corrc.json` (or "unknown — no .corrc.json")
72
- - **Installed modules** from `.corrc.json` modules map
73
- - **Skipped modules** with reasons from `.corrc.json` skipped map
74
- - Each adopted skill with its phase file statuses
75
- - Each adopted perspective group with member count
76
- - Hook count and types
77
- - Schema state
78
- - Pattern/archive counts
79
-
80
- This manifest feeds directly into the diff-upstream phase. The version
81
- field is especially critical — it determines whether diff-upstream can
82
- do a targeted version-to-version comparison or must diff everything.
@@ -1,72 +0,0 @@
1
- # Diff Upstream — Compare Project Against Claude on Rails Package
2
-
3
- Compare the project's current adoption state (from detect-current) against
4
- the upstream CoR package. Produce a categorized list of changes.
5
-
6
- When this file is absent or empty, the default behavior is: look for
7
- `.pib-upstream/` in the project root (staged by `npx create-claude-rails
8
- upgrade`) and perform semantic diffs of all adopted skeletons. To
9
- explicitly skip diffing, write only `skip: true`.
10
-
11
- ## Locating Upstream
12
-
13
- Default: `.pib-upstream/` in the project root. This directory is created
14
- by `npx create-claude-rails upgrade`, which fetches the latest package
15
- from npm and stages its templates here for comparison. The directory is
16
- gitignored — it's a transient diff target, not a permanent fixture.
17
-
18
- If `.pib-upstream/` doesn't exist, prompt the user:
19
- "Run `npx create-claude-rails upgrade` first — it fetches the latest
20
- upstream and stages it for comparison."
21
-
22
- If your project stores upstream elsewhere (a submodule, a symlinked
23
- directory, a separate checkout), specify the path here.
24
-
25
- ## Diff Strategy
26
-
27
- The diff is **semantic, not textual.** Line-by-line diffs of markdown
28
- files are noisy and miss the point. Instead:
29
-
30
- ### For Each Adopted Skeleton SKILL.md
31
-
32
- Compare section by section:
33
- - **Purpose/description** — has the framing changed?
34
- - **Workflow steps** — are there new phases? Removed phases? Reordered?
35
- - **Phase summary table** — do defaults differ?
36
- - **Default behaviors** — for each phase, has the "absent/empty" behavior
37
- changed? This matters most for projects using defaults.
38
- - **Calibration** — has the failure mode description evolved?
39
- - **Extending section** — new extension examples?
40
-
41
- ### For Non-Adopted Skills
42
-
43
- List any skills in upstream that the project hasn't adopted. For each,
44
- note: name, one-line description, what problem it addresses.
45
-
46
- ### For Perspectives
47
-
48
- - New perspectives in upstream that the project doesn't have.
49
- - Updated perspectives where upstream content differs from project copy.
50
- - New perspective groups.
51
-
52
- ### For Schema
53
-
54
- Compare `pib-db-schema.sql` (or equivalent) column-by-column against
55
- the project's actual database tables. Flag: new columns, changed types,
56
- new tables, new indexes.
57
-
58
- ### For Infrastructure
59
-
60
- - New hooks in upstream's recommended settings.
61
- - New rules files in upstream's `.claude/rules/`.
62
- - Changes to the CoR onboarding or seed skills.
63
-
64
- ## Output Format
65
-
66
- A categorized change list, where each change has:
67
- - **What** changed (specific file, section, or artifact)
68
- - **Category** (1-6, matching the SKILL.md's change categories)
69
- - **Summary** of the change in plain language
70
- - **Impact** on the project (does this touch something the project customized?)
71
-
72
- This feeds directly into the merge phase.
@@ -1,97 +0,0 @@
1
- # Merge — Intelligent Upgrade Conversation
2
-
3
- THE INTELLIGENCE. For each change detected by diff-upstream, walk
4
- through a conversational merge: explain, examine, propose, dialogue.
5
-
6
- When this file is absent or empty, the default behavior is: process
7
- each change using the category-based strategy defined in the skeleton
8
- SKILL.md. To explicitly skip merging (just list changes without
9
- proposing anything), write only `skip: true`.
10
-
11
- ## The Merge Loop
12
-
13
- For each change in the categorized list:
14
-
15
- ### 1. Explain What Changed and Why
16
-
17
- Read the upstream change in full. Don't summarize from the diff — read
18
- the actual new content. Infer purpose from:
19
- - The change itself (what does it add, remove, or alter?)
20
- - Surrounding documentation (did a README or methodology essay mention it?)
21
- - Commit messages if accessible
22
- - The pattern of changes (if several skeletons gained the same phase,
23
- that's a methodology-wide shift)
24
-
25
- Communicate at the level of intent, not lines: "The orient skeleton now
26
- checks for stale deferred items because projects found that deferred
27
- work was being forgotten" — not "lines 140-155 were added."
28
-
29
- ### 2. Examine the Project's Current Implementation
30
-
31
- Before proposing anything, understand how the project handles this area:
32
- - Read the relevant phase files (customized? default? skipped?)
33
- - Check if the project has custom phases that address the same concern
34
- - Look at related memory patterns or feedback
35
- - Understand why the project's current approach exists
36
-
37
- ### 3. Propose Adaptation
38
-
39
- Based on the change category:
40
-
41
- **Category 1 (new default):** "This applies automatically since you're
42
- using the default. Here's what it adds: [description]. No action needed
43
- unless you want to customize it."
44
-
45
- **Category 2 (changed default):** "The default behavior for [phase]
46
- changed from [old] to [new]. You're currently using the default. The
47
- new version [explanation]. Adopt the new default, or would you prefer
48
- to pin the old behavior by writing it into your phase file?"
49
-
50
- **Category 3 (new phase):** "Upstream added a [name] phase to [skill].
51
- It handles [description]. Your project [does/doesn't] have something
52
- similar. Want to opt in, or skip it for now?"
53
-
54
- **Category 4 (changed workflow):** "The [skill] skeleton's workflow
55
- changed: [description]. Your project has customized [these phases].
56
- Here's how I'd adapt: [proposal]. Let's walk through it."
57
-
58
- **Category 5 (new skill):** "There's a new [name] skill available. It
59
- handles [description]. Adopting it would involve [steps]. Want to
60
- explore it, or skip for now?"
61
-
62
- **Category 6 (schema migration):** "The upstream schema adds [columns/
63
- tables]. Here's the migration SQL: [SQL]. This would enable [features].
64
- Want me to apply it?"
65
-
66
- ### 4. Dialogue
67
-
68
- Wait for the user's response. They may:
69
- - Accept as proposed
70
- - Want modifications (co-author the adaptation)
71
- - Skip with a reason (record why for future upgrades)
72
- - Ask questions (answer from upstream context)
73
-
74
- ## CRITICAL: Phase File Protection
75
-
76
- Phase files are NEVER overwritten by this process. The merge handles:
77
- - Skeleton SKILL.md updates (the generic orchestration)
78
- - New capabilities and defaults
79
- - Schema migrations
80
- - New skills and perspectives
81
-
82
- It does NOT handle:
83
- - Replacing project phase files with upstream examples
84
- - Overwriting custom perspectives
85
- - Changing project-specific hook configurations
86
-
87
- If an upstream change interacts with a phase file's content (e.g., a
88
- skeleton now references a concept the phase file also addresses), propose
89
- a **collaborative edit** — show the user what you'd change in their
90
- phase file and why, get approval before touching it.
91
-
92
- ## Batch vs Interactive
93
-
94
- For small upgrades (1-3 changes), walk through each one interactively.
95
- For large upgrades (many changes), group by category and handle
96
- auto-adopt items (category 1) in batch, then walk through the rest
97
- individually.