syntropic 0.4.0 → 0.5.0

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/bin/syntropic.js CHANGED
@@ -33,20 +33,21 @@ if (!command || args.includes('--help') || args.includes('-h')) {
33
33
 
34
34
  Usage:
35
35
  syntropic init [project-name] Scaffold a new project with the Syntropic pipeline
36
- syntropic add <tool> [tool...] Add support for another AI tool (cursor, windsurf, copilot, claude)
36
+ syntropic add <tool> [tool...] Add support for another AI tool
37
37
  syntropic health Run a local health check
38
38
  syntropic --version Show version
39
39
  syntropic --help Show this help
40
40
 
41
41
  What you get:
42
- - Instruction files for Claude Code, Cursor, Windsurf, and/or GitHub Copilot
42
+ - Instruction files for Claude Code, Cursor, Windsurf, GitHub Copilot, and/or OpenAI Codex
43
+ - SKILL.md for automatic discovery by Claude Code and Codex
43
44
  - Evergreen Rules (EG1-EG9) — a disciplined dev pipeline
44
45
  - Generic agents: dev, qa, research, plan, devops, security (Claude Code)
45
46
  - Daily health check workflow with auto-remediation
46
47
  - PRISM efficiency tracking methodology
47
48
 
48
49
  Flags (init):
49
- --tools claude,cursor,windsurf,copilot Select AI tools (default: all)
50
+ --tools claude,cursor,windsurf,copilot,codex Select AI tools (default: all)
50
51
  --name "My Project" Project name
51
52
  --domain example.com Production domain
52
53
  --test-url /test Test page path
package/commands/add.js CHANGED
@@ -17,10 +17,11 @@ const readline = require('readline');
17
17
  const TEMPLATES_DIR = path.join(__dirname, '..', 'templates');
18
18
 
19
19
  const TOOLS = {
20
- claude: { label: 'Claude Code', file: 'CLAUDE.md', hasAgents: true },
21
- cursor: { label: 'Cursor', file: '.cursorrules', hasAgents: false },
22
- windsurf: { label: 'Windsurf', file: '.windsurfrules', hasAgents: false },
23
- copilot: { label: 'GitHub Copilot', file: '.github/copilot-instructions.md', hasAgents: false },
20
+ claude: { label: 'Claude Code', file: 'CLAUDE.md', hasAgents: true, hasSkills: true },
21
+ cursor: { label: 'Cursor', file: '.cursorrules', hasAgents: false, hasSkills: false },
22
+ windsurf: { label: 'Windsurf', file: '.windsurfrules', hasAgents: false, hasSkills: false },
23
+ copilot: { label: 'GitHub Copilot', file: '.github/copilot-instructions.md', hasAgents: false, hasSkills: false },
24
+ codex: { label: 'OpenAI Codex', file: 'AGENTS.md', hasAgents: false, hasSkills: true },
24
25
  };
25
26
 
26
27
  const TEMPLATE_MAP = {
@@ -28,6 +29,7 @@ const TEMPLATE_MAP = {
28
29
  cursor: ['cursorrules.template', 'tool-append.template'],
29
30
  windsurf: ['windsurfrules.template', 'tool-append.template'],
30
31
  copilot: ['copilot-instructions.template', 'tool-append.template'],
32
+ codex: ['agents-md.template', 'tool-append.template'],
31
33
  };
32
34
 
33
35
  function ask(question) {
@@ -40,6 +42,20 @@ function ask(question) {
40
42
  });
41
43
  }
42
44
 
45
+ function copySkillsDir(src, dest) {
46
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
47
+ const srcPath = path.join(src, entry.name);
48
+ const destPath = path.join(dest, entry.name);
49
+ if (entry.isDirectory()) {
50
+ if (!fs.existsSync(destPath)) fs.mkdirSync(destPath, { recursive: true });
51
+ copySkillsDir(srcPath, destPath);
52
+ } else if (!fs.existsSync(destPath)) {
53
+ fs.copyFileSync(srcPath, destPath);
54
+ console.log(` create ${path.relative(process.cwd(), destPath)}`);
55
+ }
56
+ }
57
+ }
58
+
43
59
  function hasSyntropicMarker(filePath) {
44
60
  if (!fs.existsSync(filePath)) return false;
45
61
  return fs.readFileSync(filePath, 'utf8').includes('<!-- syntropic -->');
@@ -154,7 +170,7 @@ async function run(args) {
154
170
  writeOrAppend(fullTpl, appendTpl, destPath, replacements);
155
171
  }
156
172
 
157
- // If adding Claude, also copy agents
173
+ // If adding Claude, copy agents + skills
158
174
  if (requestedTools.includes('claude')) {
159
175
  const claudeDir = path.join(targetDir, '.claude');
160
176
  const templateClaudeDir = path.join(TEMPLATES_DIR, '.claude');
@@ -183,10 +199,25 @@ async function run(args) {
183
199
  fs.copyFileSync(egSrc, egDest);
184
200
  console.log(` create ${path.relative(process.cwd(), egDest)}`);
185
201
  }
202
+ // Copy skills
203
+ const skillsSrc = path.join(templateClaudeDir, 'skills');
204
+ const skillsDest = path.join(claudeDir, 'skills');
205
+ if (fs.existsSync(skillsSrc)) {
206
+ copySkillsDir(skillsSrc, skillsDest);
207
+ }
186
208
  }
187
209
  }
