agent(skills): migrate flat skill stubs to directory-packaged structure
Brain Structural Validation / Validate Markdown Structure & Links (push) Successful in 10s

- Remove legacy flat 05-agents/skills/<name>.md files superseded by
  directory-structured skill packages (<name>/README.md)
- Update AGENTS.md skills/ description to document new packaging model
  with human capability contracts and runtime SKILL.md
- Fix skill-builder link in 2026-09-29 journal entry
- Fix engineering-investigation link in documentation-and-investigation
  skills walkthrough guide
This commit is contained in:
kiskaadee committed 2026-10-02 19:24:45 -05:00
1 parent 714dc76eb7
commit 0acfd3d983
7 files changed
+3 -376

No files matched your search

+1 -1
View File
@@ -43,7 +43,7 @@ tags:
- Formalized **Knowledge Articles** as an explicit epistemic document type in [`documentation-router`](../../05-agents/skills/documentation-router/README.md), authoring the specification `references/knowledge-authoring.md` based on a side-by-side learner voice and rhetorical restraint.
- Authored the durable knowledge article [How to Build Effective Agent Skills](../../04-learning/knowledge/methods/building-effective-agent-skills.md), explaining why essay prompts fail, introducing the assembly jig / airlock mental model, and codifying the single observable proof heuristic.
- Derived the Skill-Engineering Methodology based on 4 structural sizing archetypes (Reference, Transformation, Procedural Workflow, Interactive Elicitation) and a 4-tier epistemic architecture (Engineering Invariants, Platform Constraints, Contextual Heuristics, Authoring Quality).
- Designed and implemented the [`skill-builder`](../../05-agents/skills/skill-builder.md) meta-skill (deployed to `~/.gemini/config/skills/skill-builder/` and `/build-skill`) as an interactive coach with a mandatory Design Review Gate.
- Designed and implemented the [`skill-builder`](../../05-agents/skills/skill-builder/README.md) meta-skill (deployed to `~/.gemini/config/skills/skill-builder/` and `/build-skill`) as an interactive coach with a mandatory Design Review Gate.
- Dogfooded `skill-builder` against existing skills (`engineering-investigation`, `engineering-tutor`, `documentation-router`, `git-commit`), validating its false-positive rejection and identifying high-signal refinements.
- Strengthened `engineering-investigation` with Evidence Before Hypothesis, Traceable Diagnostic Cleanup, and Sensitive Data Redaction invariants.
- Captured the architectural commitments in ADR [Agent Skill Architecture & Governance](../../03-records/decisions/agent-skill-architecture-and-governance.md).
@@ -45,7 +45,7 @@ Operational walkthrough for the implementation of the decoupled, reusable global
### A. Procedural Investigation Skill
- **Runtime Location**: `~/.gemini/config/skills/engineering-investigation/SKILL.md`
- **Vault Specification**: [`05-agents/skills/engineering-investigation.md`](../../../05-agents/skills/engineering-investigation.md)
- **Vault Specification**: [`05-agents/skills/engineering-investigation/README.md`](../../../05-agents/skills/engineering-investigation/README.md)
- **Role**: Purely empirical troubleshooting following the scientific method (Observation $\to$ Verification) and the 6-part interactive checkpoint protocol.
- **Boundary**: Stops cleanly upon verified recovery; hands off to `documentation-router` if non-obvious learning or architectural questions emerged.
@@ -1,82 +0,0 @@
---
type: agent
status: active
name: engineering-investigation
kind: skill
project: brain
tags:
- investigation
- debugging
- troubleshooting
- scientific-method
- checkpoints
---
# Engineering Investigation Skill
Canonical store of the global agent skill for disciplined engineering investigations, scientific method progression, and interactive checkpoint reviews.
* **Runtime Customization Path**: `~/.gemini/config/skills/engineering-investigation/SKILL.md`
* **Applicable Workspaces**: Global (workstation-wide across all repositories and directories).
---
## 1. The Investigative Lifecycle & Scientific Method
Engineering troubleshooting must follow a disciplined, empirical scientific progression:
```mermaid
flowchart TD
Obs["1. Observe & Triage<br/>(Raw error logs, symptoms, blast radius)"] --> Hyp["2. Form Working Hypotheses<br/>(Plausible failure mechanisms)"]
Hyp --> Test["3. Rationalized Inspection<br/>(Targeted diagnostics with stated expectations)"]
Test --> Narrow["4. Narrow Failure Domain<br/>(Confirm or eliminate hypotheses)"]
Narrow --> RCA["5. Root Cause Determination<br/>(Underlying causal mechanism proven)"]
RCA --> Fix["6. Declarative Remediation<br/>(Minimal, isolated, reversible fix)"]
Fix --> Val["7. Local & Environment Validation<br/>(Tests, linters, flake checks)"]
Val --> Deploy["8. Handoff / Deployment & Verification<br/>(Verify recovery in runtime environment)"]
Deploy --> Done["Investigation Concluded<br/>(Handoff to Documentation Router if warranted)"]
```
### Core Epistemic Principles
* **Evidence Before Hypothesis**: Before formulating causal theories or diving into implementation code, establish sufficient observable evidence (raw logs, error outputs, system traces, or deterministic reproductions where available) to characterize the failure symptom and boundary. Avoid speculative code browsing without grounded empirical observations.
* **Preserve Investigative Reasoning**: Document how the evidence led from the initial observation to the explanation, not merely what final patch fixed the bug.
* **Separate Observation from Inference**: Strictly distinguish what the system reported (raw logs, error outputs, exit codes) from what the operator inferred.
* **Explain Diagnostic Command Rationale**: Before running inspections, be clear on why the command is run, what layer of the stack it tests, and what result supports or refutes the working hypothesis.
* **Traceable Diagnostic Mutations & Cleanup**: Every temporary diagnostic modification (debug logging, environment overrides, test fixtures, database records, probe code, or configuration changes) must have an explicit cleanup boundary and a verification method. Before declaring recovery or proposing commits, verify that all temporary mutations have been completely removed.
* **No Hindsight Bias**: Avoid fabricating a tidy, linear narrative after the fact. Distinguish working hypotheses held during the investigation from insights discovered retrospectively.
* **Proportional Depth**: Scale the depth of investigation to the complexity and learning value of the issue. Do not manufacture complex hypotheses or ceremonial boilerplate for trivial syntax errors or routine typos.
* **Transferable Diagnostic Knowledge**: Surface heuristics, architectural invariants, and debugging techniques that generalize across system boundaries.
* **Sensitive Data Redaction & Zero Leakage**: Diagnostic evidence must be inspected for sensitive values (passwords, API tokens, HMAC keys, authorization headers, database connection strings, personal identifiers) before being surfaced, persisted, or incorporated into an investigation log. Verify credentials via redacted signatures or non-sensitive metadata.
---
## 2. The Interactive Checkpoint Protocol
To maintain human-in-the-loop alignment and prevent unchecked autonomous divergence, halt at meaningful investigation transitions rather than stopping after every individual command:
* The failure domain has been materially narrowed.
* An important hypothesis has been confirmed or eliminated.
* A meaningful local configuration or code change has been made.
* Local validation establishes a new state.
* An atomic commit boundary has been reached.
* A production or deployment step is ready for user execution.
* Post-deployment evidence confirms recovery or reveals regressions.
### The 6-Part Checkpoint Format
1. **Current State**: What is empirically known from evidence; what remains uncertain.
2. **Reasoning**: Current working hypothesis, why the evidence supports it, and what alternatives have been eliminated.
3. **Changes**: What has been changed locally, which files are affected, and what invariant the change establishes.
4. **Validation**: What has already been tested, including expected versus actual results.
5. **Next Action**: What should happen next, why it is appropriate, and what evidence is expected.
6. **Recovery**: How the change or deployment can be rolled back if validation fails.
> **Rule**: Present the checkpoint concisely, and **pause before crossing user-controlled state boundaries** (such as committing, merging, pushing, or executing production deployments).
---
## 3. Investigation Completion & Documentation Boundary
Investigation is purely procedural and terminates upon post-deployment verification or recovery.
* Routine maintenance, straightforward typos, and self-explanatory fixes require **no external documentation**—document them normally in Git commit messages or repository-local comments.
* If the investigation yielded architectural insights, unexpected failure modes, false system assumptions dispelled, or reusable operational heuristics, hand off to the global skill **`documentation-router`** to evaluate which, if any, durable documentation artifact is justified.
-106
View File
@@ -1,106 +0,0 @@
---
type: agent
status: active
name: engineering-tutor
kind: skill
project: brain
tags:
- tutoring
- pedagogy
- socratic-method
- practice-mode
- transfer-verification
---
# Engineering Tutor Skill (Practice Mode)
Canonical store of the global agent skill for Socratic engineering tutoring, graduated assistance, and transfer-verified learning across projects and conceptual inquiries.
* **Runtime Customization Path**: `~/.gemini/config/skills/engineering-tutor/SKILL.md`
* **Applicable Workspaces**: Global (workstation-wide across all repositories and directories).
---
## 1. Governing Axioms
1. **The Learner Is the Primary Agent**:
When implementation is part of the exercise, the learner—not the tutor—writes the implementation in their repository. The tutor does not write solution code, edit working files, or run implementation commands in the learner's repository. When an exercise is conceptual or diagnostic, the learner drives the analysis and inspects the evidence.
2. **Graduated Assistance & Explicit Override**:
> **Default to the lowest effective intervention.** Do not provide a direct answer, fix, or code implementation when guided reasoning could reasonably lead the learner there.
>
> **Explicit User Override**: If the learner explicitly requests a higher level of assistance (e.g. *"I've spent 20 minutes on this. Stop Socratic questioning and explain how Python generators work"*), honor that request directly without resistance, while preserving the opportunity for later verification (*"Now explain how that applies to your case / solve this transfer challenge"*).
3. **Evidence-Based Understanding (Mastery via Transfer)**:
Understanding is verified only when the learner can successfully explain the mechanism, predict runtime behavior, or solve a **transfer challenge** in an altered context.
4. **Any-Project Portability**:
Requires no dedicated curriculum or setup; activates in-place within any active workspace or conceptual inquiry.
---
## 2. Complementarity with Adjacent Skills
```text
engineering-investigation
= How to investigate the system (Agent diagnoses)
engineering-tutor
= How to teach the learner to investigate and build the system (Learner diagnoses & builds)
documentation-router
= Second-order filter deciding whether durable documentation is warranted
```
* The tutor does not automatically write knowledge articles or architectural records.
* The tutor may offer to record demonstrated learning evidence in a lightweight
practice record (`type: practice`) when a meaningful learning milestone is reached.
* When a fundamental concept is solidified, demonstrated learning evidence may subsequently be evaluated by `documentation-router` for durable knowledge preservation.
---
## 3. The Graduated Assistance Hierarchy
```mermaid
flowchart TD
Friction["Learner Encounters Friction / Question"] --> Q["1. Socratic Questioning"]
Q -->|"Needs context / direction"| Look["2. Guided Exploration ('Where to look')"]
Look -->|"Prerequisite gap / Diminishing returns"| Concept["3. Concept Explanation"]
Concept -->|"Pattern demonstration needed"| Demo["4. Isolated Demonstration (Unrelated context)"]
Q --> Attempt["5. Learner Attempts<br/>(Implementation, explanation, prediction, or diagnosis)"]
Look --> Attempt
Concept --> Attempt
Demo --> Attempt
Attempt --> Review["6. Review & Diagnostic Feedback"]
Review --> Transfer["7. Transfer Challenge (Verify Mastery)"]
```
### The 7 Intervention Modes
1. **Socratic Questioning**: Target assumptions and reveal inconsistencies.
2. **Guided Exploration ("Where should I look?")**: Direct the learner to inspection points (`EXPLAIN ANALYZE`, log files, spec sections).
3. **Targeted Concept Explanation**: First-principles explanation of missing theoretical foundations, followed immediately by handing back control.
4. **Isolated Demonstration**: Demonstrations in minimal, generic, unrelated domains—never directly inside the learner's codebase.
5. **Code Review & Diagnostic Feedback**: Review learner-written code, tests, and diffs with probing diagnostic observations.
6. **Transfer Challenge**: Altered context or edge case testing true comprehension.
7. **Authoritative References**: Primary sources (RFCs, official language specs, kernel documentation).
---
## 4. The Concept Mastery Loop
```mermaid
flowchart TD
Start["Encounter Concept / Problem"] --> Baseline["1. Establish Baseline Understanding"]
Baseline --> Probe["2. Socratic Probing & Guided Inspection"]
Probe --> Attempt["3. Learner Attempts<br/>(Implementation, explanation, prediction, or analysis)"]
Attempt --> Review["4. Tutor Evaluates Attempt"]
Review --> Check{"Comprehension Demonstrated?"}
Check -->|No: Misconception Persists| Explain["Targeted Explanation / Isolated Demo"]
Explain --> Attempt
Check -->|Yes: Working Correctly| Challenge["5. Transfer Challenge<br/>(Apply in altered context / edge case)"]
Challenge --> Verify{"Transfer Solved?"}
Verify -->|No| Probe
Verify -->|Yes| Record["6. Record Demonstrated Evidence"]
```
-107
View File
@@ -1,107 +0,0 @@
---
type: agent
status: active
name: git-commit
kind: skill
project: brain
tags:
- git
- gitkeeper
- conventional-commits
- history-hygiene
- atomic-commits
---
# Git Commit & History Construction Skill (GitKeeper Lineage)
Canonical store of the global agent skill for Git history hygiene, atomic commit construction, Conventional Commits 1.0.0 derivation across 3 depth levels, and protected-branch readiness gates.
* **Runtime Customization Path**: `~/.gemini/config/skills/git-commit/SKILL.md`
* **Applicable Workspaces**: Global (workstation-wide across all repositories and directories).
---
## 1. Governing Axioms & Invariants
1. **The Source-of-Truth Invariant**:
> **The working tree and diff are the authoritative source of truth for what is being committed; conversational intent may explain a change but must never override observed repository state.**
2. **The Boundary of Responsibility**:
`git-commit` packages an approved repository state transition. It does **not** decide what work ought to have been done (no rewriting code, inventing tests, or manufacturing documentation).
3. **Commit Slice Isolation Invariant**:
> **Unrelated or future-intended working-tree changes are not blockers when the current commit slice can be isolated and validated safely.**
4. **Session Authority Invariant**:
> `git-commit` consumes session mode established by the active workflow. It **MUST NOT** infer autonomous implementation authority solely from code changes. If session mode is unknown, it defaults to **Normal / Direct** behavior.
---
## 2. Core Triad & The GitKeeper Algorithm
* **Commit Boundary**: *What belongs together?* (Semantic cohesion of a state transition).
* **Commit Sequence**: *In what order should boundaries enter history?* (Dependency lineage and incremental intelligibility).
* **Commit Message**: *How should each resulting state transition be described?* (Durable historical clarity).
```mermaid
flowchart TD
Inspect["1. Inspect Repository & Worktree<br/>(Diff is authoritative)"] --> Decompose["2. Identify Logical Changes<br/>(Cluster related files & hunks)"]
Decompose --> Sequence["3. Construct Boundaries & Sequence<br/>(Order by structural dependencies)"]
Sequence --> Slice["4. Stage Current Commit Slice<br/>(Isolate slice; ignore future changes)"]
Slice --> Gate["5. Commit Readiness Gate<br/>(Branch safety, contextual validation)"]
Gate -->|Blocked| Report["Report Blockers / Pause"]
Gate -->|Ready| Derive["6. Derive Commit Message<br/>(Level 1, 2, or 3 depth)"]
Derive --> ModeCheck{"7. Session Authority?"}
ModeCheck -->|"Explicit Implementation Mode"| AutoCommit["Validate & Commit on Working Branch<br/>(Never main/master)"]
ModeCheck -->|"Practice / Investigation / Normal / Unknown"| Checkpoint["Present 6-Part Checkpoint<br/>(User-controlled transition)"]
Checkpoint --> UserApproval["User Approval / Execution"]
AutoCommit --> Verify["8. Verify Resulting Commit<br/>(Check SHA, head, and remaining worktree)"]
UserApproval --> Verify
```
---
## 3. The Four Operational Responsibilities
### 1. State Inspection
Establish ground truth before proposing Git operations: repo root, branch status, tracking upstream, staged/unstaged/untracked inventory, authoritative diff (`git diff`, `git diff --cached`), and local commit conventions (`AGENTS.md`, recent `git log`).
### 2. Commit-Boundary Reasoning & History Sequencing
An atomic commit represents one coherent repository state transition that can be understood, reviewed, reverted, or cherry-picked as a unit. Decompose multi-intent working trees into ordered narrative sequences and surface accidental coupling.
### 3. Commit Message Derivation across 3 Depth Levels
#### Type Vocabulary Hierarchy
1. **Conventional Commits 1.0.0 Baseline**:
* `feat` MUST be used for new features.
* `fix` MUST be used for bug fixes.
* Other types MAY be used; CC 1.0.0 does not prescribe a universal taxonomy.
2. **Repository Overrides**:
* Repository-local conventions (e.g. Brain's `plan`, `discussion`, `decision`, `journal`, `debug`, `agent`, or project package scopes) take precedence.
3. **Session Context & Standard Defaults**:
* Standard industry terms (`refactor`, `docs`, `test`, `build`, `ci`, `perf`, `style`, `chore`) provide clear defaults.
#### Message Depth Levels
* **Level 1 (Subject only)**: Trivial, self-explanatory changes (`docs(readme): add architecture section`).
* **Level 2 (Subject + body)**: Multiple concrete sub-changes needing explicit listing.
* **Level 3 (Subject + body + rationale)**: Architectural trade-offs, constraints, or non-obvious reasoning.
### 4. Commit Readiness Gate (Slice-Level Verification)
10-point readiness checklist:
1. Correct repository root confirmed.
2. Target branch is intentional.
3. Protected branch safety: NOT on `main`/`master` without explicit repo-local authorization.
4. Commit slice contains only intended changes for this commit (unrelated/future changes isolated).
5. Atomic boundary established (single coherent logical unit).
6. Required repository/session validation has passed, or applicable validation has been explicitly waived.
7. Repository conventions satisfied (scope rules, issue references).
8. Message depth matches semantic significance (Level 1, 2, or 3).
9. Diff confirms message accuracy (no hallucinations).
10. Resulting history remains coherent and intelligible under repository integration policy.
---
## 4. History Manipulation & Integration Safety
* **Squash**: Collapse intermediate churn into single coherent units; never blindly squash rich narrative histories.
* **Rebase**: Encouraged for local unshared branches; prohibited on published/shared branches without explicit user authorization.
* **Cherry-Pick**: Self-contained logical commits with verified dependencies; inspect diff and validate.
* **Merge**: Preserve merge commits when branch topology conveys meaningful lifecycle information; follow repo policy.
* **Reset & Restore Safety Barrier**: Distinguish non-destructive (`reset --soft`, unstage) from destructive (`reset --hard`, `restore`). The agent **MUST NEVER** execute destructive reset/restore commands autonomously.
-78
View File
@@ -1,78 +0,0 @@
---
type: agent
status: active
name: skill-builder
kind: skill
project: brain
tags:
- skills
- skill-authoring
- agent-engineering
- meta-skill
---
# Skill Builder Meta-Skill
Canonical store of the global agent skill for designing, sizing, authoring, and iteratively refining agent skills through interactive diagnostic coaching.
* **Runtime Customization Path**: `~/.gemini/config/skills/skill-builder/SKILL.md`
* **Applicable Workspaces**: Global (workstation-wide across all repositories and directories).
---
## 1. Governing Axioms & Division of Labor
1. **The Human is the Architectural Authority**: The human decides architectural intent, approves boundaries, accepts or rejects trade-offs, and owns the final design. `skill-builder` investigates, structures, challenges, proposes, drafts, and validates.
2. **Proportional Structure (Anti-Overengineering)**: A skill is sized to the problem it solves. Do not force every skill to be a phased state machine. Diagnose the required structural mode and apply operational controls only where justified.
3. **Change the Smallest Relevant Mechanism**: When refining an existing skill after observing a failure, avoid sweeping rewrites. Modify the smallest mechanism (a gate, a promoted rule, a negative boundary) that addresses the observed variance.
4. **Boundary of Responsibility**:
* Governs the meta-level problem: *how to design an effective skill*.
* Does *not* execute the downstream engineering tasks the authored skill will perform.
* Does *not* bypass `documentation-router` for vault documentation.
* Does *not* execute Git commits autonomously (delegated to `git-commit`).
---
## 2. Epistemic Architecture of Skills
The skill evaluates proposed skills across four distinct tiers:
* **Tier 1: Universal Engineering Invariants**: Explicit responsibility and ownership, explicit boundary and handoffs, one authoritative owner per rule/procedure, behaviorally meaningful instructions, and observable definition of completion where state changes occur.
* **Tier 2: Platform & Runtime Constraints**: Gemini runtime invocation metadata (`disable-model-invocation: true`), context pointer descriptions for model-invoked skills, co-located `references/` and `scripts/`, and explicit tool calling conventions.
* **Tier 3: Contextual Design Heuristics**: Operational state machines, hard anti-skipping gates, externalized state, progressive disclosure (`references/`), asymmetric context pressure, and behavioral anchors.
* **Tier 4: Authoring Quality Heuristics**: Side-by-side learner voice, rhetorical restraint, behavioral deletion test, explanatory guidance, and clean GitHub-flavored markdown formatting.
---
## 3. The 6-Stage Skill-Engineering Lifecycle
```mermaid
flowchart TD
Need["1. Problem Discovery & Abstraction Fit<br/>(Recurring friction? Skill vs Rule vs Script?)"] --> Sizing["2. Structural Sizing & Dynamic Overlap<br/>(Reference, Transformation, Procedural, Interactive)"]
Sizing --> Controls["3. Operational Controls & Context Sizing<br/>(Preconditions, gates, state tracking, checkpoints)"]
Controls --> Spec["4. Skill Design Specification<br/>(Structured summary of all design choices)"]
Spec --> Gate{"Design Review Gate<br/>Human Approval Required"}
Gate -->|Revise| Sizing
Gate -->|Approved| Author["5. Authoring & Scaffolding<br/>(SKILL.md, references/, scripts/, Brain catalog)"]
Author --> Dogfood["6. Dogfooding, Trajectory Audit & Regression<br/>(Run on real task; refine smallest mechanism; verify non-regression)"]
```
---
## 4. The Minimal Refinement Matrix
When dogfooding a skill against real-world tasks, adjust the smallest relevant mechanism:
| Observed Trajectory Failure | Likely Root Cause | Architectural Refinement |
| :--- | :--- | :--- |
| **Agent skips a required verification step** | Premature completion pull; fuzzy completion boundary | Strengthen the pre-condition gate; make the required artifact observable. |
| **Agent ignores a critical behavioral rule** | Rule is buried in static reference or offloaded too deep | **Promote the rule into the primary SKILL.md execution path.** |
| **Supporting detail overwhelms the procedure** | Token sprawl; in-file reference dilutes attention | Disclose detailed formats, examples, or branch rules into `references/`. |
| **Agent wanders into adjacent tasks** | Unbounded responsibility | Tighten the negative boundary; specify what it refuses to do and where it hands off. |
| **Agent repeats unnecessary boilerplate** | Prompt micro-manages standard LLM defaults | Prune the instruction or replace verbose paragraphs with a compact behavioral anchor. |
| **Agent behaves correctly without the instruction** | Instruction is a no-op | Delete the instruction entirely. |
### Regression Verification
After applying any refinement:
1. Re-run a representative scenario to confirm the target failure disappeared.
2. Verify that previously successful behaviors remain intact.
+1 -1
View File
@@ -56,7 +56,7 @@ Durable understanding, operational procedures, and deliberate drills answering:
Canonical store of AI agent profiles, instructions, operational boundaries, and guardrails across projects and workstations.
- **`README.md`** — Structural catalog of all configured agents and target workspaces.
- **`profiles/`** — Machine-readable agent persona specifications and safety guardrails (`05-agents/profiles/<name>.md`, `type: agent`, `kind: profile`).
- **`skills/`** — Reusable agent operational capabilities, instructions, and prompt modules (`05-agents/skills/<name>.md`, `type: agent`, `kind: skill`).
- **`skills/`** — Reusable agent operational capabilities, packaged with human capability contracts (`05-agents/skills/<name>/README.md`, `type: agent`, `kind: skill`) and runtime specifications (`SKILL.md`).
### `06-projects/`
Canonical project entrypoints and navigation hubs.