Skip to content

Commit 604d4e3

Browse files
Benkapnerclaude
andcommitted
refactor: consolidate and clarify skills
- Remove redhat-writing skill (user-specific, not generic workspace) - Merge python-conventions + data-pipeline-patterns → python-patterns (unified team patterns for Python development: credentials, APIs, testing, pipelines) - Clarify brainstorming skill: explicit activation triggers ("design", "how should i build", "plan this out") - Clarify cost-speed-meter skill: explicit use cases ("which is slowest?", "measure before/after optimization") - Add skill dependencies to ai-workspace.toml with explicit mapping of which commands require which skills - Document architecture in SKILLS_ARCHITECTURE.md (always-loaded skills, activation model, dependencies, design rationale) Consolidation reduces cognitive load: one unified python-patterns skill vs three separate convention skills. Clarity improvements let users understand when/how to use each skill. Dependency mapping catches future conflicts earlier. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent b0b02b5 commit 604d4e3

12 files changed

Lines changed: 310 additions & 209 deletions

File tree

‎SKILLS_ARCHITECTURE.md‎

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Skills Architecture
2+
3+
This document maps all skills, their purpose, activation triggers, and relationships.
4+
5+
## Skills Overview
6+
7+
### Core Verification & Review (always available)
8+
9+
**`verification-loop`** — Unified verification engine covering 7 phases: environment check, type check, lint, tests, code review, security scan, pre-push checks. Invoked by `/verify`, `/quality-gate`, and code-review commands. Core skill powering the entire QA workflow.
10+
11+
**`refactoring-patterns`** — Measurement-driven refactoring (profile → refactor → measure). Activates when user says "refactor", "clean up", "simplify", or when code has high complexity. Ensures changes improve metrics, not just code appearance.
12+
13+
**`update-docs`** — Detects stale documentation after code changes by matching diff against in-repo docs. Finds and updates prose that contradicts new code. Auto-activates when implementing features/fixes that rename, remove, or add APIs.
14+
15+
**`security-check`** — Scans for credential leaks, secrets in code, insecure patterns, LLM API key exposure, PII leakage to external services, and `.env/.gitignore` misconfigurations. Runs automatically before commits and when editing credential-related code.
16+
17+
### Python Development (language-specific)
18+
19+
**`python-patterns`** — Unified conventions for team Python development:
20+
- **Credentials:** dotenv loading, fail-fast on missing secrets, `.env.example` patterns
21+
- **API clients:** timeouts (30s), transient retry logic, response validation, LLM response parsing
22+
- **Testing:** TDD workflow, mock external APIs, set `random_state=42`, 80%+ coverage
23+
- **Pipelines:** standard stage structure, JSON metadata, validation-before-processing, fail-fast, checkpointing
24+
25+
Replaces separate `python-conventions` and `data-pipeline-patterns` skills (merged for clarity).
26+
27+
### Design & Workflow
28+
29+
**`brainstorming`** — Design exploration before implementation. Activates when user asks "design", "how should i build", "what's the approach", "plan this out". Proposes 2-3 approaches with trade-offs, gets approval before coding.
30+
31+
**`cost-speed-meter`** — Tracks command execution times (tests, builds, lint) across sessions. Shows trends, detects regressions, suggests fast-path alternatives (unit tests vs integration). Measures if optimizations actually worked.
32+
33+
## Skill Activation Model
34+
35+
| Skill | Activation Type | Trigger |
36+
|-------|-----------------|---------|
37+
| `verification-loop` | Command-invoked | `/verify`, `/quality-gate`, code-review commands |
38+
| `refactoring-patterns` | Declarative | User says "refactor", "simplify", "clean up", or high complexity detected |
39+
| `update-docs` | Declarative | Code changes APIs/configs/CLI flags; user asks "update docs" |
40+
| `security-check` | Declarative | Editing credential/secret handling code; before commits |
41+
| `python-patterns` | Declarative | Editing Python code files (any `.py` file in context) |
42+
| `brainstorming` | Declarative | User explicitly asks for design, planning, or approach exploration |
43+
| `cost-speed-meter` | Automatic | Tracks all bash command execution; invoked via `/metrics` or `/metrics-report` |
44+
45+
## Command Dependencies
46+
47+
Commands that rely on specific skills:
48+
49+
| Command | Requires | Notes |
50+
|---------|----------|-------|
51+
| `/verify` | `verification-loop` | Runs phases 1-4: environment, types, lint, tests |
52+
| `/quality-gate` | `verification-loop` | Runs phases 1-4 + phase 6: plus pre-push security |
53+
| `/refactor-safe` | `verification-loop`, `refactoring-patterns` | Verify code works before refactoring, then measure |
54+
| `/test-coverage` | `verification-loop` | Part of verification loop; finds untested code |
55+
| `/update-docs` | `update-docs` | Standalone; detects stale docs from code changes |
56+
| `/diff-explain` | None | Standalone; explains diffs by intent |
57+
| `/explain-code` | None | Standalone; layered explanation by complexity |
58+
| `/prompt-test` | None | Standalone; tests LLM prompts against samples |
59+
| `/ai-engineer-review` | None | Standalone; architectural review |
60+
| `/changelog` | None | Standalone; generates changelog from commits |
61+
| `/dep-check` | None | Standalone; audits dependencies |
62+
| `/env-check` | None | Standalone; validates local dev environment |
63+
64+
## Removed Skills
65+
66+
**`redhat-writing`** — Deleted. This was user-specific (Red Hat brand voice/style). Does not belong in a generic meta-repo that others clone. Users who need it should add their own CLAUDE.md instructions locally.
67+
68+
**`python-conventions` (merged)** — Consolidated into `python-patterns` with `data-pipeline-patterns`. Both covered Python team conventions; one unified skill is clearer.
69+
70+
**`data-pipeline-patterns` (merged)** — Consolidated into `python-patterns`. Pipeline structure is a specific application of Python conventions, not separate.
71+
72+
## Token Budget
73+
74+
Always-loaded skills (loaded once per session):
75+
- `verification-loop` — ~3KB (core engine)
76+
- `refactoring-patterns` — ~2KB
77+
- `security-check` — ~2KB
78+
- `python-patterns` — ~4KB (credentials, APIs, testing, pipelines)
79+
- `brainstorming` — ~2KB
80+
- `cost-speed-meter` — ~4KB
81+
82+
**Total always-loaded: ~17KB** — under 5% of typical conversation context.
83+
84+
On-demand skills (load only when invoked):
85+
- `update-docs` — ~8KB (detailed multi-step process)
86+
87+
## Design Rationale
88+
89+
1. **Merged python-conventions + data-pipeline-patterns** — Both were "team conventions for Python code." Keeping them separate created confusion about scope. One unified `python-patterns` skill is clearer and avoids redundancy.
90+
91+
2. **Explicit activation in ai-workspace.toml** — Skills can now be tracked as dependencies. Commands that require a skill have it documented. Future refactoring is safer.
92+
93+
3. **Removed redhat-writing from repo** — Generic meta-repo should not include user-specific or organization-specific content. Red Hat employees can add this locally to `~/.claude/CLAUDE.md`.
94+
95+
4. **Clarified brainstorming and cost-speed-meter** — Both had vague triggers ("when to activate"). Rewritten with explicit user-facing conditions (what the user asks for, not implicit context).
96+
97+
5. **Consolidated core verification** — Multiple commands (`/verify`, `/quality-gate`, `/refactor-safe`) all use `verification-loop`. Having them as separate commands is fine; they invoke the same skill with different phase subsets.

