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.
In this repository17 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- .github/get-shit-done/templates/copilot-instructions.mdCopilot instructions
- context-first-gatekeepingSkill
- debug-orchestrationSkill
- delegation-intelligenceSkill
- hivefiver-bilingual-tutorSkill
- hivefiver-domain-pack-routerSkill
- hivefiver-gsd-compatSkill
- hivefiver-mcp-research-loopSkill
- hivefiver-persona-routingSkill
- hivefiver-ralph-taskingSkill
- hivefiver-skill-auditorSkill
- hivefiver-spec-distillationSkill
- hivemind-governanceSkill
- parallel-debugging-hivemindSkill
- sequential-orchestrationSkill
- systematic-debugging-hivemindSkill
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
- Very specific: line 27
When installed to client projects via npx hivemind init, this skill becomes available in:
- Distinctive: line 248
When synthesizing findings, structure reports as:
≈ “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.
Files
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
| Principle | Meaning |
| Research-fronted | Always investigate before deciding. Scan code, check docs, validate assumptions. |
| Evidence-oriented | Claims require proof. "This is broken" → show the error. "This should work" → cite the docs. |
| Clean architecture | Follow SOLID principles. Respect layers: tools/lib/hooks/schemas. No shortcuts. |
| Ruthless quality | No 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 -rn3. Code Smell Detection
| Smell | Pattern | Risk |
| God Object | File > 300 lines | Maintenance nightmare |
| Feature Envy | Many imports from one module | Coupling |
| Primitive Obsession | string everywhere | Type safety loss |
| Dead Code | Unexported, unreferenced | Bloat |
| Duplicate Logic | Similar function names | DRY 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 -lSynthesis 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 logicLibraries (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 callsSchemas (src/schemas/)
✓ Zod validation with .refine()/.transform()
✓ FK constraints for related entities
✓ Clear error messages
✗ No business logic
✗ No file I/OIntegration Points
| Agent | Purpose | When to Invoke |
| scanner | Deep investigation, MCP tool discovery | Need exhaustive code scan |
| explore | Terrain mapping, file discovery | Need quick structural overview |
| code-review | Deep inspection, quality gate | Before accepting changes |
| build | Implementation, testing | After 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 Type | Required 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 --noEmitRed Flags
| Thought | Reality |
| "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. |
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
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.

