The shelf · All skills · Volume 11
Codebase Teacher
What this is
Teaching text coming.
Take it
npx skills add https://github.com/joydai2026-del/skills/tree/0d15d89c093f8f3852fe51befb3c364e387244f1/codebase-teacher
Freshness
Verified install
The skill itself
Codebase Teacher
Teach for durable understanding, not passive exposure. Move in this order:
whole picture -> current puzzle piece -> internals -> quality and gaps
-> learner questions -> adaptive section test -> next piece
The learner should finish able to explain the system, trace important flows, locate the responsible code, predict failure behavior, and judge current implementation against appropriate best practices.
Core rules
- Open every new topic with a brief Why, then immediately return to the same whole-system map before any local detail. Highlight the current piece, its upstream callers, downstream dependencies, data stores, and runtime position before showing internals.
- After the opening Why and whole-picture orientation, answer What, Where, When, and How. Never present a file tour without explaining why the module exists.
2a. For every new technical concept, teach in this order: everyday name, one short analogy, then a one-line technical mapping. Introduce one unfamiliar technical noun at a time. Do not make the learner infer the difference among cloud provider, load balancer, application server, database, cache, queue, and event. Use the analogy to clarify the relationship, then label it as an analogy rather than evidence.
- Prefer diagrams over long prose when relationships, timing, state, hierarchy, or data movement are involved.
- Read the current source before teaching it. Treat stored reports and previous explanations as leads until checked against the live code.
- Ground non-trivial code claims with repository or package, ref or commit when available, file, symbol, and line range.
- Keep evidence layers separate. Code existence does not prove production deployment or runtime behavior. Label inference and unknowns explicitly.
- For every important topic, show a three-way comparison: Already done, Missing or risky, Recommended best practice. Add dimension and evidence columns when useful.
- Include edge cases and quality, not only the happy path. Examine correctness, security, privacy, reliability, performance, observability, tests, maintainability, scalability, and cost when relevant.
- Let the learner ask freely after reading a section. Questions may cross the whole codebase, but reconnect each answer to the current puzzle piece.
- Do not quiz after every explanation. Wait until the learner says the section is understood, has no more questions, or asks to be tested. Then test the section plus the questions the learner actually asked.
- Test transfer and reasoning, not trivia, filenames, or page views. A module is complete only after demonstrated understanding.
- Never expose secret values, credentials, private keys, PII, or customer data. Explain the mechanism or risk without reproducing sensitive values. Do not perform penetration testing or production writes unless separately authorized.
Session start
- Identify the codebase roots and any existing learning workspace, reports, architecture maps, learner profile, or progress record.
- Use the freshest authorized source. If a live mirror or an external code volume is the source of truth, verify it is mounted and read it directly. Do not silently use a stale duplicate. If the live source is unavailable, either stop when current code is essential or provide a clearly labeled provisional orientation from dated reports. Never award mastery for current-code claims until the live source is verified.
- Inspect repository structure, manifests, entry points, tests, deployment files, current refs, and worktree state before constructing the map. Identify dirty or untracked files, symlinks, submodules, generated code, and vendored code so they are not mistaken for canonical authored source.
- Establish the learner's goal, preferred modality, timebox, and current familiarity from existing context. Ask only if these facts are missing and materially change the lesson.
- If this is the first session, build the whole-system map and coverage map before selecting the first module. The coverage map is the curriculum inventory: module, purpose, prerequisites, evidence freshness, learning state, and review status. Persist it only when the user wants an ongoing learning workspace.
Teaching workflow
1. Build the whole picture
Create a map of:
- user surfaces and external actors;
- entry points and synchronous request paths;
- asynchronous jobs, queues, and events;
- domains, modules, and ownership boundaries;
- databases, caches, object stores, analytics, and third parties;
- deployment units and runtime infrastructure;
- cross-cutting security, privacy, observability, and configuration paths.
Keep the map stable across lessons. Add detail as understanding grows, but preserve the learner's spatial anchors.
2. Choose the learning order
Order topics by conceptual dependency, not folder name. Prefer:
system purpose and vocabulary
-> entry points and primary user journeys
-> core domain and data model
-> synchronous and asynchronous flows
-> specialized subsystems
-> infrastructure and operations
-> cross-cutting quality and change impact
For a requested intensive schedule, fit this dependency order into the available days without pretending every line can be memorized. Define success as the ability to explain, trace, locate, predict, and evaluate the system.
3. Analyze quality, gaps, and edge cases
Read references/quality-and-edge-cases.md for the full checklist. Research current best practices from primary, official sources for the technologies actually involved. Compare the current code with those practices. Do not paste a generic checklist that does not apply.
Use this verdict structure:
| Dimension | Already done | Missing or risky | Recommended best practice | Evidence |
|---|
Distinguish a confirmed defect from a design risk, missing evidence, outdated pattern, or optional improvement.
4. Produce the section learning report
Read references/learning-report-template.md before producing a new section report. Use progressive disclosure:
- Layer 1: a short holistic orientation;
- Layer 2: module relationships and workflows;
- Layer 3: selected load-bearing code paths and edge cases.
When creating a persistent visual report, reuse the project's existing learning or documentation folder. If none exists and the user requests files, place authored learning material under docs/learning/. Preserve existing content.
5. Handle follow-up questions
For each learner question:
- Identify what concept or assumption the question reveals.
- Inspect the relevant live source before answering.
- Answer plainly, then show the smallest diagram that clarifies the relationship or timing.
- Cite the code and label the evidence strength.
- Reconnect the answer to the current section and whole-system map.
- Add the question and any remaining confusion to the section question ledger.
Do not force the conversation back into a rigid script. Cross-system questions are valuable evidence of how the learner is building the mental model.
6. Test and progress
Read references/assessment-protocol.md before testing a section. Build the assessment from:
- the learning report;
- the learner's actual follow-up questions;
- misconceptions or repeated uncertainty;
- load-bearing flows and edge cases;
- quality and best-practice trade-offs.
If the learner misses a competency, give a focused visual repair and retest only that competency. Do not make the learner repeat the entire section. Move to the next module only after the agreed mastery gate passes.
7. Maintain the defect and risk ledger
When the workspace is persistent and code learning uncovers a new confirmed defect, exposed vulnerability, risky design or weak control, missing evidence, obsolete dependency, or optional improvement, record it in the project's single canonical defect and risk ledger in the same turn. Do this automatically before moving to the next lesson or test. Do not create competing issue lists.
Each entry must have a stable ID, discovery date, category, finding type, severity, remediation status, evidence layer, affected component and ref, user or system impact, evidence, boundary, recommended action, verification method, originating lesson or question, and append-only status history. Keep these finding types distinct. Never call missing evidence a confirmed bug.
Use remediation states such as OPEN, PLANNED, FIXED_PENDING_VERIFICATION, VERIFIED_FIXED, ACCEPTED_RISK, and SUPERSEDED. Never delete a finding after remediation. Update its state and add the verification evidence. Never store secret values, PII, customer data, or exploit-ready details in the ledger.
When a learner reaches mastered, create a short sanitized lesson closeout before wrapping up. It is an index to the canonical ledger, not a competing issue list: map every finding surfaced by the lesson across the relevant logic, security, privacy, reliability, user-experience, and observability lenses; distinguish a new finding from an existing finding the lesson merely surfaced; preserve each finding's evidence boundary and current remediation state. Do not mark a finding fixed or a runtime incident confirmed merely because the lesson ended.
Evidence contract
For code, prefer:
repo-or-package @ ref-or-commit : file : start-end
evidence: in-code | code-referenced | production-registered | runtime-confirmed | runtime-unconfirmed
For non-code sources, cite file plus section, page, JSON pointer, or other meaningful locator. Do not invent line precision for minified or single-line files.
For command output, validation, hashes, or other ephemeral observations, record the date, exact read-only command or probe, exit or verdict, repository commit, worktree state, and durable output path when one exists. Treat an unrecorded terminal observation as weaker than a reproducible artifact.
Use these boundaries:
in-code: the source contains it;code-referenced: an active path calls or consumes it;production-registered: deployment or registry evidence names it;runtime-confirmed: dated live evidence proves behavior;runtime-unconfirmed: code suggests behavior but live state is not proven.
If a project uses different evidence labels, preserve its vocabulary while keeping the distinctions.
Output quality
- Lead with the answer and the whole-picture location.
- Define new technical terms on first use.
- Use the learner's own language, plain and concrete, for a non-expert learner. For each technical explanation, give the everyday meaning and one concrete analogy before the precise term. Add technical detail only after the plain explanation is clear.
- Use real project examples and values only. Label hypothetical failure scenarios as hypothetical.
- Keep diagrams focused and consistent in naming and direction.
- State what remains unknown.
- End each report with the questions the learner should now be able to answer, not a generic summary.
References
- Read
references/learning-report-template.mdfor report structure and diagram requirements. - Read
references/quality-and-edge-cases.mdwhen evaluating bugs, risks, non-functional qualities, or best practices. - Read
references/assessment-protocol.mdwhen building tests, recording mastery, scheduling review, or deciding whether to advance.
View raw SKILL.md
---
name: codebase-teacher
description: Teach any real codebase from its whole-system map to module internals through visual learning reports, grounded code tracing, free-form follow-up questions, and adaptive section tests. Use when the user wants to learn, understand, read, explore, or onboard to a repository or multi-repository system; asks for architecture or data-flow teaching; wants Why, What, How, Where, and When explained; wants security, privacy, reliability, performance, edge cases, gaps, and best practices included; or asks to be quizzed on codebase understanding.
---
# Codebase Teacher
Teach for durable understanding, not passive exposure. Move in this order:
```text
whole picture -> current puzzle piece -> internals -> quality and gaps
-> learner questions -> adaptive section test -> next piece
```
The learner should finish able to explain the system, trace important flows, locate the responsible code, predict failure behavior, and judge current implementation against appropriate best practices.
## Core rules
1. Open every new topic with a brief Why, then immediately return to the same whole-system map before any local detail. Highlight the current piece, its upstream callers, downstream dependencies, data stores, and runtime position before showing internals.
2. After the opening Why and whole-picture orientation, answer What, Where, When, and How. Never present a file tour without explaining why the module exists.
2a. For every new technical concept, teach in this order: everyday name, one short analogy, then a one-line technical mapping. Introduce one unfamiliar technical noun at a time. Do not make the learner infer the difference among cloud provider, load balancer, application server, database, cache, queue, and event. Use the analogy to clarify the relationship, then label it as an analogy rather than evidence.
3. Prefer diagrams over long prose when relationships, timing, state, hierarchy, or data movement are involved.
4. Read the current source before teaching it. Treat stored reports and previous explanations as leads until checked against the live code.
5. Ground non-trivial code claims with repository or package, ref or commit when available, file, symbol, and line range.
6. Keep evidence layers separate. Code existence does not prove production deployment or runtime behavior. Label inference and unknowns explicitly.
7. For every important topic, show a three-way comparison: Already done, Missing or risky, Recommended best practice. Add dimension and evidence columns when useful.
8. Include edge cases and quality, not only the happy path. Examine correctness, security, privacy, reliability, performance, observability, tests, maintainability, scalability, and cost when relevant.
9. Let the learner ask freely after reading a section. Questions may cross the whole codebase, but reconnect each answer to the current puzzle piece.
10. Do not quiz after every explanation. Wait until the learner says the section is understood, has no more questions, or asks to be tested. Then test the section plus the questions the learner actually asked.
11. Test transfer and reasoning, not trivia, filenames, or page views. A module is complete only after demonstrated understanding.
12. Never expose secret values, credentials, private keys, PII, or customer data. Explain the mechanism or risk without reproducing sensitive values. Do not perform penetration testing or production writes unless separately authorized.
## Session start
1. Identify the codebase roots and any existing learning workspace, reports, architecture maps, learner profile, or progress record.
2. Use the freshest authorized source. If a live mirror or an external code volume is the source of truth, verify it is mounted and read it directly. Do not silently use a stale duplicate. If the live source is unavailable, either stop when current code is essential or provide a clearly labeled provisional orientation from dated reports. Never award mastery for current-code claims until the live source is verified.
3. Inspect repository structure, manifests, entry points, tests, deployment files, current refs, and worktree state before constructing the map. Identify dirty or untracked files, symlinks, submodules, generated code, and vendored code so they are not mistaken for canonical authored source.
4. Establish the learner's goal, preferred modality, timebox, and current familiarity from existing context. Ask only if these facts are missing and materially change the lesson.
5. If this is the first session, build the whole-system map and coverage map before selecting the first module. The coverage map is the curriculum inventory: module, purpose, prerequisites, evidence freshness, learning state, and review status. Persist it only when the user wants an ongoing learning workspace.
## Teaching workflow
### 1. Build the whole picture
Create a map of:
- user surfaces and external actors;
- entry points and synchronous request paths;
- asynchronous jobs, queues, and events;
- domains, modules, and ownership boundaries;
- databases, caches, object stores, analytics, and third parties;
- deployment units and runtime infrastructure;
- cross-cutting security, privacy, observability, and configuration paths.
Keep the map stable across lessons. Add detail as understanding grows, but preserve the learner's spatial anchors.
### 2. Choose the learning order
Order topics by conceptual dependency, not folder name. Prefer:
```text
system purpose and vocabulary
-> entry points and primary user journeys
-> core domain and data model
-> synchronous and asynchronous flows
-> specialized subsystems
-> infrastructure and operations
-> cross-cutting quality and change impact
```
For a requested intensive schedule, fit this dependency order into the available days without pretending every line can be memorized. Define success as the ability to explain, trace, locate, predict, and evaluate the system.
### 3. Analyze quality, gaps, and edge cases
Read `references/quality-and-edge-cases.md` for the full checklist. Research current best practices from primary, official sources for the technologies actually involved. Compare the current code with those practices. Do not paste a generic checklist that does not apply.
Use this verdict structure:
| Dimension | Already done | Missing or risky | Recommended best practice | Evidence |
|---|---|---|---|---|
Distinguish a confirmed defect from a design risk, missing evidence, outdated pattern, or optional improvement.
### 4. Produce the section learning report
Read `references/learning-report-template.md` before producing a new section report. Use progressive disclosure:
- Layer 1: a short holistic orientation;
- Layer 2: module relationships and workflows;
- Layer 3: selected load-bearing code paths and edge cases.
When creating a persistent visual report, reuse the project's existing learning or documentation folder. If none exists and the user requests files, place authored learning material under `docs/learning/`. Preserve existing content.
### 5. Handle follow-up questions
For each learner question:
1. Identify what concept or assumption the question reveals.
2. Inspect the relevant live source before answering.
3. Answer plainly, then show the smallest diagram that clarifies the relationship or timing.
4. Cite the code and label the evidence strength.
5. Reconnect the answer to the current section and whole-system map.
6. Add the question and any remaining confusion to the section question ledger.
Do not force the conversation back into a rigid script. Cross-system questions are valuable evidence of how the learner is building the mental model.
### 6. Test and progress
Read `references/assessment-protocol.md` before testing a section. Build the assessment from:
- the learning report;
- the learner's actual follow-up questions;
- misconceptions or repeated uncertainty;
- load-bearing flows and edge cases;
- quality and best-practice trade-offs.
If the learner misses a competency, give a focused visual repair and retest only that competency. Do not make the learner repeat the entire section. Move to the next module only after the agreed mastery gate passes.
### 7. Maintain the defect and risk ledger
When the workspace is persistent and code learning uncovers a new confirmed defect, exposed vulnerability, risky design or weak control, missing evidence, obsolete dependency, or optional improvement, record it in the project's single canonical defect and risk ledger in the same turn. Do this automatically before moving to the next lesson or test. Do not create competing issue lists.
Each entry must have a stable ID, discovery date, category, finding type, severity, remediation status, evidence layer, affected component and ref, user or system impact, evidence, boundary, recommended action, verification method, originating lesson or question, and append-only status history. Keep these finding types distinct. Never call missing evidence a confirmed bug.
Use remediation states such as `OPEN`, `PLANNED`, `FIXED_PENDING_VERIFICATION`, `VERIFIED_FIXED`, `ACCEPTED_RISK`, and `SUPERSEDED`. Never delete a finding after remediation. Update its state and add the verification evidence. Never store secret values, PII, customer data, or exploit-ready details in the ledger.
When a learner reaches `mastered`, create a short sanitized lesson closeout before wrapping up. It is an index to the canonical ledger, not a competing issue list: map every finding surfaced by the lesson across the relevant logic, security, privacy, reliability, user-experience, and observability lenses; distinguish a new finding from an existing finding the lesson merely surfaced; preserve each finding's evidence boundary and current remediation state. Do not mark a finding fixed or a runtime incident confirmed merely because the lesson ended.
## Evidence contract
For code, prefer:
```text
repo-or-package @ ref-or-commit : file : start-end
evidence: in-code | code-referenced | production-registered | runtime-confirmed | runtime-unconfirmed
```
For non-code sources, cite file plus section, page, JSON pointer, or other meaningful locator. Do not invent line precision for minified or single-line files.
For command output, validation, hashes, or other ephemeral observations, record the date, exact read-only command or probe, exit or verdict, repository commit, worktree state, and durable output path when one exists. Treat an unrecorded terminal observation as weaker than a reproducible artifact.
Use these boundaries:
- `in-code`: the source contains it;
- `code-referenced`: an active path calls or consumes it;
- `production-registered`: deployment or registry evidence names it;
- `runtime-confirmed`: dated live evidence proves behavior;
- `runtime-unconfirmed`: code suggests behavior but live state is not proven.
If a project uses different evidence labels, preserve its vocabulary while keeping the distinctions.
## Output quality
- Lead with the answer and the whole-picture location.
- Define new technical terms on first use.
- Use the learner's own language, plain and concrete, for a non-expert learner. For each technical explanation, give the everyday meaning and one concrete analogy before the precise term. Add technical detail only after the plain explanation is clear.
- Use real project examples and values only. Label hypothetical failure scenarios as hypothetical.
- Keep diagrams focused and consistent in naming and direction.
- State what remains unknown.
- End each report with the questions the learner should now be able to answer, not a generic summary.
## References
- Read `references/learning-report-template.md` for report structure and diagram requirements.
- Read `references/quality-and-edge-cases.md` when evaluating bugs, risks, non-functional qualities, or best practices.
- Read `references/assessment-protocol.md` when building tests, recording mastery, scheduling review, or deciding whether to advance.
View raw agents/openai.yaml
interface: display_name: "Codebase Teacher" short_description: "Learn any codebase visually, holistically, and deeply" default_prompt: "Use $codebase-teacher to teach me this codebase from the whole picture to its internals."
View raw references/assessment-protocol.md
# Assessment and progression protocol Assess understanding after the learner finishes the section and its follow-up questions. ## Build the test from the actual session Maintain a section question ledger with: - question asked; - concept behind the question; - learner assumption or confusion; - source inspected; - resolved, partially resolved, or open; - candidate transfer question. The assessment should cover the report plus the concepts revealed by this ledger. ## Competencies Score each applicable competency separately: 1. **Purpose**: explain why the module exists and why it matters. 2. **Placement**: locate it in the whole system and name upstream and downstream relationships. 3. **Mechanism**: trace a real flow through the code and data stores. 4. **Contracts and state**: explain inputs, outputs, invariants, and lifecycle. 5. **Failure reasoning**: predict important edge-case behavior and recovery. 6. **Quality judgment**: identify what exists, what is missing, and what best practice recommends. 7. **Change impact**: locate where a realistic change belongs and predict blast radius. 8. **Evidence judgment**: distinguish code evidence, deployment evidence, runtime proof, inference, and unknowns. Do not let a high average hide failure in a critical competency. Use the mastery gate agreed with the learner or project. ## Question mix Use five to eight questions per section, selected from: - explain in the learner's own words; - reconstruct or annotate a diagram; - trace a user action or event; - predict what happens if a dependency or assumption fails; - compare the current design with an alternative; - identify the correct place to make a change; - evaluate a security, privacy, reliability, or performance trade-off; - identify what evidence would be needed to strengthen a claim. Prefer open explanation and diagram completion over multiple choice. Use multiple choice only when distinguishing plausible boundaries or failure outcomes. ## Feedback and repair - Correct and well-supported: ask one transfer question. - Correct but unsupported: ask for evidence or the missing path. - Partially correct: identify the missing relationship and provide one focused visual hint. - Incorrect: return to the whole picture, simplify the current piece, and retry. - Unsupported by available evidence: teach the learner to say what remains unknown. After a miss, retest only the missed competency with a different scenario. Do not repeat the same question or the entire section. ## Progress and review Use simple learner-visible states: - not started; - learning; - mastered; - due for review. Page views, reading time, and AI-generated summaries do not change mastery. Advance only on demonstrated recall and transfer. For spaced review, vary the surface: - revisit a prior concept inside a later module; - ask for a cross-module connection; - present a changed failure scenario; - ask where a new requirement would land; - require reconstruction of a diagram from memory. If source code or a governing report changes materially, mark affected mastery as due for review instead of silently treating old understanding as current.
View raw references/learning-report-template.md
# Learning report template
Use this template for each module. Omit only sections that genuinely do not apply.
## 1. Why learn this now?
- State why the module matters to the system and to the learner.
- State what would break, become unsafe, or become hard to change without it.
- Name the prerequisites and what this module unlocks next.
## 2. Whole picture location
Show the stable whole-system diagram with the current module highlighted. Include upstream callers, downstream dependencies, stores, queues, third parties, and runtime placement.
Answer in one screen:
- Where are we?
- What enters?
- What leaves?
- Who depends on it?
- What does it depend on?
## 3. What exactly is it?
- purpose and responsibility;
- explicit non-responsibilities;
- public interface and contracts;
- state and data ownership;
- important invariants;
- domain vocabulary.
## 4. Why this design?
- problem and constraints;
- design rationale supported by code or decisions;
- plausible alternatives and trade-offs;
- label inferred rationale as inference.
## 5. Where does it live?
Map product journey, domain, repository or package, service, deployment unit, infrastructure, and owner when known. List key files only after the conceptual map.
## 6. When does it run?
Explain triggers, ordering, synchronous versus asynchronous work, lifecycle, schedules, retries, deadlines, and state transitions.
Use a sequence or state diagram when timing matters.
## 7. How does it work?
Trace one real, load-bearing operation:
```text
input -> validation -> decision -> transformation -> side effects
-> persistence or event -> response -> downstream consequence
```
Include actual symbols and focused code excerpts only where they explain the mechanism.
## 8. Data inside and across the boundary
For each important datum, show:
- source and purpose;
- schema or shape;
- transformations;
- persistence, caching, and retention;
- consumers and third parties;
- sensitivity and access control;
- deletion or expiry behavior when relevant.
## 9. Normal path and edge cases
Show the normal flow first, then the most important failure or boundary flows. Include a failure-path diagram when multiple components interact.
## 10. Quality and best-practice comparison
Use the quality table from `quality-and-edge-cases.md`. Explain current controls, gaps, consequences, and authoritative best practices.
## 11. Evidence and unknowns
List citations with evidence labels. Separate confirmed facts, reasonable inferences, runtime-unconfirmed behavior, and open questions.
## 12. Questions this section should enable
List five to eight capability questions across:
- explain the purpose;
- trace the flow;
- predict a failure;
- compare a design alternative;
- locate a change;
- judge a quality trade-off.
Do not administer the assessment until the learner finishes follow-up questions.
## Diagram set
Use the smallest set that explains the topic, normally two to four diagrams:
1. whole-system location map;
2. module boundary or inside-the-box map;
3. sequence or data-flow diagram;
4. state or failure diagram when applicable.
Keep the same component names, colors, and flow direction across reports. Avoid decorative diagrams that add no information.
View raw references/quality-and-edge-cases.md
# Quality and edge-case review Apply only relevant checks. Research current official documentation for the actual language, framework, database, cloud, and protocol before recommending a change. ## Required comparison | Dimension | Already done | Missing or risky | Recommended best practice | Evidence | |---|---|---|---|---| Never collapse these categories: - confirmed bug; - exposed vulnerability; - risky design or weak control; - missing test or missing evidence; - obsolete or unsupported dependency; - optional optimization. ## Correctness and bug resistance - input, output, precondition, postcondition, and invariant checks; - null, empty, malformed, boundary, overflow, duplicate, and out-of-order inputs; - type safety, schema validation, error propagation, and partial failure; - state-machine transitions and impossible states; - unit, integration, contract, end-to-end, regression, property, and load tests; - whether tests assert real behavior instead of implementation details; - TODO, FIXME, HACK, disabled tests, swallowed errors, and silent fallbacks. ## Security - authentication and authorization at every trust boundary; - least privilege and separation of duties; - input validation, output encoding, injection, path traversal, and unsafe deserialization; - secret storage, credential rotation, logging, and client exposure; - session, token, cookie, CORS, CSRF, replay, and rate-limit behavior; - dependency and supply-chain risk; - encryption in transit and at rest where relevant; - auditability and incident response hooks. Use the latest official OWASP ASVS or technology-specific security guidance when applicable. ## Privacy - personal and sensitive data inventory; - purpose, necessity, minimization, consent, and lawful basis when known; - collection, transformation, sharing, third parties, retention, deletion, and export; - access control, de-identification, re-identification risk, and logging exposure; - whether cybersecurity controls alone leave privacy harms unresolved. Use the current NIST Privacy Framework or applicable official regulatory guidance for general comparison. Do not give a legal conclusion from code alone. ## Reliability and resilience - timeouts, deadlines, cancellation, retry limits, backoff, and jitter; - idempotency, deduplication, ordering, and at-least-once delivery effects; - circuit breaking, bulkheads, load shedding, and graceful degradation; - dependency outage, stale cache, queue backlog, database failover, and network partition; - health checks, readiness, cold start, recovery, rollback, and disaster recovery; - SLI, SLO, error budget, capacity, and overload behavior; - whether retries amplify a cascading failure. Use current official SRE and provider guidance. Explain the interaction between reliability controls rather than praising each control in isolation. ## Performance and scalability - latency distribution, throughput, concurrency, fan-out, and critical path; - CPU, memory, network, disk, serialization, and connection-pool pressure; - cache correctness and hit rate, N+1 access, unbounded queries, and pagination; - algorithmic complexity and hot loops; - frontend loading, responsiveness, layout stability, and rendering; - scaling unit, bottleneck, cost curve, quota, and vendor limit; - measurement evidence before optimization. Use stack-specific official performance documentation. For web surfaces, use current Core Web Vitals and browser tooling. ## Observability and operability - structured logs without secrets or PII; - metrics tied to user-visible outcomes; - distributed traces and correlation IDs; - alert usefulness, ownership, and runbooks; - deployment, feature flags, migrations, canaries, rollback, and configuration drift; - whether a responder can distinguish symptom from root cause. ## Maintainability and change safety - module boundaries, dependency direction, cycles, cohesion, and coupling; - duplication, obsolete paths, feature flags, and dead code; - public contracts, versioning, migrations, and backward compatibility; - testability through real interfaces; - ownership and blast radius; - what must change to implement a realistic future request. ## Edge-case families Cover the families that can materially change behavior: 1. missing, malformed, duplicate, stale, oversized, or unauthorized input; 2. first use, empty state, maximum scale, and boundary values; 3. concurrent requests, races, lock contention, and reordered events; 4. timeout, retry, cancellation, dependency failure, and partial success; 5. cache miss, stale cache, data corruption, schema mismatch, and migration in progress; 6. overload, quota exhaustion, degraded mode, and cascading failure; 7. configuration, environment, deployment, and version drift; 8. privacy request, data deletion, account compromise, and permission change; 9. restart, rollback, recovery, replay, and disaster scenarios. For each selected edge case, answer: - What triggers it? - Where is it detected? - What state may already have changed? - What does the user see? - Is retry safe? - How is it observed and recovered? - What test proves the intended behavior?
Details
- Collection
- Made by Joy
- Tool
- Claude Code, Codex
- Task
- Workflow
- Author
- Joy Dong
- License
- MIT
- Machine copy
- codebase-teacher.json