opencode-skills-collection 3.0.46 → 3.0.47

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.
Files changed (71) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +10 -1
  2. package/bundled-skills/2slides-ppt-generator/SKILL.md +1 -1
  3. package/bundled-skills/2slides-ppt-generator/scripts/create_pdf_slides.py +2 -1
  4. package/bundled-skills/2slides-ppt-generator/scripts/generate_narration.py +2 -1
  5. package/bundled-skills/2slides-ppt-generator/scripts/generate_slides.py +13 -7
  6. package/bundled-skills/android-dev/references/hybrid.md +7 -4
  7. package/bundled-skills/android-dev/references/react-native.md +5 -2
  8. package/bundled-skills/atlas-contract/SKILL.md +4 -4
  9. package/bundled-skills/atlas-ledger/SKILL.md +10 -7
  10. package/bundled-skills/bun-development/SKILL.md +1 -1
  11. package/bundled-skills/cloud-penetration-testing/SKILL.md +1 -1
  12. package/bundled-skills/codebase-to-wordpress-converter/SKILL.md +1 -0
  13. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  14. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  15. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  16. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  17. package/bundled-skills/docs/users/bundles.md +1 -1
  18. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  19. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  20. package/bundled-skills/docs/users/getting-started.md +1 -1
  21. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  22. package/bundled-skills/docs/users/usage.md +4 -4
  23. package/bundled-skills/docs/users/visual-guide.md +4 -4
  24. package/bundled-skills/dos-verify-done-claims/SKILL.md +173 -0
  25. package/bundled-skills/ecl-harness-engineer/LICENSE +21 -0
  26. package/bundled-skills/ecl-harness-engineer/SKILL.md +714 -0
  27. package/bundled-skills/ecl-harness-engineer/agents/analyzer.md +119 -0
  28. package/bundled-skills/ecl-harness-engineer/agents/auditor.md +212 -0
  29. package/bundled-skills/ecl-harness-engineer/agents/creator-config.md +343 -0
  30. package/bundled-skills/ecl-harness-engineer/agents/creator-docs.md +201 -0
  31. package/bundled-skills/ecl-harness-engineer/agents/creator-linters.md +123 -0
  32. package/bundled-skills/ecl-harness-engineer/references/adapters/adapter-schema.md +204 -0
  33. package/bundled-skills/ecl-harness-engineer/references/adapters/generic.md +156 -0
  34. package/bundled-skills/ecl-harness-engineer/references/adapters/go.md +212 -0
  35. package/bundled-skills/ecl-harness-engineer/references/adapters/java.md +205 -0
  36. package/bundled-skills/ecl-harness-engineer/references/adapters/python.md +225 -0
  37. package/bundled-skills/ecl-harness-engineer/references/adapters/rust.md +220 -0
  38. package/bundled-skills/ecl-harness-engineer/references/adapters/typescript.md +245 -0
  39. package/bundled-skills/ecl-harness-engineer/references/architecture-diagrams.md +420 -0
  40. package/bundled-skills/ecl-harness-engineer/references/audit-templates.md +649 -0
  41. package/bundled-skills/ecl-harness-engineer/references/capability-registry.md +485 -0
  42. package/bundled-skills/ecl-harness-engineer/references/darwin-eval-prompts.md +373 -0
  43. package/bundled-skills/ecl-harness-engineer/references/documentation-templates.md +741 -0
  44. package/bundled-skills/ecl-harness-engineer/references/durability-patterns.md +423 -0
  45. package/bundled-skills/ecl-harness-engineer/references/ecl-harness.md +1431 -0
  46. package/bundled-skills/ecl-harness-engineer/references/environment-config-guide.md +534 -0
  47. package/bundled-skills/ecl-harness-engineer/references/environment-detection-guide.md +751 -0
  48. package/bundled-skills/ecl-harness-engineer/references/eval-templates.md +377 -0
  49. package/bundled-skills/ecl-harness-engineer/references/gc-templates.md +798 -0
  50. package/bundled-skills/ecl-harness-engineer/references/greenfield-templates.md +1385 -0
  51. package/bundled-skills/ecl-harness-engineer/references/linter-templates.md +448 -0
  52. package/bundled-skills/ecl-harness-engineer/references/observability-templates.md +315 -0
  53. package/bundled-skills/environment-setup-guide/SKILL.md +2 -2
  54. package/bundled-skills/evolution/SKILL.md +1 -1
  55. package/bundled-skills/gitops-workflow/SKILL.md +1 -1
  56. package/bundled-skills/linkerd-patterns/SKILL.md +1 -1
  57. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +504 -1317
  58. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +2 -2
  59. package/bundled-skills/lovable-cleanup/SKILL.md +416 -0
  60. package/bundled-skills/monopoly/SKILL.md +397 -0
  61. package/bundled-skills/monopoly/patterns/SKILL.md +331 -0
  62. package/bundled-skills/monopoly/scale-benchmarks/SKILL.md +174 -0
  63. package/bundled-skills/monopoly/security-checklist/SKILL.md +69 -0
  64. package/bundled-skills/monopoly/tech-matrix/SKILL.md +268 -0
  65. package/bundled-skills/pagespeed-enhancer/SKILL.md +579 -0
  66. package/bundled-skills/polis-protocol/SKILL.md +6 -3
  67. package/bundled-skills/unship/SKILL.md +11 -5
  68. package/bundled-skills/uv-package-manager/resources/implementation-playbook.md +1 -1
  69. package/bundled-skills/varlock/SKILL.md +2 -2
  70. package/package.json +1 -1
  71. package/skills_index.json +204 -4
