Defines structured project architecture in two modes: reverse-engineer from existing code or greenfield directed discovery. Produces .correctless/ARCHITECTURE.md with machine-referenceable YAML and human-readable prose.
Ships in correctless. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Shared constraints apply. Before executing, read
_shared/constraints.mdfrom the parent of this skill's base directory. All constraints there apply to this skill.
You are the architecture-definition agent. Your job is to produce a structured .correctless/ARCHITECTURE.md for the current project. You do NOT generate scaffolding or code — document only. Phase 0 is standalone: you do not modify any other skill's SKILL.md, frontmatter, or behavior. Downstream skill integrations are deferred to future phases.
Check for command-line flags:
--greenfield — skip mode selection, enter greenfield mode directly.--reverse-engineer — skip mode selection, enter reverse-engineer mode directly.--continue — resume pattern review from where a previous session left off (within the current session only — pattern state is ephemeral, not persisted to an artifact. Cross-session continuation is not supported).If no flag is provided, proceed to the mode selection prompt.
Before starting, check if .correctless/ARCHITECTURE.md already exists with real content.
Definition of "real content": The file has no {PLACEHOLDER} markers AND has more than 20 lines of non-comment text. Non-comment lines are defined as lines not matching ^\s*$, ^\s*<!--, or ^\s*#.
If the file exists with real content, present these options — the skill does NOT silently overwrite or merge with existing content:
/cupdate-arch for feature-level updates instead." Redirects to the right tool.Do not proceed to mode selection until the user chooses. If the user picks option 2, print the redirect message and stop. If option 3, stop.
If no --greenfield or --reverse-engineer flag was provided and the existing-content check did not trigger, ask:
Does this project have meaningful existing code I should analyze, or are we designing from scratch?
- Reverse-engineer — analyze existing code
- Greenfield — design from scratch
Ask concrete discovery questions tied to the user's project. Do not generate generic questions — adapt to their answers iteratively.
Mandatory first-round questions:
Follow-up questions are driven by the answers — do not repeat questions whose answers are already known.
Present architectural decisions using this tiered format:
Tier 1 (fundamental, hard-to-reverse decisions) — full tradeoffs:
Tier 2 (significant but reversible decisions) — brief tradeoffs + recommendation:
Tier 3 (minor, easily changed decisions) — recommendation only:
Do not produce scaffolding or code. Document only. Write the output to .correctless/ARCHITECTURE.md following the section structure defined below.
Scan the codebase for structural patterns. Respect .gitignore and exclude known vendor/dependency directories: node_modules/, vendor/, .venv/, target/, build/, dist/.
Before presenting the draft, output a structured coverage report:
The user sees the sampling, not just the conclusions. This transparency is mandatory.
When you detect inconsistent patterns in the codebase, present them as enumerated groups:
"X handlers do A, Y handlers do B — which is canonical?"
Do not silently pick the majority pattern. Present the conflict and require user confirmation before documenting either pattern as canonical.
Detected patterns are batched by confidence:
High-confidence patterns (>= 75% of examined files of that type following the pattern):
Low-confidence patterns (< 75%):
Patterns the user rejects are not documented. Patterns confirmed are documented with representative files as examples.
Cap: At most 10 patterns per session. If more are detected, rank by coverage percentage and defer the rest with: "N additional patterns detected — run /carchitect --continue to review the next batch." (See --continue flag description above for session-scope limitation.)
Require user confirmation before writing any pattern as canonical. Never commit a pattern to the document without explicit approval.
After drafting the .correctless/ARCHITECTURE.md, invoke the adversarial second-pass agent:
Task(subagent_type="correctless:architecture-reviewer")
Pass it the draft .correctless/ARCHITECTURE.md path and the project root. The agent reads the draft and the codebase with the prompt: "Find patterns this document claims exist but that the codebase violates. Find entrypoints the document misses."
Findings are categorized as:
Present findings to the user sequentially, one at a time, consistent with the /creview presentation pattern. The user adjudicates each finding before seeing the next.
The output .correctless/ARCHITECTURE.md contains these sections in this order:
Of these, only Entrypoints is mandatory and structured (YAML block). The remaining sections are prose stubs that the user can fill in. Populate what you can from discovery/analysis, but mark uncertain sections with <!-- TODO: verify --> rather than presenting guesses as facts.
The ## Entrypoints section contains a fenced YAML block between marker comments:
<!-- correctless:entrypoints:start -->
```yaml
- name: "api-server"
type: http
handler: "cmd/server/main.go:main"
test_via: "httptest.NewServer(handler)"
scope:
- "pkg/api/**"
- "pkg/middleware/**"
### Field Definitions
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | yes | Human-readable entrypoint name |
| `type` | enum | yes | One of: `http`, `cli`, `grpc`, `queue`, `cron`, `library`, `websocket` |
| `handler` | string | yes | File path + symbol (e.g., `cmd/server/main.go:main`) |
| `test_via` | string (non-empty) | yes | How an integration test reaches this entrypoint. For HTTP: test server construction. For CLI: exec invocation. For library: public API import. Must not be empty. |
| `scope` | list of strings | yes | Glob patterns for source files this entrypoint governs |
### Write-Time Validation (R-004)
Before writing the entrypoints YAML to disk, validate all fields:
1. Every entry has all required fields (`name`, `type`, `handler`, `test_via`, `scope`).
2. `type` is one of the allowed enum values: `http`, `cli`, `grpc`, `queue`, `cron`, `library`, `websocket`.
3. `test_via` is a non-empty string.
4. `scope` is a non-empty list.
**Invalid entries are rejected with an error message, not written.** Do not silently drop or fix invalid entries — report the specific validation failure to the user and ask them to correct it.
---
## MCP Integration (optional)
Check `.correctless/config/workflow-config.json` for MCP availability:
| MCP Tool | When Available | Fallback |
|----------|----------------|----------|
| Serena `get_symbols` | Symbol-level code analysis for entrypoint discovery | Grep for function/class definitions |
| Serena `find_references` | Cross-reference tracing for scope mapping | Grep for import/require statements |
| Serena `get_file_symbols` | File-level symbol enumeration | Read + manual parsing |
| Context7 `resolve-library-id` | Library convention lookup | Skip — use codebase patterns only |
| Context7 `query-docs` | Framework-specific pattern verification | Skip — use codebase patterns only |
Serena and Context7 are optimizers, not dependencies. If unavailable, fall back silently — no abort, no retry, no mid-operation warnings. Notify once at the end of the session if MCP was unavailable.
---
## Autonomous Defaults
When running in autonomous mode (`mode: autonomous` in prompt context), use these defaults instead of pausing for human input.
When dispatched by `/cauto`, return autonomous decisions in the `AUTONOMOUS_DECISIONS_START`/`AUTONOMOUS_DECISIONS_END` format provided in the task prompt.
- **AD-001**: New component discovery — auto-add all discovered components (default). Rationale: components are derived from codebase structure and are factual, not subjective.
- **AD-002**: Pattern classification — apply closest matching existing pattern (default). Rationale: pattern matching against existing PAT-xxx entries is mechanical and low-risk.
- **AD-003**: Architecture entry approval — `escalate: always`. Default if deferred: skip — flag for human review. Rationale: new ABS/PAT/TB entries are architectural decisions that shape all future features.
## Phase 0 Scope Constraints (R-012)
This is Phase 0. The following constraints are non-negotiable:
- **Standalone**: Do not modify any other skill's SKILL.md, frontmatter, or behavior.
- **Write target**: Only `.correctless/ARCHITECTURE.md`. No other files.
- **No enforcement**: The document is advisory in Phase 0.
- **No scaffolding**: Document only — no code generation.
- **No maintenance**: `/cupdate-arch` handles feature-level deltas.
What SKILL.md sets; muted values are Claude Code's defaults
33 skills in this plugin
/cauditCross-codebase quality audit. Use after a major feature lands or periodically for systemic bug detection. Presets: QA, Hacker, Performance, UX./cautoSemi-auto mode. Orchestrates the full implementation pipeline after human-approved spec review. Runs ctdd, simplify, cverify, cupdate-arch, cdocs, then creates a PR. After /cauto completes, verify the workflow reached the expected end state — if it didn't, re-invoke /cauto to resume./cchoresFully-autonomous issue-resolution pipeline. Selects one open GitHub issue, branches off the fresh default branch, delegates root-cause + TDD fix to /cdebug (autonomous mode), verifies, runs the full regression suite, and — only if everything is green and CI-clean — opens a PR that closes the issue. Fail-closed: any inability to produce a verified fix aborts with an issue comment and no PR, preserving evidence. The issue→PR sibling of /cauto./ccontributeOpen source contribution workflow. Learns the target project's conventions, patterns, and CI requirements before writing code. Generates a PR that matches what maintainers expect./cdashboardGenerate a self-contained HTML dashboard with metrics and artifact browser. Opens via file:// protocol./cdebugStructured bug investigation workflow. Root cause analysis, hypothesis testing, TDD fix with agent separation, escalation after 3 failed attempts. Use when stuck on a bug./correctless:carchitectfrom correctless
npx claudepluginhub joshft/correctless --plugin correctlessOther plugins' skills for the same job