/gloria:setting-up-a-gloria-projectfrom gloria
Use when setting up a new project with Gloria - a new or empty repo, or one whose CLAUDE.md or AGENTS.md is missing or thin, where the user wants Gloria too ("set up this project with gloria", "start a new gloria project") - surveys the repo, interviews the user, and authors CLAUDE.md plus an AGENTS.md tuned for Codex CLI, OpenCode, and Cursor, covering project purpose, tech stack, commands, TDD rules, and development practices, then runs every Gloria setup step (wiring, dependency sync, coding standards, skills). For a plain setup without Gloria, use `project-foundations:setting-up-a-project`. Distinct from `setting-up-gloria`, which wires Gloria into a project that's already set up.
Ships in gloria. 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.
Read when SKILL.md points to them.
Author the instruction files that define a project's purpose, commands, and development practices before writing code: CLAUDE.md for Claude Code, AGENTS.md for Codex CLI, OpenCode, and Cursor, plus the rule files both of them lean on. Then run every Gloria setup step on the project, so it leaves with Gloria fully configured.
Core principle: A well-configured project prevents rework and ensures consistency. Establishing guardrails upfront helps Claude Code work reliably, produce high-quality code, and avoid doom loops where code is written, broken, and rewritten repeatedly.
When NOT to use: an established repo that already has a mature CLAUDE.md - review and refine the existing file instead. If the repo is already set up and only needs Gloria wired in, use the setting-up-gloria skill directly instead of running this full interview.
Bundled files: TDD.rules.md, git-commit-rules.md, and CLAUDE-specific-fuckups.md ship in this skill's directory. If one is missing, stop and tell the user the plugin install looks broken - do not fetch it from anywhere else or reconstruct it from memory.
Track each numbered step below as a todo (TodoWrite in Claude Code, your plan or todo tool elsewhere).
Commit after each section the user confirms - one commit per section, throughout every step below.
Read what the repo already says about itself before asking anything. Never ask a question the files answer.
ls -a # layout, and whether CLAUDE.md / AGENTS.md / .claude/ exist
cat README.md 2>/dev/null
Detect the stack from manifests and lockfiles:
| Evidence | What it tells you |
|---|---|
package.json + pnpm-lock.yaml / package-lock.json / yarn.lock / bun.lockb | Language, package manager, scripts, test and lint tooling |
pyproject.toml / uv.lock / requirements.txt | Python packaging and tool config |
go.mod | Go module path and version |
Cargo.toml | Rust crate and workspace layout |
Makefile / Taskfile.yml / justfile | The commands people actually run |
.github/workflows/*.yml | The commands CI actually runs - the most reliable source |
Dockerfile / fly.toml / wrangler.jsonc / serverless.yml | Deployment target |
Then confirm rather than interrogate: "This looks like a TypeScript CLI on pnpm with Vitest and ESLint - right?" Ask only about what the repo cannot tell you.
Handle what you find:
Also ask which agents will work in this repo (Claude Code, Codex CLI, OpenCode, Cursor). Step 7 writes AGENTS.md for the latter three; write it by default unless the user says Claude Code is the only agent that will ever touch the project.
Ask questions to determine:
Document the answers in CLAUDE.md under a ## Project Overview section:
## Project Overview
**Pantry Pal**: A CLI tool that suggests weeknight dinner recipes from ingredients already in the user's pantry.
### Problem
Home cooks waste food and time deciding what to make. Existing recipe apps assume a shopping trip rather than working with what is already on hand.
### Approach
A local ingredient inventory is matched against a recipe index. The tool ranks recipes by pantry coverage and prints the top matches along with a shopping list for any missing ingredients.
Ask about each area the survey did not already answer. Suggest defaults based on the language and runtime.
Defaults by language:
| Language | Package Manager | Testing | Linting | Build |
|---|---|---|---|---|
| TypeScript/Node.js | pnpm | Vitest | ESLint + Prettier | esbuild or tsc |
| Python | uv | pytest | Ruff | - |
| Go | go modules | go test | golangci-lint | go build |
| Rust | cargo | cargo test | clippy | cargo build |
Adjust suggestions based on deployment target and project needs. Document the result under ## Tech Stack:
## Tech Stack
- **Language**: [Language and version]
- **Runtime**: [Runtime environment]
- **Package Manager**: [Package manager]
- **Testing**: [Testing framework]
- **Linting**: [Linter and formatter]
- **Build**: [Build tool]
- **Key Libraries**: [List of essential libraries]
The Commands section is the most-used part of a CLAUDE.md - Claude reads it before every test run, build, and lint. Get exact, runnable strings, copied verbatim from package.json scripts, the Makefile, or the CI workflow when those exist.
## Commands
| Task | Command |
| ------------ | ---------------------- |
| Install | `pnpm install` |
| Test (once) | `pnpm test` |
| Test (watch) | `pnpm test --watch` |
| Coverage | `pnpm test --coverage` |
| Build | `pnpm build` |
| Lint | `pnpm lint` |
| Format | `pnpm format` |
| Typecheck | `pnpm typecheck` |
| Run locally | `pnpm dev` |
Omit rows that do not apply. These values fill the placeholders in TDD.rules.md (step 5) and the permission allowlist (step 7), so get them right here.
TDD is non-negotiable for all projects set up with this skill.
Confirm the coverage thresholds with the user. Defaults: 90% lines, functions, and statements; 85% branches. Record whatever they choose.
Ask how test files are named and located in this stack (for example src/example.ts → src/__tests__/example.test.ts, or Go's example_test.go beside the source).
Copy the bundled TDD.rules.md (in this skill's directory) to the project root as TDD.rules.md. Do not paste it into CLAUDE.md - it is about 150 lines, and CLAUDE.md loads into every session.
Replace every {{PLACEHOLDER}} in the copy:
| Placeholder | Value |
|---|---|
{{TEST_COMMAND}} | Test (once), from step 4 |
{{TEST_WATCH_COMMAND}} | Test (watch), from step 4 |
{{COVERAGE_COMMAND}} | Coverage, from step 4 |
{{BUILD_COMMAND}} | Build, from step 4 |
{{LINT_COMMAND}} | Lint, from step 4 |
{{COVERAGE_THRESHOLD}} | Lines/functions/statements threshold |
{{BRANCH_COVERAGE_THRESHOLD}} | Branch threshold |
{{TEST_FILE_CONVENTION}} | The naming and location rule, with two or three concrete examples |
Delete the **This file is a template.** note at the top of the copy - its two lines name placeholders themselves, so the check below can never pass while they remain. Keep the "Referenced by CLAUDE.md and AGENTS.md" note under it.
Reference it from CLAUDE.md under ## Development Practices:
### Test-Driven Development
TDD is mandatory. **Read `TDD.rules.md` before writing any code.**
@TDD.rules.md
The @ line is a Claude Code auto-import. The sentence above it is what makes the rules reachable in every other agent, which read the file as plain text - never rely on @ alone.
If the bundled TDD.rules.md is missing, stop and tell the user the plugin install looks broken - do not fetch it from anywhere else or reconstruct it from memory.
Verify no placeholder survives: grep -n '{{' TDD.rules.md must return nothing.
This rule is non-negotiable. Read the bundled git-commit-rules.md file (in this skill's directory) and copy it verbatim into CLAUDE.md, and into AGENTS.md in step 7. It is short, and it is the single home for commit discipline - TDD.rules.md points here rather than restating it. If the bundled git-commit-rules.md is missing, stop and tell the user the plugin install looks broken.
Copy the bundled CLAUDE-specific-fuckups.md (in this skill's directory) to the project root verbatim - it has no placeholders to fill in.
Reference it from CLAUDE.md under ## Development Practices:
### Known Failure Patterns
Claude Code repeats certain mistakes because its training data lags the tools it uses. **Read `CLAUDE-specific-fuckups.md` before work that touches any of its entries.**
@CLAUDE-specific-fuckups.md
This file is Claude Code-specific - do not reference it from AGENTS.md. The other agents don't share Claude's training data, so the entries would be dead text there.
If the bundled CLAUDE-specific-fuckups.md is missing, stop and tell the user the plugin install looks broken - do not fetch it from anywhere else or reconstruct it from memory.
Ask about each, and offer the default:
feature/, fix/, chore/)Document the answers under ## Development Practices.
If the project uses, or will use, GitHub Actions for CI/CD, apply this rule whenever authoring or editing workflow files:
Never use an action pinned to the deprecated Node 20 runtime. GitHub Actions is moving off Node 20 in favor of Node 24. When adding or updating a uses: step, always pick the action's latest major version rather than an older major still pinned to Node 20, and check the action's release notes/changelog if unsure whether it has moved to the Node 24 runtime.
Document this rule in CLAUDE.md under a ## CI/CD Practices section (only if the project uses GitHub Actions):
## CI/CD Practices
- Never use GitHub Actions pinned to the deprecated Node 20 runtime. Always use the latest major version of each action.
Three short sections that save an agent from guessing:
## Repository Layout
- `src/` - application code
- `src/__tests__/` - tests, mirroring `src/`
- `scripts/` - build and release tooling
## Environment
Copy `.env.example` to `.env` and fill in the values. Never commit `.env` or any
credential. Required variables: `DATABASE_URL`, `API_KEY`.
## Boundaries
Do not edit by hand:
- `dist/`, `*.generated.ts` - generated output; change the generator instead
- `pnpm-lock.yaml` - update via the package manager
Ask what is generated, vendored, or otherwise off-limits, and what secrets the project needs. Omit any section that has no content - an empty heading is worse than none.
Claude Code reads CLAUDE.md. Codex CLI, OpenCode, and Cursor read AGENTS.md. Write both.
Do not symlink them together. They describe the same project but they are not the same document: CLAUDE.md leans on auto-imports and Claude Code's tool names, and neither survives the trip to another agent.
How AGENTS.md differs:
| Concern | CLAUDE.md | AGENTS.md |
|---|---|---|
| Deep rule sets | @TDD.rules.md auto-import | A Required Reading list instructing the agent to open the files itself - nothing auto-loads |
| Non-negotiables | Carried by the imported rule files | Condensed inline at the top, so the critical rules are present even if the agent never opens another file |
| Todo tracking | TodoWrite by name | "your plan or todo tool" |
| Permissions | Points at .claude/settings.json | An inline rule: run the Commands table freely, ask before anything else |
| Shape | Terse; imports carry the weight | Flatter and self-contained |
Template:
# <Project Name> - Agent Instructions
Read this file before making any change. It applies to every agent working in this repo.
## Required Reading
These files are not loaded automatically. Open them yourself before writing code:
- `TDD.rules.md` - test-driven development rules. Mandatory, no exceptions.
- `VERIFICATION_PLAN.md` - how to prove a change actually works.
## Non-Negotiables
1. No production code without a failing test first. Full rules in `TDD.rules.md`.
2. Commit after every RED-GREEN-REFACTOR cycle. Never leave 30 minutes of work uncommitted.
3. A task is not done until tests pass, the build succeeds, and the linter is clean.
4. Run the commands in the Commands table freely. Ask first before anything that
installs software, writes outside the repo, or reaches the network.
5. Track multi-step work in your plan or todo tool as you go.
## Project Overview
## Tech Stack
## Commands
## Repository Layout
## Environment
## Development Practices
## CI/CD Practices
## Boundaries
## Maintaining This File
`CLAUDE.md` and `AGENTS.md` describe the same project. When a project fact changes -
a command, the stack, the layout, a boundary - update both in the same commit.
The sections from ## Project Overview down carry the same content as CLAUDE.md, written out in full rather than referenced. Write ## Development Practices inline here: the git and PR workflow from step 5, plus the commit rules, with no @ references anywhere in the file.
If a tool does not pick AGENTS.md up, check that tool's current documentation for its instruction-file path rather than guessing at one.
Offer to create .claude/settings.json with an allowlist for the commands from step 4, so routine work does not trigger a prompt on every run. Offer, do not impose - ask before writing.
{
"permissions": {
"allow": ["Bash(pnpm test:*)", "Bash(pnpm lint:*)", "Bash(pnpm build:*)"]
}
}
Only list read-only or build/test commands. Never allowlist anything destructive or anything that publishes.
This file is Claude Code-specific. The other three agents configure permissions their own way and their schemas move - do not invent a codex, opencode, or cursor config file. AGENTS.md rule 4 above covers them in prose instead.
Use the writing-verification-plans skill to create a verification plan. If it is unavailable, write VERIFICATION_PLAN.md covering the acceptance scenarios that prove the project works against real systems, with success criteria and a pass/fail log.
Link it from CLAUDE.md:
## Verification
Acceptance testing procedures: read `VERIFICATION_PLAN.md`.
@VERIFICATION_PLAN.md
In AGENTS.md it is already covered by the Required Reading list - no @ line there.
Documentation that does not run is worse than none. Before this step's commit:
grep -n '{{' CLAUDE.md AGENTS.md TDD.rules.md must return nothing.AGENTS.md carries no Claude Code-isms: grep -n '@\|TodoWrite\|\.claude/' AGENTS.md should return nothing but ordinary prose. An @TDD.rules.md line that leaked in is dead text in Codex CLI, OpenCode, and Cursor.AGENTS.md is a real file, not a symlink: test -L AGENTS.md && echo "symlink - replace it".elements-of-style:writing-clearly-and-concisely skill if available.CLAUDE.md and AGENTS.md are written and committed, so now wire the project fully into Gloria. Run every step below, in this order. Each step invokes an existing gloria skill, keeps that skill's consent gates, and commits its repo-side output before the next step starts. The phase's own steps are numbered 10.1-10.6, so they can't be confused with steps 1-9 above.
Track each phase step as a todo, alongside the todos from steps 1-9.
Check sign-in first. Call the gloria MCP tool get_info:
setting-up-gloria. It copies .gloria/USING-GLORIA.md, adds the Gloria section to CLAUDE.md and AGENTS.md, and resolves the project or registers it with register_project. Commit: chore: wire gloria into the instruction files.documenting-service-dependencies for a whole-repo pass, not a single-dependency touch-up. In its "Describe" step, propose a new description even when one already exists. Its consent rule decides whether the new one replaces it. The whole-repo pass regenerates PROJECT_EXPLAINER, plus PACKAGE_MAP for a monorepo, and pushes them with put_document.put_dependency for each dependency and put_document for each doc, then confirm with list_dependencies. Commit the four docs: docs: map service dependencies. 10.2 and 10.3 are one invocation, but track and report them separately.extracting-coding-standards. It runs deriving-agent-code-style and mapping-packages-for-coding-agents, registers the standard, rules, and snippets with per-item approval (register_standard, put_rule, put_snippet), and renders the stamped Coding Standards section into both CLAUDE.md and AGENTS.md. Commit: docs: add the coding standards section.checking-coding-standards for a full audit against the standards 10.4 registered. It reports with report_check_run even when it finds nothing. Record the drift run id it returns. If 10.4 registered no standard (nothing to extract, or its approval was declined), skip 10.5 and record why: there is nothing to audit and no drift run. The audit only reads code, so it has nothing to commit.identifying-skills-for-a-project. It inventories, recommends, and then reuses, copies, or authors the missing skills. With consent, it publishes them with publish_skill and offers an install. The gloria plugin's own skills, including the ones .gloria/USING-GLORIA.md names, are already covered, so don't recommend them as gaps. Look for what this project needs beyond them. Authoring a new skill needs writing-skills, a superpowers skill that the gloria plugin doesn't include. If writing-skills is unavailable, list each skill that would be authored with its rationale, and say what to install: the superpowers plugin. Commit only the project-local install paths the user chose to commit. Never commit the .context/ staging directory, which a new repo doesn't ignore yet, so name the paths and never git add -A.Phase rules:
Re-check the instruction files. 10.1 and 10.4 edit CLAUDE.md and AGENTS.md after step 9 checked them. When the phase ends, re-run step 9's checks 2-6 on both files, fix anything they find, and commit the fix.
One final report. End the phase with a single report:
Signed out. If the gloria MCP server is unavailable or not signed in, do only the repo-side work. That is 10.1's doc and Gloria sections and 10.3's four local dependency docs, each committed. Skip the rest: PROJECT_EXPLAINER and PACKAGE_MAP exist only on gloria.dev, and the Coding Standards stamp is the version of a registered standard. End the phase with the exact sign-in instruction for the user's agent:
/mcp, select gloria, and authenticate.codex mcp login gloria in your shell.Say that 10.1-10.6 can be rerun once signed in. Give the final report, then go on to step 11. Never report a sync, registration, standard, drift run, or publish that didn't happen.
Registration declined. If the user declines to register the project in 10.1, treat 10.2-10.6 as signed out: every server write in them needs the project, and documenting-service-dependencies would otherwise register it without asking. Do their repo-side work only, and report the rest as skipped because registration was declined.
A write is refused. If the server refuses a write because of the user's role, record that step as skipped with the error, and continue. Don't retry it.
Empty or near-empty codebase. Still run every step. When a code-derived step finds nothing, record "nothing to extract yet" for it. Never make up dependencies, rules, snippets, or skills to fill a step. The final report says which steps to rerun once the project has code, usually 10.2-10.6.
A declined consent gate skips that one step's write. Record it as skipped with the reason, and continue with the next step.
Ask if the user would like to start brainstorming requirements or an implementation plan. Use the superpowers:brainstorming skill (if available) or the superpowers:writing-plans skill (if available) if they say yes.
Sections in this order. Omit any that do not apply.
CLAUDE.md (Claude Code)
# <Project Name>
## Project Overview (problem, approach)
## Tech Stack
## Commands
## Repository Layout
## Environment
## Development Practices (TDD → read + @TDD.rules.md, commit rules, git/PR workflow)
## CI/CD Practices (only if GitHub Actions)
## Boundaries
## Verification (read + @VERIFICATION_PLAN.md)
## Gloria (step 10: setting-up-gloria)
## Coding Standards (step 10: extracting-coding-standards)
AGENTS.md (Codex CLI, OpenCode, Cursor)
# <Project Name> - Agent Instructions
## Required Reading (TDD.rules.md, VERIFICATION_PLAN.md - no @ imports)
## Non-Negotiables (condensed inline; nothing auto-loads here)
## Project Overview ┐
## Tech Stack │
## Commands │ same content as CLAUDE.md,
## Repository Layout │ written out in full
## Environment │
## Development Practices │ (inline, not referenced)
## CI/CD Practices │
## Boundaries ┘
## Maintaining This File (change one, change both, same commit)
## Gloria (step 10: setting-up-gloria)
## Coding Standards (step 10: extracting-coding-standards)
Alongside them: TDD.rules.md, CLAUDE-specific-fuckups.md, VERIFICATION_PLAN.md, and optionally .claude/settings.json. Step 10 adds .gloria/USING-GLORIA.md and the four dependency docs.
AGENTS.md to CLAUDE.md - it ships Claude Code's @ imports and tool names to agents that understand neither@ reference in AGENTS.md, where it is dead textAGENT.md instead of AGENTS.md - no agent reads the singular{{TEST_COMMAND}} and friends unreplaced in the project's TDD.rules.md, or leaving its template note (which names them) at the topTDD.rules.mdPorted from britt/agent-skills at a048db47 (MIT License), adapted for gloria.dev: bundled files are never fetched from the network, and step 10 runs the full Gloria setup phase.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
12 skills in this plugin
/checking-coding-standardsUse to check code against a project's registered gloria Coding Standards. Fires for plain requests to compare code with the rules — "check this against our standards", "does this drift from our rules/conventions", "are we following our own standards", "review this for standards compliance", "check this PR against our standards", "run a standards check", "audit the repo for drift", "has our code drifted from the rules" — including before or after implementing a change in a project that has registered standards. Runs diff-scoped checks (the per-PR workhorse), cheap metadata checks (render stamp + rule-evidence staleness), or a full audit (snippet staleness included), and reports findings to the gloria drift ledger via report_check_run. Read-only: findings, never edits./debugging-production-errorsUse to investigate production problems through gloria's log debugging tools. Fires for plain requests about live behavior — "why is X failing in production", "what happened at 2pm", "debug these 500s", "is anything erroring right now", "check the logs", "what broke after the last deploy", "why are checkouts timing out" — for any project with a gloria log connection configured. Queries the org's own log provider live via the gloria MCP tools (get_log_provider_status, get_log_stats, list_error_groups, query_logs): find the spike, group the errors, correlate with the deploy, pull the stack trace, map it to source. Read-only over logs; never asks for credentials in chat.npx claudepluginhub sandgardenhq/plugins --plugin gloria