‎ai-workspace.toml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,28 @@ commands_paths = [
1818
# Cursor does not parse command frontmatter as metadata
1919
[distribution.commands_overrides]
2020
".cursor/commands" = "strip_frontmatter"
21+
22+
# Skill activation: explicit triggers and command dependencies
23+
[skills]
24+
# Skill-to-commands mapping: which commands invoke which skills
25+
verify = ["verification-loop"]
26+
quality-gate = ["verification-loop"]
27+
refactor-safe = ["verification-loop", "refactoring-patterns"]
28+
test-coverage = ["verification-loop"]
29+
update-docs = ["update-docs"]
30+
diff-explain = [] # standalone command
31+
explain-code = [] # standalone command
32+
prompt-test = [] # standalone command
33+
ai-engineer-review = [] # standalone command
34+
35+
# Skills load declaratively (no manual trigger needed)
36+
# auto-activating = true means description-based activation in CLAUDE.md
37+
# Set to false if this skill should only load when explicitly invoked
38+
[skills.auto-activate]
39+
security-check = true # Triggers when editing code that handles credentials/APIs
40+
verification-loop = true # Powers multiple commands, loads on-demand
41+
python-patterns = true # Triggers when editing Python code
42+
refactoring-patterns = true # Triggers when refactoring
43+
brainstorming = true # Triggers when user asks for design/planning
44+
cost-speed-meter = true # Tracks all command execution automatically
45+
update-docs = false # Activated via /update-docs command

‎skills/brainstorming/SKILL.md‎

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
11
---
22
name: brainstorming
3-
description: "Use when the user asks to design, plan, or explore approaches before implementing — creating features, building components, or adding functionality that would benefit from design exploration first."
3+
description: "User asks for design, planning, or approach exploration before implementation. Covers new features, components, refactors, or architecture decisions. Creates design docs and proposes approaches with trade-offs."
44
---
55

6-
# Brainstorming Ideas Into Designs
6+
# Brainstorming — Design Exploration
77

8-
Help turn ideas into fully formed designs through collaborative dialogue.
8+
Turn ideas into fully formed designs through collaborative dialogue.
99

10-
When this skill activates, present a design before writing code. The design can be short (a few sentences for simple projects) — scale it to the complexity of the task. Get the user's approval before proceeding to implementation.
10+
When triggered, present a design before implementation. The design scales to complexity: short (few sentences) for simple tasks, detailed (pages) for architectural changes. Always get approval before proceeding to code.
11+
12+
## When to Activate
13+
14+
- User explicitly asks: "design this", "how should i build", "what's the approach", "plan this out"
15+
- User describes a feature/component/refactor and asks for guidance before coding
16+
- User wants to explore trade-offs or multiple approaches to a problem
1117

1218
## Process
1319

14-
1. **Explore context** — check files, docs, recent commits
15-
2. **Ask clarifying questions** — one at a time, prefer multiple choice, understand purpose/constraints/success criteria
16-
3. **Propose 2-3 approaches** — with trade-offs and your recommendation
17-
4. **Present design** — scale each section to its complexity, ask after each section if it looks right
18-
5. **Write spec** — save to `docs/specs/` (create directory if needed) and commit
19-
6. **User reviews spec** — wait for approval before proceeding
20-
7. **Transition** — invoke writing-plans skill to create implementation plan
20+
1. **Explore context** — check relevant code files, docs, recent commits
21+
2. **Ask clarifying questions** — one at a time, prefer multiple choice, understand: purpose, constraints, success criteria, scope
22+
3. **Propose 2-3 approaches** — name each, describe trade-offs, state your recommendation
23+
4. **Present design** — scale to complexity (1-2 sentences for trivial, multiple sections for architecture), ask approval after each section
24+
5. **Get approval** — wait for user buy-in before writing code
2125

2226
## Design Principles
2327

24-
- **One question at a time** — don't overwhelm with multiple questions
28+
- **One question at a time** — don't overwhelm
2529
- **YAGNI ruthlessly** — remove unnecessary features
26-
- **Design for isolation** — break into units with one clear purpose, well-defined interfaces, testable independently
27-
- **Explore alternatives** — always propose 2-3 approaches before settling
28-
- **Scope check** — if the request describes multiple independent subsystems, decompose into sub-projects first
30+
- **Design for isolation** — break into units with one purpose, well-defined interfaces, independently testable
31+
- **Explore alternatives** — always 2-3 approaches, with trade-offs
32+
- **Scope check** — if request spans multiple subsystems, decompose first
2933

30-
## Working in Existing Codebases
34+
## In Existing Codebases
3135

32-
- Explore the current structure before proposing changes. Follow existing patterns.
33-
- Where existing code has problems that affect the work, include targeted improvements as part of the design.
34-
- Don't propose unrelated refactoring. Stay focused on what serves the current goal.
36+
- Explore current structure and patterns before proposing changes
37+
- Include targeted fixes only if they block the current goal
38+
- Don't propose unrelated refactoring
3539

36-
## After Design Approval
40+
## Output
3741

38-
Invoke the writing-plans skill to create a detailed implementation plan. Do NOT invoke any other skill — writing-plans is the next step.
42+
Present design as prose (short or detailed based on complexity), then ask: "Does this look right?" Wait for approval before proceeding to implementation.

‎skills/cost-speed-meter/SKILL.md‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
---
22
name: cost-speed-meter
3-
version: "1.0"
4-
description: Track command execution time across sessions. Show which operations are slow, suggest faster paths (unit tests vs integration, cached builds), and measure if optimizations worked. Polyglot language support (Python, Node, Rust, Go).
3+
description: Track command execution times and suggest faster paths. After tests/builds/lint, shows execution cost and recommends fast-path alternatives (unit tests vs integration, cached builds). For feedback loop optimization and proving optimizations worked.
54
---
65

7-
# Cost & Speed Meter Skill
6+
# Cost & Speed Meter
87

9-
Track what's slow. Measure improvements. Suggest faster paths.
8+
Track execution time. Suggest faster paths. Prove optimizations worked.
109

11-
Every bash command execution is timed and stored. Across sessions, you see trends: is your test suite getting slower? Did that optimization work? Should you run unit tests instead of the full suite for quick feedback?
10+
Every bash command is timed and stored. Across sessions, you see trends: is the test suite slower? Did that optimization help? Should you run unit tests instead of full integration tests for faster feedback?
1211

13-
## When to Activate
12+
## When to Use
1413

15-
- After running tests, builds, or lint (timing is tracked automatically)
16-
- When focused on feedback loop speed (which path is fastest?)
17-
- When investigating performance regressions (did something get slower?)
18-
- Before/after optimization work (prove it helped)
19-
- Multi-repo work (compare speed across projects)
14+
- User runs tests, builds, or lint commands — timing is tracked automatically
15+
- User asks: "is this slow?", "how long did that take?", "what's the slowest operation?"
16+
- User asks: "what's a faster way to do this?", "what's the quick feedback loop?"
17+
- User is optimizing something — measure before, optimize, measure after to prove it worked
18+
- Working across multiple repos — compare execution costs
2019

2120
## What It Tracks
2221

‎skills/python-conventions/SKILL.md‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎skills/python-conventions/guidelines.md‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎skills/python-conventions/skills/conventions.md‎

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)