Pattern Library Manager
Purpose
Add, tighten, or document reusable approved patterns and anti-patterns in this bundle without leaking host-project facts into publishable rules.
This skill owns small reusable pattern-library changes: descriptions, bad/good examples, graph links, trigger/output evals, and validation alignment.
When To Use
Use this skill when the user asks to:
- add a reusable approved pattern;
- add a reusable anti-pattern;
- tighten an existing common pattern or anti-pattern;
- add code examples to a pattern or anti-pattern;
- add pattern examples sourced from official documentation or user-provided snippets;
- add eval coverage for a pattern-routing regression;
- update
common/approved-patterns.md, common/anti-patterns.md, or common/anti-patterns/** for reusable behavior.
When Not To Use
Do not use this skill for:
- project-specific patterns or anti-patterns; use local-only
project/** overlays instead;
- general skill creation unrelated to patterns; use
agent-rules-skill-author;
- implementation, bugfix, refactor, visual QA, or review work;
- adding examples copied from private project code into reusable docs;
- adding long third-party code excerpts.
Required Context
- Read
AGENTS.md.
- Read
common/documentation-maintenance.md.
- Read
common/approved-patterns.md or common/anti-patterns.md depending on the requested change.
- Read the existing target pattern or anti-pattern file when modifying one.
- Read
references/pattern-entry-template.md before creating a new entry.
- Read
references/example-sourcing-policy.md before adding code examples.
- Read
evals/trigger-evals.json or evals/output-evals.json when routing or output behavior changes.
Tool Contract
- Use the
project_files capability for repository file reads and writes.
- May use official documentation or trusted maintainer sources to understand a pattern when examples are not supplied by the user.
- Activate
openai_platform_docs only when a reusable pattern depends on current OpenAI or Codex behavior.
- Must propose sourced examples to the user before committing them when they come from external material or host-project-specific context.
- Must write original, short examples instead of copying long third-party code.
- Must not install packages, change runtime code, create tests, or modify host-project documentation.
- Must not use Figma MCP.
Workflow
- Classify the requested change as approved pattern, anti-pattern, example-only update, tightening, or eval coverage.
- Decide whether the change is reusable bundle policy or host-project local guidance.
- If the pattern is project-specific, stop and route to a local-only
project/** overlay plan.
- For reusable changes, inspect the current common rule or anti-pattern index.
- Define the rule, allowed exceptions, bad example, good example, apply-when guidance, and validation impact.
- Ask the user for examples when the requested pattern depends on a concrete code shape not already provided.
- If examples are not supplied, use official or trusted sources only to understand the pattern, then write short original examples and propose them for user approval before committing.
- Add or update the smallest owning file:
common/approved-patterns.md for positive reusable patterns;
common/anti-patterns.md for the index and routing summary;
common/anti-patterns/<name>.md for concrete anti-patterns with examples.
- Update graph links so new documents have incoming edges.
- Add trigger or output evals when the change prevents a real routing or behavior regression.
- Run the relevant skill/bundle validators when available.
Output Contract
Final response: return only facts that affect the user's understanding, confidence, or next action. Omit empty fields and workflow narration.
Report:
Pattern change:
Reusable or local-only decision:
Files changed:
Examples added or proposed:
Source or user example basis:
Eval changes:
Validation:
Risks:
Validation Gates
- Reusable pattern docs must not contain host-project facts.
- Bad/good examples must be short, original, and scoped to the rule.
- External examples must be source-backed and user-approved before committing when they shape the final code example.
- New anti-pattern files must be linked from
common/anti-patterns.md or common/anti-patterns/README.md.
- Pattern changes must not create tests, packages, runtime code, or host documentation edits.
- Every changed reusable Markdown file must keep graph frontmatter and English rule text.
Trigger Evals
Should trigger:
- "Add an anti-pattern for parallel status booleans with bad and good TypeScript examples."
- "Tighten the useCallback anti-pattern and add eval coverage."
- "Add a reusable pattern for discriminated request statuses."
- "Add examples to this anti-pattern, ask me before using project-specific snippets."
Should not trigger:
- "Create a new feature workflow skill."
- "Implement this React component."
- "Add a project-specific pattern from this app into .agents/project."
- "Review this PR for quality."
Reference Map
references/pattern-entry-template.md
references/example-sourcing-policy.md
common/approved-patterns.md
common/anti-patterns.md
common/documentation-maintenance.md
skills/agent-rules-skill-author/SKILL.md
1---2name: pattern-library-manager3description: Add or tighten reusable approved patterns and anti-patterns in common/** with source-backed examples, approvals, graph links, evals, and validation. Keep project-specific patterns in local-only project/**.4---56# Pattern Library Manager78## Purpose910Add, tighten, or document reusable approved patterns and anti-patterns in this bundle without leaking host-project facts into publishable rules.1112This skill owns small reusable pattern-library changes: descriptions, bad/good examples, graph links, trigger/output evals, and validation alignment.1314## When To Use1516Use this skill when the user asks to:1718- add a reusable approved pattern;19- add a reusable anti-pattern;20- tighten an existing common pattern or anti-pattern;21- add code examples to a pattern or anti-pattern;22- add pattern examples sourced from official documentation or user-provided snippets;23- add eval coverage for a pattern-routing regression;24- update `common/approved-patterns.md`, `common/anti-patterns.md`, or `common/anti-patterns/**` for reusable behavior.2526## When Not To Use2728Do not use this skill for:2930- project-specific patterns or anti-patterns; use local-only `project/**` overlays instead;31- general skill creation unrelated to patterns; use `agent-rules-skill-author`;32- implementation, bugfix, refactor, visual QA, or review work;33- adding examples copied from private project code into reusable docs;34- adding long third-party code excerpts.3536## Required Context37381. Read `AGENTS.md`.392. Read `common/documentation-maintenance.md`.403. Read `common/approved-patterns.md` or `common/anti-patterns.md` depending on the requested change.414. Read the existing target pattern or anti-pattern file when modifying one.425. Read `references/pattern-entry-template.md` before creating a new entry.436. Read `references/example-sourcing-policy.md` before adding code examples.447. Read `evals/trigger-evals.json` or `evals/output-evals.json` when routing or output behavior changes.4546## Tool Contract4748- Use the `project_files` capability for repository file reads and writes.49- May use official documentation or trusted maintainer sources to understand a pattern when examples are not supplied by the user.50- Activate `openai_platform_docs` only when a reusable pattern depends on current OpenAI or Codex behavior.51- Must propose sourced examples to the user before committing them when they come from external material or host-project-specific context.52- Must write original, short examples instead of copying long third-party code.53- Must not install packages, change runtime code, create tests, or modify host-project documentation.54- Must not use Figma MCP.5556## Workflow57581. Classify the requested change as approved pattern, anti-pattern, example-only update, tightening, or eval coverage.592. Decide whether the change is reusable bundle policy or host-project local guidance.603. If the pattern is project-specific, stop and route to a local-only `project/**` overlay plan.614. For reusable changes, inspect the current common rule or anti-pattern index.625. Define the rule, allowed exceptions, bad example, good example, apply-when guidance, and validation impact.636. Ask the user for examples when the requested pattern depends on a concrete code shape not already provided.647. If examples are not supplied, use official or trusted sources only to understand the pattern, then write short original examples and propose them for user approval before committing.658. Add or update the smallest owning file:66 - `common/approved-patterns.md` for positive reusable patterns;67 - `common/anti-patterns.md` for the index and routing summary;68 - `common/anti-patterns/<name>.md` for concrete anti-patterns with examples.699. Update graph links so new documents have incoming edges.7010. Add trigger or output evals when the change prevents a real routing or behavior regression.7111. Run the relevant skill/bundle validators when available.7273## Output Contract7475Final response: return only facts that affect the user's understanding, confidence, or next action. Omit empty fields and workflow narration.7677Report:7879```text80Pattern change:81Reusable or local-only decision:82Files changed:83Examples added or proposed:84Source or user example basis:85Eval changes:86Validation:87Risks:88```8990## Validation Gates9192- Reusable pattern docs must not contain host-project facts.93- Bad/good examples must be short, original, and scoped to the rule.94- External examples must be source-backed and user-approved before committing when they shape the final code example.95- New anti-pattern files must be linked from `common/anti-patterns.md` or `common/anti-patterns/README.md`.96- Pattern changes must not create tests, packages, runtime code, or host documentation edits.97- Every changed reusable Markdown file must keep graph frontmatter and English rule text.9899## Trigger Evals100101Should trigger:102103- "Add an anti-pattern for parallel status booleans with bad and good TypeScript examples."104- "Tighten the useCallback anti-pattern and add eval coverage."105- "Add a reusable pattern for discriminated request statuses."106- "Add examples to this anti-pattern, ask me before using project-specific snippets."107108Should not trigger:109110- "Create a new feature workflow skill."111- "Implement this React component."112- "Add a project-specific pattern from this app into .agents/project."113- "Review this PR for quality."114115## Reference Map116117- `references/pattern-entry-template.md`118- `references/example-sourcing-policy.md`119- `common/approved-patterns.md`120- `common/anti-patterns.md`121- `common/documentation-maintenance.md`122- `skills/agent-rules-skill-author/SKILL.md`