@ghostbyte/agent-docs-kit 0.0.0-stage → 4.0.2

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 (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -2
  3. package/bin/agent-docs.mjs +8 -0
  4. package/content/catalog.json +196 -0
  5. package/content/engineering/01-query-performance.md +48 -0
  6. package/content/engineering/02-networking-fundamentals.md +48 -0
  7. package/content/engineering/03-rate-limiting-algorithms.md +48 -0
  8. package/content/engineering/04-production-debugging.md +48 -0
  9. package/content/engineering/05-code-review-practices.md +48 -0
  10. package/content/engineering/06-data-modeling.md +48 -0
  11. package/content/engineering/07-cloud-cost-saving.md +48 -0
  12. package/content/engineering/08-testing-types.md +48 -0
  13. package/content/engineering/09-message-queues.md +48 -0
  14. package/content/engineering/full-reference.md +144 -0
  15. package/content/security/01-design-architecture.md +39 -0
  16. package/content/security/02-local-development.md +41 -0
  17. package/content/security/03-database-backend.md +46 -0
  18. package/content/security/04-api-layer.md +51 -0
  19. package/content/security/05-frontend-ui.md +44 -0
  20. package/content/security/06-application-security-testing.md +48 -0
  21. package/content/security/07-cicd-release-engineering.md +41 -0
  22. package/content/security/08-cloud-infrastructure.md +45 -0
  23. package/content/security/09-edge-cdn-dns.md +44 -0
  24. package/content/security/10-release-rollout.md +41 -0
  25. package/content/security/11-post-release-monitoring-ir.md +43 -0
  26. package/content/security/12-ongoing-operations.md +52 -0
  27. package/content/security/full-reference.md +3173 -0
  28. package/docs/ARCHITECTURE.md +107 -0
  29. package/docs/CONTENT_MAINTENANCE.md +9 -0
  30. package/docs/GITHUB_AND_NPM_SETUP.md +112 -0
  31. package/docs/PURPOSE.md +23 -0
  32. package/docs/RELEASE_PROCESS.md +22 -0
  33. package/docs/SECURITY_MODEL.md +9 -0
  34. package/package.json +57 -4
  35. package/skills/manage-project-quality/SKILL.md +78 -0
  36. package/skills/manage-project-quality/agents/openai.yaml +4 -0
  37. package/skills/manage-project-quality/assets/documentation-report.md +12 -0
  38. package/skills/manage-project-quality/assets/engineering-report.md +13 -0
  39. package/skills/manage-project-quality/assets/security-report.md +18 -0
  40. package/skills/manage-project-quality/references/documentation-governance.md +39 -0
  41. package/skills/manage-project-quality/references/engineering-01-query-performance.md +48 -0
  42. package/skills/manage-project-quality/references/engineering-02-networking-fundamentals.md +48 -0
  43. package/skills/manage-project-quality/references/engineering-03-rate-limiting-algorithms.md +48 -0
  44. package/skills/manage-project-quality/references/engineering-04-production-debugging.md +48 -0
  45. package/skills/manage-project-quality/references/engineering-05-code-review-practices.md +48 -0
  46. package/skills/manage-project-quality/references/engineering-06-data-modeling.md +48 -0
  47. package/skills/manage-project-quality/references/engineering-07-cloud-cost-saving.md +48 -0
  48. package/skills/manage-project-quality/references/engineering-08-testing-types.md +48 -0
  49. package/skills/manage-project-quality/references/engineering-09-message-queues.md +48 -0
  50. package/skills/manage-project-quality/references/engineering-full-reference.md +144 -0
  51. package/skills/manage-project-quality/references/engineering-protocol.md +23 -0
  52. package/skills/manage-project-quality/references/evidence-and-reporting.md +19 -0
  53. package/skills/manage-project-quality/references/security-01-design-architecture.md +39 -0
  54. package/skills/manage-project-quality/references/security-02-local-development.md +41 -0
  55. package/skills/manage-project-quality/references/security-03-database-backend.md +46 -0
  56. package/skills/manage-project-quality/references/security-04-api-layer.md +51 -0
  57. package/skills/manage-project-quality/references/security-05-frontend-ui.md +44 -0
  58. package/skills/manage-project-quality/references/security-06-application-security-testing.md +48 -0
  59. package/skills/manage-project-quality/references/security-07-cicd-release-engineering.md +41 -0
  60. package/skills/manage-project-quality/references/security-08-cloud-infrastructure.md +45 -0
  61. package/skills/manage-project-quality/references/security-09-edge-cdn-dns.md +44 -0
  62. package/skills/manage-project-quality/references/security-10-release-rollout.md +41 -0
  63. package/skills/manage-project-quality/references/security-11-post-release-monitoring-ir.md +43 -0
  64. package/skills/manage-project-quality/references/security-12-ongoing-operations.md +52 -0
  65. package/skills/manage-project-quality/references/security-full-reference.md +3173 -0
  66. package/skills/manage-project-quality/references/security-protocol.md +22 -0
  67. package/skills/manage-project-quality/scripts/check-report.mjs +23 -0
  68. package/src/api/index.mjs +4 -0
  69. package/src/cli/arguments.mjs +30 -0
  70. package/src/cli/help.mjs +24 -0
  71. package/src/cli/main.mjs +65 -0
  72. package/src/commands/audit.mjs +49 -0
  73. package/src/commands/doctor.mjs +12 -0
  74. package/src/commands/list.mjs +11 -0
  75. package/src/commands/setup.mjs +42 -0
  76. package/src/commands/skill.mjs +14 -0
  77. package/src/commands/validate.mjs +20 -0
  78. package/src/core/catalog.mjs +19 -0
  79. package/src/core/files.mjs +42 -0
  80. package/src/core/paths.mjs +5 -0
@@ -0,0 +1,48 @@
1
+ # Rate Limiting Algorithm Choices
2
+
3
+ # Engineering Topic 3: Rate Limiting Algorithm Choices
4
+
5
+ **When to run this:** When designing or reviewing a rate limiter — this is a companion to the security check in security-gate/SECURITY_CHECKLIST.md → 01_API_Security/01_rate_limiting.md, focused on picking the right algorithm rather than confirming a limiter exists.
6
+
7
+ **Goal of this pass:** Make sure the chosen algorithm actually matches the traffic pattern being protected against, instead of defaulting to whatever's easiest to implement.
8
+
9
+ ## Files in this folder
10
+
11
+ | File | Purpose |
12
+ |---|---|
13
+ | `CHECKLIST.md` | The reference list of concepts for this topic — what each one is, why it matters, and the self-check question to ask. Doesn't get filled in; copy `RESULTS_TEMPLATE.md` to record a real pass. |
14
+ | `RESULTS_TEMPLATE.md` | Fillable version of the same list, with a Status column and notes. Copy this file per pass (e.g. `RESULTS_2026-08-29.md`) so history isn't overwritten. |
15
+
16
+ Full source list lives in `../ENGINEERING_REFERENCE.md`. Unlike
17
+ `../../security-gate/phases/`, this is knowledge/practice review, not pass/fail security
18
+ testing — there's no severity rating, and "Fail" isn't the right framing.
19
+ Use the Status options in `RESULTS_TEMPLATE.md` instead: Applied, Partial,
20
+ Should adopt, or Not applicable.
21
+
22
+ ## Wrap-up
23
+
24
+ - This isn't a gate — nothing here blocks a release the way
25
+ Critical/High security items in `../../security-gate/phases/` do.
26
+ - Total concepts in this topic: 10
27
+ - Useful as an onboarding read-through, a periodic self-audit, or context
28
+ to hand an agent before it reviews related code.
29
+
30
+ ---
31
+
32
+ # Concepts — Topic 3: Rate Limiting Algorithm Choices
33
+
34
+ Reference list only — no status column. Use `RESULTS_TEMPLATE.md` in
35
+ this same folder to actually record a pass.
36
+
37
+ | # | Concept | Why it matters | Self-check |
38
+ |---|---|---|---|
39
+ | 1 | Fixed window | Simple to implement but allows a burst of 2x the limit right at the window boundary. | If fixed window is used, is the boundary-burst behavior acceptable for this endpoint? |
40
+ | 2 | Sliding window log | Precise (tracks every request timestamp) but memory-heavy at scale. | If precision matters and volume is low/medium, is sliding window log a better fit than fixed window? |
41
+ | 3 | Sliding window counter | Approximates the sliding log with much less memory by weighting two adjacent fixed windows. | For high-volume endpoints needing better accuracy than fixed window, is sliding window counter being used instead of the log variant? |
42
+ | 4 | Token bucket | Allows controlled bursts up to the bucket size while enforcing a steady refill rate — good for bursty-but-bounded traffic. | Does the traffic pattern need to allow short bursts, and if so, is token bucket the chosen algorithm? |
43
+ | 5 | Leaky bucket | Smooths bursty input into a constant output rate — good for protecting a downstream system that can't handle spikes at all. | Is there a downstream system that needs a strictly constant request rate, and if so, is leaky bucket used to enforce it? |
44
+ | 6 | Distributed rate limiting | A per-instance limiter is meaningless behind a load balancer with multiple app servers — limits get multiplied by instance count. | If the app runs on more than one instance, is the rate limit state shared (e.g. via Redis) rather than per-instance? |
45
+ | 7 | Client-side throttling | Reduces wasted requests and improves UX, but is never sufficient alone since a client can be bypassed or malicious. | Does the client throttle its own request rate, and is server-side enforcement still present as the actual control? |
46
+ | 8 | Adaptive rate limiting | Static limits can be too strict in quiet periods or too loose under load; adaptive limits adjust to current system health. | Does the limiter adjust based on current load/error rate, or is it a single static number regardless of system state? |
47
+ | 9 | Concurrency limiting | Limits in-flight requests, not just requests-per-second — protects against slow requests piling up and exhausting resources. | Is there a cap on concurrent in-flight requests per client, separate from the requests-per-second limit? |
48
+ | 10 | Back pressure | Signals upstream to slow down instead of silently dropping or queuing indefinitely when a system is overloaded. | When downstream capacity is exceeded, does the system push back (429/503, queue limits) rather than accepting unbounded work? |
@@ -0,0 +1,48 @@
1
+ # Production Debugging
2
+
3
+ # Engineering Topic 4: Debugging Production Issues
4
+
5
+ **When to run this:** Before an incident happens — this is about having the right tooling and habits in place, not what to do during a live fire.
6
+
7
+ **Goal of this pass:** Confirm the team has the observability primitives needed to actually diagnose a production issue quickly, not just react to alerts.
8
+
9
+ ## Files in this folder
10
+
11
+ | File | Purpose |
12
+ |---|---|
13
+ | `CHECKLIST.md` | The reference list of concepts for this topic — what each one is, why it matters, and the self-check question to ask. Doesn't get filled in; copy `RESULTS_TEMPLATE.md` to record a real pass. |
14
+ | `RESULTS_TEMPLATE.md` | Fillable version of the same list, with a Status column and notes. Copy this file per pass (e.g. `RESULTS_2026-08-29.md`) so history isn't overwritten. |
15
+
16
+ Full source list lives in `../ENGINEERING_REFERENCE.md`. Unlike
17
+ `../../security-gate/phases/`, this is knowledge/practice review, not pass/fail security
18
+ testing — there's no severity rating, and "Fail" isn't the right framing.
19
+ Use the Status options in `RESULTS_TEMPLATE.md` instead: Applied, Partial,
20
+ Should adopt, or Not applicable.
21
+
22
+ ## Wrap-up
23
+
24
+ - This isn't a gate — nothing here blocks a release the way
25
+ Critical/High security items in `../../security-gate/phases/` do.
26
+ - Total concepts in this topic: 10
27
+ - Useful as an onboarding read-through, a periodic self-audit, or context
28
+ to hand an agent before it reviews related code.
29
+
30
+ ---
31
+
32
+ # Concepts — Topic 4: Debugging Production Issues
33
+
34
+ Reference list only — no status column. Use `RESULTS_TEMPLATE.md` in
35
+ this same folder to actually record a pass.
36
+
37
+ | # | Concept | Why it matters | Self-check |
38
+ |---|---|---|---|
39
+ | 1 | Correlation IDs | Without a shared ID, tracing one user's request across multiple services means grepping logs by timestamp and guessing. | Does every request get a correlation/request ID that's propagated across all services it touches and included in every log line? |
40
+ | 2 | Distributed tracing | Shows exactly where time is spent across a multi-service call chain — impossible to reconstruct from logs alone at scale. | Is distributed tracing (e.g. OpenTelemetry) instrumented across service boundaries? |
41
+ | 3 | Feature flag rollback | Turning off a bad feature via flag is faster and safer than a code rollback/redeploy under incident pressure. | Can the riskiest recent features be disabled via flag without a deploy? |
42
+ | 4 | Canary analysis | Rolling out to a small subset first catches regressions before they hit 100% of traffic. | Are risky changes rolled out to a canary/subset with automated comparison against the baseline before full rollout? |
43
+ | 5 | Replay traffic | Re-running real production requests against a fix confirms it actually resolves the issue, not just a synthetic test case. | Is there a way to replay real production traffic (or a sample) against a candidate fix before it ships? |
44
+ | 6 | Heap dumps | A heap dump is often the only way to root-cause a memory leak instead of guessing from symptoms. | Is heap-dump capture available (manually or via crash trigger) for services with memory-related symptoms? |
45
+ | 7 | Chaos testing | Deliberately injecting failure in a controlled way surfaces weaknesses before real, uncontrolled failure does. | Has chaos testing (killing instances, injecting latency/errors) been run against critical paths? |
46
+ | 8 | Synthetic monitoring | Catches outages and regressions from the outside, the way a real user would experience them, independent of internal metrics. | Are synthetic checks running against critical user journeys from outside the infrastructure? |
47
+ | 9 | Error budgets | Gives a quantified, agreed-upon threshold for how much unreliability is acceptable, so incident response isn't a judgment call every time. | Is there an agreed error budget per service, and does exceeding it trigger a defined response (e.g. freeze on new features)? |
48
+ | 10 | Postmortems | Without a blameless, written record, the same class of incident tends to recur because the lesson isn't institutionalized. | Does every significant incident get a blameless postmortem with concrete follow-up actions that are actually tracked to completion? |
@@ -0,0 +1,48 @@
1
+ # Code Review Practices
2
+
3
+ # Engineering Topic 5: Code Review Practices
4
+
5
+ **When to run this:** Ongoing — use this to periodically check whether the team's actual review habits match its stated process, not just once.
6
+
7
+ **Goal of this pass:** Keep review effective and fast rather than either a rubber stamp or a bottleneck.
8
+
9
+ ## Files in this folder
10
+
11
+ | File | Purpose |
12
+ |---|---|
13
+ | `CHECKLIST.md` | The reference list of concepts for this topic — what each one is, why it matters, and the self-check question to ask. Doesn't get filled in; copy `RESULTS_TEMPLATE.md` to record a real pass. |
14
+ | `RESULTS_TEMPLATE.md` | Fillable version of the same list, with a Status column and notes. Copy this file per pass (e.g. `RESULTS_2026-08-29.md`) so history isn't overwritten. |
15
+
16
+ Full source list lives in `../ENGINEERING_REFERENCE.md`. Unlike
17
+ `../../security-gate/phases/`, this is knowledge/practice review, not pass/fail security
18
+ testing — there's no severity rating, and "Fail" isn't the right framing.
19
+ Use the Status options in `RESULTS_TEMPLATE.md` instead: Applied, Partial,
20
+ Should adopt, or Not applicable.
21
+
22
+ ## Wrap-up
23
+
24
+ - This isn't a gate — nothing here blocks a release the way
25
+ Critical/High security items in `../../security-gate/phases/` do.
26
+ - Total concepts in this topic: 10
27
+ - Useful as an onboarding read-through, a periodic self-audit, or context
28
+ to hand an agent before it reviews related code.
29
+
30
+ ---
31
+
32
+ # Concepts — Topic 5: Code Review Practices
33
+
34
+ Reference list only — no status column. Use `RESULTS_TEMPLATE.md` in
35
+ this same folder to actually record a pass.
36
+
37
+ | # | Concept | Why it matters | Self-check |
38
+ |---|---|---|---|
39
+ | 1 | Small PRs | Large PRs get worse review (reviewers skim or rubber-stamp) and take longer to land. | Is there a rough size norm for PRs, and are oversized PRs flagged for splitting? |
40
+ | 2 | Clear description | A reviewer without context re-derives the 'why' from the diff alone, which is slower and more error-prone than being told. | Does every PR description explain what changed and why, not just restate the diff? |
41
+ | 3 | Constructive feedback | Feedback that reads as personal or vague either gets ignored or damages the reviewer/author relationship over time. | Is feedback phrased around the code/tradeoff rather than the author, with a suggested direction, not just a criticism? |
42
+ | 4 | Nitpick vs blocker | Without this distinction, minor style opinions can block a merge as if they were correctness issues. | Are non-blocking comments explicitly labeled (e.g. 'nit:') so the author knows what's optional vs required? |
43
+ | 5 | Fast turnaround | A PR that sits for days loses context for both author and reviewer and blocks downstream work. | Is there a target turnaround time for first review, and is it generally being met? |
44
+ | 6 | Automated checks first | Humans shouldn't spend review time on things a linter/CI can catch automatically. | Do lint, format, and test checks run and pass before a human reviews the PR? |
45
+ | 7 | Context before code | Reviewing code without understanding the surrounding system leads to reviews that miss integration-level problems. | Does the reviewer understand the relevant part of the system before diving into line-by-line comments? |
46
+ | 8 | Approve vs request changes | Conflating 'I have a question' with 'this is blocked' slows things down or sends mixed signals. | Is the approve/comment/request-changes distinction used deliberately, not defaulted to whichever is habit? |
47
+ | 9 | Self-review first | Authors catch a meaningful fraction of their own issues by re-reading the diff before asking someone else to. | Does the author review their own diff (and leave self-notes where useful) before requesting review? |
48
+ | 10 | Learning from reviews | Review comments that aren't retained just repeat themselves across future PRs instead of becoming shared knowledge. | Do recurring review comments get turned into a lint rule, style-guide entry, or documented convention? |
@@ -0,0 +1,48 @@
1
+ # Data Modeling
2
+
3
+ # Engineering Topic 6: Data Modeling Concepts
4
+
5
+ **When to run this:** When designing a new schema, adding a table/relationship to an existing one, or reviewing a migration before it ships.
6
+
7
+ **Goal of this pass:** Confirm the schema decisions are deliberate — the right relationship type, the right key strategy, the right precision — rather than whatever the ORM defaulted to.
8
+
9
+ ## Files in this folder
10
+
11
+ | File | Purpose |
12
+ |---|---|
13
+ | `CHECKLIST.md` | The reference list of concepts for this topic — what each one is, why it matters, and the self-check question to ask. Doesn't get filled in; copy `RESULTS_TEMPLATE.md` to record a real pass. |
14
+ | `RESULTS_TEMPLATE.md` | Fillable version of the same list, with a Status column and notes. Copy this file per pass (e.g. `RESULTS_2026-08-29.md`) so history isn't overwritten. |
15
+
16
+ Full source list lives in `../ENGINEERING_REFERENCE.md`. Unlike
17
+ `../../security-gate/phases/`, this is knowledge/practice review, not pass/fail security
18
+ testing — there's no severity rating, and "Fail" isn't the right framing.
19
+ Use the Status options in `RESULTS_TEMPLATE.md` instead: Applied, Partial,
20
+ Should adopt, or Not applicable.
21
+
22
+ ## Wrap-up
23
+
24
+ - This isn't a gate — nothing here blocks a release the way
25
+ Critical/High security items in `../../security-gate/phases/` do.
26
+ - Total concepts in this topic: 10
27
+ - Useful as an onboarding read-through, a periodic self-audit, or context
28
+ to hand an agent before it reviews related code.
29
+
30
+ ---
31
+
32
+ # Concepts — Topic 6: Data Modeling Concepts
33
+
34
+ Reference list only — no status column. Use `RESULTS_TEMPLATE.md` in
35
+ this same folder to actually record a pass.
36
+
37
+ | # | Concept | Why it matters | Self-check |
38
+ |---|---|---|---|
39
+ | 1 | Primary vs foreign keys | Gets the basic referential integrity of the schema right; missing FK constraints let orphaned/inconsistent data accumulate silently. | Does every relationship that should be enforced have an actual FK constraint, not just an implied convention? |
40
+ | 2 | One-to-many | The most common relationship shape; modeling it as many-to-many or vice versa causes either data duplication or missing constraints. | For each relationship, has one-to-many vs many-to-many actually been verified against real-world cardinality, not assumed? |
41
+ | 3 | Many-to-many | Requires a join table; skipping it (e.g. storing a comma-separated list) breaks referential integrity and queryability. | Are many-to-many relationships modeled with a proper join table rather than a denormalized list column? |
42
+ | 4 | Composite keys | Sometimes the natural key is a combination of columns, not a synthetic ID — forcing a synthetic key can hide a real uniqueness constraint. | Where a natural composite key exists (e.g. user_id + role_id), is it enforced as a unique constraint even if a synthetic PK is also used? |
43
+ | 5 | Soft deletes | A `deleted_at` column preserves history/auditability but means every query must remember to filter it, or leaked 'deleted' data appears. | If soft deletes are used, do all reads consistently filter them out (e.g. via a default scope), and is that not forgotten in raw queries? |
44
+ | 6 | Polymorphic associations | Lets one table reference multiple other table types, but sacrifices FK constraint enforcement at the DB level — a known tradeoff, not a free pattern. | Where a polymorphic association is used, was that tradeoff (no DB-level FK) made deliberately, with integrity checks handled elsewhere? |
45
+ | 7 | Enum vs lookup table | A hardcoded enum is faster to query but requires a migration/deploy to add a value; a lookup table is more flexible but adds a join. | Was the enum-vs-lookup-table choice made based on how often the value set changes, not just habit? |
46
+ | 8 | Audit columns | Without created_at/updated_at/created_by-style columns, debugging 'when did this change and who did it' becomes guesswork. | Do tables that matter for debugging/compliance have consistent audit columns? |
47
+ | 9 | Schema migrations | Migrations that aren't reversible or aren't tested against production-scale data can cause downtime or data loss when they run for real. | Are migrations reviewed for reversibility and tested against realistic data volume before running on production? |
48
+ | 10 | Precision & data types | Using float for money, or too-small an int type for a growing counter, causes rounding errors or overflow that surface much later. | Are numeric types chosen deliberately (e.g. decimal for currency, right-sized int for counters expected to grow)? |
@@ -0,0 +1,48 @@
1
+ # Cloud Cost Saving
2
+
3
+ # Engineering Topic 7: Cloud Cost-Saving Techniques
4
+
5
+ **When to run this:** During a cost review, before scaling up infrastructure, or when a cloud bill increase needs investigating.
6
+
7
+ **Goal of this pass:** Work through the standard cost levers systematically instead of just cutting the first expensive-looking line item.
8
+
9
+ ## Files in this folder
10
+
11
+ | File | Purpose |
12
+ |---|---|
13
+ | `CHECKLIST.md` | The reference list of concepts for this topic — what each one is, why it matters, and the self-check question to ask. Doesn't get filled in; copy `RESULTS_TEMPLATE.md` to record a real pass. |
14
+ | `RESULTS_TEMPLATE.md` | Fillable version of the same list, with a Status column and notes. Copy this file per pass (e.g. `RESULTS_2026-08-29.md`) so history isn't overwritten. |
15
+
16
+ Full source list lives in `../ENGINEERING_REFERENCE.md`. Unlike
17
+ `../../security-gate/phases/`, this is knowledge/practice review, not pass/fail security
18
+ testing — there's no severity rating, and "Fail" isn't the right framing.
19
+ Use the Status options in `RESULTS_TEMPLATE.md` instead: Applied, Partial,
20
+ Should adopt, or Not applicable.
21
+
22
+ ## Wrap-up
23
+
24
+ - This isn't a gate — nothing here blocks a release the way
25
+ Critical/High security items in `../../security-gate/phases/` do.
26
+ - Total concepts in this topic: 10
27
+ - Useful as an onboarding read-through, a periodic self-audit, or context
28
+ to hand an agent before it reviews related code.
29
+
30
+ ---
31
+
32
+ # Concepts — Topic 7: Cloud Cost-Saving Techniques
33
+
34
+ Reference list only — no status column. Use `RESULTS_TEMPLATE.md` in
35
+ this same folder to actually record a pass.
36
+
37
+ | # | Concept | Why it matters | Self-check |
38
+ |---|---|---|---|
39
+ | 1 | Spot instances | Substantially cheaper than on-demand, but can be reclaimed with short notice — only right for interruption-tolerant workloads. | Are interruption-tolerant workloads (batch jobs, stateless workers) running on spot instead of on-demand? |
40
+ | 2 | Autoscaling | Paying for peak capacity 24/7 wastes money during predictable low-traffic periods. | Does capacity actually scale down during known low-traffic periods, not just scale up under load? |
41
+ | 3 | Reserved capacity | Committing to steady-state baseline load ahead of time is cheaper than paying on-demand rates for it continuously. | Has the stable, predictable-load portion of infrastructure been covered by reserved/committed-use pricing? |
42
+ | 4 | Right-sizing | Over-provisioned instances (low CPU/memory utilization) are a direct, ongoing waste that compounds over time. | Have instance sizes been checked against actual utilization recently, not just set once at launch and left alone? |
43
+ | 5 | Storage tiering | Infrequently accessed data doesn't need to sit on the most expensive, fastest storage tier. | Is cold/infrequently-accessed data moved to a cheaper storage tier rather than left on the default hot tier? |
44
+ | 6 | CDN offloading | Serving static/cacheable content from origin instead of a CDN costs more in bandwidth and origin load. | Is static and cacheable content served from a CDN rather than hitting origin servers for every request? |
45
+ | 7 | Serverless for spiky loads | Paying for always-on servers to handle infrequent, spiky workloads is wasteful compared to pay-per-invocation. | Are low-frequency, spiky workloads running serverless rather than on dedicated always-on infrastructure? |
46
+ | 8 | Idle resource cleanup | Unattached volumes, unused load balancers, and orphaned snapshots accumulate cost silently over time. | Is there a recurring process to find and remove idle/orphaned cloud resources? |
47
+ | 9 | Compression | Uncompressed data transfer and storage costs more in both bandwidth and storage fees than it needs to. | Is compression enabled where it's cheap to apply (asset delivery, log storage, backups)? |
48
+ | 10 | Multi-region arbitrage | Compute/storage/egress pricing varies meaningfully by region — running in the highest-cost region without a reason is avoidable spend. | Has region choice been checked against pricing, not just picked for proximity or default? |
@@ -0,0 +1,48 @@
1
+ # Testing Types
2
+
3
+ # Engineering Topic 8: Types of Testing
4
+
5
+ **When to run this:** When designing a test strategy for a new project/feature, or auditing whether the current test suite has coverage gaps.
6
+
7
+ **Goal of this pass:** Confirm the right mix of test types is in place for what's actually being built — not every project needs every type, but the choice should be deliberate.
8
+
9
+ ## Files in this folder
10
+
11
+ | File | Purpose |
12
+ |---|---|
13
+ | `CHECKLIST.md` | The reference list of concepts for this topic — what each one is, why it matters, and the self-check question to ask. Doesn't get filled in; copy `RESULTS_TEMPLATE.md` to record a real pass. |
14
+ | `RESULTS_TEMPLATE.md` | Fillable version of the same list, with a Status column and notes. Copy this file per pass (e.g. `RESULTS_2026-08-29.md`) so history isn't overwritten. |
15
+
16
+ Full source list lives in `../ENGINEERING_REFERENCE.md`. Unlike
17
+ `../../security-gate/phases/`, this is knowledge/practice review, not pass/fail security
18
+ testing — there's no severity rating, and "Fail" isn't the right framing.
19
+ Use the Status options in `RESULTS_TEMPLATE.md` instead: Applied, Partial,
20
+ Should adopt, or Not applicable.
21
+
22
+ ## Wrap-up
23
+
24
+ - This isn't a gate — nothing here blocks a release the way
25
+ Critical/High security items in `../../security-gate/phases/` do.
26
+ - Total concepts in this topic: 10
27
+ - Useful as an onboarding read-through, a periodic self-audit, or context
28
+ to hand an agent before it reviews related code.
29
+
30
+ ---
31
+
32
+ # Concepts — Topic 8: Types of Testing
33
+
34
+ Reference list only — no status column. Use `RESULTS_TEMPLATE.md` in
35
+ this same folder to actually record a pass.
36
+
37
+ | # | Concept | Why it matters | Self-check |
38
+ |---|---|---|---|
39
+ | 1 | Unit test | Tests one function/module in isolation — fast feedback, but doesn't catch integration problems. | Do core business-logic units have direct unit test coverage, isolated from external dependencies? |
40
+ | 2 | Integration test | Tests that multiple components work together correctly (e.g. app + real DB) — catches what unit tests can't. | Are integration tests run against real (or realistic) dependencies, not just mocks, for critical paths? |
41
+ | 3 | End-to-end test | Tests a full user flow through the real system — the closest simulation of actual usage, but slow and more brittle. | Do the most critical user journeys have E2E coverage, kept to a small, high-value set rather than everything? |
42
+ | 4 | Snapshot test | Catches unintended changes to output (UI render, API response shape) by diffing against a saved reference. | Where snapshot tests are used, are snapshots actually reviewed on change, not blindly re-approved? |
43
+ | 5 | Contract test | Verifies that a service's API still matches what its consumers expect, without needing a full integration environment. | For services with external consumers, are contract tests in place to catch breaking API changes before deploy? |
44
+ | 6 | Load test | Confirms the system holds up under expected (and above-expected) traffic before it meets that traffic in production. | Has the system been load-tested at a realistic multiple of expected peak traffic? |
45
+ | 7 | Chaos test | Confirms the system degrades gracefully under real failure conditions, not just happy-path load. | Has chaos testing been run against the critical paths (see also Debugging Production Issues)? |
46
+ | 8 | Mutation test | Checks whether the test suite would actually catch a real bug by deliberately introducing small code mutations and seeing if tests fail. | Has mutation testing been run at least once to sanity-check that the test suite isn't just achieving coverage without catching bugs? |
47
+ | 9 | Smoke test | A fast, shallow check that the basic system is up and functional — meant to catch catastrophic failures immediately after deploy. | Does every deploy run a fast smoke test before being considered successful? |
48
+ | 10 | Regression test | Confirms a previously fixed bug doesn't come back — without it, the same bug can resurface silently. | Does every fixed bug get a corresponding regression test added to the suite? |
@@ -0,0 +1,48 @@
1
+ # Message Queues
2
+
3
+ # Engineering Topic 9: Message Queue Concepts
4
+
5
+ **When to run this:** When designing or reviewing a system that uses a message queue/event stream (Kafka, RabbitMQ, SQS, etc.) for async communication between services.
6
+
7
+ **Goal of this pass:** Confirm the delivery, ordering, and failure-handling guarantees the system actually needs match what the queue setup actually provides.
8
+
9
+ ## Files in this folder
10
+
11
+ | File | Purpose |
12
+ |---|---|
13
+ | `CHECKLIST.md` | The reference list of concepts for this topic — what each one is, why it matters, and the self-check question to ask. Doesn't get filled in; copy `RESULTS_TEMPLATE.md` to record a real pass. |
14
+ | `RESULTS_TEMPLATE.md` | Fillable version of the same list, with a Status column and notes. Copy this file per pass (e.g. `RESULTS_2026-08-29.md`) so history isn't overwritten. |
15
+
16
+ Full source list lives in `../ENGINEERING_REFERENCE.md`. Unlike
17
+ `../../security-gate/phases/`, this is knowledge/practice review, not pass/fail security
18
+ testing — there's no severity rating, and "Fail" isn't the right framing.
19
+ Use the Status options in `RESULTS_TEMPLATE.md` instead: Applied, Partial,
20
+ Should adopt, or Not applicable.
21
+
22
+ ## Wrap-up
23
+
24
+ - This isn't a gate — nothing here blocks a release the way
25
+ Critical/High security items in `../../security-gate/phases/` do.
26
+ - Total concepts in this topic: 10
27
+ - Useful as an onboarding read-through, a periodic self-audit, or context
28
+ to hand an agent before it reviews related code.
29
+
30
+ ---
31
+
32
+ # Concepts — Topic 9: Message Queue Concepts
33
+
34
+ Reference list only — no status column. Use `RESULTS_TEMPLATE.md` in
35
+ this same folder to actually record a pass.
36
+
37
+ | # | Concept | Why it matters | Self-check |
38
+ |---|---|---|---|
39
+ | 1 | Producer / consumer | The basic decoupling pattern — getting the boundary wrong (e.g. producer waiting on consumer) defeats the purpose of using a queue at all. | Are producers and consumers actually decoupled, with the producer not blocked waiting on consumer processing? |
40
+ | 2 | Topic + partition | Partitioning enables parallel consumption, but choosing the wrong partition key can cause hot partitions or lost ordering guarantees. | Is the partition key chosen deliberately (e.g. by entity ID) rather than defaulted, and does it avoid hot-partitioning? |
41
+ | 3 | Consumer group | Lets multiple consumer instances share the work of one topic without processing the same message redundantly (within the group). | If there are multiple consumer instances, are they correctly grouped so work is distributed, not duplicated? |
42
+ | 4 | At-least-once delivery | The common default guarantee — means consumers WILL sometimes see the same message twice and must handle that. | Does every consumer assume at-least-once delivery and handle duplicate messages correctly? |
43
+ | 5 | Dead letter queue | Without one, a message that repeatedly fails processing either blocks the queue or is silently dropped. | Do failed messages, after retry limits, go to a dead letter queue instead of blocking or vanishing? |
44
+ | 6 | Backpressure | If consumers can't keep up, the system needs a defined behavior (slow producers, buffer, drop) rather than unbounded queue growth. | Is there a defined response when consumer lag grows unbounded, rather than assuming it will always catch up? |
45
+ | 7 | Fan-out | Delivering one message to multiple independent consumers (e.g. via separate subscriptions) needs the right topology — a single queue with one consumer group won't do it. | If multiple independent services need the same message, is the topology (e.g. separate subscriptions/topics) actually set up for fan-out? |
46
+ | 8 | Message ordering | Most queues only guarantee order within a partition/shard, not globally — code that assumes global order will break. | Does any consumer logic assume strict global ordering, and if so, does the actual queue setup guarantee that? |
47
+ | 9 | Idempotent consumer | Given at-least-once delivery, consumers must be able to safely process the same message twice without double-effecting (e.g. double-charging). | Is consumer processing logic idempotent (e.g. keyed on a unique message/operation ID) so redelivery is safe? |
48
+ | 10 | Offset commit | Committing the offset too early risks losing a message if processing then fails; committing too late risks reprocessing more than necessary. | Is the offset committed only after successful processing (not before), matching the delivery guarantee the system actually needs? |
@@ -0,0 +1,144 @@
1
+ # Engineering Reference
2
+
3
+ A companion to `../security-gate/SECURITY_CHECKLIST.md`. That file is pass/fail **security
4
+ tests**; this file is **"what should I know"** — quick-recall concept lists
5
+ for performance, infra, and engineering practice. Nothing here has a
6
+ severity rating or a test step; use it for onboarding, self-study, or as
7
+ context for an agent before it reviews related code.
8
+
9
+ ## Table of contents
10
+
11
+ - [A. Speeding Up a Slow Query](#a-speeding-up-a-slow-query)
12
+ - [B. Networking Concepts Every Dev Should Know](#b-networking-concepts-every-dev-should-know)
13
+ - [C. Rate Limiting Algorithms](#c-rate-limiting-algorithms)
14
+ - [D. Debugging Production Issues](#d-debugging-production-issues)
15
+ - [E. Code Review Practices](#e-code-review-practices)
16
+ - [F. Data Modeling Concepts](#f-data-modeling-concepts)
17
+ - [G. Cloud Cost-Saving Techniques](#g-cloud-cost-saving-techniques)
18
+ - [H. Types of Testing](#h-types-of-testing)
19
+ - [I. Message Queue Concepts](#i-message-queue-concepts)
20
+
21
+ > **Note:** the original "Web security vulnerabilities" list is not
22
+ > duplicated here — it's already covered item-for-item in
23
+ > `../security-gate/SECURITY_CHECKLIST.md` → `02_Web_Vulnerabilities`. Rate limiting
24
+ > algorithms (below) are a companion to, not a replacement for,
25
+ > `01_API_Security/01_rate_limiting.md`.
26
+
27
+ ---
28
+
29
+ ## A. Speeding Up a Slow Query
30
+
31
+ 1. Start with the explain plan
32
+ 2. Add the missing index
33
+ 3. Stop selecting *
34
+ 4. Fix N+1 queries
35
+ 5. Use a covering index
36
+ 6. Cache repeated queries
37
+ 7. Prune partitions
38
+ 8. Denormalize for reads
39
+ 9. Batch your writes
40
+ 10. Update table statistics
41
+
42
+ ## B. Networking Concepts Every Dev Should Know
43
+
44
+ 1. DNS resolution
45
+ 2. TCP handshake
46
+ 3. TLS handshake
47
+ 4. NAT
48
+ 5. Load balancer types
49
+ 6. CDN edge caching
50
+ 7. Packet loss & retransmit
51
+ 8. MTU / fragmentation
52
+ 9. Keep-alive
53
+ 10. BGP routing
54
+
55
+ ## C. Rate Limiting Algorithms
56
+
57
+ 1. Fixed window
58
+ 2. Sliding window log
59
+ 3. Sliding window counter
60
+ 4. Token bucket
61
+ 5. Leaky bucket
62
+ 6. Distributed rate limiting
63
+ 7. Client-side throttling
64
+ 8. Adaptive rate limiting
65
+ 9. Concurrency limiting
66
+ 10. Back pressure
67
+
68
+ ## D. Debugging Production Issues
69
+
70
+ 1. Correlation IDs
71
+ 2. Distributed tracing
72
+ 3. Feature flag rollback
73
+ 4. Canary analysis
74
+ 5. Replay traffic
75
+ 6. Heap dumps
76
+ 7. Chaos testing
77
+ 8. Synthetic monitoring
78
+ 9. Error budgets
79
+ 10. Postmortems
80
+
81
+ ## E. Code Review Practices
82
+
83
+ 1. Small PRs
84
+ 2. Clear description
85
+ 3. Constructive feedback
86
+ 4. Nitpick vs. blocker
87
+ 5. Fast turnaround
88
+ 6. Automated checks first
89
+ 7. Context before code
90
+ 8. Approve vs. request changes
91
+ 9. Self-review first
92
+ 10. Learning from reviews
93
+
94
+ ## F. Data Modeling Concepts
95
+
96
+ 1. Primary vs. foreign keys
97
+ 2. One-to-many
98
+ 3. Many-to-many
99
+ 4. Composite keys
100
+ 5. Soft deletes
101
+ 6. Polymorphic associations
102
+ 7. Enum vs. lookup table
103
+ 8. Audit columns
104
+ 9. Schema migrations
105
+ 10. Precision & data types
106
+
107
+ ## G. Cloud Cost-Saving Techniques
108
+
109
+ 1. Spot instances
110
+ 2. Autoscaling
111
+ 3. Reserved capacity
112
+ 4. Right-sizing
113
+ 5. Storage tiering
114
+ 6. CDN offloading
115
+ 7. Serverless for spiky loads
116
+ 8. Idle resource cleanup
117
+ 9. Compression
118
+ 10. Multi-region arbitrage
119
+
120
+ ## H. Types of Testing
121
+
122
+ 1. Unit test
123
+ 2. Integration test
124
+ 3. End-to-end test
125
+ 4. Snapshot test
126
+ 5. Contract test
127
+ 6. Load test
128
+ 7. Chaos test
129
+ 8. Mutation test
130
+ 9. Smoke test
131
+ 10. Regression test
132
+
133
+ ## I. Message Queue Concepts
134
+
135
+ 1. Producer / consumer
136
+ 2. Topic + partition
137
+ 3. Consumer group
138
+ 4. At-least-once delivery
139
+ 5. Dead letter queue
140
+ 6. Backpressure
141
+ 7. Fan-out
142
+ 8. Message ordering
143
+ 9. Idempotent consumer
144
+ 10. Offset commit
@@ -0,0 +1,23 @@
1
+ # Engineering review protocol
2
+
3
+ ## Purpose
4
+
5
+ Engineering reviews improve maintainability, reliability, performance, testability, operability, and cost efficiency. They guide design and practice; they are not automatically release gates.
6
+
7
+ ## Statuses
8
+
9
+ - `Applied`: the practice is implemented and supported by evidence.
10
+ - `Partial`: useful parts exist, but a material gap remains.
11
+ - `Recommended`: the practice would provide value and is not currently applied.
12
+ - `Unverified`: available evidence cannot establish the state.
13
+ - `N/A`: the practice does not apply; record why.
14
+
15
+ If the review discovers a security vulnerability, data-loss risk, or correctness defect, report that separately rather than disguising it as an advisory recommendation.
16
+
17
+ ## Review approach
18
+
19
+ 1. Identify the system constraint or decision under review.
20
+ 2. Inspect representative code, configuration, tests, telemetry, and design records.
21
+ 3. Evaluate tradeoffs in the project’s actual scale and failure model.
22
+ 4. Prefer measurable recommendations with a verification method.
23
+ 5. Avoid importing enterprise complexity into a project that does not need it.
@@ -0,0 +1,19 @@
1
+ # Evidence and reporting
2
+
3
+ ## Evidence hierarchy
4
+
5
+ Prefer direct evidence: relevant code lines, configuration, tests, reproducible command output, build artifacts, and authorized platform settings. Label deductions as inference and state what would confirm them.
6
+
7
+ Each finding should contain:
8
+
9
+ - control or practice reviewed;
10
+ - status and severity or priority;
11
+ - precise evidence location;
12
+ - impact in this project;
13
+ - remediation and responsible owner;
14
+ - verification step;
15
+ - limitations or assumptions.
16
+
17
+ Do not paste credentials or sensitive payloads. Quote only the minimum code needed to support the finding. If line numbers are unstable, include a symbol, key, or command that allows rediscovery.
18
+
19
+ In learning mode, add a short “why this matters” explanation and one concrete example. Do not require the user to repeat answers back as a condition for completing the review.
@@ -0,0 +1,39 @@
1
+ # Design & Architecture
2
+
3
+ # Phase 1: Design & Architecture (Pre-Code)
4
+
5
+ **When to run this:** Before writing code — during system/feature design, RFCs, or architecture review.
6
+
7
+ **Goal of this pass:** Catch design-level flaws (missing trust boundaries, over-broad data collection, no threat model) that are cheap to fix now and expensive to fix after code exists.
8
+
9
+ ## Files in this folder
10
+
11
+ | File | Purpose |
12
+ |---|---|
13
+ | `CHECKLIST.md` | What to check — the reference list of items, severity, and example test steps for this phase. Doesn't get filled in; copy it or use `RESULTS_TEMPLATE.md` to record a real pass. |
14
+ | `RESULTS_TEMPLATE.md` | Fillable version of the same checklist, with Result/Notes columns and a sign-off block. Copy this file per test pass (e.g. `RESULTS_2026-08-29.md`) so history isn't overwritten. |
15
+
16
+ Full background, "why it matters," and references for every item live in
17
+ `../../SECURITY_CHECKLIST.md` (search for the source file path shown in the
18
+ checklist below).
19
+
20
+ ## Sign-off criteria
21
+
22
+ - All Critical/High severity items must Pass or have an approved exception
23
+ before this phase is considered complete.
24
+ - Total items in this phase: 5
25
+
26
+ ---
27
+
28
+ # What to Check — Phase 1: Design & Architecture (Pre-Code)
29
+
30
+ Reference checklist only — no result columns. Use `RESULTS_TEMPLATE.md` in
31
+ this same folder to actually record a test pass.
32
+
33
+ | # | Source file | Item | Severity | Example test |
34
+ |---|---|---|---|---|
35
+ | 1 | `15_Architecture_Compliance/01_privacy_by_design.md` | Privacy by Design | Medium | Review the most recent feature's design doc and confirm data collection was scoped to only what the feature actually needs. |
36
+ | 2 | `15_Architecture_Compliance/02_threat_modeling.md` | Threat Modeling | High | Pull the data-flow diagram for the highest-risk service and confirm a STRIDE (or equivalent) pass was actually performed and mitigations tracked to closure. |
37
+ | 3 | `15_Architecture_Compliance/04_defense_in_depth.md` | Defense in Depth | Medium | Pick one critical asset and map every independent control protecting it; confirm there isn't a single point whose failure alone exposes it. |
38
+ | 4 | `15_Architecture_Compliance/06_zero_trust_network.md` | Zero Trust Network Architecture | High | From inside the internal network, attempt to reach a service without presenting valid per-request authentication and confirm it's still denied. |
39
+ | 5 | `15_Architecture_Compliance/08_secure_sdlc.md` | Secure SDLC (added) | Medium | Confirm the most recent feature had security requirements defined at design time, not bolted on after code review. |
@@ -0,0 +1,41 @@
1
+ # Local Development
2
+
3
+ # Phase 2: Local Development
4
+
5
+ **When to run this:** During day-to-day coding, before opening a pull request.
6
+
7
+ **Goal of this pass:** Prevent secrets, unpinned/unvetted dependencies, and known-bad coding patterns from ever reaching a shared branch.
8
+
9
+ ## Files in this folder
10
+
11
+ | File | Purpose |
12
+ |---|---|
13
+ | `CHECKLIST.md` | What to check — the reference list of items, severity, and example test steps for this phase. Doesn't get filled in; copy it or use `RESULTS_TEMPLATE.md` to record a real pass. |
14
+ | `RESULTS_TEMPLATE.md` | Fillable version of the same checklist, with Result/Notes columns and a sign-off block. Copy this file per test pass (e.g. `RESULTS_2026-08-29.md`) so history isn't overwritten. |
15
+
16
+ Full background, "why it matters," and references for every item live in
17
+ `../../SECURITY_CHECKLIST.md` (search for the source file path shown in the
18
+ checklist below).
19
+
20
+ ## Sign-off criteria
21
+
22
+ - All Critical/High severity items must Pass or have an approved exception
23
+ before this phase is considered complete.
24
+ - Total items in this phase: 7
25
+
26
+ ---
27
+
28
+ # What to Check — Phase 2: Local Development
29
+
30
+ Reference checklist only — no result columns. Use `RESULTS_TEMPLATE.md` in
31
+ this same folder to actually record a test pass.
32
+
33
+ | # | Source file | Item | Severity | Example test |
34
+ |---|---|---|---|---|
35
+ | 1 | `08_Release_Engineering_Version_Control/01_secure_coding_guidelines.md` | Secure Coding Guidelines | Low | Confirm the team's secure-coding cheat sheet is linked from the PR template/onboarding docs, not just filed away unused. |
36
+ | 2 | `08_Release_Engineering_Version_Control/02_semantic_versioning.md` | Semantic Versioning | Low | Check the last 3 releases and confirm any breaking change actually bumped the MAJOR version. |
37
+ | 3 | `10_Dependency_Supply_Chain/01_backend_dependency_scanning.md` | Dependency & SCA Scanning | High | Run the SCA scanner manually against the current backend dependency tree and confirm it matches what CI reports, with no critical CVEs unpatched past SLA. |
38
+ | 4 | `10_Dependency_Supply_Chain/02_dependency_version_pinning.md` | Dependency Version Pinning | Medium | Delete the lockfile locally and reinstall; confirm CI fails the build if the regenerated lockfile differs from the committed one. |
39
+ | 5 | `10_Dependency_Supply_Chain/03_frontend_dependency_scanning.md` | Frontend Dependency Scanning | Medium | Run npm audit / yarn audit and manually review any newly added package for typosquatting risk or suspicious post-install scripts. |
40
+ | 6 | `06_Data_Protection_Secrets/06_secrets_management.md` | Secrets Management (added) | Critical | Run a secret-scanning tool (e.g. gitleaks/truffleHog) across the full git history, not just HEAD, and confirm zero committed credentials. |
41
+ | 7 | `09_Release_Pipeline_Stages/01_local_dev_testing.md` | Stage 1: Local / Developer Testing | Low | Confirm a fresh local dev environment setup never requires copying real production credentials or data. |