agentleFS
peterbamuhigirepeterbamuhigire/chwezi-dev-engine/skills/security/dpia-generator/SKILL.md

dpia-generator

Skill31 starsChanged 19 days agoMITView on GitHub

Use when producing or reviewing a Data Protection Impact Assessment (DPIA) for a new feature or for Uganda DPPA-regulated, large-scale, sensitive, monitored, or high-risk personal-data processing.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the links and companion skills already referenced in this file when deeper context is needed.

    line 29
  2. Distinctive:

    Use this skill when:

    line 44
  3. Distinctive:

    Before invoking this skill, read:

    line 54
  4. Distinctive:

    Ask the consultant to identify: Which processing operation is being assessed?

    line 62
  5. Distinctive:

    Add system-specific risks based on the processing operation being assessed.

    line 149
  6. Distinctive:

    After controls: rate residual risk for each item.

    line 174
  7. Distinctive:

    If any processing operation carries residual high risk that cannot be mitigated internally:

    line 180
  8. Distinctive:

    Document the consultation outcome

    line 182
  9. Distinctive:

    Before marking this skill complete:

    line 207
  10. Distinctive:

    Default to read-only access to requirements, data flows, vendors, controls, and policies.

    line 220

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: DPIA Generator (Uganda DPPA 2019)

Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.

<!-- dual-compat-start -->

Use When

  • Generate Uganda DPPA 2019-compliant DPIA documents. Use when uganda-dppa-compliance flags [DPIA-REQUIRED] or when processing large-scale personal data.

Evidence Produced

CategoryArtifactFormatExample
Data safetyData Protection Impact AssessmentMarkdown doc covering lawful basis, data flows, risks, and mitigationsdocs/compliance/dpia-customer-onboarding.md
Data safetyPII / retention registerMarkdown doc mapping personal data fields to basis and retention windowdocs/compliance/pii-retention-register.md

References

  • Use the links and companion skills already referenced in this file when deeper context is needed.
<!-- dual-compat-end -->

Skill-specific references:

  • Data Protection and Privacy Act 2019 (No. 9 of 2019) — Section 23 (breach), Section 9 (special data)
  • Data Protection and Privacy Regulations 2021 — Regulation 12 (DPIA), Regulation 33 (breach notification)
  • domains/uganda/references/regulations.md
  • domains/uganda/references/dppa-pii-classification.md
  • uganda-dppa-compliance/SKILL.md — prerequisite skill

Purpose

Generate a Uganda Data Protection and Privacy Act 2019 — compliant Data Protection Impact Assessment (DPIA) document for a specific processing operation that has been flagged with [DPIA-REQUIRED]. Implements Regulation 12 of the Data Protection and Privacy Regulations 2021.

Use this skill when:

  • A Uganda DPPA compliance review (formerly the retired uganda-dppa-compliance skill, now an inactive alias of this one) has flagged [DPIA-REQUIRED: <reason>] for a processing operation
  • The consultant is preparing for Phase 3 go-live involving farmer personal data
  • Any new processing feature involves large-scale, systematic, or special personal data collection
  • A PDPO auditor requests a DPIA on file

Inputs Required

Before invoking this skill, read:

  • _context/vision.md — system scope
  • _context/features.md — the specific processing operation being assessed
  • _context/personas.md — data subjects affected
  • _context/gap-analysis.md — open privacy gaps
  • The specific [DPIA-REQUIRED] flag text and its context in the originating document
  • domains/uganda/references/dppa-pii-classification.md — PII classification matrix

Ask the consultant to identify: Which processing operation is being assessed? (e.g., "bulk collection of farmer NIN, GPS, photo, and mobile money number during cooperative registration")


DPIA Structure (Regulation 12)

Section 1 — Processing Operation Description

1.1 Operation name and purpose Name the specific processing operation. State its purpose. Cite the module and FR identifiers.

1.2 Data controller and DPO Name the data controller (organisation), designated DPO, and PDPO registration number.

1.3 Categories of data subjects Describe who is affected: number of individuals, demographics, vulnerability factors (e.g., rural smallholder farmers with limited digital literacy).

1.4 Data categories collected List every field. Classify each as S (special personal data), P (personal data), or N (non-personal). For S-tier fields, cite the Section 9 category.

FieldTierSection 9 CategoryVolume
Mobile money numberSFinancial information6,440+
NINPIdentification number6,440+
GPS farm coordinatesPLocation/identity6,440+
PhotographPIdentity data6,440+

1.5 Processing activities Describe what happens to the data: collection, storage, use, disclosure, retention, destruction.

1.6 Lawful basis For each data category, cite the applicable Section 7 lawful basis.

1.7 Data processors involved List any third parties processing data (MTN MoMo, Airtel, NIRA, etc.) and confirm written contracts exist per Section 21.

1.8 Cross-border transfer State whether data is processed or stored outside Uganda. If yes, document adequacy or consent.


Section 2 — Necessity and Proportionality Assessment

2.1 Necessity Is the data collection necessary for the stated purpose? Could the purpose be achieved with less data or less intrusive means?

2.2 Proportionality Is the scope of collection proportionate to the legitimate purpose?

2.3 Data minimisation Confirm that only the minimum necessary data is collected. Flag any field that is not strictly necessary.

2.4 Purpose limitation Confirm data will not be used for purposes incompatible with the original purpose (Section 17). State research/statistical exceptions if applicable (must not reveal identity).

