project-tiny-context-harness 0.2.54 → 0.2.56

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.
Files changed (54) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +266 -243
  3. package/assets/README.md +302 -279
  4. package/assets/README.zh-CN.md +8 -6
  5. package/assets/agents/.gitkeep +1 -1
  6. package/assets/agents/AGENTS_CORE.md +56 -55
  7. package/assets/context_templates/architecture.md +31 -31
  8. package/assets/context_templates/area.md +24 -24
  9. package/assets/context_templates/context.toml +27 -27
  10. package/assets/context_templates/deployment.md +35 -35
  11. package/assets/context_templates/global.md +53 -53
  12. package/assets/context_templates/product-surface-contract.md +60 -0
  13. package/assets/context_templates/verification.md +28 -28
  14. package/assets/github/.gitkeep +1 -1
  15. package/assets/github/harness.yml +19 -19
  16. package/assets/make/.gitkeep +1 -1
  17. package/assets/make/ty-context.mk +48 -0
  18. package/assets/skills/context_development_engineer/SKILL.md +69 -66
  19. package/assets/skills/context_full_project_export/SKILL.md +25 -25
  20. package/assets/skills/context_harness_upgrade/SKILL.md +9 -9
  21. package/assets/skills/context_product_plan/SKILL.md +73 -70
  22. package/assets/skills/context_surface_contract/SKILL.md +168 -0
  23. package/assets/skills/context_uiux_design/SKILL.md +113 -110
  24. package/assets/skills/plan_acceptance_checklist_compiler/SKILL.md +427 -0
  25. package/assets/tools/validate_context.py +276 -276
  26. package/dist/cli.js +1 -1
  27. package/dist/commands/check-modularity.js +1 -1
  28. package/dist/commands/export-context.js +6 -6
  29. package/dist/commands/index.js +3 -3
  30. package/dist/commands/init.js +1 -1
  31. package/dist/commands/package-source.js +2 -2
  32. package/dist/commands/upgrade.js +1 -1
  33. package/dist/lib/config.js +2 -2
  34. package/dist/lib/constants.d.ts +1 -1
  35. package/dist/lib/constants.js +1 -1
  36. package/dist/lib/context-export.js +5 -5
  37. package/dist/lib/harness-root.d.ts +5 -0
  38. package/dist/lib/harness-root.js +32 -4
  39. package/dist/lib/legacy-managed-scan.d.ts +2 -0
  40. package/dist/lib/legacy-managed-scan.js +79 -0
  41. package/dist/lib/legacy-sdlc-migration.d.ts +2 -0
  42. package/dist/lib/legacy-sdlc-migration.js +189 -0
  43. package/dist/lib/managed-file.d.ts +18 -12
  44. package/dist/lib/managed-file.js +25 -14
  45. package/dist/lib/migrations.js +4 -2
  46. package/dist/lib/package-json-config.js +3 -3
  47. package/dist/lib/paths.d.ts +2 -2
  48. package/dist/lib/paths.js +2 -2
  49. package/dist/lib/sync-engine.js +33 -31
  50. package/dist/lib/validators.js +2 -2
  51. package/migrations/README.md +3 -3
  52. package/package.json +68 -68
  53. package/source-mappings.yaml +21 -21
  54. package/assets/make/sdlc-harness.mk +0 -48
@@ -3,7 +3,7 @@ import { promises as fs } from "node:fs";
3
3
  import { readConfig } from "./config.js";
4
4
  import { harnessPath, harnessRoot } from "./harness-root.js";
5
5
  import { copyTree, listFiles, pathExists, readText, writeTextIfChanged } from "./fs.js";
6
- import { AGENTS_BLOCK_MARKERS, GITHUB_WORKFLOW_BLOCK_END, GITHUB_WORKFLOW_BLOCK_START, MAKEFILE_BLOCK_END, MAKEFILE_BLOCK_MARKERS, MAKEFILE_BLOCK_START, MANAGED_BLOCK_END, MANAGED_BLOCK_START } from "./managed-file.js";
6
+ import { AGENTS_BLOCK_MARKERS, GITHUB_WORKFLOW_BLOCK_END, GITHUB_WORKFLOW_BLOCK_MARKERS, GITHUB_WORKFLOW_BLOCK_START, MAKEFILE_BLOCK_END, MAKEFILE_BLOCK_MARKERS, MAKEFILE_BLOCK_START, MANAGED_BLOCK_END, MANAGED_BLOCK_START } from "./managed-file.js";
7
7
  import { packageAssetPath } from "./paths.js";
8
8
  import { assertSupportedSchema } from "./schema-guard.js";
