Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agents/database-engineer/references/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ user = session.query(User).filter(User.id == user_id).first()

---

### Avoid Functions on Indexed Columns in WHERE
### Use Raw Columns in WHERE Clauses for Index Hits
**Detection**:
```bash
# Find function calls wrapping column names in WHERE clauses
Expand Down
2 changes: 1 addition & 1 deletion agents/golang-general-engineer/references/go-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ if errors.As(err, &validationErr) {
- Add context to wrapped errors
- Use `errors.Is()` to check for specific errors
- Use `errors.As()` to extract error details
- Don't wrap errors you want to hide
- Return errors unwrapped when callers should not match them with errors.Is

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ for line in f:
# Stops reading after finding the match -- O(1) best case
```

Avoid loading the entire file into memory and iterating through it. Parse only what is needed, and exit as soon as the relevant data is found.
Parse only what is needed and exit as soon as the relevant data is found. Read files incrementally rather than loading entire contents into memory.

**Why this matters**: Hooks fire on every tool call. A hook that takes 200ms adds 200ms to every Read, Edit, Write, and Bash invocation. At 50+ tool calls per session, that is 10+ seconds of pure overhead.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ onINP(sendToAnalytics, { reportAllChanges: true }) // INP updates on each intera

### Sampling Strategy for High-Traffic Sites

Don't send 100% of metric events — use sampling to reduce costs without losing statistical significance.
Sample metric events (1-10%) to reduce costs while maintaining statistical significance.

```typescript
const SAMPLE_RATE = 0.1 // 10% sample
Expand Down
2 changes: 1 addition & 1 deletion agents/python-general-engineer/references/python-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if __name__ == "__main__":
**Prevention**:
- Only use `asyncio.run()` at the top level of scripts
- In notebooks, use `await` directly
- Don't nest `asyncio.run()` calls
- Use a single top-level `asyncio.run()` and await coroutines within it

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ it('calculates discount', () => {

**Why it's wrong:**
- Tests give false confidence - they pass even when code broken
- Don't actually verify correct behavior
- Fail to verify correct behavior
- Waste CI/CD time without providing value
- Can mask regressions and bugs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ interface ApiResponse<T> {
```

**When to use**:
- NEVER use `any` without explicit justification
- If absolutely necessary, add a comment explaining why
- Use specific types; when `any` is unavoidable, add a comment explaining why
- Consider `unknown` instead - forces type checking before use

