create-claude-rails 0.1.0

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.
Files changed (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -0
  3. package/bin/create-claude-rails.js +8 -0
  4. package/lib/cli.js +414 -0
  5. package/lib/copy.js +113 -0
  6. package/lib/db-setup.js +51 -0
  7. package/lib/metadata.js +41 -0
  8. package/lib/settings-merge.js +84 -0
  9. package/package.json +29 -0
  10. package/templates/EXTENSIONS.md +311 -0
  11. package/templates/README.md +485 -0
  12. package/templates/hooks/git-guardrails.sh +67 -0
  13. package/templates/hooks/skill-telemetry.sh +66 -0
  14. package/templates/hooks/skill-tool-telemetry.sh +54 -0
  15. package/templates/hooks/stop-hook.md +56 -0
  16. package/templates/memory/patterns/_pattern-template.md +119 -0
  17. package/templates/memory/patterns/pattern-intelligence-first.md +41 -0
  18. package/templates/rules/enforcement-pipeline.md +151 -0
  19. package/templates/scripts/finding-schema.json +94 -0
  20. package/templates/scripts/load-triage-history.js +151 -0
  21. package/templates/scripts/merge-findings.js +126 -0
  22. package/templates/scripts/pib-db-schema.sql +68 -0
  23. package/templates/scripts/pib-db.js +365 -0
  24. package/templates/scripts/triage-server.mjs +98 -0
  25. package/templates/scripts/triage-ui.html +536 -0
  26. package/templates/skills/audit/SKILL.md +269 -0
  27. package/templates/skills/audit/phases/finding-output.md +56 -0
  28. package/templates/skills/audit/phases/perspective-execution.md +63 -0
  29. package/templates/skills/audit/phases/perspective-selection.md +44 -0
  30. package/templates/skills/audit/phases/structural-checks.md +54 -0
  31. package/templates/skills/audit/phases/triage-history.md +45 -0
  32. package/templates/skills/debrief/SKILL.md +278 -0
  33. package/templates/skills/debrief/phases/auto-maintenance.md +48 -0
  34. package/templates/skills/debrief/phases/close-work.md +88 -0
  35. package/templates/skills/debrief/phases/health-checks.md +54 -0
  36. package/templates/skills/debrief/phases/inventory.md +40 -0
  37. package/templates/skills/debrief/phases/loose-ends.md +52 -0
  38. package/templates/skills/debrief/phases/record-lessons.md +67 -0
  39. package/templates/skills/debrief/phases/report.md +59 -0
  40. package/templates/skills/debrief/phases/update-state.md +48 -0
  41. package/templates/skills/execute/SKILL.md +293 -0
  42. package/templates/skills/execute/phases/commit-and-deploy.md +66 -0
  43. package/templates/skills/execute/phases/load-plan.md +49 -0
  44. package/templates/skills/execute/phases/perspectives.md +49 -0
  45. package/templates/skills/execute/phases/validators.md +50 -0
  46. package/templates/skills/execute/phases/verification-tools.md +67 -0
  47. package/templates/skills/investigate/SKILL.md +159 -0
  48. package/templates/skills/menu/SKILL.md +61 -0
  49. package/templates/skills/onboard/SKILL.md +301 -0
  50. package/templates/skills/onboard/phases/detect-state.md +70 -0
  51. package/templates/skills/onboard/phases/generate-context.md +81 -0
  52. package/templates/skills/onboard/phases/generate-session-loop.md +87 -0
  53. package/templates/skills/onboard/phases/interview.md +158 -0
  54. package/templates/skills/onboard/phases/modularity-menu.md +159 -0
  55. package/templates/skills/onboard/phases/summary.md +122 -0
  56. package/templates/skills/orient/SKILL.md +240 -0
  57. package/templates/skills/orient/phases/auto-maintenance.md +48 -0
  58. package/templates/skills/orient/phases/briefing.md +53 -0
  59. package/templates/skills/orient/phases/context.md +47 -0
  60. package/templates/skills/orient/phases/data-sync.md +35 -0
  61. package/templates/skills/orient/phases/health-checks.md +50 -0
  62. package/templates/skills/orient/phases/perspectives.md +46 -0
  63. package/templates/skills/orient/phases/work-scan.md +69 -0
  64. package/templates/skills/perspectives/_composition-patterns.md +240 -0
  65. package/templates/skills/perspectives/_context-template.md +152 -0
  66. package/templates/skills/perspectives/_eval-protocol.md +208 -0
  67. package/templates/skills/perspectives/_groups-template.yaml +49 -0
  68. package/templates/skills/perspectives/_lifecycle.md +93 -0
  69. package/templates/skills/perspectives/_prompt-guide.md +266 -0
  70. package/templates/skills/perspectives/accessibility/SKILL.md +177 -0
  71. package/templates/skills/perspectives/anti-confirmation/SKILL.md +170 -0
  72. package/templates/skills/perspectives/boundary-conditions/SKILL.md +261 -0
  73. package/templates/skills/perspectives/box-health/SKILL.md +338 -0
  74. package/templates/skills/perspectives/data-integrity/SKILL.md +152 -0
  75. package/templates/skills/perspectives/debugger/SKILL.md +218 -0
  76. package/templates/skills/perspectives/documentation/SKILL.md +166 -0
  77. package/templates/skills/perspectives/meta-process/SKILL.md +257 -0
  78. package/templates/skills/perspectives/mobile-responsiveness/SKILL.md +151 -0
  79. package/templates/skills/perspectives/organized-mind/SKILL.md +335 -0
  80. package/templates/skills/perspectives/output-contract.md +148 -0
  81. package/templates/skills/perspectives/performance/SKILL.md +165 -0
  82. package/templates/skills/perspectives/process/SKILL.md +235 -0
  83. package/templates/skills/perspectives/qa/SKILL.md +201 -0
  84. package/templates/skills/perspectives/security/SKILL.md +176 -0
  85. package/templates/skills/perspectives/technical-debt/SKILL.md +112 -0
  86. package/templates/skills/plan/SKILL.md +356 -0
  87. package/templates/skills/plan/phases/calibration-examples.md +75 -0
  88. package/templates/skills/plan/phases/completeness-check.md +44 -0
  89. package/templates/skills/plan/phases/composition-check.md +36 -0
  90. package/templates/skills/plan/phases/overlap-check.md +62 -0
  91. package/templates/skills/plan/phases/perspective-critique.md +47 -0
  92. package/templates/skills/plan/phases/plan-template.md +69 -0
  93. package/templates/skills/plan/phases/present.md +60 -0
  94. package/templates/skills/plan/phases/research.md +43 -0
  95. package/templates/skills/plan/phases/work-tracker.md +95 -0
  96. package/templates/skills/pulse/SKILL.md +242 -0
  97. package/templates/skills/pulse/phases/auto-fix-scope.md +40 -0
  98. package/templates/skills/pulse/phases/checks.md +58 -0
  99. package/templates/skills/pulse/phases/output.md +54 -0
  100. package/templates/skills/seed/SKILL.md +259 -0
  101. package/templates/skills/seed/phases/build-perspective.md +93 -0
  102. package/templates/skills/seed/phases/evaluate-existing.md +61 -0
  103. package/templates/skills/seed/phases/maintain.md +92 -0
  104. package/templates/skills/seed/phases/scan-signals.md +82 -0
  105. package/templates/skills/triage-audit/SKILL.md +251 -0
  106. package/templates/skills/triage-audit/phases/apply-verdicts.md +90 -0
  107. package/templates/skills/triage-audit/phases/load-findings.md +38 -0
  108. package/templates/skills/triage-audit/phases/triage-ui.md +66 -0
  109. package/templates/skills/upgrade/SKILL.md +265 -0
  110. package/templates/skills/upgrade/phases/apply.md +86 -0
  111. package/templates/skills/upgrade/phases/detect-current.md +82 -0
  112. package/templates/skills/upgrade/phases/diff-upstream.md +72 -0
  113. package/templates/skills/upgrade/phases/merge.md +97 -0
  114. package/templates/skills/validate/SKILL.md +116 -0
  115. package/templates/skills/validate/phases/validators.md +53 -0
@@ -0,0 +1,97 @@
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.
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: validate
3
+ description: |
4
+ Run structural validation checks and present a unified summary. The
5
+ orchestration pattern is generic; the specific validators are project-defined
6
+ in phases/validators.md. Use when: "validate", "run checks", "/validate",
7
+ or after any structural changes.
8
+ related:
9
+ - type: file
10
+ path: .claude/skills/validate/phases/validators.md
11
+ role: "Project-specific validator definitions"
12
+ - type: file
13
+ path: .claude/skills/perspectives/_context.md
14
+ role: "Scan scopes for validation targets"
15
+ ---
16
+
17
+ # /validate — Run All Validation Checks
18
+
19
+ ## Purpose
20
+
21
+ Run every configured validator and report results in a unified summary.
22
+ Zero errors is the standard.
23
+
24
+ This is a **skeleton skill** using the `phases/` directory pattern. The
25
+ orchestration (run → collect → report) is generic. Your project defines
26
+ which validators to run in `phases/validators.md`.
27
+
28
+ ### Phase File Protocol
29
+
30
+ Phase files have three states:
31
+
32
+ | State | Meaning |
33
+ |-------|---------|
34
+ | Absent or empty | Use this skeleton's **default behavior** for the phase |
35
+ | Contains only `skip: true` | **Explicitly opted out** — skip this phase entirely |
36
+ | Contains content | **Custom behavior** — use the file's content instead |
37
+
38
+ ## Workflow
39
+
40
+ ### 1. Read Validators
41
+
42
+ Read `phases/validators.md` for the list of project-specific checks.
43
+ Each validator has a name, command, and description of what it catches.
44
+
45
+ If `phases/validators.md` is empty or missing, report that no validators
46
+ are configured and suggest the user define some.
47
+
48
+ ### 2. Run Each Validator
49
+
50
+ Execute each validator command in sequence. For each:
51
+ - Run the command
52
+ - Capture stdout/stderr and exit code
53
+ - Record pass (exit 0) or fail (non-zero) with output
54
+
55
+ If a validator fails, continue running the rest — don't stop at the
56
+ first failure. The point is a complete picture.
57
+
58
+ ### 3. Report
59
+
60
+ Present a unified summary:
61
+
62
+ ```
63
+ ## Validation Results
64
+
65
+ | Check | Status | Details |
66
+ |-------|--------|---------|
67
+ | {name} | PASS/FAIL | {error count or "clean"} |
68
+ | ... | ... | ... |
69
+
70
+ ### Errors
71
+ {For each failed check, list the specific errors}
72
+ ```
73
+
74
+ If errors found:
75
+ - For quick fixes (obvious typo, missing tag): propose the fix
76
+ - For complex issues: suggest creating a plan via /plan
77
+ - Never silently skip errors
78
+
79
+ ### 4. Terminal State
80
+
81
+ - All pass → ready to commit and deploy
82
+ - Any fail → fix errors and re-validate
83
+
84
+ ## Extending
85
+
86
+ To add a new validator:
87
+ 1. Add an entry to `phases/validators.md`
88
+ 2. Ensure the script/command exists and returns exit 0 on success
89
+ 3. Run `/validate` to confirm it works
90
+
91
+ To skip a validator temporarily: comment it out in `phases/validators.md`.
92
+
93
+ To add a phase the skeleton doesn't define: create a new file in `phases/`
94
+ (e.g., `phases/pre-validate.md` for setup steps). Claude reads whatever
95
+ phase files exist at runtime.
96
+
97
+ ## Calibration
98
+
99
+ **Core failure this targets:** Committing or deploying code that has
100
+ structural problems (broken references, type errors, lint violations)
101
+ because checks weren't run or results weren't reviewed.
102
+
103
+ ### Without Skill (Bad)
104
+
105
+ Developer makes changes across several files, commits, and deploys.
106
+ The deploy fails because of a type error that local checking would have
107
+ caught. Or worse: the deploy succeeds but a broken cross-reference
108
+ causes a runtime error that isn't discovered for days.
109
+
110
+ ### With Skill (Good)
111
+
112
+ Developer runs `/validate` after changes. The unified summary shows
113
+ one type error and one structural issue. Both are fixed before commit.
114
+ The deploy succeeds cleanly. The structural issue would have caused a
115
+ subtle bug that wouldn't have surfaced until a user hit a specific
116
+ code path.
@@ -0,0 +1,53 @@
1
+ # Validators
2
+
3
+ Define your project-specific validation checks here. Each validator is
4
+ a named check with a command to run. The /validate skill reads this file
5
+ and executes each check in sequence.
6
+
7
+ ## Format
8
+
9
+ For each validator, provide:
10
+ - **Name** — short label for the summary table
11
+ - **Command** — shell command that returns exit 0 on success, non-zero on failure
12
+ - **What it catches** — brief description of what this validator detects
13
+
14
+ ## Example Validators
15
+
16
+ Uncomment and adapt these for your project:
17
+
18
+ <!--
19
+ ### Type Check
20
+ ```bash
21
+ cd your-app-dir && npx tsc --noEmit
22
+ ```
23
+ Catches type errors before they reach production.
24
+
25
+ ### Lint
26
+ ```bash
27
+ cd your-app-dir && npx eslint src/
28
+ ```
29
+ Catches style violations and common code quality issues.
30
+
31
+ ### Production Build
32
+ ```bash
33
+ cd your-app-dir && npx vite build
34
+ ```
35
+ Catches what the type checker misses: bare catch blocks, runtime-only
36
+ errors, bundle resolution failures. A type check pass + build fail =
37
+ broken deploy.
38
+
39
+ ### Structural Validation
40
+ ```bash
41
+ ./scripts/validate-structure.sh
42
+ ```
43
+ Project-specific structural checks (e.g., required files exist, cross-references
44
+ are valid, configuration is consistent). Write these scripts for your
45
+ project's invariants.
46
+
47
+ ### Memory/Docs Validation
48
+ ```bash
49
+ ./scripts/validate-docs.sh
50
+ ```
51
+ Checks that documentation references (memory index, CLAUDE.md links) point
52
+ to files that actually exist.
53
+ -->