From repo-architect
Repository organization expert — structure, audit, and refactor via 8 framework archetypes. USE WHEN creating a new project, auditing repo structure, or planning refactors.
How this skill is triggered — by the user, by Claude, or both
Slash command
/repo-architect:repo-architectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Before executing, check for user customizations at:**
Before executing, check for user customizations at:
.claude/repo-architect.local.md
If this file exists, load and apply any preferences or overrides found there. These override default behavior. If the file does not exist, proceed with skill defaults.
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 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 |
| 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/.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/new-project.md
intake-questions.md, frameworks.md, output-spec.md, ci-templates.mdworkflows/audit-repo.md
frameworks.md, health-checks.mdsrc/modules/ exists. See health-checks.md.workflows/refactor-plan.md
move-map-spec.md, frameworks.md, health-checks.mdworkflows/execute-refactor.md
move-map-spec.md, tools/detect-agent.ts| File | Purpose |
|---|---|
frameworks.md | 8 framework archetypes + selection heuristics |
output-spec.md | Required output sections A-G + quality criteria |
health-checks.md | 6 check categories (including module boundary) + severity + JSON schema |
ci-templates.md | Hook strategies + GitHub Actions templates |
intake-questions.md | AskUserQuestion-structured intake bank |
move-map-spec.md | 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
Creates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.
npx claudepluginhub aojdevstudio/agentic-utilities --plugin repo-architect