@refrakt-md/plan 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-plugin.d.ts +12 -0
- package/dist/cli-plugin.d.ts.map +1 -0
- package/dist/cli-plugin.js +494 -0
- package/dist/cli-plugin.js.map +1 -0
- package/dist/commands/build.d.ts +14 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +57 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/bundle-behaviors.d.ts +6 -0
- package/dist/commands/bundle-behaviors.d.ts.map +1 -0
- package/dist/commands/bundle-behaviors.js +24 -0
- package/dist/commands/bundle-behaviors.js.map +1 -0
- package/dist/commands/create.d.ts +21 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +50 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/init.d.ts +17 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +109 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/next.d.ts +34 -0
- package/dist/commands/next.d.ts.map +1 -0
- package/dist/commands/next.js +100 -0
- package/dist/commands/next.js.map +1 -0
- package/dist/commands/plan-behaviors.d.ts +2 -0
- package/dist/commands/plan-behaviors.d.ts.map +1 -0
- package/dist/commands/plan-behaviors.js +7 -0
- package/dist/commands/plan-behaviors.js.map +1 -0
- package/dist/commands/render-pipeline.d.ts +70 -0
- package/dist/commands/render-pipeline.d.ts.map +1 -0
- package/dist/commands/render-pipeline.js +1173 -0
- package/dist/commands/render-pipeline.js.map +1 -0
- package/dist/commands/serve.d.ts +13 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +167 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/status.d.ts +53 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +181 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/templates.d.ts +37 -0
- package/dist/commands/templates.d.ts.map +1 -0
- package/dist/commands/templates.js +160 -0
- package/dist/commands/templates.js.map +1 -0
- package/dist/commands/update.d.ts +29 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +238 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/validate.d.ts +29 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +298 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +163 -0
- package/dist/config.js.map +1 -0
- package/dist/filter.d.ts +17 -0
- package/dist/filter.d.ts.map +1 -0
- package/dist/filter.js +72 -0
- package/dist/filter.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +144 -0
- package/dist/index.js.map +1 -0
- package/dist/pipeline.d.ts +23 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +720 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/scanner.d.ts +9 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +234 -0
- package/dist/scanner.js.map +1 -0
- package/dist/schema/backlog.d.ts +7 -0
- package/dist/schema/backlog.d.ts.map +1 -0
- package/dist/schema/backlog.js +9 -0
- package/dist/schema/backlog.js.map +1 -0
- package/dist/schema/bug.d.ts +9 -0
- package/dist/schema/bug.d.ts.map +1 -0
- package/dist/schema/bug.js +11 -0
- package/dist/schema/bug.js.map +1 -0
- package/dist/schema/decision-log.d.ts +5 -0
- package/dist/schema/decision-log.d.ts.map +1 -0
- package/dist/schema/decision-log.js +7 -0
- package/dist/schema/decision-log.js.map +1 -0
- package/dist/schema/decision.d.ts +8 -0
- package/dist/schema/decision.d.ts.map +1 -0
- package/dist/schema/decision.js +10 -0
- package/dist/schema/decision.js.map +1 -0
- package/dist/schema/milestone.d.ts +6 -0
- package/dist/schema/milestone.d.ts.map +1 -0
- package/dist/schema/milestone.js +8 -0
- package/dist/schema/milestone.js.map +1 -0
- package/dist/schema/plan-activity.d.ts +4 -0
- package/dist/schema/plan-activity.d.ts.map +1 -0
- package/dist/schema/plan-activity.js +6 -0
- package/dist/schema/plan-activity.js.map +1 -0
- package/dist/schema/plan-progress.d.ts +4 -0
- package/dist/schema/plan-progress.d.ts.map +1 -0
- package/dist/schema/plan-progress.js +6 -0
- package/dist/schema/plan-progress.js.map +1 -0
- package/dist/schema/spec.d.ts +8 -0
- package/dist/schema/spec.d.ts.map +1 -0
- package/dist/schema/spec.js +10 -0
- package/dist/schema/spec.js.map +1 -0
- package/dist/schema/work.d.ts +10 -0
- package/dist/schema/work.d.ts.map +1 -0
- package/dist/schema/work.js +12 -0
- package/dist/schema/work.js.map +1 -0
- package/dist/tags/backlog.d.ts +4 -0
- package/dist/tags/backlog.d.ts.map +1 -0
- package/dist/tags/backlog.js +41 -0
- package/dist/tags/backlog.js.map +1 -0
- package/dist/tags/bug.d.ts +3 -0
- package/dist/tags/bug.d.ts.map +1 -0
- package/dist/tags/bug.js +58 -0
- package/dist/tags/bug.js.map +1 -0
- package/dist/tags/decision-log.d.ts +4 -0
- package/dist/tags/decision-log.d.ts.map +1 -0
- package/dist/tags/decision-log.js +35 -0
- package/dist/tags/decision-log.js.map +1 -0
- package/dist/tags/decision.d.ts +3 -0
- package/dist/tags/decision.d.ts.map +1 -0
- package/dist/tags/decision.js +54 -0
- package/dist/tags/decision.js.map +1 -0
- package/dist/tags/milestone.d.ts +3 -0
- package/dist/tags/milestone.d.ts.map +1 -0
- package/dist/tags/milestone.js +52 -0
- package/dist/tags/milestone.js.map +1 -0
- package/dist/tags/plan-activity.d.ts +4 -0
- package/dist/tags/plan-activity.d.ts.map +1 -0
- package/dist/tags/plan-activity.js +31 -0
- package/dist/tags/plan-activity.js.map +1 -0
- package/dist/tags/plan-progress.d.ts +4 -0
- package/dist/tags/plan-progress.d.ts.map +1 -0
- package/dist/tags/plan-progress.js +31 -0
- package/dist/tags/plan-progress.js.map +1 -0
- package/dist/tags/spec.d.ts +3 -0
- package/dist/tags/spec.d.ts.map +1 -0
- package/dist/tags/spec.js +57 -0
- package/dist/tags/spec.js.map +1 -0
- package/dist/tags/work.d.ts +3 -0
- package/dist/tags/work.d.ts.map +1 -0
- package/dist/tags/work.js +68 -0
- package/dist/tags/work.js.map +1 -0
- package/dist/types.d.ts +69 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +8 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +32 -0
- package/dist/util.js.map +1 -0
- package/package.json +47 -0
- package/styles/default.css +580 -0
- package/styles/minimal.css +379 -0
- package/styles/tokens.css +13 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-behaviors.js","sourceRoot":"","sources":["../../src/commands/bundle-behaviors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACpC,gFAAgF;IAChF,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC;QAC1B,WAAW,EAAE,CAAC,UAAU,CAAC;QACzB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,CAAC,QAAQ,CAAC;KAClB,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type PlanItemType } from './templates.js';
|
|
2
|
+
export declare const EXIT_SUCCESS = 0;
|
|
3
|
+
export declare const EXIT_ALREADY_EXISTS = 1;
|
|
4
|
+
export declare const EXIT_INVALID_ARGS = 2;
|
|
5
|
+
export interface CreateOptions {
|
|
6
|
+
dir: string;
|
|
7
|
+
type: PlanItemType;
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
attrs?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateResult {
|
|
13
|
+
file: string;
|
|
14
|
+
type: PlanItemType;
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Scaffold a new plan item from a template.
|
|
19
|
+
*/
|
|
20
|
+
export declare function runCreate(options: CreateOptions): CreateResult;
|
|
21
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAEA,OAAO,EAA+B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEhF,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAWnC,MAAM,WAAW,aAAa;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,YAAY,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAuC9D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { renderTemplate, VALID_TYPES } from './templates.js';
|
|
4
|
+
export const EXIT_SUCCESS = 0;
|
|
5
|
+
export const EXIT_ALREADY_EXISTS = 1;
|
|
6
|
+
export const EXIT_INVALID_ARGS = 2;
|
|
7
|
+
/** Directory name for each type */
|
|
8
|
+
const TYPE_DIRS = {
|
|
9
|
+
work: 'work',
|
|
10
|
+
bug: 'work', // bugs live alongside work items
|
|
11
|
+
decision: 'decision',
|
|
12
|
+
spec: 'spec',
|
|
13
|
+
milestone: 'milestone',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Scaffold a new plan item from a template.
|
|
17
|
+
*/
|
|
18
|
+
export function runCreate(options) {
|
|
19
|
+
const { dir, type, id, title, attrs } = options;
|
|
20
|
+
if (!VALID_TYPES.includes(type)) {
|
|
21
|
+
const err = new Error(`Invalid type "${type}". Valid types: ${VALID_TYPES.join(', ')}`);
|
|
22
|
+
err.exitCode = EXIT_INVALID_ARGS;
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
if (!id) {
|
|
26
|
+
const err = new Error('--id is required');
|
|
27
|
+
err.exitCode = EXIT_INVALID_ARGS;
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
30
|
+
if (!title) {
|
|
31
|
+
const err = new Error('--title is required');
|
|
32
|
+
err.exitCode = EXIT_INVALID_ARGS;
|
|
33
|
+
throw err;
|
|
34
|
+
}
|
|
35
|
+
const subDir = join(dir, TYPE_DIRS[type]);
|
|
36
|
+
mkdirSync(subDir, { recursive: true });
|
|
37
|
+
// Generate a filename from the title
|
|
38
|
+
const slug = title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
|
|
39
|
+
const fileName = `${slug}.md`;
|
|
40
|
+
const filePath = join(subDir, fileName);
|
|
41
|
+
if (existsSync(filePath)) {
|
|
42
|
+
const err = new Error(`File already exists: ${filePath}`);
|
|
43
|
+
err.exitCode = EXIT_ALREADY_EXISTS;
|
|
44
|
+
throw err;
|
|
45
|
+
}
|
|
46
|
+
const content = renderTemplate(type, { id, title, attrs });
|
|
47
|
+
writeFileSync(filePath, content);
|
|
48
|
+
return { file: filePath, type, id };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,mCAAmC;AACnC,MAAM,SAAS,GAAiC;IAC/C,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,MAAM,EAAE,iCAAiC;IAC9C,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;CACtB,CAAC;AAgBF;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,OAAsB;IAC/C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAA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BAAmB,CAAC;QACnC,MAAM,GAAG,CAAC;IACX,CAAC;IAED,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAEjC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const EXIT_SUCCESS = 0;
|
|
2
|
+
export declare const EXIT_ALREADY_EXISTS = 1;
|
|
3
|
+
export interface InitOptions {
|
|
4
|
+
dir: string;
|
|
5
|
+
/** Path to the project root (for CLAUDE.md). Defaults to '.' */
|
|
6
|
+
projectRoot?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface InitResult {
|
|
9
|
+
dir: string;
|
|
10
|
+
created: string[];
|
|
11
|
+
claudeMdUpdated: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Initialize a plan directory structure with example files.
|
|
15
|
+
*/
|
|
16
|
+
export declare function runInit(options: InitOptions): InitResult;
|
|
17
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,MAAM,WAAW,WAAW;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;CACzB;AAkBD;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,CA0FxD"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync, appendFileSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { runCreate } from './create.js';
|
|
4
|
+
import { STATUS_PAGES, renderStatusPage, renderTypeIndexPage } from './templates.js';
|
|
5
|
+
export const EXIT_SUCCESS = 0;
|
|
6
|
+
export const EXIT_ALREADY_EXISTS = 1;
|
|
7
|
+
const WORKFLOW_SECTION = `
|
|
8
|
+
## Plan
|
|
9
|
+
|
|
10
|
+
Project planning content lives in \`plan/\` as Markdoc files using the \`@refrakt-md/plan\` runes package.
|
|
11
|
+
|
|
12
|
+
### Workflow
|
|
13
|
+
|
|
14
|
+
1. Find next work item: \`refrakt plan next\`
|
|
15
|
+
2. Start working: \`refrakt plan update <id> --status in-progress\`
|
|
16
|
+
3. Check off criteria: \`refrakt plan update <id> --check "criterion text"\`
|
|
17
|
+
4. Mark complete with resolution: \`refrakt plan update <id> --status done --resolve "summary of what was done"\`
|
|
18
|
+
5. Check project status: \`refrakt plan status\`
|
|
19
|
+
|
|
20
|
+
When marking a work item done, always provide a \`--resolve\` summary unless the change is trivial. This captures implementation context (files changed, decisions made, branch/PR) for future reference.
|
|
21
|
+
`;
|
|
22
|
+
/**
|
|
23
|
+
* Initialize a plan directory structure with example files.
|
|
24
|
+
*/
|
|
25
|
+
export function runInit(options) {
|
|
26
|
+
const { dir, projectRoot = '.' } = options;
|
|
27
|
+
const created = [];
|
|
28
|
+
// Create directories
|
|
29
|
+
const dirs = ['work', 'spec', 'decision', 'milestone'];
|
|
30
|
+
for (const sub of dirs) {
|
|
31
|
+
const path = join(dir, sub);
|
|
32
|
+
if (!existsSync(path)) {
|
|
33
|
+
mkdirSync(path, { recursive: true });
|
|
34
|
+
created.push(path + '/');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Create example files — use runCreate which generates slug-based filenames
|
|
38
|
+
const examples = [
|
|
39
|
+
{ type: 'spec', id: 'SPEC-001', title: 'Example Spec', subDir: 'spec', slug: 'example-spec.md' },
|
|
40
|
+
{ type: 'work', id: 'WORK-001', title: 'Example Work Item', subDir: 'work', slug: 'example-work-item.md', attrs: { priority: 'medium', complexity: 'simple', tags: '' } },
|
|
41
|
+
{ type: 'decision', id: 'ADR-001', title: 'Example Decision', subDir: 'decision', slug: 'example-decision.md' },
|
|
42
|
+
{ type: 'milestone', id: 'v0.1.0', title: 'First Release', subDir: 'milestone', slug: 'first-release.md' },
|
|
43
|
+
];
|
|
44
|
+
for (const ex of examples) {
|
|
45
|
+
const filePath = join(dir, ex.subDir, ex.slug);
|
|
46
|
+
if (!existsSync(filePath)) {
|
|
47
|
+
runCreate({ dir, type: ex.type, id: ex.id, title: ex.title, attrs: ex.attrs });
|
|
48
|
+
created.push(filePath);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Create status filter pages for each type
|
|
52
|
+
for (const def of STATUS_PAGES) {
|
|
53
|
+
const slug = `${def.status}.md`;
|
|
54
|
+
const filePath = join(dir, def.typeDir, slug);
|
|
55
|
+
if (!existsSync(filePath)) {
|
|
56
|
+
writeFileSync(filePath, renderStatusPage(def));
|
|
57
|
+
created.push(filePath);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Create type-level index pages with links to status filter pages
|
|
61
|
+
const typeDirs = [...new Set(STATUS_PAGES.map(p => p.typeDir))];
|
|
62
|
+
for (const typeDir of typeDirs) {
|
|
63
|
+
const filePath = join(dir, typeDir, 'index.md');
|
|
64
|
+
if (!existsSync(filePath)) {
|
|
65
|
+
writeFileSync(filePath, renderTypeIndexPage(typeDir));
|
|
66
|
+
created.push(filePath);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// Create index.md
|
|
70
|
+
const indexFile = join(dir, 'index.md');
|
|
71
|
+
if (!existsSync(indexFile)) {
|
|
72
|
+
writeFileSync(indexFile, `# Project Plan
|
|
73
|
+
|
|
74
|
+
This directory contains project planning content.
|
|
75
|
+
|
|
76
|
+
## Structure
|
|
77
|
+
|
|
78
|
+
- [Specifications](spec/) — What to build
|
|
79
|
+
- [Work Items](work/) — How to build it
|
|
80
|
+
- [Decisions](decision/) — Why it's built this way
|
|
81
|
+
- [Milestones](milestone/) — Named release targets
|
|
82
|
+
|
|
83
|
+
## Quick Start
|
|
84
|
+
|
|
85
|
+
\`\`\`bash
|
|
86
|
+
refrakt plan next # Find next work item
|
|
87
|
+
refrakt plan status # Project overview
|
|
88
|
+
refrakt plan create work --id WORK-002 --title "My task"
|
|
89
|
+
\`\`\`
|
|
90
|
+
`);
|
|
91
|
+
created.push(indexFile);
|
|
92
|
+
}
|
|
93
|
+
// Update CLAUDE.md
|
|
94
|
+
let claudeMdUpdated = false;
|
|
95
|
+
const claudeMdPath = join(projectRoot, 'CLAUDE.md');
|
|
96
|
+
if (existsSync(claudeMdPath)) {
|
|
97
|
+
const content = readFileSync(claudeMdPath, 'utf-8');
|
|
98
|
+
if (!content.includes('refrakt plan next')) {
|
|
99
|
+
appendFileSync(claudeMdPath, WORKFLOW_SECTION);
|
|
100
|
+
claudeMdUpdated = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
writeFileSync(claudeMdPath, `# CLAUDE.md\n${WORKFLOW_SECTION}`);
|
|
105
|
+
claudeMdUpdated = true;
|
|
106
|
+
}
|
|
107
|
+
return { dir, created, claudeMdUpdated };
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAA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AAC;IACxB,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const EXIT_FOUND = 0;
|
|
2
|
+
export declare const EXIT_NO_MATCHES = 1;
|
|
3
|
+
export declare const EXIT_INVALID_ARGS = 2;
|
|
4
|
+
export interface NextOptions {
|
|
5
|
+
dir: string;
|
|
6
|
+
milestone?: string;
|
|
7
|
+
tag?: string;
|
|
8
|
+
assignee?: string;
|
|
9
|
+
type?: 'work' | 'bug' | 'all';
|
|
10
|
+
count?: number;
|
|
11
|
+
formatJson?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface NextResult {
|
|
14
|
+
items: NextItem[];
|
|
15
|
+
}
|
|
16
|
+
export interface NextItem {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string | undefined;
|
|
19
|
+
type: string;
|
|
20
|
+
priority: string;
|
|
21
|
+
complexity: string;
|
|
22
|
+
file: string;
|
|
23
|
+
criteria: {
|
|
24
|
+
text: string;
|
|
25
|
+
checked: boolean;
|
|
26
|
+
}[];
|
|
27
|
+
refs: string[];
|
|
28
|
+
attributes: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Find the next actionable work items, respecting dependencies and filters.
|
|
32
|
+
*/
|
|
33
|
+
export declare function runNext(options: NextOptions): NextResult;
|
|
34
|
+
//# sourceMappingURL=next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/commands/next.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,MAAM,WAAW,WAAW;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAC/C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,CA2ExD"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { scanPlanFiles } from '../scanner.js';
|
|
2
|
+
// --- Priority and complexity sort orders ---
|
|
3
|
+
const PRIORITY_ORDER = {
|
|
4
|
+
critical: 0,
|
|
5
|
+
high: 1,
|
|
6
|
+
medium: 2,
|
|
7
|
+
low: 3,
|
|
8
|
+
};
|
|
9
|
+
const COMPLEXITY_ORDER = {
|
|
10
|
+
trivial: 0,
|
|
11
|
+
simple: 1,
|
|
12
|
+
moderate: 2,
|
|
13
|
+
complex: 3,
|
|
14
|
+
unknown: 4,
|
|
15
|
+
};
|
|
16
|
+
/** Statuses that indicate an entity's work is complete */
|
|
17
|
+
const DONE_STATUSES = new Set(['done', 'fixed']);
|
|
18
|
+
/** Statuses that indicate an item is actionable */
|
|
19
|
+
const READY_STATUSES = {
|
|
20
|
+
work: ['ready'],
|
|
21
|
+
bug: ['confirmed'],
|
|
22
|
+
};
|
|
23
|
+
// --- Exit codes ---
|
|
24
|
+
export const EXIT_FOUND = 0;
|
|
25
|
+
export const EXIT_NO_MATCHES = 1;
|
|
26
|
+
export const EXIT_INVALID_ARGS = 2;
|
|
27
|
+
/**
|
|
28
|
+
* Find the next actionable work items, respecting dependencies and filters.
|
|
29
|
+
*/
|
|
30
|
+
export function runNext(options) {
|
|
31
|
+
const { dir, milestone, tag, assignee, type = 'all', count = 1 } = options;
|
|
32
|
+
const entities = scanPlanFiles(dir);
|
|
33
|
+
// Build status lookup: ID → status
|
|
34
|
+
const statusMap = new Map();
|
|
35
|
+
for (const e of entities) {
|
|
36
|
+
const id = e.attributes.id ?? e.attributes.name;
|
|
37
|
+
if (id)
|
|
38
|
+
statusMap.set(id, e.attributes.status ?? '');
|
|
39
|
+
}
|
|
40
|
+
// Filter to actionable types
|
|
41
|
+
const typeFilter = type === 'all' ? ['work', 'bug'] : [type];
|
|
42
|
+
let candidates = entities.filter(e => {
|
|
43
|
+
if (!typeFilter.includes(e.type))
|
|
44
|
+
return false;
|
|
45
|
+
const readyStatuses = READY_STATUSES[e.type];
|
|
46
|
+
if (!readyStatuses)
|
|
47
|
+
return false;
|
|
48
|
+
const status = e.attributes.status ?? '';
|
|
49
|
+
return readyStatuses.includes(status);
|
|
50
|
+
});
|
|
51
|
+
// Exclude items with unfinished dependencies
|
|
52
|
+
candidates = candidates.filter(e => {
|
|
53
|
+
for (const refId of e.refs) {
|
|
54
|
+
const refStatus = statusMap.get(refId);
|
|
55
|
+
// If the referenced entity exists and isn't done, exclude this item
|
|
56
|
+
if (refStatus !== undefined && !DONE_STATUSES.has(refStatus)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
});
|
|
62
|
+
// Apply filters
|
|
63
|
+
if (milestone) {
|
|
64
|
+
candidates = candidates.filter(e => e.attributes.milestone === milestone);
|
|
65
|
+
}
|
|
66
|
+
if (tag) {
|
|
67
|
+
candidates = candidates.filter(e => {
|
|
68
|
+
const tags = (e.attributes.tags ?? '').split(',').map(t => t.trim());
|
|
69
|
+
return tags.includes(tag);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (assignee) {
|
|
73
|
+
candidates = candidates.filter(e => e.attributes.assignee === assignee);
|
|
74
|
+
}
|
|
75
|
+
// Sort: priority (critical first), then complexity (simpler first)
|
|
76
|
+
candidates.sort((a, b) => {
|
|
77
|
+
const pa = PRIORITY_ORDER[a.attributes.priority ?? 'medium'] ?? 2;
|
|
78
|
+
const pb = PRIORITY_ORDER[b.attributes.priority ?? 'medium'] ?? 2;
|
|
79
|
+
if (pa !== pb)
|
|
80
|
+
return pa - pb;
|
|
81
|
+
const ca = COMPLEXITY_ORDER[a.attributes.complexity ?? 'unknown'] ?? 4;
|
|
82
|
+
const cb = COMPLEXITY_ORDER[b.attributes.complexity ?? 'unknown'] ?? 4;
|
|
83
|
+
return ca - cb;
|
|
84
|
+
});
|
|
85
|
+
const selected = candidates.slice(0, count);
|
|
86
|
+
return {
|
|
87
|
+
items: selected.map(e => ({
|
|
88
|
+
id: e.attributes.id ?? e.attributes.name ?? '',
|
|
89
|
+
title: e.title,
|
|
90
|
+
type: e.type,
|
|
91
|
+
priority: e.attributes.priority ?? 'medium',
|
|
92
|
+
complexity: e.attributes.complexity ?? 'unknown',
|
|
93
|
+
file: e.file,
|
|
94
|
+
criteria: e.criteria,
|
|
95
|
+
refs: e.refs,
|
|
96
|
+
attributes: e.attributes,
|
|
97
|
+
})),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=next.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../src/commands/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE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N,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACzB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE;YAC9C,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,IAAI,QAAQ;YAC3C,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,UAAU,IAAI,SAAS;YAChD,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,UAAU,EAAE,CAAC,CAAC,UAAU;SACxB,CAAC,CAAC;KACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-behaviors.d.ts","sourceRoot":"","sources":["../../src/commands/plan-behaviors.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { initRuneBehaviors, initLayoutBehaviors, registerBehaviors, tabsBehavior } from '@refrakt-md/behaviors';
|
|
2
|
+
// Register plan-specific behaviors
|
|
3
|
+
registerBehaviors({ 'milestone-backlog': tabsBehavior });
|
|
4
|
+
// Initialize all rune + layout behaviors on DOM ready
|
|
5
|
+
initRuneBehaviors(document);
|
|
6
|
+
initLayoutBehaviors(document);
|
|
7
|
+
//# sourceMappingURL=plan-behaviors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-behaviors.js","sourceRoot":"","sources":["../../src/commands/plan-behaviors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhH,mCAAmC;AACnC,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,YAAY,EAAE,CAAC,CAAC;AAEzD,sDAAsD;AACtD,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAC5B,mBAAmB,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { RendererNode } from '@refrakt-md/types';
|
|
3
|
+
export interface ProcessedPage {
|
|
4
|
+
url: string;
|
|
5
|
+
title: string;
|
|
6
|
+
type: string;
|
|
7
|
+
entityId: string;
|
|
8
|
+
status: string;
|
|
9
|
+
renderable: RendererNode;
|
|
10
|
+
filePath: string;
|
|
11
|
+
headings: Array<{
|
|
12
|
+
level: number;
|
|
13
|
+
text: string;
|
|
14
|
+
id: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export interface NavGroup {
|
|
18
|
+
title: string;
|
|
19
|
+
type: string;
|
|
20
|
+
items: NavItem[];
|
|
21
|
+
statusGroups: NavStatusGroup[];
|
|
22
|
+
}
|
|
23
|
+
export interface NavStatusGroup {
|
|
24
|
+
status: string;
|
|
25
|
+
label: string;
|
|
26
|
+
items: NavItem[];
|
|
27
|
+
collapsed: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface NavItem {
|
|
30
|
+
url: string;
|
|
31
|
+
label: string;
|
|
32
|
+
id: string;
|
|
33
|
+
status: string;
|
|
34
|
+
priority?: string;
|
|
35
|
+
tags?: string;
|
|
36
|
+
assignee?: string;
|
|
37
|
+
milestone?: string;
|
|
38
|
+
severity?: string;
|
|
39
|
+
hasUnresolvedBlockers?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface PipelineResult {
|
|
42
|
+
pages: ProcessedPage[];
|
|
43
|
+
dashboard: ProcessedPage;
|
|
44
|
+
nav: NavGroup[];
|
|
45
|
+
navRegion: RendererNode[];
|
|
46
|
+
themeCss: string;
|
|
47
|
+
highlightCss: string;
|
|
48
|
+
}
|
|
49
|
+
export interface PipelineOptions {
|
|
50
|
+
dir: string;
|
|
51
|
+
specsDir?: string;
|
|
52
|
+
theme: string;
|
|
53
|
+
baseUrl: string;
|
|
54
|
+
}
|
|
55
|
+
export declare function runPipeline(options: PipelineOptions): Promise<PipelineResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Render a processed page to a full HTML document using the HTML adapter.
|
|
58
|
+
*/
|
|
59
|
+
export declare function renderPage(page: ProcessedPage, navRegion: RendererNode[], allPageUrls: Array<{
|
|
60
|
+
url: string;
|
|
61
|
+
title: string;
|
|
62
|
+
draft: boolean;
|
|
63
|
+
}>, opts?: {
|
|
64
|
+
hotReload?: boolean;
|
|
65
|
+
stylesheets?: string[];
|
|
66
|
+
scripts?: string[];
|
|
67
|
+
activeUrl?: string;
|
|
68
|
+
}): string;
|
|
69
|
+
export declare function getThemeCss(theme: string): string;
|
|
70
|
+
//# sourceMappingURL=render-pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-pipeline.d.ts","sourceRoot":"","sources":["../../src/commands/render-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAQ1B,OAAO,KAAK,EAAE,YAAY,EAAuF,MAAM,mBAAmB,CAAC;AAoB3I,MAAM,WAAW,aAAa;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D;AAED,MAAM,WAAW,QAAQ;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAA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