@geraldmaron/construct 1.0.5 → 1.0.7
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 +24 -18
- package/agents/contracts.json +617 -2
- package/agents/contracts.schema.json +83 -0
- package/agents/prompts/cx-accessibility.md +5 -3
- package/agents/prompts/cx-ai-engineer.md +9 -7
- package/agents/prompts/cx-architect.md +8 -6
- package/agents/prompts/cx-business-strategist.md +8 -6
- package/agents/prompts/cx-data-analyst.md +9 -7
- package/agents/prompts/cx-data-engineer.md +5 -3
- package/agents/prompts/cx-debugger.md +8 -6
- package/agents/prompts/cx-designer.md +7 -5
- package/agents/prompts/cx-devil-advocate.md +6 -4
- package/agents/prompts/cx-docs-keeper.md +7 -5
- package/agents/prompts/cx-engineer.md +7 -5
- package/agents/prompts/cx-evaluator.md +4 -2
- package/agents/prompts/cx-explorer.md +10 -8
- package/agents/prompts/cx-legal-compliance.md +4 -2
- package/agents/prompts/cx-operations.md +7 -5
- package/agents/prompts/cx-orchestrator.md +12 -10
- package/agents/prompts/cx-platform-engineer.md +7 -5
- package/agents/prompts/cx-product-manager.md +6 -4
- package/agents/prompts/cx-qa.md +10 -8
- package/agents/prompts/cx-rd-lead.md +11 -9
- package/agents/prompts/cx-release-manager.md +7 -5
- package/agents/prompts/cx-researcher.md +24 -22
- package/agents/prompts/cx-reviewer.md +9 -7
- package/agents/prompts/cx-security.md +12 -10
- package/agents/prompts/cx-sre.md +9 -7
- package/agents/prompts/cx-test-automation.md +5 -3
- package/agents/prompts/cx-trace-reviewer.md +10 -8
- package/agents/prompts/cx-ux-researcher.md +5 -3
- package/agents/registry.json +8 -3
- package/bin/construct +444 -53
- package/commands/build/feature.md +4 -4
- package/commands/build/fix.md +8 -8
- package/commands/design/access.md +3 -3
- package/commands/design/flow.md +3 -3
- package/commands/design/ui.md +4 -4
- package/commands/measure/experiment.md +5 -5
- package/commands/measure/metrics.md +3 -3
- package/commands/measure/results.md +4 -4
- package/commands/plan/api.md +3 -3
- package/commands/plan/challenge.md +3 -3
- package/commands/plan/decide.md +3 -3
- package/commands/plan/feature.md +7 -7
- package/commands/plan/requirements.md +3 -3
- package/commands/remember/context.md +5 -5
- package/commands/remember/handoff.md +3 -3
- package/commands/remember/runbook.md +3 -3
- package/commands/review/code.md +8 -8
- package/commands/review/quality.md +4 -4
- package/commands/review/security.md +3 -3
- package/commands/ship/ready.md +3 -3
- package/commands/ship/release.md +3 -3
- package/commands/ship/status.md +4 -4
- package/commands/understand/docs.md +3 -3
- package/commands/understand/this.md +4 -4
- package/commands/understand/why.md +8 -8
- package/commands/work/clean.md +14 -14
- package/commands/work/drive.md +10 -10
- package/commands/work/optimize-prompts.md +9 -9
- package/commands/work/parallel-review.md +8 -8
- package/db/schema/006_graph.sql +24 -0
- package/examples/provider-plugin/README.md +7 -7
- package/examples/seed-observations/README.md +6 -6
- package/examples/seed-observations/anti-patterns.md +14 -14
- package/examples/seed-observations/decisions.md +4 -4
- package/examples/seed-observations/patterns.md +14 -14
- package/lib/auto-docs.mjs +13 -8
- package/lib/boundary.mjs +126 -0
- package/lib/cache-strategy-google.js +26 -31
- package/lib/cli-commands.mjs +2 -2
- package/lib/comment-lint.mjs +134 -0
- package/lib/contracts/validate.mjs +323 -0
- package/lib/daemons/contract.mjs +210 -0
- package/lib/docs-verify.mjs +59 -6
- package/lib/doctor/cli.mjs +16 -1
- package/lib/doctor/index.mjs +3 -1
- package/lib/doctor/watchers/consistency.mjs +310 -0
- package/lib/doctor/watchers/mcp-protocol.mjs +232 -0
- package/lib/document-extract.mjs +211 -1
- package/lib/embed/cli.mjs +124 -3
- package/lib/embed/daemon.mjs +43 -4
- package/lib/embed/docs-lifecycle.mjs +1 -1
- package/lib/embed/inbox.mjs +2 -0
- package/lib/embed/scheduler.mjs +33 -5
- package/lib/evaluator-optimizer.mjs +2 -3
- package/lib/flavors/loader.mjs +1 -1
- package/lib/hooks/comment-lint.mjs +16 -0
- package/lib/hooks/mcp-audit.mjs +2 -1
- package/lib/hooks/proactive-activation.mjs +0 -14
- package/lib/hooks/rule-verifier.mjs +217 -0
- package/lib/hooks/session-optimize.mjs +2 -1
- package/lib/init-unified.mjs +55 -65
- package/lib/intake/classify.mjs +108 -24
- package/lib/intake/daemon.mjs +121 -0
- package/lib/intake/filesystem-queue.mjs +6 -1
- package/lib/intake/intake-config.mjs +2 -1
- package/lib/intake/prepare.mjs +0 -1
- package/lib/intake/session-prelude.mjs +7 -1
- package/lib/intake/traceability.mjs +90 -0
- package/lib/knowledge/graph.mjs +213 -0
- package/lib/knowledge/research-store.mjs +2 -0
- package/lib/maintenance/cleanup.mjs +315 -0
- package/lib/mcp/memory-bridge.mjs +276 -0
- package/lib/mcp/server.mjs +189 -1
- package/lib/mcp/tools/profile.mjs +270 -0
- package/lib/mcp/tools/workflow.mjs +25 -0
- package/lib/mcp-catalog.json +12 -8
- package/lib/mcp-platform-config.mjs +16 -8
- package/lib/migrations/index.mjs +106 -0
- package/lib/migrations/v1-baseline.mjs +33 -0
- package/lib/observation-store.mjs +9 -4
- package/lib/outcomes/record.mjs +2 -0
- package/lib/profiles/rebrand.mjs +46 -0
- package/lib/project-init-shared.mjs +12 -0
- package/lib/provider-capabilities.js +20 -7
- package/lib/providers/auth-manager.mjs +58 -17
- package/lib/reflect.mjs +49 -12
- package/lib/server/index.mjs +22 -28
- package/lib/session-store.mjs +6 -4
- package/lib/setup.mjs +14 -3
- package/lib/telemetry/client.mjs +5 -1
- package/lib/version.mjs +51 -0
- package/lib/worker/trace.mjs +5 -1
- package/package.json +4 -1
- package/personas/construct.md +3 -1
- package/platforms/claude/CLAUDE.md +6 -6
- package/rules/common/agents.md +2 -2
- package/rules/common/beads-hygiene.md +11 -11
- package/rules/common/code-review.md +1 -1
- package/rules/common/coding-style.md +1 -1
- package/rules/common/comments.md +8 -8
- package/rules/common/commit-approval.md +4 -4
- package/rules/common/cx-agent-routing.md +2 -2
- package/rules/common/cx-skill-routing.md +2 -2
- package/rules/common/development-workflow.md +3 -2
- package/rules/common/doc-ownership.md +2 -2
- package/rules/common/efficiency.md +3 -3
- package/rules/common/framing.md +1 -1
- package/rules/common/git-workflow.md +1 -1
- package/rules/common/no-fabrication.md +69 -0
- package/rules/common/patterns.md +1 -1
- package/rules/common/performance.md +1 -1
- package/rules/common/release-gates.md +7 -7
- package/rules/common/research.md +4 -4
- package/rules/common/review-before-change.md +58 -0
- package/rules/common/security.md +1 -1
- package/rules/common/skill-composition.md +8 -8
- package/rules/common/testing.md +1 -1
- package/rules/golang/coding-style.md +2 -2
- package/rules/golang/hooks.md +1 -1
- package/rules/golang/patterns.md +1 -1
- package/rules/golang/security.md +1 -1
- package/rules/golang/testing.md +1 -1
- package/rules/python/coding-style.md +1 -1
- package/rules/python/hooks.md +1 -1
- package/rules/python/patterns.md +1 -1
- package/rules/python/security.md +1 -1
- package/rules/python/testing.md +1 -1
- package/rules/swift/coding-style.md +3 -3
- package/rules/swift/hooks.md +2 -2
- package/rules/swift/patterns.md +2 -2
- package/rules/swift/security.md +4 -4
- package/rules/swift/testing.md +2 -2
- package/rules/typescript/coding-style.md +1 -1
- package/rules/typescript/hooks.md +1 -1
- package/rules/typescript/patterns.md +1 -1
- package/rules/typescript/security.md +1 -1
- package/rules/typescript/testing.md +1 -1
- package/rules/web/coding-style.md +1 -1
- package/rules/web/design-quality.md +1 -1
- package/rules/web/hooks.md +1 -1
- package/rules/web/patterns.md +1 -1
- package/rules/web/performance.md +1 -1
- package/rules/web/security.md +1 -1
- package/rules/web/testing.md +1 -1
- package/scripts/sync-agents.mjs +45 -14
- package/skills/ai/agent-dev.md +1 -1
- package/skills/ai/llm-security.md +1 -1
- package/skills/ai/ml-ops.md +6 -6
- package/skills/ai/orchestration-workflow.md +1 -1
- package/skills/ai/prompt-and-eval.md +1 -1
- package/skills/ai/prompt-optimizer.md +13 -13
- package/skills/ai/rag-system.md +1 -1
- package/skills/architecture/api-design.md +1 -1
- package/skills/architecture/caching.md +1 -1
- package/skills/architecture/cloud-native.md +1 -1
- package/skills/architecture/message-queue.md +1 -1
- package/skills/architecture/security-arch.md +1 -1
- package/skills/compliance/ai-disclosure.md +1 -1
- package/skills/compliance/data-privacy.md +1 -1
- package/skills/compliance/license-audit.md +2 -2
- package/skills/compliance/regulatory-review.md +1 -1
- package/skills/development/cpp.md +1 -1
- package/skills/development/go.md +1 -1
- package/skills/development/java.md +1 -1
- package/skills/development/kotlin.md +9 -9
- package/skills/development/mobile-crossplatform.md +13 -13
- package/skills/development/python.md +1 -1
- package/skills/development/rust.md +1 -1
- package/skills/development/shell.md +1 -1
- package/skills/development/swift.md +6 -6
- package/skills/development/typescript.md +1 -1
- package/skills/devops/ci-cd.md +5 -5
- package/skills/devops/containerization.md +9 -9
- package/skills/devops/cost-optimization.md +1 -1
- package/skills/devops/data-engineering.md +2 -2
- package/skills/devops/database.md +1 -1
- package/skills/devops/dependency-management.md +3 -3
- package/skills/devops/devsecops.md +1 -1
- package/skills/devops/git-workflow.md +1 -1
- package/skills/devops/incident-response.md +18 -18
- package/skills/devops/monorepo.md +5 -5
- package/skills/devops/observability.md +1 -1
- package/skills/devops/performance.md +1 -1
- package/skills/devops/testing.md +1 -1
- package/skills/docs/adr-workflow.md +2 -2
- package/skills/docs/backlog-proposal-workflow.md +1 -1
- package/skills/docs/customer-profile-workflow.md +1 -1
- package/skills/docs/document-ingest-workflow.md +1 -1
- package/skills/docs/evidence-ingest-workflow.md +1 -1
- package/skills/docs/init-docs.md +15 -15
- package/skills/docs/init-project.md +1 -1
- package/skills/docs/prd-workflow.md +3 -3
- package/skills/docs/prfaq-workflow.md +1 -1
- package/skills/docs/product-intelligence-review.md +1 -1
- package/skills/docs/product-intelligence-workflow.md +1 -1
- package/skills/docs/product-signal-workflow.md +9 -9
- package/skills/docs/research-workflow.md +10 -10
- package/skills/docs/runbook-workflow.md +2 -2
- package/skills/docs/strategy-workflow.md +3 -3
- package/skills/exploration/repo-map.md +11 -11
- package/skills/frameworks/django.md +15 -15
- package/skills/frameworks/nextjs.md +16 -16
- package/skills/frameworks/react.md +12 -12
- package/skills/frameworks/spring-boot.md +12 -12
- package/skills/frontend-design/accessibility.md +6 -6
- package/skills/frontend-design/component-patterns.md +1 -1
- package/skills/frontend-design/engineering.md +1 -1
- package/skills/frontend-design/state-management.md +1 -1
- package/skills/frontend-design/ui-aesthetics.md +1 -1
- package/skills/frontend-design/ux-principles.md +1 -1
- package/skills/operating/orchestration-reference.md +27 -27
- package/skills/quality-gates/review-work.md +3 -3
- package/skills/quality-gates/verify-change.md +1 -1
- package/skills/quality-gates/verify-module.md +1 -1
- package/skills/quality-gates/verify-quality.md +1 -1
- package/skills/quality-gates/verify-security.md +1 -1
- package/skills/routing.md +14 -14
- package/skills/security/blue-team.md +1 -1
- package/skills/security/code-audit.md +1 -1
- package/skills/security/pentest.md +1 -1
- package/skills/security/red-team.md +1 -1
- package/skills/security/threat-intel.md +1 -1
- package/skills/security/vuln-research.md +1 -1
- package/skills/utility/clean-code.md +2 -2
- package/templates/docs/changelog-entry.md +1 -1
- package/templates/docs/construct_guide.md +18 -18
- package/templates/docs/meta-prd.md +16 -16
- package/templates/docs/one-pager.md +1 -1
- package/templates/docs/prd-business.md +1 -1
- package/templates/docs/prd-platform.md +1 -1
- package/templates/docs/prd.md +17 -17
- package/templates/docs/research-brief.md +8 -8
- package/templates/docs/rfc.md +1 -1
- package/templates/docs/skill-artifact.md +1 -1
- package/templates/docs/strategy.md +1 -1
package/rules/swift/security.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
rules/swift/security.md
|
|
2
|
+
rules/swift/security.md: <one-line purpose>
|
|
3
3
|
|
|
4
4
|
<2–6 line summary.>
|
|
5
5
|
-->
|
|
@@ -14,9 +14,9 @@ paths:
|
|
|
14
14
|
|
|
15
15
|
## Secret Management
|
|
16
16
|
|
|
17
|
-
- Use **Keychain Services** for sensitive data (tokens, passwords, keys)
|
|
17
|
+
- Use **Keychain Services** for sensitive data (tokens, passwords, keys): never `UserDefaults`
|
|
18
18
|
- Use environment variables or `.xcconfig` files for build-time secrets
|
|
19
|
-
- Never hardcode secrets in source
|
|
19
|
+
- Never hardcode secrets in source: decompilation tools extract them trivially
|
|
20
20
|
|
|
21
21
|
```swift
|
|
22
22
|
let apiKey = ProcessInfo.processInfo.environment["API_KEY"]
|
|
@@ -27,7 +27,7 @@ guard let apiKey, !apiKey.isEmpty else {
|
|
|
27
27
|
|
|
28
28
|
## Transport Security
|
|
29
29
|
|
|
30
|
-
- App Transport Security (ATS) is enforced by default
|
|
30
|
+
- App Transport Security (ATS) is enforced by default: do not disable it
|
|
31
31
|
- Use certificate pinning for critical endpoints
|
|
32
32
|
- Validate all server certificates
|
|
33
33
|
|
package/rules/swift/testing.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
rules/swift/testing.md
|
|
2
|
+
rules/swift/testing.md: <one-line purpose>
|
|
3
3
|
|
|
4
4
|
<2–6 line summary.>
|
|
5
5
|
-->
|
|
@@ -27,7 +27,7 @@ func userCreationValidatesEmail() throws {
|
|
|
27
27
|
|
|
28
28
|
## Test Isolation
|
|
29
29
|
|
|
30
|
-
Each test gets a fresh instance
|
|
30
|
+
Each test gets a fresh instance: set up in `init`, tear down in `deinit`. No shared mutable state between tests.
|
|
31
31
|
|
|
32
32
|
## Parameterized Tests
|
|
33
33
|
|
package/rules/web/hooks.md
CHANGED
package/rules/web/patterns.md
CHANGED
package/rules/web/performance.md
CHANGED
package/rules/web/security.md
CHANGED
package/rules/web/testing.md
CHANGED
package/scripts/sync-agents.mjs
CHANGED
|
@@ -121,6 +121,18 @@ if (validationErrors.length > 0) {
|
|
|
121
121
|
process.exit(1);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
// Sync-time contract validation: contracts.json shape, schema refs, and
|
|
125
|
+
// producer/consumer name resolution against the registry above.
|
|
126
|
+
{
|
|
127
|
+
const { validateContractsFile } = await import("../lib/contracts/validate.mjs");
|
|
128
|
+
const contractsResult = validateContractsFile();
|
|
129
|
+
if (!contractsResult.ok) {
|
|
130
|
+
console.error("Contract validation failed:");
|
|
131
|
+
for (const err of contractsResult.errors) console.error(` - ${err}`);
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
124
136
|
// --- Dry-run + lockfile + two-phase write infrastructure ---
|
|
125
137
|
|
|
126
138
|
const DRY_RUN = process.argv.includes("--dry-run");
|
|
@@ -671,9 +683,13 @@ ${agentList || "(all specialists are internal — routed through Construct)"}`;
|
|
|
671
683
|
if (!settings.mcpServers) settings.mcpServers = {};
|
|
672
684
|
const registryMcp = registry.mcpServers ?? {};
|
|
673
685
|
for (const [id, mcpDef] of Object.entries(registryMcp)) {
|
|
674
|
-
const
|
|
686
|
+
const existingEntry = settings.mcpServers[id];
|
|
687
|
+
const existing = JSON.stringify(existingEntry ?? "");
|
|
675
688
|
const hasPlaceholder = existing.includes("__");
|
|
676
|
-
|
|
689
|
+
const registryWantsCommand = !mcpDef.type && Array.isArray(mcpDef.args);
|
|
690
|
+
const existingIsRemote = existingEntry && (existingEntry.type === 'http' || existingEntry.type === 'remote');
|
|
691
|
+
const transportMismatch = registryWantsCommand && existingIsRemote;
|
|
692
|
+
if (existingEntry && !hasPlaceholder && !transportMismatch) continue;
|
|
677
693
|
settings.mcpServers[id] = buildClaudeMcpEntry(id, mcpDef, process.env);
|
|
678
694
|
}
|
|
679
695
|
if (!DRY_RUN) fs.writeFileSync(claudeSettingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
@@ -711,8 +727,8 @@ function hasCodexMcpTable(text, id) {
|
|
|
711
727
|
return new RegExp(`^\\[mcp_servers\\.(?:${escapeRegExp(id)}|${escapeRegExp(tomlString(id))})\\]`, "m").test(text);
|
|
712
728
|
}
|
|
713
729
|
|
|
714
|
-
function isCodexMcpSupported(
|
|
715
|
-
return
|
|
730
|
+
function isCodexMcpSupported() {
|
|
731
|
+
return true;
|
|
716
732
|
}
|
|
717
733
|
|
|
718
734
|
function syncCodex(entries) {
|
|
@@ -834,9 +850,13 @@ function syncVSCode() {
|
|
|
834
850
|
if (!settings["github.copilot.mcpServers"]) settings["github.copilot.mcpServers"] = {};
|
|
835
851
|
const mcpServers = settings["github.copilot.mcpServers"];
|
|
836
852
|
for (const [id, mcpDef] of Object.entries(registryMcp)) {
|
|
837
|
-
const
|
|
853
|
+
const existingEntry = mcpServers[id];
|
|
854
|
+
const existing = JSON.stringify(existingEntry ?? "");
|
|
838
855
|
const hasPlaceholder = existing.includes("__");
|
|
839
|
-
|
|
856
|
+
const registryWantsCommand = !mcpDef.type && Array.isArray(mcpDef.args);
|
|
857
|
+
const existingIsRemote = existingEntry && (existingEntry.type === 'http' || existingEntry.type === 'remote');
|
|
858
|
+
const transportMismatch = registryWantsCommand && existingIsRemote;
|
|
859
|
+
if (existingEntry && !hasPlaceholder && !transportMismatch) continue;
|
|
840
860
|
mcpServers[id] = buildClaudeMcpEntry(id, mcpDef, process.env);
|
|
841
861
|
}
|
|
842
862
|
settings["github.copilot.mcpServers"] = mcpServers;
|
|
@@ -862,9 +882,13 @@ function syncCursor() {
|
|
|
862
882
|
const config = JSON.parse(fs.readFileSync(cursorMcpPath, "utf8"));
|
|
863
883
|
if (!config.mcpServers) config.mcpServers = {};
|
|
864
884
|
for (const [id, mcpDef] of Object.entries(registryMcp)) {
|
|
865
|
-
const
|
|
885
|
+
const existingEntry = config.mcpServers[id];
|
|
886
|
+
const existing = JSON.stringify(existingEntry ?? "");
|
|
866
887
|
const hasPlaceholder = existing.includes("__");
|
|
867
|
-
|
|
888
|
+
const registryWantsCommand = !mcpDef.type && Array.isArray(mcpDef.args);
|
|
889
|
+
const existingIsRemote = existingEntry && (existingEntry.type === 'http' || existingEntry.type === 'remote');
|
|
890
|
+
const transportMismatch = registryWantsCommand && existingIsRemote;
|
|
891
|
+
if (existingEntry && !hasPlaceholder && !transportMismatch) continue;
|
|
868
892
|
config.mcpServers[id] = buildClaudeMcpEntry(id, mcpDef, process.env);
|
|
869
893
|
}
|
|
870
894
|
if (!DRY_RUN) fs.writeFileSync(cursorMcpPath, JSON.stringify(config, null, 2) + "\n");
|
|
@@ -963,14 +987,21 @@ function syncOpencode(entries) {
|
|
|
963
987
|
for (const [id, mcpDef] of Object.entries(registryMcp)) {
|
|
964
988
|
const openCodeId = getOpenCodeMcpId(id);
|
|
965
989
|
if (openCodeId !== id) delete config.mcp[id];
|
|
966
|
-
if (id === 'memory' && config.mcp.cass && !config.mcp[openCodeId]) {
|
|
967
|
-
config.mcp[openCodeId] = config.mcp.cass;
|
|
968
|
-
}
|
|
969
990
|
if (id === 'memory') delete config.mcp.cass;
|
|
970
|
-
|
|
971
|
-
|
|
991
|
+
|
|
992
|
+
// Migrate the legacy cass-memory HTTP entry to the stdio bridge. cm v0.2.x
|
|
993
|
+
// rejects the MCP handshake (OpenCode surfaces 405 on the SSE GET), so
|
|
994
|
+
// any remote/http memory entry must be rewritten when the registry
|
|
995
|
+
// defines a command-based bridge.
|
|
996
|
+
const existingEntry = config.mcp[openCodeId];
|
|
997
|
+
const registryWantsCommand = !mcpDef.type && Array.isArray(mcpDef.args);
|
|
998
|
+
const existingIsRemote = existingEntry && (existingEntry.type === 'remote' || existingEntry.type === 'http');
|
|
999
|
+
const transportMismatch = registryWantsCommand && existingIsRemote;
|
|
1000
|
+
|
|
1001
|
+
const existing = JSON.stringify(existingEntry ?? "");
|
|
1002
|
+
const hasPlaceholder = existing.includes("__");
|
|
972
1003
|
const argsHaveTemplates = (mcpDef.args ?? []).some((a) => typeof a === 'string' && a.includes('__'));
|
|
973
|
-
if (!
|
|
1004
|
+
if (!existingEntry || hasPlaceholder || argsHaveTemplates || transportMismatch) {
|
|
974
1005
|
config.mcp[openCodeId] = buildOpenCodeMcpEntry(id, mcpDef, process.env).entry;
|
|
975
1006
|
}
|
|
976
1007
|
}
|
package/skills/ai/agent-dev.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/ai/agent-dev.md
|
|
2
|
+
skills/ai/agent-dev.md (AI Agent Development) Use this skill when building AI agents, tool-use systems, or multi-agent workflo
|
|
3
3
|
|
|
4
4
|
Use this skill when building AI agents, tool-use systems, or multi-agent workflows. ## Agent Architecture
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/ai/llm-security.md
|
|
2
|
+
skills/ai/llm-security.md (LLM Security) Use this skill when securing LLM-powered applications against prompt injection,
|
|
3
3
|
|
|
4
4
|
Use this skill when securing LLM-powered applications against prompt injection, data leakage, and misuse. ## Prompt Injection
|
|
5
5
|
-->
|
package/skills/ai/ml-ops.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/ai/ml-ops.md
|
|
2
|
+
skills/ai/ml-ops.md (ML Operations (MLOps)) ```
|
|
3
3
|
|
|
4
4
|
## The MLOps Lifecycle ```
|
|
5
5
|
-->
|
|
@@ -86,7 +86,7 @@ Central store for model versions and deployment state:
|
|
|
86
86
|
|
|
87
87
|
| Stage | Meaning |
|
|
88
88
|
|---|---|
|
|
89
|
-
| Staging | Candidate
|
|
89
|
+
| Staging | Candidate: passes evaluation, not yet in production |
|
|
90
90
|
| Production | Currently serving |
|
|
91
91
|
| Archived | Superseded |
|
|
92
92
|
|
|
@@ -117,7 +117,7 @@ async def predict(req: PredictRequest) -> PredictResponse:
|
|
|
117
117
|
|
|
118
118
|
### A/B testing / Shadow mode
|
|
119
119
|
|
|
120
|
-
- **Shadow mode**: new model receives traffic and logs predictions but does not serve users
|
|
120
|
+
- **Shadow mode**: new model receives traffic and logs predictions but does not serve users: validate before switching
|
|
121
121
|
- **A/B test**: split traffic (e.g., 10% new model) and measure business metrics, not just accuracy
|
|
122
122
|
- Use a feature flag system to control routing
|
|
123
123
|
|
|
@@ -162,8 +162,8 @@ Trigger retraining when:
|
|
|
162
162
|
|
|
163
163
|
## Common Pitfalls
|
|
164
164
|
|
|
165
|
-
- **Training-serving skew**: feature engineering in training differs from serving
|
|
166
|
-
- **Data leakage**: future information in training features inflates metrics
|
|
165
|
+
- **Training-serving skew**: feature engineering in training differs from serving: solve with a shared feature pipeline
|
|
166
|
+
- **Data leakage**: future information in training features inflates metrics: use strict temporal splits
|
|
167
167
|
- **Model staleness without detection**: set up drift monitoring day 1, not after the model degrades
|
|
168
168
|
- **No rollback plan**: always keep N-1 model version in registry and test rollback procedure
|
|
169
|
-
- **GPU waste**: jobs that could run on CPU scheduled on GPU
|
|
169
|
+
- **GPU waste**: jobs that could run on CPU scheduled on GPU: profile resource usage
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/ai/orchestration-workflow.md
|
|
2
|
+
skills/ai/orchestration-workflow.md (Construct Orchestration Workflow) Use this skill when the request involves agent orchestration, phase transitions,
|
|
3
3
|
|
|
4
4
|
Use this skill when the request involves agent orchestration, phase transitions, task keys, handoff quality, workflow state, or project alignment. ## Core Model
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/ai/prompt-and-eval.md
|
|
2
|
+
skills/ai/prompt-and-eval.md (Prompt Engineering and Evaluation) Use this skill when designing prompts, evaluating model performance, or optimizi
|
|
3
3
|
|
|
4
4
|
Use this skill when designing prompts, evaluating model performance, or optimizing LLM behavior. ## Prompt Structure
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/ai/prompt-optimizer.md
|
|
2
|
+
skills/ai/prompt-optimizer.md: Closed-loop prompt auto-optimization guide.
|
|
3
3
|
|
|
4
4
|
Uses telemetry traces and quality scores as the feedback signal, Claude as the optimizer,
|
|
5
5
|
and the agent registry + construct sync as the deployment layer.
|
|
@@ -24,15 +24,15 @@ construct optimize --list
|
|
|
24
24
|
construct optimize cx-debugger --threshold=0.65 --days=14 --min-traces=15
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
The optimizer requires Python 3.12+ (`pip3` must be available). It will auto-install `dspy-ai` and `requests` on first run. Set `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` in `.env`. DSPy uses the same LLM key Construct uses
|
|
27
|
+
The optimizer requires Python 3.12+ (`pip3` must be available). It will auto-install `dspy-ai` and `requests` on first run. Set `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` in `.env`. DSPy uses the same LLM key Construct uses: no separate setup.
|
|
28
28
|
|
|
29
29
|
## When to run
|
|
30
30
|
|
|
31
31
|
- Triggered by `/work:optimize-prompts` (manual) or the scheduled task `prompt-optimization-weekly`
|
|
32
32
|
- Automatically suggested when `cx-trace-reviewer` finds an agent with median quality score below 0.65 over the past 7 days
|
|
33
|
-
- Never run optimization on prompts with fewer than 20 scored traces
|
|
33
|
+
- Never run optimization on prompts with fewer than 20 scored traces: insufficient signal
|
|
34
34
|
|
|
35
|
-
## Step 1
|
|
35
|
+
## Step 1: Gather signal
|
|
36
36
|
|
|
37
37
|
Retrieve the current production prompt for the target agent from `agents/registry.json` (or the corresponding `promptFile` if using extracted prompts).
|
|
38
38
|
|
|
@@ -50,7 +50,7 @@ GET {CONSTRUCT_TELEMETRY_URL}/api/public/scores?traceId={id}&name=quality
|
|
|
50
50
|
|
|
51
51
|
Filter to scores where `value < 0.7`. For each low-scoring trace, extract: the prompt used, the user input, the model output, the quality score, and any human comments.
|
|
52
52
|
|
|
53
|
-
## Step 2
|
|
53
|
+
## Step 2: Diagnose failure patterns
|
|
54
54
|
|
|
55
55
|
Analyze the low-scoring traces as a batch. Identify recurring failure modes. Common patterns:
|
|
56
56
|
|
|
@@ -65,16 +65,16 @@ Analyze the low-scoring traces as a batch. Identify recurring failure modes. Com
|
|
|
65
65
|
|
|
66
66
|
Write a failure summary: top 3 patterns with supporting trace count and representative examples.
|
|
67
67
|
|
|
68
|
-
## Step 3
|
|
68
|
+
## Step 3: Generate improved prompt
|
|
69
69
|
|
|
70
70
|
Write an improved prompt that directly addresses the diagnosed failures. Rules:
|
|
71
71
|
|
|
72
|
-
1. **Keep what works
|
|
73
|
-
2. **Surgical edits, not rewrites
|
|
74
|
-
3. **Be explicit, not vague
|
|
75
|
-
4. **Add a self-check instruction
|
|
72
|
+
1. **Keep what works**: compare high-scoring traces (>0.8) to low-scoring ones. Only change what's associated with failures.
|
|
73
|
+
2. **Surgical edits, not rewrites**: changing everything risks breaking current strengths. Identify the specific clauses that correlate with failures.
|
|
74
|
+
3. **Be explicit, not vague**: if the failure is "too verbose", add a concrete rule ("respond in under 150 words for questions that fit on one line") not a general note ("be concise").
|
|
75
|
+
4. **Add a self-check instruction**: append a brief checklist the agent runs before responding, derived from the top failure patterns.
|
|
76
76
|
|
|
77
|
-
## Step 4
|
|
77
|
+
## Step 4: Push to staging
|
|
78
78
|
|
|
79
79
|
Update the agent's prompt in `agents/registry.json` (or the corresponding `promptFile`) with a staging marker comment. Tag the version by writing to `.cx/decisions/prompt-staging-{agent}-{date}.md`.
|
|
80
80
|
|
|
@@ -82,7 +82,7 @@ Log the candidate prompt as a span attribute on a test run batch using `cx_trace
|
|
|
82
82
|
|
|
83
83
|
Do not overwrite the production prompt in the registry until promotion is confirmed.
|
|
84
84
|
|
|
85
|
-
## Step 5
|
|
85
|
+
## Step 5: Monitor staging
|
|
86
86
|
|
|
87
87
|
After at least 20 scored traces on the staging version:
|
|
88
88
|
- Compare median quality score: staging vs production
|
|
@@ -91,7 +91,7 @@ After at least 20 scored traces on the staging version:
|
|
|
91
91
|
|
|
92
92
|
To promote: update the agent registry with the accepted prompt and run `construct sync`.
|
|
93
93
|
|
|
94
|
-
## Step 6
|
|
94
|
+
## Step 6: Document the optimization
|
|
95
95
|
|
|
96
96
|
Write to `.cx/decisions/` with:
|
|
97
97
|
- Which agent was optimized
|
package/skills/ai/rag-system.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/ai/rag-system.md
|
|
2
|
+
skills/ai/rag-system.md (RAG System Design) Use this skill when building retrieval-augmented generation pipelines, vector se
|
|
3
3
|
|
|
4
4
|
Use this skill when building retrieval-augmented generation pipelines, vector search, or knowledge-grounded AI systems. ## Document Processing
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/architecture/api-design.md
|
|
2
|
+
skills/architecture/api-design.md (API Design) Use this skill when designing REST, GraphQL, or gRPC APIs.
|
|
3
3
|
|
|
4
4
|
Use this skill when designing REST, GraphQL, or gRPC APIs. ## REST Design Principles
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/architecture/caching.md
|
|
2
|
+
skills/architecture/caching.md (Caching) Use this skill when designing caching strategies for applications, APIs, or infr
|
|
3
3
|
|
|
4
4
|
Use this skill when designing caching strategies for applications, APIs, or infrastructure. ## Cache Layers
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/architecture/cloud-native.md
|
|
2
|
+
skills/architecture/cloud-native.md (Cloud-Native Architecture) Use this skill when designing containerized, orchestrated, or microservice-based
|
|
3
3
|
|
|
4
4
|
Use this skill when designing containerized, orchestrated, or microservice-based systems. ## Container Best Practices
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/architecture/message-queue.md
|
|
2
|
+
skills/architecture/message-queue.md (Message Queues and Event-Driven Architecture) Use this skill when designing asynchronous communication, event-driven systems,
|
|
3
3
|
|
|
4
4
|
Use this skill when designing asynchronous communication, event-driven systems, or message-based integrations. ## When to Use Message Queues
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/architecture/security-arch.md
|
|
2
|
+
skills/architecture/security-arch.md (Security Architecture) Use this skill when designing authentication, authorization, network security, o
|
|
3
3
|
|
|
4
4
|
Use this skill when designing authentication, authorization, network security, or zero-trust architectures. ## Zero Trust Principles
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/compliance/ai-disclosure.md
|
|
2
|
+
skills/compliance/ai-disclosure.md (AI Disclosure) AI transparency, disclosure, and regulatory compliance.
|
|
3
3
|
|
|
4
4
|
Use this skill when reviewing AI features for disclosure requirements, transparency obligations, or emerging AI regulation compliance.
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/compliance/data-privacy.md
|
|
2
|
+
skills/compliance/data-privacy.md (Data Privacy) GDPR, CCPA, and data protection compliance patterns.
|
|
3
3
|
|
|
4
4
|
Use this skill when reviewing data collection, storage, processing, or retention for privacy regulation compliance.
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/compliance/license-audit.md
|
|
2
|
+
skills/compliance/license-audit.md (License Audit) Dependency license review and open-source compliance.
|
|
3
3
|
|
|
4
4
|
Use this skill when auditing dependency licenses, evaluating OSS compliance risk, or preparing license inventories for legal review.
|
|
5
5
|
-->
|
|
@@ -24,7 +24,7 @@ Use this skill when auditing dependency licenses, evaluating OSS compliance risk
|
|
|
24
24
|
3. Map each dependency to its SPDX license identifier
|
|
25
25
|
4. Flag any dependency without a clear license file as unknown-risk
|
|
26
26
|
5. Check for license changes between pinned versions and latest
|
|
27
|
-
6. Look past layer one
|
|
27
|
+
6. Look past layer one: transitive copyleft taints the whole tree
|
|
28
28
|
|
|
29
29
|
## Red Flags
|
|
30
30
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/compliance/regulatory-review.md
|
|
2
|
+
skills/compliance/regulatory-review.md (Regulatory Review) Pre-ship compliance review checklist and process.
|
|
3
3
|
|
|
4
4
|
Use this skill when conducting a compliance review before shipping features that handle user data, financial transactions, AI decisions, or regulated content.
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/development/cpp.md
|
|
2
|
+
skills/development/cpp.md (C/C++ Best Practices) Use this skill when writing, reviewing, or debugging C or C++ code.
|
|
3
3
|
|
|
4
4
|
Use this skill when writing, reviewing, or debugging C or C++ code. ## Project Structure
|
|
5
5
|
-->
|
package/skills/development/go.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/development/go.md
|
|
2
|
+
skills/development/go.md (Go Best Practices) Use this skill when writing, reviewing, or debugging Go code.
|
|
3
3
|
|
|
4
4
|
Use this skill when writing, reviewing, or debugging Go code. ## Project Structure
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/development/java.md
|
|
2
|
+
skills/development/java.md (Java Best Practices) Use this skill when writing, reviewing, or debugging Java or Kotlin code on the
|
|
3
3
|
|
|
4
4
|
Use this skill when writing, reviewing, or debugging Java or Kotlin code on the JVM. ## Project Structure
|
|
5
5
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/development/kotlin.md
|
|
2
|
+
skills/development/kotlin.md (Kotlin / Android Development) | Scope | Use when |
|
|
3
3
|
|
|
4
4
|
## Coroutines & Flows ### Coroutine scope discipline
|
|
5
5
|
-->
|
|
@@ -14,7 +14,7 @@ skills/development/kotlin.md — Kotlin / Android Development — | Scope | Use
|
|
|
14
14
|
| `viewModelScope` | ViewModel-bound work; auto-cancelled on clear |
|
|
15
15
|
| `lifecycleScope` | Fragment/Activity-bound; cancelled on destroy |
|
|
16
16
|
| `rememberCoroutineScope()` | Compose-scoped; cancelled on composition exit |
|
|
17
|
-
| `GlobalScope` | Never
|
|
17
|
+
| `GlobalScope` | Never: uncontrolled lifetime |
|
|
18
18
|
|
|
19
19
|
```kotlin
|
|
20
20
|
class ItemViewModel(private val repo: ItemRepository) : ViewModel() {
|
|
@@ -31,7 +31,7 @@ class ItemViewModel(private val repo: ItemRepository) : ViewModel() {
|
|
|
31
31
|
|
|
32
32
|
### Flow operators
|
|
33
33
|
|
|
34
|
-
- `stateIn(scope, SharingStarted.WhileSubscribed(5_000), initial)
|
|
34
|
+
- `stateIn(scope, SharingStarted.WhileSubscribed(5_000), initial)`: converts cold flow to hot StateFlow for UI consumption
|
|
35
35
|
- `map`, `filter`, `distinctUntilChanged`, `debounce` for transform chains
|
|
36
36
|
- `combine` for merging multiple flows
|
|
37
37
|
- Use `flowOn(Dispatchers.IO)` for upstream CPU/IO work; do not switch dispatchers in the collector
|
|
@@ -43,7 +43,7 @@ class ItemViewModel(private val repo: ItemRepository) : ViewModel() {
|
|
|
43
43
|
| `Dispatchers.Main` | UI updates |
|
|
44
44
|
| `Dispatchers.IO` | Network, disk, database |
|
|
45
45
|
| `Dispatchers.Default` | CPU-intensive work |
|
|
46
|
-
| `Dispatchers.Unconfined` | Rarely
|
|
46
|
+
| `Dispatchers.Unconfined` | Rarely: only in tests |
|
|
47
47
|
|
|
48
48
|
## Jetpack Compose
|
|
49
49
|
|
|
@@ -69,7 +69,7 @@ fun ItemList(items: List<Item>, onDelete: (Item) -> Unit) { ... }
|
|
|
69
69
|
|
|
70
70
|
- `remember` expensive computations with stable keys
|
|
71
71
|
- `key(id) { ... }` in lazy lists to preserve item identity
|
|
72
|
-
- Avoid unstable lambdas
|
|
72
|
+
- Avoid unstable lambdas: use `remember { { ... } }` or stable function references
|
|
73
73
|
- Enable Compose compiler metrics to detect recomposition hot spots
|
|
74
74
|
- Prefer `LazyColumn` over `Column` for variable-length lists
|
|
75
75
|
|
|
@@ -134,7 +134,7 @@ Scoping: `@Singleton` for app-scoped, `@ActivityRetainedScoped` for ViewModel-li
|
|
|
134
134
|
|
|
135
135
|
## Common Pitfalls
|
|
136
136
|
|
|
137
|
-
- `collect` in `Fragment.onViewCreated` without `repeatOnLifecycle(STARTED)
|
|
138
|
-
- `StateFlow.value` reads in tests without collecting
|
|
139
|
-
- Leaking `Activity` context into long-lived objects
|
|
140
|
-
- `LazyColumn` with `items(list)` where `list` is `State<List<...>>` causing full recomposition
|
|
137
|
+
- `collect` in `Fragment.onViewCreated` without `repeatOnLifecycle(STARTED)`: causes collection after view destruction
|
|
138
|
+
- `StateFlow.value` reads in tests without collecting: use `turbine` or `runTest { first() }`
|
|
139
|
+
- Leaking `Activity` context into long-lived objects: use `applicationContext`
|
|
140
|
+
- `LazyColumn` with `items(list)` where `list` is `State<List<...>>` causing full recomposition: use `key` param
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/development/mobile-crossplatform.md
|
|
2
|
+
skills/development/mobile-crossplatform.md (Mobile Cross-Platform Development) Before choosing a framework, answer:
|
|
3
3
|
|
|
4
4
|
## Decision Framework: Native vs Cross-Platform Before choosing a framework, answer:
|
|
5
5
|
-->
|
|
@@ -13,11 +13,11 @@ Before choosing a framework, answer:
|
|
|
13
13
|
|---|---|---|
|
|
14
14
|
| Platform-specific APIs needed (ARKit, Health, NFC)? | Yes | No |
|
|
15
15
|
| Animation fidelity is a differentiator? | Yes | Partial |
|
|
16
|
-
| Single team, both platforms?
|
|
16
|
+
| Single team, both platforms? |: | Yes |
|
|
17
17
|
| Heavy use of platform OS widgets? | Yes | No |
|
|
18
|
-
| App is primarily data-display / CRUD?
|
|
19
|
-
| Existing web team?
|
|
20
|
-
| Existing Kotlin/Swift team? | Native
|
|
18
|
+
| App is primarily data-display / CRUD? |: | Yes |
|
|
19
|
+
| Existing web team? |: | React Native |
|
|
20
|
+
| Existing Kotlin/Swift team? | Native |: |
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
@@ -42,7 +42,7 @@ Future<List<Item>> items(ItemsRef ref) async {
|
|
|
42
42
|
|
|
43
43
|
### Performance
|
|
44
44
|
|
|
45
|
-
- `const` constructors everywhere possible
|
|
45
|
+
- `const` constructors everywhere possible: eliminates widget rebuilds
|
|
46
46
|
- `RepaintBoundary` around independently-animated subtrees
|
|
47
47
|
- Profile with Flutter DevTools → CPU flame chart + widget rebuild tracker
|
|
48
48
|
- `ListView.builder` for lazy lists; never `ListView(children: [...])` for long lists
|
|
@@ -78,8 +78,8 @@ testWidgets('shows items on load', (tester) async {
|
|
|
78
78
|
### New Architecture (React Native 0.74+)
|
|
79
79
|
|
|
80
80
|
Enable the New Architecture by default on new projects. Key changes:
|
|
81
|
-
- JSI replaces the async bridge
|
|
82
|
-
- Fabric replaces the native renderer
|
|
81
|
+
- JSI replaces the async bridge: sync native calls
|
|
82
|
+
- Fabric replaces the native renderer: concurrent React features work correctly
|
|
83
83
|
- TurboModules replace native modules
|
|
84
84
|
|
|
85
85
|
### State & logic sharing with web
|
|
@@ -130,11 +130,11 @@ export default function ItemScreen() { ... }
|
|
|
130
130
|
|
|
131
131
|
## Common Pitfalls (both frameworks)
|
|
132
132
|
|
|
133
|
-
- **Deep linking not tested until late
|
|
134
|
-
- **Push notifications complexity
|
|
135
|
-
- **Over-the-air update strategy
|
|
136
|
-
- **Platform capability divergence
|
|
137
|
-
- **Code signing automation
|
|
133
|
+
- **Deep linking not tested until late**: set up universal links / app links in week 1
|
|
134
|
+
- **Push notifications complexity**: Expo Notifications or Firebase Cloud Messaging; plan for permission states
|
|
135
|
+
- **Over-the-air update strategy**: define what can be OTA vs what requires App Store review
|
|
136
|
+
- **Platform capability divergence**: features available on iOS 17+ may be absent on Android 12; maintain a capability matrix
|
|
137
|
+
- **Code signing automation**: `fastlane match` (iOS) and keystore management (Android) require upfront investment; do it early
|
|
138
138
|
|
|
139
139
|
## When to go native anyway
|
|
140
140
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
skills/development/python.md
|
|
2
|
+
skills/development/python.md (Python Best Practices) Use this skill when writing, reviewing, or debugging Python code.
|
|
3
3
|
|
|
4
4
|
Use this skill when writing, reviewing, or debugging Python code. ## Project Structure
|
|
5
5
|
-->
|