oh-my-customcode 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -12
- package/dist/cli/index.js +518 -274
- package/dist/index.js +304 -101
- package/package.json +1 -1
- package/templates/.claude/agents/db-postgres-expert.md +106 -0
- package/templates/.claude/agents/db-redis-expert.md +101 -0
- package/templates/.claude/agents/de-airflow-expert.md +71 -0
- package/templates/.claude/agents/de-dbt-expert.md +72 -0
- package/templates/.claude/agents/de-kafka-expert.md +81 -0
- package/templates/.claude/agents/de-pipeline-expert.md +92 -0
- package/templates/.claude/agents/de-snowflake-expert.md +89 -0
- package/templates/.claude/agents/de-spark-expert.md +80 -0
- package/templates/.claude/rules/SHOULD-agent-teams.md +47 -1
- package/templates/.claude/skills/airflow-best-practices/SKILL.md +56 -0
- package/templates/.claude/skills/dbt-best-practices/SKILL.md +54 -0
- package/templates/.claude/skills/de-lead-routing/SKILL.md +230 -0
- package/templates/.claude/skills/dev-lead-routing/SKILL.md +15 -0
- package/templates/.claude/skills/kafka-best-practices/SKILL.md +52 -0
- package/templates/.claude/skills/pipeline-architecture-patterns/SKILL.md +83 -0
- package/templates/.claude/skills/postgres-best-practices/SKILL.md +66 -0
- package/templates/.claude/skills/redis-best-practices/SKILL.md +83 -0
- package/templates/.claude/skills/secretary-routing/SKILL.md +12 -0
- package/templates/.claude/skills/snowflake-best-practices/SKILL.md +65 -0
- package/templates/.claude/skills/spark-best-practices/SKILL.md +52 -0
- package/templates/.codex/agents/arch-documenter.md +97 -0
- package/templates/.codex/agents/arch-speckit-agent.md +134 -0
- package/templates/.codex/agents/be-express-expert.md +80 -0
- package/templates/.codex/agents/be-fastapi-expert.md +43 -0
- package/templates/.codex/agents/be-go-backend-expert.md +43 -0
- package/templates/.codex/agents/be-nestjs-expert.md +60 -0
- package/templates/.codex/agents/be-springboot-expert.md +85 -0
- package/templates/.codex/agents/db-postgres-expert.md +106 -0
- package/templates/.codex/agents/db-redis-expert.md +101 -0
- package/templates/.codex/agents/db-supabase-expert.md +71 -0
- package/templates/.codex/agents/de-airflow-expert.md +71 -0
- package/templates/.codex/agents/de-dbt-expert.md +72 -0
- package/templates/.codex/agents/de-kafka-expert.md +81 -0
- package/templates/.codex/agents/de-pipeline-expert.md +92 -0
- package/templates/.codex/agents/de-snowflake-expert.md +89 -0
- package/templates/.codex/agents/de-spark-expert.md +80 -0
- package/templates/.codex/agents/fe-svelte-agent.md +65 -0
- package/templates/.codex/agents/fe-vercel-agent.md +69 -0
- package/templates/.codex/agents/fe-vuejs-agent.md +65 -0
- package/templates/.codex/agents/infra-aws-expert.md +47 -0
- package/templates/.codex/agents/infra-docker-expert.md +47 -0
- package/templates/.codex/agents/lang-golang-expert.md +43 -0
- package/templates/.codex/agents/lang-java21-expert.md +65 -0
- package/templates/.codex/agents/lang-kotlin-expert.md +43 -0
- package/templates/.codex/agents/lang-python-expert.md +43 -0
- package/templates/.codex/agents/lang-rust-expert.md +43 -0
- package/templates/.codex/agents/lang-typescript-expert.md +43 -0
- package/templates/.codex/agents/mgr-claude-code-bible.md +246 -0
- package/templates/.codex/agents/mgr-creator.md +120 -0
- package/templates/.codex/agents/mgr-gitnerd.md +113 -0
- package/templates/.codex/agents/mgr-sauron.md +154 -0
- package/templates/.codex/agents/mgr-supplier.md +120 -0
- package/templates/.codex/agents/mgr-sync-checker.md +99 -0
- package/templates/.codex/agents/mgr-updater.md +103 -0
- package/templates/.codex/agents/qa-engineer.md +96 -0
- package/templates/.codex/agents/qa-planner.md +74 -0
- package/templates/.codex/agents/qa-writer.md +97 -0
- package/templates/.codex/agents/sys-memory-keeper.md +117 -0
- package/templates/.codex/agents/sys-naggy.md +90 -0
- package/templates/.codex/agents/tool-bun-expert.md +71 -0
- package/templates/.codex/agents/tool-npm-expert.md +88 -0
- package/templates/.codex/agents/tool-optimizer.md +87 -0
- package/templates/.codex/codex-native-hash.txt +1 -0
- package/templates/.codex/contexts/dev.md +20 -0
- package/templates/.codex/contexts/ecomode.md +63 -0
- package/templates/.codex/contexts/index.yaml +41 -0
- package/templates/.codex/contexts/research.md +28 -0
- package/templates/.codex/contexts/review.md +23 -0
- package/templates/.codex/hooks/hooks.json +151 -0
- package/templates/.codex/install-hooks.sh +100 -0
- package/templates/.codex/rules/MAY-optimization.md +93 -0
- package/templates/.codex/rules/MUST-agent-design.md +162 -0
- package/templates/.codex/rules/MUST-agent-identification.md +108 -0
- package/templates/.codex/rules/MUST-continuous-improvement.md +132 -0
- package/templates/.codex/rules/MUST-intent-transparency.md +199 -0
- package/templates/.codex/rules/MUST-language-policy.md +62 -0
- package/templates/.codex/rules/MUST-orchestrator-coordination.md +471 -0
- package/templates/.codex/rules/MUST-parallel-execution.md +469 -0
- package/templates/.codex/rules/MUST-permissions.md +84 -0
- package/templates/.codex/rules/MUST-safety.md +69 -0
- package/templates/.codex/rules/MUST-sync-verification.md +281 -0
- package/templates/.codex/rules/MUST-tool-identification.md +195 -0
- package/templates/.codex/rules/SHOULD-agent-teams.md +183 -0
- package/templates/.codex/rules/SHOULD-ecomode.md +145 -0
- package/templates/.codex/rules/SHOULD-error-handling.md +102 -0
- package/templates/.codex/rules/SHOULD-hud-statusline.md +112 -0
- package/templates/.codex/rules/SHOULD-interaction.md +103 -0
- package/templates/.codex/rules/SHOULD-memory-integration.md +132 -0
- package/templates/.codex/rules/index.yaml +141 -0
- package/templates/.codex/skills/airflow-best-practices/SKILL.md +56 -0
- package/templates/.codex/skills/audit-agents/SKILL.md +116 -0
- package/templates/.codex/skills/aws-best-practices/SKILL.md +280 -0
- package/templates/.codex/skills/claude-code-bible/SKILL.md +180 -0
- package/templates/.codex/skills/claude-code-bible/scripts/fetch-docs.js +244 -0
- package/templates/.codex/skills/create-agent/SKILL.md +91 -0
- package/templates/.codex/skills/dbt-best-practices/SKILL.md +54 -0
- package/templates/.codex/skills/de-lead-routing/SKILL.md +230 -0
- package/templates/.codex/skills/dev-lead-routing/SKILL.md +253 -0
- package/templates/.codex/skills/dev-refactor/SKILL.md +123 -0
- package/templates/.codex/skills/dev-review/SKILL.md +81 -0
- package/templates/.codex/skills/docker-best-practices/SKILL.md +275 -0
- package/templates/.codex/skills/fastapi-best-practices/SKILL.md +270 -0
- package/templates/.codex/skills/fix-refs/SKILL.md +107 -0
- package/templates/.codex/skills/go-backend-best-practices/SKILL.md +338 -0
- package/templates/.codex/skills/go-best-practices/CLAUDE.md +9 -0
- package/templates/.codex/skills/go-best-practices/SKILL.md +203 -0
- package/templates/.codex/skills/help/SKILL.md +125 -0
- package/templates/.codex/skills/intent-detection/SKILL.md +215 -0
- package/templates/.codex/skills/intent-detection/patterns/agent-triggers.yaml +349 -0
- package/templates/.codex/skills/kafka-best-practices/SKILL.md +52 -0
- package/templates/.codex/skills/kotlin-best-practices/SKILL.md +256 -0
- package/templates/.codex/skills/lists/SKILL.md +78 -0
- package/templates/.codex/skills/memory-management/SKILL.md +195 -0
- package/templates/.codex/skills/memory-recall/SKILL.md +152 -0
- package/templates/.codex/skills/memory-save/SKILL.md +126 -0
- package/templates/.codex/skills/monitoring-setup/SKILL.md +115 -0
- package/templates/.codex/skills/npm-audit/SKILL.md +72 -0
- package/templates/.codex/skills/npm-publish/SKILL.md +63 -0
- package/templates/.codex/skills/npm-version/SKILL.md +75 -0
- package/templates/.codex/skills/optimize-analyze/SKILL.md +55 -0
- package/templates/.codex/skills/optimize-bundle/SKILL.md +67 -0
- package/templates/.codex/skills/optimize-report/SKILL.md +74 -0
- package/templates/.codex/skills/pipeline-architecture-patterns/SKILL.md +83 -0
- package/templates/.codex/skills/postgres-best-practices/SKILL.md +66 -0
- package/templates/.codex/skills/python-best-practices/SKILL.md +222 -0
- package/templates/.codex/skills/qa-lead-routing/SKILL.md +277 -0
- package/templates/.codex/skills/react-best-practices/SKILL.md +101 -0
- package/templates/.codex/skills/redis-best-practices/SKILL.md +83 -0
- package/templates/.codex/skills/result-aggregation/SKILL.md +164 -0
- package/templates/.codex/skills/rust-best-practices/SKILL.md +267 -0
- package/templates/.codex/skills/sauron-watch/SKILL.md +144 -0
- package/templates/.codex/skills/secretary-routing/SKILL.md +190 -0
- package/templates/.codex/skills/snowflake-best-practices/SKILL.md +65 -0
- package/templates/.codex/skills/spark-best-practices/SKILL.md +52 -0
- package/templates/.codex/skills/springboot-best-practices/SKILL.md +357 -0
- package/templates/.codex/skills/status/SKILL.md +153 -0
- package/templates/.codex/skills/supabase-postgres-best-practices/SKILL.md +99 -0
- package/templates/.codex/skills/typescript-best-practices/SKILL.md +321 -0
- package/templates/.codex/skills/update-docs/SKILL.md +140 -0
- package/templates/.codex/skills/update-external/SKILL.md +149 -0
- package/templates/.codex/skills/vercel-deploy/SKILL.md +73 -0
- package/templates/.codex/skills/web-design-guidelines/SKILL.md +118 -0
- package/templates/.codex/skills/writing-clearly-and-concisely/SKILL.md +64 -0
- package/templates/.codex/uninstall-hooks.sh +52 -0
- package/templates/AGENTS.md.en +39 -0
- package/templates/AGENTS.md.ko +39 -0
- package/templates/CLAUDE.md.en +7 -5
- package/templates/CLAUDE.md.ko +7 -5
- package/templates/guides/airflow/README.md +32 -0
- package/templates/guides/dbt/README.md +32 -0
- package/templates/guides/iceberg/README.md +49 -0
- package/templates/guides/kafka/README.md +32 -0
- package/templates/guides/postgres/README.md +58 -0
- package/templates/guides/redis/README.md +50 -0
- package/templates/guides/snowflake/README.md +32 -0
- package/templates/guides/spark/README.md +32 -0
- package/templates/manifest.codex.json +43 -0
- package/templates/manifest.json +5 -5
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pipeline-architecture-patterns
|
|
3
|
+
description: Data pipeline architecture patterns for ETL/ELT design, orchestration, and data quality frameworks
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Data Pipeline Architecture Patterns
|
|
8
|
+
|
|
9
|
+
## Pipeline Architectures
|
|
10
|
+
|
|
11
|
+
### ETL vs ELT (CRITICAL)
|
|
12
|
+
- **ETL**: Extract → Transform (staging) → Load
|
|
13
|
+
- Traditional, on-premise data warehouses
|
|
14
|
+
- Pre-aggregation, complex transformations
|
|
15
|
+
- **ELT**: Extract → Load (raw) → Transform (in warehouse)
|
|
16
|
+
- Cloud warehouses (Snowflake, BigQuery)
|
|
17
|
+
- Leverage warehouse compute power
|
|
18
|
+
|
|
19
|
+
### Lambda Architecture
|
|
20
|
+
- Batch layer: historical data processing
|
|
21
|
+
- Speed layer: real-time stream processing
|
|
22
|
+
- Serving layer: merge batch + real-time views
|
|
23
|
+
- Complexity: maintain two codebases
|
|
24
|
+
|
|
25
|
+
### Kappa Architecture
|
|
26
|
+
- Stream-only processing
|
|
27
|
+
- Single codebase for batch + real-time
|
|
28
|
+
- Reprocessing via replay
|
|
29
|
+
- Simpler than Lambda
|
|
30
|
+
|
|
31
|
+
### Medallion Architecture
|
|
32
|
+
- **Bronze**: Raw data (append-only)
|
|
33
|
+
- **Silver**: Cleaned, conformed data
|
|
34
|
+
- **Gold**: Business-level aggregations
|
|
35
|
+
- Databricks pattern
|
|
36
|
+
|
|
37
|
+
## Orchestration Patterns
|
|
38
|
+
|
|
39
|
+
### DAG-Based Orchestration
|
|
40
|
+
- Airflow, Prefect, Dagster
|
|
41
|
+
- Task dependencies as DAG
|
|
42
|
+
- Retries, backfills, scheduling
|
|
43
|
+
|
|
44
|
+
### Event-Driven Orchestration
|
|
45
|
+
- Kafka, Pub/Sub triggers
|
|
46
|
+
- Real-time, low-latency
|
|
47
|
+
- Decoupled producers/consumers
|
|
48
|
+
|
|
49
|
+
### Hybrid Orchestration
|
|
50
|
+
- Scheduled batch + event-driven streams
|
|
51
|
+
- Example: Airflow DAG triggered by Kafka event
|
|
52
|
+
|
|
53
|
+
## Data Quality Frameworks
|
|
54
|
+
|
|
55
|
+
### Data Contracts (CRITICAL)
|
|
56
|
+
- Define schema, freshness, volume expectations
|
|
57
|
+
- Producer-consumer agreement
|
|
58
|
+
- Break build on violation
|
|
59
|
+
|
|
60
|
+
### Validation Frameworks
|
|
61
|
+
- **Great Expectations**: Python-based expectations
|
|
62
|
+
- **dbt tests**: SQL-based tests
|
|
63
|
+
- **Soda**: YAML-based checks
|
|
64
|
+
|
|
65
|
+
### Data Lineage
|
|
66
|
+
- Track data origin and transformations
|
|
67
|
+
- Debug data quality issues
|
|
68
|
+
- Compliance and auditing
|
|
69
|
+
|
|
70
|
+
## Idempotency Patterns
|
|
71
|
+
|
|
72
|
+
### Idempotent Design (CRITICAL)
|
|
73
|
+
- Same input → same output (no side effects)
|
|
74
|
+
- Upserts instead of inserts
|
|
75
|
+
- Partition replacement instead of append
|
|
76
|
+
|
|
77
|
+
### Deduplication
|
|
78
|
+
- Use unique keys
|
|
79
|
+
- Window-based deduplication
|
|
80
|
+
- Consumer group offset management
|
|
81
|
+
|
|
82
|
+
## References
|
|
83
|
+
- [Data Engineering Design Patterns](https://www.oreilly.com/library/view/data-engineering-design/9781098130725/)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: postgres-best-practices
|
|
3
|
+
description: PostgreSQL best practices for database design, query optimization, and performance tuning
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PostgreSQL Best Practices
|
|
8
|
+
|
|
9
|
+
## Query Optimization
|
|
10
|
+
|
|
11
|
+
### EXPLAIN ANALYZE (CRITICAL)
|
|
12
|
+
- Use `EXPLAIN ANALYZE` to understand query plans
|
|
13
|
+
- Identify slow operations: Seq Scan, Nested Loop
|
|
14
|
+
- Check row estimates vs actual rows
|
|
15
|
+
- Monitor buffers: shared hit vs read
|
|
16
|
+
|
|
17
|
+
### Indexing (CRITICAL)
|
|
18
|
+
- B-tree: default, most use cases
|
|
19
|
+
- GIN: JSONB, arrays, full-text search
|
|
20
|
+
- GiST: geometry, range types
|
|
21
|
+
- BRIN: large sequential tables (time-series)
|
|
22
|
+
- Partial indexes: filtered queries
|
|
23
|
+
- Covering indexes (INCLUDE): avoid heap fetches
|
|
24
|
+
|
|
25
|
+
### Index Maintenance
|
|
26
|
+
- Create indexes concurrently: `CREATE INDEX CONCURRENTLY`
|
|
27
|
+
- Monitor usage: `pg_stat_user_indexes`
|
|
28
|
+
- Remove unused indexes
|
|
29
|
+
- Reindex bloated indexes
|
|
30
|
+
|
|
31
|
+
## Table Design
|
|
32
|
+
|
|
33
|
+
### Partitioning (HIGH)
|
|
34
|
+
- Range partitioning: time-series data
|
|
35
|
+
- List partitioning: categorical data
|
|
36
|
+
- Hash partitioning: even distribution
|
|
37
|
+
- Declarative partitioning (PG 10+)
|
|
38
|
+
|
|
39
|
+
### Data Types
|
|
40
|
+
- Use appropriate types (int vs bigint, varchar vs text)
|
|
41
|
+
- JSONB for semi-structured data
|
|
42
|
+
- Arrays for multi-value columns
|
|
43
|
+
- UUIDs for distributed IDs
|
|
44
|
+
|
|
45
|
+
## Performance Tuning
|
|
46
|
+
|
|
47
|
+
### Vacuum and Autovacuum
|
|
48
|
+
- Autovacuum: default enabled
|
|
49
|
+
- Monitor bloat: `pg_stat_user_tables`
|
|
50
|
+
- Tune autovacuum thresholds
|
|
51
|
+
- Manual VACUUM for large updates
|
|
52
|
+
|
|
53
|
+
### Connection Pooling
|
|
54
|
+
- Use pgBouncer or PgPool
|
|
55
|
+
- Transaction pooling for short transactions
|
|
56
|
+
- Session pooling for long transactions
|
|
57
|
+
- Max connections: tune based on workload
|
|
58
|
+
|
|
59
|
+
### Configuration
|
|
60
|
+
- `shared_buffers`: 25% of RAM
|
|
61
|
+
- `work_mem`: per operation, tune carefully
|
|
62
|
+
- `effective_cache_size`: 50-75% of RAM
|
|
63
|
+
- `random_page_cost`: 1.1 for SSD
|
|
64
|
+
|
|
65
|
+
## References
|
|
66
|
+
- [PostgreSQL Performance Optimization](https://wiki.postgresql.org/wiki/Performance_Optimization)
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: python-best-practices
|
|
3
|
+
description: Pythonic patterns from PEP 8 and PEP 20
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Apply idiomatic Python patterns and best practices from official Python documentation.
|
|
10
|
+
|
|
11
|
+
## The Zen of Python (PEP 20)
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Beautiful is better than ugly.
|
|
15
|
+
Explicit is better than implicit.
|
|
16
|
+
Simple is better than complex.
|
|
17
|
+
Complex is better than complicated.
|
|
18
|
+
Flat is better than nested.
|
|
19
|
+
Sparse is better than dense.
|
|
20
|
+
Readability counts.
|
|
21
|
+
Special cases aren't special enough to break the rules.
|
|
22
|
+
Although practicality beats purity.
|
|
23
|
+
Errors should never pass silently.
|
|
24
|
+
Unless explicitly silenced.
|
|
25
|
+
In the face of ambiguity, refuse the temptation to guess.
|
|
26
|
+
There should be one-- and preferably only one --obvious way to do it.
|
|
27
|
+
Although that way may not be obvious at first unless you're Dutch.
|
|
28
|
+
Now is better than never.
|
|
29
|
+
Although never is often better than *right* now.
|
|
30
|
+
If the implementation is hard to explain, it's a bad idea.
|
|
31
|
+
If the implementation is easy to explain, it may be a good idea.
|
|
32
|
+
Namespaces are one honking great idea -- let's do more of those!
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Rules
|
|
36
|
+
|
|
37
|
+
### 1. Code Layout
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
indentation:
|
|
41
|
+
- Use 4 spaces per indentation level
|
|
42
|
+
- Never mix tabs and spaces
|
|
43
|
+
- Continuation lines align vertically or use hanging indent
|
|
44
|
+
|
|
45
|
+
line_length:
|
|
46
|
+
- Maximum 79 characters for code
|
|
47
|
+
- Maximum 72 characters for docstrings/comments
|
|
48
|
+
- Teams may agree on 99 characters for code
|
|
49
|
+
|
|
50
|
+
blank_lines:
|
|
51
|
+
- Two blank lines around top-level definitions
|
|
52
|
+
- One blank line between method definitions
|
|
53
|
+
- Use sparingly inside functions
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 2. Imports
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
rules:
|
|
60
|
+
- One import per line
|
|
61
|
+
- Position at file top, after docstrings
|
|
62
|
+
- Group order: standard library → third-party → local
|
|
63
|
+
- Separate groups with blank lines
|
|
64
|
+
- Prefer absolute imports
|
|
65
|
+
- Avoid wildcard imports (from X import *)
|
|
66
|
+
|
|
67
|
+
example: |
|
|
68
|
+
import os
|
|
69
|
+
import sys
|
|
70
|
+
|
|
71
|
+
from third_party import lib
|
|
72
|
+
|
|
73
|
+
from myproject import module
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Whitespace
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
avoid:
|
|
80
|
+
- Extra spaces inside parentheses/brackets
|
|
81
|
+
- Spaces before commas or colons
|
|
82
|
+
- Spaces between function name and parenthesis
|
|
83
|
+
- Multiple spaces for alignment
|
|
84
|
+
|
|
85
|
+
required:
|
|
86
|
+
- Single space around binary operators
|
|
87
|
+
- Spaces around -> in annotations
|
|
88
|
+
- No spaces around = for default parameters
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 4. Naming Conventions
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
modules_packages:
|
|
95
|
+
style: lowercase_with_underscores
|
|
96
|
+
example: my_module
|
|
97
|
+
|
|
98
|
+
classes:
|
|
99
|
+
style: CapWords
|
|
100
|
+
example: MyClass
|
|
101
|
+
|
|
102
|
+
functions_variables:
|
|
103
|
+
style: lowercase_with_underscores
|
|
104
|
+
example: my_function, my_variable
|
|
105
|
+
|
|
106
|
+
constants:
|
|
107
|
+
style: ALL_CAPS_WITH_UNDERSCORES
|
|
108
|
+
example: MAX_SIZE, DEFAULT_VALUE
|
|
109
|
+
|
|
110
|
+
exceptions:
|
|
111
|
+
style: CapWords + Error suffix
|
|
112
|
+
example: ValueError, CustomError
|
|
113
|
+
|
|
114
|
+
private:
|
|
115
|
+
single_underscore: _internal (weak internal)
|
|
116
|
+
double_underscore: __private (name mangling)
|
|
117
|
+
trailing_underscore: class_ (avoid keyword conflict)
|
|
118
|
+
|
|
119
|
+
avoid:
|
|
120
|
+
- Single characters l, O, I (ambiguous)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 5. Comments and Docstrings
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
principles:
|
|
127
|
+
- Comments contradicting code are worse than none
|
|
128
|
+
- Use complete sentences
|
|
129
|
+
- Keep comments up to date
|
|
130
|
+
|
|
131
|
+
block_comments:
|
|
132
|
+
- Indent at same level as code
|
|
133
|
+
- Start each line with # and space
|
|
134
|
+
|
|
135
|
+
inline_comments:
|
|
136
|
+
- Minimum two spaces from code
|
|
137
|
+
- Avoid obvious statements
|
|
138
|
+
|
|
139
|
+
docstrings:
|
|
140
|
+
- Write for all public modules, functions, classes, methods
|
|
141
|
+
- Use triple quotes
|
|
142
|
+
- First line: concise summary
|
|
143
|
+
- Blank line before detailed description
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 6. Programming Recommendations
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
comparisons:
|
|
150
|
+
- Use 'is' and 'is not' for None, True, False
|
|
151
|
+
- Prefer isinstance() over type()
|
|
152
|
+
- Use 'is not' rather than 'not ... is'
|
|
153
|
+
|
|
154
|
+
sequences:
|
|
155
|
+
- Test empty: if not seq: (not if len(seq) == 0)
|
|
156
|
+
- Use .startswith() and .endswith()
|
|
157
|
+
|
|
158
|
+
exceptions:
|
|
159
|
+
- Derive from Exception, not BaseException
|
|
160
|
+
- Catch specific exceptions
|
|
161
|
+
- Avoid bare except clauses
|
|
162
|
+
- Use 'raise X from Y' for chaining
|
|
163
|
+
|
|
164
|
+
functions:
|
|
165
|
+
- Use def, not lambda assignment
|
|
166
|
+
- Consistent return statements
|
|
167
|
+
- Use with for resource management
|
|
168
|
+
|
|
169
|
+
type_hints:
|
|
170
|
+
- Follow PEP 484 syntax
|
|
171
|
+
- Space after colon in annotations
|
|
172
|
+
- No space before colon
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### 7. Pythonic Idioms
|
|
176
|
+
|
|
177
|
+
```yaml
|
|
178
|
+
list_comprehension:
|
|
179
|
+
prefer: "[x*2 for x in items if x > 0]"
|
|
180
|
+
over: |
|
|
181
|
+
result = []
|
|
182
|
+
for x in items:
|
|
183
|
+
if x > 0:
|
|
184
|
+
result.append(x*2)
|
|
185
|
+
|
|
186
|
+
context_managers:
|
|
187
|
+
prefer: "with open('file') as f:"
|
|
188
|
+
over: |
|
|
189
|
+
f = open('file')
|
|
190
|
+
try:
|
|
191
|
+
...
|
|
192
|
+
finally:
|
|
193
|
+
f.close()
|
|
194
|
+
|
|
195
|
+
unpacking:
|
|
196
|
+
prefer: "a, b = b, a"
|
|
197
|
+
over: |
|
|
198
|
+
temp = a
|
|
199
|
+
a = b
|
|
200
|
+
b = temp
|
|
201
|
+
|
|
202
|
+
enumerate:
|
|
203
|
+
prefer: "for i, item in enumerate(items):"
|
|
204
|
+
over: "for i in range(len(items)):"
|
|
205
|
+
|
|
206
|
+
dictionary:
|
|
207
|
+
prefer: "d.get(key, default)"
|
|
208
|
+
over: "d[key] if key in d else default"
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Application
|
|
212
|
+
|
|
213
|
+
When writing or reviewing Python code:
|
|
214
|
+
|
|
215
|
+
1. **Always** follow PEP 8 formatting
|
|
216
|
+
2. **Always** write docstrings for public APIs
|
|
217
|
+
3. **Prefer** explicit over implicit
|
|
218
|
+
4. **Prefer** simple over complex
|
|
219
|
+
5. **Prefer** flat over nested
|
|
220
|
+
6. **Avoid** premature optimization
|
|
221
|
+
7. **Use** list comprehensions when readable
|
|
222
|
+
8. **Use** context managers for resources
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qa-lead-routing
|
|
3
|
+
description: Coordinates QA workflow across planning, writing, and execution agents. Use when user requests testing, quality assurance, or test documentation.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# QA Lead Routing Skill
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Coordinates QA team activities by routing tasks to qa-planner, qa-writer, and qa-engineer agents. This skill contains the coordination logic for orchestrating the complete quality assurance workflow.
|
|
12
|
+
|
|
13
|
+
## QA Team Agents
|
|
14
|
+
|
|
15
|
+
| Agent | Role | Output |
|
|
16
|
+
|-------|------|--------|
|
|
17
|
+
| qa-planner | Test planning | QA plans, test scenarios, acceptance criteria |
|
|
18
|
+
| qa-writer | Documentation | Test cases, test reports, templates |
|
|
19
|
+
| qa-engineer | Execution | Test results, defect reports, coverage reports |
|
|
20
|
+
|
|
21
|
+
## Command Routing
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
QA Request → Routing → QA Agent(s)
|
|
25
|
+
|
|
26
|
+
test_planning → qa-planner
|
|
27
|
+
test_documentation → qa-writer
|
|
28
|
+
test_execution → qa-engineer
|
|
29
|
+
quality_analysis → qa-planner + qa-engineer (parallel)
|
|
30
|
+
full_qa_cycle → all agents (sequential)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Routing Rules
|
|
34
|
+
|
|
35
|
+
### 1. Test Planning
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
User: "Create test plan for feature X"
|
|
39
|
+
|
|
40
|
+
Route:
|
|
41
|
+
Task(qa-planner role → create test plan, model: "sonnet")
|
|
42
|
+
|
|
43
|
+
Output:
|
|
44
|
+
- Test scenarios
|
|
45
|
+
- Coverage targets
|
|
46
|
+
- Acceptance criteria
|
|
47
|
+
- Risk assessment
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2. Test Documentation
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
User: "Document test cases for API"
|
|
54
|
+
|
|
55
|
+
Route:
|
|
56
|
+
Task(qa-writer role → document test cases, model: "sonnet")
|
|
57
|
+
|
|
58
|
+
Output:
|
|
59
|
+
- Test case specifications
|
|
60
|
+
- Test data requirements
|
|
61
|
+
- Expected results
|
|
62
|
+
- Test templates
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. Test Execution
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
User: "Execute tests for module Y"
|
|
69
|
+
|
|
70
|
+
Route:
|
|
71
|
+
Task(qa-engineer role → execute tests, model: "sonnet")
|
|
72
|
+
|
|
73
|
+
Output:
|
|
74
|
+
- Test execution results
|
|
75
|
+
- Pass/fail metrics
|
|
76
|
+
- Defect reports
|
|
77
|
+
- Coverage reports
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 4. Quality Analysis
|
|
81
|
+
|
|
82
|
+
When analysis is needed (parallel execution):
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
User: "Analyze quality metrics"
|
|
86
|
+
|
|
87
|
+
Route (parallel):
|
|
88
|
+
Task(qa-planner role → analyze strategy, model: "sonnet")
|
|
89
|
+
Task(qa-engineer role → analyze results, model: "sonnet")
|
|
90
|
+
|
|
91
|
+
Aggregate:
|
|
92
|
+
Strategy insights + execution data
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 5. Full QA Cycle (Sequential)
|
|
96
|
+
|
|
97
|
+
For complete quality assurance workflow:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
User: "Run full QA cycle for feature Z"
|
|
101
|
+
|
|
102
|
+
Route (sequential):
|
|
103
|
+
1. Task(qa-planner role → create test plan, model: "sonnet")
|
|
104
|
+
2. Task(qa-writer role → document test cases, model: "sonnet")
|
|
105
|
+
3. Task(qa-engineer role → execute tests, model: "sonnet")
|
|
106
|
+
4. Task(qa-writer role → generate report, model: "sonnet")
|
|
107
|
+
|
|
108
|
+
Aggregate and present final report
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Full QA Cycle Workflow
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
1. Planning Phase (qa-planner)
|
|
115
|
+
- Analyze requirements
|
|
116
|
+
- Define test scenarios
|
|
117
|
+
- Set acceptance criteria
|
|
118
|
+
- Identify risks
|
|
119
|
+
|
|
120
|
+
2. Documentation Phase (qa-writer)
|
|
121
|
+
- Write test cases
|
|
122
|
+
- Define test data
|
|
123
|
+
- Document expected results
|
|
124
|
+
- Create templates
|
|
125
|
+
|
|
126
|
+
3. Execution Phase (qa-engineer)
|
|
127
|
+
- Execute test cases
|
|
128
|
+
- Record results
|
|
129
|
+
- Report defects
|
|
130
|
+
- Calculate coverage
|
|
131
|
+
|
|
132
|
+
4. Reporting Phase (qa-writer)
|
|
133
|
+
- Aggregate results
|
|
134
|
+
- Generate reports
|
|
135
|
+
- Document findings
|
|
136
|
+
- Provide recommendations
|
|
137
|
+
|
|
138
|
+
5. Aggregation (qa-lead routing)
|
|
139
|
+
- Combine all phases
|
|
140
|
+
- Present unified status
|
|
141
|
+
- Highlight critical issues
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Sequential vs Parallel Execution
|
|
145
|
+
|
|
146
|
+
### Sequential (typical for QA workflow)
|
|
147
|
+
|
|
148
|
+
QA workflow is typically sequential because each phase depends on the previous:
|
|
149
|
+
- Planning must complete before documentation
|
|
150
|
+
- Documentation must complete before execution
|
|
151
|
+
- Execution must complete before reporting
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
qa-planner → qa-writer → qa-engineer → qa-writer
|
|
155
|
+
(plan) (document) (execute) (report)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Parallel (rare, for independent analyses)
|
|
159
|
+
|
|
160
|
+
Only when tasks are truly independent:
|
|
161
|
+
- Quality analysis (strategy + results)
|
|
162
|
+
- Multi-module testing (independent modules)
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
Example:
|
|
166
|
+
Task(qa-engineer role → test module A, model: "sonnet")
|
|
167
|
+
Task(qa-engineer role → test module B, model: "sonnet")
|
|
168
|
+
Task(qa-engineer role → test module C, model: "sonnet")
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Sub-agent Model Selection
|
|
172
|
+
|
|
173
|
+
### Model Mapping
|
|
174
|
+
|
|
175
|
+
| Agent | Recommended Model | Reason |
|
|
176
|
+
|-------|-------------------|--------|
|
|
177
|
+
| qa-planner | `sonnet` | Strategy requires balanced reasoning |
|
|
178
|
+
| qa-writer | `sonnet` | Documentation quality matters |
|
|
179
|
+
| qa-engineer | `sonnet` | Test execution needs accuracy |
|
|
180
|
+
|
|
181
|
+
All QA agents typically use `sonnet` for balanced quality output.
|
|
182
|
+
|
|
183
|
+
### Task Call Examples
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
# Test planning
|
|
187
|
+
Task(
|
|
188
|
+
subagent_type: "general-purpose",
|
|
189
|
+
prompt: "Create comprehensive test plan for authentication feature following qa-planner guidelines",
|
|
190
|
+
model: "sonnet"
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
# Test documentation
|
|
194
|
+
Task(
|
|
195
|
+
subagent_type: "general-purpose",
|
|
196
|
+
prompt: "Document test cases for API endpoints following qa-writer guidelines",
|
|
197
|
+
model: "sonnet"
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
# Test execution
|
|
201
|
+
Task(
|
|
202
|
+
subagent_type: "general-purpose",
|
|
203
|
+
prompt: "Execute integration tests and report results following qa-engineer guidelines",
|
|
204
|
+
model: "sonnet"
|
|
205
|
+
)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Display Format
|
|
209
|
+
|
|
210
|
+
### Full QA Cycle
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
[Planning] Delegating to qa-planner...
|
|
214
|
+
→ Test plan created (15 scenarios)
|
|
215
|
+
|
|
216
|
+
[Documentation] Delegating to qa-writer...
|
|
217
|
+
→ 15 test cases documented
|
|
218
|
+
|
|
219
|
+
[Execution] Delegating to qa-engineer...
|
|
220
|
+
→ 13 passed, 2 failed
|
|
221
|
+
|
|
222
|
+
[Report] Generating summary...
|
|
223
|
+
Coverage: 85%
|
|
224
|
+
Pass Rate: 87%
|
|
225
|
+
Defects: 2 (1 High, 1 Medium)
|
|
226
|
+
|
|
227
|
+
[Done] QA cycle completed
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Parallel Quality Analysis
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
[Analyzing] Spawning parallel analysis...
|
|
234
|
+
|
|
235
|
+
[Instance 1] strategy-analysis:sonnet → qa-planner
|
|
236
|
+
[Instance 2] results-analysis:sonnet → qa-engineer
|
|
237
|
+
|
|
238
|
+
[Progress] ████████████ 2/2
|
|
239
|
+
|
|
240
|
+
[Summary]
|
|
241
|
+
Strategy: Coverage targets met, add edge cases
|
|
242
|
+
Results: 85% pass rate, 2 critical defects
|
|
243
|
+
|
|
244
|
+
Analysis completed.
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Integration with Other Agents
|
|
248
|
+
|
|
249
|
+
- **Receives requirements from**: arch-speckit-agent (sw-architect)
|
|
250
|
+
- **Reports quality status to**: dev-lead
|
|
251
|
+
- **Coordinates with**: Language experts for automated tests
|
|
252
|
+
- **Provides feedback to**: Development team via dev-lead
|
|
253
|
+
|
|
254
|
+
## Metrics Tracking
|
|
255
|
+
|
|
256
|
+
QA lead routing should aggregate these metrics:
|
|
257
|
+
|
|
258
|
+
```yaml
|
|
259
|
+
metrics:
|
|
260
|
+
test_coverage: percentage
|
|
261
|
+
pass_rate: percentage
|
|
262
|
+
defect_count: number
|
|
263
|
+
defect_severity: [critical, high, medium, low]
|
|
264
|
+
execution_time: duration
|
|
265
|
+
test_case_count: number
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Usage
|
|
269
|
+
|
|
270
|
+
This skill is NOT user-invocable. It should be automatically triggered when the main conversation detects QA intent.
|
|
271
|
+
|
|
272
|
+
Detection criteria:
|
|
273
|
+
- User requests testing
|
|
274
|
+
- User mentions quality assurance
|
|
275
|
+
- User asks for test plan/cases/execution
|
|
276
|
+
- User requests QA metrics/reports
|
|
277
|
+
- System detects need for quality verification
|