一键导入
repoarchitect
// Repository organization expert — structure, audit, and refactor via 8 framework archetypes. USE WHEN creating a new project, auditing repo structure, or planning refactors.
// Repository organization expert — structure, audit, and refactor via 8 framework archetypes. USE WHEN creating a new project, auditing repo structure, or planning refactors.
Analyze Stitch projects and synthesize a semantic design system into DESIGN.md files
Transforms vague UI ideas into polished, Stitch-optimized prompts. Enhances specificity, adds UI/UX keywords, injects design system context, and structures output for better generation results.
Converts Stitch designs into modular Vite and React components using system-level networking and AST-based validation.
Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays
Unified entry point for Stitch design work. Handles prompt enhancement (UI/UX keywords, atmosphere), design system synthesis (.stitch/DESIGN.md), and high-fidelity screen generation/editing via Stitch MCP.
Teaches agents to iteratively build websites using Stitch with an autonomous baton-passing loop pattern
| name | RepoArchitect |
| description | Repository organization expert — structure, audit, and refactor via 8 framework archetypes. USE WHEN creating a new project, auditing repo structure, or planning refactors. |
| category | development |
| context | fork |
| hooks | {"SessionStart":[{"hooks":[{"type":"command","command":"${PAI_DIR}/hooks/SkillActivationNotify.hook.ts --skill RepoArchitect","once":true}]}],"PostToolUse":[{"matcher":"Write|Bash","hooks":[{"type":"command","command":"${PAI_DIR}/skills/RepoArchitect/Hooks/StructureValidator.hook.ts","async":true}]}],"SubagentStop":[{"hooks":[{"type":"command","command":"${PAI_DIR}/skills/RepoArchitect/Hooks/RefactorVerifier.hook.ts","async":true}]}]} |
Before executing, check for user customizations at:
~/.claude/skills/CORE/USER/SKILLCUSTOMIZATIONS/RepoArchitect/
If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.
When executing a workflow, do BOTH:
Send voice notification:
curl -s -X POST http://localhost:8888/notify \
-H "Content-Type: application/json" \
-d '{"message": "Running the WORKFLOWNAME workflow in the RepoArchitect skill to ACTION"}' \
> /dev/null 2>&1 &
Output text notification:
Running the **WorkflowName** workflow in the **RepoArchitect** skill to ACTION...
Full documentation: ~/.claude/skills/CORE/SYSTEM/THENOTIFICATIONSYSTEM.md
Repository organization expert — structure, audit, and refactor via 8 framework archetypes.
Encodes the Repo Architect blueprint: 8 framework archetypes, structured intake, health checks, CI templates, and move map migration planning. Ensures every repo gets intentional structure, not ad-hoc folder creation.
RepoArchitect adapts its behavior based on which AI agent is running it. This prevents circular delegation (e.g., Codex trying to delegate to itself) and optimizes execution paths.
Detection tool: Tools/detect-agent.ts — run via bun run ~/.claude/skills/RepoArchitect/Tools/detect-agent.ts
Detected agents and their capabilities:
| Agent | Marker | Can Delegate to Codex | Execution Strategy |
|---|---|---|---|
| Claude Code | CLAUDECODE=1 | Yes | Delegate refactors to Codex CLI |
| Codex CLI | CODEX_SANDBOX / CODEX_HOME | No (circular) | Execute moves directly |
| Gemini CLI | GEMINI_CLI_* vars | Yes | Delegate or execute directly |
| OpenClaw | OPENCLAW_HOME | Yes | Delegate or execute directly |
| Unknown | No markers | No | Manual plan export or direct execution |
When to detect: At the start of ExecuteRefactor and RefactorPlan workflows. NewProject and AuditRepo don't need agent detection (no delegation involved).
How workflows adapt:
codex exec (which would be circular). If running inside Claude Code, delegates to Codex as designed.These override all other defaults when applicable.
src/modules/<capability>/.index.ts).@/modules/<capability>.internal/providers/.~/.claude/PAI/USER/Plans/2026-02-26-module-first-decisions.md Appendix A.orgId is the canonical tenant identifier — never provider-specific IDs in public types.getAuthSession, requireAuth, requireOrg, requireOnboardedOrg.src/modules/offices/ backed by DB, keyed on orgId.src/actions/<capability>/) call one orchestrator each.src/modules/<capability>/
index.ts # Contract + re-exports (3-7 max)
orchestrators/ # One function per use case (verbNoun naming)
createClaim.ts
verifyClaim.ts
internal/
types/ # Internal + public IO types
public.ts # Exported via index.ts
providers/ # Optional — SDK/vendor adapters
clerk/
stripe/
repo.ts # Data access (ORM calls)
domain.ts # Pure business rules
Every index.ts MUST have this header:
/**
* Module: <capability>
* Purpose: <what this capability owns>
*
* Public API:
* - orchestratorA(input): output
* - orchestratorB(input): output
*
* Exported IO Types:
* - InputType, OutputType
*
* Side Effects:
* - DB writes, cookies, network calls
*
* Error Behavior:
* - typed result union | thrown errors policy
*/
src/actions/ ConventionServer Actions live at src/actions/<capability>/<useCase>.action.ts. Each action is a thin wrapper calling one module orchestrator. Actions are NOT modules — they're wiring.
When app uses Postgres + optional realtime:
src/modules/
db/ # System of record
index.ts
internal/
providers/
supabase/ # Or neon/
drizzle/ # ORM
convex/ # Optional, DB features only
realtime/ # Optional — incremental updates
index.ts
internal/
providers/
convex/ # Or pusher, etc.
activity/ # Canonical event log (Postgres-backed)
index.ts
orchestrators/
analytics/ # Dashboard metrics (Postgres-backed)
index.ts
orchestrators/
Rule: Dashboard initial state from Postgres modules. Realtime layers provide incremental updates only.
Route to the appropriate workflow based on the request.
When executing a workflow, output this notification directly:
Running the **WorkflowName** workflow in the **RepoArchitect** skill to ACTION...
Workflows/NewProject.md
Workflows/AuditRepo.md
src/modules/ exists. See HealthChecks.md.Workflows/RefactorPlan.md
Workflows/ExecuteRefactor.md
| Product Type | Also Activate |
|---|---|
| SaaS / web app with user accounts | SaaSStandards — for auth, onboarding, route guards |
When the product type is SaaS or a web application with user accounts, note to the user that SaaSStandards should be activated for authentication and onboarding patterns. RepoArchitect handles structure; SaaSStandards handles substance.
When product type is SaaS with multi-tenancy:
src/modules/auth/ and src/modules/offices/ are in the canonical treeorgId is used as tenant FK in all schema examplesno-restricted-imports in CI guardrails output| File | Source Blueprint | Purpose |
|---|---|---|
Frameworks.md | 02_frameworks-cheatsheet | 8 framework archetypes + selection heuristics |
OutputSpec.md | 03_output-spec | Required output sections A-G + quality criteria |
HealthChecks.md | 04_repo-health-checks | 5 check categories (including module boundary) + severity + JSON schema |
CiTemplates.md | 05_ci-templates | Hook strategies + GitHub Actions templates |
IntakeQuestions.md | 06_intake-prompt | AskUserQuestion-structured intake bank |
MoveMapSpec.md | 07_reformat-existing-repo | Move Map format + migration order + rollback |
Example 1: New project setup
User: "I need to set up a new TypeScript API project"
-> Invokes NewProject workflow
-> Runs intake questions, selects framework, generates A-G output
-> User receives canonical tree, CI config, and implementation steps
Example 2: Audit existing repo
User: "Check the health of my repo"
-> Invokes AuditRepo workflow
-> Scans structure, classifies framework, runs health checks
-> User receives score (e.g., 14/18) and prioritized fix list
Example 3: Plan a restructure
User: "My repo is messy, help me restructure it"
-> Invokes RefactorPlan workflow
-> Generates Move Map with phased migration plan
-> Offers Codex-powered execution or manual plan export