Best for
- Creating a new rule in src/rules/{name}.md
- Rewriting an existing rule (not a typo fix)
- Deciding whether something should be a rule at all
event4u-app/agent-config/src/skills/rule-writing/SKILL.md
Use when creating or editing a rule in src/rules/ — trigger wording, always vs auto classification, size budget — even when the user just says 'add a rule for X'.
Decision brief
Use when creating or editing a rule in src/rules/ — trigger wording, always vs auto classification, size budget — even when the user just says 'add a rule for X'.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/rule-writing"Inspect the Agent Skill "rule-writing" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/rule-writing/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Creating or materially rewriting a rule must go through Understand → Research → Draft from the artifact-drafting-protocol rule.
Creating a new rule in src/rules/{name}.md Rewriting an existing rule (not a typo fix) Deciding whether something should be a rule at all Converting a learning from learning-to-rule-or-skill into a concrete rule
A rule is a constraint — it states a boundary, not a workflow. If the content needs numbered steps, it is a skill.
Creating or materially rewriting a rule must go through Understand → Research → Draft from the artifact-drafting-protocol rule.
Normative source: rule-type-governance.
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 98/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 7 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
src/rules/{name}.mdlearning-to-rule-or-skill into a concrete ruleDo NOT use this skill when:
skill-writingguideline-writingcommand-writing| Intent | Artifact |
|---|---|
| "Agent must always/never do X" | Rule |
| "When Y happens, run these steps" | Skill |
| "Here is knowledge the agent may cite" | Guideline |
A rule is a constraint — it states a boundary, not a workflow. If the content needs numbered steps, it is a skill.
Creating or materially rewriting a rule must go through Understand →
Research → Draft from the
artifact-drafting-protocol rule.
src/rules/ for overlap
and analyze rule-type-governance, size-enforcement,
skill-quality before drafting.type, description) first, wait for
confirmation, then fill the body.always vs autoNormative source: rule-type-governance.
always — universal behavior (language, scope, safety, verification)auto — triggered by description match on domain/symptomDefault to auto. always must be justified — if >50% of conversations
don't need it, it is auto.
The description field is the trigger. Describe when the rule
applies, not what it contains. Soft cap: 200 characters.
# Bad — describes content, won't match reliably:
description: "PHP coding standards"
# Good — trigger-shaped, names domain + symptoms:
description: "Writing or reviewing PHP code — strict types, naming, comparisons, early returns, Eloquent conventions"
When iterating on phrasing, delegate to the
description-assist skill — approval-gated,
no silent edits, max two rounds.
Three different surfaces, three different rules. Mixing them up will
either fail the schema (./scripts-run src/scripts/validate_frontmatter) or
fail ./scripts-run src/scripts/lint_load_context. Canonical reference:
templates/rule.md § Path conventions and
docs/contracts/load-context-schema.md.
| Field | Form | Example |
|---|---|---|
load_context: / load_context_eager: | Logical name rooted at the source — never src/ | contexts/execution/verification-mechanics.md |
triggers[].path_prefix: | Literal match pattern the host evaluates against the file the agent is editing — not rewritten | src/skills/ (source-of-truth rules) or agents/, app/, .augment/ |
| Body links to guidelines / contracts | Verbatim relative form — ../../docs/... works in any markdown viewer; rewriter handles depth | [guideline](../../docs/guidelines/<group>/<name>.md) |
The condense-time rewriter (scripts/condense.ts::_rewrite_paths) is
idempotent and depth-aware — it resolves logical names and body links
to the deployment-correct relative path at condense time, leaving
path_prefix: literally as written. The schema regex
(scripts/schemas/rule.schema.json) and scripts/lint_load_context.ts
both reject the src/ prefix in load_context: /
load_context_eager: with an error pointing at the canonical logical
name.
Normative source: size-enforcement +
docs/guidelines/agent-infra/size-and-scope.md.
| Category | Target |
|---|---|
| Ideal | < 60 non-empty lines |
| Acceptable | < 100–120 lines |
| Hard limit | < 200 lines |
Linter emits long_rule above ~80 non-empty lines. Above that, justify in
the PR or split by responsibility.
./scripts-run src/scripts/skill_linter src/rules/{name}.md
→ must report 0 FAIL.bash scripts/condense.sh --sync to regenerate dist/agent-src/rules/{name}.md../scripts-run src/scripts/condense --generate-tools to project into .claude/, .cursor/, .clinerules/, .windsurfrules.Taskfile.yml in this repo for
the script list) — must exit 0 except for tolerated warnings.After validation, before declaring the rule done, run:
./scripts-run src/scripts/measure_augment_budget --check
If utilisation is ≥ 0.95 (or the check exits non-zero), STOP and
invoke rule-refactor. Do NOT:
FAIL_THRESHOLD in scripts/measure_augment_budget.ts —
threshold-lift is explicitly forbidden (see the
validation-budget rule and
the rule-refactor Iron Law).The discipline: budget pressure is the signal that the rule set
needs a cleanup pass, not that the new rule needs to be smaller. The
rule-refactor skill runs the audit and proposes merge / delete /
move-to-context / promote-to-skill so the new rule earns its space.
Advisory, reviewer-checked — no CI gate. When the same PR adds a
new check to scripts/skill_linter.ts (or strengthens an existing
one) such that previously-clean rules now warn, the PR body MUST
record the pre-existing violations on main in a Markdown table:
### Pre-existing baseline (informational)
| Code | Count on main | Bucket |
|---|---:|---|
| {new_code} | N | (a) genuine fix · (b) accept · (c) check too aggressive |
Forward-only: the new check applies to the rule under review and
to future edits. The baseline table is informational so reviewers
can distinguish genuine debt from acceptable carry-overs without
diffing the full lint output. See
agents/evidence/analysis/lint-warning-triage.md for the 3-bucket reference.
---
type: "auto" # or "always"
description: "Trigger-shaped sentence — domain + symptoms — soft cap 200 chars"
alwaysApply: false # true only if type: always
source: package # or project for consumer-local rules
load_context: # logical names only — `contexts/<area>/<file>.md`
- contexts/execution/verification-mechanics.md
triggers: # path_prefix is literal, not rewritten
- path_prefix: "src/rules/"
routes_to:
- "skill:related-skill"
---
See § 3b above for the load-bearing distinction between load_context:
(logical, rewritten), triggers[].path_prefix: (literal, verbatim),
and body links (relative ../../docs/..., rewriter handles depth).
src/rules/{name}.mdbash scripts/condense.sh --sync + ./scripts-run src/scripts/condense --generate-tools ran cleanalways "just in case" — token cost is real, auto is default../scripts-run src/scripts/condense --generate-tools — downstream tools stay stale.dist/agent-src/rules/ or .augment/rules/ directly — those are generated.Apply the Frugality Charter to every rule you author.
Examples in this artifact:
kernel-membership
list.Pre-save self-check:
dist/agent-src/, .augment/, .claude/, etc.)On cloud surfaces (Claude.ai Web, Skills API) the package's
scripts/skill_linter.ts, scripts/condense.ts, and task runner
are not reachable. The skill still applies — with prose-only
validation:
type is always
or auto, description is trigger-shaped, alwaysApply matches
type.src/rules/{name}.md
and run task sync && task lint-skills locally before committing.Good description (trigger-shaped, names domain + symptoms):
"Git commit message format, branch naming, conventional commits, committing, pushing, or creating pull requests"
Bad description (no trigger, too vague):
"Commit conventions"
Alternatives
coreyhaines31/marketingskills
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
event4u-app/agent-config
Use BEFORE writing/changing tests, adding mocks, or test-only methods on production classes — vs mocking-the-mock, production pollution, partial mocks, and overfit/tautological assertions
event4u-app/agent-config
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
event4u-app/agent-config
Use when writing, generating, or improving Pest tests for Laravel — clear intent, good coverage, maintainable structure, and alignment with project testing conventions.