/forge:fg-rulesfrom forge
Analyzes project patterns and proposes durable AI coding rules for user review, saving only adopted changes under .forge/rules/. Useful for generating or updating project-specific coding rules.
Ships in forge. 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.
An on-demand utility outside the forge loop. Turn supported project patterns into proposed instructions, then persist only what the user adopts. A frequent pattern is evidence, not permission to make it a rule.
Language: Write every user-facing message and generated project document in the user's language. Keep paths and command identifiers unchanged.
Explaining forge: forge's vocabulary is not the user's — verified: failed, unsealed tail, a pillar or gate name means nothing unread. Always, never gated on eco: gloss a forge-specific term on first use in a message (a few words, not a paragraph), put the purpose before the mechanism, and lead with the answer, closing on what it means for the user. A gloss is not filler — with eco on, ECO.md's terse rules govern form (length, padding) while these govern vocabulary, so terseness never deletes a gloss.
Evidence and candor: every claim you make about code, state, or results — in a message or in a document you write (plan, run notes, retro, ADR) — carries its evidence in the same sentence (a file:line, a command and its output) or a label: Measured (you checked it this session), Inferred (reasoned from what you checked), Guess (a prediction or an unseen cause), rendered in the user's language. A label is not a license to skip a check — if a cheap check would settle it, run it; never hand the user a check you could run. Agreement is not the default: when asked whether to do something, invited to add scope, or shown an approach, give your real judgment first — the strongest objection, and "don't do it" when that is true. Change a recommendation only for a new fact or argument, never for repetition; the decision stays the user's — state the objection once, then follow their call without re-arguing or silently deviating. Output a deterministic script printed is already measured and needs no label.
Host contract: Review uses structured_choice when available. Read ../../core/HOST.md,
../../core/INTERACTION.md, and the active host's
interaction adapter. Review happens in this conversation, one bounded question
at a time; use structured_choice when available, otherwise numbered text.
No delegation or hook is required.
Location: .forge/rules/ is relative to the project root, on every branch,
as defined in ../fg-run/FORGE-ROOT.md. Find the git
top-level, or use the explicitly selected project directory outside git.
Never write rules inside a branch's forge state directory or the plugin install.
Ordinary git branches/worktrees version their own files; this is not an external
shared store.
The optional argument is a topic, such as testing, API, or 테스트, not an
executable command. With no topic, inspect project-specific naming, file
placement, dependency boundaries, error handling and testing as applicable.
With a topic, limit proposals and changes to that topic; do not prune other rules.
Read existing project instructions and their referenced files first, including AGENTS.md, CLAUDE.md, applicable nested/override instructions, existing rules and formatter/linter configuration. Preserve the existing authority and delegation relationships. Inspect representative current source and tests, including exceptions to each apparent pattern. Exclude generated/vendor output and secrets.
If .forge/codebase/ exists, read only relevant map documents and check their
claims against current files. Missing or stale maps do not block analysis.
Do not invoke fg-map or change its output.
Do not copy those documents wholesale into rules. Existing explicit instructions take priority over inferred conventions. Mixed patterns, weak evidence, or conflicting instructions are reported as deferred candidates, with the reason. Do not resolve an existing instruction conflict by silently choosing a winner. Do not propose generic best practices or duplicate constraints already enforced by the project's formatter/linter.
Present a compact candidate list with stable identifiers, each containing:
Connection repairs are standalone candidates too, even when every adopted rule is unchanged. For example, if existing rules and their index are valid but a new host's entrypoint does not read them, propose only the missing read instruction as its own candidate. Review its exact patch and apply it only when adopted; preserve the unchanged rule files and index. Do not manufacture a rule-body change to make a connection repair eligible.
For an update, read the current rule text, including manual edits. Show the actual before/after change. Absence of a pattern is not permission to delete a rule. Existing rules are not disposable generated output.
Prepare the full proposed patch in conversation before asking for adoption: include the rule text, index changes, project-instruction connection and any minimal ignore exception needed for tracking. Follow CONNECTIONS.md to prepare that connection. Do not create a draft file in the project or change instructions while still proposing.
Ask which candidate IDs to adopt, with “none” as an explicit option. For a deferred conflict, recommend retaining the existing instruction; changing it requires an explicit choice covering both the old instruction and the new rule. Generic “adopt all” does not resolve a conflict labeled deferred.
Recompute the index, connection and ignore edits for the selected subset. For example, selecting a last-rule deletion while rejecting its proposed replacement can require connection cleanup that the original combined patch did not show. Present and get adoption of any such new edits before applying that dependent change; do not ask again about edits already adopted unchanged.
If the user already approved this exact patch in the current conversation, do not ask again. A request to generate/update rules alone is not adoption. If the user changes a candidate materially, show its revised patch before applying it. Approval of a rule never silently includes unrelated instructions.
After considering both rule and connection candidates: no candidates, none adopted, or no actual changes → report that result and stop without creating directories or rewriting files. Unchanged rule bodies alone are not a reason to skip a needed connection proposal.
Immediately before editing, re-read affected files. If they differ from the reviewed version, preserve the intervening edits and show a revised patch for the affected candidates; still-applicable approved changes may proceed.
Create only the topic files needed, using stable descriptive names, for example
.forge/rules/testing.md. Keep adopted rule bodies in one place. Each rule
contains its instruction, applicability and evidence paths; add exceptions or
a short example only when they clarify the instruction. Use the user's language.
Do not copy credentials, sensitive values, or bulk source excerpts into rules.
Maintain .forge/rules/INDEX.md as a short routing index:
# Project rules
Read the common rules and rules matching the current task before editing.
Existing project instructions, including more specific instructions, retain
their authority. If a rule conflicts with them, report the conflict.
| Applies when | Rule file |
| --- | --- |
| Editing tests | [Testing](testing.md) |
Translate this prose and headings; keep paths unchanged. Add a common-rules
entry only when there are adopted common rules. The index lists applicability
and links, not duplicate rule bodies. Preserve existing user-written index
content. If INDEX.md already has another purpose, propose an in-place integration
or an alternative entrypoint explicitly rather than replacing it.
Apply only the approved connection and ignore changes. Existing text outside the adopted edits must stay intact. Reuse a working connection instead of appending another; do not rely on generated markers as ownership of manual edits. Topic-scoped updates may change that topic's index entry but not other entries.
Deletion needs explicit adoption too. If it removes the last rule, include index/connection cleanup in the reviewed patch. Do not leave a dangling read instruction, and do not remove unrelated user content to make a directory empty. Never auto-stage, commit, push, or edit user-global configuration.
Inspect the resulting diff against the adopted patch:
If verification fails, repair within the adopted patch and check again. If it needs a different policy or additional edits, report what is incomplete and review that change; do not claim success.
Report adopted/deferred counts, changed paths, and the connection verification level. Give a normal coding-task example for checking loading in a new session. This utility does not advance the forge loop, so do not invent a next loop stage or prompt the user to run fg-ask. An unchanged run gets a one-line report.
Writes are limited to adopted .forge/rules/ content and reviewed project
instruction/ignore edits. Do not modify source code, maps, glossary, ADRs,
plan/run/STATUS, or other loop state. Do not add hooks, runtime enforcement,
automatic re-analysis, or copies for every possible AI tool.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gyuha/forge --plugin forge25 skills in this plugin
/fg-adversarial-reviewOptional adversarial review between fg-run and the seal (fg-done) — a reviewer assumes the result is WRONG and hunts for evidence across six lenses (failure points, hidden assumptions, misread requirements, security/perf/data-loss, unexpected misuse, weak decisions), fanning out as parallel subagents; fix-needed findings become a fix-forward plan on your approval. Outside the loop, never a seal gate, always skipped in fg-next all / fg-loop. Use in contexts like 'adversarial review', '적대적 리뷰', '이 결과 공격적으로 검토', '허점 찾아줘', 'red team this'./fg-agendaA decision queue for foggy work — outside the forge loop. Settles the destination with you, grills breadth-first to surface what must be decided, and keeps it in .forge/agenda.md (destination · decided · open questions · fog · out of scope), resolving one question at a time via fg-ask until the way is clear, then deleting itself. The agent finds the decisions; you answer them. Use in contexts like 'forge agenda', '의제', '결정 대기열', '뭘 결정해야 하는지 정리해줘', '어디서 시작할지 모르겠다'./fg-agentsGenerates a project's domain agents — conversational grilling derives the recurring roles, then writes standard Claude Code subagent cards to .claude/agents/<role>.md (each `description` carrying a "when to use" so fg-run can dispatch a matching role as agentType). Cards load only at session start, so RESTART the session after generating them before fg-run can use them. On-demand utility outside the loop. Use in contexts like 'forge agents', '도메인 에이전트 만들어', '에이전트 팀 구성', 'create project agents', 'domain agents', 'agent roles'.Other plugins' skills for the same job