agentleFS
shynlee04shynlee04/hivemind-plugin/skills/hivemind-architect-strategist/SKILL.md

hivemind-architect-strategist

Skill51 starsChanged 7 months agoMITView on GitHub

Core skill for the hiveminder agent. Provides scanning, analysis, and synthesis capabilities for architecture review and strategic planning. Research-fronted and evidence-oriented approaches for high-quality decision making.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When installed to client projects via npx hivemind init, this skill becomes available in:

    line 27
  2. Distinctive:

    When synthesizing findings, structure reports as:

    line 248

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

HiveMind Architect Strategist

Core principle: Research-fronted. Evidence-oriented. Clean architecture. Ruthless quality. Never decide without data. Never claim without proof.

When to Use

  • Starting architecture review or code audit
  • Planning strategic refactoring decisions
  • Evaluating technical debt and migration paths
  • Synthesizing findings from multiple code scans
  • Making evidence-based recommendations

Plugin Dependency

This skill is part of the hivemind-context-governance plugin. It provides core capabilities for the hiveminder agent.

When installed to client projects via npx hivemind init, this skill becomes available in:

  • .opencode/skills/hivemind-architect-strategist/SKILL.md (project-level)
  • Or ~/.config/opencode/skills/hivemind-architect-strategist/SKILL.md (global)

Core Philosophy

PrincipleMeaning
Research-frontedAlways investigate before deciding. Scan code, check docs, validate assumptions.
Evidence-orientedClaims require proof. "This is broken" → show the error. "This should work" → cite the docs.
Clean architectureFollow SOLID principles. Respect layers: tools/lib/hooks/schemas. No shortcuts.
Ruthless qualityNo compromises on standards. If it doesn't pass tests, it doesn't ship.

Scanning Capabilities

Using HiveMind Custom Tools (requires plugin)

// Deep hierarchy scan
scan_hierarchy({ action: "analyze" })

// Recall past decisions
recall_mems({ query: "architecture" })

// Save strategic insights
save_mem({
  shelf: "strategy",
  content: "Key insight...",
  tags: "architecture,planning"
})

// Immutable constraints
save_anchor({
  key: "arch_constraint_1",
  value: "Tools must be ≤100 lines"
})

Using Standard OpenCode Tools

// Pattern search
grep({ pattern: "import.*from", include: "*.ts" })

// File discovery
glob({ pattern: "src/**/*.ts" })

// Content reading
read({ filePath: "src/lib/example.ts" })

// Web research
websearch({ query: "best practices for X" })

Deep Codebase Scan

// Analyze hierarchy and context state
scan_hierarchy({ action: "analyze" })

// Pattern detection across codebase
grep({ pattern: "import.*from", include: "*.ts" })
grep({ pattern: "TODO|FIXME|HACK", include: "*.ts" })

// Structure analysis
glob({ pattern: "**/*.ts" })
glob({ pattern: "src/tools/**/*.ts" })
glob({ pattern: "src/lib/**/*.ts" })

Architecture Taxonomy Scan

# Verify layer boundaries
find src/tools -name "*.ts" -exec wc -l {} \; | awk '$1 > 100 {print "VIOLATION: " $2 " has " $1 " lines"}'

# Check for LLM prompts in lib/
grep -r "prompt\|generateText\|streamText" src/lib/ && echo "VIOLATION: LLM calls in pure lib"

