Eliminates COMMON-LISP-USER::DEFSKILL and other package-related STYLE-WARNINGs during compilation. Files affected: - gateway-messaging, programming-repl, programming-standards, system-memory, system-archivist Remaining warnings are cross-skill references (vault functions) and minor same-file forward refs — category 2 per ROADMAP.
5.6 KiB
SKILL: Engineering Standards (org-skill-engineering-standards.org)
- Overview
- Implementation
Overview
The Engineering Standards Skill defines the REPL-first engineering lifecycle and enforces technical invariants, including the Commit-Before-Modify rule and Chaos-Driven Development.
Engineering Lifecycle (Two-Track)
The canonical workflow. Two tracks, not to be confused:
Track 1 — Org-First: Prose, Tests, Thinking (Phases 0/A)
This track stays in Org. No code is written yet.
Phase 0: Exploration & Documentation
- Read the relevant Org source files for context
- Explore the problem in the running REPL with
repl-inspectandrepl-eval - Document findings in Org prose
- If a bug: document investigation in Org before fixing (Org as thinking medium)
Phase A: Test-First Design
- Write the success criteria in Org prose — what the function does, arguments, return value, rationale
- Write the FiveAM test in a
#+begin_src lisp :tangle noblock - Tangle the test and evaluate in the REPL — confirm it fails (red)
- The failing test is the success criteria. Do not proceed to Track 2 until it exists and is red.
Track 2 — REPL-First: Implementation, Iteration, Reflection (Phases B/C/D/E)
Code is prototyped in the REPL, never written directly into Org first.
Phase B/C: REPL Implementation
- Write the function directly in the REPL using
repl-eval - Iterate: evaluate, inspect, fix, re-evaluate — the image accumulates state
- Run the test in the REPL — confirm green
- Explore edge cases with
repl-inspectand ad-hoc evaluations - Before writing any
defunin an Org block, verify it was prototyped and tested in the REPL first
Phase D: Chaos Verification
Run the appropriate chaos tier before reflecting code back to Org:
- Tier 1 (Deterministic): Full FiveAM test suite — required on every change
- Tier 2 (Probabilistic): Randomized fuzzing — required on every major release
- Tier 3 (Stress): Load and resource starvation — required during hardening sprints
Phase E: Reflect Back to Org
- Copy the working function into its own
#+begin_src lispblock in the Org file - Update the prose to match what the function actually does (arguments, return, rationale)
- Before closing Phase E, run
(utils-lisp-validate (uiop:read-file-string "path/to/file.lisp") :strict t)in the REPL — never external scripts or manual paren-counting - Verify the Org file tangles correctly
- Tangle, commit, update GTD
Syntax Error Protocol
If a LOADER ERROR or reader-error occurs:
- Run
(utils-lisp-validate (uiop:read-file-string "file.lisp") :strict t)in the REPL — never Python, never grep, never manual counting - Fix the error in the Org file (since the code was prototyped in REPL first, this should be rare)
- Retangle and re-evaluate
Rationale: The two tracks prevent the two failure modes we have observed. Writing implementation code directly in Org (without REPL prototyping) produces syntax errors that require external tools to debug. Skipping Org-first test writing produces code without verified success criteria. The split is not bureaucratic — it is the mechanism by which both failures are prevented.
GTD Conventions
Every task headline in the project's ROADMAP.org and gtd.org follows these rules:
- :ID: — generated by
memory-id-generate(UUIDv4 withid-prefix), never written manually. Use(memory-id-generate)in the REPL to produce one. - :CREATED: — ISO-8601 timestamp:
[2026-05-02 Sat 14:30]. Set when the headline is first created, never changed. - :LOGBOOK: — each state transition is logged:
- State "DONE" from "TODO" [2026-05-02 Sat 15:00]. - CLOSED: — set when the task reaches DONE:
CLOSED: [2026-05-02 Sat 15:00]. - TODO keywords follow the standard sequence:
TODO→NEXT→IN-PROGRESS→DONE/BLOCKED/CANCELLED. - The Agent updates these automatically during Phase E of the lifecycle. The human never needs to write a UUID or timestamp manually — the agent generates and inserts them.
Example:
*** DONE Event Orchestrator
:PROPERTIES:
:ID: id-4a2b9c8f-3d7e-4f12-a9b0-1c2d3e4f5a6b
:CREATED: [2026-05-02 Sat]
:END:
:LOGBOOK:
- State "DONE" from "TODO" [2026-05-02 Sat 18:00]
:END:
CLOSED: [2026-05-02 Sat 18:00]
Implementation
Standards Enforcement
;; REPL-VERIFIED: 2026-05-03T13:00:00
(in-package :passepartout)
(defun standards-git-clean-p (dir)
"Checks if a directory has uncommitted changes."
(let ((status (uiop:run-program (list "git" "-C" (namestring dir) "status" "--porcelain")
:output :string
:ignore-error-status t)))
(string= "" (string-trim '(#\Space #\Newline #\Tab) status))))
standards-lisp-verify
;; REPL-VERIFIED: 2026-05-03T13:00:00
(defun standards-lisp-verify (code)
"Enforces Lisp structural and semantic standards using utils-lisp."
(let ((result (utils-lisp-validate code :strict t)))
(if (eq (getf result :status) :success)
t
(error (getf result :reason)))))
standards-lisp-format
;; REPL-VERIFIED: 2026-05-03T13:00:00
(defun standards-lisp-format (code)
"Ensures Lisp code adheres to formatting standards."
(utils-lisp-format code))
#+end_src
Skill Registration
(defskill :passepartout-programming-standards
:priority 100
:trigger (lambda (ctx) (declare (ignore ctx)) nil))