all-hands-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.allhands/README.md +75 -0
- package/.allhands/agents/compounder.yaml +15 -0
- package/.allhands/agents/coordinator.yaml +17 -0
- package/.allhands/agents/documentor.yaml +15 -0
- package/.allhands/agents/e2e-test-planner.yaml +17 -0
- package/.allhands/agents/emergent.yaml +22 -0
- package/.allhands/agents/executor.yaml +14 -0
- package/.allhands/agents/ideation.yaml +11 -0
- package/.allhands/agents/initiative-steering.yaml +19 -0
- package/.allhands/agents/judge.yaml +13 -0
- package/.allhands/agents/planner.yaml +19 -0
- package/.allhands/agents/pr-reviewer.yaml +15 -0
- package/.allhands/docs.json +5 -0
- package/.allhands/docs.local.json +26 -0
- package/.allhands/flows/COMPOUNDING.md +203 -0
- package/.allhands/flows/COORDINATION.md +89 -0
- package/.allhands/flows/CORE.md +87 -0
- package/.allhands/flows/DOCUMENTATION.md +218 -0
- package/.allhands/flows/E2E_TEST_PLAN_BUILDING.md +140 -0
- package/.allhands/flows/EMERGENT_PLANNING.md +57 -0
- package/.allhands/flows/IDEATION_SCOPING.md +154 -0
- package/.allhands/flows/INITIATIVE_STEERING.md +110 -0
- package/.allhands/flows/JUDGE_REVIEWING.md +79 -0
- package/.allhands/flows/PROMPT_TASK_EXECUTION.md +68 -0
- package/.allhands/flows/PR_REVIEWING.md +43 -0
- package/.allhands/flows/SPEC_PLANNING.md +216 -0
- package/.allhands/flows/harness/WRITING_HARNESS_FLOWS.md +27 -0
- package/.allhands/flows/harness/WRITING_HARNESS_KNOWLEDGE.md +27 -0
- package/.allhands/flows/harness/WRITING_HARNESS_ORCHESTRATION.md +27 -0
- package/.allhands/flows/harness/WRITING_HARNESS_SKILLS.md +27 -0
- package/.allhands/flows/harness/WRITING_HARNESS_TOOLS.md +27 -0
- package/.allhands/flows/harness/WRITING_HARNESS_VALIDATION_TOOLING.md +27 -0
- package/.allhands/flows/shared/CODEBASE_UNDERSTANDING.md +72 -0
- package/.allhands/flows/shared/CREATE_HARNESS_SPEC.md +48 -0
- package/.allhands/flows/shared/CREATE_SPEC.md +41 -0
- package/.allhands/flows/shared/CREATE_VALIDATION_TOOLING_SPEC.md +70 -0
- package/.allhands/flows/shared/DOCUMENTATION_DISCOVERY.md +123 -0
- package/.allhands/flows/shared/DOCUMENTATION_WRITER.md +101 -0
- package/.allhands/flows/shared/EMERGENT_REFINEMENT_ANALYSIS.md +76 -0
- package/.allhands/flows/shared/EXTERNAL_TECH_GUIDANCE.md +97 -0
- package/.allhands/flows/shared/IDEATION_CODEBASE_GROUNDING.md +49 -0
- package/.allhands/flows/shared/PLAN_DEEPENING.md +152 -0
- package/.allhands/flows/shared/PROMPT_TASKS_CURATION.md +113 -0
- package/.allhands/flows/shared/PROMPT_VALIDATION_REVIEW.MD +99 -0
- package/.allhands/flows/shared/QUICK_PREMORTEM.md +70 -0
- package/.allhands/flows/shared/RESEARCH_GUIDANCE.md +38 -0
- package/.allhands/flows/shared/REVIEW_OPTIONS_BREAKDOWN.md +68 -0
- package/.allhands/flows/shared/SKILL_EXTRACTION.md +84 -0
- package/.allhands/flows/shared/SPEC_FLOW_ANALYSIS.md +119 -0
- package/.allhands/flows/shared/TDD_WORKFLOW.md +109 -0
- package/.allhands/flows/shared/UTILIZE_VALIDATION_TOOLING.md +84 -0
- package/.allhands/flows/shared/WRITING_HARNESS_FLOWS.md +11 -0
- package/.allhands/flows/shared/WRITING_HARNESS_MCP_TOOLS.md +84 -0
- package/.allhands/flows/shared/jury/ARCHITECTURE_REVIEW.md +91 -0
- package/.allhands/flows/shared/jury/BEST_PRACTICES_REVIEW.md +80 -0
- package/.allhands/flows/shared/jury/CLAIM_VERIFICATION_REVIEW.md +101 -0
- package/.allhands/flows/shared/jury/EXPECTATIONS_FIT_REVIEW.md +78 -0
- package/.allhands/flows/shared/jury/MAINTAINABILITY_REVIEW.md +110 -0
- package/.allhands/flows/shared/jury/PROMPTS_EXPECTATIONS_FIT.md +74 -0
- package/.allhands/flows/shared/jury/PROMPTS_FLOW_ANALYSIS.md +92 -0
- package/.allhands/flows/shared/jury/PROMPTS_YAGNI.md +78 -0
- package/.allhands/flows/shared/jury/PROMPT_PREMORTEM.md +125 -0
- package/.allhands/flows/shared/jury/SECURITY_REVIEW.md +86 -0
- package/.allhands/flows/shared/jury/YAGNI_REVIEW.md +82 -0
- package/.allhands/flows/wip/DEBUG_INVESTIGATION.md +162 -0
- package/.allhands/flows/wip/MEMORY_RECALL.md +62 -0
- package/.allhands/harness/ah +131 -0
- package/.allhands/harness/package-lock.json +5292 -0
- package/.allhands/harness/package.json +52 -0
- package/.allhands/harness/src/__tests__/e2e/commands.test.ts +307 -0
- package/.allhands/harness/src/__tests__/e2e/event-loop.test.ts +539 -0
- package/.allhands/harness/src/__tests__/e2e/hooks.test.ts +427 -0
- package/.allhands/harness/src/__tests__/e2e/new-initiative-routing.test.ts +137 -0
- package/.allhands/harness/src/__tests__/e2e/run-e2e.ts +109 -0
- package/.allhands/harness/src/__tests__/e2e/specs-type.test.ts +210 -0
- package/.allhands/harness/src/__tests__/e2e/validation-hooks.test.ts +669 -0
- package/.allhands/harness/src/__tests__/e2e/validation-path-consistency.test.ts +354 -0
- package/.allhands/harness/src/__tests__/e2e/validation.test.ts +528 -0
- package/.allhands/harness/src/__tests__/harness/assertions.ts +318 -0
- package/.allhands/harness/src/__tests__/harness/cli-runner.ts +359 -0
- package/.allhands/harness/src/__tests__/harness/fixture.ts +384 -0
- package/.allhands/harness/src/__tests__/harness/hook-runner.ts +411 -0
- package/.allhands/harness/src/__tests__/harness/index.ts +122 -0
- package/.allhands/harness/src/cli.ts +36 -0
- package/.allhands/harness/src/commands/complexity.ts +177 -0
- package/.allhands/harness/src/commands/context7.ts +202 -0
- package/.allhands/harness/src/commands/docs.ts +557 -0
- package/.allhands/harness/src/commands/hooks.ts +24 -0
- package/.allhands/harness/src/commands/index.ts +51 -0
- package/.allhands/harness/src/commands/knowledge.ts +382 -0
- package/.allhands/harness/src/commands/memories.ts +302 -0
- package/.allhands/harness/src/commands/notify.ts +61 -0
- package/.allhands/harness/src/commands/oracle.ts +158 -0
- package/.allhands/harness/src/commands/perplexity.ts +220 -0
- package/.allhands/harness/src/commands/planning.ts +245 -0
- package/.allhands/harness/src/commands/schema.ts +73 -0
- package/.allhands/harness/src/commands/skills.ts +128 -0
- package/.allhands/harness/src/commands/solutions.ts +353 -0
- package/.allhands/harness/src/commands/spawn.ts +158 -0
- package/.allhands/harness/src/commands/specs.ts +532 -0
- package/.allhands/harness/src/commands/tavily.ts +226 -0
- package/.allhands/harness/src/commands/tools.ts +579 -0
- package/.allhands/harness/src/commands/trace.ts +327 -0
- package/.allhands/harness/src/commands/tui.ts +960 -0
- package/.allhands/harness/src/commands/validate.ts +143 -0
- package/.allhands/harness/src/commands/validation-tools.ts +108 -0
- package/.allhands/harness/src/hooks/context.ts +1442 -0
- package/.allhands/harness/src/hooks/enforcement.ts +170 -0
- package/.allhands/harness/src/hooks/index.ts +54 -0
- package/.allhands/harness/src/hooks/lifecycle.ts +229 -0
- package/.allhands/harness/src/hooks/notification.ts +104 -0
- package/.allhands/harness/src/hooks/observability.ts +551 -0
- package/.allhands/harness/src/hooks/session.ts +88 -0
- package/.allhands/harness/src/hooks/shared.ts +815 -0
- package/.allhands/harness/src/hooks/transcript-parser.ts +208 -0
- package/.allhands/harness/src/hooks/validation.ts +617 -0
- package/.allhands/harness/src/lib/__tests__/ctags.test.ts +244 -0
- package/.allhands/harness/src/lib/__tests__/docs-validation.test.ts +344 -0
- package/.allhands/harness/src/lib/__tests__/mcp-runtime.test.ts +190 -0
- package/.allhands/harness/src/lib/__tests__/schema.test.ts +861 -0
- package/.allhands/harness/src/lib/base-command.ts +198 -0
- package/.allhands/harness/src/lib/cli-daemon.ts +343 -0
- package/.allhands/harness/src/lib/compaction.ts +313 -0
- package/.allhands/harness/src/lib/ctags.ts +497 -0
- package/.allhands/harness/src/lib/docs-validation.ts +907 -0
- package/.allhands/harness/src/lib/event-loop.ts +662 -0
- package/.allhands/harness/src/lib/flows.ts +155 -0
- package/.allhands/harness/src/lib/git.ts +276 -0
- package/.allhands/harness/src/lib/knowledge-worker.ts +72 -0
- package/.allhands/harness/src/lib/knowledge.ts +810 -0
- package/.allhands/harness/src/lib/llm.ts +255 -0
- package/.allhands/harness/src/lib/mcp-client.ts +432 -0
- package/.allhands/harness/src/lib/mcp-daemon.ts +486 -0
- package/.allhands/harness/src/lib/mcp-runtime.ts +418 -0
- package/.allhands/harness/src/lib/notification.ts +115 -0
- package/.allhands/harness/src/lib/opencode/index.ts +70 -0
- package/.allhands/harness/src/lib/opencode/profiles.ts +300 -0
- package/.allhands/harness/src/lib/opencode/prompts/codesearch.md +98 -0
- package/.allhands/harness/src/lib/opencode/prompts/knowledge-aggregator.md +67 -0
- package/.allhands/harness/src/lib/opencode/runner.ts +281 -0
- package/.allhands/harness/src/lib/oracle.ts +926 -0
- package/.allhands/harness/src/lib/planning-utils.ts +150 -0
- package/.allhands/harness/src/lib/planning.ts +605 -0
- package/.allhands/harness/src/lib/pr-review.ts +225 -0
- package/.allhands/harness/src/lib/prompts.ts +522 -0
- package/.allhands/harness/src/lib/schema.ts +418 -0
- package/.allhands/harness/src/lib/schemas/agent-profile.ts +141 -0
- package/.allhands/harness/src/lib/schemas/template-vars.ts +138 -0
- package/.allhands/harness/src/lib/session.ts +164 -0
- package/.allhands/harness/src/lib/specs.ts +348 -0
- package/.allhands/harness/src/lib/tldr.ts +829 -0
- package/.allhands/harness/src/lib/tmux.ts +1051 -0
- package/.allhands/harness/src/lib/trace-store.ts +714 -0
- package/.allhands/harness/src/mcp/__tests__/index.test.ts +46 -0
- package/.allhands/harness/src/mcp/_template.ts +47 -0
- package/.allhands/harness/src/mcp/filesystem.ts +33 -0
- package/.allhands/harness/src/mcp/index.ts +69 -0
- package/.allhands/harness/src/mcp/playwright.ts +34 -0
- package/.allhands/harness/src/mcp/xcodebuild.ts +29 -0
- package/.allhands/harness/src/schemas/docs.schema.json +44 -0
- package/.allhands/harness/src/schemas/settings.schema.json +214 -0
- package/.allhands/harness/src/tui/actions.ts +227 -0
- package/.allhands/harness/src/tui/file-viewer-modal.ts +270 -0
- package/.allhands/harness/src/tui/index.ts +1574 -0
- package/.allhands/harness/src/tui/modal.ts +232 -0
- package/.allhands/harness/src/tui/prompts-pane.ts +186 -0
- package/.allhands/harness/src/tui/status-pane.ts +434 -0
- package/.allhands/harness/tsconfig.json +22 -0
- package/.allhands/harness/vitest.config.ts +13 -0
- package/.allhands/pillars.md +33 -0
- package/.allhands/principles.md +88 -0
- package/.allhands/schemas/alignment.yaml +51 -0
- package/.allhands/schemas/documentation.yaml +10 -0
- package/.allhands/schemas/prompt.yaml +92 -0
- package/.allhands/schemas/skill.yaml +34 -0
- package/.allhands/schemas/solution.yaml +131 -0
- package/.allhands/schemas/spec.yaml +67 -0
- package/.allhands/schemas/validation-suite.yaml +49 -0
- package/.allhands/schemas/workflow.yaml +51 -0
- package/.allhands/settings.json +57 -0
- package/.allhands/skills/claude-code-patterns/SKILL.md +60 -0
- package/.allhands/skills/claude-code-patterns/docs/context-hygiene.md +19 -0
- package/.allhands/skills/harness-maintenance/SKILL.md +449 -0
- package/.allhands/skills/harness-maintenance/references/core-architecture.md +187 -0
- package/.allhands/skills/harness-maintenance/references/harness-skills.md +87 -0
- package/.allhands/skills/harness-maintenance/references/knowledge-compounding.md +78 -0
- package/.allhands/skills/harness-maintenance/references/tools-commands-mcp-hooks.md +115 -0
- package/.allhands/skills/harness-maintenance/references/validation-tooling.md +77 -0
- package/.allhands/skills/harness-maintenance/references/writing-flows.md +84 -0
- package/.allhands/validation/browser-automation.md +109 -0
- package/.allhands/validation/xcode-automation.md +195 -0
- package/.allhands/workflows/documentation.md +86 -0
- package/.allhands/workflows/investigation.md +81 -0
- package/.allhands/workflows/milestone.md +91 -0
- package/.allhands/workflows/optimization.md +85 -0
- package/.allhands/workflows/refactor.md +99 -0
- package/.allhands/workflows/triage.md +81 -0
- package/.claude/README.md +1 -0
- package/.claude/agents/explorer.md +10 -0
- package/.claude/agents/researcher.md +11 -0
- package/.claude/agents/task-runner.md +8 -0
- package/.claude/settings.json +231 -0
- package/.env.ai.example +7 -0
- package/.github/workflows/npm-publish.yml +69 -0
- package/.internal.json +45 -0
- package/.tldr/config.json +11 -0
- package/.tldrignore +90 -0
- package/CLAUDE.md +6 -0
- package/README.md +98 -0
- package/bin/sync-cli.js +7552 -0
- package/concerns.md +7 -0
- package/docs/README.md +41 -0
- package/docs/agents/README.md +24 -0
- package/docs/agents/agent-configuration-system.md +86 -0
- package/docs/agents/execution-agents.md +50 -0
- package/docs/agents/knowledge-agents.md +61 -0
- package/docs/agents/orchestration-agent.md +57 -0
- package/docs/agents/planning-agents.md +84 -0
- package/docs/agents/quality-review-agents.md +67 -0
- package/docs/agents/workflow-agent-orchestration.md +69 -0
- package/docs/flows/README.md +44 -0
- package/docs/flows/compounding.md +126 -0
- package/docs/flows/coordination.md +72 -0
- package/docs/flows/core-harness-integration.md +63 -0
- package/docs/flows/documentation-orchestration.md +98 -0
- package/docs/flows/e2e-test-plan-building.md +83 -0
- package/docs/flows/emergent-refinement.md +104 -0
- package/docs/flows/flow-authoring-and-mcp-tools.md +89 -0
- package/docs/flows/judge-reviewing.md +112 -0
- package/docs/flows/plan-deepening-and-research.md +107 -0
- package/docs/flows/plan-review-jury.md +114 -0
- package/docs/flows/pr-reviewing.md +54 -0
- package/docs/flows/prompt-task-execution.md +119 -0
- package/docs/flows/spec-planning.md +162 -0
- package/docs/flows/type-specific-scoping-flows.md +49 -0
- package/docs/flows/validation-and-skills-integration.md +145 -0
- package/docs/flows/wip/wip-flows.md +102 -0
- package/docs/harness/README.md +23 -0
- package/docs/harness/agent-profiles.md +84 -0
- package/docs/harness/cli/README.md +24 -0
- package/docs/harness/cli/cli-entry-and-command-discovery.md +91 -0
- package/docs/harness/cli/docs-command.md +87 -0
- package/docs/harness/cli/knowledge-command.md +91 -0
- package/docs/harness/cli/minor-cli-commands.md +65 -0
- package/docs/harness/cli/oracle-command.md +113 -0
- package/docs/harness/cli/planning-command.md +95 -0
- package/docs/harness/cli/schema-and-validation-commands.md +154 -0
- package/docs/harness/cli/search-commands.md +97 -0
- package/docs/harness/cli/spawn-command.md +136 -0
- package/docs/harness/cli/specs-command.md +102 -0
- package/docs/harness/cli/tools-command.md +122 -0
- package/docs/harness/cli/trace-command.md +122 -0
- package/docs/harness/cli-daemon.md +92 -0
- package/docs/harness/event-loop.md +184 -0
- package/docs/harness/hooks/README.md +15 -0
- package/docs/harness/hooks/context-hooks.md +96 -0
- package/docs/harness/hooks/lifecycle-and-observability-hooks.md +135 -0
- package/docs/harness/hooks/validation-hooks.md +97 -0
- package/docs/harness/test-harness.md +149 -0
- package/docs/harness/tui.md +176 -0
- package/docs/memories.md +20 -0
- package/docs/solutions/agentic-issues/premature-agent-deletion-tui-action-dependency-20260130.md +49 -0
- package/docs/solutions/agentic-issues/ref-anchor-scope-mismatch-skill-references-20260131.md +55 -0
- package/docs/solutions/agentic-issues/tautological-tests-routing-20260131.md +52 -0
- package/docs/solutions/integration_issue/blocktool-output-format-mismatch-hook-runner-20260130.md +52 -0
- package/docs/solutions/integration_issue/dual-validation-path-divergence-schema-20260130.md +66 -0
- package/docs/solutions/security-issues/unsanitized-domain-path-join-20260131.md +52 -0
- package/docs/solutions/test-failures/event-loop-mock-ordering-checkAgentWindows-20260130.md +63 -0
- package/docs/sync-cli/README.md +19 -0
- package/docs/sync-cli/cli-entrypoint-and-commands.md +39 -0
- package/docs/sync-cli/commands/README.md +11 -0
- package/docs/sync-cli/commands/pull-manifest-command.md +36 -0
- package/docs/sync-cli/commands/push-command.md +84 -0
- package/docs/sync-cli/commands/sync-command.md +71 -0
- package/docs/sync-cli/systems/README.md +14 -0
- package/docs/sync-cli/systems/git-and-github-integration.md +49 -0
- package/docs/sync-cli/systems/interactive-ui.md +43 -0
- package/docs/sync-cli/systems/manifest-and-distribution.md +51 -0
- package/docs/sync-cli/systems/path-resolution.md +42 -0
- package/package.json +46 -0
- package/scripts/install-shim.sh +40 -0
- package/scripts/pre-pack.sh +25 -0
- package/specs/harness-maintenance-skill.spec.md +138 -0
- package/specs/roadmap/git-spec-lifecycle-management.spec.md +113 -0
- package/specs/sync-init-flag.spec.md +117 -0
- package/specs/unified-workflow-orchestration.spec.md +250 -0
- package/specs/validation-tooling-practice.spec.md +98 -0
- package/specs/workflow-domain-configuration.spec.md +265 -0
- package/src/commands/pull-manifest.ts +31 -0
- package/src/commands/push.ts +344 -0
- package/src/commands/sync.ts +289 -0
- package/src/lib/constants.ts +10 -0
- package/src/lib/dotfiles.ts +36 -0
- package/src/lib/fs-utils.ts +18 -0
- package/src/lib/gh.ts +40 -0
- package/src/lib/git.ts +63 -0
- package/src/lib/gitignore.ts +167 -0
- package/src/lib/manifest.ts +121 -0
- package/src/lib/marker-sync.ts +39 -0
- package/src/lib/paths.ts +38 -0
- package/src/lib/target-lines.ts +66 -0
- package/src/lib/ui.ts +78 -0
- package/src/sync-cli.ts +120 -0
- package/target-lines.json +23 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Type-aware spec lifecycle from engineer ideation through codebase grounding, spec creation, and planning -- milestone specs get deep planning with jury review, exploratory specs get lightweight scoping with seed prompts"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Spec Planning
|
|
6
|
+
|
|
7
|
+
Spec planning is the harness's front door. Before any prompt is written or any code is generated, an engineer's intent must be captured, grounded in codebase reality, and structured into an actionable plan. Milestone specs go through a full ideation session; all other spec types enter through type-specific scoping flows. Both paths converge at spec persistence, after which the spec `type` field drives planning depth.
|
|
8
|
+
|
|
9
|
+
## Ideation-to-Execution Lifecycle
|
|
10
|
+
|
|
11
|
+
```mermaid
|
|
12
|
+
flowchart TD
|
|
13
|
+
A[Engineer arrives with initiative] --> B{Spec type?}
|
|
14
|
+
B -->|milestone| C[Ideation Session]
|
|
15
|
+
B -->|other types| SC[Type-Specific Scoping]
|
|
16
|
+
C --> D[Codebase Grounding + Interview]
|
|
17
|
+
D --> E[Write Spec]
|
|
18
|
+
SC --> E
|
|
19
|
+
E --> F[Persist Spec + Create Branch]
|
|
20
|
+
F --> G{Start now?}
|
|
21
|
+
G -->|No| H[Saved for later]
|
|
22
|
+
G -->|Yes| I{Spec type?}
|
|
23
|
+
I -->|milestone| J[Milestone Planning]
|
|
24
|
+
I -->|exploratory| K[Exploratory Planning]
|
|
25
|
+
J --> L[Deep Research + Interview + Jury]
|
|
26
|
+
L --> M[5-15 Prompts Ready]
|
|
27
|
+
K --> N[Focused Research + Seed Prompts]
|
|
28
|
+
N --> O[0-3 Prompts Ready]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Phase 1: Ideation Session (Milestone Only)
|
|
32
|
+
|
|
33
|
+
[ref:.allhands/flows/IDEATION_SESSION.md::4eddba4]
|
|
34
|
+
|
|
35
|
+
The ideation session is an interview-driven process grounded in the principle of **Ideation First**: front-load exploration to prevent low-level decision fatigue during implementation. Non-milestone specs bypass ideation and enter through [type-specific scoping flows](type-specific-scoping-flows.md) instead.
|
|
36
|
+
|
|
37
|
+
### Parallel Grounding
|
|
38
|
+
|
|
39
|
+
While the interview proceeds, parallel subtasks run codebase and research exploration:
|
|
40
|
+
|
|
41
|
+
| Subtask Type | Flow | Purpose |
|
|
42
|
+
|-------------|------|---------|
|
|
43
|
+
| Codebase grounding (1-3 tasks) | [ref:.allhands/flows/shared/IDEATION_CODEBASE_GROUNDING.md::ff98c47] | Discover existing implementations, roadmap dependencies, and hard constraints |
|
|
44
|
+
| Research (0-2 tasks) | [ref:.allhands/flows/shared/RESEARCH_GUIDANCE.md::eb9185c] | Find high-level solution approaches for novel problems |
|
|
45
|
+
|
|
46
|
+
The grounding subtask overlays codebase findings against the roadmap, distinguishing between what exists now and what is planned -- because ideation must account for future state, not just current state.
|
|
47
|
+
|
|
48
|
+
### Interview Dimensions
|
|
49
|
+
|
|
50
|
+
The interview elicits six dimensions: goals, motivations, concerns, desires, capabilities, and expectations. Each has dedicated deep-dive categories (UX, data/state, technical, scale, integrations, security) with knowledge gap detection signals that trigger deeper probing.
|
|
51
|
+
|
|
52
|
+
Key design decision: questions are asked **one at a time**. This prevents cognitive overload and allows the agent to adapt each question based on prior answers -- a deliberate application of **Context is Precious** to the human side.
|
|
53
|
+
|
|
54
|
+
### Preference Language
|
|
55
|
+
|
|
56
|
+
Specs use calibrated language that preserves engineer intent fidelity:
|
|
57
|
+
|
|
58
|
+
| Engineer Signal | Spec Language |
|
|
59
|
+
|----------------|---------------|
|
|
60
|
+
| Strong preference | "Engineer desires X" / "Engineer expects X" |
|
|
61
|
+
| Flexible preference | "Engineer likes X but open to alternatives" |
|
|
62
|
+
| Just an idea | "Engineer proposes X, open-ended for architect" |
|
|
63
|
+
| No opinion | Left in Open Questions |
|
|
64
|
+
|
|
65
|
+
This matters because downstream planning agents use this language to determine how much latitude they have.
|
|
66
|
+
|
|
67
|
+
## Spec Creation and Persistence
|
|
68
|
+
|
|
69
|
+
[ref:.allhands/flows/shared/CREATE_SPEC.md::e145081]
|
|
70
|
+
|
|
71
|
+
The spec is written to `specs/roadmap/{name}.spec.md`, persisted via `ah specs persist`, and its branch is created. The roadmap is reindexed so future ideation sessions can discover this spec as a dependency.
|
|
72
|
+
|
|
73
|
+
### Spec Variants
|
|
74
|
+
|
|
75
|
+
Not all specs follow the ideation interview. Several specialized spec types exist:
|
|
76
|
+
|
|
77
|
+
| Spec Type | Flow | Trigger |
|
|
78
|
+
|-----------|------|---------|
|
|
79
|
+
| Harness improvement | [ref:.allhands/flows/shared/CREATE_HARNESS_SPEC.md::c486457] | Compounding identifies systemic harness issues |
|
|
80
|
+
| Validation tooling | [ref:.allhands/flows/shared/CREATE_VALIDATION_TOOLING_SPEC.md::9750183] | Gap analysis reveals missing validation infrastructure |
|
|
81
|
+
| Investigation | [ref:.allhands/flows/INVESTIGATION_SCOPING.md::4eddba4] | Engineer scopes a hypothesis-driven diagnosis |
|
|
82
|
+
| Optimization | [ref:.allhands/flows/OPTIMIZATION_SCOPING.md::4eddba4] | Engineer scopes a performance improvement |
|
|
83
|
+
| Refactor | [ref:.allhands/flows/REFACTOR_SCOPING.md::4eddba4] | Engineer scopes a structural transformation |
|
|
84
|
+
| Documentation | [ref:.allhands/flows/DOCUMENTATION_SCOPING.md::4eddba4] | Engineer scopes a documentation effort |
|
|
85
|
+
| Triage | [ref:.allhands/flows/TRIAGE_SCOPING.md::4eddba4] | Engineer scopes an externally-signaled issue |
|
|
86
|
+
|
|
87
|
+
Harness and validation specs follow `CREATE_SPEC.md` for persistence but have distinct interview formats. The five scoping flows (investigation through triage) each conduct a type-specific interview before delegating to `CREATE_SPEC.md`. See [type-specific-scoping-flows](type-specific-scoping-flows.md) for details.
|
|
88
|
+
|
|
89
|
+
### Optional: Flow Analysis
|
|
90
|
+
|
|
91
|
+
[ref:.allhands/flows/shared/SPEC_FLOW_ANALYSIS.md::513806f]
|
|
92
|
+
|
|
93
|
+
For user-facing features with multiple paths, the spec can be analyzed for user flow completeness. This identifies missing flows, ambiguous transitions, undefined error states, and scope boundaries -- all presented as questions, not mandates.
|
|
94
|
+
|
|
95
|
+
## Planning Depth by Spec Type
|
|
96
|
+
|
|
97
|
+
[ref:.allhands/flows/SPEC_PLANNING.md::cc0b192]
|
|
98
|
+
|
|
99
|
+
Per **Frontier Models are Capable**, the spec `type` field determines planning depth. This branching happens after spec persistence, when planning begins:
|
|
100
|
+
|
|
101
|
+
| Spec Type | Planning Path | Research Depth | Interview | Jury | Output |
|
|
102
|
+
|-----------|--------------|----------------|-----------|------|--------|
|
|
103
|
+
| `milestone` (or missing) | Milestone Planning | 1-4 deep subtasks | Full decision interview | Yes | 5-15 prompts + detailed alignment doc |
|
|
104
|
+
| `investigation` | Exploratory Planning | 1-2 focused subtasks | Open questions only (skippable) | No | 0-3 seed prompts + problem-focused alignment doc |
|
|
105
|
+
| `optimization` | Exploratory Planning | 1-2 focused subtasks | Open questions only (skippable) | No | 0-3 seed prompts + problem-focused alignment doc |
|
|
106
|
+
| `refactor` | Exploratory Planning | 1-2 focused subtasks | Open questions only (skippable) | No | 0-3 seed prompts + problem-focused alignment doc |
|
|
107
|
+
| `documentation` | Exploratory Planning | 1-2 focused subtasks | Open questions only (skippable) | No | 0-3 seed prompts + problem-focused alignment doc |
|
|
108
|
+
| `triage` | Exploratory Planning | 1-2 focused subtasks | Open questions only (skippable) | No | 0-3 seed prompts + problem-focused alignment doc |
|
|
109
|
+
|
|
110
|
+
## Phase 2: Spec Planning -- Milestone Path
|
|
111
|
+
|
|
112
|
+
Planning transforms the spec into executable prompts. This is where **Quality Engineering** takes over: the question shifts from "what does the engineer want?" to "which implementation approach is best?"
|
|
113
|
+
|
|
114
|
+
### Research Before Options
|
|
115
|
+
|
|
116
|
+
Planning spawns parallel research subtasks before presenting any options:
|
|
117
|
+
|
|
118
|
+
| Research Type | Flow | Purpose |
|
|
119
|
+
|--------------|------|---------|
|
|
120
|
+
| Codebase understanding (1-4 tasks) | [ref:.allhands/flows/shared/CODEBASE_UNDERSTANDING.md::b10cce8] | Ground implementation approaches in existing patterns |
|
|
121
|
+
| Solution research (0-3 tasks) | [ref:.allhands/flows/shared/RESEARCH_GUIDANCE.md::eb9185c] | Isolate optimal solutions for novel problems |
|
|
122
|
+
| External tech (as needed) | [ref:.allhands/flows/shared/EXTERNAL_TECH_GUIDANCE.md::9766b03] | Acquire documentation and implementation guidance |
|
|
123
|
+
|
|
124
|
+
### Disposable Variant Architecture
|
|
125
|
+
|
|
126
|
+
When the engineer selects multiple approaches for the same decision point, the planning agent creates variant prompts that execute in parallel behind feature flags. This is a direct application of **Quality Engineering**: software is cheap, so multiple variants can be tested rather than debated.
|
|
127
|
+
|
|
128
|
+
The planning agent is the only agent authorized to architect variant prompt structures. This prevents downstream agents from creating uncoordinated variants.
|
|
129
|
+
|
|
130
|
+
### Plan Verification
|
|
131
|
+
|
|
132
|
+
Before jury review, the planner self-verifies across five dimensions: requirement coverage, task completeness, key links planned (components wiring together), scope sanity (2-3 tasks per prompt, fewer than 7 files), and validation coverage.
|
|
133
|
+
|
|
134
|
+
### Plan Review Jury
|
|
135
|
+
|
|
136
|
+
The plan passes through a jury of four specialized reviewers before execution begins. See the [plan-review-jury documentation](plan-review-jury.md) for details on this pre-execution review gate.
|
|
137
|
+
|
|
138
|
+
## Phase 2: Spec Planning -- Exploratory Path
|
|
139
|
+
|
|
140
|
+
Exploratory planning is intentionally lightweight. Per **Frontier Models are Capable**, exploratory specs leave room for hypothesis-driven discovery by the emergent planner rather than pre-specifying all work upfront.
|
|
141
|
+
|
|
142
|
+
### Focused Research
|
|
143
|
+
|
|
144
|
+
1-2 targeted research subtasks grounded in the specific problem domain. External research is only spawned if the spec references external tools or novel approaches.
|
|
145
|
+
|
|
146
|
+
### Engineer Scope Narrowing
|
|
147
|
+
|
|
148
|
+
Open questions from the spec are presented to the engineer via `AskUserQuestion`. Each question can be answered to narrow scope or skipped -- skipped questions remain open for hypothesis-driven discovery. The interview is kept brief; exploratory specs intentionally leave room for discovery.
|
|
149
|
+
|
|
150
|
+
### Seed Prompt Creation
|
|
151
|
+
|
|
152
|
+
0-3 seed prompts created as testable hypotheses grounded in research findings. These target the most concrete, immediately actionable aspects of the spec. Remaining open questions are left for the emergent planner to design experiments around.
|
|
153
|
+
|
|
154
|
+
### Exploratory Alignment Doc
|
|
155
|
+
|
|
156
|
+
The alignment doc for exploratory specs emphasizes the problem space over the solution:
|
|
157
|
+
|
|
158
|
+
- **Overview**: Problem statement, evidence, context, and unresolved questions -- the emergent planner reads these to design experiments
|
|
159
|
+
- **Hard User Requirements**: Success criteria and constraints
|
|
160
|
+
- **Engineer Decisions**: Only deviations from recommendations
|
|
161
|
+
|
|
162
|
+
Unresolved questions (skipped interview questions, open spec questions) are documented prominently. Per **Knowledge Compounding**, this enables the emergent planner to discover and test answers through hypothesis-driven work.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Type-specific scoping flows for the unified initiative system -- five interview-driven flows that capture engineer intent for investigation, optimization, refactor, documentation, and triage specs before delegating to the shared spec creation pipeline"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Type-Specific Scoping Flows
|
|
6
|
+
|
|
7
|
+
The harness supports six spec types: milestone, investigation, optimization, refactor, documentation, and triage. Milestone specs enter through the ideation session (see [spec-planning](spec-planning.md)). The remaining five types each have a dedicated scoping flow that interviews the engineer and delegates to the shared spec creation pipeline.
|
|
8
|
+
|
|
9
|
+
## Shared Pattern
|
|
10
|
+
|
|
11
|
+
All five scoping flows follow a two-phase structure:
|
|
12
|
+
|
|
13
|
+
1. **Scoping Interview** -- Ask targeted questions via `AskUserQuestion`, one at a time. Per **Frontier Models are Capable**, the agent adapts depth based on engineer responses -- probing vague answers, skipping questions already addressed.
|
|
14
|
+
2. **Spec Creation** -- Synthesize interview answers into spec content (Motivation, Goals, Technical Considerations, Open Questions), set the `type` field in spec frontmatter, and delegate to [ref:.allhands/flows/shared/CREATE_SPEC.md::e145081] for persistence.
|
|
15
|
+
|
|
16
|
+
The interview dimensions differ per type because each problem class has distinct information needs. An investigation needs evidence and symptoms; an optimization needs baselines and targets.
|
|
17
|
+
|
|
18
|
+
## Per-Type Interview Dimensions
|
|
19
|
+
|
|
20
|
+
| Spec Type | Flow | Questions | Key Dimensions |
|
|
21
|
+
|-----------|------|-----------|----------------|
|
|
22
|
+
| Investigation | [ref:.allhands/flows/INVESTIGATION_SCOPING.md::4eddba4] | 5 | Symptom description, evidence/reproduction, success criteria, constraints, suspected root causes |
|
|
23
|
+
| Optimization | [ref:.allhands/flows/OPTIMIZATION_SCOPING.md::4eddba4] | 5 | Bottleneck identification, performance targets, measurement approach, baseline metrics, constraints |
|
|
24
|
+
| Refactor | [ref:.allhands/flows/REFACTOR_SCOPING.md::4eddba4] | 5 | Scope boundaries, invariants to preserve, target architecture, migration strategy, constraints |
|
|
25
|
+
| Documentation | [ref:.allhands/flows/DOCUMENTATION_SCOPING.md::4eddba4] | 4 | Coverage areas, target audience, existing docs state, format and location |
|
|
26
|
+
| Triage | [ref:.allhands/flows/TRIAGE_SCOPING.md::4eddba4] | 3 | External signals, impact and urgency, desired outcome (stub) |
|
|
27
|
+
|
|
28
|
+
### Triage: Stub Status
|
|
29
|
+
|
|
30
|
+
The triage scoping flow is a manual-input stub. Full external source integration (PostHog, Sentry, PagerDuty) is deferred to a future spec. Engineers paste or summarize external signals rather than the harness pulling them automatically.
|
|
31
|
+
|
|
32
|
+
## Branch Prefix Convention
|
|
33
|
+
|
|
34
|
+
Each spec type maps to a default branch prefix when the spec does not specify one explicitly. The `branch` field on the spec is always the source of truth.
|
|
35
|
+
|
|
36
|
+
| Spec Type | Branch Prefix |
|
|
37
|
+
|-----------|---------------|
|
|
38
|
+
| `milestone` (or missing) | `feature/` |
|
|
39
|
+
| `investigation` | `fix/` |
|
|
40
|
+
| `optimization` | `optimize/` |
|
|
41
|
+
| `refactor` | `refactor/` |
|
|
42
|
+
| `documentation` | `docs/` |
|
|
43
|
+
| `triage` | `triage/` |
|
|
44
|
+
|
|
45
|
+
These conventions are defined in [ref:.allhands/flows/shared/CREATE_SPEC.md::e145081] and applied during `ah specs persist`.
|
|
46
|
+
|
|
47
|
+
## Downstream Impact
|
|
48
|
+
|
|
49
|
+
Scoped specs flow into type-aware planning. Per [spec-planning](spec-planning.md), milestone specs receive deep planning with jury review (5-15 prompts), while all other types receive exploratory planning (1-2 research subtasks, 0-3 seed prompts). The spec `type` field set during scoping drives this branching.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Validation practice model (stochastic vs deterministic dimensions, crystallization lifecycle, suite existence threshold), suite discovery, domain skills extraction, and TDD methodology during prompt execution"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Validation and Skills Integration
|
|
6
|
+
|
|
7
|
+
These three shared flows form the quality infrastructure that prompt curation and execution depend on. They are invoked as sub-flows -- typically from prompt curation -- to ensure every prompt carries the right validation suites, domain expertise, and testing methodology.
|
|
8
|
+
|
|
9
|
+
## Two-Dimensional Validation Practice Model
|
|
10
|
+
|
|
11
|
+
Per **Agentic Validation Tooling**, every validation domain has two first-class dimensions:
|
|
12
|
+
|
|
13
|
+
| Dimension | Nature | Phase | Purpose |
|
|
14
|
+
|-----------|--------|-------|---------|
|
|
15
|
+
| **Stochastic** | Agent-driven exploratory testing using model intuition | During implementation | Probe edge cases, test user flows, verify quality beyond deterministic checks |
|
|
16
|
+
| **Deterministic** | Binary pass/fail gating | Acceptance criteria | CI/CD-enforceable commands that gate completion |
|
|
17
|
+
|
|
18
|
+
These dimensions map to suite body sections: **Stochastic Validation** teaches agents how to explore; **Deterministic Integration** provides the commands that gate acceptance criteria.
|
|
19
|
+
|
|
20
|
+
### Suite Existence Threshold
|
|
21
|
+
|
|
22
|
+
A validation suite MUST have a meaningful stochastic dimension to justify existing. Per [ref:.allhands/principles.md::0610b13], deterministic-only tools (type checking, linting, formatting) are test commands referenced directly in acceptance criteria and CI/CD -- they are NOT suites.
|
|
23
|
+
|
|
24
|
+
### Crystallization Lifecycle
|
|
25
|
+
|
|
26
|
+
Stochastic exploration and deterministic gating are connected by a compounding lifecycle:
|
|
27
|
+
|
|
28
|
+
```mermaid
|
|
29
|
+
stateDiagram-v2
|
|
30
|
+
[*] --> StochasticExploration: Agent discovers patterns
|
|
31
|
+
StochasticExploration --> PatternStabilization: Repeatable pattern emerges
|
|
32
|
+
PatternStabilization --> DeterministicCheck: Crystallization promotion
|
|
33
|
+
DeterministicCheck --> CICD: Entrenched in pipeline
|
|
34
|
+
CICD --> StochasticExploration: Exploration shifts to frontier
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Per [ref:.allhands/flows/COMPOUNDING.md::905aed8], the compounding flow evaluates crystallization during its Tooling Signals phase and promotes stable stochastic patterns into deterministic checks during Harness Improvement.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## How These Flows Connect
|
|
42
|
+
|
|
43
|
+
```mermaid
|
|
44
|
+
flowchart TD
|
|
45
|
+
PC[Prompt Curation] -->|"What validation applies?"| VT[Utilize Validation Tooling]
|
|
46
|
+
PC -->|"What domain expertise applies?"| SE[Skill Extraction]
|
|
47
|
+
PE[Prompt Execution] -->|"How to implement?"| TDD[TDD Workflow]
|
|
48
|
+
|
|
49
|
+
VT -->|validation_suites frontmatter| PF[Prompt File]
|
|
50
|
+
SE -->|skills frontmatter + embedded guidance| PF
|
|
51
|
+
TDD -->|test-first implementation| Code[Implementation]
|
|
52
|
+
|
|
53
|
+
VT -.- VTN["Programmatic acceptance criteria"]
|
|
54
|
+
SE -.- SEN["Domain expertise for executor"]
|
|
55
|
+
TDD -.- TDDN["RED → GREEN → REFACTOR"]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Validation Tooling Discovery
|
|
61
|
+
|
|
62
|
+
[ref:.allhands/flows/shared/UTILIZE_VALIDATION_TOOLING.md::1df56ac]
|
|
63
|
+
|
|
64
|
+
This flow matches implementation tasks to existing validation suites. Per **Agentic Validation Tooling**, programmatic validation replaces human supervision for routine checks.
|
|
65
|
+
|
|
66
|
+
### Discovery Pipeline
|
|
67
|
+
|
|
68
|
+
1. **Discover**: Run `ah validation-tools list` to get available suites (name, description, globs, file path, `tools`)
|
|
69
|
+
2. **Match**: Two parallel approaches:
|
|
70
|
+
- Glob pattern matching against files being touched
|
|
71
|
+
- Semantic inference from suite descriptions against task nature
|
|
72
|
+
- The `tools` field identifies which tooling each suite wraps -- useful for matching against available MCP tools and installed CLI commands
|
|
73
|
+
3. **Read**: For each matched suite, read its body sections:
|
|
74
|
+
- **Stochastic Validation** -- how agents explore quality during implementation
|
|
75
|
+
- **Deterministic Integration** -- CI-gated commands for acceptance criteria
|
|
76
|
+
4. **Integrate**: Derive acceptance criteria from **Deterministic Integration** commands; use **Stochastic Validation** during implementation. Add suite paths to `validation_suites` frontmatter.
|
|
77
|
+
5. **Gap analysis**: Document unmatched validation needs for future `CREATE_VALIDATION_TOOLING`
|
|
78
|
+
|
|
79
|
+
### Validation Ordering
|
|
80
|
+
|
|
81
|
+
Acceptance criteria (deterministic dimension) are ordered progressively to fail fast:
|
|
82
|
+
|
|
83
|
+
> Compiles --> Unit tests --> Integration tests --> E2E
|
|
84
|
+
|
|
85
|
+
Stochastic exploration during implementation is not ordered -- agents follow model intuition to probe quality.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Skill Extraction
|
|
90
|
+
|
|
91
|
+
[ref:.allhands/flows/shared/SKILL_EXTRACTION.md::03a6816]
|
|
92
|
+
|
|
93
|
+
This flow finds and distills domain expertise from skill files into actionable prompt guidance. Per **Knowledge Compounding**, skills are "how to do it right" -- expertise that compounds across prompts.
|
|
94
|
+
|
|
95
|
+
### Extraction Pipeline
|
|
96
|
+
|
|
97
|
+
1. **Discover**: Run `ah skills list` to get available skills (name, description, globs, file path)
|
|
98
|
+
2. **Match**: Same dual approach as validation -- glob patterns and semantic inference
|
|
99
|
+
3. **Read**: Extract key patterns, best practices, and references from each `.allhands/skills/<name>/SKILL.md`
|
|
100
|
+
4. **Synthesize**: Distill task-relevant knowledge (not full skill file copies)
|
|
101
|
+
5. **Embed**: Add skill paths to `skills` frontmatter and embed guidance in prompt Tasks section
|
|
102
|
+
|
|
103
|
+
### Key Distinction from Validation
|
|
104
|
+
|
|
105
|
+
| Aspect | Validation Suites | Skills |
|
|
106
|
+
|--------|------------------|--------|
|
|
107
|
+
| What they provide | Commands to verify correctness | Knowledge to implement correctly |
|
|
108
|
+
| When they apply | After implementation (checking) | During implementation (guiding) |
|
|
109
|
+
| Output location | `validation_suites` frontmatter | `skills` frontmatter + prompt body |
|
|
110
|
+
| Who consumes them | Validation runners | Prompt executors |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## TDD Workflow
|
|
115
|
+
|
|
116
|
+
[ref:.allhands/flows/shared/TDD_WORKFLOW.md::8d9b5d8]
|
|
117
|
+
|
|
118
|
+
This flow applies test-driven development to prompt execution. Per **Agentic Validation Tooling**, tests written first create clear acceptance criteria and prevent scope drift.
|
|
119
|
+
|
|
120
|
+
### The Cycle
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
RED --> GREEN --> REFACTOR
|
|
124
|
+
| | |
|
|
125
|
+
| | +-- Improve code quality (tests still pass)
|
|
126
|
+
| +-- Write minimal code to pass tests
|
|
127
|
+
+-- Write failing tests from acceptance criteria
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### When to Apply
|
|
131
|
+
|
|
132
|
+
| Context | TDD Depth |
|
|
133
|
+
|---------|-----------|
|
|
134
|
+
| High-risk domains (auth, payments, data) | Full -- every acceptance criterion tested first |
|
|
135
|
+
| Core business logic | Full -- tests define behavior |
|
|
136
|
+
| UI components | Light -- key interactions tested |
|
|
137
|
+
| Integration glue code | Light -- happy path + error cases |
|
|
138
|
+
| Scripts/utilities | Optional -- judgment call |
|
|
139
|
+
| Exploratory/spike work | Skip -- write tests after if keeping |
|
|
140
|
+
| Pure UI layout changes | Skip -- visual review sufficient |
|
|
141
|
+
| Configuration changes | Skip -- integration test coverage |
|
|
142
|
+
|
|
143
|
+
### Test Evidence
|
|
144
|
+
|
|
145
|
+
TDD produces test evidence tables that map acceptance criteria to specific tests and their pass/fail status. This evidence feeds into prompt summaries and ultimately into the compounding flow for knowledge extraction.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Work-in-progress flows for structured debug investigation and memory recall, not yet integrated into the milestone workflow"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Work-in-Progress Flows
|
|
6
|
+
|
|
7
|
+
These flows are under active development. They define useful capabilities but lack finalized integration points with the milestone workflow. Both are usable standalone but their invocation paths from other flows are TBD.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Debug Investigation
|
|
12
|
+
|
|
13
|
+
[ref:.allhands/flows/wip/DEBUG_INVESTIGATION.md::8d96611]
|
|
14
|
+
|
|
15
|
+
A structured investigation methodology for complex bugs with unclear root causes. Per **Agentic Validation Tooling**, systematic debugging beats random exploration.
|
|
16
|
+
|
|
17
|
+
### Investigation Phases
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart TD
|
|
21
|
+
S[Symptom Gathering] --> H[Hypothesis Formation]
|
|
22
|
+
H --> I[Investigation]
|
|
23
|
+
I -->|confirmed| RC[Root Cause Confirmation]
|
|
24
|
+
I -->|inconclusive| H
|
|
25
|
+
I -->|refuted| H
|
|
26
|
+
RC --> F[Fix Recommendation]
|
|
27
|
+
F --> D[Documentation]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The flow enforces a discipline: gather symptoms before hypothesizing, verify hypotheses with evidence before concluding, never guess at root cause without verification.
|
|
31
|
+
|
|
32
|
+
### Hypothesis-Driven Approach
|
|
33
|
+
|
|
34
|
+
Each investigation cycle produces structured evidence:
|
|
35
|
+
|
|
36
|
+
| Phase | Output |
|
|
37
|
+
|-------|--------|
|
|
38
|
+
| Symptom Gathering | Error messages, reproduction steps, frequency, recent changes |
|
|
39
|
+
| Hypothesis Formation | 2-3 ranked hypotheses with confidence, supporting/contradicting evidence, verification method |
|
|
40
|
+
| Investigation | Per-hypothesis file examination, findings, and conclusion (confirmed / refuted / inconclusive) |
|
|
41
|
+
| Root Cause | Description, location, evidence chain, explanation of why other hypotheses were wrong |
|
|
42
|
+
|
|
43
|
+
### Common Debug Patterns
|
|
44
|
+
|
|
45
|
+
The flow includes a reference table mapping symptom patterns to likely causes:
|
|
46
|
+
|
|
47
|
+
| Symptom | First Check |
|
|
48
|
+
|---------|-------------|
|
|
49
|
+
| Works locally, fails in CI | Environment diff: vars, paths, deps |
|
|
50
|
+
| Intermittent failures | Race condition: async timing, shared state |
|
|
51
|
+
| Started after deploy | Recent changes: git diff from last working |
|
|
52
|
+
| Only affects some users | Data-dependent: user data differences |
|
|
53
|
+
| Works sometimes on refresh | Caching: cache invalidation logic |
|
|
54
|
+
|
|
55
|
+
### Potential Integration Approaches
|
|
56
|
+
|
|
57
|
+
Integration with the milestone workflow is under consideration via four paths:
|
|
58
|
+
1. Patch prompt type (`type: debug`) following this flow
|
|
59
|
+
2. Pre-implementation phase when initial execution fails
|
|
60
|
+
3. Emergent debug when emergent refinement hits blockers
|
|
61
|
+
4. Coordinator service option in the coordination flow
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Memory Recall
|
|
66
|
+
|
|
67
|
+
[ref:.allhands/flows/wip/MEMORY_RECALL.md::38dd927]
|
|
68
|
+
|
|
69
|
+
A query interface for the simple memory file at `docs/memories.md`. Per **Knowledge Compounding**, memories enable reuse of solutions without re-discovery.
|
|
70
|
+
|
|
71
|
+
### Memory Format
|
|
72
|
+
|
|
73
|
+
Memories use a table format with four columns:
|
|
74
|
+
|
|
75
|
+
| Column | Values |
|
|
76
|
+
|--------|--------|
|
|
77
|
+
| Name | Short identifier |
|
|
78
|
+
| Domain | `planning`, `validation`, `implementation`, `harness-tooling`, `ideation` |
|
|
79
|
+
| Source | `user-steering` (engineer directed) or `agent-inferred` (discovered during work) |
|
|
80
|
+
| Description | 1-3 sentences of self-contained learning |
|
|
81
|
+
|
|
82
|
+
### Recall Process
|
|
83
|
+
|
|
84
|
+
1. Read `docs/memories.md`
|
|
85
|
+
2. Filter by domain if provided
|
|
86
|
+
3. Scan descriptions for keyword relevance
|
|
87
|
+
4. Return matching memories with context
|
|
88
|
+
|
|
89
|
+
### Relevance Scoring
|
|
90
|
+
|
|
91
|
+
Memories are prioritized by domain match, keyword overlap, and source authority (`user-steering` outranks `agent-inferred` for preference-based queries).
|
|
92
|
+
|
|
93
|
+
### Caller Flows
|
|
94
|
+
|
|
95
|
+
| Flow | Query Focus |
|
|
96
|
+
|------|-------------|
|
|
97
|
+
| Spec Planning | Planning patterns, past decisions |
|
|
98
|
+
| Prompt Execution | Implementation approaches, solutions |
|
|
99
|
+
| Ideation Session | Similar initiatives, prior engineer preferences |
|
|
100
|
+
| Compounding | Verify memory doesn't already exist before adding |
|
|
101
|
+
|
|
102
|
+
For detailed technical solutions beyond lightweight memories, the recall flow also directs callers to `ah solutions search`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Harness domain documentation covering the ah CLI commands, hook system, TUI, event loop, agent profiles, CLI daemon, and test infrastructure."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Harness
|
|
6
|
+
|
|
7
|
+
The `ah` CLI is the core tool for agent orchestration. It provides commands, hooks, a terminal UI, and supporting systems.
|
|
8
|
+
|
|
9
|
+
## CLI Commands
|
|
10
|
+
|
|
11
|
+
Commands registered via filesystem auto-discovery. See `docs/harness/cli/README.md` for the full list.
|
|
12
|
+
|
|
13
|
+
## Hooks
|
|
14
|
+
|
|
15
|
+
Pre/post tool hooks that inject context, validate schemas, enforce rules, and manage agent lifecycle. See `docs/harness/hooks/README.md`.
|
|
16
|
+
|
|
17
|
+
## Systems
|
|
18
|
+
|
|
19
|
+
- **TUI** — Blessed-based terminal interface with three-pane layout, modal system, and vim-style navigation: `docs/harness/tui.md`
|
|
20
|
+
- **Event Loop** — Background polling for prompt dispatch, agent monitoring, PR review detection, and branch state: `docs/harness/event-loop.md`
|
|
21
|
+
- **Agent Profiles** — YAML profile loading, template resolution, and invocation building: `docs/harness/agent-profiles.md`
|
|
22
|
+
- **CLI Daemon** — Unix socket server for fast hook execution, bypassing CLI startup overhead: `docs/harness/cli-daemon.md`
|
|
23
|
+
- **Test Harness** — E2E test infrastructure with fixtures, runners, and assertions: `docs/harness/test-harness.md`
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "YAML-defined agent profiles that configure how agents are spawned from the TUI, including template variable resolution, flow file binding, invocation building, and the OpenCode SDK runner for sub-agent execution."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Agent Profiles
|
|
6
|
+
|
|
7
|
+
Agent profiles are YAML declarations that define how agents are configured and spawned. They decouple agent behavior (what flows and system prompts to use) from orchestration (how and when to spawn). The TUI reads profiles to populate its action menu and build the correct invocation for each agent type.
|
|
8
|
+
|
|
9
|
+
## Profile Loading
|
|
10
|
+
|
|
11
|
+
Profiles live in the `.allhands/harness/agents/` directory as YAML files.
|
|
12
|
+
|
|
13
|
+
[ref:.allhands/harness/src/lib/opencode/profiles.ts:loadAgentProfile:ef20442] loads a single profile by name: reads the YAML, validates it against `RawAgentProfileSchema` via Zod, normalizes it with `normalizeProfile`, and runs semantic validation with `validateProfileSemantics`. Returns `null` if the file is missing or validation fails.
|
|
14
|
+
|
|
15
|
+
[ref:.allhands/harness/src/lib/opencode/profiles.ts:listAgentProfiles:ef20442] enumerates all `.yaml` / `.yml` files in the agents directory, returning profile names (filenames without extensions).
|
|
16
|
+
|
|
17
|
+
[ref:.allhands/harness/src/lib/opencode/profiles.ts:loadAllProfiles:ef20442] loads every profile, collecting both valid profiles and per-profile error/warning lists. The TUI calls this at startup to validate the entire profile set and report issues in the activity log.
|
|
18
|
+
|
|
19
|
+
## TUI Action Mapping
|
|
20
|
+
|
|
21
|
+
[ref:.allhands/harness/src/lib/opencode/profiles.ts:getProfilesByTuiAction:ef20442] builds a `Map<string, AgentProfile[]>` keyed by TUI action ID (e.g., "coordinator", "planner", "ideation"). Each TUI action button can trigger one or more agent profiles -- for example, a "planner" action might spawn both a planning agent and a dependency-check agent.
|
|
22
|
+
|
|
23
|
+
This mapping is what connects the TUI's action pane to actual agent configurations.
|
|
24
|
+
|
|
25
|
+
## Template Resolution
|
|
26
|
+
|
|
27
|
+
Profiles use template variables (e.g., `{{spec_name}}`, `{{branch}}`, `{{planning_dir}}`) in their system prompts, flow paths, and arguments. [ref:.allhands/harness/src/lib/opencode/profiles.ts:resolveTemplate:ef20442] performs string substitution using a `TemplateContext` object.
|
|
28
|
+
|
|
29
|
+
The context is validated at invocation time via `validateContext` from the template-vars schema, ensuring all required variables are provided before spawning. Missing variables produce clear error messages rather than silently passing `{{undefined}}` tokens to agents.
|
|
30
|
+
|
|
31
|
+
## Invocation Building
|
|
32
|
+
|
|
33
|
+
[ref:.allhands/harness/src/lib/opencode/profiles.ts:buildAgentInvocation:ef20442] transforms a profile + context into a concrete `AgentInvocation` -- the fully resolved command, arguments, environment variables, and system prompt ready for tmux execution.
|
|
34
|
+
|
|
35
|
+
[ref:.allhands/harness/src/lib/opencode/profiles.ts:buildAgentInvocationByName:ef20442] is a convenience wrapper that loads the profile by name and builds the invocation in one call.
|
|
36
|
+
|
|
37
|
+
Before building, [ref:.allhands/harness/src/lib/opencode/profiles.ts:validateProfileFlowExists:ef20442] verifies that the flow file referenced by the profile actually exists on disk. Flow files live in [ref:.allhands/harness/src/lib/opencode/profiles.ts:getFlowsDir:ef20442] (`.allhands/flows/`). This catches stale profile-to-flow references at spawn time rather than mid-execution.
|
|
38
|
+
|
|
39
|
+
## Agent Runner (OpenCode SDK)
|
|
40
|
+
|
|
41
|
+
[ref:.allhands/harness/src/lib/opencode/runner.ts:AgentRunner:c3a3694] provides a different execution model: instead of spawning agents in tmux windows, it runs sub-agents programmatically via the OpenCode SDK. This is used for internal harness tasks (oracle analysis, knowledge aggregation) that need structured JSON output.
|
|
42
|
+
|
|
43
|
+
### Execution Flow
|
|
44
|
+
|
|
45
|
+
```mermaid
|
|
46
|
+
sequenceDiagram
|
|
47
|
+
participant Caller
|
|
48
|
+
participant Runner as AgentRunner
|
|
49
|
+
participant SDK as OpenCode SDK
|
|
50
|
+
participant Agent
|
|
51
|
+
|
|
52
|
+
Caller->>Runner: run(config, userMessage)
|
|
53
|
+
Runner->>SDK: createOpencode({port: 0})
|
|
54
|
+
SDK-->>Runner: client + server
|
|
55
|
+
Runner->>SDK: session.create()
|
|
56
|
+
Runner->>SDK: session.prompt(systemPrompt, noReply)
|
|
57
|
+
Runner->>SDK: session.prompt(userMessage)
|
|
58
|
+
SDK->>Agent: Execute
|
|
59
|
+
Agent-->>SDK: Response (possibly with EXPAND: requests)
|
|
60
|
+
|
|
61
|
+
loop Expansion (max 3)
|
|
62
|
+
Runner->>Runner: hasExpansionRequest?
|
|
63
|
+
Runner->>Runner: readFiles(paths)
|
|
64
|
+
Runner->>SDK: session.prompt(expandedContent)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
Runner->>Runner: parseStructuredOutput<T>()
|
|
68
|
+
Runner-->>Caller: AgentResult<T>
|
|
69
|
+
Runner->>SDK: server.close()
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Key Design Decisions
|
|
73
|
+
|
|
74
|
+
**Port 0 allocation** -- Each `run()` call spawns a fresh OpenCode server on an OS-assigned port, enabling parallel sub-agent execution without port conflicts.
|
|
75
|
+
|
|
76
|
+
**Expansion protocol** -- Agents can request file contents by including `EXPAND: path/to/file` lines in their response. The runner reads those files (with 1MB size limit) and sends them back, up to 3 expansion rounds. This lets agents pull in context incrementally rather than requiring all files upfront.
|
|
77
|
+
|
|
78
|
+
**Structured output parsing** -- Responses are parsed as JSON, first trying code block extraction (`\`\`\`json ... \`\`\``), then raw parse. If parsing fails, the runner sends one retry prompt requesting JSON format before reporting failure.
|
|
79
|
+
|
|
80
|
+
**Model resolution** -- Uses the profile's `config.model` if set, falls back to `settings.opencodeSdk.model`, then to the OpenCode SDK default. This three-tier precedence lets operators override models at the project level while profiles can pin specific models for specialized tasks.
|
|
81
|
+
|
|
82
|
+
## Module Structure
|
|
83
|
+
|
|
84
|
+
[ref:.allhands/harness/src/lib/opencode/index.ts::20598fd] is the barrel export that re-exports profile functions and the `AgentRunner` class. It also defines the shared type interfaces (`AgentConfig`, `AgentResult`, `McpServerConfig`, `SearchResult`, `AggregatorInput`, `AggregatorOutput`) used across the harness for agent communication.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Index of all ah CLI command documentation covering entry point, planning, knowledge, schema validation, specs, oracle, spawn, tools, search, docs, trace, and minor utilities."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# CLI Commands
|
|
6
|
+
|
|
7
|
+
All commands are auto-discovered from the filesystem and registered via Commander.js. See `docs/harness/cli/cli-entry-and-command-discovery.md` for the discovery mechanism.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
| Command Area | Doc |
|
|
12
|
+
|---|---|
|
|
13
|
+
| Entry point and command discovery | `docs/harness/cli/cli-entry-and-command-discovery.md` |
|
|
14
|
+
| Planning directories and status | `docs/harness/cli/planning-command.md` |
|
|
15
|
+
| Semantic knowledge search | `docs/harness/cli/knowledge-command.md` |
|
|
16
|
+
| Schema and validation | `docs/harness/cli/schema-and-validation-commands.md` |
|
|
17
|
+
| Spec file management | `docs/harness/cli/specs-command.md` |
|
|
18
|
+
| LLM-powered PR and analysis | `docs/harness/cli/oracle-command.md` |
|
|
19
|
+
| Agent spawning via tmux | `docs/harness/cli/spawn-command.md` |
|
|
20
|
+
| MCP tool integration | `docs/harness/cli/tools-command.md` |
|
|
21
|
+
| Solution, memory, and web search | `docs/harness/cli/search-commands.md` |
|
|
22
|
+
| Documentation validation | `docs/harness/cli/docs-command.md` |
|
|
23
|
+
| Observability and tracing | `docs/harness/cli/trace-command.md` |
|
|
24
|
+
| Skills, notify, complexity | `docs/harness/cli/minor-cli-commands.md` |
|