188
210
  }
189
211
 
212
+ // If adding Codex, copy .agents/skills
213
+ if (requestedTools.includes('codex')) {
214
+ const agentsSrc = path.join(TEMPLATES_DIR, '.agents', 'skills');
215
+ const agentsDest = path.join(targetDir, '.agents', 'skills');
216
+ if (fs.existsSync(agentsSrc)) {
217
+ copySkillsDir(agentsSrc, agentsDest);
218
+ }
219
+ }
220
+
190
221
  console.log(`
191
222
  Done! Added: ${requestedTools.map(t => TOOLS[t].label).join(', ')}
192
223
  `);
@@ -21,6 +21,7 @@ function run() {
21
21
  { name: 'Cursor', path: '.cursorrules' },
22
22
  { name: 'Windsurf', path: '.windsurfrules' },
23
23
  { name: 'GitHub Copilot', path: path.join('.github', 'copilot-instructions.md') },
24
+ { name: 'OpenAI Codex', path: 'AGENTS.md' },
24
25
  ];
25
26
 
26
27
  const foundTools = [];
package/commands/init.js CHANGED
@@ -15,10 +15,11 @@ const readline = require('readline');
15
15
  const TEMPLATES_DIR = path.join(__dirname, '..', 'templates');
16
16
 
17
17
  const TOOLS = {
18
- claude: { label: 'Claude Code', file: 'CLAUDE.md', hasAgents: true },
19
- cursor: { label: 'Cursor', file: '.cursorrules', hasAgents: false },
20
- windsurf: { label: 'Windsurf', file: '.windsurfrules', hasAgents: false },
21
- copilot: { label: 'GitHub Copilot', file: '.github/copilot-instructions.md', hasAgents: false },
18
+ claude: { label: 'Claude Code', file: 'CLAUDE.md', hasAgents: true, hasSkills: true },
19
+ cursor: { label: 'Cursor', file: '.cursorrules', hasAgents: false, hasSkills: false },
20
+ windsurf: { label: 'Windsurf', file: '.windsurfrules', hasAgents: false, hasSkills: false },
21
+ copilot: { label: 'GitHub Copilot', file: '.github/copilot-instructions.md', hasAgents: false, hasSkills: false },
22
+ codex: { label: 'OpenAI Codex', file: 'AGENTS.md', hasAgents: false, hasSkills: true },
22
23
  };
23
24
 
