contextos-agents 2.3.0 → 2.3.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/adapters/cursor/export.js +3 -27
- package/.agents/adapters/gemini/export.js +5 -7
- package/.agents/adapters/shared.js +14 -1
- package/.agents/adapters/zed/export.js +4 -16
- package/.agents/compiled/registry.v2.json +33 -33
- package/.agents/compiled/registry.v2.sha256 +1 -1
- package/.agents/compiler/manifest-compiler.js +8 -5
- package/.agents/core/skills/context-manager/EXAMPLES.md +5 -17
- package/.agents/core/skills/context-manager/SKILL.md +10 -100
- package/.agents/core/skills/context-manager/TROUBLESHOOTING.md +6 -6
- package/.agents/core/skills/context-manager/VALIDATION.json +115 -4
- package/.agents/core/skills/context-manager/references/context-rules.md +3 -57
- package/.agents/core/skills/context-manager/skill.yaml +1 -3
- package/.agents/core/skills/context-os/EXAMPLES.md +25 -15
- package/.agents/core/skills/context-os/SKILL.md +12 -135
- package/.agents/core/skills/context-os/TROUBLESHOOTING.md +11 -6
- package/.agents/core/skills/context-os/VALIDATION.json +115 -4
- package/.agents/core/skills/context-os/packs.yaml +10 -59
- package/.agents/core/skills/context-os/references/context-rules.md +27 -59
- package/.agents/core/skills/context-os/references/pipeline.md +14 -119
- package/.agents/core/skills/context-os/references/project-graph.md +11 -100
- package/.agents/core/skills/context-os/rules.yaml +8 -135
- package/.agents/core/skills/engineering-workflow/EXAMPLES.md +15 -50
- package/.agents/core/skills/engineering-workflow/SKILL.md +10 -10
- package/.agents/core/skills/engineering-workflow/TROUBLESHOOTING.md +11 -19
- package/.agents/core/skills/engineering-workflow/VALIDATION.json +115 -4
- package/.agents/core/skills/engineering-workflow/references/workflow.md +55 -317
- package/.agents/core/skills/gemini-precision/EXAMPLES.md +33 -53
- package/.agents/core/skills/gemini-precision/SKILL.md +11 -147
- package/.agents/core/skills/gemini-precision/TROUBLESHOOTING.md +12 -25
- package/.agents/core/skills/gemini-precision/VALIDATION.json +115 -4
- package/.agents/core/skills/gemini-precision/skill.yaml +1 -1
- package/.agents/core/skills/gstack-roles/EXAMPLES.md +5 -21
- package/.agents/core/skills/gstack-roles/SKILL.md +10 -12
- package/.agents/core/skills/gstack-roles/TROUBLESHOOTING.md +6 -12
- package/.agents/core/skills/gstack-roles/VALIDATION.json +115 -4
- package/.agents/core/skills/gstack-roles/references/roles.md +3 -147
- package/.agents/core/skills/ponytail-mindset/EXAMPLES.md +12 -45
- package/.agents/core/skills/ponytail-mindset/SKILL.md +10 -13
- package/.agents/core/skills/ponytail-mindset/TROUBLESHOOTING.md +10 -19
- package/.agents/core/skills/ponytail-mindset/VALIDATION.json +115 -4
- package/.agents/core/skills/ponytail-mindset/references/minimalism.md +58 -174
- package/.agents/core/skills/security/EXAMPLES.md +19 -55
- package/.agents/core/skills/security/SKILL.md +61 -137
- package/.agents/core/skills/security/TROUBLESHOOTING.md +13 -19
- package/.agents/core/skills/security/VALIDATION.json +115 -4
- package/.agents/core/skills/security/skill.yaml +1 -1
- package/.agents/generated/claude/skills/context-manager/EXAMPLES.md +5 -17
- package/.agents/generated/claude/skills/context-manager/SKILL.md +9 -96
- package/.agents/generated/claude/skills/context-manager/TROUBLESHOOTING.md +6 -6
- package/.agents/generated/claude/skills/context-manager/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/context-manager/references/context-rules.md +3 -57
- package/.agents/generated/claude/skills/context-os/EXAMPLES.md +25 -15
- package/.agents/generated/claude/skills/context-os/SKILL.md +11 -133
- package/.agents/generated/claude/skills/context-os/TROUBLESHOOTING.md +11 -6
- package/.agents/generated/claude/skills/context-os/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/context-os/packs.yaml +10 -59
- package/.agents/generated/claude/skills/context-os/references/context-rules.md +27 -59
- package/.agents/generated/claude/skills/context-os/references/pipeline.md +14 -119
- package/.agents/generated/claude/skills/context-os/references/project-graph.md +11 -100
- package/.agents/generated/claude/skills/context-os/rules.yaml +8 -135
- package/.agents/generated/claude/skills/engineering-workflow/EXAMPLES.md +15 -50
- package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +9 -9
- package/.agents/generated/claude/skills/engineering-workflow/TROUBLESHOOTING.md +11 -19
- package/.agents/generated/claude/skills/engineering-workflow/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/engineering-workflow/references/workflow.md +55 -317
- package/.agents/generated/claude/skills/gemini-precision/EXAMPLES.md +33 -53
- package/.agents/generated/claude/skills/gemini-precision/SKILL.md +10 -143
- package/.agents/generated/claude/skills/gemini-precision/TROUBLESHOOTING.md +12 -25
- package/.agents/generated/claude/skills/gemini-precision/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/gstack-roles/EXAMPLES.md +5 -21
- package/.agents/generated/claude/skills/gstack-roles/SKILL.md +9 -11
- package/.agents/generated/claude/skills/gstack-roles/TROUBLESHOOTING.md +6 -12
- package/.agents/generated/claude/skills/gstack-roles/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/gstack-roles/references/roles.md +3 -147
- package/.agents/generated/claude/skills/ponytail-mindset/EXAMPLES.md +12 -45
- package/.agents/generated/claude/skills/ponytail-mindset/SKILL.md +9 -12
- package/.agents/generated/claude/skills/ponytail-mindset/TROUBLESHOOTING.md +10 -19
- package/.agents/generated/claude/skills/ponytail-mindset/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/ponytail-mindset/references/minimalism.md +58 -174
- package/.agents/generated/claude/skills/security/EXAMPLES.md +19 -55
- package/.agents/generated/claude/skills/security/SKILL.md +60 -134
- package/.agents/generated/claude/skills/security/TROUBLESHOOTING.md +13 -19
- package/.agents/generated/claude/skills/security/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/context-manager/EXAMPLES.md +5 -17
- package/.agents/generated/gemini/skills/context-manager/SKILL.md +10 -99
- package/.agents/generated/gemini/skills/context-manager/TROUBLESHOOTING.md +6 -6
- package/.agents/generated/gemini/skills/context-manager/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/context-manager/references/context-rules.md +3 -57
- package/.agents/generated/gemini/skills/context-os/EXAMPLES.md +25 -15
- package/.agents/generated/gemini/skills/context-os/SKILL.md +12 -135
- package/.agents/generated/gemini/skills/context-os/TROUBLESHOOTING.md +11 -6
- package/.agents/generated/gemini/skills/context-os/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/context-os/packs.yaml +10 -59
- package/.agents/generated/gemini/skills/context-os/references/context-rules.md +27 -59
- package/.agents/generated/gemini/skills/context-os/references/pipeline.md +14 -119
- package/.agents/generated/gemini/skills/context-os/references/project-graph.md +11 -100
- package/.agents/generated/gemini/skills/context-os/rules.yaml +8 -135
- package/.agents/generated/gemini/skills/engineering-workflow/EXAMPLES.md +15 -50
- package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +10 -11
- package/.agents/generated/gemini/skills/engineering-workflow/TROUBLESHOOTING.md +11 -19
- package/.agents/generated/gemini/skills/engineering-workflow/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/engineering-workflow/references/workflow.md +55 -317
- package/.agents/generated/gemini/skills/gemini-precision/EXAMPLES.md +33 -53
- package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +11 -145
- package/.agents/generated/gemini/skills/gemini-precision/TROUBLESHOOTING.md +12 -25
- package/.agents/generated/gemini/skills/gemini-precision/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/gstack-roles/EXAMPLES.md +5 -21
- package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +10 -13
- package/.agents/generated/gemini/skills/gstack-roles/TROUBLESHOOTING.md +6 -12
- package/.agents/generated/gemini/skills/gstack-roles/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/gstack-roles/references/roles.md +3 -147
- package/.agents/generated/gemini/skills/ponytail-mindset/EXAMPLES.md +12 -45
- package/.agents/generated/gemini/skills/ponytail-mindset/SKILL.md +10 -14
- package/.agents/generated/gemini/skills/ponytail-mindset/TROUBLESHOOTING.md +10 -19
- package/.agents/generated/gemini/skills/ponytail-mindset/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/ponytail-mindset/references/minimalism.md +58 -174
- package/.agents/generated/gemini/skills/security/EXAMPLES.md +19 -55
- package/.agents/generated/gemini/skills/security/SKILL.md +61 -136
- package/.agents/generated/gemini/skills/security/TROUBLESHOOTING.md +13 -19
- package/.agents/generated/gemini/skills/security/VALIDATION.json +115 -4
- package/.agents/resolver/canonical-resolver.js +34 -21
- package/.agents/rules/rule-catalog.js +5 -5
- package/.agents/validate.js +9 -2
- package/.agents/validation-evidence.js +89 -0
- package/README.md +132 -197
- package/bin/index.js +1 -1
- package/catalog/skills/typescript/SKILL.md +16 -2
- package/package.json +90 -89
|
@@ -139,7 +139,7 @@ const BUILTIN_RULES = [
|
|
|
139
139
|
level: 'must',
|
|
140
140
|
enforcement: 'runtime',
|
|
141
141
|
checker: 'secret-scanner',
|
|
142
|
-
summary: '
|
|
142
|
+
summary: 'Scan configured inputs for supported credential patterns; report input scope, exclusions, and scanner results',
|
|
143
143
|
applicability: ['all'],
|
|
144
144
|
priority: 100,
|
|
145
145
|
tokenCost: 35,
|
|
@@ -276,9 +276,8 @@ const BUILTIN_RULES = [
|
|
|
276
276
|
id: 'TEST-001',
|
|
277
277
|
sourceSkill: 'testing',
|
|
278
278
|
level: 'must',
|
|
279
|
-
enforcement: '
|
|
280
|
-
|
|
281
|
-
summary: 'Zero unverified claims: mandatory proof-of-work with automated test suite and validator execution',
|
|
279
|
+
enforcement: 'prompt-guidance',
|
|
280
|
+
summary: 'Report completion only with relevant behavioral evidence; document failed and unrun checks and their scope',
|
|
282
281
|
applicability: ['all'],
|
|
283
282
|
priority: 100,
|
|
284
283
|
tokenCost: 45,
|
|
@@ -290,7 +289,7 @@ const BUILTIN_RULES = [
|
|
|
290
289
|
sourceSkill: 'ponytail-mindset',
|
|
291
290
|
level: 'must',
|
|
292
291
|
enforcement: 'prompt-guidance',
|
|
293
|
-
summary: '
|
|
292
|
+
summary: 'Keep changes within the authorized outcome, update the plan for necessary callers, and preserve unrelated edits',
|
|
294
293
|
applicability: ['all'],
|
|
295
294
|
priority: 90,
|
|
296
295
|
tokenCost: 35,
|
|
@@ -420,6 +419,7 @@ class RuleCatalog {
|
|
|
420
419
|
lines.push(` Checker Module : ${checker.module}`);
|
|
421
420
|
lines.push(` Checker Purpose : ${checker.description}`);
|
|
422
421
|
}
|
|
422
|
+
lines.push(' Coverage Note : Registered checker; applies only when invoked on its configured inputs, not proof of the whole workflow.');
|
|
423
423
|
} else {
|
|
424
424
|
lines.push(` Enforcement Note : Governed via agent prompt guidelines (No runtime checker)`);
|
|
425
425
|
}
|
package/.agents/validate.js
CHANGED
|
@@ -413,14 +413,21 @@ function checkValidationJson(sourceSkills) {
|
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
try {
|
|
416
|
-
JSON.parse(fs.readFileSync(valPath, 'utf8'));
|
|
416
|
+
const metadata = JSON.parse(fs.readFileSync(valPath, 'utf8'));
|
|
417
|
+
if (metadata['x-contextos-evidence-contract'] !== undefined) {
|
|
418
|
+
const issues = require('./validation-evidence.js').validateEvidenceSchema(metadata);
|
|
419
|
+
if (issues.length) {
|
|
420
|
+
error(`[validation] ${name}/VALIDATION.json: ${issues.join('; ')}`);
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
417
424
|
pass++;
|
|
418
425
|
} catch (e) {
|
|
419
426
|
error(`[validation] ${name}/VALIDATION.json is invalid JSON: ${e.message}`);
|
|
420
427
|
}
|
|
421
428
|
}
|
|
422
429
|
|
|
423
|
-
info(`[validation] ${pass}
|
|
430
|
+
info(`[validation] ${pass} metadata files structurally valid (not proof of command execution or agent behavior)`);
|
|
424
431
|
}
|
|
425
432
|
|
|
426
433
|
// ═════════════════════════════════════════════════════════════════════════════
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const { isDeepStrictEqual } = require('node:util');
|
|
5
|
+
|
|
6
|
+
// A report contract, not an attestation that a command was actually executed.
|
|
7
|
+
const EVIDENCE_REPORT_SCHEMA = {
|
|
8
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
9
|
+
'x-contextos-evidence-contract': 1,
|
|
10
|
+
title: 'Scoped verification evidence',
|
|
11
|
+
description: 'Report shape and outcome consistency only; command execution and agent behavior require separate evidence.',
|
|
12
|
+
type: 'object',
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
required: ['status', 'checks', 'limitations'],
|
|
15
|
+
properties: {
|
|
16
|
+
status: { enum: ['verified', 'partial', 'not_run'] },
|
|
17
|
+
checks: {
|
|
18
|
+
type: 'array',
|
|
19
|
+
items: {
|
|
20
|
+
type: 'object', additionalProperties: false,
|
|
21
|
+
required: ['command', 'exitCode', 'scope'],
|
|
22
|
+
properties: {
|
|
23
|
+
command: { type: 'string', minLength: 1 },
|
|
24
|
+
exitCode: { type: ['integer', 'null'] },
|
|
25
|
+
scope: { type: 'string', minLength: 1 },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
limitations: { type: 'array', items: { type: 'string', minLength: 1 } },
|
|
30
|
+
},
|
|
31
|
+
allOf: [
|
|
32
|
+
{
|
|
33
|
+
if: { properties: { status: { const: 'verified' } } },
|
|
34
|
+
then: { properties: { checks: { minItems: 1, items: { properties: { exitCode: { const: 0 } } } } } },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
if: { properties: { status: { enum: ['partial', 'not_run'] } } },
|
|
38
|
+
then: { properties: { limitations: { minItems: 1 } } },
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
if: { properties: { status: { const: 'not_run' } } },
|
|
42
|
+
then: { properties: { checks: { items: { properties: { exitCode: { type: 'null' } } } } } },
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
function validateEvidenceSchema(schema) {
|
|
48
|
+
return isDeepStrictEqual(schema, EVIDENCE_REPORT_SCHEMA) ? [] : ['Evidence schema must match the version 1 report contract'];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function validateEvidenceReport(report) {
|
|
52
|
+
const errors = [];
|
|
53
|
+
const object = v => v && typeof v === 'object' && !Array.isArray(v);
|
|
54
|
+
const nonempty = v => typeof v === 'string' && v.trim().length > 0;
|
|
55
|
+
if (!object(report)) return ['Report must be an object'];
|
|
56
|
+
if (Object.keys(report).some(k => !['status', 'checks', 'limitations'].includes(k))) errors.push('Unknown report property');
|
|
57
|
+
if (!['verified', 'partial', 'not_run'].includes(report.status)) errors.push('Invalid status');
|
|
58
|
+
if (!Array.isArray(report.checks)) errors.push('checks must be an array');
|
|
59
|
+
else {
|
|
60
|
+
for (const [i, check] of report.checks.entries()) {
|
|
61
|
+
if (!object(check) || Object.keys(check).some(k => !['command', 'exitCode', 'scope'].includes(k)) ||
|
|
62
|
+
!nonempty(check.command) || !nonempty(check.scope) ||
|
|
63
|
+
!(check.exitCode === null || Number.isInteger(check.exitCode))) {
|
|
64
|
+
errors.push(`Invalid check at index ${i}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (report.status === 'verified' && (!report.checks.length || report.checks.some(c => c?.exitCode !== 0))) {
|
|
68
|
+
errors.push('verified requires at least one successful check and no failed or unrun checks');
|
|
69
|
+
}
|
|
70
|
+
if (report.status === 'not_run' && report.checks.some(c => c?.exitCode !== null)) errors.push('not_run cannot contain executed checks');
|
|
71
|
+
}
|
|
72
|
+
if (!Array.isArray(report.limitations) || report.limitations.some(v => !nonempty(v))) errors.push('limitations must contain nonempty strings');
|
|
73
|
+
else if (report.status !== 'verified' && !report.limitations.length) errors.push('Partial or unrun work needs limitations');
|
|
74
|
+
return errors;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = { EVIDENCE_REPORT_SCHEMA, validateEvidenceSchema, validateEvidenceReport };
|
|
78
|
+
|
|
79
|
+
if (require.main === module) {
|
|
80
|
+
try {
|
|
81
|
+
const report = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'));
|
|
82
|
+
const errors = validateEvidenceReport(report);
|
|
83
|
+
process.stdout.write(JSON.stringify({ ok: errors.length === 0, scope: 'report contract only', errors }) + '\n');
|
|
84
|
+
process.exitCode = errors.length ? 1 : 0;
|
|
85
|
+
} catch (err) {
|
|
86
|
+
process.stderr.write(err.message + '\n');
|
|
87
|
+
process.exitCode = 1;
|
|
88
|
+
}
|
|
89
|
+
}
|
package/README.md
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
<h1 align="center">contextos-agents</h1>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
<strong>
|
|
10
|
+
<strong>Maintain your coding-agent rules in one place.</strong><br />
|
|
11
|
+
Export them to supported tools and catch outdated configs in CI.
|
|
11
12
|
</p>
|
|
12
13
|
|
|
13
14
|
<p align="center">
|
|
@@ -19,247 +20,181 @@
|
|
|
19
20
|
</p>
|
|
20
21
|
|
|
21
22
|
<p align="center">
|
|
22
|
-
<a href="#
|
|
23
|
-
<a href="
|
|
24
|
-
<a href="./
|
|
25
|
-
<a href="./
|
|
26
|
-
<a href="#supported-agents--compilation">Supported Agents</a> •
|
|
27
|
-
<a href="./CONTRIBUTING.md">Contributing</a> •
|
|
28
|
-
<a href="https://www.npmjs.com/package/contextos-agents">npm</a>
|
|
23
|
+
<a href="#quickstart">Quickstart</a> ·
|
|
24
|
+
<a href="#supported-agents">Supported agents</a> ·
|
|
25
|
+
<a href="./GUIDE.md">Guide</a> ·
|
|
26
|
+
<a href="./CONTRIBUTING.md">Contributing</a>
|
|
29
27
|
</p>
|
|
30
28
|
|
|
31
29
|
---
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
Using several coding agents in the same project? A rule updated for one tool can
|
|
32
|
+
leave another tool's configuration behind. ContextOS keeps your rules in
|
|
33
|
+
version-controlled Markdown, exports them to supported agent formats, and checks
|
|
34
|
+
whether those exports still match their sources.
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
It is useful when you or your team maintain instructions across multiple tools
|
|
37
|
+
or need a configuration check before merging changes. If a small, stable
|
|
38
|
+
instruction file already covers your workflow, you may not need an extra tool.
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
npx contextos-agents init
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
By default, ContextOS installs seven core skills: `engineering-workflow`, `ponytail-mindset`, `gemini-precision`, `security`, `context-os`, `context-manager`, and `gstack-roles`, then exports Gemini workspace skills. Supporting examples and references remain separate files. The actual context loaded and session cost depend on your client and task; ContextOS does not control an external client's chat history.
|
|
44
|
-
|
|
45
|
-
Codex also discovers the shared `.agents/skills` directory. The default Cursor
|
|
46
|
-
export always applies only the compact project bootstrap; skill bodies load by
|
|
47
|
-
file patterns or agent request. Resolver token budgets are soft: mandatory safety
|
|
48
|
-
guidance survives with an overflow warning. The experimental MCP prompt assembler
|
|
49
|
-
keeps selected bodies whole and can reject an explicit hard character limit.
|
|
50
|
-
|
|
51
|
-
Want more skills right away? Install pre-packaged presets or the entire catalog:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npx contextos-agents init --preset frontend # React, Next.js, TypeScript, UI/UX, a11y
|
|
55
|
-
npx contextos-agents init --preset backend # System design, API design, Node.js, databases
|
|
56
|
-
npx contextos-agents init --preset devops # Docker, CI/CD, Terraform
|
|
57
|
-
npx contextos-agents init --all # Install all 36 catalog skills at once
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Options
|
|
61
|
-
|
|
62
|
-
Try the [small local demo](examples/quickstart/README.md) to install the current
|
|
63
|
-
candidate in a new folder, select a TypeScript skill, and add a team rule without
|
|
64
|
-
calling a model API. The [five-minute guide](docs/product/onboarding.md) explains
|
|
65
|
-
the same workflow for an existing project.
|
|
66
|
-
|
|
67
|
-
For the current R2 candidates, see the [release preparation status](docs/R2_RELEASE_PREPARATION.md)
|
|
68
|
-
and [upgrade/checkpoint rollback](docs/COMPACT_CONTEXT_MIGRATION.md). The
|
|
69
|
-
[release manifest](docs/evidence/release-2.3.json) records the verified source,
|
|
70
|
-
cross-platform CI and candidate archive identities. The client pilot and
|
|
71
|
-
publication decision remain pending. Internal plans, local API probes
|
|
72
|
-
and raw logs are excluded from the public release surface.
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
npx contextos-agents --help # Show all options
|
|
76
|
-
npx contextos-agents --version # Show version
|
|
77
|
-
npx contextos-agents --minimal # Install only the core bootstrap skills
|
|
78
|
-
npx contextos-agents --all # Install all 36 catalog domain skills during init
|
|
79
|
-
npx contextos-agents --preset <name> # Install stack preset: frontend, backend, devops, full
|
|
80
|
-
npx contextos-agents --profile init # Install with specific profile
|
|
81
|
-
npx contextos-agents --auto # Auto-detect tech stack and apply recommended profile
|
|
82
|
-
npx contextos-agents --dry-run # Preview what will be installed
|
|
83
|
-
npx contextos-agents --force # Overwrite an existing .agents/ folder
|
|
84
|
-
npx contextos-agents --skip-compile # Skip auto-compilation step
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Why ContextOS?
|
|
88
|
-
|
|
89
|
-
Modern development teams face fragmented AI tooling: engineers use Cursor, Claude Code, GitHub Copilot, Gemini, Zed, and Aider. Each tool requires its own proprietary rules format, leading to configuration drift, contradictory standards, and unvetted AI slop (`// TODO`, leaked secrets).
|
|
90
|
-
|
|
91
|
-
Artificially truncating skills to save tokens degrades model reasoning and induces hallucinations. Instead, ContextOS ensures that agents receive complete, high-fidelity engineering context from a single version-controlled source.
|
|
92
|
-
|
|
93
|
-
**ContextOS is not another coding agent.** It is the deterministic context compiler and policy engine for the agents your team already uses.
|
|
94
|
-
|
|
95
|
-
### The Three Pillars
|
|
96
|
-
|
|
97
|
-
1. **Portable (Multi-Agent):** Define your engineering skills once in standard Markdown. ContextOS compiles native configurations for all supported agents (Gemini, Claude Code, Cursor, Copilot, Aider, and Zed).
|
|
98
|
-
2. **High-Fidelity & Focused:** The resolver maps domain skills to relevant tasks without lossy truncation, delivering rich, complete context to the model.
|
|
99
|
-
3. **Verifiable in CI:** Lockfile v2 provenance, dual-hash verification, and CI quality gates detect configuration drift and enforce quality guardrails before merge.
|
|
100
|
-
|
|
101
|
-
## How it works
|
|
102
|
-
|
|
103
|
-
1. Define version-controlled engineering policies once.
|
|
104
|
-
2. Resolve the complete, relevant skill policies for the current task.
|
|
105
|
-
3. Compile native configuration for each coding agent.
|
|
106
|
-
4. Detect configuration drift and policy violations in CI.
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
contextos resolve "review authentication changes" \
|
|
110
|
-
--files src/auth/session.ts \
|
|
111
|
-
--explain
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Selected:
|
|
115
|
-
security explicit task match
|
|
116
|
-
engineering-workflow required dependency
|
|
117
|
-
|
|
118
|
-
Excluded:
|
|
119
|
-
context-manager domain relevance filter
|
|
120
|
-
|
|
121
|
-
Risk: high
|
|
122
|
-
Context status: complete and verified
|
|
123
|
-
|
|
124
|
-
## Dynamic Skill Resolution & Unified CLI (`contextos` / `ctx.js`)
|
|
125
|
-
|
|
126
|
-
ContextOS provides a unified CLI (`contextos` or `npx contextos-agents`) and local engine (`.agents/ctx.js`) to resolve minimal skills on the fly, run health diagnostics, and compile exports for AI assistants.
|
|
127
|
-
|
|
128
|
-
### Dynamic Skill Resolution (`resolve`)
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
# Resolve skills for a task description:
|
|
132
|
-
contextos resolve "Build an accessible modal component with React and Tailwind"
|
|
133
|
-
|
|
134
|
-
# Output:
|
|
135
|
-
# [DOMAIN: Frontend] [PHASE: Build] [ROLE: Senior Developer]
|
|
136
|
-
# Skills loaded: ponytail-mindset, engineering-workflow, gemini-precision
|
|
137
|
-
|
|
138
|
-
# Resolve with full evidence scoring explanation:
|
|
139
|
-
contextos resolve "security review" --files apps/web/app/login/page.tsx --explain
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Skill & Catalog Management (`contextos skill`)
|
|
143
|
-
|
|
144
|
-
Discover, install, and customize skills:
|
|
40
|
+
<p align="center">
|
|
41
|
+
<img src="./assets/contextos-story.gif" alt="One rule changed. Three agent configs fell behind. ContextOS detects stale exports, then refreshes and verifies them." width="960" />
|
|
42
|
+
</p>
|
|
145
43
|
|
|
146
|
-
|
|
147
|
-
# Explore all available catalog skills (36 domain skills):
|
|
148
|
-
contextos skill list --available
|
|
44
|
+
<p align="center"><sub>Change a rule. Catch stale exports. Bring them back in sync.</sub></p>
|
|
149
45
|
|
|
150
|
-
|
|
151
|
-
contextos skill add fastapi
|
|
46
|
+
<a id="installation"></a>
|
|
152
47
|
|
|
153
|
-
|
|
154
|
-
contextos skill add --all
|
|
48
|
+
## Quickstart
|
|
155
49
|
|
|
156
|
-
|
|
157
|
-
|
|
50
|
+
Requires **Node.js 22+** and npm. Run these commands in your project's root.
|
|
51
|
+
This workflow does not call a model API.
|
|
158
52
|
|
|
159
|
-
|
|
160
|
-
contextos skill diff gemini-precision
|
|
53
|
+
**1. Initialize the rule sources.**
|
|
161
54
|
|
|
162
|
-
|
|
163
|
-
contextos
|
|
55
|
+
```sh
|
|
56
|
+
npx contextos-agents init --skip-compile
|
|
164
57
|
```
|
|
165
58
|
|
|
166
|
-
|
|
59
|
+
This installs the seven core skills. We generate the agent files after adding
|
|
60
|
+
your own rule below. See the [guide](GUIDE.md#initialization-options) for presets,
|
|
61
|
+
installation previews, and using a pinned project dependency.
|
|
167
62
|
|
|
168
|
-
|
|
63
|
+
**2. Add a rule your team wants to maintain.**
|
|
169
64
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Supported Agents & Compilation
|
|
65
|
+
Create the folders and save this as
|
|
66
|
+
`.agents/project/skills/team-auth/SKILL.md`:
|
|
175
67
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
| **Aider** | `contextos export aider` | `.aider.conf.yml` + `CONVENTIONS.md` |
|
|
183
|
-
| **Zed IDE** | `contextos export zed` | `.zed/rules.md` + `.zed/prompts/*.md` |
|
|
68
|
+
```markdown
|
|
69
|
+
---
|
|
70
|
+
name: team-auth
|
|
71
|
+
description: Team rules for authentication code.
|
|
72
|
+
---
|
|
73
|
+
# Team security
|
|
184
74
|
|
|
185
|
-
|
|
186
|
-
contextos export all # Compile for all agents
|
|
75
|
+
- Never log authorization headers.
|
|
187
76
|
```
|
|
188
77
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
Scan staged changes directly from the Git index for secret leaks, blocked credential files, unfinished lazy stubs, and write-scope containment:
|
|
78
|
+
**3. Compile, export, and check.**
|
|
192
79
|
|
|
193
|
-
```
|
|
194
|
-
contextos
|
|
195
|
-
contextos
|
|
80
|
+
```sh
|
|
81
|
+
npx contextos-agents compile
|
|
82
|
+
npx contextos-agents export all
|
|
83
|
+
npx contextos-agents export all --check --json
|
|
196
84
|
```
|
|
197
85
|
|
|
198
|
-
|
|
86
|
+
The check should report `"status": "pass"`, `"hasDrift": false`, and exit code
|
|
87
|
+
`0`. The rule is now present in generated files such as
|
|
88
|
+
`.cursor/rules/team-auth.mdc` and `.agents/skills/team-auth/SKILL.md`.
|
|
199
89
|
|
|
200
|
-
|
|
90
|
+
**See drift detection:** add `- Never log session tokens.` to the same source
|
|
91
|
+
file, then run:
|
|
201
92
|
|
|
202
|
-
```
|
|
203
|
-
contextos
|
|
204
|
-
contextos
|
|
93
|
+
```sh
|
|
94
|
+
npx contextos-agents compile
|
|
95
|
+
npx contextos-agents export all --check --json
|
|
205
96
|
```
|
|
206
97
|
|
|
207
|
-
|
|
98
|
+
The check now reports `"status": "drift"` and exits with code `1`: the exports
|
|
99
|
+
are out of date. Run `npx contextos-agents export all` and check again to return
|
|
100
|
+
to `pass`. Commit the source rules, generated files, and lockfile together.
|
|
208
101
|
|
|
209
|
-
|
|
102
|
+
Edit your rules under `.agents/project/skills/`; generated files are managed
|
|
103
|
+
outputs. To use a single adapter, replace `all` with its name, for example
|
|
104
|
+
`cursor`. See the [step-by-step onboarding guide](docs/product/onboarding.md)
|
|
105
|
+
for task selection, client activation, updates, and removal.
|
|
210
106
|
|
|
211
|
-
|
|
212
|
-
contextos gate
|
|
213
|
-
```
|
|
107
|
+
## Check rule changes in CI
|
|
214
108
|
|
|
215
|
-
|
|
109
|
+
After committing a fresh export, run the same consistency check on pull requests.
|
|
110
|
+
It checks agent configuration; your application's tests and security checks
|
|
111
|
+
remain separate.
|
|
216
112
|
|
|
217
|
-
|
|
113
|
+
<details>
|
|
114
|
+
<summary>GitHub Actions example</summary>
|
|
218
115
|
|
|
219
|
-
|
|
116
|
+
Save as `.github/workflows/contextos.yml`:
|
|
220
117
|
|
|
221
118
|
```yaml
|
|
222
|
-
|
|
223
|
-
name: ContextOS Quality Gate
|
|
119
|
+
name: Agent rule consistency
|
|
224
120
|
on: [pull_request, push]
|
|
225
121
|
jobs:
|
|
226
|
-
|
|
122
|
+
check:
|
|
227
123
|
runs-on: ubuntu-latest
|
|
228
124
|
steps:
|
|
229
125
|
- uses: actions/checkout@v4
|
|
230
|
-
- uses: kok-o/contextos-agents/.github/actions/contextos-gate@v2.2
|
|
126
|
+
- uses: kok-o/contextos-agents/.github/actions/contextos-gate@v2.3.2
|
|
231
127
|
with:
|
|
232
|
-
version: '2.2
|
|
233
|
-
adapters: 'all'
|
|
234
|
-
working-directory: '.'
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
The action executes the verified ContextOS quality gate in-process from the pinned package version, verifying generated AI adapter configs against source skills without executing untrusted scripts from pull requests, and without requiring a Node.js project or running `npm test`.
|
|
238
|
-
|
|
239
|
-
## Optional MCP integration (Beta)
|
|
240
|
-
|
|
241
|
-
The MCP server is a separate beta package. It is not part of the stable `contextos-agents` core.
|
|
242
|
-
|
|
243
|
-
Install it separately if you want to try the beta integration:
|
|
244
|
-
|
|
245
|
-
```bash
|
|
246
|
-
npm install --save-dev @contextos/mcp
|
|
247
|
-
npx contextos-mcp --dir .
|
|
128
|
+
version: '2.3.2'
|
|
129
|
+
adapters: 'all'
|
|
130
|
+
working-directory: '.'
|
|
248
131
|
```
|
|
249
132
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
133
|
+
Set `adapters` to the adapter or adapters you actually exported.
|
|
134
|
+
See [CI configuration](GUIDE.md#ci-configuration-check) for version pinning.
|
|
135
|
+
|
|
136
|
+
</details>
|
|
137
|
+
|
|
138
|
+
<a id="supported-agents--compilation"></a>
|
|
139
|
+
|
|
140
|
+
## Supported agents
|
|
141
|
+
|
|
142
|
+
| Agent | How ContextOS provides the rules |
|
|
143
|
+
| --- | --- |
|
|
144
|
+
| Codex | Shared native skills in `.agents/skills/*/SKILL.md`. |
|
|
145
|
+
| Gemini CLI | Shared workspace skills plus Gemini exports. |
|
|
146
|
+
| Claude Code | `CLAUDE.md` index linking to generated instructions. |
|
|
147
|
+
| Cursor | Modular `.cursor/rules/*.mdc` files. |
|
|
148
|
+
| GitHub Copilot | Repository instructions and a skill source index. |
|
|
149
|
+
| Aider | `CONVENTIONS.md` referenced by `.aider.conf.yml`. |
|
|
150
|
+
| Zed | Templates for manual import. |
|
|
151
|
+
|
|
152
|
+
Export tests and live client loading are separate checks. See the
|
|
153
|
+
[compatibility matrix](docs/ADAPTER_COMPATIBILITY.md) for exact paths, tested
|
|
154
|
+
client versions, and limitations, including unverified Antigravity loading.
|
|
155
|
+
|
|
156
|
+
## Beyond the first rule
|
|
157
|
+
|
|
158
|
+
- **Reuse skills:** install catalog skills and stack presets, or keep team
|
|
159
|
+
overrides. See [skill management](GUIDE.md#skill--catalog-management-skill).
|
|
160
|
+
- **Inspect task relevance:** `resolve` recommends skills for a task and explains
|
|
161
|
+
the selection. It does not install or activate them. Ordinary exports use the
|
|
162
|
+
installed skills allowed by the profile, independently of a task's selection.
|
|
163
|
+
See [resolution](GUIDE.md#dynamic-skill-resolution-resolve).
|
|
164
|
+
- **Inspect staged changes:** the separate `scan` command and optional hooks
|
|
165
|
+
check supported secret, placeholder, and write-scope patterns. See
|
|
166
|
+
[scanning and hooks](GUIDE.md#security-scanning--governance-hooks).
|
|
167
|
+
|
|
168
|
+
## Scope and evidence
|
|
169
|
+
|
|
170
|
+
The core CLI manages rule sources, selection, exports, and configuration checks.
|
|
171
|
+
The optional [MCP package](contextos-mcp/README.md) is separate and in beta
|
|
172
|
+
(`npm install --save-dev contextos-mcp`); agent execution and runtime orchestration
|
|
173
|
+
remain experimental.
|
|
174
|
+
|
|
175
|
+
Consistent configuration does not guarantee that a model follows every rule.
|
|
176
|
+
The [recorded calibration](docs/BENCHMARK_RESULTS.md) found no quality advantage
|
|
177
|
+
over vanilla on its test corpus. Install third-party skills only from sources
|
|
178
|
+
you trust: their instructions are not sandboxed.
|
|
179
|
+
|
|
180
|
+
## Documentation
|
|
181
|
+
|
|
182
|
+
| I want to… | Read |
|
|
183
|
+
| --- | --- |
|
|
184
|
+
| Look up commands, presets, profiles, and diagnostics | [Guide and cheat sheet](GUIDE.md) |
|
|
185
|
+
| Try a task with a custom team rule | [Onboarding](docs/product/onboarding.md) |
|
|
186
|
+
| Check agent-specific behavior | [Compatibility matrix](docs/ADAPTER_COMPATIBILITY.md) |
|
|
187
|
+
| Understand the compiler and support boundaries | [Architecture](docs/ARCHITECTURE.md) · [Product boundaries](docs/PRODUCT_BOUNDARIES.md) |
|
|
188
|
+
| Upgrade or recover a previous configuration | [Migration and rollback](docs/COMPACT_CONTEXT_MIGRATION.md) |
|
|
189
|
+
| Review release evidence | [2.3.2 maintenance release](docs/PATCH_RELEASE_2.3.2.md) · [Changelog](CHANGELOG.md) |
|
|
190
|
+
| Reproduce the animated example | [Demo commands and renderer](scripts/readme-gif/STORY.md) |
|
|
258
191
|
|
|
259
192
|
## Contributing
|
|
260
193
|
|
|
261
|
-
|
|
194
|
+
Bug reports, documentation fixes, and examples from real projects are welcome.
|
|
195
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) or
|
|
196
|
+
[open an issue](https://github.com/kok-o/contextos-agents/issues).
|
|
262
197
|
|
|
263
198
|
## License
|
|
264
199
|
|
|
265
|
-
|
|
200
|
+
[Apache-2.0](LICENSE). See [NOTICE](NOTICE) for attribution.
|
package/bin/index.js
CHANGED
|
@@ -100,7 +100,7 @@ Options:
|
|
|
100
100
|
--project <path> Specify target project root directory (default: current directory)
|
|
101
101
|
--target <adapters> Target adapter(s) to verify or export (default: all)
|
|
102
102
|
--github-annotations Emit GitHub Actions workflow commands and step summary
|
|
103
|
-
--with-mcp, --mcp [DEPRECATED] Use the separate
|
|
103
|
+
--with-mcp, --mcp [DEPRECATED] Use the separate contextos-mcp package instead
|
|
104
104
|
--skip-compile Skip running ctx.js export after installation
|
|
105
105
|
--add-skill <ref> Install a community plugin skill after setup
|
|
106
106
|
|
|
@@ -68,9 +68,23 @@ type Result<T> = { ok: true; data: T } | { ok: false; error: string };
|
|
|
68
68
|
|
|
69
69
|
## Type Guards
|
|
70
70
|
|
|
71
|
+
A type guard must validate every required property before narrowing. This checks
|
|
72
|
+
the data shape; a supplied `role` does not establish authorization.
|
|
73
|
+
|
|
74
|
+
<!-- example: typescript-user-guard -->
|
|
75
|
+
|
|
71
76
|
```typescript
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
export interface User {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
role: 'admin' | 'user';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function isUser(value: unknown): value is User {
|
|
84
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
85
|
+
&& 'id' in value && typeof value.id === 'string'
|
|
86
|
+
&& 'name' in value && typeof value.name === 'string'
|
|
87
|
+
&& 'role' in value && (value.role === 'admin' || value.role === 'user');
|
|
74
88
|
}
|
|
75
89
|
```
|
|
76
90
|
|