9
9
  import { createUpgradePlan, formatUpgradePlan, hasUpgradePlanWork } from "./migrations.js";
@@ -50,20 +50,20 @@ async function syncManagedFile(projectRoot, root, managedFile, report) {
50
50
  return;
51
51
  }
52
52
  const managedPath = normalizeManagedPath(managedFile.path);
53
- if (managedPath === harnessPath(root, "pjsdlc_managed", "templates")) {
53
+ if (managedPath === harnessPath(root, "ty-context-managed", "templates")) {
54
54
  await syncTree(packageAssetPath("templates"), destination, report);
55
55
  return;
56
56
  }
57
- if (managedPath === harnessPath(root, "pjsdlc_managed", "context_templates")) {
57
+ if (managedPath === harnessPath(root, "ty-context-managed", "context_templates")) {
58
58
  await syncTree(packageAssetPath("context_templates"), destination, report, { prune: true });
59
59
  return;
60
60
  }
61
- if (managedPath === harnessPath(root, "pjsdlc_managed", "policies")) {
61
+ if (managedPath === harnessPath(root, "ty-context-managed", "policies")) {
62
62
  await syncTree(packageAssetPath("policies"), destination, report);
63
63
  return;
64
64
  }
65
- if (managedPath === harnessPath(root, "pjsdlc_managed", "make", "sdlc-harness.mk")) {
66
- await syncFile(packageAssetPath("make", "sdlc-harness.mk"), destination, report, "skip-if-missing");
65
+ if (managedPath === harnessPath(root, "ty-context-managed", "make", "ty-context.mk")) {
66
+ await syncFile(packageAssetPath("make", "ty-context.mk"), destination, report, "skip-if-missing");
67
67
  return;
68
68
  }
69
69
  if (managedFile.path === "tools") {
@@ -118,7 +118,7 @@ function renderAgentsCore(content, root) {
118
118
  async function syncMakefileInclude(destination, root, report) {
119
119
  const existing = (await pathExists(destination)) ? await readText(destination) : "";
120
120
  const resetDefaultGoal = shouldResetMakeDefaultGoal(existing);
121
- const includePath = `${root.replace(/\\/g, "/")}/pjsdlc_managed/make/sdlc-harness.mk`;
121
+ const includePath = `${root.replace(/\\/g, "/")}/ty-context-managed/make/ty-context.mk`;
122
122
  const blockLines = [
123
123
  MAKEFILE_BLOCK_START,
124
124
  "# Included before project targets so project recipes win on name conflicts.",
@@ -264,22 +264,31 @@ async function syncSkillsTree(source, destination, report) {
264
264
  }
265
265
  }
266
266
  async function blockDeprecatedSkillOverrides(projectRoot, root, report) {
267
- const overrideRoot = skillOverrideRoot(projectRoot, root);
268
- if (!(await pathExists(overrideRoot))) {
269
- return;
270
- }
271
- const deprecatedFiles = (await listFiles(overrideRoot))
272
- .filter((file) => path.basename(file) !== ".gitkeep")
273
- .map((file) => path.relative(overrideRoot, file).split(path.sep).join("/"))
274
- .sort();
275
- if (deprecatedFiles.length === 0) {
276
- return;
267
+ for (const overrideRoot of skillOverrideRoots(projectRoot, root)) {
268
+ if (!(await pathExists(overrideRoot.absolute))) {
269
+ continue;
270
+ }
271
+ const deprecatedFiles = (await listFiles(overrideRoot.absolute))
272
+ .filter((file) => path.basename(file) !== ".gitkeep")
273
+ .map((file) => path.relative(overrideRoot.absolute, file).split(path.sep).join("/"))
274
+ .sort();
275
+ if (deprecatedFiles.length === 0) {
276
+ continue;
277
+ }
278
+ report.blocked.push(`${overrideRoot.relative}: Skill overrides are no longer supported. Move these rules into a separate project-local Skill such as ${root.replace(/\\/g, "/")}/skills/product_plan/SKILL.md, ${root.replace(/\\/g, "/")}/skills/uiux_design/SKILL.md or ${root.replace(/\\/g, "/")}/skills/development_engineer/SKILL.md. Deprecated files: ${deprecatedFiles.join(", ")}`);
277
279
  }
278
- const relativeRoot = path.join(root, "pjsdlc_managed", "override_skills").split(path.sep).join("/");
279
- report.blocked.push(`${relativeRoot}: Skill overrides are no longer supported. Move these rules into a separate project-local Skill such as ${root.replace(/\\/g, "/")}/skills/product_plan/SKILL.md, ${root.replace(/\\/g, "/")}/skills/uiux_design/SKILL.md or ${root.replace(/\\/g, "/")}/skills/development_engineer/SKILL.md. Deprecated files: ${deprecatedFiles.join(", ")}`);
280
280
  }
281
- function skillOverrideRoot(projectRoot, root) {
282
- return path.join(projectRoot, root, "pjsdlc_managed", "override_skills");
281
+ function skillOverrideRoots(projectRoot, root) {
282
+ return [
283
+ {
284
+ absolute: path.join(projectRoot, root, "ty-context-managed", "override_skills"),
285
+ relative: path.join(root, "ty-context-managed", "override_skills").split(path.sep).join("/")
286
+ },
287
+ {
288
+ absolute: path.join(projectRoot, root, "pjsdlc_managed", "override_skills"),
289
+ relative: path.join(root, "pjsdlc_managed", "override_skills").split(path.sep).join("/")
290
+ }
291
+ ];
283
292
  }
284
293
  async function syncFile(source, destination, report, missingMode) {
285
294
  if (!(await pathExists(source))) {
@@ -331,18 +340,11 @@ async function syncGithubWorkflow(source, destination, relativePath, report) {
331
340
  report.skipped.push(`${relativePath}: customized`);
332
341
  }
333
342
  function workflowMarkerState(content) {
334
- const startIndex = content.indexOf(GITHUB_WORKFLOW_BLOCK_START);
335
- const endIndex = content.indexOf(GITHUB_WORKFLOW_BLOCK_END);
336
- const hasStart = startIndex >= 0;
337
- const hasEnd = endIndex >= 0;
338
- if (!hasStart && !hasEnd) {
343
+ const found = findManagedBlock(content, GITHUB_WORKFLOW_BLOCK_MARKERS);
344
+ if (found.status === "missing") {
339
345
  return "missing";
340
346
  }
341
- if (hasStart !== hasEnd || endIndex < startIndex) {
342
- return "invalid";
343
- }
344
- if (content.indexOf(GITHUB_WORKFLOW_BLOCK_START, startIndex + GITHUB_WORKFLOW_BLOCK_START.length) >= 0 ||
345
- content.indexOf(GITHUB_WORKFLOW_BLOCK_END, endIndex + GITHUB_WORKFLOW_BLOCK_END.length) >= 0) {
347
+ if (found.status === "invalid") {
346
348
  return "invalid";
347
349
  }
348
350
  return "managed";
@@ -160,7 +160,7 @@ async function validateContext(projectRoot) {
160
160
  }
161
161
  }
162
162
  else if (schemaRequiresContextManifest(schemaVersion)) {
163
- errors.push("project_context/context.toml is missing; run sdlc-harness upgrade to create the Schema v4 Context graph manifest");
163
+ errors.push("project_context/context.toml is missing; run ty-context upgrade to create the Schema v4 Context graph manifest");
164
164
  }
165
165
  const contextFiles = (await listFiles(projectContextRoot))
166
166
  .filter((file) => file.endsWith(".md"))
@@ -243,7 +243,7 @@ async function validateContextManifest(projectRoot, manifest, manifestRoles, err
243
243
  async function addManifestRole(projectRoot, roles, rawPath, role, source, errors) {
244
244
  const relative = normalizeContextPath(rawPath);
245
245
  if (looksLikeExportArtifact(relative)) {
246
- errors.push(`project_context/context.toml ${source} must not reference temporary export artifact ${rawPath}; export artifacts belong in tmp/sdlc/context-exports/** and must not be registered as Context graph nodes or implementation-index`);
246
+ errors.push(`project_context/context.toml ${source} must not reference temporary export artifact ${rawPath}; export artifacts belong in tmp/ty-context/context-exports/** and must not be registered as Context graph nodes or implementation-index`);
247
247
  return;
248
248
  }
249
249
  if (!relative.startsWith("project_context/") || !relative.endsWith(".md")) {
@@ -1,3 +1,3 @@
1
- # Migrations
2
-
3
- Schema migrations for `.harness/config.yaml` and managed file layout belong here.
1
+ # Migrations
2
+
3
+ Schema migrations for `.harness/config.yaml` and managed file layout belong here.
package/package.json CHANGED
@@ -1,68 +1,68 @@
1
- {
2
- "name": "project-tiny-context-harness",
3
- "version": "0.2.54",
4
- "description": "Minimal project memory and validation harness for AI coding agents.",
5
- "license": "MIT",
6
- "author": "Seven128",
7
- "homepage": "https://github.com/Seven128/project-tiny-context-harness#readme",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/Seven128/project-tiny-context-harness.git",
11
- "directory": "packages/sdlc-harness"
12
- },
13
- "bugs": {
14
- "url": "https://github.com/Seven128/project-tiny-context-harness/issues"
15
- },
16
- "keywords": [
17
- "ai-agents",
18
- "coding-agent",
19
- "codex",
20
- "claude-code",
21
- "cursor",
22
- "gemini-cli",
23
- "opencode",
24
- "agent-context",
25
- "context-engineering",
26
- "context-management",
27
- "agents-md",
28
- "project-memory",
29
- "agent-memory",
30
- "ai-coding",
31
- "multi-agent",
32
- "llm",
33
- "developer-tools",
34
- "developer-productivity",
35
- "cli",
36
- "sdlc",
37
- "workflow"
38
- ],
39
- "type": "module",
40
- "bin": {
41
- "sdlc-harness": "dist/cli.js"
42
- },
43
- "files": [
44
- "README.md",
45
- "dist",
46
- "assets",
47
- "migrations",
48
- "source-mappings.yaml"
49
- ],
50
- "scripts": {
51
- "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
52
- "typecheck": "tsc -p tsconfig.json --noEmit",
53
- "test": "npm run build && node --test ../../tests/sdlc-harness/*.test.mjs",
54
- "prepack": "npm run build"
55
- },
56
- "engines": {
57
- "node": ">=20"
58
- },
59
- "dependencies": {
60
- "@google/design.md": "^0.2.0",
61
- "impeccable": "^2.3.2",
62
- "yaml": "^2.9.0"
63
- },
64
- "devDependencies": {
65
- "@types/node": "^24.0.0",
66
- "typescript": "^5.5.0"
67
- }
68
- }
1
+ {
2
+ "name": "project-tiny-context-harness",
3
+ "version": "0.2.56",
4
+ "description": "Minimal project memory and validation harness for AI coding agents.",
5
+ "license": "MIT",
6
+ "author": "Seven128",
7
+ "homepage": "https://github.com/Seven128/project-tiny-context-harness#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Seven128/project-tiny-context-harness.git",
11
+ "directory": "packages/ty-context"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/Seven128/project-tiny-context-harness/issues"
15
+ },
16
+ "keywords": [
17
+ "ai-agents",
18
+ "coding-agent",
19
+ "codex",
20
+ "claude-code",
21
+ "cursor",
22
+ "gemini-cli",
23
+ "opencode",
24
+ "agent-context",
25
+ "context-engineering",
26
+ "context-management",
27
+ "agents-md",
28
+ "project-memory",
29
+ "agent-memory",
30
+ "ai-coding",
31
+ "multi-agent",
32
+ "llm",
33
+ "developer-tools",
34
+ "developer-productivity",
35
+ "cli",
36
+ "ty-context",
37
+ "workflow"
38
+ ],
39
+ "type": "module",
40
+ "bin": {
41
+ "ty-context": "dist/cli.js"
42
+ },
43
+ "files": [
44
+ "README.md",
45
+ "dist",
46
+ "assets",
47
+ "migrations",
48
+ "source-mappings.yaml"
49
+ ],
50
+ "scripts": {
51
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
52
+ "typecheck": "tsc -p tsconfig.json --noEmit",
53
+ "test": "npm run build && node --test ../../tests/ty-context/*.test.mjs",
54
+ "prepack": "npm run build"
55
+ },
56
+ "engines": {
57
+ "node": ">=20"
58
+ },
59
+ "dependencies": {
60
+ "@google/design.md": "^0.2.0",
61
+ "impeccable": "^2.3.2",
62
+ "yaml": "^2.9.0"
63
+ },
64
+ "devDependencies": {
65
+ "@types/node": "^24.0.0",
66
+ "typescript": "^5.5.0"
67
+ }
68
+ }
@@ -1,25 +1,25 @@
1
- source_mappings:
2
- - source: ".codex/pjsdlc_managed/agents/AGENTS_CORE.md"
3
- target: "packages/sdlc-harness/assets/agents/AGENTS_CORE.md"
4
- mode: "copy-file"
1
+ source_mappings:
2
+ - source: ".codex/ty-context-managed/agents/AGENTS_CORE.md"
3
+ target: "packages/ty-context/assets/agents/AGENTS_CORE.md"
4
+ mode: "copy-file"
5
5
  - source: "README.md"
6
- target: "packages/sdlc-harness/assets/README.md"
6
+ target: "packages/ty-context/assets/README.md"
7
7
  mode: "copy-file"
8
8
  - source: "README.zh-CN.md"
9
- target: "packages/sdlc-harness/assets/README.zh-CN.md"
9
+ target: "packages/ty-context/assets/README.zh-CN.md"
10
+ mode: "copy-file"
11
+ - source: ".codex/ty-context-managed/context_templates"
12
+ target: "packages/ty-context/assets/context_templates"
13
+ mode: "copy-tree"
14
+ - source: ".codex/ty-context-managed/skills"
15
+ target: "packages/ty-context/assets/skills"
16
+ mode: "copy-tree"
17
+ - source: ".codex/ty-context-managed/make/ty-context.mk"
18
+ target: "packages/ty-context/assets/make/ty-context.mk"
19
+ mode: "copy-file"
20
+ - source: ".codex/ty-context-managed/minimal_tools"
21
+ target: "packages/ty-context/assets/tools"
22
+ mode: "copy-tree"
23
+ - source: ".github/workflows/harness.yml"
24
+ target: "packages/ty-context/assets/github/harness.yml"
10
25
  mode: "copy-file"
11
- - source: ".codex/pjsdlc_managed/context_templates"
12
- target: "packages/sdlc-harness/assets/context_templates"
13
- mode: "copy-tree"
14
- - source: ".codex/pjsdlc_managed/skills"
15
- target: "packages/sdlc-harness/assets/skills"
16
- mode: "copy-tree"
17
- - source: ".codex/pjsdlc_managed/make/sdlc-harness.mk"
18
- target: "packages/sdlc-harness/assets/make/sdlc-harness.mk"
19
- mode: "copy-file"
20
- - source: ".codex/pjsdlc_managed/minimal_tools"
21
- target: "packages/sdlc-harness/assets/tools"
22
- mode: "copy-tree"
23
- - source: ".github/workflows/harness.yml"
24
- target: "packages/sdlc-harness/assets/github/harness.yml"
25
- mode: "copy-file"
@@ -1,48 +0,0 @@
1
- PYTHON ?= python3
2
- SDLC_HARNESS ?= $(if $(wildcard packages/sdlc-harness/dist/cli.js),node packages/sdlc-harness/dist/cli.js,npx --yes --package project-tiny-context-harness@latest sdlc-harness)
3
- SDLC_MODULARITY_SCOPE = $(if $(SDLC_MODULARITY_BASE),--base $(SDLC_MODULARITY_BASE),--touched)
4
-
5
- .PHONY: help sdlc-doctor sdlc-sync sdlc-upgrade sdlc-check-modularity validate-context validate-code-modularity validate-harness lint test-current-domain test-all build
6
-
7
- help:
8
- @echo "Minimal Context Harness commands"
9
- @echo " make sdlc-doctor Diagnose Harness root, core package and schema version"
10
- @echo " make sdlc-sync Refresh managed assets; refuses when upgrade migrations are pending"
11
- @echo " make sdlc-upgrade Run safe upgrade migrations, sync managed assets and doctor"
12
- @echo " make sdlc-check-modularity Warn on oversized touched handwritten source files"
13
- @echo " make validate-context Check whether project_context/** supports context recovery"
14
- @echo " make validate-code-modularity Fail on oversized touched handwritten source files"
15
- @echo " make validate-harness Run validate-context and validate-code-modularity"
16
- @echo " make test-all Run the project regression suite after replacing this placeholder"
17
-
18
- sdlc-doctor:
19
- $(SDLC_HARNESS) doctor
20
-
21
- sdlc-sync:
22
- $(SDLC_HARNESS) sync
23
-
24
- sdlc-upgrade:
25
- $(SDLC_HARNESS) upgrade
26
-
27
- sdlc-check-modularity:
28
- $(SDLC_HARNESS) check-modularity $(SDLC_MODULARITY_SCOPE)
29
-
30
- validate-context:
31
- $(SDLC_HARNESS) validate-context
32
-
33
- validate-code-modularity:
34
- $(SDLC_HARNESS) check-modularity $(SDLC_MODULARITY_SCOPE) --fail-on-warning
35
-
36
- validate-harness: validate-context validate-code-modularity
37
-
38
- lint:
39
- @echo "No project lint command configured yet. Replace this target with your stack-specific lint command."
40
-
41
- test-current-domain:
42
- @echo "No domain test command configured yet. Replace this target with focused tests for the current change."
43
-
44
- test-all:
45
- @echo "No full test command configured yet. Replace this target with the project regression suite."
46
-
47
- build:
48
- @echo "No build command configured yet. Replace this target with the project build/package command."