Implemented Closed-Loop Audit
Use this skill to audit whether implemented code already satisfies the sixteen-character principle:
就源输入、多次应用、环环相扣、相互稽核
This is the second step in a three-skill workflow:
legacy-system-archaeology: factual archaeology of implemented code only
implemented-closed-loop-audit: audit implemented code against the sixteen-character principle
closed-loop-requirement-drift: evaluate a specific new requirement against the implemented audit baseline
Do not use this skill for PRDs, proposed screens, desired workflows, or future acceptance criteria. If no archaeology baseline exists, first run legacy-system-archaeology or ask for its output.
Evidence Boundary
Allowed inputs:
legacy-system-archaeology report, especially Evidence Sources, Data Logic Map, State and Dependency Map, Operational Ontology, Identity, Authorization, Technical Debt, and Unknowns
- implemented source code, migrations, tests, runtime snapshots, logs, scripts, and checked-in configuration used to verify disputed baseline facts
Forbidden inputs as implementation evidence:
- PRDs, roadmap items, backlog wishes, target-state diagrams, future requirements, stakeholder wishes
- a new requirement file; use
closed-loop-requirement-drift for that
Use only these tags:
Observed: directly supported by implemented artifacts
Inferred: likely from evidence but not directly proven
Unknown: not proven or contradictory
Required Outputs
Always produce:
Reader Summary
Imported Archaeology Baseline
Source Fact Ledger
Four-Principle Scorecard
Implemented Loop Trace
Duplicate Entry and Drift Audit
Cross-Check and Reconciliation Audit
Identity / Permission / Approval Continuity
Closed-Loop Debt Ledger
Unknowns That Block a Strong Audit Conclusion
Skill Compliance Checklist
Artifact Delivery
For full audits, write the complete output to a Markdown file in the target project's docs/report area. Do not paste the full audit into chat unless the user explicitly asks for inline output.
The audit file must start with a localized Reader Summary before detailed audit tables. Use the user's current conversation language unless the user explicitly requests another language. Do not default to English just because the imported baseline, code, or template headings are English.
The final chat response must use the same language as the user and include only:
- the audit file link
- a one-sentence closed-loop audit conclusion
- 3 to 5 reader-facing bullets covering the strongest compliant loop, the most broken or fragile loop, the highest-impact duplicate-entry or reconciliation risk, and the most important unknowns
- verification performed
- remaining blockers
Do not make the final response a count of sections, rows, or commands. Counts may appear only as supporting verification after the practical conclusion is clear.
Reader Summary Standard
For full audits, put Reader Summary at the top of the report unless scope/evidence metadata must appear first.
The summary must be understandable without reading the detailed ledgers. Include:
One-sentence conclusion: whether the implemented system is compliant, partial, broken, or still blocked by evidence
Strongest closed loop: the best implemented evidence of 就源输入、多次应用、环环相扣、相互稽核
Most important break: where duplicate truth, lost traceability, weak handoff, or missing reconciliation matters most
Audit debt: the top debt items that later requirement work must not hide
Unknowns: the few unresolved facts that could change the audit conclusion
Translate section labels into the user's language when helpful, but keep exact score values and evidence tags unchanged.
Audit Rules
- Keep current implementation separate from desired behavior. Do not say "should" unless it is in a debt row or unknown-resolution note.
- Do not create work-package plans, rollout sequences, repair plans, or acceptance gates. Those belong to planning or requirement-drift review.
- Do not score a loop as healthy unless source capture, downstream reuse, chain continuity, and independent check are all backed by artifacts.
- If an audit point depends on runtime data not inspected, mark it
Unknown; do not infer compliance from naming.
- If the archaeology baseline lacks required data logic artifacts, state
insufficient baseline and list what must be re-run in archaeology.
Principle Definitions
就源输入: the business fact is captured at its authoritative source or imported once with a stable source row key; uncontrolled manual recapture is absent or explicitly isolated.
多次应用: downstream calculations, reports, workflows, exports, and reviews reuse the same source fact/key rather than copying a new truth.
环环相扣: each step's governed output becomes the next step's governed input, with state transitions, retry/failure semantics, and traceable handoff.
相互稽核: at least two independent surfaces reconcile the same fact before acceptance, posting, locking, reporting, or external notification.
Use score values:
compliant: strong implemented evidence satisfies the principle
partial: some chain exists but evidence, automation, or reconciliation is incomplete
broken: implemented behavior allows uncontrolled duplicate truth, lost traceability, skipped gates, or unverifiable output
Unknown: evidence is missing
Workflow
1. Import the archaeology baseline
Extract:
- canonical business facts and source row keys
- source-entry modules and mutation surfaces
- downstream reuse surfaces
- manual correction or duplicate-entry surfaces
- report/export/workflow/notification outputs
- identity anchors and movement semantics
- permission, approval, data-scope, and runtime-task layers
- unknowns from the archaeology report
2. Build source fact ledger
For each important fact, capture:
- first entry/import surface
- canonical store
- stable source key
- allowed mutation surfaces
- copied/derived stores
- reports/exports/workflows that reuse it
- independent check surfaces
- evidence tag
3. Score the four principles
Score each principle per fact or loop. Do not average away a broken core fact. When one business fact has mixed behavior, split rows by flow.
4. Trace implemented loops
Use Mermaid with typed edges. Allowed labels:
source-input
reuse
derive
mutate
approve
export
reconcile
lock
notify
manual-risk
Unknown
Inferred <type>
Every edge must be labeled. Omit speculative edges.
5. Audit duplicate entry and drift
Classify current implemented drift:
data-drift
semantic-drift
identity-drift
permission-drift
approval-drift
report-drift
workflow-drift
ops-drift
Each row must include current implemented evidence, likely symptom, current guard if any, and audit status.
6. Audit cross-checks
For each report, export, workflow state, external notification, or locked/accounting state, identify what independent source can reconcile it. If none is implemented, mark the audit result broken or Unknown.
Output Template
Reader Summary
- One-sentence conclusion:
- Strongest closed loop:
- Most important break:
- Audit debt:
- Unknowns:
Imported Archaeology Baseline
| Baseline item |
Imported fact |
Evidence |
Tag |
Source Fact Ledger
| Business fact |
Source entry |
Canonical store |
Stable source key |
Mutations |
Reused by |
Cross-check surface |
Tag |
Four-Principle Scorecard
| Fact / loop |
就源输入 |
多次应用 |
环环相扣 |
相互稽核 |
Overall |
Evidence |
Implemented Loop Trace
flowchart LR
Source["Source fact"] -->|source-input| Canonical["Canonical store"]
Canonical -->|reuse| Downstream["Downstream reuse"]
Downstream -->|reconcile| Check["Independent check"]
Duplicate Entry and Drift Audit
| Drift type |
Fact / loop |
Current implemented evidence |
Symptom |
Current guard |
Audit status |
Tag |
Cross-Check and Reconciliation Audit
| Output / state |
Source fact reconciled |
Independent check |
Automated or manual |
Result |
Evidence |
Identity / Permission / Approval Continuity
| Object / flow |
Stable identity |
Permission/data scope follows? |
Approval/history follows? |
Continuity result |
Evidence |
Closed-Loop Debt Ledger
| Severity |
Debt |
Principle affected |
Implemented evidence |
Why it matters |
Unknowns That Block a Strong Audit Conclusion
| Unknown |
Blocks which principle |
How to verify |
Skill Compliance Checklist
| Requirement |
Status |
Notes |
| Localized Reader Summary present and reflected in final chat response |
|
|
| Archaeology baseline imported |
|
|
| No PRD/future requirement treated as implementation |
|
|
| Source fact ledger present |
|
|
| Four principles scored with allowed score values |
|
|
| Mermaid loop trace has typed edges |
|
|
| Drift audit covers applicable drift types |
|
|
| Cross-check/reconciliation audit present |
|
|
| Identity/permission/approval continuity audited where applicable |
|
|
| Unknowns separated from debt |
|
|
1---2name: implemented-closed-loop-audit3description: Use after legacy-system-archaeology has produced a pure implemented-system baseline, when auditing already implemented code and runtime evidence for compliance with "就源输入、多次应用、环环相扣、相互稽核" without considering new requirements, PRDs, roadmaps, or future designs.4---56# Implemented Closed-Loop Audit78Use this skill to audit whether implemented code already satisfies the sixteen-character principle:910`就源输入、多次应用、环环相扣、相互稽核`1112This is the second step in a three-skill workflow:13141. `legacy-system-archaeology`: factual archaeology of implemented code only152. `implemented-closed-loop-audit`: audit implemented code against the sixteen-character principle163. `closed-loop-requirement-drift`: evaluate a specific new requirement against the implemented audit baseline1718Do not use this skill for PRDs, proposed screens, desired workflows, or future acceptance criteria. If no archaeology baseline exists, first run `legacy-system-archaeology` or ask for its output.1920## Evidence Boundary2122Allowed inputs:2324- `legacy-system-archaeology` report, especially Evidence Sources, Data Logic Map, State and Dependency Map, Operational Ontology, Identity, Authorization, Technical Debt, and Unknowns25- implemented source code, migrations, tests, runtime snapshots, logs, scripts, and checked-in configuration used to verify disputed baseline facts2627Forbidden inputs as implementation evidence:2829- PRDs, roadmap items, backlog wishes, target-state diagrams, future requirements, stakeholder wishes30- a new requirement file; use `closed-loop-requirement-drift` for that3132Use only these tags:3334- `Observed`: directly supported by implemented artifacts35- `Inferred`: likely from evidence but not directly proven36- `Unknown`: not proven or contradictory3738## Required Outputs3940Always produce:41420. `Reader Summary`431. `Imported Archaeology Baseline`442. `Source Fact Ledger`453. `Four-Principle Scorecard`464. `Implemented Loop Trace`475. `Duplicate Entry and Drift Audit`486. `Cross-Check and Reconciliation Audit`497. `Identity / Permission / Approval Continuity`508. `Closed-Loop Debt Ledger`519. `Unknowns That Block a Strong Audit Conclusion`5210. `Skill Compliance Checklist`5354## Artifact Delivery5556For full audits, write the complete output to a Markdown file in the target project's docs/report area. Do not paste the full audit into chat unless the user explicitly asks for inline output.5758The audit file must start with a localized `Reader Summary` before detailed audit tables. Use the user's current conversation language unless the user explicitly requests another language. Do not default to English just because the imported baseline, code, or template headings are English.5960The final chat response must use the same language as the user and include only:6162- the audit file link63- a one-sentence closed-loop audit conclusion64- 3 to 5 reader-facing bullets covering the strongest compliant loop, the most broken or fragile loop, the highest-impact duplicate-entry or reconciliation risk, and the most important unknowns65- verification performed66- remaining blockers6768Do not make the final response a count of sections, rows, or commands. Counts may appear only as supporting verification after the practical conclusion is clear.6970## Reader Summary Standard7172For full audits, put `Reader Summary` at the top of the report unless scope/evidence metadata must appear first.7374The summary must be understandable without reading the detailed ledgers. Include:7576- `One-sentence conclusion`: whether the implemented system is compliant, partial, broken, or still blocked by evidence77- `Strongest closed loop`: the best implemented evidence of `就源输入、多次应用、环环相扣、相互稽核`78- `Most important break`: where duplicate truth, lost traceability, weak handoff, or missing reconciliation matters most79- `Audit debt`: the top debt items that later requirement work must not hide80- `Unknowns`: the few unresolved facts that could change the audit conclusion8182Translate section labels into the user's language when helpful, but keep exact score values and evidence tags unchanged.8384## Audit Rules8586- Keep current implementation separate from desired behavior. Do not say "should" unless it is in a debt row or unknown-resolution note.87- Do not create work-package plans, rollout sequences, repair plans, or acceptance gates. Those belong to planning or requirement-drift review.88- Do not score a loop as healthy unless source capture, downstream reuse, chain continuity, and independent check are all backed by artifacts.89- If an audit point depends on runtime data not inspected, mark it `Unknown`; do not infer compliance from naming.90- If the archaeology baseline lacks required data logic artifacts, state `insufficient baseline` and list what must be re-run in archaeology.9192## Principle Definitions9394- `就源输入`: the business fact is captured at its authoritative source or imported once with a stable source row key; uncontrolled manual recapture is absent or explicitly isolated.95- `多次应用`: downstream calculations, reports, workflows, exports, and reviews reuse the same source fact/key rather than copying a new truth.96- `环环相扣`: each step's governed output becomes the next step's governed input, with state transitions, retry/failure semantics, and traceable handoff.97- `相互稽核`: at least two independent surfaces reconcile the same fact before acceptance, posting, locking, reporting, or external notification.9899Use score values:100101- `compliant`: strong implemented evidence satisfies the principle102- `partial`: some chain exists but evidence, automation, or reconciliation is incomplete103- `broken`: implemented behavior allows uncontrolled duplicate truth, lost traceability, skipped gates, or unverifiable output104- `Unknown`: evidence is missing105106## Workflow107108### 1. Import the archaeology baseline109110Extract:111112- canonical business facts and source row keys113- source-entry modules and mutation surfaces114- downstream reuse surfaces115- manual correction or duplicate-entry surfaces116- report/export/workflow/notification outputs117- identity anchors and movement semantics118- permission, approval, data-scope, and runtime-task layers119- unknowns from the archaeology report120121### 2. Build source fact ledger122123For each important fact, capture:124125- first entry/import surface126- canonical store127- stable source key128- allowed mutation surfaces129- copied/derived stores130- reports/exports/workflows that reuse it131- independent check surfaces132- evidence tag133134### 3. Score the four principles135136Score each principle per fact or loop. Do not average away a broken core fact. When one business fact has mixed behavior, split rows by flow.137138### 4. Trace implemented loops139140Use Mermaid with typed edges. Allowed labels:141142- `source-input`143- `reuse`144- `derive`145- `mutate`146- `approve`147- `export`148- `reconcile`149- `lock`150- `notify`151- `manual-risk`152- `Unknown`153- `Inferred <type>`154155Every edge must be labeled. Omit speculative edges.156157### 5. Audit duplicate entry and drift158159Classify current implemented drift:160161- `data-drift`162- `semantic-drift`163- `identity-drift`164- `permission-drift`165- `approval-drift`166- `report-drift`167- `workflow-drift`168- `ops-drift`169170Each row must include current implemented evidence, likely symptom, current guard if any, and audit status.171172### 6. Audit cross-checks173174For each report, export, workflow state, external notification, or locked/accounting state, identify what independent source can reconcile it. If none is implemented, mark the audit result `broken` or `Unknown`.175176## Output Template177178### Reader Summary179180- One-sentence conclusion:181- Strongest closed loop:182- Most important break:183- Audit debt:184- Unknowns:185186### Imported Archaeology Baseline187188| Baseline item | Imported fact | Evidence | Tag |189|---|---|---|---|190191### Source Fact Ledger192193| Business fact | Source entry | Canonical store | Stable source key | Mutations | Reused by | Cross-check surface | Tag |194|---|---|---|---|---|---|---|---|195196### Four-Principle Scorecard197198| Fact / loop | 就源输入 | 多次应用 | 环环相扣 | 相互稽核 | Overall | Evidence |199|---|---|---|---|---|---|---|200201### Implemented Loop Trace202203```mermaid204flowchart LR205 Source["Source fact"] -->|source-input| Canonical["Canonical store"]206 Canonical -->|reuse| Downstream["Downstream reuse"]207 Downstream -->|reconcile| Check["Independent check"]208```209210### Duplicate Entry and Drift Audit211212| Drift type | Fact / loop | Current implemented evidence | Symptom | Current guard | Audit status | Tag |213|---|---|---|---|---|---|---|214215### Cross-Check and Reconciliation Audit216217| Output / state | Source fact reconciled | Independent check | Automated or manual | Result | Evidence |218|---|---|---|---|---|---|219220### Identity / Permission / Approval Continuity221222| Object / flow | Stable identity | Permission/data scope follows? | Approval/history follows? | Continuity result | Evidence |223|---|---|---|---|---|---|224225### Closed-Loop Debt Ledger226227| Severity | Debt | Principle affected | Implemented evidence | Why it matters |228|---|---|---|---|---|229230### Unknowns That Block a Strong Audit Conclusion231232| Unknown | Blocks which principle | How to verify |233|---|---|---|234235### Skill Compliance Checklist236237| Requirement | Status | Notes |238|---|---|---|239| Localized Reader Summary present and reflected in final chat response | | |240| Archaeology baseline imported | | |241| No PRD/future requirement treated as implementation | | |242| Source fact ledger present | | |243| Four principles scored with allowed score values | | |244| Mermaid loop trace has typed edges | | |245| Drift audit covers applicable drift types | | |246| Cross-check/reconciliation audit present | | |247| Identity/permission/approval continuity audited where applicable | | |248| Unknowns separated from debt | | |