24
25
  function ask(question) {
@@ -147,6 +148,9 @@ function detectTools(targetDir) {
147
148
  if (fs.existsSync(path.join(targetDir, '.github', 'copilot-instructions.md'))) {
148
149
  detected.push('copilot');
149
150
  }
151
+ if (fs.existsSync(path.join(targetDir, 'AGENTS.md')) || fs.existsSync(path.join(targetDir, '.agents'))) {
152
+ detected.push('codex');
153
+ }
150
154
  return detected;
151
155
  }
152
156
 
@@ -202,11 +206,14 @@ async function run(args) {
202
206
 
203
207
  console.log('\n Scaffolding...\n');
204
208
 
205
- // Always exclude CLAUDE.md from copyDir — we handle all instruction files via writeOrAppend
206
- const exclude = ['CLAUDE.md'];
209
+ // Always exclude instruction files from copyDir — we handle them via writeOrAppend
210
+ const exclude = ['CLAUDE.md', 'AGENTS.md'];
207
211
  if (!selectedTools.includes('claude')) {
208
212
  exclude.push('.claude');
209
213
  }
214
+ if (!selectedTools.includes('codex')) {
215
+ exclude.push('.agents');
216
+ }
210
217
 
211
218
  // Copy shared template files (workflows, scripts, agents)
212
219
  copyDir(TEMPLATES_DIR, targetDir, exclude);
@@ -217,6 +224,7 @@ async function run(args) {
217
224
  cursor: ['cursorrules.template', 'tool-append.template'],
218
225
  windsurf: ['windsurfrules.template', 'tool-append.template'],
219
226
  copilot: ['copilot-instructions.template', 'tool-append.template'],
227
+ codex: ['agents-md.template', 'tool-append.template'],
220
228
  };
221
229
 
222
230
  // Generate instruction files — create new or append to existing
@@ -240,13 +248,25 @@ async function run(args) {
240
248
  return ` ${pad}${info.label} instructions`;
241
249
  }).join('\n');
242
250
 
243
- const hasAgents = selectedTools.includes('claude');
251
+ const hasClaude = selectedTools.includes('claude');
252
+ const hasCodex = selectedTools.includes('codex');
253
+ const hasSkills = hasClaude || hasCodex;
254
+
255
+ let extras = '';
256
+ if (hasClaude) {
257
+ extras += '\n .claude/EVERGREEN_RULES.md Full rule reference';
258
+ extras += '\n .claude/commands/*.md Generic agents (dev, qa, research, plan, devops, security)';
259
+ extras += '\n .claude/skills/syntropic-pipeline/ Discoverable skill for Claude Code';
260
+ }
261
+ if (hasCodex) {
262
+ extras += '\n .agents/skills/syntropic-pipeline/ Discoverable skill for Codex';
263
+ }
244
264
 
245
265
  console.log(`
246
266
  Done! Your project is set up with the Syntropic pipeline.
247
267
 
248
268
  What was created:
249
- ${toolFiles}${hasAgents ? '\n .claude/EVERGREEN_RULES.md Full rule reference\n .claude/commands/*.md Generic agents (dev, qa, research, plan, devops, security)' : ''}
269
+ ${toolFiles}${extras}
250
270
  .github/workflows/ Daily health check with auto-remediation
251
271
  scripts/health-check.js Local health check script
252
272
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "syntropic",
3
- "version": "0.4.0",
4
- "description": "Philosophy-as-code development pipeline for Claude Code, Cursor, Windsurf, and GitHub Copilot.",
3
+ "version": "0.5.0",
4
+ "description": "Philosophy-as-code development pipeline for Claude Code, Cursor, Windsurf, GitHub Copilot, and OpenAI Codex.",
5
5
  "bin": {
6
6
  "syntropic": "./bin/syntropic.js"
7
7
  },
@@ -14,6 +14,9 @@
14
14
  "cursor",
15
15
  "windsurf",
16
16
  "github-copilot",
17
+ "openai-codex",
18
+ "agents-md",
19
+ "skill-md",
17
20
  "ai-development",
18
21
  "dev-pipeline",
19
22
  "syntropic"
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: syntropic-pipeline
3
+ description: Use this skill when starting any non-trivial task. It enforces the Syntropic development methodology — a disciplined process that scales to the task size. Invoke before writing code.
4
+ ---
5
+
6
+ # Syntropic Development Pipeline
7
+
8
+ You follow a disciplined development process. Before writing any code, identify the cycle weight:
9
+
10
+ - **Full Cycle** (>3 files or new patterns): Research → Plan → Implement → Review
11
+ - **Lightweight Cycle** (1-3 files, known patterns): Plan → Implement → Review
12
+ - **Minimum Cycle** (trivial/obvious): Implement → Verify
13
+
14
+ **State the cycle before writing any code.** When in doubt, go one level UP.
15
+
16
+ ## Core Rules
17
+
18
+ ### Pre-Flight Loop
19
+ BEFORE every deploy: build must pass, no localhost/127.0.0.1 references in source.
20
+ AFTER every deploy: verify the live URL works.
21
+
22
+ ### Ship and Iterate
23
+ Default: Build → Deploy → Show result.
24
+ Only ask if: Destructive, Expensive, or Irreversible.
25
+
26
+ ### Hypothesis-Driven Debugging
27
+ 1. State hypothesis ("X because Y")
28
+ 2. Test WITHOUT code changes (logs, DB, API)
29
+ 3. Only code if confirmed
30
+ 4. 3rd attempt same issue → STOP, deep investigation
31
+
32
+ ### No Workarounds Without Approval
33
+ Never implement bypass code, temporary hardcoded values, or "fix later" shortcuts without explicit approval.
34
+
35
+ ### Live Site Testing
36
+ All new features go to the test page FIRST.
37
+ DO NOT modify production without explicit approval.
38
+ Workflow: Build on test → push → verify live → promote with approval.
39
+
40
+ ### Session Continuity
41
+ On session reset: re-read project instructions, check git status, verify current state before proceeding.
42
+
43
+ ## Implementation Standards
44
+
45
+ 1. **Read before write** — always read existing code before modifying
46
+ 2. **Match existing patterns** — follow codebase conventions
47
+ 3. **Minimal changes** — only change what's needed
48
+ 4. **No over-engineering** — solve the current problem, not hypothetical future ones
49
+ 5. **Security first** — no injection vulnerabilities, no hardcoded secrets
50
+ 6. **Test what you build** — verify it works before marking done
51
+
52
+ ## Efficiency
53
+
54
+ Before complex tasks: estimate cost vs. value.
55
+ After cycles: note what worked and what was wasteful.
56
+ Better output AND fewer resources. Never sacrifice quality to save tokens.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: syntropic-pipeline
3
+ description: Use this skill when starting any non-trivial task. It enforces the Syntropic development methodology — a disciplined process that scales to the task size. Invoke before writing code.
4
+ ---
5
+
6
+ # Syntropic Development Pipeline
7
+
8
+ You follow a disciplined development process. Before writing any code, identify the cycle weight:
9
+
10
+ - **Full Cycle** (>3 files or new patterns): `/research` → `/plan` → `/dev` → `/qa`
11
+ - **Lightweight Cycle** (1-3 files, known patterns): `/plan` → `/dev` → `/qa`
12
+ - **Minimum Cycle** (trivial/obvious): `/dev` → verify
13
+
14
+ **State the cycle before writing any code.** When in doubt, go one level UP.
15
+
16
+ ## Core Rules
17
+
18
+ ### EG1: Pre-Flight Loop
19
+ BEFORE every deploy: build must pass (`npm run build` or equivalent), no localhost/127.0.0.1 references in source.
20
+ AFTER every deploy: verify the live URL works.
21
+
22
+ ### EG2: Ship and Iterate
23
+ Default: Build → Deploy → Show result.
24
+ Only ask if: Destructive, Expensive, or Irreversible.
25
+
26
+ ### EG3: Hypothesis-Driven Debugging
27
+ 1. State hypothesis ("X because Y")
28
+ 2. Test WITHOUT code changes (logs, DB, API)
29
+ 3. Only code if confirmed
30
+ 4. 3rd attempt same issue → STOP, deep investigation
31
+
32
+ ### EG5: No Workarounds Without Approval
33
+ Never implement bypass code, temporary hardcoded values, or "fix later" shortcuts without explicit approval.
34
+
35
+ ### EG8: Live Site Testing
36
+ All new features go to the test page FIRST.
37
+ DO NOT modify production without explicit approval.
38
+ Workflow: Build on test → push → verify live → promote with approval.
39
+
40
+ ### EG9: Session Continuity
41
+ On session reset: re-read project instructions, check git status, verify current state before proceeding.
42
+
43
+ ## Implementation Standards
44
+
45
+ 1. **Read before write** — always read existing code before modifying
46
+ 2. **Match existing patterns** — follow codebase conventions
47
+ 3. **Minimal changes** — only change what's needed
48
+ 4. **No over-engineering** — solve the current problem, not hypothetical future ones
49
+ 5. **Security first** — no injection vulnerabilities, no hardcoded secrets
50
+ 6. **Test what you build** — verify it works before marking done
51
+
52
+ ## Efficiency (PRISM Methodology)
53
+
54
+ Before complex tasks: estimate cost vs. value.
55
+ After cycles: note what worked and what was wasteful.
56
+ Better output AND fewer resources. Never sacrifice quality to save tokens.
@@ -0,0 +1,84 @@
1
+ <!-- syntropic -->
2
+ # AGENTS.md — {{PROJECT_NAME}}
3
+
4
+ **This file is loaded automatically by Codex. Follow these rules for all work in this project.**
5
+
6
+ ---
7
+
8
+ ## MANDATORY: Implementation Pipeline
9
+
10
+ Before starting ANY task, identify the cycle weight:
11
+
12
+ - **Full Cycle** (>3 files or new patterns): Research → Plan → Implement → Review
13
+ - **Lightweight Cycle** (1-3 files, known patterns): Plan → Implement → Review
14
+ - **Minimum Cycle** (trivial/obvious): Implement → Verify
15
+
16
+ State the cycle before writing any code. When in doubt, go one level UP.
17
+
18
+ ---
19
+
20
+ ## Core Rules
21
+
22
+ ### Pre-Flight Loop
23
+ **BEFORE** every deploy:
24
+ - Build must pass (`npm run build` or equivalent)
25
+ - No localhost/127.0.0.1 references in source
26
+ **AFTER** every deploy: verify the live URL works.
27
+
28
+ ### Ship and Iterate
29
+ Default: Build → Deploy → Show result.
30
+ Only ask if: Destructive, Expensive, or Irreversible.
31
+
32
+ ### Hypothesis-Driven Debugging
33
+ 1. State hypothesis ("X because Y")
34
+ 2. Test WITHOUT code changes (logs, DB, API)
35
+ 3. Only code if confirmed
36
+ 4. 3rd attempt same issue → STOP, deep investigation
37
+
38
+ ### No Workarounds Without Approval
39
+ Never implement bypass code, temporary hardcoded values, or "fix later" shortcuts without explicit approval.
40
+
41
+ ### Live Site Testing
42
+ - Test page: {{TEST_URL}} — all new features go here FIRST
43
+ - Production: {{PROD_URL}} — DO NOT modify without explicit approval
44
+ - Workflow: Build on test → push → verify live → promote with approval
45
+
46
+ ### Session Continuity
47
+ On session reset: re-read this file, check git status, verify current state before proceeding.
48
+
49
+ ---
50
+
51
+ ## Project: {{PROJECT_NAME}}
52
+
53
+ **Production domain:** {{PROD_DOMAIN}}
54
+ **Test page:** {{TEST_URL}}
55
+ **Production page:** {{PROD_URL}}
56
+
57
+ ---
58
+
59
+ ## Efficiency
60
+
61
+ - **Before complex tasks**: estimate cost vs. value
62
+ - **After cycles**: note what worked and what was wasteful
63
+ - Better output AND fewer resources. Never sacrifice quality to save tokens.
64
+
65
+ ---
66
+
67
+ ## Implementation Standards
68
+
69
+ 1. **Read before write** — always read existing code before modifying
70
+ 2. **Match existing patterns** — follow codebase conventions
71
+ 3. **Minimal changes** — only change what's needed
72
+ 4. **No over-engineering** — solve the current problem, not hypothetical future ones
73
+ 5. **Security first** — no injection vulnerabilities, no hardcoded secrets
74
+ 6. **Test what you build** — verify it works before marking done
75
+
76
+ ---
77
+
78
+ ## Communication
79
+
80
+ - Be direct and concise
81
+ - Recommend the objectively best solution
82
+ - If you made a mistake, own it directly
83
+
84
+ <!-- Generated by syntropic — development methodology for AI coding tools (https://npmjs.com/package/syntropic) -->