create-claude-rails 0.5.0 โ†’ 0.5.2

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/lib/cli.js CHANGED
@@ -15,7 +15,7 @@ const MODULES = {
15
15
  name: 'Session Loop (orient + debrief)',
16
16
  description: 'Context continuity between sessions. Claude starts informed, ends by recording what happened.',
17
17
  mandatory: true,
18
- templates: ['skills/orient', 'skills/debrief', 'skills/debrief/phases/upstream-feedback.md', 'skills/menu', 'hooks/stop-hook.md'],
18
+ templates: ['skills/orient', 'skills/orient-quick', 'skills/debrief', 'skills/debrief-quick', 'skills/debrief/phases/upstream-feedback.md', 'skills/menu', 'hooks/stop-hook.md'],
19
19
  },
20
20
  'hooks': {
21
21
  name: 'Git Guardrails + Telemetry',
@@ -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.5.0",
3
+ "version": "0.5.2",
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"
@@ -174,11 +174,46 @@ reference `ยง Friction Captures` which the project hasn't defined yet.
174
174
  Show the section template from `_context-template.md` and help the
175
175
  user fill it in.
176
176
 
177
- #### Phase File Implications
178
- If a skeleton's workflow changed in a way that interacts with existing
179
- phase files, discuss the implications. "The orient skeleton reorganized
180
- its steps โ€” your custom `health-checks.md` phase still works, but it
181
- now runs earlier in the workflow. Is that okay?"
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.
182
217
 
183
218
  #### Schema Migrations
184
219
  If the upstream schema has new columns or tables:
@@ -5,7 +5,9 @@ description: |
5
5
  updates state, captures lessons, and reports results. The operational
6
6
  closing that prevents entropy between sessions. This is a skeleton skill
7
7
  using the phases/ directory pattern. Use when: session end, "debrief",
8
- "wrap up", "/debrief", or after completing significant work.
8
+ "wrap up", "/debrief", "quick debrief", "debrief-quick", "/debrief-quick",
9
+ or after completing significant work. If "quick" is mentioned, use the
10
+ Quick Mode section โ€” run core phases only, skip presentation phases.
9
11
  related:
10
12
  - type: file
11
13
  path: .claude/skills/debrief/phases/inventory.md
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: debrief-quick
3
+ description: |
4
+ Quick post-session debrief โ€” core phases only, skip presentation.
5
+ Use when: "debrief-quick", "quick debrief", "/debrief-quick".
6
+ ---
7
+
8
+ # /debrief-quick
9
+
10
+ Load the `/debrief` skill and run it in **Quick Mode** โ€” core phases
11
+ only, skip presentation phases. See the debrief SKILL.md's Quick Mode
12
+ section for details.
@@ -5,7 +5,9 @@ description: |
5
5
  items, runs health checks and maintenance, then presents a briefing so
6
6
  the session starts informed. This is a skeleton skill using the phases/
7
7
  directory pattern. Use when: session start, "orient", "what's the state",
8
- "/orient".
8
+ "/orient", "quick orient", "orient-quick", "/orient-quick".
9
+ If "quick" is mentioned, use the Quick Mode section โ€” run core phases
10
+ only, skip presentation phases.
9
11
  related:
10
12
  - type: file
11
13
  path: .claude/skills/orient/phases/context.md
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: orient-quick
3
+ description: |
4
+ Quick session orientation โ€” core phases only, skip presentation.
5
+ Use when: "orient-quick", "quick orient", "/orient-quick".
6
+ ---
7
+
8
+ # /orient-quick
9
+
10
+ Load the `/orient` skill and run it in **Quick Mode** โ€” core phases
11
+ only, skip presentation phases. See the orient SKILL.md's Quick Mode
12
+ section for details.
@@ -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.