agent(skills): add global engineering investigation and knowledge workflow skill
Brain Structural Validation / Validate Markdown Structure & Links (push) Successful in 7s
Brain Structural Validation / Validate Markdown Structure & Links (push) Successful in 7s
This commit is contained in:
1 parent
14846bab10
commit
2670eafa20
3 files changed
+130
-83
No files matched your search
+5
-1
@@ -26,4 +26,8 @@ Rather than treating agent rulebooks (`AGENTS.md`) as transient, untracked local
|
||||
| [NekoWeb Manga Platform](profiles/nekoweb.md) | `git@github.com:kiskaadee/nekoweb.git` | Self-hosted manga web platform (FastAPI, UV, React/TanStack, HakuNeko Daemon) | `active` |
|
||||
| [Second Brain Knowledge Graph](profiles/second-brain.md) | `ssh://git@gitea.roadtotech.me:2223/kiskaadee/second-brain` | Personal knowledge graph curation, epistemic validation, and artifact management | `active` |
|
||||
|
||||
---
|
||||
## Catalog of Operational Skills
|
||||
|
||||
| Skill | Target Workspace | Primary Capability | Status |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| [Engineering Investigation & Knowledge](skills/engineering-investigation-and-knowledge.md) | Global (`~/.gemini/config/skills/`) | Scientific investigation lifecycle, 6-part checkpoints, RCA, and conditional Brain staging | `active` |
|
||||
@@ -144,7 +144,7 @@ flowchart TD
|
||||
D --> CP4{"Deployment Handoff"}
|
||||
CP4 -->|"User Deploys"| E["5. User-Controlled Production Deployment<br/>(Core rebuild or Sites workload rollout)"]
|
||||
E --> F["6. Post-Deployment Verification<br/>(Agent verifies via SSH)"]
|
||||
F --> G["7. Document in Brain Inbox<br/>(~/Brain/00-inbox/YYYY-MM-DD-<slug>-debug.md)"]
|
||||
F --> G["7. Evaluate Knowledge Capture<br/>(Stage if non-obvious/durable)"]
|
||||
```
|
||||
|
||||
### B. Checkpoint Protocol
|
||||
@@ -212,8 +212,8 @@ This policy applies equally to Core/NixOS system changes and Sites application c
|
||||
Agent provides the workload-specific deployment handoff runbook. User executes the deployment.
|
||||
6. **Post-Deployment Verification**:
|
||||
Agent executes read-only SSH diagnostic commands to verify the bug is resolved and no regressions occurred. Checkpoint findings.
|
||||
7. **Document in Brain Inbox**:
|
||||
If troubleshooting produced non-obvious diagnostic reasoning, architectural insights, or reusable operational lessons, author an epistemic incident report staged in `~/Brain/00-inbox/YYYY-MM-DD-<slug>-debug.md` (`type: inbox`, `project: homelab`). During Second Brain curation, this artifact is normalized to `type: debug`, committed to `03-records/debug/YYYY-MM-DD-<slug>.md`, and referenced in the day's daily journal (`03-records/journal/YYYY-MM-DD.md`).
|
||||
7. **Evaluate Durable Knowledge Capture**:
|
||||
If troubleshooting produced non-obvious diagnostic reasoning, architectural insights, or reusable operational lessons, invoke the global investigation and knowledge workflow to stage an epistemic report in the operator's knowledge inbox. Routine maintenance and self-explanatory fixes require no external documentation.
|
||||
|
||||
### F. CI/CD & Gitea Actions (`act_runner`) Invariants
|
||||
* **Pre-Baked Images over In-Job Installers**: Always declare `container: { image: <image> }` (e.g., `nixery.dev/shell/coreutils/git/nix/nodejs:latest`, `python:3.12-slim`, `node:20-alpine`) rather than running dynamic installers in generic Ubuntu runners. Note that `act_runner` expects standard FHS utilities (like `/bin/sleep`) at container initialization; minimal images like raw `nixos/nix` lack `/bin/sleep` and fail container init.
|
||||
@@ -226,87 +226,13 @@ This policy applies equally to Core/NixOS system changes and Sites application c
|
||||
|
||||
---
|
||||
|
||||
## 4. Post-Incident Debugging & Epistemic Reporting (Second Brain)
|
||||
## 4. Post-Incident Epistemic Knowledge Capture
|
||||
|
||||
Capture incidents into the Second Brain inbox (`/home/kiskaadee/Brain/00-inbox/YYYY-MM-DD-<slug>-debug.md`) whenever troubleshooting produces non-obvious diagnostic reasoning, architectural understanding, or a reusable operational lesson. Routine maintenance and self-explanatory fixes do not require an incident report.
|
||||
Troubleshooting operations adhere to the global `engineering-investigation-and-knowledge` workflow:
|
||||
* **Conditional Capture**: Routine fixes and maintenance do not require incident documentation. Only non-obvious root causes, architectural trade-offs, or transferable operational heuristics warrant durable capture.
|
||||
* **Epistemic Standards**: Preserve investigative reasoning, separate observation from inference, state command rationale, avoid hindsight bias, and maintain zero secret leakage.
|
||||
* **Staging**: When qualified, stage findings into the operator's knowledge inbox (`~/Brain/00-inbox/`) following the global capture protocol.
|
||||
|
||||
During Second Brain curation, the document is moved to `/home/kiskaadee/Brain/03-records/debug/YYYY-MM-DD-<slug>.md` (`type: debug`), and cross-referenced in the day's daily journal (`/home/kiskaadee/Brain/03-records/journal/YYYY-MM-DD.md`).
|
||||
|
||||
### A. Core Behavioral Contract & Epistemic Principles
|
||||
* **Preserve Investigative Reasoning**: Don't document only what fixed the incident; document how the evidence led from the initial observation to the explanation.
|
||||
* **Separate Observation from Inference**: Strictly distinguish what the system reported (raw logs, error codes, outputs) from what the operator inferred.
|
||||
* **Explain Command Rationale**: Document why each diagnostic inspection was performed, what layer it inspected, and what result would support or refute the working hypothesis.
|
||||
* **No Hindsight Bias**: Never fabricate a neat, predetermined narrative. If an explanation or diagnostic path was discovered retrospectively, explicitly label it as retrospective analysis.
|
||||
* **Proportional Depth**: Scale detail to the incident's learning value. Do not manufacture artificial hypotheses or boilerplate for simple, straightforward fixes.
|
||||
* **Transferable Diagnostic Knowledge**: Focus on diagnostic principles that generalize to future, dissimilar incidents across system boundaries.
|
||||
* **Zero Secret Leakage**: Never log raw or truncated secrets. Document verification matches securely.
|
||||
* **Checkpoints vs. Durable Report**: Interactive checkpoints serve as transient execution-control mechanisms during the live session; the debug record is the durable historical and technical report. Do not transcribe checkpoints or conversational exchanges verbatim. Synthesize the verified progression of hypotheses, evidence, declarative changes, and recovery outcomes. The checkpoints naturally surface the key investigation transitions needed for an accurate report.
|
||||
|
||||
### B. Frontmatter Schemas:
|
||||
|
||||
**Staging Frontmatter** (`~/Brain/00-inbox/YYYY-MM-DD-<slug>-debug.md`):
|
||||
```yaml
|
||||
---
|
||||
type: inbox
|
||||
created: YYYY-MM-DD
|
||||
project: homelab
|
||||
tags:
|
||||
- operations
|
||||
- homelab
|
||||
- troubleshooting
|
||||
- <relevant-services>
|
||||
---
|
||||
```
|
||||
|
||||
**Curated Target Frontmatter** (`~/Brain/03-records/debug/YYYY-MM-DD-<slug>.md`):
|
||||
```yaml
|
||||
---
|
||||
type: debug
|
||||
project: homelab
|
||||
date: YYYY-MM-DD
|
||||
tags:
|
||||
- operations
|
||||
- homelab
|
||||
- troubleshooting
|
||||
- <relevant-services>
|
||||
---
|
||||
```
|
||||
|
||||
### C. Epistemic Progression Structure:
|
||||
Follow the modular investigative progression below (sections may be omitted, merged, or abbreviated when not applicable):
|
||||
|
||||
```markdown
|
||||
# <Title>
|
||||
|
||||
## System Context & Fundamentals
|
||||
Subsystem function, relevant components, data flow, and critical protocol/security contracts. (Reference canonical docs; avoid reproducing generic architecture).
|
||||
|
||||
## Problem & Observations
|
||||
Observed vs. expected behavior, raw error logs, and initial symptom manifestation (separating raw facts from interpretation).
|
||||
|
||||
## Diagnostic Inquiries
|
||||
Guiding questions formulated to narrow down the failure domain.
|
||||
|
||||
## Investigation & Hypothesis Testing
|
||||
Reasoning progression: Rationale → Inspection/Command → Expected vs. Actual Evidence → Hypothesis Status. Preserves real investigation branches and eliminated possibilities.
|
||||
|
||||
## Findings & Root Cause Analysis
|
||||
Synthesis of proven evidence and explanation of the underlying causal mechanism.
|
||||
|
||||
## Declarative Remediation & Local Validation
|
||||
Declarative changes made, test commands run, and verification results.
|
||||
|
||||
## Deployment & Recovery Runbook
|
||||
Production rollout steps and post-deployment proof of recovery.
|
||||
|
||||
## Discussion & Generalization
|
||||
Architectural takeaways, false assumptions dispelled, transferable diagnostic heuristics, and preventative measures.
|
||||
|
||||
## References
|
||||
Links to affected manifests, scripts, canonical documentation, or protocol specs.
|
||||
```
|
||||
|
||||
*(For detailed methodology, epistemological principles, and diagnostic design, consult canonical documentation in `Brain/04-learning/knowledge/methods/incident-investigation-and-journaling.md`).*
|
||||
````
|
||||
|
||||
### B. Client Adapter Specification: `/home/kiskaadee/Homelab/CLAUDE.md`
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
---
|
||||
type: agent
|
||||
status: active
|
||||
name: engineering-investigation-and-knowledge
|
||||
kind: skill
|
||||
project: brain
|
||||
tags:
|
||||
- investigation
|
||||
- debugging
|
||||
- troubleshooting
|
||||
- scientific-method
|
||||
- epistemic-reporting
|
||||
- rca
|
||||
---
|
||||
|
||||
# Engineering Investigation & Epistemic Knowledge Skill
|
||||
|
||||
Canonical store of the global agent skill for engineering investigations, diagnostic checkpoint reviews, and conditional epistemic knowledge capture.
|
||||
|
||||
* **Runtime Customization Path**: `~/.gemini/config/skills/engineering-investigation-and-knowledge/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 fix in runtime environment)"]
|
||||
Deploy --> Decision{"Evaluate Durable Learning"}
|
||||
Decision -->|"Routine / Self-explanatory"| Done["Close Investigation<br/>(Standard commit/PR docs)"]
|
||||
Decision -->|"Non-obvious / Architectural"| Capture["9. Stage Epistemic Artifact<br/>(~/Brain/00-inbox/)"]
|
||||
```
|
||||
|
||||
### Core Epistemic Principles
|
||||
* **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.
|
||||
* **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 and reporting to the learning value. 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.
|
||||
* **Zero Secret Leakage**: Never log credentials, API tokens, HMAC keys, or raw secrets. Verify security matches 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. Conditional Knowledge Capture Decision
|
||||
|
||||
> **Rule: Investigation is procedural; documentation is conditional.**
|
||||
|
||||
Routine maintenance, straightforward typos, and self-explanatory fixes **do not require an external knowledge artifact**. They should be documented normally in Git commit messages or repository-local comments.
|
||||
|
||||
Capture an incident into the knowledge system only when troubleshooting produces:
|
||||
* Non-obvious diagnostic reasoning or surprising failure modes.
|
||||
* Architectural insights or incorrect system assumptions dispelled.
|
||||
* A reusable operational or troubleshooting lesson applicable across systems.
|
||||
* A security posture or threat model clarification.
|
||||
|
||||
---
|
||||
|
||||
## 4. Staging & Epistemic Reporting Protocol
|
||||
|
||||
When an incident qualifies for durable capture, stage an epistemic incident report in the knowledge inbox:
|
||||
|
||||
### Staging Destination:
|
||||
`~/Brain/00-inbox/YYYY-MM-DD-<slug>-debug.md`
|
||||
|
||||
### Staging Frontmatter:
|
||||
```yaml
|
||||
---
|
||||
type: inbox
|
||||
created: YYYY-MM-DD
|
||||
project: <project-name>
|
||||
tags:
|
||||
- operations
|
||||
- troubleshooting
|
||||
- debugging
|
||||
- <relevant-subsystems>
|
||||
---
|
||||
```
|
||||
|
||||
### Subsequent Curation (Second Brain Lifecycle):
|
||||
During subsequent knowledge vault curation:
|
||||
1. The artifact is validated and normalized to `type: debug`.
|
||||
2. Moved to its permanent location: `~/Brain/03-records/debug/YYYY-MM-DD-<slug>.md`.
|
||||
3. Cross-referenced in the day's engineering journal: `~/Brain/03-records/journal/YYYY-MM-DD.md`.
|
||||
Reference in new issue
Block a user