@geraldmaron/construct 1.0.5 → 1.0.6
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 +8 -4
- package/agents/prompts/cx-accessibility.md +3 -3
- package/agents/prompts/cx-ai-engineer.md +7 -7
- package/agents/prompts/cx-architect.md +6 -6
- package/agents/prompts/cx-business-strategist.md +6 -6
- package/agents/prompts/cx-data-analyst.md +7 -7
- package/agents/prompts/cx-data-engineer.md +3 -3
- package/agents/prompts/cx-debugger.md +6 -6
- package/agents/prompts/cx-designer.md +5 -5
- package/agents/prompts/cx-devil-advocate.md +4 -4
- package/agents/prompts/cx-docs-keeper.md +5 -5
- package/agents/prompts/cx-engineer.md +5 -5
- package/agents/prompts/cx-evaluator.md +2 -2
- package/agents/prompts/cx-explorer.md +8 -8
- package/agents/prompts/cx-legal-compliance.md +2 -2
- package/agents/prompts/cx-operations.md +5 -5
- package/agents/prompts/cx-orchestrator.md +10 -10
- package/agents/prompts/cx-platform-engineer.md +5 -5
- package/agents/prompts/cx-product-manager.md +4 -4
- package/agents/prompts/cx-qa.md +8 -8
- package/agents/prompts/cx-rd-lead.md +9 -9
- package/agents/prompts/cx-release-manager.md +5 -5
- package/agents/prompts/cx-researcher.md +22 -22
- package/agents/prompts/cx-reviewer.md +7 -7
- package/agents/prompts/cx-security.md +10 -10
- package/agents/prompts/cx-sre.md +7 -7
- package/agents/prompts/cx-test-automation.md +3 -3
- package/agents/prompts/cx-trace-reviewer.md +8 -8
- package/agents/prompts/cx-ux-researcher.md +3 -3
- package/bin/construct +235 -21
- 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 +8 -3
- package/lib/cli-commands.mjs +2 -2
- package/lib/flavors/loader.mjs +1 -1
- package/lib/knowledge/graph.mjs +213 -0
- package/lib/mcp/server.mjs +187 -1
- package/lib/mcp/tools/profile.mjs +270 -0
- package/package.json +1 -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 +1 -1
- 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/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/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/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 +13 -13
- 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/strategy.md +1 -1
package/rules/common/security.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
rules/common/security.md
|
|
2
|
+
rules/common/security.md: mandatory security checks and secret management.
|
|
3
3
|
|
|
4
4
|
Defines pre-commit security checklist, secret management rules,
|
|
5
5
|
and response protocol for discovered vulnerabilities.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
rules/common/skill-composition.md
|
|
2
|
+
rules/common/skill-composition.md: how specialist prompts compose with skill files.
|
|
3
3
|
|
|
4
4
|
Defines the default boundary between what lives in the agent's base prompt and
|
|
5
5
|
what is fetched via `get_skill` at runtime. Aims to keep prompts lean while
|
|
@@ -17,13 +17,13 @@ Every specialist prompt carries a marker:
|
|
|
17
17
|
**Role guidance**: call `get_skill("roles/NAME")` before drafting.
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
When the agent begins substantive work in its domain, it calls `get_skill("roles/NAME")` via the construct-mcp server. The skill body is returned for that turn only
|
|
20
|
+
When the agent begins substantive work in its domain, it calls `get_skill("roles/NAME")` via the construct-mcp server. The skill body is returned for that turn only: no permanent prompt budget is consumed.
|
|
21
21
|
|
|
22
22
|
All hosts Construct supports (Claude Code, OpenCode, Codex, Copilot) have `get_skill` available through the construct-mcp server, so the runtime call is reliable.
|
|
23
23
|
|
|
24
24
|
## Why on-demand is the default
|
|
25
25
|
|
|
26
|
-
Inlining every role skill at sync time used to consume ~1000–2000 words of prompt budget per specialist, regardless of whether the skill content was relevant to the current task. That budget is fixed
|
|
26
|
+
Inlining every role skill at sync time used to consume ~1000–2000 words of prompt budget per specialist, regardless of whether the skill content was relevant to the current task. That budget is fixed: it reduces the window available for actual context.
|
|
27
27
|
|
|
28
28
|
On-demand loading means:
|
|
29
29
|
|
|
@@ -40,20 +40,20 @@ Set `preloadRoleGuidance: true` on a registry entry only when:
|
|
|
40
40
|
- The role content is so load-bearing that every single turn needs it
|
|
41
41
|
- The agent's model is weak at tool-calling discipline and skips the `get_skill` call in practice
|
|
42
42
|
|
|
43
|
-
This should be rare. If you find yourself preloading most agents, revisit the reasoning
|
|
43
|
+
This should be rare. If you find yourself preloading most agents, revisit the reasoning: the default exists because the cost is real.
|
|
44
44
|
|
|
45
45
|
## Skill array vs. role guidance
|
|
46
46
|
|
|
47
47
|
Two different mechanisms for two different purposes:
|
|
48
48
|
|
|
49
|
-
- **Registry `skills: [...]` array
|
|
50
|
-
- **Role guidance directive
|
|
49
|
+
- **Registry `skills: [...]` array**: declarative metadata listing which skills the agent is *entitled* to call. Not inlined into the prompt. Used by `list_skills`, routing heuristics, and audit tooling. Add skills here liberally.
|
|
50
|
+
- **Role guidance directive**: the single `**Role guidance**: call get_skill("roles/NAME")` line in the prompt. Points the agent at its role file and (by default) tells it to load on demand. Exactly one per agent.
|
|
51
51
|
|
|
52
52
|
## Contributor guidance
|
|
53
53
|
|
|
54
54
|
When adding or editing a specialist:
|
|
55
55
|
|
|
56
|
-
1. Keep the base prompt short
|
|
56
|
+
1. Keep the base prompt short: role, perspective, productive tension, handoff contract. Under 400 words is normal.
|
|
57
57
|
2. Put domain depth into `skills/roles/NAME.md` and optional flavor overlays like `skills/roles/NAME.FLAVOR.md`.
|
|
58
58
|
3. Leave the role-guidance directive in place. Do not manually inline role content into the prompt body.
|
|
59
59
|
4. Only add `preloadRoleGuidance: true` with a written reason in the registry description.
|
|
@@ -64,4 +64,4 @@ Do not:
|
|
|
64
64
|
|
|
65
65
|
- Paste role-skill content directly into the prompt body "to be safe"
|
|
66
66
|
- Add `preloadRoleGuidance: true` to push a prompt under the cap without fixing the underlying bloat
|
|
67
|
-
- Split a role skill into many tiny files to dodge the cap
|
|
67
|
+
- Split a role skill into many tiny files to dodge the cap: keep the cohesive unit, load it on demand instead
|
package/rules/common/testing.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
rules/common/testing.md
|
|
2
|
+
rules/common/testing.md: test coverage requirements and TDD workflow.
|
|
3
3
|
|
|
4
4
|
Defines minimum 80% coverage, TDD red-green-refactor cycle,
|
|
5
5
|
AAA test structure, and descriptive naming conventions.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
rules/golang/coding-style.md
|
|
2
|
+
rules/golang/coding-style.md: <one-line purpose>
|
|
3
3
|
|
|
4
4
|
<2–6 line summary.>
|
|
5
5
|
-->
|
|
@@ -15,7 +15,7 @@ paths:
|
|
|
15
15
|
|
|
16
16
|
## Formatting
|
|
17
17
|
|
|
18
|
-
- **gofmt** and **goimports** are mandatory
|
|
18
|
+
- **gofmt** and **goimports** are mandatory: no style debates
|
|
19
19
|
|
|
20
20
|
## Design Principles
|
|
21
21
|
|
package/rules/golang/hooks.md
CHANGED
package/rules/golang/patterns.md
CHANGED
package/rules/golang/security.md
CHANGED
package/rules/golang/testing.md
CHANGED
package/rules/python/hooks.md
CHANGED
package/rules/python/patterns.md
CHANGED
package/rules/python/security.md
CHANGED
package/rules/python/testing.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
rules/swift/coding-style.md
|
|
2
|
+
rules/swift/coding-style.md: <one-line purpose>
|
|
3
3
|
|
|
4
4
|
<2–6 line summary.>
|
|
5
5
|
-->
|
|
@@ -19,14 +19,14 @@ paths:
|
|
|
19
19
|
|
|
20
20
|
## Immutability
|
|
21
21
|
|
|
22
|
-
- Prefer `let` over `var
|
|
22
|
+
- Prefer `let` over `var`: define everything as `let` and only change to `var` if the compiler requires it
|
|
23
23
|
- Use `struct` with value semantics by default; use `class` only when identity or reference semantics are needed
|
|
24
24
|
|
|
25
25
|
## Naming
|
|
26
26
|
|
|
27
27
|
Follow [Apple API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/):
|
|
28
28
|
|
|
29
|
-
- Clarity at the point of use
|
|
29
|
+
- Clarity at the point of use: omit needless words
|
|
30
30
|
- Name methods and properties for their roles, not their types
|
|
31
31
|
- Use `static let` for constants over global constants
|
|
32
32
|
|
package/rules/swift/hooks.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
rules/swift/hooks.md
|
|
2
|
+
rules/swift/hooks.md: <one-line purpose>
|
|
3
3
|
|
|
4
4
|
<2–6 line summary.>
|
|
5
5
|
-->
|
|
@@ -18,4 +18,4 @@ paths:
|
|
|
18
18
|
|
|
19
19
|
## Warning
|
|
20
20
|
|
|
21
|
-
Flag `print()` statements
|
|
21
|
+
Flag `print()` statements: use `os.Logger` or structured logging instead for production code.
|
package/rules/swift/patterns.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
rules/swift/patterns.md
|
|
2
|
+
rules/swift/patterns.md: <one-line purpose>
|
|
3
3
|
|
|
4
4
|
<2–6 line summary.>
|
|
5
5
|
-->
|
|
@@ -53,7 +53,7 @@ actor Cache<Key: Hashable & Sendable, Value: Sendable> {
|
|
|
53
53
|
|
|
54
54
|
## Dependency Injection
|
|
55
55
|
|
|
56
|
-
Inject protocols with default parameters
|
|
56
|
+
Inject protocols with default parameters: production uses defaults, tests inject mocks:
|
|
57
57
|
|
|
58
58
|
```swift
|
|
59
59
|
struct UserService {
|
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/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
|
-->
|