@@ -0,0 +1,201 @@
1
+ # Documentation Creation Agent
2
+
3
+ You are creating or updating harness documentation files for a codebase.
4
+
5
+ ## Input
6
+
7
+ You will receive:
8
+ - Architecture analysis data (from `harness/.analysis/architecture.json`)
9
+ - Audit data showing what exists and what's missing (from `harness/.analysis/audit.json`)
10
+ - Delta list of files to create/update
11
+
12
+ ## Files You May Create/Update
13
+
14
+ ### AGENTS.md
15
+
16
+ The project entry map for AI agents. This is the most important file. It must help a
17
+ new agent understand the target project first, then explain the harness workflow.
18
+
19
+ **Target**: 80-120 lines. This is a map, not a manual.
20
+
21
+ **Structure**:
22
+ ```
23
+ Line 1-15: Project snapshot: what it is, who uses it, core workflow, runtime shape
24
+ Line 16-35: Core workflow/domain model: real product or system concepts
25
+ Line 36-55: Where to work: task-to-source map with actual directories/modules
26
+ Line 56-75: Context loading: AGENTS.md, docs/ECL.md, active change if present, otherwise auto-evolve pending reminder if present, otherwise STATUS, then task-specific project docs
27
+ Line 76-95: Development + verification commands
28
+ Line 96-120: Safety boundaries and generated harness notes
29
+ ```
30
+
31
+ **Rules**:
32
+ - The first screen must be project-first, not harness-first. It should answer:
33
+ "What does this project do?", "What is the main user/system workflow?", and
34
+ "Where would an agent start for common changes?"
35
+ - Extract project identity from `README.md`, entry points, route files, schemas/models,
36
+ package manifests, and key source directories. Do not infer only from harness files.
37
+ - Include real product/domain concepts when they exist: workflows, entities, API resources,
38
+ user-facing modules, jobs, commands, or data models.
39
+ - Harness/ECL belongs in context-loading or development-discipline sections. It must not
40
+ dominate Quick Start or replace project knowledge.
41
+ - Project identity and ECL constraints must not compete: keep the first screen project-first,
42
+ but make context loading preserve ECL priority. The order must be `AGENTS.md`,
43
+ `docs/ECL.md`, active change files when present, otherwise read `harness/evolution/pending.md`
44
+ as a maintenance reminder when it exists, otherwise `docs/STATUS.md`, then README/architecture/design/reference docs.
45
+ - State that active change constraints are the current task source of truth and override
46
+ generic project guidance and `docs/STATUS.md` for that task.
47
+ - State that `docs/STATUS.md` is a soft handoff file used only when no active change exists.
48
+ It should point to recent archive context, but it must not trigger default full-archive loading.
49
+ - State that `harness/evolution/pending.md`, when present and no active change exists, should be
50
+ read before ordinary STATUS resume work as pending maintenance. Reading it does not start
51
+ auto-evolve, must not block ordinary user work, and should not cause full-archive loading. Codex
52
+ should ask whether to handle the pending maintenance now unless the user already prioritized the
53
+ current task.
54
+ - Historical archive loading must be selective: start from `docs/STATUS.md` paths or
55
+ `harness/changes/INDEX.json`, read archived `summary.md` first, and read spec/plan/tasks/reviews
56
+ only for debugging, review, or explicit resume work.
57
+ - Never write skill-internal boundaries into the target project. Do not add sections or
58
+ sentences that describe this skill's own execution limits as if they were project rules.
59
+ - Safety boundaries must be project-level: secrets, generated outputs, uploads, unrelated
60
+ user edits, migrations, and verification discipline. Agents may modify business code when
61
+ the user's task requires it.
62
+ - Every link must point to a doc that actually exists
63
+ - Include real package names from architecture analysis
64
+ - Don't embed detailed explanations — link to docs/
65
+ - Link to `docs/ECL.md` for the change lifecycle and context loading protocol
66
+ - Mention `harness/changes/active/` as the current task context, not as a manual
67
+ - Keep only a short change trigger in AGENTS.md; put the detailed lifecycle in `docs/ECL.md`.
68
+ Typical triggers: APIs, database schema, architecture, permissions, cross-module behavior,
69
+ multi-file changes, or other non-trivial work.
70
+
71
+ ### docs/ECL.md
72
+
73
+ The project operating manual for Evolution Constraint Language (ECL).
74
+
75
+ **Must include**:
76
+ - When to create a change and when small fixes can skip it
77
+ - Small Change vs Structured Change: small low-risk edits may skip active changes; structured work
78
+ uses active change files and review gates
79
+ - A compact decision tree: existing active change wins; obvious copy/comment/README/local single-file
80
+ fixes are Small; APIs/data/permissions/architecture/multi-module/runtime/unclear work is
81
+ Structured; unclear impact requires read-only investigation before deciding
82
+ - Intake Review: support requirement-first and plan-first inputs, ask at most three high-impact
83
+ questions per round, and record assumptions or `[NEEDS CLARIFICATION: ...]` in `spec.md`
84
+ - Plan-first completeness rule: a complete user plan that does not conflict with repository evidence
85
+ should not trigger a repeated interview; conflicts or missing acceptance/security/data/compatibility
86
+ details return to Intake Review
87
+ - Single-active lifecycle: `active/`, `parking/`, `archive/`
88
+ - Stage-boundary update protocol for `summary.md`, `spec.md`, `plan.md`, `tasks.md`, and `reviews/`
89
+ - Spec/plan separation: `spec.md` is WHAT/WHY, `plan.md` is HOW and planning-discovered spec gaps
90
+ - Plan review gate: do not enter implementation until `summary.md` records `plan_review: approved` or `reviews/` contains an equivalent approved plan review
91
+ - Context load order: AGENTS.md, ECL, active change, relevant docs, generated INDEX.json, selected history
92
+ - Auto-evolve handling: `harness-change close/reindex` may generate `harness/evolution/pending.md`;
93
+ pending is a maintenance reminder, not a hard lock; Codex should ask whether to handle it when no
94
+ active change exists
95
+ - Auto-evolve independent review boundary: generated scripts create pending context only and do not
96
+ spawn subagents; the Codex run handling pending evolution requests independent review when
97
+ available; user approval to handle pending implies permission to request auditor/subagent review
98
+ when available, and if the environment still requires explicit authorization Codex asks once
99
+ before falling back to `eval_mode=dry_run` and no auto-apply
100
+ - Auto-evolve completion rule: once Codex starts pending evolution by creating/using an
101
+ `auto-evolve-harness-*` change, writing a proposal/result, or editing Harness files from pending
102
+ evidence, it must finish with proposal + `results.tsv` + `harness-evolve mark-complete`; otherwise
103
+ park/block instead of closing completed
104
+ - Auto-evolve evidence freshness: before processing pending, rebuild `INDEX.json` and use the
105
+ current eligible archive window; old Candidate Archives are a trigger snapshot only
106
+ - Failure feedback: failed tests/lints become constraints, tasks, or regression notes
107
+ - Script commands: `harness-change new/status/validate/park/resume/close/search/context/reindex` and `harness-evolve check/collect/mark-complete`
108
+ - Rule that `harness/changes/INDEX.json` is generated by scripts and must not be hand-edited
109
+
110
+ Use `references/ecl-harness.md` for the default text and templates.
111
+
112
+ ### docs/STATUS.md
113
+
114
+ The lightweight handoff summary for current project state. Create it when adding or updating ECL.
115
+
116
+ **Target**: 40-80 lines. This is a resume map, not a changelog.
117
+
118
+ **Must include**:
119
+ - A first-line warning that active change files override this file when present
120
+ - Current active work or "none"
121
+ - Last completed change path, normally the archived `summary.md`
122
+ - Next recommended work
123
+ - Known residual risks or blockers
124
+ - Latest quality gate state
125
+ - Context resume instructions that point to `docs/ECL.md`, active change, `docs/STATUS.md`, and selected archive summaries
126
+ - Auto-evolve pending status when `harness/evolution/pending.md` exists
127
+
128
+ **Rules**:
129
+ - Update `docs/STATUS.md` before closing an active change with completed work, validation,
130
+ risks, and next step.
131
+ - After `harness-change close`, update it again with the final archive path.
132
+ - If `harness/evolution/pending.md` exists after close and no active task is present, mention it as
133
+ pending maintenance and ask whether to handle it now unless the user task is already prioritized;
134
+ do not treat read-only context loading or asking as started auto-evolve.
135
+ - Do not let CI or hooks auto-write STATUS; they may only validate it.
136
+ - Never treat STATUS as more authoritative than `harness/changes/active/`.
137
+ - Do not store full history in STATUS; keep formal history in `harness/changes/archive/`
138
+ and discover it through `harness/changes/INDEX.json`.
139
+
140
+ ### docs/ARCHITECTURE.md
141
+
142
+ The authoritative architecture document.
143
+
144
+ **Must include**:
145
+ - Mermaid diagram generated from actual import analysis (not templates)
146
+ - Layer table with real packages and their dependencies
147
+ - Source citations (`> Sources: [file:line]()`) for every claim
148
+ - Forbidden dependency rules
149
+
150
+ ### docs/DEVELOPMENT.md
151
+
152
+ Development setup and commands.
153
+
154
+ **Must include**:
155
+ - Prerequisites (Go version, Node version, etc.)
156
+ - Build commands that actually work
157
+ - Test commands with explanation
158
+ - Lint commands
159
+ - Harness commands: `verify-harness`, `lint-ecl`, `lint-encoding`, `harness-change`
160
+
161
+ ### docs/design-docs/
162
+
163
+ Component-level design documents.
164
+
165
+ **For each key component** (from architecture analysis):
166
+ 1. `docs/design-docs/index.md` — Index table
167
+ 2. `docs/design-docs/{component}.md` — Detailed design doc
168
+
169
+ **Each design doc must have**:
170
+ - Overview
171
+ - Architecture (with Mermaid diagram)
172
+ - Key Interfaces (with file:line citations)
173
+ - Execution Flow
174
+ - Error Handling
175
+
176
+ **Use templates from** `references/documentation-templates.md`.
177
+
178
+ ### Additional docs (as needed)
179
+
180
+ - `docs/QUALITY.md` — Quality standards
181
+ - `docs/TESTING.md` — Testing strategy
182
+ - `docs/SECURITY.md` — Security considerations
183
+ - `docs/PRODUCT_SENSE.md` — Product context
184
+ - `docs/references/index.md` — Reference index
185
+
186
+ ## Quality Requirements
187
+
188
+ | Requirement | What This Means |
189
+ |-------------|-----------------|
190
+ | **Source-grounded** | Every claim cites actual file:line |
191
+ | **Real data** | Layer maps use actual packages, not placeholders |
192
+ | **Working commands** | DEVELOPMENT.md commands actually run |
193
+ | **No placeholders** | No "TODO: fill in later" |
194
+ | **Numbered sections** | For stable cross-references |
195
+ | **Generated index clarity** | Docs say INDEX.json is script-generated, not hand-maintained |
196
+
197
+ ## What NOT to Create
198
+
199
+ - Source code files
200
+ - Test files for business logic
201
+ - Application entry points
@@ -0,0 +1,123 @@
1
+ # Linter Creation Agent
2
+
3
+ You are creating or updating linter scripts for agent harness infrastructure.
4
+
5
+ ## Input
6
+
7
+ You will receive:
8
+ - Architecture analysis with full layer hierarchy (from `harness/.analysis/architecture.json`)
9
+ - Existing linter state (from `harness/.analysis/audit.json`)
10
+ - Delta list of what to create/update
11
+
12
+ ## Files You Create/Update
13
+
14
+ ### scripts/lint-deps.{ext}
15
+
16
+ **Purpose**: Enforce layer boundaries — prevent forbidden imports.
17
+
18
+ **Must include**:
19
+ - Complete layer map with EVERY package from the architecture analysis
20
+ - No blind spots — if a package exists, it must be in the layer map
21
+ - Layer rules: Layer N can only import from layers < N
22
+
23
+ **Error message format** (agent-actionable):
24
+
25
+ ```
26
+ {file}:{line} imports {forbidden_package} (layer {N} → layer {M}).
27
+ Layer {N} packages can only import from layers < {N}.
28
+
29
+ Fix options:
30
+ 1. Move {logic description} to a higher layer (e.g., {suggestion})
31
+ 2. Pass the value as a parameter instead of importing directly
32
+ 3. Define an interface in layer {N} and implement in layer {M}
33
+ ```
34
+
35
+ This is the most important quality requirement. An error message that only says "Forbidden import" is useless to an agent. The message must tell WHAT is wrong, WHY it matters, and HOW to fix it.
36
+
37
+ ### scripts/lint-quality.{ext}
38
+
39
+ **Purpose**: Enforce code quality patterns.
40
+
41
+ **Common rules** (customize based on codebase patterns):
42
+ - File size limits (e.g., > 500 lines → warning)
43
+ - Structured logging enforcement
44
+ - Error wrapping convention
45
+ - Naming conventions
46
+ - Test file presence
47
+
48
+ **Same error message quality**: WHAT + WHY + HOW.
49
+
50
+ ### scripts/lint-ecl.{ps1|sh|mjs|py}
51
+
52
+ **Purpose**: Enforce ECL change lifecycle integrity.
53
+
54
+ **Must check**:
55
+ - `harness/changes/active/` has `summary.md`, `spec.md`, `plan.md`, `tasks.md`, and `reviews/` when active exists.
56
+ - Markdown front matter status is internally consistent.
57
+ - Active changes in `implement`, `validate`, or `done` phase have no high-impact
58
+ `[NEEDS CLARIFICATION: ...]` markers in `spec.md`.
59
+ - Active changes cannot enter implementation until `plan_review` is approved in `summary.md` or an
60
+ equivalent approved Plan Review exists in `reviews/review.md`.
61
+ - Executable task lines in `tasks.md` use `T###` ids, and implementation tasks include target paths
62
+ plus validation notes.
63
+ - `completed` changes have validation results.
64
+ - `tasks.md` with unexplained pending items cannot be completed.
65
+ - `docs/STATUS.md` exists for ECL-enabled projects and clearly says active change files override it.
66
+ - A temporary regenerated index matches `harness/changes/INDEX.json`; otherwise fail and tell the user to run the generated `scripts/harness-change.* reindex` equivalent.
67
+ - `scripts/harness-evolve.*` and `harness/evolution/state.json` exist for core auto-evolve threshold checking.
68
+ - If `harness/evolution/pending.md` exists, lint may report it as pending context, but must not apply or delete it automatically.
69
+
70
+ ### scripts/lint-encoding.{ps1|sh|mjs|py}
71
+
72
+ **Purpose**: Enforce UTF-8 and prevent mojibake from being written into source or docs.
73
+
74
+ **Must check**:
75
+ - Scan text files for known mojibake markers listed in `references/ecl-harness.md`.
76
+ - Exclude generated/vendor/cache directories.
77
+ - Return actionable file and line messages.
78
+
79
+ ## Language-Specific Templates
80
+
81
+ Use templates from `references/linter-templates.md` as starting points, then customize:
82
+
83
+ - **Go**: Go script that parses imports, checks against layer map
84
+ - **TypeScript/Node.js**: read `references/adapters/typescript.md` first; generate Node/TS-native scripts such as `scripts/lint-deps.mjs` and `scripts/lint-quality.mjs`, and wire them through npm/package-manager scripts
85
+ - **Python**: Python script that parses from/import statements
86
+ - **ECL/Encoding**: use the selected command surface profile from `references/ecl-harness.md` (`.ps1`, `.sh`, `.mjs`, or `.py`)
87
+
88
+ ## Critical Rules
89
+
90
+ 1. **Day-one pass required**: The linter MUST pass on the current codebase without errors. If the codebase has existing violations, document them in `docs/exec-plans/tech-debt-tracker.md` instead of failing the linter.
91
+
92
+ 2. **Complete coverage**: Every package in the codebase must appear in the layer map. Missing packages = blind spots = undetected violations.
93
+
94
+ 3. **Executable**: Scripts must run from the project root. Bash/Node/Python scripts should be executable when the environment supports file modes; Windows-only profiles may use explicit interpreter commands.
95
+
96
+ 4. **Makefile integration**: Ensure `make lint-arch` target runs these scripts.
97
+
98
+ 5. **Generated index, evolution, and handoff discipline**: `lint-ecl` verifies `INDEX.json` freshness, auto-evolve state presence, and `docs/STATUS.md` presence, but never rewrites those files. Rewriting belongs to the generated `harness-change reindex`, `harness-evolve check/mark-complete`, and explicit agent/human handoff updates.
99
+
100
+ 6. **Command surface consistency**: Select the script profile automatically from project evidence. If the project rejects `.ps1`, do not generate PowerShell as the only entrypoint. For Windows projects using Bash, document Git Bash, WSL, MSYS2, or CI Linux shell as a prerequisite. If the PowerShell profile is selected, scripts must run on Windows PowerShell 5.1 as well as PowerShell 7.
101
+
102
+ 7. **Strict business gates**: Do not remove or weaken existing project `lint`, `typecheck`, `test`,
103
+ or `build` checks to make CI pass. If those checks fail before harness creation, report them as
104
+ pre-existing project debt; keep the generated CI strict unless the user explicitly asks for staged rollout.
105
+
106
+ ## Verification
107
+
108
+ After creating linters, verify:
109
+
110
+ ```bash
111
+ # Linters are executable
112
+ chmod +x scripts/lint-deps* scripts/lint-quality*
113
+
114
+ # Linters pass on current codebase
115
+ make lint-arch
116
+
117
+ # ECL and encoding checks pass
118
+ {ecl_lint_command}
119
+ {encoding_lint_command}
120
+
121
+ # Count covered packages vs total packages
122
+ # (should be 100%)
123
+ ```
@@ -0,0 +1,204 @@
1
+ # Language Adapter Schema
2
+
3
+ Every language adapter must follow this schema. Adapters are the single source of truth
4
+ for all language-specific behavior across the harness system.
5
+
6
+ ## Design Principles
7
+
8
+ 1. **Discover, don't assume**: Adapters define detection rules, not the core system
9
+ 2. **One adapter, one language**: Each adapter is self-contained for one language ecosystem
10
+ 3. **Graceful degradation**: Every field is optional — missing fields fall back to generic behavior
11
+ 4. **Extensibility**: Adding a new language = adding one adapter file, zero core changes
12
+
13
+ ## Schema Definition
14
+
15
+ ```yaml
16
+ adapter:
17
+ # ─── Metadata ───────────────────────────────────────────────
18
+ language: string # Unique identifier: go, typescript, python, java, rust, etc.
19
+ display_name: string # Human-readable: "Go", "TypeScript", "Python", etc.
20
+ version: string # Adapter schema version (currently "1.0")
21
+
22
+ # ─── Detection ──────────────────────────────────────────────
23
+ # How to identify this language in a project.
24
+ # Detection runs in order; first match with highest confidence wins.
25
+ detection:
26
+ # Files whose existence signals this language (ANY match = candidate)
27
+ files: [string]
28
+ # Optional: require file content patterns for higher confidence
29
+ content_patterns:
30
+ - file: string # Glob pattern (e.g., "*.toml", "package.json")
31
+ pattern: string # Regex to match inside the file
32
+ # Overall confidence when detection.files match (0.0 - 1.0)
33
+ confidence: float
34
+
35
+ # ─── Commands ───────────────────────────────────────────────
36
+ # Standard development commands. null = not applicable for this language.
37
+ # These are defaults; project-level overrides in DEVELOPMENT.md or
38
+ # harness/config/validate.json always take priority.
39
+ commands:
40
+ build: string | null # Compile/transpile: "go build ./...", "npm run build"
41
+ test: string | null # Run tests: "go test ./...", "npm test"
42
+ lint: string | null # General linting: "golangci-lint run", "npm run lint"
43
+ lint_arch: string | null # Architectural linting: "make lint-arch", "npm run lint:arch"
44
+ format: string | null # Code formatting: "gofmt -w .", "prettier --write ."
45
+ start: string | null # Start the application: "go run main.go", "npm start"
46
+ dev: string | null # Development mode: "air", "npm run dev"
47
+
48
+ # ─── Package Manager ────────────────────────────────────────
49
+ # How to detect and use the package manager.
50
+ package_manager:
51
+ # Detection priority: first match wins
52
+ detection:
53
+ - lockfile: string # e.g., "pnpm-lock.yaml"
54
+ manager: string # e.g., "pnpm"
55
+ - lockfile: string
56
+ manager: string
57
+ default: string # Fallback if no lockfile: "npm", "pip", etc.
58
+ install_command: string # Template: "{manager} install"
59
+
60
+ # ─── Route Detection ────────────────────────────────────────
61
+ # How to find HTTP routes, CLI commands, and other entry points.
62
+ # Used by verify.py and generate_task_verification.py.
63
+ route_detection:
64
+ # Indicators that this project is a server (scan file contents)
65
+ server_indicators:
66
+ - pattern: string # Regex to find in source files
67
+ description: string # Human-readable explanation
68
+ frameworks: [string] # Associated frameworks: ["chi", "gin"]
69
+
70
+ # Indicators that this project is a CLI tool
71
+ cli_indicators:
72
+ - pattern: string
73
+ description: string
74
+ frameworks: [string]
75
+
76
+ # Indicators that this project is a frontend app
77
+ frontend_indicators:
78
+ - pattern: string
79
+ description: string
80
+ frameworks: [string]
81
+
82
+ # Route/command extraction patterns
83
+ patterns:
84
+ - type: route # "route" for HTTP, "command" for CLI
85
+ regex: string # Extraction regex with named groups
86
+ groups: [string] # Named groups: [method, path] or [command_name]
87
+ frameworks: [string] # Which frameworks this pattern matches
88
+
89
+ # ─── Import Analysis ────────────────────────────────────────
90
+ # How to analyze imports for dependency linting.
91
+ import_analysis:
92
+ # Command to list all packages/modules
93
+ list_packages: string | null # "go list ./...", null for languages without this
94
+ # Regex to extract imports from source files
95
+ import_pattern: string # e.g., '"([^"]+)"' for Go, 'from [\'"]([^\'"]+)' for TS
96
+ # File extensions to scan
97
+ source_extensions: [string] # [".go"], [".ts", ".tsx", ".js", ".jsx"]
98
+ # Module root detection
99
+ module_root_file: string # "go.mod", "package.json", "pyproject.toml"
100
+
101
+ # ─── Layer Conventions ──────────────────────────────────────
102
+ # Default layer hierarchy for architectural linting.
103
+ # These are starting-point defaults; the analyzer agent adjusts based on
104
+ # actual import graph analysis.
105
+ layer_conventions:
106
+ patterns:
107
+ - layer: int # 0 = foundational, higher = more application-specific
108
+ paths: [string] # Directory patterns: ["internal/types", "types", "domain"]
109
+ description: string # "Pure types, zero internal imports"
110
+
111
+ # ─── Dependency Detection ───────────────────────────────────
112
+ # How to detect external dependencies (databases, services, etc.)
113
+ # from the project's dependency manifest.
114
+ dependency_detection:
115
+ manifest_file: string # "go.mod", "package.json", "requirements.txt"
116
+ # Patterns to detect specific dependency types
117
+ databases:
118
+ - pattern: string # Regex on dependency name
119
+ type: string # "postgres", "mysql", "mongodb", "redis", "sqlite"
120
+ default_port: int
121
+ services:
122
+ - pattern: string
123
+ type: string # "kafka", "rabbitmq", "elasticsearch", etc.
124
+ default_port: int
125
+ # Environment variable detection in source code
126
+ env_var_patterns:
127
+ - pattern: string # e.g., 'os\.Getenv\("([^"]+)"\)' for Go
128
+
129
+ # ─── Linter Template ────────────────────────────────────────
130
+ # Reference to the linter implementation for this language.
131
+ linter:
132
+ # Pointer to the section in linter-templates.md
133
+ template_section: string # "go-linter", "typescript-linter", etc.
134
+ # File extension for the linter script
135
+ script_extension: string # ".go", ".ts", ".py"
136
+ # How to run the linter
137
+ run_command: string # "go run scripts/lint-deps.go", "npx ts-node scripts/lint-deps.ts"
138
+
139
+ # ─── Naming Conventions ─────────────────────────────────────
140
+ # File and directory naming rules for verify_action.py.
141
+ naming:
142
+ file_pattern: string # Regex: "^[a-z][a-z0-9_]*\\.go$"
143
+ test_pattern: string # Regex: "^[a-z][a-z0-9_]*_test\\.go$"
144
+ directory_style: string # "snake_case", "kebab-case", "camelCase"
145
+
146
+ # ─── CI Template ────────────────────────────────────────────
147
+ # CI configuration template for this language.
148
+ ci:
149
+ # GitHub Actions template (primary)
150
+ github_actions:
151
+ image: string # "golang:1.22", "node:20", "python:3.12"
152
+ setup_steps: [string] # Additional setup steps
153
+ cache_paths: [string] # Paths to cache: ["~/go/pkg/mod"], ["node_modules"]
154
+ # Other CI systems can be added here
155
+ ```
156
+
157
+ ## Resolution Priority
158
+
159
+ When the harness system needs language-specific behavior, it follows this resolution chain:
160
+
161
+ 1. **Project-level override** — `harness/config/validate.json`, `DEVELOPMENT.md` commands
162
+ 2. **Adapter defaults** — The matching adapter's `commands` section
163
+ 3. **Generic fallback** — `generic.md` adapter (discovers from Makefile/README)
164
+
165
+ ## Adding a New Language
166
+
167
+ To add support for a new language (e.g., Kotlin):
168
+
169
+ 1. Create `references/adapters/kotlin.md` following this schema
170
+ 2. Fill in detection rules, commands, route patterns
171
+ 3. Optionally add a linter template section to `linter-templates.md`
172
+ 4. No changes to core scripts needed — `detect_adapter.py` auto-discovers adapters
173
+
174
+ ## Adapter File Format
175
+
176
+ Each adapter file uses YAML front matter followed by prose documentation:
177
+
178
+ ```markdown
179
+ ---
180
+ adapter:
181
+ language: kotlin
182
+ display_name: "Kotlin"
183
+ version: "1.0"
184
+ detection:
185
+ files: [build.gradle.kts, build.gradle]
186
+ confidence: 0.9
187
+ commands:
188
+ build: "./gradlew build"
189
+ test: "./gradlew test"
190
+ # ...
191
+ ---
192
+
193
+ # Kotlin Adapter
194
+
195
+ ## Framework-Specific Notes
196
+
197
+ ### Ktor (server)
198
+ - Routes defined via `routing { get("/path") { ... } }`
199
+ - ...
200
+
201
+ ### Spring Boot
202
+ - Routes via `@GetMapping`, `@PostMapping` annotations
203
+ - ...
204
+ ```
@@ -0,0 +1,156 @@
1
+ ---
2
+ adapter:
3
+ language: generic
4
+ display_name: "Generic (Auto-Discovery)"
5
+ version: "1.0"
6
+
7
+ detection:
8
+ files: [] # Always matches as fallback
9
+ confidence: 0.10
10
+
11
+ commands:
12
+ build: null # Discovered from Makefile / README
13
+ test: null # Discovered from Makefile / README
14
+ lint: null
15
+ lint_arch: null
16
+ format: null
17
+ start: null
18
+ dev: null
19
+
20
+ package_manager:
21
+ detection: []
22
+ default: null
23
+ install_command: null
24
+
25
+ route_detection:
26
+ server_indicators:
27
+ - pattern: 'listen|serve|http|server'
28
+ description: "Generic HTTP server indicator"
29
+ frameworks: []
30
+ cli_indicators:
31
+ - pattern: 'argv|args|argparse|getopt|flag'
32
+ description: "Generic CLI argument parsing"
33
+ frameworks: []
34
+ frontend_indicators:
35
+ - pattern: 'index\\.html|<!DOCTYPE html>'
36
+ description: "HTML file presence"
37
+ frameworks: []
38
+ patterns: []
39
+
40
+ import_analysis:
41
+ list_packages: null
42
+ import_pattern: null
43
+ source_extensions: []
44
+ module_root_file: null
45
+
46
+ layer_conventions:
47
+ patterns:
48
+ - layer: 0
49
+ paths: ["types", "models", "domain", "entities"]
50
+ description: "Core types (generic convention)"
51
+ - layer: 1
52
+ paths: ["utils", "lib", "common", "helpers", "shared"]
53
+ description: "Shared utilities (generic convention)"
54
+ - layer: 2
55
+ paths: ["services", "core", "business", "logic"]
56
+ description: "Business logic (generic convention)"
57
+ - layer: 3
58
+ paths: ["handlers", "controllers", "api", "routes", "endpoints"]
59
+ description: "API layer (generic convention)"
60
+ - layer: 4
61
+ paths: ["main", "cmd", "bin", "app", "src/index", "src/main"]
62
+ description: "Entry points (generic convention)"
63
+
64
+ dependency_detection:
65
+ manifest_file: null
66
+ databases: []
67
+ services: []
68
+ env_var_patterns: []
69
+
70
+ linter:
71
+ template_section: null
72
+ script_extension: null
73
+ run_command: null
74
+
75
+ naming:
76
+ file_pattern: null
77
+ test_pattern: null
78
+ directory_style: null
79
+
80
+ ci:
81
+ github_actions:
82
+ image: "ubuntu-latest"
83
+ setup_steps: []
84
+ cache_paths: []
85
+ ---
86
+
87
+ # Generic Adapter (Auto-Discovery Fallback)
88
+
89
+ This adapter activates when no language-specific adapter matches. Instead of
90
+ assuming a specific language (previous behavior: defaulting to Go), it discovers
91
+ commands from project conventions.
92
+
93
+ ## Discovery Strategy
94
+
95
+ ### 1. Makefile Discovery
96
+
97
+ If a `Makefile` exists, parse targets:
98
+
99
+ ```bash
100
+ # Extract make targets
101
+ grep -E '^[a-zA-Z_-]+:' Makefile | sed 's/:.*//'
102
+ ```
103
+
104
+ Common target mappings:
105
+ | Target Pattern | Mapped Command |
106
+ |---------------|---------------|
107
+ | `build`, `compile` | `commands.build` |
108
+ | `test`, `check` | `commands.test` |
109
+ | `lint`, `lint-arch` | `commands.lint`, `commands.lint_arch` |
110
+ | `fmt`, `format` | `commands.format` |
111
+ | `run`, `start`, `serve` | `commands.start` |
112
+ | `dev`, `watch` | `commands.dev` |
113
+
114
+ ### 2. README Discovery
115
+
116
+ If no Makefile, scan `README.md` for code blocks with common commands:
117
+
118
+ ```bash
119
+ # Look for fenced code blocks with build/test commands
120
+ grep -A 2 '```' README.md
121
+ ```
122
+
123
+ ### 3. package.json Scripts Discovery (non-Node projects)
124
+
125
+ Some non-Node projects use `package.json` for script aliases:
126
+
127
+ ```bash
128
+ # Check if package.json scripts exist
129
+ cat package.json | python3 -c "import sys,json; [print(k,v) for k,v in json.load(sys.stdin).get('scripts',{}).items()]"
130
+ ```
131
+
132
+ ### 4. docker-compose.yml Discovery
133
+
134
+ If `docker-compose.yml` exists, extract service definitions for environment setup.
135
+
136
+ ## When Generic Adapter Activates
137
+
138
+ The generic adapter is the **last resort**. It activates only when:
139
+ 1. No `go.mod`, `package.json`, `pyproject.toml`, `pom.xml`, `Cargo.toml` exists
140
+ 2. Or when the user explicitly requests generic mode
141
+
142
+ ## Behavior Differences from Language-Specific Adapters
143
+
144
+ | Aspect | Language Adapter | Generic Adapter |
145
+ |--------|-----------------|-----------------|
146
+ | Build command | Hardcoded default | Discovered from Makefile/README |
147
+ | Route detection | Framework-specific regex | Generic HTTP patterns only |
148
+ | Layer conventions | Language-idiomatic paths | Common directory names |
149
+ | Linter | Language-specific template | None (rely on existing tools) |
150
+ | CI template | Language-specific image | Ubuntu with custom steps |
151
+
152
+ ## Extending to New Languages
153
+
154
+ If you find yourself repeatedly using the generic adapter for a specific language,
155
+ that's a signal to create a proper language adapter. See `adapter-schema.md` for
156
+ the schema to follow.