godpowers 1.6.16 → 1.6.17

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/CHANGELOG.md CHANGED
@@ -5,6 +5,34 @@ All notable changes to Godpowers will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.6.17] - 2026-05-16
9
+
10
+ Autonomous repository documentation sync.
11
+
12
+ ### Added
13
+ - Added `lib/repo-doc-sync.js` to detect and refresh mechanical repository
14
+ documentation claims.
15
+ - Added `docs/repo-doc-sync.md` with auto-invoke, auto-spawn, Pillars, and
16
+ arc-ready closeout behavior.
17
+ - Added behavioral tests for stale repo docs detection, safe mechanical sync,
18
+ sync logging, Pillars planning, and adjacent autonomous sync recommendations.
19
+ - Added missing `/god-export-otel` routing metadata.
20
+
21
+ ### Changed
22
+ - `/god-sync`, `/god-docs`, `/god-doctor`, `/god-status`, and `/god-mode` now
23
+ document repo documentation sync behavior.
24
+ - The dashboard proactive docs check now uses `lib/repo-doc-sync.detect`.
25
+ - Package contents checks now require `lib/repo-doc-sync.js` and
26
+ `routing/god-export-otel.yaml`.
27
+ - Release and contribution docs now describe repo documentation sync as part of
28
+ release readiness.
29
+
30
+ ### Guardrails
31
+ - Detection is read-only by default.
32
+ - Safe apply is limited to mechanical version, badge, and count claims.
33
+ - Narrative changelog, release, contribution, support, and security policy
34
+ changes route to `god-docs-writer` or the maintainer.
35
+
8
36
  ## [1.6.16] - 2026-05-16
9
37
 
10
38
  Feature awareness for existing Godpowers projects.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/aihxp/godpowers/actions/workflows/ci.yml/badge.svg)](https://github.com/aihxp/godpowers/actions/workflows/ci.yml)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
- [![Version](https://img.shields.io/badge/version-1.6.16-blue)](CHANGELOG.md)
5
+ [![Version](https://img.shields.io/badge/version-1.6.17-blue)](CHANGELOG.md)
6
6
  [![npm](https://img.shields.io/npm/v/godpowers.svg)](https://www.npmjs.com/package/godpowers)
7
7
 
8
8
  **Ship fast. Ship right. Ship everything. Ship accountably.**
@@ -12,12 +12,11 @@ idea to hardened production. It runs as **slash commands inside your AI coding
12
12
  tool** (Claude Code, Codex, Cursor, etc.) that orchestrate **specialist agents**
13
13
  in fresh contexts to do the work.
14
14
 
15
- Version 1.6.16 adds feature awareness for existing Godpowers projects. When a
16
- new runtime adds capabilities, `/god-doctor`, `/god-context`, `/god-sync`, and
17
- `/god-mode` can detect stale project awareness, record the current feature set
18
- in `state.json`, refresh AI-tool context fences, and point source-system
19
- migration cases to `/god-migrate` or `god-greenfieldifier` when judgment is
20
- needed.
15
+ Version 1.6.17 adds autonomous repository documentation sync. `/god-sync`,
16
+ `/god-docs`, `/god-doctor`, `/god-status`, and `/god-mode` can now detect stale
17
+ README badges, public surface counts, release docs, contribution guidance,
18
+ security policy, and Pillars context planning needs before a project run is
19
+ declared complete.
21
20
 
22
21
  It fuses four disciplines into one unified workflow:
23
22
 
@@ -361,6 +360,7 @@ Pi. T3 Code inherits from the underlying agent (Codex / Claude / OpenCode).
361
360
  - [Concepts](docs/concepts.md)
362
361
  - [Command reference (all 109 skills + 40 agents)](docs/reference.md)
363
362
  - [Feature awareness](docs/feature-awareness.md)
363
+ - [Repository documentation sync](docs/repo-doc-sync.md)
364
364
  - [Roadmap](docs/ROADMAP.md)
365
365
  - [Release Notes](RELEASE.md)
366
366
  - [Changelog](CHANGELOG.md)
package/RELEASE.md CHANGED
@@ -1,11 +1,12 @@
1
- # Godpowers 1.6.16 Release
1
+ # Godpowers 1.6.17 Release
2
2
 
3
3
  Date: 2026-05-16
4
4
 
5
- Godpowers 1.6.16 adds feature awareness for existing Godpowers projects. After
6
- the installed runtime gains new capabilities, Godpowers can detect stale project
7
- awareness, record the current feature set in `state.json`, refresh AI-tool
8
- context fences, and route migration judgment to the right command or agent.
5
+ Godpowers 1.6.17 adds autonomous repository documentation sync for release
6
+ surfaces and project-run closeout. Godpowers can now detect stale README badges,
7
+ public surface counts, release notes, changelog entries, contribution guidance,
8
+ security policy, and Pillars context planning needs before a sync, docs, doctor,
9
+ status, or god-mode closeout declares the repository current.
9
10
 
10
11
  ## What is stable
11
12
 
@@ -23,46 +24,52 @@ context fences, and route migration judgment to the right command or agent.
23
24
  - Critical harden finding gate before launch
24
25
  - Planning-system migration for GSD, BMAD, and Superpowers
25
26
  - Managed sync-back companion files for imported source systems
27
+ - Feature awareness for existing Godpowers projects
26
28
 
27
29
  ## What is new
28
30
 
29
- - Added `lib/feature-awareness.js`.
30
- - Added `godpowers-features` to `state.v1.json`.
31
- - Added `scripts/test-feature-awareness.js`.
32
- - `/god-doctor`, `/god-context`, `/god-sync`, and `/god-mode` now document the
33
- feature-awareness auto-invoke path.
34
- - `AGENTS.md` refreshes now include `/god-sync`, `/god-migrate`, and
35
- `/god-context refresh` in the useful command list.
31
+ - Added `lib/repo-doc-sync.js`.
32
+ - Added `docs/repo-doc-sync.md`.
33
+ - Added `scripts/test-repo-doc-sync.js`.
34
+ - Added missing `/god-export-otel` routing metadata.
35
+ - `/god-sync`, `/god-docs`, `/god-doctor`, `/god-status`, and `/god-mode` now
36
+ document repo documentation sync integration.
37
+ - The dashboard proactive docs check now reads repo documentation sync status.
38
+ - Package contents checks now require the repo documentation sync helper and
39
+ `/god-export-otel` routing metadata.
36
40
 
37
- ## Awareness behavior
41
+ ## Sync behavior
38
42
 
39
- For an initialized `.godpowers` project, the helper:
43
+ For a Godpowers repository, the helper:
40
44
 
41
- - reads the installed runtime version
42
- - compares the project `godpowers-features` record to the current feature set
43
- - detects missing managed AI-tool context fences
44
- - detects unimported GSD, BMAD, or Superpowers planning artifacts
45
- - writes only safe state metadata and managed context fences when applied
45
+ - reads package version and repository surface counts
46
+ - detects stale mechanical claims in README, user docs, architecture docs,
47
+ roadmap docs, command reference docs, `/god-version`, and `/god-doctor`
48
+ - applies safe mechanical badge, version, and count refreshes when requested
49
+ - plans Pillars sync for changed repo documentation paths
50
+ - recommends `god-docs-writer` for release notes, changelog, contribution,
51
+ support, or security policy prose
46
52
 
47
- Detection is read-only. Applying awareness does not rewrite product, planning,
48
- source-system, or code files outside Godpowers-owned fences.
53
+ Detection is read-only by default. Applying sync does not invent narrative
54
+ release notes, changelog entries, contribution policy, support policy, or
55
+ security support policy.
49
56
 
50
57
  ## Auto-invoke and auto-spawn policy
51
58
 
52
- Feature awareness is local runtime work and must be reported as:
59
+ Safe repo documentation sync is local runtime work and must be reported as:
53
60
 
54
- ```
61
+ ```text
55
62
  Agent: none, local runtime only
56
63
  ```
57
64
 
58
- Godpowers recommends or spawns `god-greenfieldifier` only when imported or
59
- detected planning-system context has low confidence or conflicts that need
60
- migration judgment.
65
+ Godpowers recommends or spawns `god-docs-writer` only when narrative docs need
66
+ claim verification or policy judgment after local mechanical sync has finished.
61
67
 
62
68
  ## Validation
63
69
 
64
70
  Release validation includes:
65
71
 
72
+ - `node scripts/test-repo-doc-sync.js`
66
73
  - `node scripts/test-feature-awareness.js`
67
74
  - `node scripts/test-context-writer.js`
68
75
  - `node scripts/test-planning-systems.js`
@@ -70,5 +77,5 @@ Release validation includes:
70
77
  - `node scripts/validate-skills.js`
71
78
  - `git diff --check`
72
79
 
73
- The `v1.6.16` tag should point to the release commit that matches the npm
74
- `godpowers@1.6.16` package.
80
+ The `v1.6.17` tag should point to the release commit that matches the npm
81
+ `godpowers@1.6.17` package.
package/SKILL.md CHANGED
@@ -154,7 +154,7 @@ Proactive checks:
154
154
  Checkpoint: <fresh | refreshed | missing | stale | conflicts with state.json>
155
155
  Reviews: <none | N pending, suggest /god-review-changes>
156
156
  Sync: <fresh | missing | stale | local helper ran | suggest /god-sync>
157
- Docs: <fresh | possible drift, suggest /god-docs>
157
+ Docs: <fresh | N stale, suggest /god-docs | repo-doc-sync ran>
158
158
  Runtime: <not-applicable | known URL, suggest /god-test-runtime | no known URL, defer deployed verification>
159
159
  Automation: <not configured | N active | available via provider, suggest /god-automation-setup>
160
160
  Security: <clear | sensitive files changed, suggest /god-harden>
@@ -214,7 +214,7 @@ Auto-invoked:
214
214
  Trigger: <what caused this automatic step>
215
215
  Agent: <god-updater | god-context-writer | none, local runtime only>
216
216
  Local syncs:
217
- + <feature-awareness | planning-system-import | reverse-sync | source-sync | pillars-sync | checkpoint-sync | context-refresh>: <result or skipped reason>
217
+ + <feature-awareness | planning-system-import | reverse-sync | source-sync | repo-doc-sync | pillars-sync | checkpoint-sync | context-refresh>: <result or skipped reason>
218
218
  Artifacts: <changed files, no-op, or deferred>
219
219
  Log: <SYNC-LOG.md, CHECKPOINT.md, REVIEW-REQUIRED.md, or none>
220
220
  ```
@@ -242,6 +242,8 @@ Automatic steps that especially need visible reporting:
242
242
  - source-system sync-back during `/god-sync`, `/god-scan`, or `/god-migrate`
243
243
  - feature-awareness refresh during `/god-doctor`, `/god-context`,
244
244
  `/god-sync`, or `/god-mode`
245
+ - repo documentation sync during `/god-sync`, `/god-docs`, `/god-doctor`,
246
+ `/god-status`, or `/god-mode`
245
247
 
246
248
  ### 13. Proactive Auto-Invoke Policy
247
249
  Godpowers should be proactive from disk evidence, not from guesswork. Before
@@ -278,6 +280,10 @@ Run these local runtime helpers automatically when their trigger is present:
278
280
  `lib/feature-awareness.run` during `/god-context`, `/god-sync`, or
279
281
  `/god-mode` when an initialized `.godpowers` project lacks current runtime
280
282
  feature metadata or managed AI-tool context fences.
283
+ - `lib/repo-doc-sync.detect` during `/god-status` and `/god-doctor`, and
284
+ `lib/repo-doc-sync.run` during `/god-sync`, `/god-docs`, or `/god-mode`
285
+ when README badges, public surface counts, release docs, contribution docs,
286
+ or security policy may have drifted.
281
287
  - Context refresh dry-run after `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`,
282
288
  `.cursor/rules/`, `.windsurfrules`, `.github/copilot-instructions.md`,
283
289
  `.clinerules`, `.roo/`, or `.continue/` changes.
@@ -291,6 +297,9 @@ Spawn these agents only when the trigger is direct and scope is bounded:
291
297
  artifacts.
292
298
  - `god-docs-writer` in drift-check mode when docs changed after code changed,
293
299
  or code changed after docs that claim current behavior.
300
+ - `god-docs-writer` when repo-doc-sync reports narrative drift in
301
+ `CHANGELOG.md`, `RELEASE.md`, `CONTRIBUTING.md`, `SECURITY.md`, or
302
+ `SUPPORT.md` after local mechanical sync has finished.
294
303
  - `god-browser-tester` when frontend-visible files changed and a known local,
295
304
  preview, staging, or production URL is evidenced.
296
305
  - `god-harden-auditor` suggestion after security-sensitive files changed;
package/lib/README.md CHANGED
@@ -13,6 +13,7 @@ package-level integrations.
13
13
  | `intent.js` | Read and validate `intent.yaml` from project roots or `.godpowers/`. |
14
14
  | `checkpoint.js` | Create and inspect resumable checkpoint artifacts. |
15
15
  | `feature-awareness.js` | Detect and refresh existing-project awareness after runtime upgrades. |
16
+ | `repo-doc-sync.js` | Detect and refresh mechanical repository documentation surfaces. |
16
17
  | `budget.js` | Read and enforce configured budget controls. |
17
18
  | `cost-tracker.js` | Track token and cost estimates from event streams. |
18
19
 
package/lib/dashboard.js CHANGED
@@ -12,6 +12,7 @@ const cp = require('child_process');
12
12
  const state = require('./state');
13
13
  const router = require('./router');
14
14
  const automationProviders = require('./automation-providers');
15
+ const repoDocSync = require('./repo-doc-sync');
15
16
 
16
17
  const GOD_DIR = '.godpowers';
17
18
  const PRD_PATH = '.godpowers/prd/PRD.md';
@@ -158,12 +159,16 @@ function proactiveChecks(projectRoot, changedFiles = []) {
158
159
  'auth',
159
160
  'security'
160
161
  ]));
162
+ const repoDocs = repoDocSync.detect(projectRoot, { changedFiles });
163
+ const repoDocsStatus = repoDocs.status === 'fresh'
164
+ ? 'fresh'
165
+ : `${repoDocs.stale.length} stale, suggest /god-docs`;
161
166
 
162
167
  return {
163
168
  checkpoint,
164
169
  reviews: reviews > 0 ? `${reviews} pending, suggest /god-review-changes` : 'none',
165
170
  sync,
166
- docs: 'fresh',
171
+ docs: repoDocsStatus,
167
172
  runtime: 'not-applicable',
168
173
  automation: automationSummary(projectRoot),
169
174
  security: sensitiveChanged ? 'sensitive files changed, suggest /god-harden' : 'clear',
@@ -34,6 +34,12 @@ const FEATURES = [
34
34
  since: '1.6.16',
35
35
  commands: ['/god-doctor', '/god-context', '/god-sync', '/god-mode'],
36
36
  description: 'Refresh existing Godpowers projects when the installed runtime gains new capabilities.'
37
+ },
38
+ {
39
+ id: 'repo-documentation-sync',
40
+ since: '1.6.17',
41
+ commands: ['/god-sync', '/god-docs', '/god-doctor', '/god-status', '/god-mode'],
42
+ description: 'Detect and refresh repository documentation surfaces, release docs, and Pillars planning signals.'
37
43
  }
38
44
  ];
39
45
 
package/lib/pillars.js CHANGED
@@ -80,6 +80,15 @@ const KNOWN_PILLARS = {
80
80
  };
81
81
 
82
82
  const ARTIFACT_PILLAR_MAP = [
83
+ { pattern: /^README\.md$/i, pillars: ['context', 'repo'] },
84
+ { pattern: /^CHANGELOG\.md$/i, pillars: ['context', 'deploy'] },
85
+ { pattern: /^RELEASE\.md$/i, pillars: ['context', 'deploy'] },
86
+ { pattern: /^CONTRIBUTING\.md$/i, pillars: ['repo', 'quality'] },
87
+ { pattern: /^SECURITY\.md$/i, pillars: ['security'] },
88
+ { pattern: /^SUPPORT\.md$/i, pillars: ['context'] },
89
+ { pattern: /^docs\/ROADMAP\.md$/i, pillars: ['context', 'quality'] },
90
+ { pattern: /^docs\/reference\.md$/i, pillars: ['repo'] },
91
+ { pattern: /^docs\/repo-doc-sync\.md$/i, pillars: ['repo', 'quality'] },
83
92
  { pattern: /(^|\/)prd\/PRD\.md$/i, pillars: ['context'] },
84
93
  { pattern: /(^|\/)arch\/ARCH\.md$/i, pillars: ['arch'] },
85
94
  { pattern: /(^|\/)arch\/adr\//i, pillars: ['arch'] },
@@ -0,0 +1,392 @@
1
+ /**
2
+ * Repository documentation sync.
3
+ *
4
+ * Keeps mechanical public repository claims aligned with the actual runtime
5
+ * surface. Narrative docs remain human or specialist-agent owned.
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+ const crypto = require('crypto');
11
+
12
+ const pillars = require('./pillars');
13
+
14
+ const LOG_PATH = '.godpowers/docs/REPO-DOC-SYNC.md';
15
+
16
+ function read(projectRoot, relPath) {
17
+ const file = path.join(projectRoot, relPath);
18
+ if (!fs.existsSync(file)) return '';
19
+ return fs.readFileSync(file, 'utf8');
20
+ }
21
+
22
+ function write(projectRoot, relPath, text) {
23
+ const file = path.join(projectRoot, relPath);
24
+ fs.mkdirSync(path.dirname(file), { recursive: true });
25
+ fs.writeFileSync(file, text);
26
+ }
27
+
28
+ function exists(projectRoot, relPath) {
29
+ return fs.existsSync(path.join(projectRoot, relPath));
30
+ }
31
+
32
+ function countFiles(projectRoot, dir, pattern) {
33
+ const full = path.join(projectRoot, dir);
34
+ if (!fs.existsSync(full)) return 0;
35
+ return fs.readdirSync(full).filter((name) => pattern.test(name)).length;
36
+ }
37
+
38
+ function readPackage(projectRoot) {
39
+ const file = path.join(projectRoot, 'package.json');
40
+ if (!fs.existsSync(file)) return {};
41
+ try {
42
+ return JSON.parse(fs.readFileSync(file, 'utf8'));
43
+ } catch (err) {
44
+ return {};
45
+ }
46
+ }
47
+
48
+ function packageVersion(projectRoot) {
49
+ return readPackage(projectRoot).version || 'unknown';
50
+ }
51
+
52
+ function counts(projectRoot) {
53
+ return {
54
+ skills: countFiles(projectRoot, 'skills', /^god.*\.md$/),
55
+ agents: countFiles(projectRoot, 'agents', /^god.*\.md$/),
56
+ workflows: countFiles(projectRoot, 'workflows', /\.yaml$/),
57
+ recipes: countFiles(projectRoot, path.join('routing', 'recipes'), /\.yaml$/)
58
+ };
59
+ }
60
+
61
+ function expectedSurface(projectRoot) {
62
+ const version = packageVersion(projectRoot);
63
+ const surfaceCounts = counts(projectRoot);
64
+ return {
65
+ version,
66
+ counts: surfaceCounts,
67
+ surface: `${surfaceCounts.skills} skills, ${surfaceCounts.agents} agents`,
68
+ commandSurface: `${surfaceCounts.skills} slash commands`,
69
+ workflowSurface: `${surfaceCounts.workflows} workflows`,
70
+ recipeSurface: `${surfaceCounts.recipes} recipes`,
71
+ minorSeries: version.split('.').slice(0, 2).join('.')
72
+ };
73
+ }
74
+
75
+ function includes(projectRoot, relPath, expected) {
76
+ const text = read(projectRoot, relPath);
77
+ return text.includes(expected);
78
+ }
79
+
80
+ function makeCheck(id, relPath, expected, opts = {}) {
81
+ return {
82
+ id,
83
+ path: relPath,
84
+ expected,
85
+ safeFix: opts.safeFix === true,
86
+ owner: opts.owner || (opts.safeFix ? 'local runtime' : 'god-docs-writer'),
87
+ reason: opts.reason || ''
88
+ };
89
+ }
90
+
91
+ function checkDefinitions(projectRoot) {
92
+ const expected = expectedSurface(projectRoot);
93
+ return [
94
+ makeCheck('package-description-surface', 'package.json',
95
+ `${expected.counts.skills} slash commands and ${expected.counts.agents} specialist agents`,
96
+ { safeFix: true, reason: 'package metadata is a mechanical count claim' }),
97
+ makeCheck('readme-version-badge', 'README.md', `version-${expected.version}-blue`,
98
+ { safeFix: true, reason: 'README badge mirrors package version' }),
99
+ makeCheck('readme-reference-counts', 'README.md',
100
+ `all ${expected.counts.skills} skills + ${expected.counts.agents} agents`,
101
+ { safeFix: true, reason: 'README command reference count mirrors files on disk' }),
102
+ makeCheck('users-version', 'USERS.md', `Godpowers is at v${expected.version}. Stable release.`,
103
+ { safeFix: true, reason: 'user support version mirrors package version' }),
104
+ makeCheck('architecture-version', 'ARCHITECTURE.md', `STABLE v${expected.version}`,
105
+ { safeFix: true, reason: 'architecture release marker mirrors package version' }),
106
+ makeCheck('architecture-surface', 'ARCHITECTURE.md',
107
+ `Core: ${expected.surface}, ${expected.workflowSurface}`,
108
+ { safeFix: true, reason: 'architecture surface mirrors repository counts' }),
109
+ makeCheck('roadmap-version', 'docs/ROADMAP.md', `Current shipped: v${expected.version}`,
110
+ { safeFix: true, reason: 'roadmap current shipped marker mirrors package version' }),
111
+ makeCheck('roadmap-command-count', 'docs/ROADMAP.md', `**${expected.commandSurface}**`,
112
+ { safeFix: true, reason: 'roadmap command count mirrors skills directory' }),
113
+ makeCheck('roadmap-agent-count', 'docs/ROADMAP.md',
114
+ `**${expected.counts.agents} specialist agents**`,
115
+ { safeFix: true, reason: 'roadmap agent count mirrors agents directory' }),
116
+ makeCheck('reference-version', 'docs/reference.md', `reference for v${expected.version}`,
117
+ { safeFix: true, reason: 'reference docs version mirrors package version' }),
118
+ makeCheck('reference-command-count', 'docs/reference.md',
119
+ `Slash commands (${expected.counts.skills} total)`,
120
+ { safeFix: true, reason: 'reference command count mirrors skills directory' }),
121
+ makeCheck('reference-agent-count', 'docs/reference.md',
122
+ `Specialist agents (${expected.counts.agents} total)`,
123
+ { safeFix: true, reason: 'reference agent count mirrors agents directory' }),
124
+ makeCheck('god-version-surface', 'skills/god-version.md',
125
+ `Surface: ${expected.surface}, ${expected.workflowSurface}, ${expected.recipeSurface}`,
126
+ { safeFix: true, reason: '/god-version output mirrors repository counts' }),
127
+ makeCheck('god-doctor-skill-count', 'skills/god-doctor.md',
128
+ `[OK] ${expected.counts.skills} skills installed`,
129
+ { safeFix: true, reason: '/god-doctor sample output mirrors skills directory' }),
130
+ makeCheck('god-doctor-agent-count', 'skills/god-doctor.md',
131
+ `[OK] ${expected.counts.agents} agents installed`,
132
+ { safeFix: true, reason: '/god-doctor sample output mirrors agents directory' }),
133
+ makeCheck('release-notes-version', 'RELEASE.md', `Godpowers ${expected.version}`,
134
+ { reason: 'release notes are narrative and should be reviewed before publish' }),
135
+ makeCheck('changelog-version', 'CHANGELOG.md', `## [${expected.version}]`,
136
+ { reason: 'changelog entries are narrative and should be curated' }),
137
+ makeCheck('security-supported-series', 'SECURITY.md', `${expected.minorSeries}.x`,
138
+ { reason: 'supported versions are release policy and should be reviewed' }),
139
+ makeCheck('contributing-release-sync', 'CONTRIBUTING.md', 'repo documentation sync',
140
+ { reason: 'contributor release guidance is narrative policy' })
141
+ ];
142
+ }
143
+
144
+ function detect(projectRoot, opts = {}) {
145
+ const expected = expectedSurface(projectRoot);
146
+ const checks = checkDefinitions(projectRoot).map((check) => {
147
+ const present = exists(projectRoot, check.path);
148
+ const fresh = present && includes(projectRoot, check.path, check.expected);
149
+ return {
150
+ ...check,
151
+ status: !present ? 'missing' : (fresh ? 'fresh' : 'stale')
152
+ };
153
+ });
154
+ const stale = checks.filter((check) => check.status !== 'fresh');
155
+ const safeFixes = stale.filter((check) => check.safeFix);
156
+ const prose = stale.filter((check) => !check.safeFix);
157
+ const changedFiles = opts.changedFiles || [];
158
+ const touchedDocs = changedFiles.filter((file) => isRepoDocPath(file));
159
+ const pillarSyncPlan = touchedDocs.length > 0
160
+ ? pillars.planArtifactSync(projectRoot, touchedDocs, opts)
161
+ : [];
162
+
163
+ return {
164
+ version: expected.version,
165
+ counts: expected.counts,
166
+ status: stale.length === 0 ? 'fresh' : 'stale',
167
+ checks,
168
+ stale,
169
+ safeFixes,
170
+ prose,
171
+ touchedDocs,
172
+ pillarSyncPlan,
173
+ adjacentOpportunities: adjacentOpportunities(),
174
+ spawnRecommendation: prose.length > 0
175
+ ? {
176
+ agent: 'god-docs-writer',
177
+ reason: 'Repo documentation has narrative release, contribution, or security policy drift.',
178
+ paths: [...new Set(prose.map((check) => check.path))].sort()
179
+ }
180
+ : null
181
+ };
182
+ }
183
+
184
+ function replaceOnce(text, regex, replacement) {
185
+ if (!regex.test(text)) return text;
186
+ return text.replace(regex, replacement);
187
+ }
188
+
189
+ function safeFixContent(relPath, text, expected) {
190
+ switch (relPath) {
191
+ case 'package.json':
192
+ return fixPackageDescription(text, expected);
193
+ case 'README.md':
194
+ return replaceOnce(
195
+ replaceOnce(text, /version-[0-9]+\.[0-9]+\.[0-9]+-blue/g, `version-${expected.version}-blue`),
196
+ /all [0-9]+ skills \+ [0-9]+ agents/g,
197
+ `all ${expected.counts.skills} skills + ${expected.counts.agents} agents`
198
+ );
199
+ case 'USERS.md':
200
+ return replaceOnce(text, /Godpowers is at v[0-9]+\.[0-9]+\.[0-9]+\. Stable release\./g,
201
+ `Godpowers is at v${expected.version}. Stable release.`);
202
+ case 'ARCHITECTURE.md':
203
+ return replaceOnce(
204
+ replaceOnce(text, /STABLE v[0-9]+\.[0-9]+\.[0-9]+/g, `STABLE v${expected.version}`),
205
+ /Core: [0-9]+ skills, [0-9]+ agents, [0-9]+ workflows/g,
206
+ `Core: ${expected.surface}, ${expected.workflowSurface}`
207
+ );
208
+ case 'docs/ROADMAP.md':
209
+ return replaceOnce(
210
+ replaceOnce(
211
+ replaceOnce(text, /Current shipped: v[0-9]+\.[0-9]+\.[0-9]+/g,
212
+ `Current shipped: v${expected.version}`),
213
+ /\*\*[0-9]+ slash commands\*\*/g,
214
+ `**${expected.commandSurface}**`
215
+ ),
216
+ /\*\*[0-9]+ specialist agents\*\*/g,
217
+ `**${expected.counts.agents} specialist agents**`
218
+ );
219
+ case 'docs/reference.md':
220
+ return replaceOnce(
221
+ replaceOnce(
222
+ replaceOnce(text, /reference for v[0-9]+\.[0-9]+\.[0-9]+/g,
223
+ `reference for v${expected.version}`),
224
+ /Slash commands \([0-9]+ total\)/g,
225
+ `Slash commands (${expected.counts.skills} total)`
226
+ ),
227
+ /Specialist agents \([0-9]+ total\)/g,
228
+ `Specialist agents (${expected.counts.agents} total)`
229
+ );
230
+ case 'skills/god-version.md':
231
+ return replaceOnce(text,
232
+ /Surface: [0-9]+ skills, [0-9]+ agents, [0-9]+ workflows, [0-9]+ recipes/g,
233
+ `Surface: ${expected.surface}, ${expected.workflowSurface}, ${expected.recipeSurface}`);
234
+ case 'skills/god-doctor.md':
235
+ return replaceOnce(
236
+ replaceOnce(text, /\[OK\] [0-9]+ skills installed/g,
237
+ `[OK] ${expected.counts.skills} skills installed`),
238
+ /\[OK\] [0-9]+ agents installed/g,
239
+ `[OK] ${expected.counts.agents} agents installed`
240
+ );
241
+ default:
242
+ return text;
243
+ }
244
+ }
245
+
246
+ function fixPackageDescription(text, expected) {
247
+ try {
248
+ const parsed = JSON.parse(text);
249
+ if (typeof parsed.description === 'string') {
250
+ parsed.description = parsed.description.replace(
251
+ /[0-9]+ slash commands and [0-9]+ specialist agents/g,
252
+ `${expected.counts.skills} slash commands and ${expected.counts.agents} specialist agents`
253
+ );
254
+ }
255
+ return `${JSON.stringify(parsed, null, 2)}\n`;
256
+ } catch (err) {
257
+ return text;
258
+ }
259
+ }
260
+
261
+ function isRepoDocPath(file) {
262
+ return [
263
+ 'README.md',
264
+ 'CHANGELOG.md',
265
+ 'RELEASE.md',
266
+ 'CONTRIBUTING.md',
267
+ 'SECURITY.md',
268
+ 'SUPPORT.md',
269
+ 'AGENTS.md'
270
+ ].includes(file) || file.startsWith('docs/');
271
+ }
272
+
273
+ function appendLog(projectRoot, before, after, applied) {
274
+ const now = new Date().toISOString();
275
+ const lines = [];
276
+ if (exists(projectRoot, LOG_PATH)) {
277
+ lines.push(read(projectRoot, LOG_PATH).replace(/\s*$/, ''));
278
+ lines.push('');
279
+ } else {
280
+ lines.push('# Repo Documentation Sync Log');
281
+ lines.push('');
282
+ lines.push('- [DECISION] This file records mechanical repository documentation syncs run by Godpowers.');
283
+ lines.push('- [DECISION] Narrative release, contribution, support, and security policy prose remains owned by humans or `god-docs-writer`.');
284
+ lines.push('');
285
+ }
286
+ lines.push(`## ${now}`);
287
+ lines.push('');
288
+ lines.push(`- [DECISION] Repo documentation sync status before apply was ${before.status}.`);
289
+ lines.push(`- [DECISION] Repo documentation sync status after apply is ${after.status}.`);
290
+ if (applied.length === 0) {
291
+ lines.push('- [DECISION] No mechanical repo documentation files were changed.');
292
+ } else {
293
+ for (const item of applied) {
294
+ lines.push(`- [DECISION] Refreshed ${item.path} for ${item.checks.join(', ')}.`);
295
+ }
296
+ }
297
+ if (after.spawnRecommendation) {
298
+ lines.push(`- [HYPOTHESIS] ${after.spawnRecommendation.agent} should review ${after.spawnRecommendation.paths.join(', ')}.`);
299
+ }
300
+ lines.push('');
301
+ write(projectRoot, LOG_PATH, lines.join('\n'));
302
+ }
303
+
304
+ function run(projectRoot, opts = {}) {
305
+ const before = detect(projectRoot, opts);
306
+ const expected = expectedSurface(projectRoot);
307
+ const byPath = new Map();
308
+ const applied = [];
309
+
310
+ for (const check of before.safeFixes) {
311
+ if (!byPath.has(check.path)) byPath.set(check.path, []);
312
+ byPath.get(check.path).push(check);
313
+ }
314
+
315
+ for (const [relPath, checks] of byPath.entries()) {
316
+ const original = read(projectRoot, relPath);
317
+ if (!original) continue;
318
+ const next = safeFixContent(relPath, original, expected);
319
+ if (next !== original) {
320
+ write(projectRoot, relPath, next);
321
+ applied.push({
322
+ path: relPath,
323
+ checks: checks.map((check) => check.id)
324
+ });
325
+ }
326
+ }
327
+
328
+ const touched = applied.map((item) => item.path);
329
+ const pillarResults = opts.applyPillars && touched.length > 0
330
+ ? pillars.applyArtifactSync(projectRoot, touched, opts)
331
+ : pillars.planArtifactSync(projectRoot, touched, opts);
332
+
333
+ const after = detect(projectRoot, { ...opts, changedFiles: touched });
334
+ if (opts.log !== false) appendLog(projectRoot, before, after, applied);
335
+
336
+ return {
337
+ before,
338
+ after,
339
+ applied,
340
+ pillarResults,
341
+ logPath: opts.log === false ? null : LOG_PATH,
342
+ hash: sha(JSON.stringify({ before: before.status, after: after.status, applied }))
343
+ };
344
+ }
345
+
346
+ function sha(input) {
347
+ return `sha256:${crypto.createHash('sha256').update(input).digest('hex')}`;
348
+ }
349
+
350
+ function adjacentOpportunities() {
351
+ return [
352
+ {
353
+ id: 'routing-surface-sync',
354
+ trigger: '/god-doctor, /god-help, /god-next, /god-sync',
355
+ behavior: 'detect missing routing YAML for installed slash-command skills',
356
+ escalation: 'suggest fix by default, auto-apply only under fix mode'
357
+ },
358
+ {
359
+ id: 'package-installer-sync',
360
+ trigger: '/god-doctor, /god-sync, release checks',
361
+ behavior: 'detect package file allowlist and installer smoke drift when runtime files are added',
362
+ escalation: 'suggest fix because package contents affect release'
363
+ },
364
+ {
365
+ id: 'agent-contract-sync',
366
+ trigger: '/god-agent-audit, /god-doctor, /god-sync',
367
+ behavior: 'compare route spawns, skill docs, agent files, and agent specs',
368
+ escalation: 'spawn god-auditor when ownership or handoff conflicts need judgment'
369
+ },
370
+ {
371
+ id: 'workflow-recipe-graph-sync',
372
+ trigger: '/god-next, /god-mode, /god-doctor',
373
+ behavior: 'compare workflow YAML, recipes, command flows, and orchestrator guidance',
374
+ escalation: 'spawn god-roadmap-reconciler when lifecycle intent is ambiguous'
375
+ },
376
+ {
377
+ id: 'extension-pack-sync',
378
+ trigger: '/god-extension-info, /god-extension-list, /god-doctor',
379
+ behavior: 'compare first-party extension manifests, READMEs, skills, agents, and workflows',
380
+ escalation: 'spawn god-coordinator for multi-pack release prep'
381
+ }
382
+ ];
383
+ }
384
+
385
+ module.exports = {
386
+ LOG_PATH,
387
+ counts,
388
+ expectedSurface,
389
+ detect,
390
+ run,
391
+ adjacentOpportunities
392
+ };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "godpowers",
3
- "version": "1.6.16",
3
+ "version": "1.6.17",
4
4
  "description": "AI-powered development system: 109 slash commands and 40 specialist agents that take a project from raw idea to hardened production. Runs inside Claude Code, Codex, Cursor, Windsurf, Gemini, and 10+ other AI coding tools.",
5
5
  "bin": {
6
6
  "godpowers": "./bin/install.js"
7
7
  },
8
8
  "scripts": {
9
- "test": "node scripts/validate-skills.js && node scripts/test-doc-surface-counts.js && bash scripts/smoke.sh && node scripts/test-runtime.js && node scripts/test-router.js && node scripts/test-recipes.js && node scripts/test-context-writer.js && node scripts/test-pillars.js && node scripts/test-artifact-linter.js && node scripts/test-artifact-diff.js && node scripts/test-design-foundation.js && node scripts/test-linkage.js && node scripts/test-impact.js && node scripts/test-reverse-sync.js && node scripts/test-planning-systems.js && node scripts/test-feature-awareness.js && node scripts/test-integration.js && node scripts/test-cross-artifact.js && node scripts/test-awesome-design.js && node scripts/test-skillui-bridge.js && node scripts/test-runtime-verification.js && node scripts/test-agent-browser.js && node scripts/test-mode-d.js && node scripts/test-runtime-heuristics.js && node scripts/test-agent-validator.js && node scripts/test-story-validator.js && node scripts/test-state.js && node scripts/test-dashboard.js && node scripts/test-automation-providers.js && node scripts/test-intent.js && node scripts/test-events.js && node scripts/test-golden-artifacts.js && node scripts/test-install-smoke.js && node scripts/test-checkpoint.js && node scripts/test-extensions.js && node scripts/test-event-reader.js && node scripts/test-state-lock.js && node scripts/test-cost-saver.js && node scripts/test-budget-onoff.js && node scripts/test-workflow-runner.js && npm run test:e2e && node scripts/test-otel-exporter.js && node scripts/test-extensions-publish.js",
9
+ "test": "node scripts/validate-skills.js && node scripts/test-doc-surface-counts.js && bash scripts/smoke.sh && node scripts/test-runtime.js && node scripts/test-router.js && node scripts/test-recipes.js && node scripts/test-context-writer.js && node scripts/test-pillars.js && node scripts/test-artifact-linter.js && node scripts/test-artifact-diff.js && node scripts/test-design-foundation.js && node scripts/test-linkage.js && node scripts/test-impact.js && node scripts/test-reverse-sync.js && node scripts/test-planning-systems.js && node scripts/test-feature-awareness.js && node scripts/test-repo-doc-sync.js && node scripts/test-integration.js && node scripts/test-cross-artifact.js && node scripts/test-awesome-design.js && node scripts/test-skillui-bridge.js && node scripts/test-runtime-verification.js && node scripts/test-agent-browser.js && node scripts/test-mode-d.js && node scripts/test-runtime-heuristics.js && node scripts/test-agent-validator.js && node scripts/test-story-validator.js && node scripts/test-state.js && node scripts/test-dashboard.js && node scripts/test-automation-providers.js && node scripts/test-intent.js && node scripts/test-events.js && node scripts/test-golden-artifacts.js && node scripts/test-install-smoke.js && node scripts/test-checkpoint.js && node scripts/test-extensions.js && node scripts/test-event-reader.js && node scripts/test-state-lock.js && node scripts/test-cost-saver.js && node scripts/test-budget-onoff.js && node scripts/test-workflow-runner.js && npm run test:e2e && node scripts/test-otel-exporter.js && node scripts/test-extensions-publish.js",
10
10
  "prepublishOnly": "npm test",
11
11
  "validate-skills": "node scripts/validate-skills.js",
12
12
  "test:surface": "node scripts/test-doc-surface-counts.js",
@@ -0,0 +1,24 @@
1
+ apiVersion: godpowers/v1
2
+ kind: CommandRouting
3
+ metadata:
4
+ command: /god-export-otel
5
+ description: Export Godpowers events to OpenTelemetry OTLP JSON traces
6
+ tier: 0
7
+
8
+ prerequisites:
9
+ required: []
10
+
11
+ execution:
12
+ spawns: [built-in]
13
+ context: fresh
14
+ writes: []
15
+
16
+ success-path:
17
+ next-recommended: /god-status
18
+
19
+ failure-path:
20
+ on-error: /god-doctor
21
+
22
+ endoff:
23
+ state-update: none
24
+ events: [agent.start, agent.end]
@@ -23,6 +23,11 @@ Documentation work. Docs that don't lie.
23
23
 
24
24
  ## Orchestration
25
25
 
26
+ First call `lib/repo-doc-sync.run(projectRoot)` for mechanical repository
27
+ documentation claims such as README badges, version references, public surface
28
+ counts, and `/god-doctor` sample counts. Report this as `Agent: none, local
29
+ runtime only`.
30
+
26
31
  Spawn **god-docs-writer** in fresh context.
27
32
 
28
33
  The agent:
@@ -56,6 +61,7 @@ Godpowers may invoke docs work proactively in two ways:
56
61
  |---|---|---|
57
62
  | Docs changed after code changed | Spawn `god-docs-writer` in drift-check mode when current workflow owns docs | Do not invent new docs scope |
58
63
  | Code changed after docs that claim current behavior | Suggest `/god-docs` or spawn drift-check inside `/god-mode`, `/god-feature`, `/god-refactor`, or `/god-sync` closeout | Verify claims against code before editing |
64
+ | Repo docs surface drift | Run `lib/repo-doc-sync.run` for safe mechanical fixes, then spawn `god-docs-writer` for prose | Do not auto-invent changelog or release notes |
59
65
  | `REVIEW-REQUIRED.md` contains docs drift items | Suggest `/god-review-changes` first | Do not auto-clear review items |
60
66
 
61
67
  When auto-invoked, show:
@@ -65,6 +71,7 @@ Auto-invoked:
65
71
  Trigger: docs and code changed in the same workflow
66
72
  Agent: god-docs-writer
67
73
  Local syncs:
74
+ + repo-doc-sync: <safe mechanical fixes, prose review needed, or no-op>
68
75
  + docs-drift-check: <N claims checked, N drift items>
69
76
  Artifacts: .godpowers/docs/UPDATE-LOG.md or no-op
70
77
  Log: .godpowers/docs/UPDATE-LOG.md
@@ -114,6 +114,18 @@ as a read-only diagnostic. It reports:
114
114
  `/god-doctor --fix` may call `lib/feature-awareness.run(projectRoot)` because
115
115
  that helper writes only safe state metadata and managed context fences.
116
116
 
117
+ ## Repo Documentation Sync
118
+
119
+ For initialized projects, `/god-doctor` calls `lib/repo-doc-sync.detect` as a
120
+ read-only diagnostic. It reports stale README badges, public surface counts,
121
+ release notes, changelog entries, contribution guidance, security policy, and
122
+ Pillars sync planning for changed repo docs.
123
+
124
+ `/god-doctor --fix` may call `lib/repo-doc-sync.run(projectRoot)` because that
125
+ helper writes only safe mechanical version, badge, and count claims. It should
126
+ recommend `god-docs-writer` when narrative release, contribution, support, or
127
+ security prose needs judgment.
128
+
117
129
  ## Implementation
118
130
 
119
131
  Built-in, no spawned agent. Reads:
@@ -122,6 +134,7 @@ Built-in, no spawned agent. Reads:
122
134
  - `.godpowers/state.json`, `intent.yaml`, `log`, `linkage.json`
123
135
  - `lib/feature-awareness.detect(projectRoot)` for existing-project upgrade
124
136
  awareness
137
+ - `lib/repo-doc-sync.detect(projectRoot)` for repo documentation freshness
125
138
  - `bin/install.js` VERSION constant
126
139
 
127
140
  ## Exit codes
@@ -306,6 +306,7 @@ Sync status:
306
306
  Local syncs:
307
307
  + feature-awareness: <recorded runtime features, refreshed context, or no-op>
308
308
  + reverse-sync: <counts and result>
309
+ + repo-doc-sync: <refreshed repo docs, recommended god-docs-writer, or no-op>
309
310
  + pillars-sync: <counts and result>
310
311
  + checkpoint-sync: <created, updated, no-op, or skipped>
311
312
  + context-refresh: <spawned, no-op, or skipped>
@@ -324,6 +325,11 @@ When `/god-mode` resumes an existing `.godpowers` project, it auto-invokes
324
325
  keeps upgraded projects aware of new runtime features, current context fences,
325
326
  and migration routes without rewriting user artifacts.
326
327
 
328
+ The mandatory final sync also receives repo documentation sync through
329
+ `/god-sync`. This keeps README badges, release surfaces, contribution guidance,
330
+ security policy checks, and Pillars context planning arc-ready before the
331
+ project run is declared complete.
332
+
327
333
  If `/god-mode` resumes an existing `.godpowers` project that lacks Pillars,
328
334
  it Pillar-izes the project before continuing. Existing `.godpowers` artifacts
329
335
  become managed source references in the relevant `agents/*.md` files.
@@ -345,6 +351,7 @@ Sync status:
345
351
  Local syncs:
346
352
  + feature-awareness: <recorded runtime features, refreshed context, or no-op>
347
353
  + reverse-sync: <counts and result>
354
+ + repo-doc-sync: <refreshed repo docs, recommended god-docs-writer, or no-op>
348
355
  + pillars-sync: <counts and result>
349
356
  + checkpoint-sync: <created, updated, no-op, or skipped>
350
357
  + context-refresh: <spawned, no-op, or skipped>
@@ -171,8 +171,8 @@ Report:
171
171
  - Checkpoint: `fresh`, `missing`, `stale`, or `conflicts with state.json`
172
172
  - Reviews: `none` or `<N> pending, suggest /god-review-changes`
173
173
  - Sync: `fresh`, `missing`, `stale`, or `suggest /god-sync`
174
- - Docs: `fresh`, `possible drift, suggest /god-docs`, or
175
- `docs drift-check already logged`
174
+ - Docs: `fresh`, `<N> stale, suggest /god-docs`, `possible drift, suggest
175
+ /god-docs`, or `repo-doc-sync ran`
176
176
  - Runtime: `not-applicable`, `known URL, suggest /god-test-runtime`, or
177
177
  `no known URL, defer deployed verification`
178
178
  - Automation: `not configured`, `<N> active`, or
@@ -35,11 +35,18 @@ User runs `/god-sync` after manual changes. Useful for:
35
35
  3. Call `lib/pillars.pillarizeExisting(projectRoot)` if Pillars is absent or
36
36
  partial, because every Godpowers project must also carry native Pillars
37
37
  context.
38
- 4. If `state.json` contains enabled `source-systems`, auto-invoke
38
+ 4. Call `lib/repo-doc-sync.run(projectRoot)` so README badges, public surface
39
+ counts, release references, contribution docs, and security policy are
40
+ checked before sync closes. Safe mechanical updates are local runtime work.
41
+ Narrative drift should recommend or spawn `god-docs-writer`.
42
+ 5. If repo documentation changed durable project truth, plan or apply Pillars
43
+ updates through `lib/pillars.planArtifactSync` or
44
+ `lib/pillars.applyArtifactSync` under the active Pillars policy.
45
+ 6. If `state.json` contains enabled `source-systems`, auto-invoke
39
46
  `lib/source-sync.run(projectRoot)` so current Godpowers progress is written
40
47
  back to imported GSD, BMAD, or Superpowers companion files. Report this as
41
48
  `Agent: none, local runtime only`.
42
- 5. Spawn god-updater in fresh context with:
49
+ 7. Spawn god-updater in fresh context with:
43
50
  - The reconciliation verdict (if available from a prior /god-reconcile)
44
51
  - Or: re-run reconciliation against current state to detect what changed
45
52
  - Recent commits for context
@@ -51,7 +58,7 @@ Auto-invoked:
51
58
  Trigger: <manual /god-sync, recipe closeout, /god-mode final sync, or other source>
52
59
  Agent: god-updater
53
60
  Local syncs:
54
- - pending: feature-awareness, reverse-sync, source-sync, pillars-sync, checkpoint-sync, context-refresh
61
+ - pending: feature-awareness, reverse-sync, source-sync, repo-doc-sync, pillars-sync, checkpoint-sync, context-refresh
55
62
  Artifacts: pending
56
63
  Log: .godpowers/SYNC-LOG.md
57
64
  ```
@@ -78,6 +85,7 @@ Sync status:
78
85
  + reverse-sync: <scanned N files, updated M footers, populated K review items>
79
86
  + feature-awareness: <recorded runtime features, refreshed context, or no-op>
80
87
  + source-sync: <written GSD/BMAD/Superpowers companion files, no-op, or skipped>
88
+ + repo-doc-sync: <refreshed README badges/counts, recommended god-docs-writer, or no-op>
81
89
  + pillars-sync: <updated N pillar files, no-op, or proposed>
82
90
  + checkpoint-sync: <CHECKPOINT.md updated or skipped>
83
91
  + context-refresh: <updated AGENTS.md/tool pointers, no-op, or skipped by setting>
@@ -122,6 +130,7 @@ Next:
122
130
  | Orphan todos | Closes superseded todos |
123
131
  | Lost threads | Active threads get progress notes |
124
132
  | Pillars drift | Keeps `agents/*.md` aligned with current `.godpowers` artifacts |
133
+ | Repo docs drift | Keeps README badges, repo docs, and release surfaces aligned |
125
134
 
126
135
  The loop:
127
136