3.3 KiB
3.3 KiB
SKILL: Tech-Analyst Agent (Consensus Phase C)
- Overview
- The Analyst Mandate
- Symbolic Implementation (The Logic)
- Neuro-Cognitive Prompt (The 'Think' Loop)
- Registration
Overview
The Tech-Analyst Agent is the third specialized role in the Personal Software Foundry (PSF) Consensus Loop. Its purpose is to define the Success Criteria for a project.
By generating a failing test suite immediately after the architecture is signed, the Analyst ensures that the Foundry follows a strict Test-Driven Development (TDD) mandate. This prevents the Coder from writing "orphan code" that lacks verification.
The Analyst Mandate
- Perception: The Analyst must perceive when a `PROTOCOL.org` has reached the `SIGNED` state.
- Translation: It must translate the semantic interfaces defined in the protocol into executable test cases.
- Integrity: It MUST ensure that the test suite covers both "Happy Path" and "Edge Case" scenarios, adhering to the security standards in Institutional Memory.
Symbolic Implementation (The Logic)
The following Lisp logic defines the physical actuation of the Analyst. It handles the creation of the test directory and the initial test files.
(defun tech-analyst-actuate (project-name test-content)
"Physically writes the TDD suite drafted by the Neuro-layer."
(let* ((projects-dir (org-agent::get-env "PROJECTS_DIR" "/app/5_projects/"))
(project-dir (format nil "~a/~a/" projects-dir project-name))
(test-dir (format nil "~atests/" project-dir))
(test-path (format nil "~atests/test-suite.lisp" project-dir))) ; Defaulting to Lisp for PSF core
(kernel-log "ANALYST - Actuating TDD Suite for: ~a" project-name)
(ensure-directories-exist test-dir)
(with-open-file (out test-path :direction :output :if-exists :supersede)
(format out ";;; TDD Suite for ~a~%~a" project-name test-content))
(format nil "SUCCESS - Tech-Analyst established TDD Suite for ~a" project-name)))
Neuro-Cognitive Prompt (The 'Think' Loop)
When the agent's LLM layer is invoked for this skill, it receives the following instructions to generate the tests based on the signed protocol.
(defun neuro-skill-tech-analyst (context)
(let* ((payload (getf context :payload))
(project-name (getf payload :project-name))
(protocol-content (getf payload :protocol-content)))
(format nil "
You are the PSF Tech-Analyst.
The PROTOCOL for project '~a' has been SIGNED.
Protocol & Interfaces:
---
~a
---
Your task: Generate a comprehensive test suite (TDD).
1. Write the tests in Common Lisp (FiveAM or similar).
2. Ensure tests match the function signatures in the PROTOCOL.
3. Include tests for:
- Success scenarios (Expected behavior).
- Edge cases (Malformed input, empty states).
- Security constraints.
Return a Lisp plist: (:target :analyst :action :actuate :name \"~a\" :content \"generated-test-code\")
" project-name protocol-content project-name)))
Registration
(defskill :skill-tech-analyst
:priority 60
:trigger #'trigger-skill-tech-analyst
:neuro #'neuro-skill-tech-analyst
:symbolic #'tech-analyst-actuate)