/credo:optimize runs instead · from credo
Runs an opt-in, read-only scan of a repo for workflow bottlenecks: conflict hotspots, changelog fragments, test conventions, parallelism readiness, and agent instruction consistency. Presents findings as Implement/Later/Never proposals.
This skill never runs in Claude Code
It ships in credo at skills/, but /credo:optimize (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
An audit credo OFFERS but never forces. It looks at how the repo is organised and worked on, and proposes improvements that make parallel and long-running work smoother. Every finding is a proposal; nothing changes without the user's explicit choice.
/credo:optimize by hand). Nothing is changed before the
user picked Implement for that finding.git log, git status, git branch,
gh pr list (when gh is available). The only write before the user's choices is the
report file. git fetch in the freshness check is the only network-touching git call..env*, keys or credentials may be listed (for the
worktree files list), their CONTENTS are never read.All scripts live in "${CLAUDE_PLUGIN_ROOT}/scripts/". State is per repo (the main
worktree) and per Claude Code profile, under
${CLAUDE_CONFIG_DIR:-$HOME/.claude}/credo/optimize/<repo-hash>/.
credo-optimize-state.sh optin [yes|no] - the opt-in answer. yes = run now, later
offered again only to returners; no = never offered automatically, manual only.credo-optimize-state.sh offered - record that a welcome-back offer was asked (clears
the pending marker; call it after ANY answer, so each return is asked once).credo-optimize-state.sh never-add <id> / never-has <id> / never-list - findings the
user answered Never for; they are not offered again in this repo.credo-optimize-idle.sh - returner detection (used by the hook; idle=yes only when
credo's last-seen, the reflog, the index and the modified files are all at least
optimize.idle_days old, default 7).credo-optimize-fresh.sh - default branch + behind check (step 1).The credo-optimize-hook.sh hook asks the opt-in question (credo active, answer still
open) and injects the welcome-back offer; the credo SessionStart ASK asks the opt-in
together with the credo decision. A manual /credo:optimize run does not change the
opt-in answer.
git rev-parse --show-toplevel fails) -> say so and stop."${CLAUDE_PLUGIN_ROOT}/scripts/credo-config.sh" resolve-project.
Exit 0 -> <credo-dir>/process/reports/. Exit 4 (hub or no .credo/) -> the report is
shown in chat only; say so (offer /credo:setup if the user wants it stored)."${CLAUDE_PLUGIN_ROOT}/scripts/credo-optimize-fresh.sh"
fresh=yes): continue.fresh=no): show branch, default, behind and the suggest= commands
(git switch <default>, git pull --ff-only). Ask whether to run them. Run them only
on Yes. With uncommitted changes (dirty > 0) the switch may fail: say so, never stash,
reset or discard on your own. If the user declines, stop - an audit of a stale state is
never run silently. Continue on the stale state only when the user explicitly asks for
that, and mark the report fresh: no (user override).fresh=unknown: no default branch found, or fetch=failed): tell the user
freshness could not be confirmed and ask whether to continue anyway; same override rule.Before the scan, ask once via the Ask tool (plain text when no Ask tool exists) whether to include the opt-in area 2.6, with a one-line reason: "Contradicting instructions (for example the global CLAUDE.md says 'always ask', a credo mode says 'never ask') make agents stall or pick a side at random; this check reads the global and repo instruction files and installed hook texts, read-only, and only reports." Options:
instruction_consistency: skipped (user).The answer holds for this run only. Without an attended user (autonomous mode, where this
skill does not run anyway, or any unattended invocation) never ask - skip 2.6 and note
instruction_consistency: skipped (unattended, needs consent) in the report frontmatter.
Delegate the scan to ONE read-only subagent (Explore, else general-purpose with a
read-only brief) per the credo orchestration skill. Brief it with the five areas below
(plus 2.6 when the user said Yes in step 1b), the Hard rules, and the never-list
(credo-optimize-state.sh never-list) so it skips those ids. It returns findings, each with: id, area, title, evidence (commands +
numbers, file:line where useful), proposal, size (small = a few lines in one or two
files, else large), and convention (existing / recommended standard).
Finding ids are stable so Never sticks: hotspot:<path>, claude-md:split,
changelog:fragments, tests:convention, dogma:test-commands, dogma:release-only,
dogma:hydra, parallel:worktree-files:<path>, parallel:large-file:<path>,
consistency:<kind>:<slug> (2.6; <slug> names the rule topic, for example
consistency:mode:ask-vs-autonomous, never a person or a secret).
git log --since=90.days --format= --name-only | sort | uniq -c | sort -rn | head -20,
plus the touches: of recent done items under .credo/items/2_done/ when present.CLAUDE.md -> split into the dogma pattern: topic files CLAUDE/<topic>.md
referenced by @CLAUDE/<topic>.md lines, with long background in GUIDES/. When text
moves, check and fix every @-path that pointed at it; when unsure where a part
belongs or whether a path is still used, ask instead of guessing.CHANGELOG*, changelog.d/, towncrier, changesets,
release-please or similar. If one works, report it as existing and propose nothing.changelog.d/ at the repo root: one small fragment per change,
assembled by /dogma:versioning at the release. The release is the bundling commit with
the version bump, never a tag; tags stay with the user. Generated files (the assembled
changelog) change only at the release.tests/ mirroring the package; jest / vitest co-located *.test.ts; .NET a
Foo.Tests/ project per Foo; Flutter / Dart test/ mirroring lib/ with
*_test.dart; Go x_test.go next to x.go; other ecosystems analogously (their
documented default).Infer the actual workflow, read-only:
git branch -a (long-lived ones such as main, develop, stage);git log --merges --oneline | wc -l against
git log --oneline | wc -l, and gh pr list --state all --limit 20 when gh exists;.github/workflows/*, .gitlab-ci.yml, azure-pipelines.yml, ...), test
runners and build scripts (package.json, pyproject.toml, *.csproj, pubspec.yaml,
go.mod, Makefile, git hooks);"${CLAUDE_PLUGIN_ROOT}/scripts/credo-dogma-mode.sh" <subsection> <pattern> (prints
missing when not set), so only gaps or mismatches become findings.Propose: ### Test Commands stages (commit, push, relevant, build, all, with
branch filters that match the inferred branches), the Final Verification option
run ALL tests only at release (fits repos that bundle several items into a release
commit), and the Hydra checkboxes (use Hydra for 2+ independent tasks,
clean up merged worktrees automatically).
credo holds no dogma logic. On Implement, show the inferred values as suggestions and run
/dogma:permissions (Skill tool); in its Ask rounds offer these suggestions as the
recommended option. The user confirms every value there. If dogma is not installed (no
/dogma:permissions in this session), only report the suggestions.
### Hydra "Worktree files" list when
present, else the credo default in scripts/credo-worktree-setup.sh: link CLAUDE.md,
CLAUDE/, GUIDES/, DOGMA-PERMISSIONS.md, .credo/) against the excluded or ignored
files that an agent in a fresh worktree would need (names only, from
git status --porcelain --ignored and .git/info/exclude; never read their contents).
Missing entries -> propose adding them (link: by default, copy: for files that must
differ per worktree, such as a local env file).Contradictions between the instruction sources an agent loads confuse it - it stalls, asks needlessly, or follows the wrong side. This area compares them, read-only.
Sources (read what exists; resolve every @path import relative to the file that
contains it, follow symlinks such as linked CLAUDE/ and GUIDES/ dirs, stop at cycles
and at depth 5; also follow plain "Details: " references to guide files):
${CLAUDE_CONFIG_DIR:-$HOME/.claude}/CLAUDE.md and its imports and
referenced guides;CLAUDE.md (and CLAUDE.local.md) with its imports, AGENTS.md when
present, DOGMA-PERMISSIONS.md, .credo/RULES.md;"${CLAUDE_PLUGIN_ROOT}/skills/" (items, orchestration, session-*, budget, safety,
compact-plus, audit) and its commands.What counts as a finding (<kind> in the id):
contradiction - A says always X, B says never X (or A requires a step B forbids) for
the same situation.mode - a rule that conflicts with a credo mode or the credo model: "always ask" vs
autonomous no-Ask; "always use TaskCreate / a todo list" vs the credo item model;
delete, compact, commit / push or delegation rules that clash with credo's safety,
compact-plus, budget or orchestration rules.drift - the same rule kept in several places whose wording or values diverged (for
example a threshold, a path, an allowed command).stale - references to outdated plugin behaviour, removed commands or skills, moved
paths, or version numbers that no longer match the installed plugins.harness - rules that only apply to another harness (tool names, files or commands
that do not exist in Claude Code) inside a source Claude Code loads, where they mislead.A conflict the sources already resolve with an explicit precedence rule
(for example "DOGMA-PERMISSIONS.md overrides this file", or an exclusion that names the
mode it overrides) is not a finding; report it at most as low when the wording still
invites a misread.
Each finding additionally carries: location (file:line), conflicts_with (file:line),
severity (high = opposite orders for a frequent or risky action such as asking,
deleting, committing, pushing, compacting; medium = a real conflict in a rarer case or a
drifted value; low = stale wording or a resolved conflict that still reads ambiguous),
resolution (the suggested wording or removal), and change_side (which file to change
and why - usually the outdated or the more general source; a credo-side error is
reported as an upstream credo issue, never patched in the installed plugin cache).
Files outside the repo are cited as <global>/<relative path>:line, not by home path.
Hygiene - never quote secrets or secret-like values (tokens, keys, passwords, private
topic or webhook ids, URLs with credentials) - write <redacted>; quote at most a short
phrase per side, paraphrase the rest; keep personal data (names, mail addresses, hosts)
out of the finding text. Findings stay local: chat and the report file only.
Write optimize-<YYYY-MM-DD>.md (append -2, -3 for further runs that day) to the
reports dir from step 0. It is versioned exactly like the rest of .credo in this repo
(never force-add an excluded file). Frontmatter kind: optimize, date, fresh
(yes / no (user override) / unknown (user override)), branch, commit (short
sha), instruction_consistency (checked / skipped (user) /
skipped (unattended, needs consent)). Body: a summary line, then one section per finding
(id, area, evidence, proposal, size, convention; for 2.6 also location, conflicts_with,
severity, resolution, change_side) with a decision: line filled in step 4 (implement,
later, never, or open). When the report file is versioned in this repo, 2.6 entries
carry only file:line references, severity and a neutral one-line summary; the quoted
detail is shown in chat only.
Present every finding not on the never-list, most valuable first (2.6 findings by
severity, high first), up to four per Ask round, each with exactly these options:
orchestration, commits per the repo rules). Large: create a credo item
per the items skill (1_todo/1_clarify by default; straight to GO only when the user
gives a GO and the GO entry gate passes), with the finding id and report path in its
body. dogma settings: the /dogma:permissions flow in 2.4. Instruction consistency
(2.6) - never edit an instruction file from this audit; show the location, the
conflicting location, the severity and the suggested wording for the change_side file
so the user applies it (or, for a repo-local file, a credo item per the items skill;
for a credo-side error, an upstream credo issue note).credo-optimize-state.sh never-add <id>; never offered again in this repo.Without an Ask tool, list the findings as plain text with the same three choices and wait
for the user's answers. Fill each decision: line in the report, then give a short
summary: implemented, items created (with their #N), later, never.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
28 skills in this plugin
/auditRead-only quality gate that audits already-built work against its stated requirement and Definition of Done before it is allowed to move to 2_done/. Produces a severity-ranked decision proposal (BLOCKER/MAJOR/MINOR/NIT) with evidence; the judgement never edits, only a recorded post-audit step may fix small findings. Use when an item is claimed complete, before moving anything to 2_done/, when asked to audit or review finished work for completeness against requirements, or when acting as the dedicated post-completion review subagent. This gate is mandatory in every session mode. Not for diagnosing why something is broken (use diag) and not for verifying rendered UI behavior (use verify)./budgetThe single source for all API budget cap and reset rules - how much of the 5-hour and weekly API limits may be spent, when to throttle, pause, wake up, or hibernate, and the commit-identity gate that runs before any commit. Use whenever you are about to start or continue autonomous work, before spawning or stopping subagents, when deciding how large a task chunk to take on, when a limit is near a cap, before a commit, or whenever someone asks "how much budget is left" or "can I keep going". Works standalone (no session skill required) and applies inside subagents too: any agent that spends API budget or commits must apply these rules.
/compact-plusSecure everything the user approved before a context compaction so a later /compact can never lose or alter it. Writes verbatim intent and handoff state to disk and commits plus pushes the tracked work product in the correct repository, then reports whether it is safe to compact. It does NOT run /compact itself - it makes a later compact safe. Run this only when the limit plugin's injected ACTION line names it (session-context fill crossed a configured threshold; in interactive modes only after asking the user once, autonomous mode runs it directly) or when the user invokes it manually. Never self-trigger it proactively - that only wastes tokens. Accepts extra trailing instructions to perform in addition to the securing checklist. A minimal mode (invoke as /compact-plus min) secures only intent plus handoff to disk - no audit, no commit or push - for a quick token-cheap save.
/cross-cutting-checklist-generatorDetect when a concern is scattered across many places in a project (config keys, enums, translations, feature flags, API endpoints, doc references) and auto-generate a project-local checklist so that same concern is never partially updated again. Use whenever you add or change something that also exists in several other spots, or when you edit something that already has a checklist. Runs fully autonomously with no user effort, including inside subagents./diagRead-only root-cause diagnosis for a symptom, bug, failure, or unexpected behavior. Establishes the mechanism at file:line and reads up the facts instead of guessing, before any fix is attempted. Produces a diagnosis report; the fix is always a separate step gated by an explicit GO. Use when something is broken, failing, throwing, or behaving unexpectedly and the cause is not yet proven, or when asked to investigate or find the root cause. Not for judging whether finished work meets its requirement (use audit) and not for confirming rendered UI behavior (use verify)./disableDisable the credo items workflow for the current directory. Use when the user wants to stop credo's workflow here - for example "stop using credo here", "disable credo for this repo", "turn credo off here", "no credo in this directory", "credo hier aus", "credo hier deaktivieren", "credo hier abschalten" - or runs the /credo:disable command. It persists a per-directory declined decision (so the SessionStart onboarding ASK and the workflow text stay silent here across future sessions), records the current session as declined, clears its active session mode, and switches keep-alive autonomy off (same effect as switching to active/passive). Model presets and the shorthand legend stay on. Fully reversible via /credo:enable.
npx claudepluginhub marcel-bich/marcel-bich-claude-marketplace --plugin credoOther plugins' skills for the same job