install
source · Clone the upstream repo
git clone https://github.com/ariffazil/arifOS
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ariffazil/arifOS "$T" && mkdir -p ~/.claude/skills && cp -r "$T/archive/WORKSPACE/skills/apex-docs" ~/.claude/skills/ariffazil-arifos-apex-docs && rm -rf "$T"
manifest:
archive/WORKSPACE/skills/apex-docs/SKILL.mdsource content
apex-docs — APEX Documentation Forge
Version: 2026.03.11-APEX Authority: arifOS F1-F13 Trigger: "forge docs", "apex docs", "document this", "harden documentation"
What This Skill Does
APEX-style documentation hardening using constitutional governance. Not generic "write good docs" — but forged documentation that reduces entropy, preserves reversibility, and links evidence.
The 6-Phase APEX Flow
READ → RISK → REASON → FORGE → VERIFY → SEAL
Phase 0: READ (Ground Truth)
# Always start here read <target_file> git log --oneline <target_file> | head -5 ls -la <directory_context>
Output: Actual state. Not assumed. Not "probably".
Phase 1: RISK (CVSS for Docs)
| Tier | Indicator | Action |
|---|---|---|
| Critical | Auth, payment, deletion logic undocumented | Immediate 888_HOLD |
| High | Public API mismatch with code | Same-day fix |
| Medium | Internal helper outdated | Backlog |
| Low | Typo, formatting | Batch |
| Cosmetic | "Sounds better" rewrites | Skip (PROPA) |
Phase 2: REASON (F1-F4 Check)
F1 Reversibility:
- Can this be undone in 60 seconds?
- Git commit before edit
F2 Truth (τ ≥ 0.99):
- Every claim links to source
- Uncertainty stated explicitly (Ω₀)
F4 Clarity (ΔS ≤ 0):
- Does this reduce confusion?
- If file grows >20%, probably over-engineering
Phase 3: FORGE (Minimal Delta)
Rules:
- Edit, don't rewrite
- One purpose per commit
- No PROPA (polished performance)
- Raw > Perfect
Template for new sections:
## <Section Name> > Source: `<file>:<line-range>` > Last verified: `<YYYY-MM-DD>` > Ω₀: <0.03-0.05> (uncertainty coefficient) <Content> <!-- If incomplete --> **TODO:** <what's missing>
Phase 4: VERIFY
| Check | Command |
|---|---|
| Links work | `grep -oP '(.*?)' <file> |
| No orphans | |
| Grammar | (optional) |
| F4 Clarity | Read aloud: does it reduce confusion? |
Phase 5: SEAL
# Commit git add <file> git commit -m "<file>: <minimal description> - Why: <F2 evidence> - Risk: <CVSS tier> - Reversible: <F1 check>" # Log to memory echo "- <file> hardened (<CVSS tier>)" >> memory/$(date +%Y-%m-%d).md
Constitutional Constraints
F1: Reversibility
- All changes versioned
- Can revert to pre-edit state
- 60-second recovery path
F2: Truth
- Every claim → source link
- τ (truth coefficient) ≥ 0.99
- Unknown > Unsafe Certainty
F4: Clarity
- ΔS ≤ 0 (entropy reduces)
- Tables > Lists > Prose
- No PROPA
F7: Humility
- State Ω₀ (uncertainty)
- Mark TODOs explicitly
- "This section needs review"
F11: Command Auth
- Destructive (delete, rewrite) → propose
- Wait for F13 "do it"
F12: Injection Defense
- Sanitize external inputs before including
- No exec of extracted content
F13: Sovereignty
- Human veto absolute
- "Don't like it" = valid rejection
Drift Detection
Weekly scan:
# Check for orphaned docs for doc in *.md; do refs=$(grep -oP 'source:\s*\K[^\s]+' "$doc" | sort -u) for ref in $refs; do test -f "$ref" || echo "ORPHAN: $doc references missing $ref" done done
Monthly audit:
- Compare code exports to doc coverage
- Flag undocumented public functions
- Update last_verified dates
Example Workflow
User: "Harden AGENTS.md"
Agent:
- READ →
, check git historycat AGENTS.md - RISK → Public API access map → Critical tier
- REASON → F1: reversible (git) ✓, F2: needs evidence links ✓, F4: ΔS? needs audit
- FORGE → Add source links to §4, mark Ω₀ where uncertain
- VERIFY → Links work, no orphans, clarity check
- SEAL → Commit, log to memory/2026-03-11.md
Anti-Patterns (Never Do)
| Anti-Pattern | Why | Alternative |
|---|---|---|
| "Documentation sprint" | Bulk rewrite = irreversible | One file at a time |
| "Polish pass" | PROPA — no substance | Skip if content correct |
| "Perfect grammar" | Cosmetic, not clarity | Raw transmission OK |
| "v2, v3, final" | File explosion | Edit in place |
| AI writes, human skips review | Hallucination risk | Human must verify F2 |
Quick Reference
# Start any doc hardening apex-docs harden <file> # Check drift apex-docs drift-scan <directory> # Verify single file apex-docs verify <file>
Ditempa bukan diberi