---
Expand Down Expand Up @@ -299,10 +298,8 @@ const edgeCase = complexTypeFunction(input)
```

**When to use**:
- NEVER use `@ts-ignore` or `@ts-nocheck` without thorough justification
- If used, add detailed comment explaining WHY and what's being ignored
- Replace `@ts-ignore` with `@ts-expect-error` (provides compile-time checking); add a comment when suppression is necessary
- Link to GitHub issue if it's a TypeScript bug
- Prefer `@ts-expect-error` over `@ts-ignore` (fails if error is fixed)

---

Expand Down
31 changes: 27 additions & 4 deletions scripts/bulk_fix_instruction_joy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,35 @@
"CLAUDE.md",
]
SAFE_REWRITES = {
"## Anti-Patterns": "## Patterns to Detect and Fix",
"## Common Anti-Patterns": "## Common Patterns to Detect and Fix",
"## Anti-Pattern Catalog": "## Pattern Catalog",
"## Operational Anti-Patterns": "## Operational Patterns to Detect and Fix",
# Heading-level Anti-Pattern renames (mechanical, domain-independent)
"## Anti-Patterns": "## Common Failure Modes",
"### Anti-Patterns": "### Common Failure Modes",
"## Common Anti-Patterns": "## Common Failure Modes",
"## Anti-Pattern Catalog": "## Failure Mode Catalog",
"## Operational Anti-Patterns": "## Operational Failure Modes",
"## Anti-Patterns in Runbook Authoring": "## Runbook Authoring Failure Modes",
"### Anti-Patterns (never produce these)": "### Failure Modes (detect and fix these)",
"### FORBIDDEN Patterns (HARD GATE)": "### Hard Gate Patterns",
"### Anti-Pattern Checklist: What NOT To Do": "### Pattern Checklist: What to Detect and Fix",
# Domain-specific Anti-Pattern headings
"## Vendor Management Anti-Patterns": "## Vendor Management Failure Modes",
"## Triage Anti-Patterns": "## Triage Failure Modes",
"## Risk Assessment Anti-Patterns": "## Risk Assessment Failure Modes",
"### Retro Anti-Patterns with Corrections": "### Retro Failure Modes with Corrections",
"### Reorg Anti-Patterns": "### Reorg Failure Modes",
"### Question Design Anti-Patterns": "### Question Design Failure Modes",
"## Process Documentation Anti-Patterns": "## Process Documentation Failure Modes",
"### Planning Anti-Patterns with Corrections": "### Planning Failure Modes with Corrections",
"### Org Design Anti-Patterns": "### Org Design Failure Modes",
"### Onboarding Anti-Patterns": "### Onboarding Failure Modes",
"## KB Quality Anti-Patterns": "## KB Quality Failure Modes",
"### Follow-Up Anti-Patterns": "### Follow-Up Failure Modes",
"#### Feedback Anti-Patterns": "#### Feedback Failure Modes",
"### De-escalation Anti-Patterns": "### De-escalation Failure Modes",
"### Dashboard Anti-Patterns": "### Dashboard Failure Modes",
"## Critique Anti-Patterns to Avoid": "## Critique Failure Modes",
"### Common Funnel Anti-Patterns": "### Common Funnel Failure Modes",
"## Change Management Anti-Patterns": "## Change Management Failure Modes",
}
PRIMARY_PATTERNS = [
("NEVER", re.compile(r"\bNEVER\b")),
Expand Down
4 changes: 2 additions & 2 deletions scripts/tests/test_bulk_fix_instruction_joy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_scan_file_marks_safe_heading_rewrite(tmp_path: Path) -> None:
path.write_text("## Anti-Patterns\n\nBody\n", encoding="utf-8")
findings = _mod.scan_file(path)
assert len(findings) == 1
assert findings[0].safe_fix == "## Patterns to Detect and Fix"
assert findings[0].safe_fix == "## Common Failure Modes"


def test_apply_safe_rewrites_rewrites_heading_only(tmp_path: Path) -> None:
Expand All @@ -26,7 +26,7 @@ def test_apply_safe_rewrites_rewrites_heading_only(tmp_path: Path) -> None:
changed = _mod.apply_safe_rewrites(path)
assert changed == 2
text = path.read_text(encoding="utf-8")
assert "## Patterns to Detect and Fix" in text
assert "## Common Failure Modes" in text
assert "### Hard Gate Patterns" in text


Expand Down
4 changes: 4 additions & 0 deletions scripts/validate_positive_instruction_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
# not toolkit operator instructions. Contextual exception per instruction-rubric.md.
"voice-andy-nemmity",
"voice-vexjoy",
# PHILOSOPHY.md uses negative patterns as quoted examples in a teaching table
# (e.g. "NEVER edit code directly" → "Route all code modifications...").
# The patterns are the subject, not instructions.
"PHILOSOPHY.md",
)


Expand Down
4 changes: 2 additions & 2 deletions skills/business/customer-support/references/knowledge-base.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ Billing & Account
| FAQ | Detailed article | "For a full walkthrough, see [Guide]" |
| Known issue | Workaround | Keep problem-to-solution chain short |

Avoid circular links unless both articles are genuinely useful entry points. Use relative links within the KB -- they survive restructuring.
Link articles in one direction unless both are genuinely useful entry points. Use relative links within the KB they survive restructuring.

---

Expand Down Expand Up @@ -397,7 +397,7 @@ Transform the ticket-specific resolution into a general guide:

---

## KB Quality Anti-Patterns
## KB Quality Failure Modes

| Anti-Pattern | Problem | Fix |
|-------------|---------|-----|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ When a customer is angry, frustrated, or escalating. The goal is not to win an a
| "You need to..." | "Here's how to resolve this: [steps]" | Directive language feels adversarial under stress |

<!-- no-pair-required: anti-patterns are self-explanatory failure modes; positive approach is in surrounding context -->
### De-escalation Anti-Patterns
### De-escalation Failure Modes

| Anti-Pattern | Why It Fails |
|-------------|-------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Every triage produces this structured output:

---

## Triage Anti-Patterns
## Triage Failure Modes

| Anti-Pattern | Problem | Correct Approach |
|-------------|---------|-----------------|
Expand Down
2 changes: 1 addition & 1 deletion skills/business/design/references/design-critique.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Simulate a new user attempting a specific task. For each step:

---

## Critique Anti-Patterns to Avoid
## Critique Failure Modes

| Anti-pattern | Do instead |
|-------------|-----------|
Expand Down
2 changes: 1 addition & 1 deletion skills/business/finance/references/variance-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Every narrative must be:
| Actionable | Identifies required follow-up or decision |
| Concise | 2-4 sentences. No filler |

### Anti-Patterns (never produce these)
### Failure Modes (detect and fix these)

| Anti-Pattern | Why It Fails | Fix |
|-------------|-------------|-----|
Expand Down
4 changes: 2 additions & 2 deletions skills/business/hr/references/org-planning.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Headcount modeling, org design principles, capacity planning, and people analyti
| Single points of failure | 0 critical | 1-2 | >3 (bus factor risk) |
| Skip-level ratio | Every IC has skip-level access | Some don't | No skip-levels happening |

### Org Design Anti-Patterns
### Org Design Failure Modes

| Anti-Pattern | Symptom | Root Cause | Fix |
|-------------|---------|-----------|-----|
Expand Down Expand Up @@ -230,7 +230,7 @@ Composite risk score based on multiple factors:
| **Team kickoff** | Week 1 | New teams | Mission, priorities, working agreements |
| **30-day check-in** | Day 30 | All affected | How's it going, what needs adjustment |

### Reorg Anti-Patterns
### Reorg Failure Modes

| Anti-Pattern | Risk | Prevention |
|-------------|------|-----------|
Expand Down
2 changes: 1 addition & 1 deletion skills/business/hr/references/performance-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Purpose: Document performance assessment, provide development guidance, justify
| Gap identification | "You're strong at execution. The gap I see is in proactive communication — stakeholders are sometimes surprised by delays." | Names the specific gap between current and expected. |
| Frequency + evidence | "In the last quarter, 3 of 5 project updates were late by more than a day. Let's discuss what's causing this." | Data-driven. Not "you're always late." |

#### Feedback Anti-Patterns
#### Feedback Failure Modes

| Anti-Pattern | Problem | Better |
|-------------|---------|--------|
Expand Down
4 changes: 2 additions & 2 deletions skills/business/hr/references/recruiting.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ For each role, define 4-6 competencies. Each competency gets dedicated interview
| Trained interviewers | Everyone on the panel has completed structured interviewing training. |
| Consistent questions | Same question set per competency across all candidates for the same role. |

### Question Design Anti-Patterns
### Question Design Failure Modes

| Anti-Pattern | Problem | Better Approach |
|-------------|---------|-----------------|
Expand Down Expand Up @@ -182,7 +182,7 @@ Date: [Date] | Panel: [Names]
| **Days 31-60** | Contribute | Delivers independently on scoped work. Participates in reviews. Identifies one improvement. |
| **Days 61-90** | Own | Owns a workstream. Contributes to planning. Can onboard the next new hire. |

### Onboarding Anti-Patterns
### Onboarding Failure Modes

| Anti-Pattern | Problem | Fix |
|-------------|---------|-----|
Expand Down
2 changes: 1 addition & 1 deletion skills/business/legal/references/legal-writing.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ to any other legal holds, those obligations remain in effect.

## Escalation Triggers

Before generating ANY templated legal response, check these triggers. If any fire, do NOT generate a templated response -- recommend escalation instead.
Before generating ANY templated legal response, check these triggers. If any fire, recommend escalation to qualified counsel instead of generating a template.

### Universal Triggers (All Categories)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Legal analysis has properties that amplify LLM weaknesses:
- LLM provides citation with unusual confidence (no hedging language)

**Mitigation:**
- NEVER present a case citation, statute number, or regulatory reference as authoritative without instructing the user to verify
- Mark every case citation, statute number, and regulatory reference as "requires verification" and instruct the user to confirm with primary sources
- Use hedging: "regulations such as..." or "provisions similar to..." rather than citing specific sections
- For well-known, foundational statutes (GDPR, CCPA, HIPAA), cite the act name and general provision (e.g., "GDPR Article 28") but avoid citing specific subsections unless highly confident
- When the user needs specific citations, recommend legal research tools (Westlaw, Lexis, regulatory authority websites)
Expand Down
6 changes: 3 additions & 3 deletions skills/business/marketing/references/content-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,14 @@ The voice stays constant. Tone adjusts to context.
#### Inclusive Language Rules

- Gender-neutral: they/them for unknown individuals
- Avoid ableist language ("crazy", "blind spot", "lame")
- Use inclusive alternatives for ableist terms ("unexpected" for "crazy", "oversight" for "blind spot", "weak" for "lame")
- "Simple" or "straightforward" instead of "easy" (easy varies by person)
- Avoid culturally specific idioms that don't translate
- Use universally understood phrasing over culturally specific idioms

#### Competitor and Category Terms

- Use your preferred category framing, not the competitor's
- Avoid terms competitors coined (reinforces their positioning)
- Use original terminology over competitor-coined terms (which reinforce their positioning)
- Refer to competitors generically unless direct comparison is the point
- Define your differentiation language and use it consistently

Expand Down
2 changes: 1 addition & 1 deletion skills/business/marketing/references/email-sequences.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Map each email to a specific stage:
- Under 50 characters (35-40 optimal for mobile)
- No ALL CAPS words
- No excessive punctuation (!!!, ???)
- Avoid spam triggers: free, act now, limited time, congratulations, click here
- Replace spam-trigger words (free, act now, limited time, congratulations, click here) with specific value statements
- Preview text complements -- never repeats -- the subject line
- Always provide 2-3 options per email for A/B testing

Expand Down
2 changes: 1 addition & 1 deletion skills/business/operations/references/change-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ Rollback procedures must be tested before the change. An untested rollback is a

---

## Change Management Anti-Patterns
## Change Management Failure Modes

| Anti-Pattern | Symptom | Fix |
|-------------|---------|-----|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Annual value: 3hr × 48 weeks × $75/hr loaded cost = $10,800

---

## Process Documentation Anti-Patterns
## Process Documentation Failure Modes

| Anti-Pattern | Symptom | Fix |
|-------------|---------|-----|
Expand Down
2 changes: 1 addition & 1 deletion skills/business/operations/references/risk-assessment.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Maintain evidence that risk management is active, not just documented.

---

## Risk Assessment Anti-Patterns
## Risk Assessment Failure Modes

| Anti-Pattern | Symptom | Fix |
|-------------|---------|-----|
Expand Down
2 changes: 1 addition & 1 deletion skills/business/operations/references/runbook-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Review the runbook when any of these occur:

---

## Anti-Patterns in Runbook Authoring
## Runbook Authoring Failure Modes

| Anti-Pattern | Example | Fix |
|-------------|---------|-----|
Expand Down
2 changes: 1 addition & 1 deletion skills/business/operations/references/vendor-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Every vendor relationship should have an exit plan. Not because you plan to leav

---

## Vendor Management Anti-Patterns
## Vendor Management Failure Modes

| Anti-Pattern | Symptom | Fix |
|-------------|---------|-----|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ KR3: 3 core workflows with >80% task completion rate
- **Beware averages**: Mean time-to-activate can be misleading if the distribution is bimodal. Use median or percentiles.
- **Attribution**: If you changed multiple things, you cannot attribute funnel changes to one change. Run A/B tests for causal claims.

### Common Funnel Anti-Patterns
### Common Funnel Failure Modes

| Anti-Pattern | Problem | Fix |
|-------------|---------|-----|
Expand Down Expand Up @@ -327,7 +327,7 @@ Possible explanations:
└────────────────────────────────────────┘
```

