kyro-ai 3.2.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.
Files changed (140) hide show
  1. package/.claude-plugin/README.md +29 -0
  2. package/.claude-plugin/marketplace.json +52 -0
  3. package/.claude-plugin/plugin.json +40 -0
  4. package/.claude-plugin/settings.json +16 -0
  5. package/LICENSE +201 -0
  6. package/README.md +331 -0
  7. package/WORKFLOW.yaml +36 -0
  8. package/agents/orchestrator.md +393 -0
  9. package/commands/forge.md +55 -0
  10. package/commands/status.md +92 -0
  11. package/commands/wrap-up.md +85 -0
  12. package/config.json +17 -0
  13. package/contexts/init.md +64 -0
  14. package/contexts/review.md +89 -0
  15. package/contexts/sprint.md +90 -0
  16. package/dist/cli/adapters/codex.d.ts +3 -0
  17. package/dist/cli/adapters/codex.d.ts.map +1 -0
  18. package/dist/cli/adapters/codex.js +55 -0
  19. package/dist/cli/adapters/codex.js.map +1 -0
  20. package/dist/cli/adapters/command-skills.d.ts +5 -0
  21. package/dist/cli/adapters/command-skills.d.ts.map +1 -0
  22. package/dist/cli/adapters/command-skills.js +41 -0
  23. package/dist/cli/adapters/command-skills.js.map +1 -0
  24. package/dist/cli/adapters/opencode.d.ts +5 -0
  25. package/dist/cli/adapters/opencode.d.ts.map +1 -0
  26. package/dist/cli/adapters/opencode.js +41 -0
  27. package/dist/cli/adapters/opencode.js.map +1 -0
  28. package/dist/cli/adapters/registry-types.d.ts +13 -0
  29. package/dist/cli/adapters/registry-types.d.ts.map +1 -0
  30. package/dist/cli/adapters/registry-types.js +3 -0
  31. package/dist/cli/adapters/registry-types.js.map +1 -0
  32. package/dist/cli/adapters/registry.d.ts +7 -0
  33. package/dist/cli/adapters/registry.d.ts.map +1 -0
  34. package/dist/cli/adapters/registry.js +46 -0
  35. package/dist/cli/adapters/registry.js.map +1 -0
  36. package/dist/cli/app.d.ts +2 -0
  37. package/dist/cli/app.d.ts.map +1 -0
  38. package/dist/cli/app.js +46 -0
  39. package/dist/cli/app.js.map +1 -0
  40. package/dist/cli/commands/doctor.d.ts +2 -0
  41. package/dist/cli/commands/doctor.d.ts.map +1 -0
  42. package/dist/cli/commands/doctor.js +133 -0
  43. package/dist/cli/commands/doctor.js.map +1 -0
  44. package/dist/cli/commands/install.d.ts +4 -0
  45. package/dist/cli/commands/install.d.ts.map +1 -0
  46. package/dist/cli/commands/install.js +42 -0
  47. package/dist/cli/commands/install.js.map +1 -0
  48. package/dist/cli/commands/tui.d.ts +2 -0
  49. package/dist/cli/commands/tui.d.ts.map +1 -0
  50. package/dist/cli/commands/tui.js +35 -0
  51. package/dist/cli/commands/tui.js.map +1 -0
  52. package/dist/cli/commands/uninstall.d.ts +3 -0
  53. package/dist/cli/commands/uninstall.d.ts.map +1 -0
  54. package/dist/cli/commands/uninstall.js +33 -0
  55. package/dist/cli/commands/uninstall.js.map +1 -0
  56. package/dist/cli/constants.d.ts +23 -0
  57. package/dist/cli/constants.d.ts.map +1 -0
  58. package/dist/cli/constants.js +27 -0
  59. package/dist/cli/constants.js.map +1 -0
  60. package/dist/cli/fs.d.ts +12 -0
  61. package/dist/cli/fs.d.ts.map +1 -0
  62. package/dist/cli/fs.js +133 -0
  63. package/dist/cli/fs.js.map +1 -0
  64. package/dist/cli/help.d.ts +4 -0
  65. package/dist/cli/help.d.ts.map +1 -0
  66. package/dist/cli/help.js +28 -0
  67. package/dist/cli/help.js.map +1 -0
  68. package/dist/cli/install-plan.d.ts +3 -0
  69. package/dist/cli/install-plan.d.ts.map +1 -0
  70. package/dist/cli/install-plan.js +93 -0
  71. package/dist/cli/install-plan.js.map +1 -0
  72. package/dist/cli/options.d.ts +8 -0
  73. package/dist/cli/options.d.ts.map +1 -0
  74. package/dist/cli/options.js +99 -0
  75. package/dist/cli/options.js.map +1 -0
  76. package/dist/cli/state.d.ts +4 -0
  77. package/dist/cli/state.d.ts.map +1 -0
  78. package/dist/cli/state.js +13 -0
  79. package/dist/cli/state.js.map +1 -0
  80. package/dist/cli/types.d.ts +50 -0
  81. package/dist/cli/types.d.ts.map +1 -0
  82. package/dist/cli/types.js +3 -0
  83. package/dist/cli/types.js.map +1 -0
  84. package/dist/cli.d.ts +3 -0
  85. package/dist/cli.d.ts.map +1 -0
  86. package/dist/cli.js +10 -0
  87. package/dist/cli.js.map +1 -0
  88. package/dist/index.d.ts +10 -0
  89. package/dist/index.d.ts.map +1 -0
  90. package/dist/index.js +12 -0
  91. package/dist/index.js.map +1 -0
  92. package/docs/HOW-TO-USE-CODEX.md +82 -0
  93. package/docs/HOW-TO-USE-OPENCODE.md +93 -0
  94. package/docs/agent-adapters.md +152 -0
  95. package/docs/agents-reference.md +153 -0
  96. package/docs/architecture.md +159 -0
  97. package/docs/architecture.mmd +21 -0
  98. package/docs/cli.md +87 -0
  99. package/docs/commands-reference.md +138 -0
  100. package/docs/context-management.md +92 -0
  101. package/docs/getting-started.md +165 -0
  102. package/docs/harness-migration.md +95 -0
  103. package/docs/programmatic-usage.md +109 -0
  104. package/docs/rules-guide.md +216 -0
  105. package/package.json +78 -0
  106. package/rules/context-persistence.md +54 -0
  107. package/rules/estimation.md +56 -0
  108. package/rules/learning-rules.md +66 -0
  109. package/rules/quality-gates.md +65 -0
  110. package/rules/sprint-discipline.md +49 -0
  111. package/scripts/check-markdown-links.mjs +97 -0
  112. package/scripts/check-versions.mjs +46 -0
  113. package/scripts/make-cli-executable.mjs +12 -0
  114. package/settings.example.json +27 -0
  115. package/skills/qa-review/SKILL.md +660 -0
  116. package/skills/qa-review/manifest.json +41 -0
  117. package/skills/sprint-forge/SKILL.md +260 -0
  118. package/skills/sprint-forge/assets/README.md +31 -0
  119. package/skills/sprint-forge/assets/helpers/analysis-guide.md +207 -0
  120. package/skills/sprint-forge/assets/helpers/analyzer.md +83 -0
  121. package/skills/sprint-forge/assets/helpers/debt-tracker.md +122 -0
  122. package/skills/sprint-forge/assets/helpers/handoff.md +103 -0
  123. package/skills/sprint-forge/assets/helpers/learner.md +69 -0
  124. package/skills/sprint-forge/assets/helpers/metrics.md +81 -0
  125. package/skills/sprint-forge/assets/helpers/reentry-generator.md +121 -0
  126. package/skills/sprint-forge/assets/helpers/reviewer.md +71 -0
  127. package/skills/sprint-forge/assets/helpers/sprint-generator.md +145 -0
  128. package/skills/sprint-forge/assets/modes/INIT.md +204 -0
  129. package/skills/sprint-forge/assets/modes/SPRINT.md +253 -0
  130. package/skills/sprint-forge/assets/modes/STATUS.md +145 -0
  131. package/skills/sprint-forge/assets/templates/PROJECT-README.md +107 -0
  132. package/skills/sprint-forge/assets/templates/REENTRY-PROMPTS.md +132 -0
  133. package/skills/sprint-forge/assets/templates/ROADMAP.md +126 -0
  134. package/skills/sprint-forge/assets/templates/SPRINT.md +189 -0
  135. package/skills/sprint-forge/manifest.json +165 -0
  136. package/templates/split-claude-md/AGENTS.md +96 -0
  137. package/templates/split-claude-md/CLAUDE.md +67 -0
  138. package/templates/split-claude-md/COMMANDS.md +37 -0
  139. package/templates/split-claude-md/LEARNED.md +39 -0
  140. package/templates/split-claude-md/SOUL.md +107 -0
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "kyro-ai",
3
+ "version": "3.2.0",
4
+ "description": "Portable sprint workflow kit for AI coding agents, with markdown artifacts, adapter guides, and formal debt tracking",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "npm run clean && tsc && npm run build:chmod",
9
+ "typecheck": "tsc --noEmit",
10
+ "clean": "rm -rf dist",
11
+ "check:links": "node scripts/check-markdown-links.mjs",
12
+ "check:versions": "node scripts/check-versions.mjs",
13
+ "check": "npm run typecheck && npm run check:versions && npm run check:links",
14
+ "prepublishOnly": "npm run build",
15
+ "build:chmod": "node scripts/make-cli-executable.mjs"
16
+ },
17
+ "keywords": [
18
+ "ai-agents",
19
+ "agent-workflow",
20
+ "llm-workflow",
21
+ "agentic-development",
22
+ "markdown-workflow",
23
+ "workflow",
24
+ "sprint",
25
+ "planning",
26
+ "execution",
27
+ "debt-tracking",
28
+ "roadmap",
29
+ "iterative",
30
+ "adaptive",
31
+ "agents",
32
+ "claude-code",
33
+ "self-correction",
34
+ "worktrees",
35
+ "context-persistence"
36
+ ],
37
+ "author": {
38
+ "name": "SynapSync",
39
+ "url": "https://github.com/SynapSync"
40
+ },
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/SynapSync/kyro-ai.git"
44
+ },
45
+ "homepage": "https://synapsync.dev/cognitives/kyro-ai",
46
+ "skills": [
47
+ "./skills/sprint-forge",
48
+ "./skills/qa-review"
49
+ ],
50
+ "license": "Apache-2.0",
51
+ "engines": {
52
+ "node": ">=18.0.0"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^25.2.2",
56
+ "typescript": "^5.7.3"
57
+ },
58
+ "files": [
59
+ "dist",
60
+ "commands",
61
+ "agents",
62
+ "skills",
63
+ "scripts",
64
+ "docs",
65
+ "rules",
66
+ "contexts",
67
+ "templates",
68
+ "config.json",
69
+ "WORKFLOW.yaml",
70
+ ".claude-plugin",
71
+ "settings.example.json",
72
+ "README.md"
73
+ ],
74
+ "bin": {
75
+ "kyro": "dist/cli.js",
76
+ "kyro-ai": "dist/cli.js"
77
+ }
78
+ }
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Governs re-entry prompt management, context compaction safety, and session handoff procedures. Ensures zero mental context loss between sessions.
3
+ globs: ["**/*.md"]
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # Context Persistence
8
+
9
+ Rules governing how mental context is preserved across sessions and compaction events.
10
+
11
+ ## R-CP-01: Update Re-Entry Prompts at Milestones
12
+
13
+ Update re-entry prompts after INIT completes and after each executed sprint.
14
+
15
+ - Re-entry prompts live in the project's sprint output directory.
16
+ - They must contain: current sprint number, phase, last completed task, active debt items, and output directory path.
17
+ - Stale re-entry prompts are worse than no prompts — they cause misaligned execution.
18
+
19
+ ## R-CP-02: Save State Before Compaction
20
+
21
+ Save re-entry state before context compaction occurs.
22
+
23
+ - The orchestrator should trigger this before compaction when possible.
24
+ - State includes: current phase, task index, in-progress work, and any uncommitted decisions.
25
+ - If compaction happens without a save, the session must restart from the last checkpoint.
26
+
27
+ ## R-CP-03: Handoff Document on Mid-Sprint Exit
28
+
29
+ Generate a handoff document when ending a session mid-sprint.
30
+
31
+ - The handoff must include:
32
+ - Current sprint and phase
33
+ - Last completed task and next pending task
34
+ - Any in-flight decisions or blockers
35
+ - Modified files not yet committed
36
+ - Active debt items relevant to current work
37
+ - Use the handoff helper (`skills/sprint-forge/assets/helpers/handoff.md`) to generate enriched handoffs with mental model context.
38
+
39
+ ## R-CP-04: Re-Entry Prompts Are Source of Truth
40
+
41
+ Re-entry prompts are the authoritative source for output directory paths.
42
+
43
+ - Never hardcode or guess output paths — always read from the re-entry prompt.
44
+ - If the re-entry prompt is missing or corrupted, ask the user to confirm the output directory before proceeding.
45
+ - Output directory format: `{cwd}/.agents/kyro/scopes/{project}/`
46
+
47
+ ## R-CP-05: Session Continuity Verification
48
+
49
+ When resuming a session, verify continuity:
50
+
51
+ 1. Read the re-entry prompt.
52
+ 2. Confirm the sprint file exists and matches the expected state.
53
+ 3. Check for any handoff documents from the previous session.
54
+ 4. If state is inconsistent, present the discrepancy to the user before proceeding.
@@ -0,0 +1,56 @@
1
+ ---
2
+ description: Governs task estimation practices including rule loading, historical calibration, buffer allocation, and error tracking for continuous improvement.
3
+ globs: ["**/*.md"]
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # Estimation
8
+
9
+ Rules governing how tasks are estimated and how estimation accuracy is tracked over time.
10
+
11
+ ## R-ES-01: Load Estimation Rules Before Estimating
12
+
13
+ Load estimation rules from `.agents/kyro/scopes/rules.md` before producing any estimate.
14
+
15
+ - Filter for rules tagged with estimation-related keywords (estimate, duration, complexity, underestimate).
16
+ - Apply relevant corrections to the base estimate.
17
+ - If the rules file is unavailable, proceed with base estimates but flag the sprint as "uncalibrated."
18
+
19
+ ## R-ES-02: Buffer for Historically Underestimated Types
20
+
21
+ Add buffer for task types that have been historically underestimated.
22
+
23
+ Common underestimation patterns:
24
+ - **Migration tasks**: Add 30% buffer (data edge cases, rollback planning)
25
+ - **Integration tasks**: Add 25% buffer (API mismatches, auth flows)
26
+ - **Refactoring tasks**: Add 20% buffer (hidden dependencies, test updates)
27
+ - **First-time frameworks**: Add 40% buffer (learning curve, configuration)
28
+
29
+ These defaults are overridden by project-specific learned rules when available.
30
+
31
+ ## R-ES-03: Track Actual vs Estimated
32
+
33
+ Track actual completion time against estimates for every task.
34
+
35
+ - Record in the sprint file: `estimated: Xh | actual: Yh | delta: ±Z%`
36
+ - Deltas are inputs to the retro's estimation accuracy analysis.
37
+ - The metrics helper aggregates these across sprints for trend detection.
38
+
39
+ ## R-ES-04: Flag Significant Estimation Errors
40
+
41
+ Flag tasks with greater than 30% estimation error in the retrospective.
42
+
43
+ - Over-estimates (>30% faster than expected) suggest the task was simpler than anticipated or the estimator is being too conservative.
44
+ - Under-estimates (>30% slower than expected) suggest hidden complexity or scope creep.
45
+ - For each flagged task, record:
46
+ - Root cause of the error
47
+ - Whether a learned rule should be created
48
+ - Adjusted buffer for similar future tasks
49
+
50
+ ## R-ES-05: Estimation Units
51
+
52
+ Use consistent estimation units across all sprints.
53
+
54
+ - Unit: story points mapped to approximate hours (1 SP = ~1h for a senior developer).
55
+ - Range: 1-8 SP per task. Tasks estimated above 8 SP must be decomposed.
56
+ - If the user prefers different units, calibrate once and record the mapping in the project's sprint config.
@@ -0,0 +1,66 @@
1
+ ---
2
+ description: Governs the capture, formatting, and lifecycle of learned rules in .agents/kyro/scopes/rules.md. Ensures rules are specific, actionable, and do not accumulate without bound.
3
+ globs: ["**/*.md"]
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # Learning Rules
8
+
9
+ Rules governing how Kyro captures and manages per-project learnings.
10
+
11
+ ## R-LR-01: Capture Corrections as Rules
12
+
13
+ When a correction is made during a sprint (user overrides a decision, a pattern causes a bug, an estimation is wrong), capture it as a rule.
14
+
15
+ Format:
16
+ ```
17
+ [LEARN] <date> (<project>) — <specific, actionable rule>
18
+ ```
19
+
20
+ Example:
21
+ ```
22
+ [LEARN] 2026-01-15 (api-gateway) — Always check for null middleware before calling next() in Express error handlers
23
+ ```
24
+
25
+ ## R-LR-02: Rules Must Be Specific and Actionable
26
+
27
+ Rules must describe a concrete behavior to adopt or avoid. Vague rules are rejected.
28
+
29
+ - BAD: "Be more careful with error handling"
30
+ - GOOD: "Wrap all external API calls in try/catch and log the operation on failure"
31
+ - BAD: "Tests are important"
32
+ - GOOD: "Add integration tests for every new API endpoint before closing the task"
33
+
34
+ ## R-LR-03: Include Provenance
35
+
36
+ Every rule must include the date it was learned and the project where the lesson originated.
37
+
38
+ - This enables filtering rules by recency and relevance.
39
+ - When applying rules to a new project, prioritize rules from similar project types.
40
+ - Rules without provenance are flagged for update during the next retro.
41
+
42
+ ## R-LR-04: Check Before Adding
43
+
44
+ Before proposing a new rule, check `.agents/kyro/scopes/rules.md` for existing rules that cover the same concern.
45
+
46
+ - If a match exists, update or refine the existing rule instead of adding a duplicate.
47
+ - If the new rule contradicts an existing one, present both to the user for resolution.
48
+ - Use the learner helper's search capability to find semantic matches.
49
+
50
+ ## R-LR-05: Maximum 50 Active Rules
51
+
52
+ The active rule set must not exceed 50 rules.
53
+
54
+ - When the limit is reached, trigger a consolidation review:
55
+ 1. Merge rules that cover the same domain into a single, broader rule.
56
+ 2. Deprecate rules that have not been triggered in the last 5 sprints.
57
+ 3. Archive deprecated rules to `.agents/kyro/scopes/rules-archive.md`.
58
+ - Present the consolidation plan to the user for approval before modifying.
59
+
60
+ ## R-LR-06: Rule Application Tracking
61
+
62
+ Track which rules are applied during each sprint.
63
+
64
+ - Record rule applications in the sprint file's "Applied Rules" section.
65
+ - Rules that are consistently applied become candidates for automation or linting.
66
+ - Rules that are never triggered become candidates for deprecation.
@@ -0,0 +1,65 @@
1
+ ---
2
+ description: Defines mandatory quality checks before closing any task. Classifies issues as BLOCKER, WARNING, or SUGGESTION and enforces resolution policies for each.
3
+ globs: ["**/*.{ts,tsx,js,jsx,py,rs,go}"]
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # Quality Gates
8
+
9
+ Rules governing code quality enforcement during sprint execution.
10
+
11
+ ## R-QG-01: Run All Checks Before Closing
12
+
13
+ Run lint, typecheck, and tests before closing any task.
14
+
15
+ - Commands are defined in `config.json` under `quality_gates`.
16
+ - All three must pass. A single failure keeps the task open.
17
+ - If a check is not applicable (e.g., no test suite), document why in the task notes.
18
+
19
+ ## R-QG-02: BLOCKER Items Must Be Fixed
20
+
21
+ BLOCKER-level issues must be fixed before the task can be marked complete. No exceptions.
22
+
23
+ - BLOCKERs include: failing tests, type errors, lint errors that indicate bugs, security vulnerabilities.
24
+ - If a BLOCKER cannot be fixed within the current task scope, escalate to the user with a clear description.
25
+ - Never downgrade a BLOCKER to WARNING to bypass this rule.
26
+
27
+ ## R-QG-03: WARNING Items Require Justification
28
+
29
+ WARNING-level issues may be skipped, but only with explicit justification recorded in the sprint file.
30
+
31
+ - WARNINGs include: style violations, missing edge-case tests, minor lint warnings.
32
+ - Justification must explain why the warning is acceptable and when it will be addressed.
33
+ - Unjustified warnings are treated as BLOCKERs.
34
+
35
+ ## R-QG-04: No Debug Artifacts in Production Code
36
+
37
+ The following are prohibited in production code:
38
+
39
+ - `console.log` / `console.debug` / `console.warn` (use a proper logger)
40
+ - `debugger` statements
41
+ - `print()` statements used for debugging (Python)
42
+ - Commented-out code blocks longer than 3 lines
43
+ - `TODO` or `FIXME` without an associated debt table entry
44
+
45
+ Detection is handled by the orchestrator post-edit scan.
46
+
47
+ ## R-QG-05: No Hardcoded Secrets
48
+
49
+ No hardcoded secrets, API keys, tokens, or credentials in source code.
50
+
51
+ - Use environment variables or a secrets manager.
52
+ - If a placeholder is needed, use the format `PLACEHOLDER_<SERVICE>_<TYPE>` (e.g., `PLACEHOLDER_STRIPE_API_KEY`).
53
+ - The orchestrator pre-commit checkpoint scans for common secret patterns before allowing commits.
54
+
55
+ ## R-QG-06: Review Checklist
56
+
57
+ After each task, the orchestrator runs a review checklist:
58
+
59
+ 1. Does the change match the task description?
60
+ 2. Are there any regressions in existing functionality?
61
+ 3. Are quality gates passing?
62
+ 4. Is there new debt that needs to be tracked?
63
+ 5. Are there any SUGGESTION-level improvements worth noting?
64
+
65
+ SUGGESTION items are recorded but do not block task completion.
@@ -0,0 +1,49 @@
1
+ ---
2
+ description: Enforces sequential sprint execution, mandatory retrospectives, and debt continuity. Prevents batch-planning and ensures every recommendation is tracked across sprints.
3
+ globs: ["**/*.md"]
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # Sprint Discipline
8
+
9
+ Rules governing sprint lifecycle integrity. These ensure that sprints are deliberate, sequential, and accountable.
10
+
11
+ ## R-SD-01: One Sprint at a Time
12
+
13
+ Always generate sprints one at a time. Never batch-generate multiple sprints in a single session.
14
+
15
+ - Each sprint depends on the outcomes and learnings of the previous one.
16
+ - Batch planning ignores emergent work and produces stale plans.
17
+ - If the user asks for "the next 3 sprints," generate Sprint N, execute it, retro it, then generate Sprint N+1.
18
+
19
+ ## R-SD-02: Retro Before Next Sprint
20
+
21
+ A retrospective is mandatory before generating the next sprint.
22
+
23
+ - The retro produces recommendations, estimation corrections, and debt updates.
24
+ - These feed directly into Sprint N+1 planning.
25
+ - If no retro exists for Sprint N, refuse to generate Sprint N+1 and prompt the user to run the retrospective phase of forge first.
26
+
27
+ ## R-SD-03: Disposition Table Completeness
28
+
29
+ Every recommendation from Sprint N-1's retro must appear in Sprint N's disposition table.
30
+
31
+ - Valid dispositions: `ADOPTED`, `DEFERRED`, `REJECTED (reason)`, `PARTIAL (details)`
32
+ - No recommendation may be silently dropped.
33
+ - The disposition table is the first section of every sprint plan after the header.
34
+
35
+ ## R-SD-04: Debt Table Inheritance
36
+
37
+ The debt table is inherited complete from the previous sprint. Never delete rows.
38
+
39
+ - New debt items are appended.
40
+ - Resolved items change status to `RESOLVED` with the sprint number and date.
41
+ - Aged items (open for more than 3 sprints) are flagged with `[AGED]`.
42
+ - The debt table is a living document — deletion is data loss.
43
+
44
+ ## R-SD-05: Checkpoint After Each Phase
45
+
46
+ Save the sprint file after each phase completes.
47
+
48
+ - If context is lost mid-sprint, the last checkpoint is the recovery point.
49
+ - Checkpoints include: phase status, completed tasks, updated debt, and discovered work.
@@ -0,0 +1,97 @@
1
+ import { readFileSync, existsSync, statSync } from 'node:fs';
2
+ import { resolve, dirname, relative } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ const __dirname = dirname(fileURLToPath(import.meta.url));
6
+ const root = resolve(__dirname, '..');
7
+
8
+ function isMdFile(path) {
9
+ return path.endsWith('.md') && statSync(path).isFile();
10
+ }
11
+
12
+ import { readdirSync } from 'node:fs';
13
+
14
+ function* walkMdFiles(dir) {
15
+ const entries = readdirSync(dir, { withFileTypes: true });
16
+ for (const entry of entries) {
17
+ const full = resolve(dir, entry.name);
18
+ if (entry.isDirectory()) {
19
+ yield* walkMdFiles(full);
20
+ } else if (entry.isFile() && entry.name.endsWith('.md')) {
21
+ yield full;
22
+ }
23
+ }
24
+ }
25
+
26
+ function collectFiles(patterns) {
27
+ const files = [];
28
+ for (const pattern of patterns) {
29
+ const full = resolve(root, pattern);
30
+ try {
31
+ if (statSync(full).isDirectory()) {
32
+ files.push(...walkMdFiles(full));
33
+ } else if (isMdFile(full)) {
34
+ files.push(full);
35
+ }
36
+ } catch {
37
+ // skip missing patterns
38
+ }
39
+ }
40
+ return files;
41
+ }
42
+
43
+ const linkRe = /\[([^\]]*)\]\(([^)]+)\)/g;
44
+
45
+ let exitCode = 0;
46
+
47
+ function checkFile(filePath) {
48
+ const content = readFileSync(filePath, 'utf-8');
49
+ const lines = content.split('\n');
50
+ const baseDir = dirname(filePath);
51
+
52
+ for (let i = 0; i < lines.length; i++) {
53
+ const line = lines[i];
54
+ let match;
55
+ linkRe.lastIndex = 0;
56
+
57
+ while ((match = linkRe.exec(line)) !== null) {
58
+ const target = match[2].trim();
59
+
60
+ // Skip external URLs, anchors, and wiki-links
61
+ if (target.startsWith('http://') || target.startsWith('https://') || target.startsWith('#') || target.startsWith('mailto:')) {
62
+ continue;
63
+ }
64
+
65
+ // Skip references starting with a slash (absolute paths in the filesystem, not markdown relative)
66
+ if (target.startsWith('/')) {
67
+ continue;
68
+ }
69
+
70
+ const resolved = resolve(baseDir, target);
71
+ if (!existsSync(resolved)) {
72
+ const relPath = relative(root, filePath);
73
+ console.error(`BROKEN LINK: ${relPath}:${i + 1} -> ${target}`);
74
+ exitCode = 1;
75
+ }
76
+ }
77
+ }
78
+ }
79
+
80
+ const patterns = [
81
+ 'README.md',
82
+ 'docs',
83
+ 'skills',
84
+ 'agents',
85
+ 'commands',
86
+ ];
87
+
88
+ const allFiles = collectFiles(patterns);
89
+
90
+ for (const file of allFiles) {
91
+ checkFile(file);
92
+ }
93
+
94
+ if (exitCode === 0) {
95
+ console.log(`All relative links valid (${allFiles.length} files checked)`);
96
+ }
97
+ process.exit(exitCode);
@@ -0,0 +1,46 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { resolve, dirname } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
6
+
7
+ function readJson(file) {
8
+ return JSON.parse(readFileSync(resolve(root, file), 'utf-8'));
9
+ }
10
+
11
+ function readYamlVersion(file) {
12
+ const text = readFileSync(resolve(root, file), 'utf-8');
13
+ const match = text.match(/^version:\s*["']?([^"'\n]+)["']?$/m);
14
+ if (!match) throw new Error(`Could not parse version from ${file}`);
15
+ return match[1];
16
+ }
17
+
18
+ const pkg = readJson('package.json');
19
+ const plugin = readJson('.claude-plugin/plugin.json');
20
+ const workflowVersion = readYamlVersion('WORKFLOW.yaml');
21
+
22
+ const pkgVersion = pkg.version;
23
+ const pluginVersion = plugin.version;
24
+
25
+ let failed = false;
26
+
27
+ if (pkgVersion !== pluginVersion) {
28
+ console.error(`ERROR: Version mismatch`);
29
+ console.error(` package.json: ${pkgVersion}`);
30
+ console.error(` .claude-plugin/plugin.json: ${pluginVersion}`);
31
+ failed = true;
32
+ }
33
+
34
+ if (pkgVersion !== workflowVersion) {
35
+ console.error(`ERROR: Version mismatch`);
36
+ console.error(` package.json: ${pkgVersion}`);
37
+ console.error(` WORKFLOW.yaml: ${workflowVersion}`);
38
+ failed = true;
39
+ }
40
+
41
+ if (failed) {
42
+ console.error(`\nFix: update all version fields to match before committing.`);
43
+ process.exit(1);
44
+ }
45
+
46
+ console.log(`All versions match: ${pkgVersion}`);
@@ -0,0 +1,12 @@
1
+ import { chmodSync, existsSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+
4
+ const cliPath = resolve('dist/cli.js');
5
+
6
+ if (!existsSync(cliPath)) {
7
+ console.error('ERROR: dist/cli.js does not exist. Run tsc before make-cli-executable.');
8
+ process.exit(1);
9
+ }
10
+
11
+ chmodSync(cliPath, 0o755);
12
+ console.log('Made dist/cli.js executable');
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
+ "permissions": {
4
+ "allow": [
5
+ "Read",
6
+ "Glob",
7
+ "Grep",
8
+ "Bash(npm run typecheck*)",
9
+ "Bash(npm run build*)",
10
+ "Bash(git status*)",
11
+ "Bash(git diff*)",
12
+ "Bash(git log*)"
13
+ ],
14
+ "deny": [
15
+ "Bash(rm -rf *)",
16
+ "Bash(git push --force*)",
17
+ "Bash(git reset --hard*)"
18
+ ]
19
+ },
20
+ "output": {
21
+ "markdown": true,
22
+ "spinner": {
23
+ "enabled": true,
24
+ "style": "dots"
25
+ }
26
+ }
27
+ }