trackfw 3.0.0 → 4.0.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.
Files changed (59) hide show
  1. package/README.md +94 -3
  2. package/package.json +1 -1
  3. package/src/commands/barrier.js +358 -0
  4. package/src/commands/discover.js +18 -0
  5. package/src/commands/help.js +99 -9
  6. package/src/commands/index.js +3 -0
  7. package/src/commands/init.js +40 -2
  8. package/src/commands/log.js +2 -1
  9. package/src/commands/note.js +24 -0
  10. package/src/commands/req.js +7 -1
  11. package/src/commands/roadmap.js +4 -3
  12. package/src/commands/ship.js +49 -0
  13. package/src/commands/update-harness.js +208 -0
  14. package/src/commands/update.js +206 -72
  15. package/src/config/index.js +5 -2
  16. package/src/forge/adapter.js +189 -0
  17. package/src/forge/resolve.js +191 -0
  18. package/src/generators/adr.js +13 -4
  19. package/src/generators/date.js +23 -0
  20. package/src/generators/init.js +229 -39
  21. package/src/generators/note.js +154 -0
  22. package/src/generators/req.js +88 -5
  23. package/src/generators/roadmap.js +96 -20
  24. package/src/i18n/locales/en-US.json +2 -1
  25. package/src/i18n/locales/es-ES.json +2 -1
  26. package/src/i18n/locales/pt-BR.json +2 -1
  27. package/src/identity/preset.js +22 -0
  28. package/src/integrations/assets/agents/architect.md +35 -0
  29. package/src/integrations/assets/agents/backend.md +32 -0
  30. package/src/integrations/assets/agents/code-quality.md +32 -0
  31. package/src/integrations/assets/agents/data.md +32 -0
  32. package/src/integrations/assets/agents/dba.md +32 -0
  33. package/src/integrations/assets/agents/frontend.md +32 -0
  34. package/src/integrations/assets/agents/iac.md +46 -0
  35. package/src/integrations/assets/agents/infra.md +34 -0
  36. package/src/integrations/assets/agents/qa.md +32 -0
  37. package/src/integrations/assets/agents/security.md +32 -0
  38. package/src/integrations/assets/agents/tooling.md +47 -0
  39. package/src/integrations/assets/agents/ux.md +32 -0
  40. package/src/integrations/assets/catalog.json +16 -2
  41. package/src/integrations/assets/skills/architecture.md +66 -0
  42. package/src/integrations/assets/skills/backend.md +67 -0
  43. package/src/integrations/assets/skills/code-quality.md +78 -0
  44. package/src/integrations/assets/skills/data.md +75 -0
  45. package/src/integrations/assets/skills/dba.md +77 -0
  46. package/src/integrations/assets/skills/frontend.md +70 -0
  47. package/src/integrations/assets/skills/iac.md +90 -0
  48. package/src/integrations/assets/skills/infra.md +62 -0
  49. package/src/integrations/assets/skills/qa.md +63 -0
  50. package/src/integrations/assets/skills/security.md +74 -0
  51. package/src/integrations/assets/skills/tooling.md +80 -0
  52. package/src/integrations/assets/skills/ux.md +70 -0
  53. package/src/integrations/catalog.js +25 -1
  54. package/src/integrations/index.js +20 -2
  55. package/src/integrations/render.js +57 -6
  56. package/src/lib/update-engine.js +217 -0
  57. package/src/ship/runner.js +454 -0
  58. package/src/validator/index.js +323 -111
  59. package/src/validator/traceid.js +1 -1
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: trackfw-data-skill
3
+ description: Data pipelines, quality contracts, lakehouse patterns and MLOps.
4
+ ---
5
+
6
+ ## Pipeline Design Principles
7
+
8
+ - **Idempotent**: running a pipeline twice with the same inputs produces the same outputs with
9
+ no side effects. Idempotency enables safe retries and backfills.
10
+ - **Observable**: every pipeline run emits metrics (rows processed, duration, error count)
11
+ and structured logs. Silent pipelines hide data quality problems.
12
+ - **Incremental by default**: process only new or changed data; full reloads are expensive and
13
+ error-prone. Implement watermark or change-data-capture (CDC) patterns.
14
+ - **Testable**: test transformations with deterministic fixtures. A pipeline that cannot be
15
+ run locally with sample data is hard to debug.
16
+
17
+ ## Data Contracts
18
+
19
+ A data contract is a versioned schema agreement between a data producer and its consumers.
20
+ Breaking schema changes require a new contract version and a migration window:
21
+ - Define contracts before building pipelines, not after.
22
+ - Validate incoming data against the contract on ingestion; reject or quarantine violations.
23
+ - Version schemas explicitly (SemVer or a sequential version field).
24
+ - Treat a schema change that breaks downstream consumers as a breaking change — the same way
25
+ an API breaking change is treated.
26
+
27
+ ## ELT / Transformation
28
+
29
+ - Prefer ELT (Extract, Load, Transform) over ETL when the target system can handle the
30
+ transformation cost; push compute to where the data lives.
31
+ - SQL transformations with dbt are version-controlled, testable and self-documenting.
32
+ - Model data in layers: raw (landing, immutable), staged (typed, deduplicated), marts
33
+ (business-aligned aggregations). Never query raw data directly in reports.
34
+ - Materialized models for expensive aggregations; incremental models for large tables.
35
+
36
+ ## Streaming and Real-Time
37
+
38
+ - Use a durable, partitioned log (Kafka, Pulsar) for event streaming; producers and consumers
39
+ are decoupled in time and scale independently.
40
+ - Guarantee semantics: at-least-once is the safe default; exactly-once requires coordinated
41
+ transactions between the broker and the sink.
42
+ - Windowing functions (tumbling, sliding, session) for time-based aggregations in stream
43
+ processing.
44
+ - Monitor consumer lag continuously; unprocessed lag accumulation is an early warning of
45
+ a performance or capacity problem.
46
+
47
+ ## Data Quality
48
+
49
+ - Data quality checks belong in the pipeline, not in the dashboard. Fail fast, fail clearly.
50
+ - Test categories: **schema** (types, nullability, column existence), **integrity** (referential
51
+ keys, uniqueness), **freshness** (last-updated within expected window), **statistical**
52
+ (distribution drift, unexpected nulls or zeros).
53
+ - Quarantine rows that fail quality checks rather than silently dropping them; dropped rows
54
+ hide data completeness problems.
55
+ - SLA: define freshness and completeness SLAs per dataset; alert on SLA breach, not on
56
+ arbitrary thresholds.
57
+
58
+ ## Lakehouse and Storage
59
+
60
+ - Store raw data in an open, columnar format (Parquet) in object storage; this decouples
61
+ compute from storage and avoids vendor lock-in.
62
+ - Table formats (Delta Lake, Apache Iceberg) add ACID transactions, schema evolution and
63
+ time travel to object storage. Use them for tables that require updates or deletes.
64
+ - Partition large tables by a time dimension and a high-cardinality business key to enable
65
+ efficient pruning.
66
+
67
+ ## MLOps
68
+
69
+ - Feature stores decouple feature engineering from model training; online serving and offline
70
+ training use the same feature definitions (point-in-time correctness).
71
+ - Track every experiment: hyperparameters, dataset version, metrics, artifact location.
72
+ Reproducibility requires logging, not memory.
73
+ - Model deployment is a software deployment: versioned, tested, monitored, rollback-capable.
74
+ - Monitor model performance in production: data drift, prediction drift, and business metric
75
+ correlation. Retraining triggers are defined by drift thresholds, not by calendar.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: trackfw-dba-skill
3
+ description: Database modeling, query optimization, high availability and vector data patterns.
4
+ ---
5
+
6
+ ## Modeling
7
+
8
+ Choose the data model based on access patterns, not familiarity:
9
+ - **Relational (SQL)**: normalized schemas, foreign key integrity, ACID transactions. Best when
10
+ relationships are complex and consistency is paramount.
11
+ - **Document**: flexible schema for hierarchical, polymorphic data. Beware of embedding without
12
+ considering update patterns.
13
+ - **Key-Value / Wide-Column**: for high-throughput reads/writes with simple access patterns.
14
+ Design the key structure before creating the table — it cannot be changed cheaply.
15
+ - **Graph**: for highly connected data where traversal depth and relationship types vary.
16
+
17
+ Model for queries, not for purity. A schema that cannot be queried efficiently without
18
+ full-table scans has the wrong design.
19
+
20
+ ## Indexing
21
+
22
+ - Create indexes to support the actual query patterns in the application; unused indexes
23
+ consume write overhead and space.
24
+ - Composite indexes: column order matters. The most selective column first, then the columns
25
+ used in equality filters, then range predicates.
26
+ - Partial indexes (filtered indexes) reduce index size and improve write throughput when a
27
+ significant fraction of rows never appear in queries.
28
+ - Validate index usage with execution plans (`EXPLAIN ANALYZE`); an index that the optimizer
29
+ ignores is waste.
30
+
31
+ ## Query Optimization
32
+
33
+ - Read the execution plan for every slow query; identify table scans, nested loops and
34
+ sort operations that could be eliminated.
35
+ - Avoid `SELECT *`; project only the columns the application uses.
36
+ - Parameterize queries; never concatenate user input into SQL strings.
37
+ - Push filters as early as possible in query pipelines (aggregations, joins).
38
+ - Analyze and update table statistics regularly; stale statistics cause bad query plans.
39
+
40
+ ## High Availability and Replication
41
+
42
+ - Define RTO and RPO per service tier before choosing an HA architecture.
43
+ - Read replicas for read-heavy workloads; route analytics queries away from the primary.
44
+ - Point-in-time recovery (PITR) is mandatory for production databases.
45
+ - Test backup restoration on a schedule; a backup that has never been restored is
46
+ unverified and therefore unreliable.
47
+ - Cross-region replication for disaster recovery; understand replication lag and its
48
+ impact on read-after-write consistency.
49
+
50
+ ## Cache Integration
51
+
52
+ - **Cache-aside**: application reads from cache; on miss, reads from database and populates
53
+ cache. Simple and explicit. Handles cache invalidation at write time.
54
+ - **Write-through**: write to both cache and database atomically. Keeps cache consistent at
55
+ the cost of write latency.
56
+ - Set TTLs on every cache entry; unbounded cache growth leads to eviction unpredictability.
57
+ - Cache only safe data (no PII without appropriate controls); audit what is cached.
58
+
59
+ ## Vector Databases
60
+
61
+ For AI/ML retrieval workloads:
62
+ - **Index choice**: HNSW (Hierarchical Navigable Small World) for low-latency ANN search;
63
+ IVFFlat for higher-recall bulk workloads.
64
+ - **Hybrid search**: combine dense vector search with sparse (BM25) text search using
65
+ Reciprocal Rank Fusion (RRF). Pure dense search underperforms on keyword-heavy queries.
66
+ - **Reranking**: apply a cross-encoder reranker after initial retrieval to improve top-k
67
+ precision without the cost of reranking the full corpus.
68
+ - Match the embedding model dimensionality to the index; switching models requires
69
+ re-embedding the entire corpus.
70
+
71
+ ## Analytics and Columnar Storage
72
+
73
+ - Columnar engines (ClickHouse, DuckDB, BigQuery) are optimized for aggregations over a
74
+ subset of columns in large tables; do not use them for OLTP row-level operations.
75
+ - Materialized views pre-aggregate expensive queries; refresh strategy (incremental vs full)
76
+ depends on freshness requirements and write volume.
77
+ - Partition large tables by time or a high-cardinality dimension to enable partition pruning.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: trackfw-frontend-skill
3
+ description: Accessible, performant and internationalizable user interfaces.
4
+ ---
5
+
6
+ ## Core Principles
7
+
8
+ - **Web-first**: design for the browser platform first; native equivalents are additive.
9
+ - **Progressive enhancement**: core functionality works without JavaScript; enhancements layer on top.
10
+ - **Accessibility is not optional**: WCAG 2.2 AA is the minimum bar for every user-facing interface.
11
+ - **Performance is a feature**: Core Web Vitals (LCP < 2.5 s, CLS < 0.1, INP < 200 ms) are
12
+ production quality gates, not post-launch concerns.
13
+
14
+ ## Component Architecture
15
+
16
+ Build components at the atomic level (atoms → molecules → organisms → pages). Each component
17
+ has a single, well-defined responsibility. Compose, do not inherit.
18
+
19
+ Separate concerns clearly:
20
+ - **Data fetching** lives outside components (query layer, data hooks, server components).
21
+ - **State** is as local as possible; lift only when two components genuinely share it.
22
+ - **UI logic** stays in the component; business rules belong in services or server-side code.
23
+
24
+ ## Accessibility (WCAG 2.2 AA)
25
+
26
+ - Use semantic HTML as the foundation; ARIA supplements, never replaces, semantics.
27
+ - Every interactive element is keyboard-navigable with a visible focus indicator.
28
+ - Color contrast ratio ≥ 4.5:1 for normal text, ≥ 3:1 for large text.
29
+ - Support `prefers-reduced-motion`; do not auto-play animations.
30
+ - Test with at least one screen reader (VoiceOver, NVDA) during development.
31
+ - Integrate `axe-core` in CI to catch regressions automatically.
32
+
33
+ ## Performance
34
+
35
+ - Lazy-load routes and heavy components; code-split at meaningful boundaries.
36
+ - Optimize images: responsive sizes, modern formats (WebP/AVIF), explicit `width` and `height`
37
+ to avoid layout shift.
38
+ - Virtual scrolling for lists with more than a few hundred items.
39
+ - Monitor performance budgets in CI with Lighthouse; fail the build on regressions.
40
+
41
+ ## Internationalisation (i18n)
42
+
43
+ - Externalize all user-visible strings at the start; retrofitting is expensive.
44
+ - Use ICU message format for pluralization and gender rules.
45
+ - RTL layout support requires logical CSS properties (`margin-inline-start` over `margin-left`).
46
+ - Locale-aware date, number and currency formatting — never hand-roll these.
47
+
48
+ ## State Management
49
+
50
+ Choose the simplest state model that fits the problem:
51
+ - Local component state for ephemeral UI.
52
+ - Server-state cache (e.g., query libraries with stale-while-revalidate) for remote data.
53
+ - Client-side global state only when truly shared across unrelated subtrees.
54
+ - Finite state machines for complex multi-step flows to make impossible states impossible.
55
+
56
+ ## Testing
57
+
58
+ - Web-first assertions: assert on visible state and accessibility, not internal implementation.
59
+ - Do not use `waitForTimeout`; await stable DOM state or network idle instead.
60
+ - Component tests verify rendered output and user interactions (click, type, submit).
61
+ - E2E tests cover critical paths with real browser automation (Playwright).
62
+ - Visual regression for design-system components.
63
+
64
+ ## Design Systems
65
+
66
+ - Design tokens (W3C DTCG format) are the single source of truth for spacing, color and
67
+ typography. Tokens propagate to both design tools and code.
68
+ - Document components in isolation; a component that cannot be demonstrated in isolation
69
+ is too tightly coupled.
70
+ - Maintain a clear Figma → dev handoff contract; use Dev Mode or equivalent tooling.
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: trackfw-iac-skill
3
+ description: Declarative infrastructure provisioning, state management, policy-as-code and immutability.
4
+ ---
5
+
6
+ ## Foundational Principles
7
+
8
+ Infrastructure as Code means the repository is the authoritative source of truth for every
9
+ provisioned resource. If it is not in code, it does not officially exist.
10
+
11
+ - **Declarative over imperative**: describe the desired end state; let the tool reconcile.
12
+ - **Idempotent by design**: applying the same configuration twice must produce the same result.
13
+ - **Immutable infrastructure**: replace, do not patch. Mutable drift between nodes is a source
14
+ of undocumented operational risk.
15
+ - **Least privilege**: every resource receives the minimum permissions required, nothing more.
16
+ Wildcard actions combined with wildcard resources are forbidden.
17
+
18
+ ## File and Module Structure
19
+
20
+ Organize files by concern, not by resource count. In Terraform/OpenTofu:
21
+
22
+ ```
23
+ infra/<environment>/
24
+ ├── main.tf # primary resources
25
+ ├── variables.tf # typed, described, validated inputs
26
+ ├── outputs.tf # values consumed by other configurations
27
+ ├── versions.tf # required_version and required_providers (pinned)
28
+ ├── locals.tf # computed values, naming conventions, shared tags
29
+ └── data.tf # data sources, separate from managed resources
30
+ ```
31
+
32
+ Never put everything in `main.tf`. One file per concern makes diffs reviewable and
33
+ `terraform plan` output readable.
34
+
35
+ Module decisions:
36
+ - Create a local module when a pattern repeats three or more times in the same project.
37
+ - Prefer a well-maintained registry module over a custom one for complex resources.
38
+ - Always pin module versions: `version = "~> 4.0"`. Unpinned modules are a supply-chain risk.
39
+
40
+ ## State Management
41
+
42
+ Remote state is mandatory for team and production environments:
43
+ - Store in a managed backend with encryption at rest and distributed locking.
44
+ - Never commit `terraform.tfstate` or `*.tfvars` containing secrets.
45
+ - Use workspaces or separate state files per environment; mixing environments in a single
46
+ state file is an operational hazard.
47
+ - Enable state file backup and versioning on the storage backend.
48
+
49
+ ## Plan, Review and Apply
50
+
51
+ ```
52
+ 1. terraform fmt -check -recursive # style
53
+ 2. terraform validate # syntax and provider schema
54
+ 3. policy-as-code scan (Checkov, Trivy config) # security gates
55
+ 4. cost estimation (Infracost) # visibility before apply
56
+ 5. terraform plan -out=plan.tfplan # deterministic plan
57
+ 6. human review of plan # mandatory for production
58
+ 7. terraform apply plan.tfplan # apply the reviewed plan
59
+ ```
60
+
61
+ **Never apply to production without a reviewed, saved plan.** Ad-hoc `terraform apply` in
62
+ production bypasses the review gate and defeats reproducibility.
63
+
64
+ ## Policy-as-Code
65
+
66
+ Automated policy checks run before `apply`, not after:
67
+ - Reject resources with encryption disabled (storage, databases, secrets).
68
+ - Reject IAM policies with `"*"` on both action and resource simultaneously.
69
+ - Require mandatory tags (environment, team, cost-centre) on all taggable resources.
70
+ - Enforce minimum TLS versions and private endpoint requirements.
71
+ - HIGH and CRITICAL policy violations block the pipeline; they are not warnings.
72
+
73
+ ## Configuration Management (Ansible)
74
+
75
+ - Every task must be idempotent: running the playbook twice must not change the system on the
76
+ second run.
77
+ - Use `no_log: true` on every task that handles secrets or credentials.
78
+ - Store secrets in a secrets manager or vault; never in playbook variables or inventory files.
79
+ - Use dynamic inventory sources; never hardcode hostnames or IP addresses.
80
+ - Name every task descriptively; unnamed tasks make failure logs unreadable.
81
+
82
+ ## Anti-Patterns
83
+
84
+ The following are always wrong:
85
+ - `apply` in production without a human-reviewed plan.
86
+ - Secrets in `.tfvars`, environment variables without a secrets manager, or hardcoded values.
87
+ - `"*"` in both `actions` and `resources` of an IAM statement.
88
+ - Unpinned module or provider versions.
89
+ - `null_resource` or `local-exec` for business logic that a provider resource can handle.
90
+ - Manual changes to resources managed by IaC (infrastructure drift).
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: trackfw-infra-skill
3
+ description: Cloud platforms, Kubernetes operations, CI/CD, observability and reliability.
4
+ ---
5
+
6
+ ## Kubernetes Operations
7
+
8
+ - GitOps is the source of truth: cluster state is declared in a repository and reconciled
9
+ continuously by a controller (ArgoCD, Flux). Manual `kubectl apply` in production is an
10
+ anti-pattern.
11
+ - Use readiness and liveness probes on every workload; tune them to reflect actual service
12
+ health, not just process health.
13
+ - Resource requests and limits are mandatory; workloads without them destabilize the
14
+ node's QoS. Rightsize with Vertical Pod Autoscaler metrics, not guesses.
15
+ - RBAC: least privilege per ServiceAccount. Never use the `cluster-admin` role for workloads.
16
+ - Pod Security Standards (restricted profile) as the default; relax per workload only with
17
+ documented justification.
18
+
19
+ ## CI/CD
20
+
21
+ - Pipelines are code: version-controlled, reviewable, tested.
22
+ - Use environment-specific deployment gates; production deployments require explicit approval.
23
+ - Separate build from deploy: the same artifact that passed staging is promoted to production
24
+ (immutable artifact principle).
25
+ - Reusable workflows reduce duplication; extract common steps (lint, test, scan, notify).
26
+ - Dependency scanning and container image scanning run on every PR, not only on schedule.
27
+
28
+ ## Observability
29
+
30
+ Instrument with OpenTelemetry as the vendor-neutral standard:
31
+ - **Metrics**: RED method (Rate, Errors, Duration) for services; USE method (Utilization,
32
+ Saturation, Errors) for resources.
33
+ - **Traces**: distributed trace context propagates across all service calls; sample based on
34
+ latency or error, not uniformly.
35
+ - **Logs**: structured JSON to stdout; correlate with trace ID.
36
+ - Define SLOs and error budgets before an incident, not during.
37
+ - Golden signals dashboard is the first screen in any incident response.
38
+
39
+ ## Reliability
40
+
41
+ - Chaos engineering (controlled failure injection) validates reliability assumptions before
42
+ production incidents do. Start with single-node failures, then dependency outages.
43
+ - Disaster recovery: define RTO and RPO per service tier; test backup restoration on schedule
44
+ — untested backups are not backups.
45
+ - Multi-AZ for stateful workloads; cross-region only where business continuity justifies cost.
46
+ - Circuit breakers at the service mesh layer protect downstream services from cascading failures.
47
+
48
+ ## Cloud Cost Optimization (FinOps)
49
+
50
+ - Tag every resource with team, environment and cost centre at provisioning time; retroactive
51
+ tagging is never complete.
52
+ - Spot/preemptible instances for stateless, fault-tolerant workloads; reserved capacity for
53
+ predictable baseline load.
54
+ - Rightsizing is a continuous process; review monthly, not quarterly.
55
+ - Cost visibility per team is a prerequisite for accountability.
56
+
57
+ ## Supply Chain Security
58
+
59
+ - Sign container images with Sigstore/Cosign; verify signatures in admission controllers.
60
+ - Generate SBOM (CycloneDX or SPDX) on every build; store alongside the artifact.
61
+ - Pin base image digests, not tags; floating tags introduce silent updates.
62
+ - Scan dependencies for known CVEs at build time and on a regular schedule.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: trackfw-qa-skill
3
+ description: Automated testing, quality gates, contract verification and coverage strategy.
4
+ ---
5
+
6
+ ## Test Pyramid
7
+
8
+ Maintain a healthy ratio: approximately 70% unit tests, 20% integration tests, 10% E2E tests.
9
+ Unit tests give fast, precise feedback. Integration tests verify component boundaries and
10
+ database behaviour with real infrastructure. E2E tests cover critical user journeys end-to-end.
11
+
12
+ Deviating from the pyramid is a deliberate trade-off — document the reason.
13
+
14
+ ## E2E Testing Principles
15
+
16
+ - **Web-first assertions**: assert on stable, observable state (element visible, text present,
17
+ URL changed) — never `waitForTimeout`, which is fragile and masks real timing issues.
18
+ - **Cross-browser matrix**: test Chromium, Firefox and WebKit; sharding keeps CI fast.
19
+ - **Real authentication**: use actual credentials stored in `storageState`; mock auth hides
20
+ permission bugs and token expiry issues that appear in production.
21
+ - **Trace on failure**: attach Playwright trace files to CI artifacts for deterministic replay.
22
+ - **Visual regression**: snapshot tests for design-system components; fail the PR on visual drift.
23
+
24
+ ## Integration Testing
25
+
26
+ - Integration tests must hit a real database (via Testcontainers or an equivalent ephemeral
27
+ service). Mocked repositories hide driver/migration mismatches that cause production failures.
28
+ - Seed deterministic fixtures; avoid shared state between tests — parallel runs must not collide.
29
+
30
+ ## Contract Testing
31
+
32
+ API contracts are a team boundary. Use schema-driven contract testing (e.g., Pact for
33
+ consumer-driven contracts, Spectral for OpenAPI lint) to catch breaking changes before
34
+ deployment, not after.
35
+
36
+ ## Quality Gates
37
+
38
+ - Coverage thresholds enforced in CI (service layer ≥ 85%); fail the build on regression.
39
+ - Mutation testing score ≥ 80%: a test suite that does not kill mutations gives false
40
+ confidence.
41
+ - Flaky tests are quarantined immediately; a test with stability score < 95% is either fixed
42
+ or removed. Flaky tests erode trust in the entire suite.
43
+ - SonarQube or equivalent quality gate on every PR: coverage, duplication, critical issues.
44
+
45
+ ## Bug Hunting
46
+
47
+ A bug report is only complete when it includes:
48
+ 1. Deterministic reproduction steps.
49
+ 2. Expected vs. actual behaviour.
50
+ 3. Environment (OS, browser, version, test data).
51
+
52
+ Root-cause analysis must produce a regression test that would have caught the bug before
53
+ it reached production. Fix the test pyramid root cause, not just the symptom.
54
+
55
+ ## Accessibility in QA
56
+
57
+ Integrate accessibility checks (`axe-core`, Lighthouse a11y) in CI. A WCAG 2.2 AA violation
58
+ is a defect with the same severity as a functional bug.
59
+
60
+ ## Performance Budgets
61
+
62
+ Define Lighthouse performance budgets per route: LCP, CLS, INP thresholds. Run Lighthouse CI
63
+ on every PR targeting main; block merge on regression.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: trackfw-security-skill
3
+ description: Threat modeling, DevSecOps controls, Zero Trust and supply chain security.
4
+ ---
5
+
6
+ ## Shift-Left Security
7
+
8
+ Security controls belong in the development pipeline, not only at the perimeter. The later a
9
+ vulnerability is found, the more expensive it is to fix.
10
+
11
+ CI pipeline mandatory gates:
12
+ - **SAST** (Static Application Security Testing): scan source code on every PR.
13
+ - **SCA** (Software Composition Analysis): identify vulnerable dependencies; block on HIGH/CRITICAL.
14
+ - **Secrets scanning**: detect committed credentials before they reach the repository.
15
+ - **Container image scanning**: scan base images and final images; fail on HIGH/CRITICAL CVEs.
16
+ - **IaC security**: scan Terraform, Helm and Kubernetes manifests for misconfigurations.
17
+
18
+ ## Threat Modeling
19
+
20
+ Model threats before writing code for any new feature that handles authentication, authorisation,
21
+ data storage or external integrations. Use STRIDE as the baseline framework:
22
+
23
+ | Threat | Example |
24
+ |---|---|
25
+ | Spoofing | Forged identity or token |
26
+ | Tampering | Modified request payload |
27
+ | Repudiation | Missing audit trail |
28
+ | Information Disclosure | Over-permissive API response |
29
+ | Denial of Service | Unbounded resource consumption |
30
+ | Elevation of Privilege | Broken access control |
31
+
32
+ Validate findings against OWASP Top 10 and ASVS (Application Security Verification Standard)
33
+ at the appropriate assurance level for the feature.
34
+
35
+ ## Zero Trust Architecture
36
+
37
+ - **Never trust, always verify**: authenticate and authorize every request, regardless of network
38
+ origin. Internal services are not implicitly trusted.
39
+ - **mTLS** between services in a mesh: mutual authentication proves both sides hold valid certificates.
40
+ - **Least privilege at every layer**: IAM roles, Kubernetes RBAC, database users — minimum
41
+ permissions for the task, nothing more.
42
+ - **JIT (Just-in-Time) access**: elevate privilege for a bounded time window for administrative
43
+ tasks; revoke automatically.
44
+
45
+ ## Identity and Access Management
46
+
47
+ - OAuth 2.0 with PKCE for public clients; validate `iss`, `aud` and `exp` on every JWT.
48
+ - RBAC for coarse-grained access; ABAC for attribute-based decisions.
49
+ - Rotate credentials on schedule and on any suspicion of compromise.
50
+ - Secrets management: use a dedicated secrets manager; never hardcode secrets in code,
51
+ configuration files or environment variables committed to a repository.
52
+
53
+ ## Supply Chain Security
54
+
55
+ - Generate an SBOM (Software Bill of Materials) in CycloneDX or SPDX format on every build.
56
+ - Sign artifacts and container images (Sigstore/Cosign); verify signatures in admission
57
+ controllers before deploying to production.
58
+ - Pin dependency versions; review updates in PRs, not silently via floating ranges.
59
+ - Monitor for newly published CVEs against your SBOM continuously, not just at build time.
60
+
61
+ ## API Security
62
+
63
+ Design APIs with OWASP API Security Top 10 in mind:
64
+ - Broken Object Level Authorization (BOLA) is the most common API vulnerability — validate
65
+ that the caller has access to the specific object, not just the endpoint.
66
+ - Rate-limiting and input validation are required on every public endpoint.
67
+ - Avoid exposing internal IDs directly; prefer opaque tokens or UUIDs.
68
+
69
+ ## Incident Readiness
70
+
71
+ - Centralise logs and security events in a SIEM; define alerting thresholds before incidents occur.
72
+ - Maintain and rehearse an incident response playbook; detection-to-containment time (MTTC)
73
+ is the metric that matters.
74
+ - Conduct a post-incident review (PIR) after every significant security event; update controls.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: trackfw-tooling-skill
3
+ description: AI agent design, skill composition, MCP configuration and context economy.
4
+ ---
5
+
6
+ ## Agent Design Principles
7
+
8
+ An agent is effective when its scope, tools and constraints are explicit. Vague instructions
9
+ produce vague behaviour:
10
+ - **Lock the role**: every agent declares its role at the top of its system prompt and does
11
+ not switch roles mid-session without an explicit handoff.
12
+ - **Declare tools explicitly**: list only the tools the agent needs for its role; an agent
13
+ with write access that only needs to read is a liability.
14
+ - **Explicit memory scope**: use project-scoped memory for context that belongs to the
15
+ repository; use global memory only for cross-project preferences.
16
+ - **Restrict scope**: an agent must know what it is forbidden to do (create branches, open PRs,
17
+ modify configuration outside its domain). Prohibitions are as important as permissions.
18
+
19
+ ## Skill Design
20
+
21
+ Skills extend agents with domain expertise loaded on demand:
22
+ - **Single responsibility**: one skill per role or domain. A skill that covers both backend
23
+ and frontend is too broad to be useful without loading the entire file.
24
+ - **Stack-agnostic content**: skills contain principles, patterns and vocabulary that define
25
+ the role. Stack-specific choices (library names, project configuration) belong in the
26
+ project's CLAUDE.md, not in a shared skill.
27
+ - **Right size**: 40–90 lines is the target. A 5-line skill teaches nothing; a 300-line
28
+ skill inflates context on every invocation. Prefer principles over tool lists.
29
+ - **Load on demand**: skills are not always loaded. Design them as self-contained documents
30
+ that provide value when read in isolation, without assuming other skills are present.
31
+
32
+ ## MCP (Model Context Protocol)
33
+
34
+ MCP enables agents to interact with external tools and services through a standardised protocol:
35
+ - Define tool schemas precisely: name, description, input schema, output schema.
36
+ - Group related tools in a tool set to reduce context size when only a subset is needed.
37
+ - Prefer tool sets over individual tool registrations when the agent needs more than five tools.
38
+ - Validate MCP server responses before acting on them; a malformed response must not
39
+ silently corrupt state.
40
+ - Document which MCP servers a configuration depends on; an agent that fails silently because
41
+ a server is unavailable is hard to debug.
42
+
43
+ ## Prompt Engineering
44
+
45
+ - **Specificity over length**: a short, specific prompt outperforms a long, vague one.
46
+ Remove filler instructions that repeat the model's defaults.
47
+ - **Reusable prompt files**: extract repeated prompt patterns into versioned, reviewable files.
48
+ Treat prompts as code: they have bugs, they drift, they need tests.
49
+ - **Context economy**: every token in context is a cost. Load only the context that is
50
+ relevant to the current task. Unload when done.
51
+ - **Structured output**: when the downstream consumer is code (not a human), request JSON
52
+ or a defined schema. Freeform prose is hard to parse reliably.
53
+
54
+ ## Validating Recommendations
55
+
56
+ Before recommending a tool, configuration option, or API:
57
+ 1. Check the official documentation for the current version.
58
+ 2. Verify that the feature or flag exists in the version the project is using.
59
+ 3. Test in a minimal example before including in a recommendation.
60
+
61
+ A memory that says "feature X exists" is not the same as "feature X exists now." Models have
62
+ knowledge cutoffs; documentation does not. When in doubt, read the source.
63
+
64
+ ## Human-in-the-Loop
65
+
66
+ Define checkpoints where human review is mandatory:
67
+ - Irreversible operations (production deploys, data deletions, secret rotation).
68
+ - Operations with significant blast radius (schema migrations, dependency upgrades).
69
+ - Decisions that bifurcate the architecture (new service boundary, new data model).
70
+
71
+ Agents that can proceed without human input should declare that capability explicitly in their
72
+ design. Agents that are uncertain must ask, not guess.
73
+
74
+ ## Observability for AI Systems
75
+
76
+ - Log prompts, tool calls, token counts and latency for every agent interaction in production.
77
+ - Monitor for response quality drift: a pipeline that produces correct output today may not
78
+ produce correct output after a model update.
79
+ - Evaluation datasets: maintain a set of representative inputs with expected outputs; run
80
+ them on every model or prompt change.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: trackfw-ux-skill
3
+ description: User-centred design, design systems, accessibility and usability validation.
4
+ ---
5
+
6
+ ## User-Centred Design
7
+
8
+ Design starts with understanding users, not with wireframes. Before sketching, establish:
9
+ - **Who** are the users? (personas, JTBD — Jobs to Be Done)
10
+ - **What** are they trying to accomplish? (user journey, task analysis)
11
+ - **Where** does the current experience fail? (pain points, drop-off analysis)
12
+
13
+ Design Thinking cycle: Empathize → Define → Ideate → Prototype → Test. The cycle is
14
+ iterative; return to earlier phases when testing invalidates assumptions.
15
+
16
+ ## Prototyping
17
+
18
+ Prototypes are for learning, not for pride. Build the cheapest prototype that can answer the
19
+ design question:
20
+ - **Low-fidelity** (sketch, wireframe): validates information architecture and flow.
21
+ - **High-fidelity** (interactive prototype): validates micro-interactions and visual language.
22
+ - **Discardable prototypes**: isolated from production code; exist to prove a concept, not
23
+ to ship. Remove them before the production implementation goes to review.
24
+
25
+ ## Accessibility (WCAG 2.2 AA Minimum)
26
+
27
+ Accessibility is a legal requirement in many jurisdictions and a quality attribute in all:
28
+ - Color contrast ≥ 4.5:1 for body text; ≥ 3:1 for large text and UI components.
29
+ - All interactive elements are keyboard-operable with a visible focus indicator.
30
+ - ARIA landmarks structure the page for assistive technology; do not use ARIA to override
31
+ broken semantics — fix the semantics first.
32
+ - `prefers-reduced-motion`: disable or reduce animations for users who opt out.
33
+ - Every form field has a programmatically associated label.
34
+ - Test with a real screen reader; automated tools (axe-core) catch ~30–40% of issues.
35
+
36
+ ## Usability Heuristics
37
+
38
+ Apply Nielsen's 10 heuristics as a review lens, not a checklist:
39
+ - **Visibility of system status**: users always know what is happening.
40
+ - **Match with the real world**: language and concepts match the user's mental model.
41
+ - **User control and freedom**: support undo and clear exit paths.
42
+ - **Consistency**: same words, same icons, same placement across the product.
43
+ - **Error prevention**: design to make errors impossible before handling them gracefully.
44
+
45
+ ## Design Systems
46
+
47
+ A design system is a product that serves the product team:
48
+ - **Design tokens** (W3C DTCG format): spacing, colour, typography as named variables.
49
+ Tokens are the contract between design and code.
50
+ - **Atomic Design**: atoms (button, input) → molecules (form field) → organisms (card) →
51
+ templates → pages. Each level composes from the level below.
52
+ - Document components in isolation with rendered examples, props API and accessibility notes.
53
+ - A component that cannot be demonstrated without application context is too tightly coupled.
54
+
55
+ ## Validation and Metrics
56
+
57
+ A design is a hypothesis until tested with users:
58
+ - **A/B testing**: one variable, measurable success criterion, sufficient sample size.
59
+ Do not run experiments without a pre-registered hypothesis.
60
+ - **Usability testing**: five users reveal the majority of critical usability problems.
61
+ Recruit from the actual target audience, not convenience.
62
+ - **Quantitative signals**: task completion rate, time on task, error rate, NPS/CSAT.
63
+ - **Qualitative signals**: think-aloud sessions, session replays, support ticket themes.
64
+
65
+ ## Responsive and Adaptive Design
66
+
67
+ - Mobile-first: design and test the constrained layout first; expand to wider viewports.
68
+ - Touch targets ≥ 48 dp (CSS equivalent) for all interactive elements on touch surfaces.
69
+ - Fluid typography with `clamp()` to eliminate breakpoint-driven font size jumps.
70
+ - Content-driven breakpoints, not device-driven; break where the layout breaks.