From harness-claude
Advises on architecture for new features, modules, refactoring, or system boundaries by asking questions, surfacing trade-offs, and presenting options. Does not execute.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Cognitive mode: **advisory-guide**. Ask questions, surface trade-offs, present options. Do NOT execute. The human decides; you inform the decision.
Evaluates architecture decisions, documents trade-offs in ADRs, selects patterns based on context like team size, scale, and quality attributes such as performance and scalability.
Translates PRDs into system architecture via interactive workflow: loads product specs.md, iterates decisions with options/discussion, outputs documented architecture.md. Handles Groundwork monorepos.
Evaluates architectural decisions: reviews existing ADRs, defines context/options, analyzes trade-offs with pros/cons tables, researches via GitHub/GitLab/Azure DevOps, produces new ADRs per template.
Share bugs, ideas, or general feedback.
Cognitive mode: advisory-guide. Ask questions, surface trade-offs, present options. Do NOT execute. The human decides; you inform the decision.
on_new_feature triggers fire and the feature touches multiple modulesThis skill advises. It does not execute.
You will research, analyze, and present options with clear trade-offs. You will not write production code, create files, or make architectural choices. The human makes the decision. You document it.
If you find yourself writing implementation code, STOP. You have left advisory mode. Return to presenting options.
Architecture artifacts (discovery, analysis, proposals, ADRs) are human-facing documentation and live under the project's docs directory — NOT under .harness/ (which is reserved for tool state like debug sessions, graph data, and baselines).
Resolve the storage root as follows:
docsDir from harness.config.json at the project root. If present, use <docsDir>/architecture/ (e.g. docsDir: "./docs" → docs/architecture/).harness.config.json is absent or has no docsDir, default to docs/architecture/..harness/architecture/ directory exists from a prior version of this skill, surface this to the human and offer to migrate it via git mv .harness/architecture <docsDir>/architecture before proceeding.All path references below use <docs>/architecture/ as shorthand for the resolved location.
Gate: This phase requires human answers. Do not proceed to Phase 2 until the human has responded.
Ask these 5 questions. Wait for answers before proceeding.
What problem are you solving? Describe the user-facing or system-facing need. Not the technical solution — the problem.
What are your hard constraints? Things that cannot change: existing database, specific language/framework, compliance requirements, team size, timeline, budget.
What are your soft preferences? Things you would like but could trade away: specific patterns, technology preferences, performance targets, consistency with other systems.
What have you already considered? Any approaches you have thought about, tried, or rejected. Include why you rejected them if applicable.
What does success look like in 6 months? How will you know this decision was correct? What would make you regret it?
Record the answers verbatim. Do not paraphrase or interpret at this stage.
Store answers in: <docs>/architecture/<topic>/discovery.md
Read-only research constraint: This phase is discovery, not solution design. You may read files, search patterns, trace dependencies, and record observations. You may NOT propose solutions, recommend approaches, or evaluate trade-offs. If you catch yourself writing "we could..." or "one option is...", STOP — you have left research mode. Save solutions for Phase 3.
Read the codebase to understand the current state. Do not propose solutions yet — gather facts.
Run detect_constraint_emergence to discover implicit architectural patterns that should be formalized as constraints. Run detect_stale_constraints to identify constraints that no longer apply or need updating. Check get_decay_trends to understand how architectural health has evolved and which areas are degrading fastest. Run predict_failures to forecast which constraints are most likely to be violated based on current trends.
Search for how the codebase currently handles similar concerns:
Find where the new feature will touch existing code:
Look for existing issues that may affect the decision:
## Codebase Analysis: <topic>
### Current Patterns
- <pattern 1>: used in <locations>
- <pattern 2>: used in <locations>
### Integration Points
- <module A>: <how it connects>
- <module B>: <how it connects>
### Technical Debt
- <issue 1>: <impact on this decision>
- <issue 2>: <impact on this decision>
### Relevant Files
- <path>: <why it matters>
Store analysis in: <docs>/architecture/<topic>/analysis.md
When a knowledge graph exists at .harness/graph/, use graph queries for faster, more accurate context:
query_graph — discover how similar features are structured in the codebasesearch_similar — find analogous patterns and implementationsReplaces manual Glob/Grep exploration with graph pattern discovery. Fall back to file-based commands if no graph is available.
Gate: This phase requires human choice at the end. Do not proceed to Phase 4 until the human has selected an option.
Present 2-3 architectural options. Never present only one option — a single option is not a decision, it is a directive. Never present more than 3 — too many options cause decision paralysis.
### Option [A/B/C]: <Name>
**Summary:** One paragraph describing the approach.
**How it works:**
1. <Step 1>
2. <Step 2>
3. <Step 3>
**Pros:**
- <Advantage 1> — <why it matters given the constraints>
- <Advantage 2> — <why it matters given the constraints>
**Cons:**
- <Disadvantage 1> — <severity: low/medium/high> — <mitigation if any>
- <Disadvantage 2> — <severity: low/medium/high> — <mitigation if any>
**Effort:** <Small / Medium / Large> — <rough description of what is involved>
**Risk:** <Low / Medium / High> — <what could go wrong>
**Best when:** <the scenario where this option is clearly the right choice>
After presenting all options, provide a direct comparison:
| Criterion | Option A | Option B | Option C |
| ---------------- | -------- | -------- | -------- |
| Complexity | | | |
| Performance | | | |
| Maintainability | | | |
| Effort to build | | | |
| Effort to change | | | |
| Risk | | | |
| Fits constraints | | | |
State which option you would lean toward and why, but frame it as a recommendation, not a decision:
Based on the constraints (especially <key constraint>), I would lean toward Option <X> because <reason>.
However, if <condition>, Option <Y> would be stronger.
Present the options to the human and wait for their choice.
Store proposal in: <docs>/architecture/<topic>/proposal.md
After the human selects an option, write a formal ADR.
# ADR-<number>: <Title>
**Date:** <date>
**Status:** Accepted
**Deciders:** <who was involved>
## Context
<What is the problem or need that prompted this decision? Include relevant
background, constraints, and the current state of the system. A reader who
was not part of the discussion should understand why this decision was needed.>
## Decision
<What is the architectural decision? State it clearly and specifically.
Include enough detail that someone could implement it without further
discussion.>
## Alternatives Considered
### <Alternative 1 name>
<Brief description and why it was not chosen.>
### <Alternative 2 name>
<Brief description and why it was not chosen.>
## Consequences
### Positive
- <Benefit 1>
- <Benefit 2>
### Negative
- <Trade-off 1> — <mitigation plan>
- <Trade-off 2> — <mitigation plan>
### Neutral
- <Side effect that is neither positive nor negative>
## Action Items
- [ ] <Concrete next step 1> — owner: <who> — by: <when>
- [ ] <Concrete next step 2> — owner: <who> — by: <when>
- [ ] <Concrete next step 3> — owner: <who> — by: <when>
Save the ADR:
<docs>/architecture/<topic>/ADR-<number>.md
Also link from the project's ADR index if one exists.
<docs>/architecture/ (resolved from harness.config.json docsDir, default docs/architecture/) for consistencyWhen this skill makes claims about existing code, architecture, or behavior, it MUST cite evidence using one of:
file:line format (e.g., src/auth.ts:42)file with description (e.g., src/utils/hash.ts —
"existing bcrypt wrapper")evidence session section via manage_stateUncited claims: Technical assertions without citations MUST be prefixed with
[UNVERIFIED]. Example: [UNVERIFIED] The auth middleware supports refresh tokens.
These apply to ALL skills. If you catch yourself doing any of these, STOP.
These reasoning patterns sound plausible but lead to bad outcomes. Reject them.
| Rationalization | Reality |
|---|---|
| "This will be easier to maintain" | Easier for whom, and compared to what? Cite the maintenance burden with evidence from the codebase. |
| "It's the modern approach" | Modernity is not a design criterion. Fitness for purpose is. State the specific benefit. |
| "Other teams do it this way" | Other teams have different constraints. Evaluate the option on this codebase's specific merits. |
| "I can see the solution already, no need to finish research" | Premature convergence anchors on the first viable option. Complete Phase 2 research before proposing anything in Phase 3. The best option may not be the first one found. |
Phase 1 — DISCOVER:
1. Problem: We need to expose order history to mobile clients and third-party integrations.
2. Hard constraints: Must work with existing PostgreSQL database. REST API already
serves other resources. Team of 3 backend engineers. Ship in 6 weeks.
3. Soft preferences: Would like to use GraphQL eventually. Want pagination.
Want to keep response times under 200ms.
4. Already considered: Adding REST endpoints like the other resources. Wondered
about GraphQL but unsure if it is worth the investment for one resource.
5. Success in 6 months: Mobile app and 2 integrations consuming the API without
complaints about performance or missing data.
Phase 2 — ANALYZE:
Current patterns: REST with Express, controller-service-repository layers.
15 existing resources follow this pattern.
Integration points: Order model joins with Users and Products.
Existing /users and /products endpoints.
Tech debt: No pagination on existing endpoints — they return all records.
This is fine for small datasets but orders could be large.
Phase 3 — PROPOSE:
Option A: REST endpoints following existing patterns. Add pagination.
Option B: GraphQL for orders only, REST for everything else.
Option C: REST with sparse fieldsets (JSON:API style ?fields=id,total,date).
Recommendation: Option A with pagination. It ships fastest, matches the existing codebase, and the team can migrate to GraphQL later as a separate initiative when there are more consumers with diverse needs.
Phase 4 — DOCUMENT: ADR written after human selects Option A. Action items: implement pagination middleware (reusable for other endpoints), create /orders endpoints, update API documentation.
Phase 1 — DISCOVER:
1. Problem: The dashboard page component is 1200 lines and growing. It handles
data fetching, state management, filtering, sorting, and rendering for
5 different widget types.
2. Hard constraints: React with TypeScript. Must not break existing widget
behavior. Cannot change the API contract — backend team is on a different
release cycle.
3. Soft preferences: Want widgets to be independently testable. Want to add
2 new widget types next quarter without touching the main component.
4. Already considered: Just splitting into smaller files. Worried that without
a clear boundary, it will re-tangle.
5. Success in 6 months: Adding a new widget type requires creating one new
file and registering it, not modifying the dashboard component.
Phase 2 — ANALYZE:
Current patterns: Dashboard uses a single useEffect for all data fetching.
State is a large object with fields for each widget type. Rendering uses
a switch statement on widget type.
Integration points: 3 API endpoints supply data. Shared filter context
affects all widgets. URL query params drive initial state.
Tech debt: Two widget types share copy-pasted filtering logic. The sort
function has special cases for each widget type.
Phase 3 — PROPOSE:
Option A: Widget plugin architecture with a registry.
Option B: Compound component pattern with slots.
Option C: Micro-frontend approach with module federation.
Recommendation: Option A. The plugin registry provides the clear boundary you need to prevent re-tangling, and the upfront cost pays off immediately when you add the 2 new widget types next quarter. Option C is overengineered for your scale.
Phase 4 — DOCUMENT: ADR written after human selects Option A. Action items: define widget interface contract, extract existing widgets one at a time (one PR per widget), create registry with type-safe registration, add documentation for "how to add a new widget."