contextos-agents 1.7.0 → 2.0.0-beta.2
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/.agents/AGENTS.md +1 -1
- package/.agents/adapters/aider/export.js +117 -99
- package/.agents/adapters/claude/export.js +68 -26
- package/.agents/adapters/copilot/export.js +90 -53
- package/.agents/adapters/cursor/export.js +80 -101
- package/.agents/adapters/drift-detector.js +196 -0
- package/.agents/adapters/gemini/export.js +76 -45
- package/.agents/adapters/pure-compiler.js +443 -0
- package/.agents/adapters/zed/export.js +104 -96
- package/.agents/compiled/registry.v2.json +504 -0
- package/.agents/compiled/registry.v2.sha256 +1 -0
- package/.agents/compiler/manifest-compiler.js +963 -0
- package/.agents/compiler/vendor/yaml.LICENSE.txt +13 -0
- package/.agents/compiler/vendor/yaml.SBOM.json +6 -0
- package/.agents/compiler/vendor/yaml.js +139 -0
- package/.agents/core/profiles/init.yaml +25 -0
- package/.agents/core/skills/context-manager/skill.yaml +3 -5
- package/.agents/core/skills/context-os/SKILL.md +3 -6
- package/.agents/core/skills/context-os/skill.yaml +3 -8
- package/.agents/core/skills/engineering-workflow/skill.yaml +1 -7
- package/.agents/core/skills/gemini-precision/skill.yaml +1 -6
- package/.agents/core/skills/gstack-roles/skill.yaml +3 -6
- package/.agents/core/skills/ponytail-mindset/skill.yaml +1 -7
- package/.agents/core/skills/security/skill.yaml +15 -3
- package/.agents/ctx.js +574 -111
- package/.agents/customization-dx.js +282 -0
- package/.agents/doctor.js +719 -64
- package/.agents/filesystem/index.js +71 -0
- package/.agents/filesystem/journaled-transaction.js +451 -0
- package/.agents/filesystem/lockfile-v2.js +275 -0
- package/.agents/filesystem/platform-hardening.js +222 -0
- package/.agents/filesystem/project-lock.js +218 -0
- package/.agents/filesystem/safe-path.js +256 -0
- package/.agents/generated/claude/skills/context-os/SKILL.md +1 -1
- package/.agents/generated/gemini/skills/context-os/SKILL.md +2 -2
- package/.agents/plugins/contextos/plugin.json +1 -1
- package/.agents/plugins.js +259 -60
- package/.agents/profiles.js +486 -51
- package/.agents/resolver.js +50 -534
- package/.agents/schemas/attestation.review.v1.json +111 -0
- package/.agents/schemas/attestation.verification.v1.json +85 -0
- package/.agents/schemas/lockfile.v2.schema.json +134 -0
- package/.agents/schemas/profile.v2.schema.json +114 -0
- package/.agents/schemas/runtime.thread.v1.json +192 -0
- package/.agents/schemas/skill.manifest.v2.json +177 -0
- package/.agents/schemas/verification.spec.v1.json +39 -0
- package/.agents/schemas/workspace.graph.schema.json +106 -0
- package/.agents/transaction-core/event-store.js +288 -0
- package/.agents/transaction-core/idempotency.js +129 -0
- package/.agents/transaction-core/ipc-lock.js +311 -0
- package/.agents/transaction-core/plugin-supply-chain-bundle.js +436 -0
- package/.agents/validate.js +44 -1
- package/.agents/watch.js +354 -102
- package/.agents/workspace/workspace-graph.js +778 -0
- package/README.md +59 -387
- package/benchmarks/v2/analysis/statistics.js +140 -0
- package/benchmarks/v2/analysis/stats.js +69 -0
- package/benchmarks/v2/arms/arm-definitions.js +79 -0
- package/benchmarks/v2/dataset.schema.json +34 -0
- package/benchmarks/v2/evaluators/index.js +25 -0
- package/benchmarks/v2/evaluators/verified-success.js +116 -0
- package/benchmarks/v2/harness/runner.js +88 -0
- package/benchmarks/v2/pilot-tasks.json +392 -0
- package/bin/commands/recover.js +88 -0
- package/bin/commands/update.js +80 -17
- package/bin/commands.js +62 -25
- package/bin/index.js +138 -81
- package/bin/lib/lockfile.js +5 -3
- package/bin/lib/safe-writer.js +34 -3
- package/package.json +85 -72
- package/registry.json +2 -2
- package/registry.v2.schema.json +86 -0
- package/.agents/core/profiles/backend.yaml +0 -47
- package/.agents/core/profiles/enterprise.yaml +0 -46
- package/.agents/core/profiles/frontend.yaml +0 -46
- package/.agents/core/profiles/hackathon.yaml +0 -45
- package/.agents/core/profiles/mvp.yaml +0 -44
- package/.agents/core/profiles/startup.yaml +0 -48
- package/.agents/core/skills/adapters/EXAMPLES.md +0 -19
- package/.agents/core/skills/adapters/SKILL.md +0 -105
- package/.agents/core/skills/adapters/TROUBLESHOOTING.md +0 -7
- package/.agents/core/skills/adapters/VALIDATION.json +0 -12
- package/.agents/core/skills/adapters/skill.yaml +0 -16
- package/.agents/core/skills/architecture-diagrams/SKILL.md +0 -108
- package/.agents/core/skills/architecture-diagrams/VALIDATION.json +0 -12
- package/.agents/core/skills/architecture-diagrams/skill.yaml +0 -12
- package/.agents/core/skills/brutalist-design/SKILL.md +0 -150
- package/.agents/core/skills/brutalist-design/VALIDATION.json +0 -12
- package/.agents/core/skills/brutalist-design/skill.yaml +0 -12
- package/.agents/core/skills/database/EXAMPLES.md +0 -74
- package/.agents/core/skills/database/SKILL.md +0 -101
- package/.agents/core/skills/database/TROUBLESHOOTING.md +0 -18
- package/.agents/core/skills/database/VALIDATION.json +0 -11
- package/.agents/core/skills/database/skill.yaml +0 -31
- package/.agents/core/skills/ddd/EXAMPLES.md +0 -42
- package/.agents/core/skills/ddd/SKILL.md +0 -247
- package/.agents/core/skills/ddd/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/ddd/VALIDATION.json +0 -12
- package/.agents/core/skills/ddd/ddd.md +0 -178
- package/.agents/core/skills/ddd/skill.yaml +0 -17
- package/.agents/core/skills/decisions/EXAMPLES.md +0 -35
- package/.agents/core/skills/decisions/SKILL.md +0 -90
- package/.agents/core/skills/decisions/TROUBLESHOOTING.md +0 -13
- package/.agents/core/skills/decisions/VALIDATION.json +0 -12
- package/.agents/core/skills/decisions/skill.yaml +0 -16
- package/.agents/core/skills/docker/EXAMPLES.md +0 -56
- package/.agents/core/skills/docker/SKILL.md +0 -63
- package/.agents/core/skills/docker/TROUBLESHOOTING.md +0 -18
- package/.agents/core/skills/docker/VALIDATION.json +0 -11
- package/.agents/core/skills/docker/skill.yaml +0 -29
- package/.agents/core/skills/fastapi/EXAMPLES.md +0 -36
- package/.agents/core/skills/fastapi/SKILL.md +0 -148
- package/.agents/core/skills/fastapi/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/fastapi/VALIDATION.json +0 -12
- package/.agents/core/skills/fastapi/fastapi.md +0 -112
- package/.agents/core/skills/fastapi/skill.yaml +0 -17
- package/.agents/core/skills/generators/EXAMPLES.md +0 -19
- package/.agents/core/skills/generators/SKILL.md +0 -112
- package/.agents/core/skills/generators/TROUBLESHOOTING.md +0 -7
- package/.agents/core/skills/generators/VALIDATION.json +0 -12
- package/.agents/core/skills/generators/skill.yaml +0 -25
- package/.agents/core/skills/generators/templates/API.md +0 -77
- package/.agents/core/skills/generators/templates/ARCHITECTURE.md +0 -70
- package/.agents/core/skills/generators/templates/DATABASE.md +0 -42
- package/.agents/core/skills/generators/templates/DECISION.md +0 -46
- package/.agents/core/skills/generators/templates/PRD.md +0 -67
- package/.agents/core/skills/generators/templates/PROJECT_GRAPH.md +0 -56
- package/.agents/core/skills/generators/templates/ROADMAP.md +0 -51
- package/.agents/core/skills/generators/templates/TASKS.md +0 -43
- package/.agents/core/skills/generators/templates/UI.md +0 -73
- package/.agents/core/skills/graphify/EXAMPLES.md +0 -73
- package/.agents/core/skills/graphify/SKILL.md +0 -130
- package/.agents/core/skills/graphify/VALIDATION.json +0 -12
- package/.agents/core/skills/graphify/skill.yaml +0 -18
- package/.agents/core/skills/impeccable-design/EXAMPLES.md +0 -26
- package/.agents/core/skills/impeccable-design/SKILL.md +0 -201
- package/.agents/core/skills/impeccable-design/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/impeccable-design/VALIDATION.json +0 -12
- package/.agents/core/skills/impeccable-design/skill.yaml +0 -20
- package/.agents/core/skills/interview-me/SKILL.md +0 -97
- package/.agents/core/skills/interview-me/VALIDATION.json +0 -12
- package/.agents/core/skills/interview-me/skill.yaml +0 -12
- package/.agents/core/skills/microservices/EXAMPLES.md +0 -38
- package/.agents/core/skills/microservices/SKILL.md +0 -164
- package/.agents/core/skills/microservices/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/microservices/VALIDATION.json +0 -12
- package/.agents/core/skills/microservices/microservices.md +0 -119
- package/.agents/core/skills/microservices/skill.yaml +0 -17
- package/.agents/core/skills/minimalist-design/SKILL.md +0 -113
- package/.agents/core/skills/minimalist-design/VALIDATION.json +0 -12
- package/.agents/core/skills/minimalist-design/skill.yaml +0 -12
- package/.agents/core/skills/nestjs/EXAMPLES.md +0 -40
- package/.agents/core/skills/nestjs/SKILL.md +0 -139
- package/.agents/core/skills/nestjs/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/nestjs/VALIDATION.json +0 -12
- package/.agents/core/skills/nestjs/nestjs.md +0 -103
- package/.agents/core/skills/nestjs/skill.yaml +0 -17
- package/.agents/core/skills/nextjs/EXAMPLES.md +0 -40
- package/.agents/core/skills/nextjs/SKILL.md +0 -163
- package/.agents/core/skills/nextjs/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/nextjs/VALIDATION.json +0 -12
- package/.agents/core/skills/nextjs/nextjs.md +0 -67
- package/.agents/core/skills/nextjs/skill.yaml +0 -17
- package/.agents/core/skills/node/EXAMPLES.md +0 -80
- package/.agents/core/skills/node/SKILL.md +0 -128
- package/.agents/core/skills/node/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/node/VALIDATION.json +0 -12
- package/.agents/core/skills/node/node.md +0 -87
- package/.agents/core/skills/node/skill.yaml +0 -17
- package/.agents/core/skills/performance/EXAMPLES.md +0 -30
- package/.agents/core/skills/performance/SKILL.md +0 -75
- package/.agents/core/skills/performance/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/performance/VALIDATION.json +0 -12
- package/.agents/core/skills/performance/performance.md +0 -52
- package/.agents/core/skills/performance/skill.yaml +0 -17
- package/.agents/core/skills/react/EXAMPLES.md +0 -79
- package/.agents/core/skills/react/SKILL.md +0 -132
- package/.agents/core/skills/react/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/react/VALIDATION.json +0 -12
- package/.agents/core/skills/react/react.md +0 -93
- package/.agents/core/skills/react/skill.yaml +0 -17
- package/.agents/core/skills/react-best-practices/SKILL.md +0 -155
- package/.agents/core/skills/react-best-practices/VALIDATION.json +0 -12
- package/.agents/core/skills/react-best-practices/skill.yaml +0 -14
- package/.agents/core/skills/redesign-audit/SKILL.md +0 -117
- package/.agents/core/skills/redesign-audit/VALIDATION.json +0 -12
- package/.agents/core/skills/redesign-audit/skill.yaml +0 -12
- package/.agents/core/skills/soft-design/SKILL.md +0 -108
- package/.agents/core/skills/soft-design/VALIDATION.json +0 -12
- package/.agents/core/skills/soft-design/skill.yaml +0 -12
- package/.agents/core/skills/state-management/EXAMPLES.md +0 -56
- package/.agents/core/skills/state-management/SKILL.md +0 -48
- package/.agents/core/skills/state-management/TROUBLESHOOTING.md +0 -18
- package/.agents/core/skills/state-management/VALIDATION.json +0 -11
- package/.agents/core/skills/state-management/skill.yaml +0 -28
- package/.agents/core/skills/subagent-orchestrator/SKILL.md +0 -117
- package/.agents/core/skills/subagent-orchestrator/VALIDATION.json +0 -12
- package/.agents/core/skills/subagent-orchestrator/skill.yaml +0 -12
- package/.agents/core/skills/system-design/EXAMPLES.md +0 -75
- package/.agents/core/skills/system-design/SKILL.md +0 -419
- package/.agents/core/skills/system-design/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/system-design/VALIDATION.json +0 -12
- package/.agents/core/skills/system-design/skill.yaml +0 -20
- package/.agents/core/skills/system-design/system-design.md +0 -112
- package/.agents/core/skills/testing/EXAMPLES.md +0 -71
- package/.agents/core/skills/testing/SKILL.md +0 -70
- package/.agents/core/skills/testing/TROUBLESHOOTING.md +0 -18
- package/.agents/core/skills/testing/VALIDATION.json +0 -11
- package/.agents/core/skills/testing/skill.yaml +0 -32
- package/.agents/core/skills/typescript/EXAMPLES.md +0 -64
- package/.agents/core/skills/typescript/SKILL.md +0 -112
- package/.agents/core/skills/typescript/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/typescript/VALIDATION.json +0 -12
- package/.agents/core/skills/typescript/skill.yaml +0 -17
- package/.agents/core/skills/typescript/typescript.md +0 -71
- package/.agents/core/skills/ui-design/EXAMPLES.md +0 -21
- package/.agents/core/skills/ui-design/SKILL.md +0 -124
- package/.agents/core/skills/ui-design/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/ui-design/VALIDATION.json +0 -12
- package/.agents/core/skills/ui-design/skill.yaml +0 -17
- package/.agents/core/skills/ui-design/ui.md +0 -88
- package/.agents/core/skills/ui-ux-pro/EXAMPLES.md +0 -62
- package/.agents/core/skills/ui-ux-pro/SKILL.md +0 -375
- package/.agents/core/skills/ui-ux-pro/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/ui-ux-pro/VALIDATION.json +0 -12
- package/.agents/core/skills/ui-ux-pro/skill.yaml +0 -19
- package/.agents/core/skills/ux-design/EXAMPLES.md +0 -36
- package/.agents/core/skills/ux-design/SKILL.md +0 -116
- package/.agents/core/skills/ux-design/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/ux-design/VALIDATION.json +0 -12
- package/.agents/core/skills/ux-design/skill.yaml +0 -17
- package/.agents/core/skills/ux-design/ux.md +0 -80
- package/.agents/core/skills/vercel-optimize/SKILL.md +0 -83
- package/.agents/core/skills/vercel-optimize/VALIDATION.json +0 -12
- package/.agents/core/skills/vercel-optimize/scripts/collect-signals.mjs +0 -131
- package/.agents/core/skills/vercel-optimize/scripts/gate-investigations.mjs +0 -142
- package/.agents/core/skills/vercel-optimize/scripts/merge-signals.mjs +0 -143
- package/.agents/core/skills/vercel-optimize/scripts/scan-codebase.mjs +0 -174
- package/.agents/core/skills/vercel-optimize/skill.yaml +0 -18
- package/.agents/core/skills/web-accessibility/EXAMPLES.md +0 -39
- package/.agents/core/skills/web-accessibility/SKILL.md +0 -170
- package/.agents/core/skills/web-accessibility/TROUBLESHOOTING.md +0 -19
- package/.agents/core/skills/web-accessibility/VALIDATION.json +0 -12
- package/.agents/core/skills/web-accessibility/accessibility.md +0 -63
- package/.agents/core/skills/web-accessibility/skill.yaml +0 -17
- package/.agents/generated/claude/skills/adapters/SKILL.md +0 -126
- package/.agents/generated/claude/skills/architecture-diagrams/SKILL.md +0 -101
- package/.agents/generated/claude/skills/brutalist-design/SKILL.md +0 -145
- package/.agents/generated/claude/skills/database/SKILL.md +0 -191
- package/.agents/generated/claude/skills/ddd/SKILL.md +0 -305
- package/.agents/generated/claude/skills/decisions/SKILL.md +0 -134
- package/.agents/generated/claude/skills/docker/SKILL.md +0 -135
- package/.agents/generated/claude/skills/fastapi/SKILL.md +0 -200
- package/.agents/generated/claude/skills/generators/SKILL.md +0 -133
- package/.agents/generated/claude/skills/graphify/SKILL.md +0 -198
- package/.agents/generated/claude/skills/impeccable-design/SKILL.md +0 -241
- package/.agents/generated/claude/skills/interview-me/SKILL.md +0 -90
- package/.agents/generated/claude/skills/microservices/SKILL.md +0 -218
- package/.agents/generated/claude/skills/minimalist-design/SKILL.md +0 -108
- package/.agents/generated/claude/skills/nestjs/SKILL.md +0 -195
- package/.agents/generated/claude/skills/nextjs/SKILL.md +0 -219
- package/.agents/generated/claude/skills/node/SKILL.md +0 -224
- package/.agents/generated/claude/skills/performance/SKILL.md +0 -121
- package/.agents/generated/claude/skills/react/SKILL.md +0 -227
- package/.agents/generated/claude/skills/react-best-practices/SKILL.md +0 -146
- package/.agents/generated/claude/skills/redesign-audit/SKILL.md +0 -112
- package/.agents/generated/claude/skills/soft-design/SKILL.md +0 -103
- package/.agents/generated/claude/skills/state-management/SKILL.md +0 -120
- package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +0 -110
- package/.agents/generated/claude/skills/system-design/SKILL.md +0 -507
- package/.agents/generated/claude/skills/testing/SKILL.md +0 -157
- package/.agents/generated/claude/skills/typescript/SKILL.md +0 -192
- package/.agents/generated/claude/skills/ui-design/SKILL.md +0 -161
- package/.agents/generated/claude/skills/ui-ux-pro/SKILL.md +0 -451
- package/.agents/generated/claude/skills/ux-design/SKILL.md +0 -168
- package/.agents/generated/claude/skills/vercel-optimize/SKILL.md +0 -76
- package/.agents/generated/claude/skills/web-accessibility/SKILL.md +0 -225
- package/.agents/generated/gemini/skills/adapters/SKILL.md +0 -135
- package/.agents/generated/gemini/skills/architecture-diagrams/SKILL.md +0 -107
- package/.agents/generated/gemini/skills/brutalist-design/SKILL.md +0 -151
- package/.agents/generated/gemini/skills/database/SKILL.md +0 -200
- package/.agents/generated/gemini/skills/ddd/SKILL.md +0 -314
- package/.agents/generated/gemini/skills/decisions/SKILL.md +0 -143
- package/.agents/generated/gemini/skills/docker/SKILL.md +0 -144
- package/.agents/generated/gemini/skills/fastapi/SKILL.md +0 -209
- package/.agents/generated/gemini/skills/generators/SKILL.md +0 -142
- package/.agents/generated/gemini/skills/graphify/SKILL.md +0 -205
- package/.agents/generated/gemini/skills/impeccable-design/SKILL.md +0 -250
- package/.agents/generated/gemini/skills/interview-me/SKILL.md +0 -96
- package/.agents/generated/gemini/skills/microservices/SKILL.md +0 -227
- package/.agents/generated/gemini/skills/minimalist-design/SKILL.md +0 -114
- package/.agents/generated/gemini/skills/nestjs/SKILL.md +0 -204
- package/.agents/generated/gemini/skills/nextjs/SKILL.md +0 -298
- package/.agents/generated/gemini/skills/node/SKILL.md +0 -323
- package/.agents/generated/gemini/skills/performance/SKILL.md +0 -185
- package/.agents/generated/gemini/skills/react/SKILL.md +0 -332
- package/.agents/generated/gemini/skills/react-best-practices/SKILL.md +0 -152
- package/.agents/generated/gemini/skills/redesign-audit/SKILL.md +0 -118
- package/.agents/generated/gemini/skills/soft-design/SKILL.md +0 -109
- package/.agents/generated/gemini/skills/state-management/SKILL.md +0 -129
- package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +0 -116
- package/.agents/generated/gemini/skills/system-design/SKILL.md +0 -631
- package/.agents/generated/gemini/skills/testing/SKILL.md +0 -166
- package/.agents/generated/gemini/skills/typescript/SKILL.md +0 -275
- package/.agents/generated/gemini/skills/ui-design/SKILL.md +0 -170
- package/.agents/generated/gemini/skills/ui-ux-pro/SKILL.md +0 -460
- package/.agents/generated/gemini/skills/ux-design/SKILL.md +0 -177
- package/.agents/generated/gemini/skills/vercel-optimize/SKILL.md +0 -82
- package/.agents/generated/gemini/skills/web-accessibility/SKILL.md +0 -300
package/.agents/AGENTS.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ContextOS — AI
|
|
1
|
+
# ContextOS — Deterministic context compiler and policy engine for AI coding agents.
|
|
2
2
|
|
|
3
3
|
You are working inside a project managed by **ContextOS**. This file is the **single source of truth** for how you must behave, think, and which skills to activate for every task.
|
|
4
4
|
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { AGENTS_MD_PATH, collectSkillDirectories, extractYamlField, stripFrontmatter, readMeaningfulMarkdown } = require('../shared.js');
|
|
4
|
-
|
|
5
|
-
// Aider config goes to project root
|
|
6
|
-
const CONF_FILE = path.join(process.cwd(), '.aider.conf.yml');
|
|
7
|
-
const CONVENTIONS_FILE = path.join(process.cwd(), 'CONVENTIONS.md');
|
|
8
|
-
|
|
9
1
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Aider uses two complementary files:
|
|
13
|
-
* 1. `.aider.conf.yml` — config file that points Aider to conventions
|
|
14
|
-
* 2. `CONVENTIONS.md` — flat Markdown with all skills compiled in
|
|
15
|
-
*
|
|
16
|
-
* The config tells Aider to load CONVENTIONS.md via `read:` directive and
|
|
17
|
-
* pre-loads it as a read-only context file on every session.
|
|
18
|
-
*
|
|
19
|
-
* Format spec: https://aider.chat/docs/config/aider_conf.html
|
|
2
|
+
* .agents/adapters/aider/export.js
|
|
3
|
+
* ContextOS Aider Pure Adapter (.aider.conf.yml & CONVENTIONS.md)
|
|
20
4
|
*/
|
|
21
5
|
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { AGENTS_MD_PATH, collectSkillDirectories, extractYamlField, stripFrontmatter } = require('../shared.js');
|
|
9
|
+
const { registerAdapter, applyArtifacts, createProvenanceHeader } = require('../pure-compiler.js');
|
|
10
|
+
|
|
11
|
+
const GENERATOR_ID = 'aider@2';
|
|
12
|
+
|
|
13
|
+
function describe() {
|
|
14
|
+
return {
|
|
15
|
+
name: 'aider',
|
|
16
|
+
version: '2.0.0',
|
|
17
|
+
description: 'Compiles configuration and conventions for Aider (.aider.conf.yml and CONVENTIONS.md)',
|
|
18
|
+
targetPattern: '{.aider.conf.yml,CONVENTIONS.md}',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
22
|
function buildSkillSection(skillDir) {
|
|
23
|
-
const skillName
|
|
24
|
-
const skillMdPath
|
|
25
|
-
const yamlPath
|
|
23
|
+
const skillName = path.basename(skillDir);
|
|
24
|
+
const skillMdPath = path.join(skillDir, 'SKILL.md');
|
|
25
|
+
const yamlPath = path.join(skillDir, 'skill.yaml');
|
|
26
26
|
|
|
27
27
|
let title = skillName;
|
|
28
28
|
let description = '';
|
|
@@ -47,93 +47,111 @@ function buildSkillSection(skillDir) {
|
|
|
47
47
|
return `\n## Skill: ${title}\n${descLine}${skillRef}`;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
50
|
+
function render(context) {
|
|
51
|
+
const projectRoot = context?.projectRoot || '.';
|
|
52
|
+
const agentsMdPath = fs.existsSync(path.join(projectRoot, '.agents', 'AGENTS.md'))
|
|
53
|
+
? path.join(projectRoot, '.agents', 'AGENTS.md')
|
|
54
|
+
: AGENTS_MD_PATH;
|
|
55
|
+
|
|
56
|
+
const yamlProv = createProvenanceHeader({
|
|
57
|
+
generator: GENERATOR_ID,
|
|
58
|
+
sourceGraphHash: context?.sourceGraphHash,
|
|
59
|
+
profileId: context?.profileId,
|
|
60
|
+
profileHash: context?.profileHash,
|
|
61
|
+
}, 'yaml');
|
|
62
|
+
|
|
63
|
+
const mdProv = createProvenanceHeader({
|
|
64
|
+
generator: GENERATOR_ID,
|
|
65
|
+
sourceGraphHash: context?.sourceGraphHash,
|
|
66
|
+
profileId: context?.profileId,
|
|
67
|
+
profileHash: context?.profileHash,
|
|
68
|
+
}, 'markdown');
|
|
69
|
+
|
|
70
|
+
// 1. .aider.conf.yml
|
|
71
|
+
const aiderConfContent = [
|
|
72
|
+
yamlProv,
|
|
73
|
+
'# Load project conventions as a read-only context file on every session',
|
|
74
|
+
'read:',
|
|
75
|
+
' - CONVENTIONS.md',
|
|
76
|
+
'',
|
|
77
|
+
'# Auto commit edits with standard git format',
|
|
78
|
+
'auto-commits: true',
|
|
79
|
+
'dirty-commits: true',
|
|
80
|
+
'',
|
|
81
|
+
].join('\n');
|
|
82
|
+
|
|
83
|
+
// 2. CONVENTIONS.md
|
|
84
|
+
const convSections = [];
|
|
85
|
+
convSections.push(
|
|
86
|
+
mdProv +
|
|
87
|
+
`# ContextOS — Project Conventions for Aider\n\n` +
|
|
88
|
+
`> **Core law: Do not read everything. Read only what the current task requires.**\n\n`
|
|
88
89
|
);
|
|
89
90
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
`Before writing a single line of code or plan, state:\n` +
|
|
95
|
-
`\`\`\`\n1. WHAT DOMAIN? → Frontend / Backend / Architecture / Full-Stack / DevOps\n2. WHAT PHASE? → Define / Plan / Build / Verify / Review / Ship\n3. WHAT ROLE? → Declare specialist role for this phase\n\`\`\`\n` +
|
|
96
|
-
`> **Anti-Spam Invariant**: Declare this strictly once at the start of a task or phase. Never repeat before intermediate tool calls or step updates.\n\n` +
|
|
97
|
-
`### Non-Negotiable Rules\n\n` +
|
|
98
|
-
`- **Zero-Assumption Investigation**: Never guess file paths or signatures. Inspect before modifying.\n` +
|
|
99
|
-
`- **Zero-Placeholder Production Code**: Never emit lazy stubs, \`// TODO\`, or partial code.\n` +
|
|
100
|
-
`- **Mandatory Proof-of-Work Verification**: Always run tests and validators before claiming completion.\n` +
|
|
101
|
-
`- **Surgical Blast Radius**: Modify only files strictly within scope.\n` +
|
|
102
|
-
`- **Fast-Track Exception**: Routine maintenance, git commands, version bumps, typo fixes, and diagnostics skip spec/plan ceremonies.\n`
|
|
103
|
-
);
|
|
91
|
+
if (fs.existsSync(agentsMdPath)) {
|
|
92
|
+
const agentsMd = fs.readFileSync(agentsMdPath, 'utf8');
|
|
93
|
+
convSections.push(`## Core Operational Rules\n\n${agentsMd}\n\n---\n`);
|
|
94
|
+
}
|
|
104
95
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
sections.push('| Trigger / Domain | Skill | On-Demand Command |\n');
|
|
109
|
-
sections.push('| --- | --- | --- |\n');
|
|
96
|
+
convSections.push(`\n## Available Specialist Skills\n\n` +
|
|
97
|
+
`Skills are loaded on demand. Use \`/read .agents/skills/<skill>/SKILL.md\` when needed.\n\n` +
|
|
98
|
+
`### Skill Index\n`);
|
|
110
99
|
|
|
111
|
-
const skills = collectSkillDirectories();
|
|
100
|
+
const skills = collectSkillDirectories(context?.profile);
|
|
112
101
|
for (const skill of skills) {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
let tags = skillName;
|
|
116
|
-
if (fs.existsSync(yamlPath)) {
|
|
117
|
-
const yaml = fs.readFileSync(yamlPath, 'utf8');
|
|
118
|
-
const rawTags = extractYamlField(yaml, 'tags');
|
|
119
|
-
if (rawTags) tags = rawTags.replace(/[\[\]]/g, '');
|
|
120
|
-
}
|
|
121
|
-
sections.push(`| \`${tags}\` | **${skillName}** | \`/read .agents/core/skills/${skillName}/SKILL.md\` |\n`);
|
|
102
|
+
const section = buildSkillSection(skill);
|
|
103
|
+
if (section) convSections.push(section);
|
|
122
104
|
}
|
|
123
105
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
106
|
+
return [
|
|
107
|
+
{
|
|
108
|
+
path: '.aider.conf.yml',
|
|
109
|
+
content: aiderConfContent.replace(/\r\n/g, '\n'),
|
|
110
|
+
mediaType: 'application/yaml',
|
|
111
|
+
kind: 'generated-adapter',
|
|
112
|
+
generator: GENERATOR_ID,
|
|
113
|
+
sourceSkillIds: [],
|
|
114
|
+
inputsHash: context?.sourceGraphHash || 'none',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
path: 'CONVENTIONS.md',
|
|
118
|
+
content: convSections.join('\n').replace(/\r\n/g, '\n'),
|
|
119
|
+
mediaType: 'text/markdown',
|
|
120
|
+
kind: 'generated-adapter',
|
|
121
|
+
generator: GENERATOR_ID,
|
|
122
|
+
sourceSkillIds: skills.map(s => path.basename(s)),
|
|
123
|
+
inputsHash: context?.sourceGraphHash || 'none',
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function validate(artifacts) {
|
|
129
|
+
const diagnostics = [];
|
|
130
|
+
for (const art of artifacts) {
|
|
131
|
+
if (!art.content || art.content.length === 0) {
|
|
132
|
+
diagnostics.push({ path: art.path, message: 'Empty artifact content' });
|
|
132
133
|
}
|
|
133
134
|
}
|
|
135
|
+
return diagnostics;
|
|
136
|
+
}
|
|
134
137
|
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
function run(options = {}) {
|
|
139
|
+
const { loadCompilerContext } = require('../pure-compiler.js');
|
|
140
|
+
const projectRoot = options.projectRoot || '.';
|
|
141
|
+
const context = loadCompilerContext(projectRoot, options);
|
|
142
|
+
const artifacts = render(context);
|
|
143
|
+
const result = applyArtifacts(projectRoot, artifacts, { command: 'export aider', context });
|
|
144
|
+
console.log(`✓ Aider export complete: ${result.appliedCount} files applied (tx: ${result.txId})`);
|
|
145
|
+
return result;
|
|
137
146
|
}
|
|
138
147
|
|
|
139
|
-
|
|
148
|
+
const adapter = {
|
|
149
|
+
describe,
|
|
150
|
+
render,
|
|
151
|
+
validate,
|
|
152
|
+
run,
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
registerAdapter('aider', adapter);
|
|
156
|
+
|
|
157
|
+
module.exports = adapter;
|
|
@@ -1,55 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .agents/adapters/claude/export.js
|
|
3
|
+
* ContextOS Claude Code Pure Adapter
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
const fs = require('fs');
|
|
2
7
|
const path = require('path');
|
|
3
|
-
const { collectSkillDirectories,
|
|
8
|
+
const { collectSkillDirectories, readMeaningfulMarkdown } = require('../shared.js');
|
|
9
|
+
const { registerAdapter, applyArtifacts } = require('../pure-compiler.js');
|
|
4
10
|
|
|
5
|
-
const
|
|
11
|
+
const GENERATOR_ID = 'claude@2';
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
function describe() {
|
|
14
|
+
return {
|
|
15
|
+
name: 'claude',
|
|
16
|
+
version: '2.0.0',
|
|
17
|
+
description: 'Compiles clean markdown skills for Claude Code CLI',
|
|
18
|
+
targetPattern: '.agents/generated/claude/skills/**/SKILL.md',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function renderClaudeSkill(skillDir, context) {
|
|
14
23
|
const skillName = path.basename(skillDir);
|
|
15
24
|
const existingSkillMdPath = path.join(skillDir, 'SKILL.md');
|
|
16
|
-
const outputDir = path.join(GENERATED_SKILLS_PATH, skillName);
|
|
17
25
|
|
|
18
26
|
if (!fs.existsSync(existingSkillMdPath)) {
|
|
19
|
-
|
|
20
|
-
return;
|
|
27
|
+
return null;
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
let content = fs.readFileSync(existingSkillMdPath, 'utf8');
|
|
24
|
-
|
|
31
|
+
|
|
25
32
|
const examples = readMeaningfulMarkdown(path.join(skillDir, 'EXAMPLES.md'));
|
|
26
33
|
if (examples) {
|
|
27
34
|
content += '\n\n' + examples;
|
|
28
35
|
}
|
|
29
|
-
|
|
36
|
+
|
|
30
37
|
const troubleshooting = readMeaningfulMarkdown(path.join(skillDir, 'TROUBLESHOOTING.md'));
|
|
31
38
|
if (troubleshooting) {
|
|
32
39
|
content += '\n\n' + troubleshooting;
|
|
33
40
|
}
|
|
34
41
|
|
|
35
|
-
// Strip YAML frontmatter
|
|
42
|
+
// Strip YAML frontmatter
|
|
36
43
|
content = content.replace(/^---[\s\S]*?---\r?\n/, '');
|
|
37
44
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
return {
|
|
46
|
+
path: `.agents/generated/claude/skills/${skillName}/SKILL.md`,
|
|
47
|
+
content: content.trimStart().replace(/\r\n/g, '\n'),
|
|
48
|
+
mediaType: 'text/markdown',
|
|
49
|
+
kind: 'generated-adapter',
|
|
50
|
+
generator: GENERATOR_ID,
|
|
51
|
+
sourceSkillIds: [skillName],
|
|
52
|
+
inputsHash: context?.sourceGraphHash || 'none',
|
|
53
|
+
};
|
|
42
54
|
}
|
|
43
55
|
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
function render(context) {
|
|
57
|
+
const skills = collectSkillDirectories(context?.profile);
|
|
58
|
+
const artifacts = [];
|
|
47
59
|
|
|
48
|
-
const skills = collectSkillDirectories();
|
|
49
60
|
for (const skill of skills) {
|
|
50
|
-
|
|
61
|
+
const art = renderClaudeSkill(skill, context);
|
|
62
|
+
if (art) artifacts.push(art);
|
|
51
63
|
}
|
|
52
|
-
|
|
64
|
+
|
|
65
|
+
return artifacts;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function validate(artifacts) {
|
|
69
|
+
const diagnostics = [];
|
|
70
|
+
for (const art of artifacts) {
|
|
71
|
+
if (!art.content || art.content.length === 0) {
|
|
72
|
+
diagnostics.push({ path: art.path, message: 'Empty artifact content' });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return diagnostics;
|
|
53
76
|
}
|
|
54
77
|
|
|
55
|
-
|
|
78
|
+
function run(options = {}) {
|
|
79
|
+
const { loadCompilerContext } = require('../pure-compiler.js');
|
|
80
|
+
const projectRoot = options.projectRoot || '.';
|
|
81
|
+
const context = loadCompilerContext(projectRoot, options);
|
|
82
|
+
const artifacts = render(context);
|
|
83
|
+
const result = applyArtifacts(projectRoot, artifacts, { command: 'export claude', context });
|
|
84
|
+
console.log(`✓ Claude export complete: ${result.appliedCount} files applied (tx: ${result.txId})`);
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const adapter = {
|
|
89
|
+
describe,
|
|
90
|
+
render,
|
|
91
|
+
validate,
|
|
92
|
+
run,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
registerAdapter('claude', adapter);
|
|
96
|
+
|
|
97
|
+
module.exports = adapter;
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { AGENTS_MD_PATH, collectSkillDirectories, extractYamlField, stripFrontmatter, readMeaningfulMarkdown } = require('../shared.js');
|
|
4
|
-
|
|
5
|
-
// GitHub Copilot reads from .github/copilot-instructions.md
|
|
6
|
-
const OUTPUT_FILE = path.join(process.cwd(), '.github', 'copilot-instructions.md');
|
|
7
|
-
|
|
8
1
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Copilot reads `.github/copilot-instructions.md` as a plain Markdown file.
|
|
12
|
-
* We compile AGENTS.md + all skills into one document with clear section
|
|
13
|
-
* headings so Copilot can reference them contextually.
|
|
14
|
-
*
|
|
15
|
-
* Format spec: https://docs.github.com/en/copilot/customizing-copilot/adding-repository-instructions
|
|
2
|
+
* .agents/adapters/copilot/export.js
|
|
3
|
+
* ContextOS GitHub Copilot Pure Adapter (.github/copilot-instructions.md)
|
|
16
4
|
*/
|
|
17
5
|
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { collectSkillDirectories, extractYamlField, stripFrontmatter } = require('../shared.js');
|
|
9
|
+
const { registerAdapter, applyArtifacts, createProvenanceHeader } = require('../pure-compiler.js');
|
|
10
|
+
|
|
11
|
+
const GENERATOR_ID = 'copilot@2';
|
|
12
|
+
|
|
13
|
+
function describe() {
|
|
14
|
+
return {
|
|
15
|
+
name: 'copilot',
|
|
16
|
+
version: '2.0.0',
|
|
17
|
+
description: 'Compiles instructions for GitHub Copilot (.github/copilot-instructions.md)',
|
|
18
|
+
targetPattern: '.github/copilot-instructions.md',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
function buildSkillSection(skillDir) {
|
|
19
|
-
const skillName
|
|
20
|
-
const skillMdPath
|
|
21
|
-
const yamlPath
|
|
23
|
+
const skillName = path.basename(skillDir);
|
|
24
|
+
const skillMdPath = path.join(skillDir, 'SKILL.md');
|
|
25
|
+
const yamlPath = path.join(skillDir, 'skill.yaml');
|
|
22
26
|
|
|
23
27
|
let title = skillName;
|
|
24
28
|
let description = '';
|
|
@@ -43,40 +47,39 @@ function buildSkillSection(skillDir) {
|
|
|
43
47
|
return `\n### ${title}\n${descLine}${skillRef}`;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
function
|
|
47
|
-
console.log('Starting GitHub Copilot adapter export...');
|
|
48
|
-
|
|
50
|
+
function render(context) {
|
|
49
51
|
const lines = [];
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
const prov = createProvenanceHeader({
|
|
54
|
+
generator: GENERATOR_ID,
|
|
55
|
+
sourceGraphHash: context?.sourceGraphHash,
|
|
56
|
+
profileId: context?.profileId,
|
|
57
|
+
profileHash: context?.profileHash,
|
|
58
|
+
});
|
|
59
|
+
|
|
52
60
|
lines.push(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
prov +
|
|
62
|
+
`# GitHub Copilot Instructions — ContextOS\n\n` +
|
|
63
|
+
`## Project Rules\n\n` +
|
|
64
|
+
`### Step 0 — Identify Before Acting\n\n` +
|
|
65
|
+
`Before writing a single line of code or plan, state:\n` +
|
|
66
|
+
`\`\`\`\n1. WHAT DOMAIN? → Frontend / Backend / Architecture / Full-Stack / DevOps\n2. WHAT PHASE? → Define / Plan / Build / Verify / Review / Ship\n3. WHAT ROLE? → Declare specialist role for this phase\n\`\`\`\n\n` +
|
|
67
|
+
`> **Anti-Spam Invariant**: Declare this strictly once at the start of a task or phase. Never repeat before intermediate tool calls or step updates.\n\n` +
|
|
68
|
+
`### Non-Negotiable Rules\n\n` +
|
|
69
|
+
`- **Zero-Assumption Investigation**: Never guess file paths or signatures. Inspect before modifying.\n` +
|
|
70
|
+
`- **Zero-Placeholder Production Code**: Never emit lazy stubs, \`// TODO\`, or partial code.\n` +
|
|
71
|
+
`- **Mandatory Proof-of-Work Verification**: Always run tests and validators before claiming completion.\n` +
|
|
72
|
+
`- **Surgical Blast Radius**: Modify only files strictly within scope.\n` +
|
|
73
|
+
`- **Fast-Track Exception**: Routine maintenance, git commands, version bumps, typo fixes, and diagnostics skip spec/plan ceremonies.\n\n` +
|
|
74
|
+
`---\n\n` +
|
|
75
|
+
`## Skills Library\n\n` +
|
|
76
|
+
`ContextOS uses on-demand progressive disclosure. Read the relevant \`SKILL.md\` file only when your task matches the trigger.\n\n` +
|
|
77
|
+
`### Skill Routing Table\n\n` +
|
|
78
|
+
`| Trigger / Domain | Skill | Path |\n` +
|
|
79
|
+
`| --- | --- | --- |\n`
|
|
56
80
|
);
|
|
57
81
|
|
|
58
|
-
|
|
59
|
-
lines.push(`## Project Rules\n\n`);
|
|
60
|
-
lines.push(`### Step 0 — Identify Before Acting\n\n`);
|
|
61
|
-
lines.push(`Before writing a single line of code or plan, state:\n`);
|
|
62
|
-
lines.push(`\`\`\`\n1. WHAT DOMAIN? → Frontend / Backend / Architecture / Full-Stack / DevOps\n2. WHAT PHASE? → Define / Plan / Build / Verify / Review / Ship\n3. WHAT ROLE? → Declare specialist role for this phase\n\`\`\`\n`);
|
|
63
|
-
lines.push(`> **Anti-Spam Invariant**: Declare this strictly once at the start of a task or phase. Never repeat before intermediate tool calls or step updates.\n\n`);
|
|
64
|
-
lines.push(`### Non-Negotiable Rules\n\n`);
|
|
65
|
-
lines.push(`- **Zero-Assumption Investigation**: Never guess file paths or signatures. Inspect before modifying.\n`);
|
|
66
|
-
lines.push(`- **Zero-Placeholder Production Code**: Never emit lazy stubs, \`// TODO\`, or partial code.\n`);
|
|
67
|
-
lines.push(`- **Mandatory Proof-of-Work Verification**: Always run tests and validators before claiming completion.\n`);
|
|
68
|
-
lines.push(`- **Surgical Blast Radius**: Modify only files strictly within scope.\n`);
|
|
69
|
-
lines.push(`- **Fast-Track Exception**: Routine maintenance, git commands, version bumps, typo fixes, and diagnostics skip spec/plan ceremonies.\n\n`);
|
|
70
|
-
lines.push(`---\n`);
|
|
71
|
-
|
|
72
|
-
// ── Skills ───────────────────────────────────────────────────────────────────
|
|
73
|
-
lines.push(`\n## Skills Library\n\n`);
|
|
74
|
-
lines.push(`ContextOS uses on-demand progressive disclosure. Read the relevant \`SKILL.md\` file only when your task matches the trigger.\n\n`);
|
|
75
|
-
lines.push(`### Skill Routing Table\n\n`);
|
|
76
|
-
lines.push(`| Trigger / Domain | Skill | Path |\n`);
|
|
77
|
-
lines.push(`| --- | --- | --- |\n`);
|
|
78
|
-
|
|
79
|
-
const skills = collectSkillDirectories();
|
|
82
|
+
const skills = collectSkillDirectories(context?.profile);
|
|
80
83
|
for (const skill of skills) {
|
|
81
84
|
const skillName = path.basename(skill);
|
|
82
85
|
const yamlPath = path.join(skill, 'skill.yaml');
|
|
@@ -91,19 +94,53 @@ function run() {
|
|
|
91
94
|
}
|
|
92
95
|
lines.push(`\n---\n`);
|
|
93
96
|
|
|
94
|
-
let count = 0;
|
|
95
97
|
for (const skill of skills) {
|
|
96
98
|
const section = buildSkillSection(skill);
|
|
97
99
|
if (section) {
|
|
98
100
|
lines.push(section);
|
|
99
|
-
count++;
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
return [
|
|
105
|
+
{
|
|
106
|
+
path: '.github/copilot-instructions.md',
|
|
107
|
+
content: lines.join('').replace(/\r\n/g, '\n'),
|
|
108
|
+
mediaType: 'text/markdown',
|
|
109
|
+
kind: 'generated-adapter',
|
|
110
|
+
generator: GENERATOR_ID,
|
|
111
|
+
sourceSkillIds: skills.map(s => path.basename(s)),
|
|
112
|
+
inputsHash: context?.sourceGraphHash || 'none',
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function validate(artifacts) {
|
|
118
|
+
const diagnostics = [];
|
|
119
|
+
for (const art of artifacts) {
|
|
120
|
+
if (!art.content || art.content.length === 0) {
|
|
121
|
+
diagnostics.push({ path: art.path, message: 'Empty artifact content' });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return diagnostics;
|
|
107
125
|
}
|
|
108
126
|
|
|
109
|
-
|
|
127
|
+
function run(options = {}) {
|
|
128
|
+
const { loadCompilerContext } = require('../pure-compiler.js');
|
|
129
|
+
const projectRoot = options.projectRoot || '.';
|
|
130
|
+
const context = loadCompilerContext(projectRoot, options);
|
|
131
|
+
const artifacts = render(context);
|
|
132
|
+
const result = applyArtifacts(projectRoot, artifacts, { command: 'export copilot', context });
|
|
133
|
+
console.log(`✓ Copilot export complete: ${result.appliedCount} files applied (tx: ${result.txId})`);
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const adapter = {
|
|
138
|
+
describe,
|
|
139
|
+
render,
|
|
140
|
+
validate,
|
|
141
|
+
run,
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
registerAdapter('copilot', adapter);
|
|
145
|
+
|
|
146
|
+
module.exports = adapter;
|