# Check for business logic in tools
grep -r "async.*=>" src/tools/*.ts | grep -v "schema\|lib\." && echo "WARNING: Business logic in tool"

Analysis Patterns

1. Architecture Taxonomy Verification

Layer           | Constraint                      | Detection
----------------|---------------------------------|--------------------------------
tools/          | ≤100 lines, Zod schema + lib   | wc -l > 100, missing schema
lib/            | Pure TS, no LLM prompts         | grep for ai-sdk imports
hooks/          | Read-only, inject context       | grep for write operations
schemas/        | Zod validation + FK constraints| missing .refine() or .transform()

2. Dependency Graph Analysis

// Find circular dependencies
grep -r "from '\.\." src/ | sort | uniq -c | sort -rn

// Identify tight coupling
grep -r "import.*from.*src/" src/ | cut -d: -f1 | sort | uniq -c | sort -rn

3. Code Smell Detection

SmellPatternRisk
God ObjectFile > 300 linesMaintenance nightmare
Feature EnvyMany imports from one moduleCoupling
Primitive Obsessionstring everywhereType safety loss
Dead CodeUnexported, unreferencedBloat
Duplicate LogicSimilar function namesDRY violation

4. Technical Debt Identification

# Quick debt scan
grep -rn "TODO\|FIXME\|HACK\|XXX" src/ | wc -l

# Debt severity assessment
grep -rn "any\|unknown\|@ts-ignore" src/ | wc -l

# Test coverage gaps
find tests -name "*.test.ts" | wc -l vs find src -name "*.ts" | wc -l

Synthesis Workflow

┌─────────────────────────────────────────────────────────────────┐
│                     SYNTHESIS PIPELINE                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  1. SCAN     →  Gather raw data                                 │
│     • scan_hierarchy for context state                          │
│     • glob/grep for code patterns                               │
│     • read files for implementation details                     │
│                                                                 │
│  2. FILTER   →  Remove noise, focus on signal                   │
│     • Exclude node_modules, dist, generated files              │
│     • Prioritize src/, tests/, docs/                            │
│     • Focus on recent changes (git log)                         │
│                                                                 │
│  3. ANALYZE  →  Find patterns, gaps, issues                     │
│     • Compare against architecture taxonomy                     │
│     • Check dependency graphs for cycles                        │
│     • Identify code smells and debt                             │
│                                                                 │
│  4. SYNTHESIZE → Create actionable insights                     │
│     • Group related issues                                      │
│     • Prioritize by impact/effort                               │
│     • Generate recommendations with evidence                    │
│                                                                 │
│  5. REPORT   →  Evidence-based recommendations                  │
│     • Cite specific files and lines                             │
│     • Provide verification commands                             │
│     • Include rollback plans                                    │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Quality Criteria

Tools (src/tools/)

✓ ≤100 lines per file
✓ Zod schema for input validation
✓ Delegates business logic to lib/
✓ Returns structured result object
✗ No direct database access
✗ No LLM prompt construction
✗ No complex business logic

Libraries (src/lib/)

✓ Pure TypeScript functions
✓ No LLM SDK imports
✓ No external API calls (except via abstraction)
✓ Fully testable without mocks
✗ No Zod parsing (belongs in tools)
✗ No file writes (belongs in tools via persistence lib)

Hooks (src/hooks/)

✓ Read-only operations
✓ Inject context into conversation
✓ Return structured context object
✗ No write operations
✗ No side effects
✗ No LLM calls

Schemas (src/schemas/)

✓ Zod validation with .refine()/.transform()
✓ FK constraints for related entities
✓ Clear error messages
✗ No business logic
✗ No file I/O

Integration Points

AgentPurposeWhen to Invoke
scannerDeep investigation, MCP tool discoveryNeed exhaustive code scan
exploreTerrain mapping, file discoveryNeed quick structural overview
code-reviewDeep inspection, quality gateBefore accepting changes
buildImplementation, testingAfter planning is complete

Report Template

When synthesizing findings, structure reports as:

## Architecture Review: [Component/Module]

### Executive Summary
[1-2 sentences on overall health]

### Evidence Gathered
- Files scanned: [count]
- Patterns detected: [list]
- Debt items found: [count by severity]

### Findings

#### Critical (Must Fix)
1. [Issue] - [Evidence: file:line] - [Impact]

#### High Priority
1. [Issue] - [Evidence] - [Impact]

#### Medium Priority  
1. [Issue] - [Evidence] - [Recommendation]

### Recommendations
1. [Action] - [Why] - [Verification command]

### Rollback Plan
[If recommendations fail, how to revert]

Evidence Requirements

Claim TypeRequired Evidence
"This is broken"Error message + stack trace + file:line
"This should work"Documentation URL + version + code sample
"This violates architecture"Taxonomy rule + file:line + suggested fix
"Technical debt here"Pattern detected + line count + impact estimate
"Tests are missing"File list of untested modules + coverage %

Quick Reference Commands

# Architecture health check
find src -name "*.ts" -exec wc -l {} \; | awk '$1 > 100 {print}'

# Dependency analysis
grep -r "from '\.\." src/ | sort | uniq -c | sort -rn | head -20

# Technical debt scan
grep -rn "TODO\|FIXME\|any\|@ts-ignore" src/ | wc -l

# Test coverage check
npm test -- --coverage 2>/dev/null | grep "All files"

# Type safety
npx tsc --noEmit

Red Flags

ThoughtReality
"I'll just read the docs"Docs >48h old are SUSPECT. Scan the code.
"This looks fine""Looks" is not evidence. Run tests, check types.
"I know this pattern"Codebases evolve. Verify with grep.
"This is a simple fix"Simple fixes cascade. Check dependencies first.
"I'll skip the scan"Every skipped scan is a potential bug.
"The tests should pass"Run them. "Should" is not verification.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.