### Dashboard Anti-Patterns
### Dashboard Failure Modes

| Anti-Pattern | Why It Fails |
|-------------|-------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Non-Goals:
| **S**mall | Completable in one sprint |
| **T**estable | Clear verification path |

### Anti-Patterns
### Common Failure Modes

| Pattern | Problem | Fix |
|---------|---------|-----|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Match task difficulty to energy state. Most knowledge workers have predictable e
- If more than 3 hours of meetings, only 2 Top 3 items are realistic. Acknowledge this explicitly.
- Buffer time is not optional — unplanned work always appears. Plans without buffers fail by noon.

### Planning Anti-Patterns with Corrections
### Planning Failure Modes with Corrections

| Anti-Pattern | What Goes Wrong | Do Instead |
|-------------|----------------|------------|
Expand Down
2 changes: 1 addition & 1 deletion skills/business/productivity/references/status-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ The simplest effective retro format.
- What can we change? (specific action, not aspiration)
5. **Decide** (5 min): Pick 1-2 action items. Each has an owner and a deadline. More than 2 actions from a single retro dilutes focus.

### Retro Anti-Patterns with Corrections
### Retro Failure Modes with Corrections

| Anti-Pattern | What Goes Wrong | Do Instead |
|-------------|----------------|------------|
Expand Down
2 changes: 1 addition & 1 deletion skills/business/sales/references/outreach-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Total email: under 150 words. 5 sentences is ideal. 7 sentences is the hard max.
| Follow-up 3 | Day 14 | Break-up email (creates urgency through scarcity) |
| LinkedIn touch | Day 5-10 | Parallel channel. Connection request or engage with their content. |

### Follow-Up Anti-Patterns
### Follow-Up Failure Modes

| Bad Follow-Up | Why It Fails | Instead |
|--------------|-------------|---------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if not items:

---

### Avoid Mutable Default Arguments (B006)
### Use Immutable Default Arguments (B006)

**Detection**:
```bash
Expand Down
Loading