2.5 Storage limitation State the retention period and destruction method at expiry.


Section 3 — Risk Assessment

Identify and rate each risk using the matrix below.

Risk Rating Matrix:

LikelihoodLow ImpactMedium ImpactHigh Impact
UnlikelyLowLowMedium
PossibleLowMediumHigh
LikelyMediumHighCritical

Risk categories to assess:

#RiskDescriptionLikelihoodImpactRating
R-1Unauthorised access to S-tier financial dataMobile money numbers accessed by unauthorised staff
R-2GPS data misuseFarm location data enables physical targeting of farmers
R-3NIN data breachMass NIN exposure creates identity fraud risk
R-4Consent not obtainedData collected without valid consent; PDPO enforcement risk
R-5Data shared with unauthorised third partiesFarmer data disclosed outside permitted recipients
R-6Breach not notified immediatelyPDPO notification delayed; criminal liability for DPO
R-7Data retained beyond retention periodHistorical data not destroyed; creates ongoing liability
R-8Children's data collected without guardian consentFarmers under 18 registered without parental consent
R-9Cross-border storageCloud backup transfers data outside Uganda without adequacy or consent
R-10Data subject rights not fulfilledRequests not responded to within 30 days

Add system-specific risks based on the processing operation being assessed.


Section 4 — Measures to Address Risks

For each risk rated Medium, High, or Critical, specify the control measure:

Risk #Control MeasureFR/NFR ReferenceOwnerStatus
R-1AES-256-GCM encryption + role-based access + access loggingNFR-DPPA-002Dev LeadPlanned
R-2GPS stored encrypted; access restricted to Procurement/FinanceNFR-FAR-001Dev LeadPlanned
R-3NIN encrypted + masked in display; NIRA validation only via APINFR-DPPA-002Dev LeadPlanned
R-4Consent capture FR at farmer registration; consent record persistedFR-FAR-xxxDev LeadPlanned
R-5API-layer RBAC; data processor contracts signedNFR-DPPA-005LegalPending
R-6Breach notification workflow; DPO dashboard alert; auto-generates PDPO notification formNFR-DPPA-005Dev LeadPlanned
R-7Retention schedule enforced; DPO expiry alert; destruction audit logNFR-DPPA-006Dev LeadPlanned
R-8Age verification step in registration; parent/guardian consent prompt for under-18FR-FAR-xxxDev LeadPlanned
R-9On-premise only; no cloud backup outside Uganda; server location documentedNFR-DPPA-010BIRDC ITPending
R-10Data subject rights log; 30-day DPO dashboard alertNFR-DPPA-004Dev LeadPlanned

Section 5 — Residual Risk Assessment

After controls: rate residual risk for each item. If any residual risk remains High or Critical, escalate to PDPO consultation (Regulation 12 — high residual risk requires PDPO prior consultation).


Section 6 — PDPO Consultation Determination

If any processing operation carries residual high risk that cannot be mitigated internally:

  • Consult the PDPO before commencing processing
  • Document the consultation outcome
  • Obtain PDPO guidance in writing

Section 7 — Sign-off

RoleNameDateSignature
Data Protection Officer
Consultant / System ArchitectPeter Bamuhigire
Client Authorising Officer

Output Format

Generate a .md file in projects/<ProjectName>/09-governance-compliance/dpia/DPIA_<OperationName>_<ProjectName>.md covering all 7 sections above.

Build to .docx using: bash scripts/build-doc.sh projects/<ProjectName>/09-governance-compliance/dpia DPIA_<OperationName>_<ProjectName>


Validation Checklist

Before marking this skill complete:

  • Every S-tier field has an explicit control measure
  • No residual risk is rated Critical without PDPO consultation recommendation
  • Retention period is specified for every data category
  • Children's data assessed
  • Cross-border transfer status confirmed
  • Sign-off table populated (roles at minimum; names/dates pending client)
  • [CONTEXT-GAP: GAP-004] retained if legal review not yet complete

Capability contract

Default to read-only access to requirements, data flows, vendors, controls, and policies. Network research is required only for current law or regulator guidance; implementation edits need separate authority.

Degraded mode

Fallback when data flows, retention, vendors, or controls are unknown: issue a draft marked incomplete and list the evidence required before approval.

Decision rules

Processing conditionDPIA decisionAction
Sensitive, systematic, large-scale, or high-impact processingrequiredComplete assessment before launch
Material uncertainty about harm or lawful basisrequired pending evidenceEscalate to privacy owner
Low-risk processing with documented controlsrecord rationaleMonitor for scope change

Domain anti-patterns

  • Inventing a lawful basis. Fix: obtain the controller's documented basis.
  • Listing controls that are only planned. Fix: distinguish implemented, planned, and absent.
  • Omitting processors or cross-border transfers. Fix: map every recipient and location.
  • Treating consent as the universal answer. Fix: assess the correct lawful basis.
  • Approving with unknown retention. Fix: block until retention and deletion are defined.

Inputs

ArtefactRequired?Purpose
Processing purpose, data inventory, data subjects, systems, recipients, retention, and jurisdictionsyesEstablish the actual processing operation and applicable risk context
Existing controls, contracts, and incident historyconditionalTest residual risk and avoid crediting controls that are only planned

Outputs

ArtefactConsumerAcceptance condition
DPIA with risk and action registerData protection officer and accountable ownerNecessity, proportionality, data flows, rights impacts, control evidence, residual risks, owners, and consultation triggers are documented

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.