@geraldmaron/construct 1.0.7 → 1.0.9
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/README.md +20 -17
- package/bin/construct +1199 -69
- package/commands/work/optimize-prompts.md +1 -1
- package/db/schema/007_tags.sql +30 -0
- package/db/schema/008_skill_usage.sql +24 -0
- package/db/schema/009_scheduler.sql +14 -0
- package/examples/internal/roles/architect/bad/clever-plan-without-contracts.md +1 -1
- package/examples/internal/roles/architect/golden/explicit-tradeoff-before-plan.md +1 -1
- package/examples/internal/roles/engineer/bad/speculative-abstraction.md +1 -1
- package/examples/internal/roles/engineer/golden/read-before-write.md +1 -1
- package/examples/internal/roles/qa/bad/coverage-theater.md +1 -1
- package/examples/internal/roles/qa/golden/regression-gate.md +1 -1
- package/examples/seed-observations/decisions.md +1 -1
- package/lib/audit-skills.mjs +3 -3
- package/lib/auto-docs.mjs +2 -2
- package/lib/cli-commands.mjs +276 -122
- package/lib/comment-lint.mjs +5 -1
- package/lib/completions.mjs +1 -1
- package/lib/config/schema.mjs +15 -1
- package/lib/contracts/validate.mjs +65 -17
- package/lib/distill.mjs +22 -4
- package/lib/doc-stamp.mjs +48 -0
- package/lib/doctor/watchers/consistency.mjs +62 -12
- package/lib/document-extract.mjs +221 -28
- package/lib/document-ingest.mjs +2 -0
- package/lib/embed/inbox.mjs +48 -3
- package/lib/embed/role-framing.mjs +3 -3
- package/lib/env-config.mjs +9 -3
- package/lib/extractors/calendar.mjs +173 -0
- package/lib/extractors/shared/drop-info.mjs +22 -0
- package/lib/extractors/transcript.mjs +0 -0
- package/lib/gates-audit.mjs +8 -2
- package/lib/git-hooks/prepare-commit-msg +1 -1
- package/lib/headhunt.mjs +2 -2
- package/lib/hooks/agent-tracker.mjs +6 -11
- package/lib/hooks/guard-bash.mjs +35 -14
- package/lib/hooks/mcp-audit.mjs +12 -0
- package/lib/hooks/pre-compact.mjs +92 -5
- package/lib/hooks/pre-push-gate.mjs +41 -8
- package/lib/hooks/registry-sync.mjs +2 -2
- package/lib/hooks/stop-notify.mjs +7 -6
- package/lib/host-capabilities.mjs +10 -1
- package/lib/hygiene/scan.mjs +141 -0
- package/lib/init-unified.mjs +18 -0
- package/lib/install/stage-project.mjs +4 -4
- package/lib/intake/classify.mjs +222 -55
- package/lib/intake/filesystem-queue.mjs +25 -5
- package/lib/intake/postgres-queue.mjs +45 -3
- package/lib/intake/prepare.mjs +3 -0
- package/lib/intake/quarantine.mjs +205 -0
- package/lib/knowledge/postgres-search.mjs +132 -0
- package/lib/knowledge/search.mjs +14 -4
- package/lib/mcp/server.mjs +9 -3
- package/lib/mcp/tools/skills.mjs +32 -11
- package/lib/mcp/tools/workflow.mjs +1 -1
- package/lib/migrations/index.mjs +1 -1
- package/lib/model-registry.mjs +1 -1
- package/lib/opencode-runtime-plugin.mjs +1 -1
- package/lib/orchestration-policy.mjs +4 -4
- package/lib/overrides/resolver.mjs +3 -3
- package/lib/parity.mjs +4 -4
- package/lib/policy/engine.mjs +2 -2
- package/lib/profiles/lifecycle.mjs +1 -1
- package/lib/prompt-metadata.mjs +4 -4
- package/lib/providers/circuit-breaker.mjs +14 -0
- package/lib/providers/contract.mjs +67 -3
- package/lib/providers/creds.mjs +219 -0
- package/lib/providers/scaffold.mjs +107 -0
- package/lib/role-preload.mjs +5 -0
- package/lib/roles/catalog.mjs +1 -1
- package/lib/roles/manifest.mjs +2 -2
- package/lib/scheduler/index.mjs +112 -0
- package/lib/scheduler/solo.mjs +183 -0
- package/lib/server/index.mjs +7 -1
- package/lib/server/insights.mjs +14 -12
- package/lib/server/langfuse-login.mjs +58 -0
- package/lib/server/static/assets/index-ab25c707.js +1 -1
- package/lib/{agent-contracts-enforce.mjs → specialist-contracts-enforce.mjs} +4 -4
- package/lib/{agent-contracts.mjs → specialist-contracts.mjs} +9 -8
- package/lib/{agents → specialists}/postconditions.mjs +3 -3
- package/lib/{agents → specialists}/schema.mjs +6 -6
- package/lib/status.mjs +13 -11
- package/lib/storage/backup.mjs +2 -2
- package/lib/tags/lifecycle.mjs +278 -0
- package/lib/tags/vocabulary.mjs +140 -0
- package/lib/telemetry/otel-tracer.mjs +184 -0
- package/lib/telemetry/skill-calls.mjs +73 -12
- package/lib/uninstall/uninstall.mjs +1 -1
- package/lib/update.mjs +1 -1
- package/lib/validator.mjs +57 -56
- package/lib/workflows/instantiate.mjs +320 -0
- package/package.json +13 -3
- package/personas/construct.md +2 -2
- package/platforms/claude/CLAUDE.md +1 -1
- package/rules/common/no-fabrication.md +1 -1
- package/scripts/{sync-agents.mjs → sync-specialists.mjs} +130 -58
- package/skills/ai/prompt-optimizer.md +3 -3
- package/skills/exploration/dependency-graph-reading.md +98 -0
- package/skills/exploration/tracer-bullet-method.md +71 -0
- package/skills/exploration/unknown-codebase-onboarding.md +91 -0
- package/skills/operating/change-management.md +91 -0
- package/skills/operating/incident-response.md +75 -0
- package/skills/operating/oncall-rotation.md +95 -0
- package/skills/operating/orchestration-reference.md +2 -2
- package/skills/strategy/competitive-landscape.md +75 -0
- package/skills/strategy/market-research-methods.md +87 -0
- package/skills/strategy/narrative-arc.md +77 -0
- package/skills/strategy/pricing-positioning.md +94 -0
- package/{agents → specialists}/contracts.schema.json +1 -1
- package/specialists/policy-inventory.json +160 -0
- package/{agents → specialists}/prompts/cx-accessibility.md +1 -1
- package/{agents → specialists}/prompts/cx-ai-engineer.md +1 -1
- package/{agents → specialists}/prompts/cx-architect.md +1 -1
- package/{agents → specialists}/prompts/cx-business-strategist.md +1 -1
- package/{agents → specialists}/prompts/cx-data-analyst.md +1 -1
- package/{agents → specialists}/prompts/cx-data-engineer.md +1 -1
- package/{agents → specialists}/prompts/cx-debugger.md +1 -1
- package/{agents → specialists}/prompts/cx-designer.md +1 -1
- package/{agents → specialists}/prompts/cx-devil-advocate.md +1 -1
- package/{agents → specialists}/prompts/cx-docs-keeper.md +2 -2
- package/{agents → specialists}/prompts/cx-engineer.md +2 -2
- package/{agents → specialists}/prompts/cx-evaluator.md +1 -1
- package/{agents → specialists}/prompts/cx-explorer.md +1 -1
- package/{agents → specialists}/prompts/cx-legal-compliance.md +1 -1
- package/{agents → specialists}/prompts/cx-operations.md +1 -1
- package/{agents → specialists}/prompts/cx-orchestrator.md +2 -2
- package/{agents → specialists}/prompts/cx-platform-engineer.md +1 -1
- package/{agents → specialists}/prompts/cx-product-manager.md +1 -1
- package/{agents → specialists}/prompts/cx-qa.md +1 -1
- package/{agents → specialists}/prompts/cx-rd-lead.md +1 -1
- package/{agents → specialists}/prompts/cx-release-manager.md +1 -1
- package/{agents → specialists}/prompts/cx-researcher.md +1 -1
- package/{agents → specialists}/prompts/cx-reviewer.md +2 -2
- package/{agents → specialists}/prompts/cx-security.md +1 -1
- package/{agents → specialists}/prompts/cx-sre.md +2 -2
- package/{agents → specialists}/prompts/cx-test-automation.md +1 -1
- package/{agents → specialists}/prompts/cx-trace-reviewer.md +3 -3
- package/{agents → specialists}/prompts/cx-ux-researcher.md +1 -1
- package/{agents → specialists}/registry.json +651 -423
- package/{agents → specialists}/role-manifests.json +8 -8
- package/templates/provider-scaffold/health.test.mjs +30 -0
- package/templates/provider-scaffold/index.mjs +48 -0
- package/templates/workflows/cross-team-handoff.yml +85 -0
- package/templates/workflows/engineering-onboarding.yml +77 -0
- package/templates/workflows/new-feature.yml +53 -0
- /package/{agents → specialists}/contracts.json +0 -0
- /package/{agents → specialists}/teams.json +0 -0
|
@@ -18,7 +18,7 @@ Optimize prompt fragments and overlays, not the runtime orchestration policy. If
|
|
|
18
18
|
|
|
19
19
|
## Required steps
|
|
20
20
|
|
|
21
|
-
1. **Read current prompt**: read the agent's prompt from `
|
|
21
|
+
1. **Read current prompt**: read the agent's prompt from `specialists/registry.json` (or its `promptFile`)
|
|
22
22
|
2. **Fetch recent scores**: GET `{CONSTRUCT_TELEMETRY_URL}/api/public/scores?name=quality&limit=200`
|
|
23
23
|
3. **Skip agents with fewer than 20 scored traces**: insufficient signal; note them but do not optimize
|
|
24
24
|
4. **Diagnose failure patterns**: analyze low-scoring traces, identify top 3 recurring patterns
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
-- Tag attribution and migration tracking for construct_documents.
|
|
2
|
+
-- The construct_documents.tags JSONB column already exists in 001_init.sql.
|
|
3
|
+
-- This migration adds GIN indexing, attribution history, and migration audit.
|
|
4
|
+
|
|
5
|
+
create index if not exists construct_documents_tags_gin_idx
|
|
6
|
+
on construct_documents using gin (tags jsonb_path_ops);
|
|
7
|
+
|
|
8
|
+
create table if not exists construct_tag_attribution (
|
|
9
|
+
document_id text not null references construct_documents(id) on delete cascade,
|
|
10
|
+
tag text not null,
|
|
11
|
+
source text not null, -- 'agent:classifier' | 'user' | 'curator'
|
|
12
|
+
confidence numeric,
|
|
13
|
+
applied_at timestamptz not null default now(),
|
|
14
|
+
migrated_from text,
|
|
15
|
+
primary key (document_id, tag, source)
|
|
16
|
+
);
|
|
17
|
+
create index if not exists construct_tag_attribution_tag_idx on construct_tag_attribution (tag);
|
|
18
|
+
|
|
19
|
+
create table if not exists construct_tag_migrations (
|
|
20
|
+
id text primary key,
|
|
21
|
+
from_tag text not null,
|
|
22
|
+
to_tag text,
|
|
23
|
+
executed_at timestamptz not null default now(),
|
|
24
|
+
executed_by text not null,
|
|
25
|
+
reason text not null,
|
|
26
|
+
doc_count_before integer not null,
|
|
27
|
+
doc_count_after integer,
|
|
28
|
+
reversible boolean not null default true,
|
|
29
|
+
rolled_back_at timestamptz
|
|
30
|
+
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- db/schema/008_skill_usage.sql — Per-skill invocation log.
|
|
2
|
+
--
|
|
3
|
+
-- Backs `construct skills usage/orphans/hot`. The local
|
|
4
|
+
-- JSONL path (~/.cx/skill-calls.jsonl) is primary in solo mode; this table is
|
|
5
|
+
-- primary in team/enterprise mode. One-time backfill via
|
|
6
|
+
-- `construct skills backfill-postgres`.
|
|
7
|
+
|
|
8
|
+
create table if not exists construct_skill_invocations (
|
|
9
|
+
id bigserial primary key,
|
|
10
|
+
ts timestamptz not null,
|
|
11
|
+
skill_id text not null,
|
|
12
|
+
source text not null, -- 'mcp' | 'role-preload' | 'prompt-composer' | …
|
|
13
|
+
agent_id text,
|
|
14
|
+
session_id text,
|
|
15
|
+
caller_context text,
|
|
16
|
+
latency_ms integer,
|
|
17
|
+
tokens_returned integer
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
create index if not exists construct_skill_invocations_skill_ts_idx
|
|
21
|
+
on construct_skill_invocations (skill_id, ts desc);
|
|
22
|
+
|
|
23
|
+
create index if not exists construct_skill_invocations_session_idx
|
|
24
|
+
on construct_skill_invocations (session_id);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- Scheduler job state for team and enterprise deployment modes.
|
|
2
|
+
-- Solo mode uses native trigger files instead of this table.
|
|
3
|
+
-- The lock_holder column stores a short identifier for the process/host
|
|
4
|
+
-- that currently holds the advisory lock for a running job.
|
|
5
|
+
|
|
6
|
+
create table if not exists construct_scheduled_jobs (
|
|
7
|
+
id text primary key,
|
|
8
|
+
schedule text not null,
|
|
9
|
+
last_run_at timestamptz,
|
|
10
|
+
last_run_status text,
|
|
11
|
+
lock_holder text,
|
|
12
|
+
lock_acquired_at timestamptz,
|
|
13
|
+
created_at timestamptz not null default now()
|
|
14
|
+
);
|
|
@@ -7,7 +7,7 @@ verdict: fail
|
|
|
7
7
|
summary: Recommends a clever architecture without exposing contracts or rejected alternatives.
|
|
8
8
|
references:
|
|
9
9
|
- skills/roles/architect.md
|
|
10
|
-
-
|
|
10
|
+
- specialists/prompts/cx-architect.md
|
|
11
11
|
tags:
|
|
12
12
|
- missing-contracts
|
|
13
13
|
- hidden-dependencies
|
|
@@ -7,7 +7,7 @@ verdict: fail
|
|
|
7
7
|
summary: Introduces an abstraction for future cases without evidence from the code.
|
|
8
8
|
references:
|
|
9
9
|
- skills/roles/engineer.md
|
|
10
|
-
-
|
|
10
|
+
- specialists/prompts/cx-engineer.md
|
|
11
11
|
tags:
|
|
12
12
|
- speculative-abstraction
|
|
13
13
|
- unnecessary-surface-area
|
|
@@ -7,7 +7,7 @@ verdict: pass
|
|
|
7
7
|
summary: Reads the touched files and surrounding pattern before proposing code changes.
|
|
8
8
|
references:
|
|
9
9
|
- skills/roles/engineer.md
|
|
10
|
-
-
|
|
10
|
+
- specialists/prompts/cx-engineer.md
|
|
11
11
|
tags:
|
|
12
12
|
- read-before-write
|
|
13
13
|
- local-conventions
|
|
@@ -33,4 +33,4 @@ Hook guards for workflow, drive, bootstrap, and task behavior are expressed as Y
|
|
|
33
33
|
|
|
34
34
|
## Registry as Single Source of Truth
|
|
35
35
|
|
|
36
|
-
`
|
|
36
|
+
`specialists/registry.json` is the canonical definition for all agents on all platforms (Claude Code, OpenCode, Codex, Copilot). `construct sync` regenerates all platform-specific files from the registry. Never edit generated files directly: edits are overwritten on the next sync.
|
package/lib/audit-skills.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import path from 'node:path';
|
|
|
11
11
|
function findConstructRoot(startPath = process.cwd()) {
|
|
12
12
|
let current = path.resolve(startPath);
|
|
13
13
|
while (true) {
|
|
14
|
-
if (fs.existsSync(path.join(current, '
|
|
14
|
+
if (fs.existsSync(path.join(current, 'specialists', 'registry.json'))) return current;
|
|
15
15
|
const parent = path.dirname(current);
|
|
16
16
|
if (parent === current) return path.resolve(startPath);
|
|
17
17
|
current = parent;
|
|
@@ -36,7 +36,7 @@ function collectSkillFiles(skillsDir) {
|
|
|
36
36
|
|
|
37
37
|
export function auditSkills({ rootDir, silent = false } = {}) {
|
|
38
38
|
const root = rootDir ?? findConstructRoot();
|
|
39
|
-
const registryPath = path.join(root, '
|
|
39
|
+
const registryPath = path.join(root, 'specialists', 'registry.json');
|
|
40
40
|
const skillsDir = path.join(root, 'skills');
|
|
41
41
|
|
|
42
42
|
const registry = JSON.parse(fs.readFileSync(registryPath, 'utf8'));
|
|
@@ -46,7 +46,7 @@ export function auditSkills({ rootDir, silent = false } = {}) {
|
|
|
46
46
|
const agentsWithNoSkills = [];
|
|
47
47
|
const missingSkillFiles = [];
|
|
48
48
|
|
|
49
|
-
for (const agent of registry.
|
|
49
|
+
for (const agent of registry.specialists ?? []) {
|
|
50
50
|
const skills = agent.skills ?? [];
|
|
51
51
|
if (skills.length === 0) {
|
|
52
52
|
agentsWithNoSkills.push(agent.name);
|
package/lib/auto-docs.mjs
CHANGED
|
@@ -397,10 +397,10 @@ function renderAgentsPage(rootDir) {
|
|
|
397
397
|
return [
|
|
398
398
|
'---',
|
|
399
399
|
'title: Specialists',
|
|
400
|
-
'description: The 28 specialists behind the construct persona. Generated from
|
|
400
|
+
'description: The 28 specialists behind the construct persona. Generated from specialists/registry.json.',
|
|
401
401
|
'---',
|
|
402
402
|
'',
|
|
403
|
-
'> Generated from `
|
|
403
|
+
'> Generated from `specialists/registry.json`. Re-run `construct docs:site` to refresh.',
|
|
404
404
|
'',
|
|
405
405
|
'Construct ships one persona (`construct`) and 28 specialists behind it. You address `@construct` for all everyday work; it routes to specialists internally. Each specialist has a role, model tier, and prompt file that defines its decision authority.',
|
|
406
406
|
'',
|