/maister:standards-discoverfrom maister
Discovers coding standards from config files, code patterns, docs, and external sources (PRs, CI/CD). Aggregates findings with confidence scoring and applies approved standards.
Ships in maister. 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; scripts run unread.
Analyzes multiple project sources in parallel to discover coding standards, conventions, and best practices. Aggregates findings with confidence scoring, asks the user which to keep, and applies approved standards via docs-manager skill.
&&, ;, pipe, here-string or inline node -e script — so it reads the same in bash, PowerShell and cmd.exe. Nothing here calls python or needs gh: a host may have neither| Parameter | Default | Description |
|---|---|---|
--scope | full | Discovery scope: full, quick, a group the group table holds (Phase 1 lists them), or a folder already under .maister/docs/standards/ |
--confidence | 60 | Minimum confidence threshold (0-100) for displaying findings |
--auto-apply | false | Auto-apply standards with confidence >= 90% without asking |
--skip-external | false | Skip GitHub PR analysis and CI/CD sources |
--pr-count | 20 | Number of recent merged PRs to analyze |
Scope determines which phases run:
| Scope | Config (P1) | Code (P2) | Docs (P3) | External (P4) |
|---|---|---|---|---|
full | Yes | Yes | Yes | Yes |
quick | Yes | No | No | No |
<group> | Configs bearing on the group | Files its filter names | Yes | Yes |
<folder of the project's own> | Relevant configs | Files matching the folder's subject | Yes | Yes |
Any other --scope value is refused in Phase 1, before any scan, naming the valid values.
| Phase | Subject | activeForm |
|---|---|---|
| 1 | Plan discovery scope | Planning discovery scope |
| 2 | Analyze configuration files | Analyzing configuration files |
| 3 | Mine code patterns | Mining code patterns |
| 4 | Extract documentation standards | Extracting documentation standards |
| 5 | Analyze external sources | Analyzing external sources |
| 6 | Aggregate & deduplicate findings | Aggregating findings |
| 7 | Review findings with user | Reviewing findings |
| 8 | Apply approved standards | Applying standards |
| 9 | Generate summary report | Generating summary |
Task Tracking: At start of Phase 1, use TaskCreate for all phases above (pending). Set dependencies: Phases 2-5 blocked by Phase 1 (they run in parallel after planning). Phase 6 blocked by Phases 2-5. Phases 7-9 sequential. At each phase start: TaskUpdate to in_progress. At each phase end: TaskUpdate to completed. For phases skipped due to scope (e.g., Phases 3-4 when --scope=quick), mark completed with metadata: {skipped: true, reason: "scope=quick"}.
.maister/docs/ exists. If not, ask once — "Set up Maister first? (runs the setup, then this)": "Set it up (Recommended)" runs maister:init with the Skill tool, which ends by running a full discovery; "Not now" stops here, and so does any other answer
2.5. Read the groups with node <plugin root>/skills/docs-manager/scripts/standards.mjs groups from the project root, the plugin root two levels above this skill's base directory, as a command of its own. Its groups list (each id, title and filter) and the custom entries of its present list are the group list. A --scope that is neither full, quick, one of those groups nor one of those folders stops here, naming the valid values. A failure of the call stops discovery with its message..maister/docs/INDEX.md to identify updates vs creates and avoid duplicates; Phase 6 reads the rules of the files a finding lands in, to find the ones it contradicts--skip-external is set or the scope is quick — with node <base directory>/scripts/external-sources.mjs from the project root (this skill's base directory, as an absolute path). Its JSON says whether the external phase has anything to read (scan): pull requests through a signed-in gh and a git remote, CI configuration, or pre-commit hooks, and why pull requests are or are not readable. A missing or signed-out gh is a reported state, not an error. With scan false, Phase 5 is skipped, and Phase 9 names it with the reasonLaunch all applicable subagents in one message so they run in parallel.
Step 1: Determine which phases to run based on scope and flags.
Step 1.5: Create the output directory — Run node <plugin root>/skills/workflow-engine/scripts/workflow.mjs scratch-dir --for=standards-discover from the project root, as a command of its own. It makes a fresh directory under the project's .maister/scratch/, which git ignores, and prints its absolute path: store that path exactly as printed, as {tmpdir}. The files in it are read back, so it is never the system temp directory: a read outside the project can stop the run for a permission prompt. Each subagent will write its results to a dedicated file in this directory: {tmpdir}/config.yml, {tmpdir}/code.yml, {tmpdir}/docs.yml, {tmpdir}/external.yml.
Step 2: Name the phase briefs
Each phase's brief is a template under this skill's base directory: which source to scan, what to look for, the sampling bounds, the confidence range and the YAML schema the aggregation step depends on. Name each by its absolute path — never cd into the skill, since every later command, the engine's included, would then run from there instead of the project root. This session does not read, fill in or condense a brief: the scanner reads it itself, so nothing in it is lost on the way.
| Phase | Condition | Brief |
|---|---|---|
| 2: Config Analysis | Always | references/config-analyzer-prompt.md |
| 3: Code Patterns | scope != quick | references/code-pattern-prompt.md |
| 4: Documentation | scope != quick | references/docs-extractor-prompt.md |
| 5: External Sources | --skip-external not set, scope != quick, and the external sources check found something to read | references/external-analyzer-prompt.md |
Step 3: Launch subagents in parallel — Use the Task tool with subagent_type: maister:standards-scanner for each phase. Its prompt is these lines, each filled in, and no part of the brief itself — never pasted, reworded or summed up:
brief: the phase brief's absolute pathproject_root: the project root's absolute pathoutput_file: the phase's file in {tmpdir}scope: the discovery scope, and confidence: the thresholdgroups: the group list, each table group as <id> (<title>) and each folder of the project's own by name, comma-separatedfiles: for a group scope, that group's filter joined with ; , sent to the config and code scanners only; omitted for full, quick, global (empty filter) and a folder of the project's own. The docs and external scanners never get a files: linechecker: the absolute path of scripts/check-findings.mjs under this skill's base directory, which the scanner runs on its filepr_count: the number of pull requests, and github: available when the external sources check found pull requests readable, otherwise its reason — for the external phase onlyThe scanner carries the rest itself — read-only, absolute paths, one file written. Each call carries the model and effort node ${CLAUDE_PLUGIN_ROOT}/skills/workflow-engine/scripts/workflow.mjs dispatch-model --agent=maister:standards-scanner --host=claude prints once just before the launch, run as a command of its own (../workflow-engine/references/verbs.md § Model and effort on every agent call; likewise for the docs-operator call below).
Every applicable phase is a subagent of its own, whatever the size of the repository: a small repository, one commit or no linter config is no reason to run a phase's discovery in this session or to write its file yourself. The phases read different sources than this session has in view, which is what makes their findings worth scoring.
Step 4: Wait for ALL subagents to complete, then check each output file with node <checker> <file> — one command per file — and read each one that passes using the Read tool to collect findings. The checker needs only Node; never check a file with python or an inline script of your own. A phase whose file is missing or fails the check did not run: dispatch it once more, and report it as not run if it is still missing or failing.
Step 5: Display progress — Show count of findings per phase.
Print the confidence scoring methodology, as Step 2.5 runs a command, never with the read tool: node <plugin root>/skills/workflow-engine/scripts/workflow.mjs reference --at="skills/standards-discover/references/aggregation-strategy.md".
category + standard_name — merge evidence and sourcesbackend/api.md against discovered singular resource paths (/user/{id}) is one. Writing the finding beside the rule, or merging it in, would leave two rules that cannot both hold, and nothing later reports them.--confidence threshold{tmpdir}/findings.yml: every finding after the merge, numbered, each with its tier — high, medium, conflict or below the threshold, exactly one — its plain name, what it says and its sources. A finding in a conflict is listed once, as the conflict. This list is the one count from here to the close: every number Phases 7 to 9 print is read from it, never recounted from memory, and nothing is asked, written or reported that it does not hold.A finding merged into another at the dedupe is said once, in Phase 7's count line, and never again.
Print one line of counts from the list, then ask: "14 raw findings, 3 merged into others — 2 high, 7 medium, 2 conflicts, 0 below the threshold" (the merge clause only when one was merged). The counts split the findings once: a finding in a conflict counts as a conflict only, never also as high or medium, and each count is the number of findings asked or listed under it — the high question lists exactly the N it names, the medium pages ask every medium finding, the conflict pages every conflict, and Phase 9 lists every finding below the threshold. A count with nothing asked or listed under it is wrong: correct the count before asking. Each entry of the list is asked as one question, never split into two or merged with another, and nothing is asked that the list does not hold; a question that names its place counts against the list ("Medium 3 of 7", the total the count line printed, plus the high ones when the user chose to go through them). Each answer is recorded against its entry in the list, an accepted change keeping the entry's number. Every question carries its own findings — never a table above it for the question to point at. Name each standard in plain words, never as category/file alone.
High confidence (>= 80%): one question — "Apply these N standards?" with one line each in the question (what the standard says, in a few words). "Apply all N (Recommended)" / "Go through them". Going through them uses the medium-confidence pages below.
Medium confidence (60-79%): pages of up to four findings, one question per finding: what the standard says, its evidence in a line (where it was seen, how often) and its sources. Options "Accept (Recommended)" when the evidence is consistent, "Accept with a change" (the change is the follow-up answer), "Skip", and "Skip the rest" — this finding and every one not yet asked, so a long list never has to be walked to its end.
Each Accept option's preview shows the standard as it would be written, with its preferred and avoided examples.
Below the threshold: not asked. The summary report (Phase 9) lists them so a later run with a lower --confidence can pick them up.
Conflicts: pages of up to four, one question per conflict, both sides in the question with their evidence and sources. The better-evidenced side is recommended, its reason in its description; the other side and "Skip" are the remaining options, and a custom rule is the Other answer.
--auto-apply included.If --auto-apply is set, automatically approve findings with confidence >= 90% and only ask about the rest.
Write standard files through the docs-operator subagent rather than Write/Edit, so INDEX.md and CLAUDE.md stay consistent with the files.
### heading with a 1-10 line description (excluding code snippets); group related standards into one topic file; add brief code examples only where they clarify. A rule cites at most one example path — never an inventory of call sites, a date or a ticket reference. Note create vs update for each target file; a finding's target folder is the group it landed in, and the docs operator creates the folder when it is absent, and prefer a new topic file (or a sub-folder for a topic with several) over appending to a file already past about 12 KB or 15 rules. A rule already written — a starter rule or the project's own — is replaced or removed only through a conflict the user settled for the discovered side. A finding that overlaps one without contradicting it is written beside it, or added to it with its heading and its text kept; it is never folded into a new section that takes the written one's place.docs-operator subagent once via Task tool (subagent_type: maister:docs-operator, model and effort from node ${CLAUDE_PLUGIN_ROOT}/skills/workflow-engine/scripts/workflow.mjs dispatch-model --agent=maister:docs-operator --host=claude, run just before) with all prepared standards, instructing it to apply each create/update — adding to existing content, every section the call does not name for replacement kept as it is, and naming each written rule a settled conflict replaces — then refresh INDEX.md with every written path as changed — check is <plugin root>/skills/docs-manager/scripts/docs-check.mjs, the plugin root two levels above this skill's base directory, as an absolute path — and confirm CLAUDE.md references the standards directory.Display the application summary in findings, read from the list: "N findings applied, in F files (c created, u updated)". A finding added to a rule already written is still one applied finding. An approved finding that was not written is named here, once, with the reason, and counted as not applied.
Display final results. Every count is read from the list, and the counts add up to the count line's total: applied, skipped, below the threshold, and conflicts settled or left unsettled. Nothing merged or dropped is said again here; it was said where it happened.
gh, gh not signed in, no remote, nothing external to read| Situation | Strategy |
|---|---|
.maister/docs/ missing | Ask "Set up Maister first?" (Phase 1); stop if declined |
| gh CLI missing or signed out | Not an error: the external sources check reports it, the external scan skips pull requests (or the whole phase, with nothing else to read), and the summary names the skipped source |
| GitHub API rate limit | Skip PR analysis, note in report |
| Config file parse error | Skip that file, log warning, continue |
| No standards found | Suggest lowering threshold or checking specific scope |
| docs-operator fails | Ask with the cause in the question: "Retry (Recommended)" / "Skip these standards" |
docs-operator returns decisions_needed | Ask each in the same form, then call it again with the answers |
| Subagent returns empty | Note in report, proceed with available findings |
| Integrates With | How |
|---|---|
docs-manager skill | Creates/updates standard files, refreshes INDEX.md |
implementation-plan-executor skill | Discovered standards immediately available via INDEX.md |
standards-update command | Complementary: discover = automated bulk, update = manual single |
# Full discovery (default)
/maister:standards-discover
# Quick scan (config files only)
/maister:standards-discover --scope=quick
# Frontend standards only
/maister:standards-discover --scope=frontend
# High confidence, auto-apply
/maister:standards-discover --confidence=80 --auto-apply
# Skip external analysis (offline/no GitHub)
/maister:standards-discover --skip-external
references/aggregation-strategy.md (opens in a new tab)references/code-pattern-prompt.md (opens in a new tab)references/config-analyzer-prompt.md (opens in a new tab)references/docs-extractor-prompt.md (opens in a new tab)references/external-analyzer-prompt.md (opens in a new tab)scripts/check-findings.mjs (opens in a new tab)scripts/external-sources.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
22 skills in this plugin
/codebase-analyzerAnalyzes codebase using adaptive parallel Explore subagents based on task complexity. Selects agent roles from a pool, launches Explore agents, then delegates report generation to codebase-analysis-reporter subagent./developmentmaister:developmentUnified orchestrator for all development tasks. ALWAYS execute when invoked — never skip for 'straightforward' tasks. Phases adapt based on detected task characteristics rather than predetermined types. Use for any development work that modifies code./docs-managerInternal engine for managing project documentation and technical standards in .maister/docs/. Handles file operations, INDEX.md refresh, CLAUDE.md integration, and the consolidation of standard candidates at a workflow's finalization. Invoked by maister:init, standards-update, standards-discover and workflow finalization.npx claudepluginhub skillpanel/maister --plugin maisterOther plugins' skills for the same job