Skip to content

Commit a1cb7ec

Browse files
committed
docs(skills): add contents lists to long references, restore rotation ordering
Anthropic's guidance: reference files over 100 lines should open with a table of contents, because Claude often previews a file with head and would otherwise never see the full scope. All 119 long reference files lacked one. scripts/add_reference_toc.py generates the list from each file's own H2 headings and inserts it below the title and When-to-read callout. It skips fenced code (# is a comment there), skips files that already have Contents, and is idempotent, so it can run again after new references are written. Also restores one durable idea lost when cli-audit-credential was removed in 7208d9b. That deletion was justified (machine-level scope, LLM reading real keys), and the file-permission and git-history checks were absorbed into cli-audit-code C9, but the create -> deploy -> verify -> revoke ordering was not. It is the part that prevents a rotation outage and does not depend on any provider console, so it now lives in the cli-forge-infra entropy checklist next to the rotation item that referenced a procedure.
1 parent 507513d commit a1cb7ec

120 files changed

Lines changed: 1661 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cli-audit-code/reference.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Clean Code Reference — Full Principles Catalog
22

3+
## Contents
4+
5+
- Sources
6+
- Principles Not in the wojteklu Gist
7+
- Rust-Specific Clean Code Idioms
8+
9+
---
10+
311
## Sources
412

513
This reference synthesizes principles from multiple authorities, not just Robert C. Martin.

cli-audit-code/references/categories.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44
55
---
66

7+
## Contents
8+
9+
- C1: NAMING & READABILITY (8%)
10+
- C2: FUNCTIONS & COGNITIVE COMPLEXITY (12%)
11+
- C3: MODULE DESIGN — DEEP VS SHALLOW (10%)
12+
- C4: DRY & CHANGE AMPLIFICATION (8%)
13+
- C5: ERROR HANDLING & ROBUSTNESS (10%)
14+
- C6: TYPE SAFETY & LANGUAGE IDIOMS (8%)
15+
- C7: COMMENTS & PUBLIC API DOCS (5%)
16+
- C8: TEST QUALITY (12%)
17+
- C9: SECURITY & INPUT VALIDATION (10%)
18+
- C10: IMMUTABILITY & STATE MANAGEMENT (7%)
19+
- C11: COGNITIVE LOAD & CONTROL FLOW (5%)
20+
- C12: DEPENDENCIES & ARCHITECTURE (5%)
21+
22+
---
23+
724
## C1: NAMING & READABILITY (8%)
825

926
**Source:** Robert C. Martin (Clean Code), Google Style Guides, Microsoft Rust Guidelines (M-CONCISE-NAMES)

cli-audit-code/references/scoring.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44
55
---
66

7+
## Contents
8+
9+
- CQI Formula
10+
- Scoring Guide
11+
- Category Weights
12+
- CQI Thresholds
13+
- Derived Metrics
14+
- Anti-Patterns (Named, from Fowler/Mantyla + extended taxonomy)
15+
- Comparative Benchmarks
16+
- Sources
17+
18+
---
19+
720
## CQI Formula
821

922
```

cli-audit-data/references/order-reservation-review.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Worked example — réservation de la dernière unité d'un produit
22

3+
## Contents
4+
5+
- 1. Verdict
6+
- 2. Décision de base de données
7+
- 3. Sources de vérité
8+
- 4. Invariants
9+
- 5. Conservation
10+
- 6. Machine à états
11+
- 7. Interleaving dangereux
12+
- 8. Frontière transactionnelle
13+
- 9. SQLx
14+
- 10. Migration
15+
- 11. Tests
16+
- 12. Homéostasie
17+
- 13. Pré-mortem
18+
- 14. Points non prouvés
19+
20+
---
21+
322
Cet exemple montre le niveau de raisonnement attendu. Il ne remplace pas l'analyse du projet réel.
423

524
## 1. Verdict

cli-audit-data/references/review-templates.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Data safety review templates / Canevas de travail
22

3+
## Contents
4+
5+
- A. Décision de conception
6+
- B. Matrice d'invariants
7+
- C. Interleaving
8+
- D. Machine à états
9+
- E. Compatibilité de migration
10+
- F. Pré-mortem
11+
- G. Revue de code
12+
- H. Homéostasie
13+
- I. Rapport final
14+
15+
---
16+
317
## A. Décision de conception
418

519
```markdown

cli-audit-doc/reference.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Documentation Audit Reference — Standards & Language Conventions
22

3+
## Contents
4+
5+
- Sources
6+
- Universal Rules (All Languages)
7+
- Language-Specific Conventions
8+
- Documentation Completeness Index (DCI)
9+
- Coverage Tiers
10+
- Confidence Protocol
11+
- Anti-Patterns Checklist
12+
13+
---
14+
315
## Sources
416

517
### Standards

cli-audit-doc/references/categories.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44
55
---
66

7+
## Contents
8+
9+
- C1: DIATAXIS COVERAGE (10%)
10+
- C2: COMPLETENESS (12%)
11+
- C3: FRESHNESS & ACCURACY (10%)
12+
- C4: READABILITY & PROSE QUALITY (10%)
13+
- C5: STRUCTURE & FINDABILITY (8%)
14+
- C6: STANDARD SECTIONS (8%)
15+
- C7: CODE EXAMPLES (10%)
16+
- C8: ACCESSIBILITY & INCLUSIVITY (6%)
17+
- C9: INLINE COMMENTS QUALITY (8%)
18+
- C10: CROSS-REFERENCES & LINKING (5%)
19+
- C11: TESTING & CI (8%)
20+
- C12: MAINTENANCE PROCESS (5%)
21+
22+
---
23+
724
## C1: DIATAXIS COVERAGE (10%)
825

926
**Source:** Daniele Procida (Diataxis framework)

cli-audit-doc/references/scoring.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44
55
---
66

7+
## Contents
8+
9+
- DQI Formula
10+
- Scoring Guide
11+
- Category Weights
12+
- DQI Thresholds
13+
- Derived Metrics
14+
- Anti-Patterns
15+
- Sources
16+
17+
---
18+
719
## DQI Formula
820

921
```

cli-audit-drift/references/contracts-template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
55
---
66

7+
## Contents
8+
9+
- File header
10+
- Contract block template
11+
- Common invariant templates
12+
- Contract sizing guide
13+
- Example: complete contract
14+
15+
---
16+
717
## File header
818

919
```markdown

cli-audit-drift/references/drift-detection-rules.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
55
---
66

7+
## Contents
8+
9+
- Detection workflow per function
10+
- Classification decision tree
11+
- Severity scoring
12+
- Common drift patterns by domain
13+
14+
---
15+
716
## Detection workflow per function
817

918
For each contracted function, execute these checks in order:

0 commit comments

Comments
 (0)