feat: make init framework-agnostic with detection, vendor fetch, and constitution gating#21
Conversation
Replace the hardcoded Next.js gate with git-only upfront checks and stack-pack prerequisites from the manifest, applied on init install and pharn add. Use git-based fresh-check heuristics instead of Next-specific file layout rules. Co-authored-by: Cursor <cursoragent@cursor.com>
Add manifest-driven stack pack and technology detection, apply wizard rules in Default mode so hidden questions become skip, and show friendly labels in the detection note. Co-authored-by: Cursor <cursoragent@cursor.com>
Add an init step that records isMultiTenant and strips Multi-Tenant Isolation from CONSTITUTION.md when the project is not a multi-tenant SaaS, so non-SaaS installs are not blocked by an inapplicable principle. Co-authored-by: Cursor <cursoragent@cursor.com>
Prepare wizard option typing, manifest parsing, and a degit-compatible source allowlist for upcoming vendor official-skill installs. Co-authored-by: Cursor <cursoragent@cursor.com>
Wire wizard option sources through consent and install: skills with a declared degit source are fetched into .claude/skills/ after the pharn-oss install; failures are non-fatal and unsourced skills stay manual. Co-authored-by: Cursor <cursoragent@cursor.com>
Update init/getting-started/pharn-config docs and roadmap to reflect that consented vendor skills are fetched on install, with manual install fallback where no source is known. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (41)
📝 WalkthroughWalkthroughAdds multi-tenant SaaS support ( ChangesMulti-tenant init, manifest-driven prerequisites, auto vendor fetching, and wizard detection
Sequence DiagramssequenceDiagram
participant User
participant runInit
participant runGitPrereq
participant runDetect
participant runMultiTenantSelect
participant assertPrerequisites
participant fetchAndInstall
participant fetchVendorSkills
participant materializeCore
User->>runInit: pharn init
runInit->>runGitPrereq: check .git
runGitPrereq-->>runInit: ok or exit(1)
runInit->>runDetect: read package.json, pre-fill wizard
runDetect-->>runInit: detectedAnswers, detectedStackPack
Note over runInit: wizard runs (stack pack, tech choices, vendor consent)
runInit->>runMultiTenantSelect: prompt isMultiTenant (default: true)
runMultiTenantSelect-->>runInit: boolean
Note over runInit: user confirms install
runInit->>assertPrerequisites: resolved modules
assertPrerequisites-->>runInit: ok or exit(1) with reasons
runInit->>fetchAndInstall: isMultiTenant, constitution, wizardSkills
fetchAndInstall->>materializeCore: isMultiTenant flag
materializeCore-->>fetchAndInstall: CONSTITUTION.md (Principle 2 stripped when !isMultiTenant)
fetchAndInstall-->>runInit: InstallResult
runInit->>fetchVendorSkills: claudeDir, VendorSkill[]
fetchVendorSkills-->>runInit: VendorFetchResult (non-fatal)
runInit-->>User: outro with fetched skill count
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
pharn initno longer hard-requires Next.js up front; git is the only universal gate, and stack-specific package checks (e.g.next) run only when the resolved install set declares them viamodule.jsonprerequisites.CONSTITUTION.mdwhen the project is not multi-tenant SaaS.sourceare fetched into.claude/skills/during install (and onpharn addwhen applicable); unknown sources degrade to manual install, and fetch failures are non-fatal.Test plan
npm test— new/updated coverage for prereqs, detect, constitution, vendor-fetch, multitenant-select, manifest prerequisites, install flowpharn initon a non-Next project (core-only) — should pass git check and complete without requiringnextpharn initon a Next.js project with Prisma/Supabase inpackage.json— verify detection note and pre-filled wizard answersCONSTITUTION.mdsource(e.g. Supabase) — confirm skill lands in.claude/skills/and manual/failed vendors are reported gracefullyMade with Cursor
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes