@elvis1513/auto-coding-skill 5.0.1 → 5.0.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema_version": 2,
3
- "skill_version": "5.0.1",
3
+ "skill_version": "5.0.2",
4
4
  "asset_files": [
5
5
  {
6
6
  "path": "SKILL.md",
package/cli/src/index.js CHANGED
@@ -96,14 +96,22 @@ function isManaged(previous, relative) {
96
96
  return Array.isArray(previous?.entries) && previous.entries.some(entry => entry?.path === relative && entry?.ownership === "managed");
97
97
  }
98
98
 
99
+ function stripLegacyAccessConfiguration(text) {
100
+ return text.replace(/\n?## Migrated access configuration\s*\n```yaml\n[\s\S]*?\n```\s*/g, "\n").trim();
101
+ }
102
+
99
103
  function migrateLegacyEnvironment(project) {
100
104
  const previous = readManifest(project);
101
105
  const environment = path.join(project, "docs", "ENVIRONMENT.md");
102
106
  const projectConfig = path.join(project, "docs", "PROJECT.md");
103
- if (!exists(environment) || exists(projectConfig) || isManaged(previous, "docs/ENVIRONMENT.md")) return false;
104
- const legacy = fs.readFileSync(environment, "utf8")
105
- .replace(/\n?## Migrated access configuration\n\n```yaml\n[\s\S]*?\n```\n?/g, "\n")
106
- .trim();
107
+ if (exists(projectConfig)) {
108
+ const existing = fs.readFileSync(projectConfig, "utf8");
109
+ const cleaned = stripLegacyAccessConfiguration(existing);
110
+ if (cleaned !== existing.trim()) fs.writeFileSync(projectConfig, `${cleaned}\n`);
111
+ return false;
112
+ }
113
+ if (!exists(environment) || isManaged(previous, "docs/ENVIRONMENT.md")) return false;
114
+ const legacy = stripLegacyAccessConfiguration(fs.readFileSync(environment, "utf8"));
107
115
  if (!legacy) return false;
108
116
  const template = fs.readFileSync(path.join(assetSkill, "data", "templates", "PROJECT.md"), "utf8").trimEnd();
109
117
  mkdirFor(projectConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvis1513/auto-coding-skill",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "CLI installer for project-owned engineering constitution, environment, and change-record documentation.",
5
5
  "type": "module",
6
6
  "bin": {