lean-spec 0.1.1 → 0.1.3
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 +119 -0
- package/README.md +25 -24
- package/dist/{chunk-GLXYUS7F.js → chunk-S6TGAL75.js} +392 -112
- package/dist/chunk-S6TGAL75.js.map +1 -0
- package/dist/cli.js +30 -13
- package/dist/cli.js.map +1 -1
- package/dist/mcp-server.js +1 -1
- package/package.json +16 -16
- package/templates/enterprise/README.md +1 -1
- package/templates/enterprise/files/AGENTS.md +12 -12
- package/templates/minimal/README.md +1 -1
- package/templates/minimal/files/AGENTS.md +7 -7
- package/templates/standard/README.md +1 -1
- package/templates/standard/files/AGENTS.md +10 -10
- package/dist/chunk-GLXYUS7F.js.map +0 -1
- /package/bin/{lspec.js → lean-spec.js} +0 -0
package/dist/cli.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
listSpecs,
|
|
14
14
|
listTemplates,
|
|
15
15
|
mcpCommand,
|
|
16
|
+
migrateCommand,
|
|
16
17
|
openCommand,
|
|
17
18
|
removeTemplate,
|
|
18
19
|
searchCommand,
|
|
@@ -22,7 +23,7 @@ import {
|
|
|
22
23
|
updateSpec,
|
|
23
24
|
validateCommand,
|
|
24
25
|
viewCommand
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-S6TGAL75.js";
|
|
26
27
|
import "./chunk-S4YNQ5KE.js";
|
|
27
28
|
|
|
28
29
|
// src/cli.ts
|
|
@@ -46,7 +47,7 @@ function parseCustomFieldOptions(fieldOptions) {
|
|
|
46
47
|
|
|
47
48
|
// src/cli.ts
|
|
48
49
|
var program = new Command();
|
|
49
|
-
program.name("
|
|
50
|
+
program.name("lean-spec").description("Manage LeanSpec documents").version("0.1.2");
|
|
50
51
|
program.addHelpText("after", `
|
|
51
52
|
Command Groups:
|
|
52
53
|
|
|
@@ -57,6 +58,7 @@ Command Groups:
|
|
|
57
58
|
update <spec> Update spec metadata
|
|
58
59
|
archive <spec> Move spec to archived/
|
|
59
60
|
backfill [specs...] Backfill timestamps from git history
|
|
61
|
+
migrate <input-path> Migrate specs from other SDD tools
|
|
60
62
|
|
|
61
63
|
Viewing & Navigation:
|
|
62
64
|
view <spec> View spec content
|
|
@@ -80,17 +82,19 @@ Command Groups:
|
|
|
80
82
|
mcp Start MCP server for AI assistants
|
|
81
83
|
|
|
82
84
|
Examples:
|
|
83
|
-
$
|
|
84
|
-
$
|
|
85
|
-
$
|
|
86
|
-
$
|
|
87
|
-
$
|
|
88
|
-
$
|
|
89
|
-
$
|
|
90
|
-
$
|
|
91
|
-
$
|
|
92
|
-
$
|
|
93
|
-
$
|
|
85
|
+
$ lean-spec init
|
|
86
|
+
$ lean-spec create my-feature --priority high
|
|
87
|
+
$ lean-spec list --status in-progress
|
|
88
|
+
$ lean-spec view 042
|
|
89
|
+
$ lean-spec backfill --dry-run
|
|
90
|
+
$ lean-spec migrate ./docs/adr
|
|
91
|
+
$ lean-spec migrate ./docs/rfcs --with copilot
|
|
92
|
+
$ lean-spec board --tag backend
|
|
93
|
+
$ lean-spec search "authentication"
|
|
94
|
+
$ lean-spec validate
|
|
95
|
+
$ lean-spec validate --verbose
|
|
96
|
+
$ lean-spec validate --quiet --rule max-lines
|
|
97
|
+
$ lean-spec validate 018 --max-lines 500
|
|
94
98
|
`);
|
|
95
99
|
program.command("archive <spec>").description("Move spec to archived/").action(async (specPath) => {
|
|
96
100
|
await archiveSpec(specPath);
|
|
@@ -239,6 +243,19 @@ program.command("view <spec>").description('View spec content (supports sub-spec
|
|
|
239
243
|
process.exit(1);
|
|
240
244
|
}
|
|
241
245
|
});
|
|
246
|
+
program.command("migrate <input-path>").description("Migrate specs from other SDD tools (ADR, RFC, OpenSpec, spec-kit, etc.)").option("--with <provider>", "AI-assisted migration (copilot, claude, gemini)").option("--dry-run", "Preview without making changes").option("--batch-size <n>", "Process N docs at a time", parseInt).option("--skip-validation", "Don't validate after migration").option("--backfill", "Auto-run backfill after migration").action(async (inputPath, options) => {
|
|
247
|
+
if (options.with && !["copilot", "claude", "gemini"].includes(options.with)) {
|
|
248
|
+
console.error("\x1B[31m\u274C Error:\x1B[0m Invalid AI provider. Use: copilot, claude, or gemini");
|
|
249
|
+
process.exit(1);
|
|
250
|
+
}
|
|
251
|
+
await migrateCommand(inputPath, {
|
|
252
|
+
aiProvider: options.with,
|
|
253
|
+
dryRun: options.dryRun,
|
|
254
|
+
batchSize: options.batchSize,
|
|
255
|
+
skipValidation: options.skipValidation,
|
|
256
|
+
backfill: options.backfill
|
|
257
|
+
});
|
|
258
|
+
});
|
|
242
259
|
program.command("mcp").description("Start MCP server for AI assistants (Claude Desktop, Cline, etc.)").action(async () => {
|
|
243
260
|
await mcpCommand();
|
|
244
261
|
});
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts","../src/utils/cli-helpers.ts"],"sourcesContent":["import { Command } from 'commander';\nimport {\n createSpec,\n archiveSpec,\n listSpecs,\n updateSpec,\n checkSpecs,\n backfillTimestamps,\n listTemplates,\n showTemplate,\n addTemplate,\n removeTemplate,\n copyTemplate,\n initProject,\n statsCommand,\n boardCommand,\n timelineCommand,\n depsCommand,\n searchCommand,\n ganttCommand,\n filesCommand,\n viewCommand,\n openCommand,\n validateCommand,\n mcpCommand,\n} from './commands/index.js';\nimport { parseCustomFieldOptions } from './utils/cli-helpers.js';\nimport type { SpecStatus, SpecPriority } from './frontmatter.js';\n\nconst program = new Command();\n\nprogram\n .name('lspec')\n .description('Manage LeanSpec documents')\n .version('0.1.0');\n\n// Add custom help text with grouped commands\nprogram.addHelpText('after', `\nCommand Groups:\n \n Core Commands:\n init Initialize LeanSpec in current directory\n create <name> Create new spec in folder structure\n list List all specs\n update <spec> Update spec metadata\n archive <spec> Move spec to archived/\n backfill [specs...] Backfill timestamps from git history\n \n Viewing & Navigation:\n view <spec> View spec content\n open <spec> Open spec in editor\n search <query> Full-text search with metadata filters\n files <spec> List files in a spec\n \n Project & Analytics:\n board Show Kanban-style board view\n stats Show aggregate statistics\n timeline Show creation/completion over time\n gantt Show timeline with dependencies\n deps <spec> Show dependency graph for a spec\n \n Maintenance:\n check Check for sequence conflicts\n validate [specs...] Validate specs for quality issues\n templates Manage spec templates\n \n Server:\n mcp Start MCP server for AI assistants\n\nExamples:\n $ lspec init\n $ lspec create my-feature --priority high\n $ lspec list --status in-progress\n $ lspec view 042\n $ lspec backfill --dry-run\n $ lspec board --tag backend\n $ lspec search \"authentication\"\n $ lspec validate\n $ lspec validate --verbose\n $ lspec validate --quiet --rule max-lines\n $ lspec validate 018 --max-lines 500\n`);\n\n// archive command\nprogram\n .command('archive <spec>')\n .description('Move spec to archived/')\n .action(async (specPath: string) => {\n await archiveSpec(specPath);\n });\n\n// backfill command\nprogram\n .command('backfill [specs...]')\n .description('Backfill timestamps from git history')\n .option('--dry-run', 'Show what would be updated without making changes')\n .option('--force', 'Overwrite existing timestamp values')\n .option('--assignee', 'Include assignee from first commit author')\n .option('--transitions', 'Include full status transition history')\n .option('--all', 'Include all optional fields (assignee + transitions)')\n .action(async (specs: string[] | undefined, options: {\n dryRun?: boolean;\n force?: boolean;\n assignee?: boolean;\n transitions?: boolean;\n all?: boolean;\n }) => {\n await backfillTimestamps({\n dryRun: options.dryRun,\n force: options.force,\n includeAssignee: options.assignee || options.all,\n includeTransitions: options.transitions || options.all,\n specs: specs && specs.length > 0 ? specs : undefined,\n });\n });\n\n// board command\nprogram\n .command('board')\n .description('Show Kanban-style board view with project completion summary')\n .option('--complete', 'Include complete specs (default: hidden)')\n .option('--simple', 'Hide completion summary (kanban only)')\n .option('--completion-only', 'Show only completion summary (no kanban)')\n .option('--tag <tag>', 'Filter by tag')\n .option('--assignee <name>', 'Filter by assignee')\n .action(async (options: {\n showComplete?: boolean;\n simple?: boolean;\n completionOnly?: boolean;\n tag?: string;\n assignee?: string;\n }) => {\n await boardCommand(options);\n });\n\n// check command\nprogram\n .command('check')\n .description('Check for sequence conflicts')\n .option('-q, --quiet', 'Brief output')\n .action(async (options: {\n quiet?: boolean;\n }) => {\n const hasNoConflicts = await checkSpecs(options);\n // Exit with 0 (success) if no conflicts, 1 (error) if conflicts found\n process.exit(hasNoConflicts ? 0 : 1);\n });\n\n// validate command\nprogram\n .command('validate [specs...]')\n .description('Validate specs for quality issues')\n .option('--max-lines <number>', 'Custom line limit (default: 400)', parseInt)\n .option('--verbose', 'Show passing specs')\n .option('--quiet', 'Suppress warnings, only show errors')\n .option('--format <format>', 'Output format: default, json, compact', 'default')\n .option('--rule <rule>', 'Filter by specific rule name (e.g., max-lines, frontmatter)')\n .action(async (specs: string[] | undefined, options: {\n maxLines?: number;\n verbose?: boolean;\n quiet?: boolean;\n format?: 'default' | 'json' | 'compact';\n rule?: string;\n }) => {\n const passed = await validateCommand({\n maxLines: options.maxLines,\n specs: specs && specs.length > 0 ? specs : undefined,\n verbose: options.verbose,\n quiet: options.quiet,\n format: options.format,\n rule: options.rule,\n });\n // Exit with 0 (success) if all passed, 1 (error) if any failed\n process.exit(passed ? 0 : 1);\n });\n\n// create command\nprogram\n .command('create <name>')\n .description('Create new spec in folder structure')\n .option('--title <title>', 'Set custom title')\n .option('--description <desc>', 'Set initial description')\n .option('--tags <tags>', 'Set tags (comma-separated)')\n .option('--priority <priority>', 'Set priority (low, medium, high, critical)')\n .option('--assignee <name>', 'Set assignee')\n .option('--template <template>', 'Use a specific template')\n .option('--field <name=value...>', 'Set custom field (can specify multiple)')\n .option('--no-prefix', 'Skip date prefix even if configured')\n .action(async (name: string, options: {\n title?: string;\n description?: string;\n tags?: string;\n priority?: SpecPriority;\n assignee?: string;\n template?: string;\n field?: string[];\n prefix?: boolean;\n }) => {\n // Parse custom fields from --field options\n const customFields = parseCustomFieldOptions(options.field);\n \n const createOptions: {\n title?: string;\n description?: string;\n tags?: string[];\n priority?: SpecPriority;\n assignee?: string;\n template?: string;\n customFields?: Record<string, unknown>;\n noPrefix?: boolean;\n } = {\n title: options.title,\n description: options.description,\n tags: options.tags ? options.tags.split(',').map(t => t.trim()) : undefined,\n priority: options.priority,\n assignee: options.assignee,\n template: options.template,\n customFields: Object.keys(customFields).length > 0 ? customFields : undefined,\n noPrefix: options.prefix === false,\n };\n await createSpec(name, createOptions);\n });\n\n// deps command\nprogram\n .command('deps <spec>')\n .description('Show dependency graph for a spec. Related specs (⟷) are shown bidirectionally, depends_on (→) are directional.')\n .option('--depth <n>', 'Show N levels deep (default: 3)', parseInt)\n .option('--graph', 'ASCII graph visualization')\n .option('--json', 'Output as JSON')\n .action(async (specPath: string, options: {\n depth?: number;\n graph?: boolean;\n json?: boolean;\n }) => {\n await depsCommand(specPath, options);\n });\n\n// files command\nprogram\n .command('files <spec>')\n .description('List files in a spec')\n .option('--type <type>', 'Filter by type: docs, assets')\n .option('--tree', 'Show tree structure')\n .action(async (specPath: string, options: {\n type?: 'docs' | 'assets';\n tree?: boolean;\n }) => {\n await filesCommand(specPath, options);\n });\n\n// gantt command\nprogram\n .command('gantt')\n .description('Show timeline with dependencies')\n .option('--weeks <n>', 'Show N weeks (default: 4)', parseInt)\n .option('--show-complete', 'Include completed specs')\n .option('--critical-path', 'Highlight critical path')\n .action(async (options: {\n weeks?: number;\n showComplete?: boolean;\n criticalPath?: boolean;\n }) => {\n await ganttCommand(options);\n });\n\n// init command\nprogram\n .command('init')\n .description('Initialize LeanSpec in current directory')\n .action(async () => {\n await initProject();\n });\n\n// list command\nprogram\n .command('list')\n .description('List all specs')\n .option('--archived', 'Include archived specs')\n .option('--status <status>', 'Filter by status (planned, in-progress, complete, archived)')\n .option('--tag <tag...>', 'Filter by tag (can specify multiple)')\n .option('--priority <priority>', 'Filter by priority (low, medium, high, critical)')\n .option('--assignee <name>', 'Filter by assignee')\n .option('--field <name=value...>', 'Filter by custom field (can specify multiple)')\n .option('--sort <field>', 'Sort by field (id, created, name, status, priority)', 'id')\n .option('--order <order>', 'Sort order (asc, desc)', 'desc')\n .action(async (options: {\n archived?: boolean;\n status?: SpecStatus;\n tag?: string[];\n priority?: SpecPriority;\n assignee?: string;\n field?: string[];\n sort?: string;\n order?: string;\n }) => {\n // Parse custom field filters from --field options\n const customFields = parseCustomFieldOptions(options.field);\n \n const listOptions: {\n showArchived?: boolean;\n status?: SpecStatus;\n tags?: string[];\n priority?: SpecPriority;\n assignee?: string;\n customFields?: Record<string, unknown>;\n sortBy?: string;\n sortOrder?: 'asc' | 'desc';\n } = {\n showArchived: options.archived,\n status: options.status,\n tags: options.tag,\n priority: options.priority,\n assignee: options.assignee,\n customFields: Object.keys(customFields).length > 0 ? customFields : undefined,\n sortBy: options.sort || 'id',\n sortOrder: (options.order as 'asc' | 'desc') || 'desc',\n };\n await listSpecs(listOptions);\n });\n\n// open command\nprogram\n .command('open <spec>')\n .description('Open spec in editor')\n .option('--editor <editor>', 'Specify editor command')\n .action(async (specPath: string, options: {\n editor?: string;\n }) => {\n try {\n await openCommand(specPath, {\n editor: options.editor,\n });\n } catch (error) {\n console.error('\\x1b[31mError:\\x1b[0m', error instanceof Error ? error.message : String(error));\n process.exit(1);\n }\n });\n\n// search command\nprogram\n .command('search <query>')\n .description('Full-text search with metadata filters')\n .option('--status <status>', 'Filter by status')\n .option('--tag <tag>', 'Filter by tag')\n .option('--priority <priority>', 'Filter by priority')\n .option('--assignee <name>', 'Filter by assignee')\n .option('--field <name=value...>', 'Filter by custom field (can specify multiple)')\n .action(async (query: string, options: {\n status?: SpecStatus;\n tag?: string;\n priority?: SpecPriority;\n assignee?: string;\n field?: string[];\n }) => {\n // Parse custom field filters from --field options\n const customFields = parseCustomFieldOptions(options.field);\n \n await searchCommand(query, {\n status: options.status,\n tag: options.tag,\n priority: options.priority,\n assignee: options.assignee,\n customFields: Object.keys(customFields).length > 0 ? customFields : undefined,\n });\n });\n\n// stats command\nprogram\n .command('stats')\n .description('Show aggregate statistics (default: simplified view)')\n .option('--tag <tag>', 'Filter by tag')\n .option('--assignee <name>', 'Filter by assignee')\n .option('--full', 'Show full detailed analytics (all sections)')\n .option('--timeline', 'Show only timeline section')\n .option('--velocity', 'Show only velocity section')\n .option('--json', 'Output as JSON')\n .action(async (options: {\n tag?: string;\n assignee?: string;\n full?: boolean;\n timeline?: boolean;\n velocity?: boolean;\n json?: boolean;\n }) => {\n await statsCommand(options);\n });\n\n// templates command and subcommands\nconst templatesCmd = program\n .command('templates')\n .description('Manage spec templates');\n\ntemplatesCmd\n .command('list')\n .description('List available templates')\n .action(async () => {\n await listTemplates();\n });\n\ntemplatesCmd\n .command('show <name>')\n .description('Show template content')\n .action(async (name: string) => {\n await showTemplate(name);\n });\n\ntemplatesCmd\n .command('add <name> <file>')\n .description('Register a template')\n .action(async (name: string, file: string) => {\n await addTemplate(name, file);\n });\n\ntemplatesCmd\n .command('remove <name>')\n .description('Unregister a template')\n .action(async (name: string) => {\n await removeTemplate(name);\n });\n\ntemplatesCmd\n .command('copy <source> <target>')\n .description('Copy a template to create a new one')\n .action(async (source: string, target: string) => {\n await copyTemplate(source, target);\n });\n\n// Default action for templates (list)\ntemplatesCmd\n .action(async () => {\n await listTemplates();\n });\n\n// timeline command\nprogram\n .command('timeline')\n .description('Show creation/completion over time')\n .option('--days <n>', 'Show last N days (default: 30)', parseInt)\n .option('--by-tag', 'Group by tag')\n .option('--by-assignee', 'Group by assignee')\n .action(async (options: {\n days?: number;\n byTag?: boolean;\n byAssignee?: boolean;\n }) => {\n await timelineCommand(options);\n });\n\n// update command\nprogram\n .command('update <spec>')\n .description('Update spec metadata')\n .option('--status <status>', 'Set status (planned, in-progress, complete, archived)')\n .option('--priority <priority>', 'Set priority (low, medium, high, critical)')\n .option('--tags <tags>', 'Set tags (comma-separated)')\n .option('--assignee <name>', 'Set assignee')\n .option('--field <name=value...>', 'Set custom field (can specify multiple)')\n .action(async (specPath: string, options: {\n status?: SpecStatus;\n priority?: SpecPriority;\n tags?: string;\n assignee?: string;\n field?: string[];\n }) => {\n // Parse custom fields from --field options\n const customFields = parseCustomFieldOptions(options.field);\n \n const updates: {\n status?: SpecStatus;\n priority?: SpecPriority;\n tags?: string[];\n assignee?: string;\n customFields?: Record<string, unknown>;\n } = {\n status: options.status,\n priority: options.priority,\n tags: options.tags ? options.tags.split(',').map(t => t.trim()) : undefined,\n assignee: options.assignee,\n customFields: Object.keys(customFields).length > 0 ? customFields : undefined,\n };\n \n // Filter out undefined values\n Object.keys(updates).forEach(key => {\n if (updates[key as keyof typeof updates] === undefined) {\n delete updates[key as keyof typeof updates];\n }\n });\n \n if (Object.keys(updates).length === 0) {\n console.error('Error: At least one update option required (--status, --priority, --tags, --assignee, --field)');\n process.exit(1);\n }\n \n await updateSpec(specPath, updates);\n });\n\n// view command (primary viewer)\nprogram\n .command('view <spec>')\n .description('View spec content (supports sub-specs like \"045/DESIGN.md\")')\n .option('--raw', 'Output raw markdown (for piping/scripting)')\n .option('--json', 'Output as JSON')\n .option('--no-color', 'Disable colors')\n .action(async (specPath: string, options: {\n raw?: boolean;\n json?: boolean;\n color?: boolean;\n }) => {\n try {\n await viewCommand(specPath, {\n raw: options.raw,\n json: options.json,\n noColor: options.color === false,\n });\n } catch (error) {\n console.error('\\x1b[31mError:\\x1b[0m', error instanceof Error ? error.message : String(error));\n process.exit(1);\n }\n });\n\n// mcp command\nprogram\n .command('mcp')\n .description('Start MCP server for AI assistants (Claude Desktop, Cline, etc.)')\n .action(async () => {\n await mcpCommand();\n });\n\n// Parse and execute\nprogram.parse();\n","/**\n * Parse custom fields from CLI --field options\n * @param fieldOptions Array of \"name=value\" strings\n * @returns Record of parsed field names and values\n */\nexport function parseCustomFieldOptions(fieldOptions?: string[]): Record<string, unknown> {\n const customFields: Record<string, unknown> = {};\n \n if (!fieldOptions) {\n return customFields;\n }\n \n for (const field of fieldOptions) {\n const [key, ...valueParts] = field.split('=');\n if (key && valueParts.length > 0) {\n const value = valueParts.join('='); // Handle values with '=' in them\n customFields[key.trim()] = value.trim();\n }\n }\n \n return customFields;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;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7B,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ,MAAM,yBAAyB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAC7F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAGH,QACG,QAAQ,KAAK,EACb,YAAY,kEAAkE,EAC9E,OAAO,YAAY;AAClB,QAAM,WAAW;AACnB,CAAC;AAGH,QAAQ,MAAM;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../src/utils/cli-helpers.ts"],"sourcesContent":["import { Command } from 'commander';\nimport {\n createSpec,\n archiveSpec,\n listSpecs,\n updateSpec,\n checkSpecs,\n backfillTimestamps,\n listTemplates,\n showTemplate,\n addTemplate,\n removeTemplate,\n copyTemplate,\n initProject,\n statsCommand,\n boardCommand,\n timelineCommand,\n depsCommand,\n searchCommand,\n ganttCommand,\n filesCommand,\n viewCommand,\n openCommand,\n validateCommand,\n mcpCommand,\n migrateCommand,\n} from './commands/index.js';\nimport { parseCustomFieldOptions } from './utils/cli-helpers.js';\nimport type { SpecStatus, SpecPriority } from './frontmatter.js';\n\nconst program = new Command();\n\nprogram\n .name('lean-spec')\n .description('Manage LeanSpec documents')\n .version('0.1.2');\n\n// Add custom help text with grouped commands\nprogram.addHelpText('after', `\nCommand Groups:\n \n Core Commands:\n init Initialize LeanSpec in current directory\n create <name> Create new spec in folder structure\n list List all specs\n update <spec> Update spec metadata\n archive <spec> Move spec to archived/\n backfill [specs...] Backfill timestamps from git history\n migrate <input-path> Migrate specs from other SDD tools\n \n Viewing & Navigation:\n view <spec> View spec content\n open <spec> Open spec in editor\n search <query> Full-text search with metadata filters\n files <spec> List files in a spec\n \n Project & Analytics:\n board Show Kanban-style board view\n stats Show aggregate statistics\n timeline Show creation/completion over time\n gantt Show timeline with dependencies\n deps <spec> Show dependency graph for a spec\n \n Maintenance:\n check Check for sequence conflicts\n validate [specs...] Validate specs for quality issues\n templates Manage spec templates\n \n Server:\n mcp Start MCP server for AI assistants\n\nExamples:\n $ lean-spec init\n $ lean-spec create my-feature --priority high\n $ lean-spec list --status in-progress\n $ lean-spec view 042\n $ lean-spec backfill --dry-run\n $ lean-spec migrate ./docs/adr\n $ lean-spec migrate ./docs/rfcs --with copilot\n $ lean-spec board --tag backend\n $ lean-spec search \"authentication\"\n $ lean-spec validate\n $ lean-spec validate --verbose\n $ lean-spec validate --quiet --rule max-lines\n $ lean-spec validate 018 --max-lines 500\n`);\n\n// archive command\nprogram\n .command('archive <spec>')\n .description('Move spec to archived/')\n .action(async (specPath: string) => {\n await archiveSpec(specPath);\n });\n\n// backfill command\nprogram\n .command('backfill [specs...]')\n .description('Backfill timestamps from git history')\n .option('--dry-run', 'Show what would be updated without making changes')\n .option('--force', 'Overwrite existing timestamp values')\n .option('--assignee', 'Include assignee from first commit author')\n .option('--transitions', 'Include full status transition history')\n .option('--all', 'Include all optional fields (assignee + transitions)')\n .action(async (specs: string[] | undefined, options: {\n dryRun?: boolean;\n force?: boolean;\n assignee?: boolean;\n transitions?: boolean;\n all?: boolean;\n }) => {\n await backfillTimestamps({\n dryRun: options.dryRun,\n force: options.force,\n includeAssignee: options.assignee || options.all,\n includeTransitions: options.transitions || options.all,\n specs: specs && specs.length > 0 ? specs : undefined,\n });\n });\n\n// board command\nprogram\n .command('board')\n .description('Show Kanban-style board view with project completion summary')\n .option('--complete', 'Include complete specs (default: hidden)')\n .option('--simple', 'Hide completion summary (kanban only)')\n .option('--completion-only', 'Show only completion summary (no kanban)')\n .option('--tag <tag>', 'Filter by tag')\n .option('--assignee <name>', 'Filter by assignee')\n .action(async (options: {\n showComplete?: boolean;\n simple?: boolean;\n completionOnly?: boolean;\n tag?: string;\n assignee?: string;\n }) => {\n await boardCommand(options);\n });\n\n// check command\nprogram\n .command('check')\n .description('Check for sequence conflicts')\n .option('-q, --quiet', 'Brief output')\n .action(async (options: {\n quiet?: boolean;\n }) => {\n const hasNoConflicts = await checkSpecs(options);\n // Exit with 0 (success) if no conflicts, 1 (error) if conflicts found\n process.exit(hasNoConflicts ? 0 : 1);\n });\n\n// validate command\nprogram\n .command('validate [specs...]')\n .description('Validate specs for quality issues')\n .option('--max-lines <number>', 'Custom line limit (default: 400)', parseInt)\n .option('--verbose', 'Show passing specs')\n .option('--quiet', 'Suppress warnings, only show errors')\n .option('--format <format>', 'Output format: default, json, compact', 'default')\n .option('--rule <rule>', 'Filter by specific rule name (e.g., max-lines, frontmatter)')\n .action(async (specs: string[] | undefined, options: {\n maxLines?: number;\n verbose?: boolean;\n quiet?: boolean;\n format?: 'default' | 'json' | 'compact';\n rule?: string;\n }) => {\n const passed = await validateCommand({\n maxLines: options.maxLines,\n specs: specs && specs.length > 0 ? specs : undefined,\n verbose: options.verbose,\n quiet: options.quiet,\n format: options.format,\n rule: options.rule,\n });\n // Exit with 0 (success) if all passed, 1 (error) if any failed\n process.exit(passed ? 0 : 1);\n });\n\n// create command\nprogram\n .command('create <name>')\n .description('Create new spec in folder structure')\n .option('--title <title>', 'Set custom title')\n .option('--description <desc>', 'Set initial description')\n .option('--tags <tags>', 'Set tags (comma-separated)')\n .option('--priority <priority>', 'Set priority (low, medium, high, critical)')\n .option('--assignee <name>', 'Set assignee')\n .option('--template <template>', 'Use a specific template')\n .option('--field <name=value...>', 'Set custom field (can specify multiple)')\n .option('--no-prefix', 'Skip date prefix even if configured')\n .action(async (name: string, options: {\n title?: string;\n description?: string;\n tags?: string;\n priority?: SpecPriority;\n assignee?: string;\n template?: string;\n field?: string[];\n prefix?: boolean;\n }) => {\n // Parse custom fields from --field options\n const customFields = parseCustomFieldOptions(options.field);\n \n const createOptions: {\n title?: string;\n description?: string;\n tags?: string[];\n priority?: SpecPriority;\n assignee?: string;\n template?: string;\n customFields?: Record<string, unknown>;\n noPrefix?: boolean;\n } = {\n title: options.title,\n description: options.description,\n tags: options.tags ? options.tags.split(',').map(t => t.trim()) : undefined,\n priority: options.priority,\n assignee: options.assignee,\n template: options.template,\n customFields: Object.keys(customFields).length > 0 ? customFields : undefined,\n noPrefix: options.prefix === false,\n };\n await createSpec(name, createOptions);\n });\n\n// deps command\nprogram\n .command('deps <spec>')\n .description('Show dependency graph for a spec. Related specs (⟷) are shown bidirectionally, depends_on (→) are directional.')\n .option('--depth <n>', 'Show N levels deep (default: 3)', parseInt)\n .option('--graph', 'ASCII graph visualization')\n .option('--json', 'Output as JSON')\n .action(async (specPath: string, options: {\n depth?: number;\n graph?: boolean;\n json?: boolean;\n }) => {\n await depsCommand(specPath, options);\n });\n\n// files command\nprogram\n .command('files <spec>')\n .description('List files in a spec')\n .option('--type <type>', 'Filter by type: docs, assets')\n .option('--tree', 'Show tree structure')\n .action(async (specPath: string, options: {\n type?: 'docs' | 'assets';\n tree?: boolean;\n }) => {\n await filesCommand(specPath, options);\n });\n\n// gantt command\nprogram\n .command('gantt')\n .description('Show timeline with dependencies')\n .option('--weeks <n>', 'Show N weeks (default: 4)', parseInt)\n .option('--show-complete', 'Include completed specs')\n .option('--critical-path', 'Highlight critical path')\n .action(async (options: {\n weeks?: number;\n showComplete?: boolean;\n criticalPath?: boolean;\n }) => {\n await ganttCommand(options);\n });\n\n// init command\nprogram\n .command('init')\n .description('Initialize LeanSpec in current directory')\n .action(async () => {\n await initProject();\n });\n\n// list command\nprogram\n .command('list')\n .description('List all specs')\n .option('--archived', 'Include archived specs')\n .option('--status <status>', 'Filter by status (planned, in-progress, complete, archived)')\n .option('--tag <tag...>', 'Filter by tag (can specify multiple)')\n .option('--priority <priority>', 'Filter by priority (low, medium, high, critical)')\n .option('--assignee <name>', 'Filter by assignee')\n .option('--field <name=value...>', 'Filter by custom field (can specify multiple)')\n .option('--sort <field>', 'Sort by field (id, created, name, status, priority)', 'id')\n .option('--order <order>', 'Sort order (asc, desc)', 'desc')\n .action(async (options: {\n archived?: boolean;\n status?: SpecStatus;\n tag?: string[];\n priority?: SpecPriority;\n assignee?: string;\n field?: string[];\n sort?: string;\n order?: string;\n }) => {\n // Parse custom field filters from --field options\n const customFields = parseCustomFieldOptions(options.field);\n \n const listOptions: {\n showArchived?: boolean;\n status?: SpecStatus;\n tags?: string[];\n priority?: SpecPriority;\n assignee?: string;\n customFields?: Record<string, unknown>;\n sortBy?: string;\n sortOrder?: 'asc' | 'desc';\n } = {\n showArchived: options.archived,\n status: options.status,\n tags: options.tag,\n priority: options.priority,\n assignee: options.assignee,\n customFields: Object.keys(customFields).length > 0 ? customFields : undefined,\n sortBy: options.sort || 'id',\n sortOrder: (options.order as 'asc' | 'desc') || 'desc',\n };\n await listSpecs(listOptions);\n });\n\n// open command\nprogram\n .command('open <spec>')\n .description('Open spec in editor')\n .option('--editor <editor>', 'Specify editor command')\n .action(async (specPath: string, options: {\n editor?: string;\n }) => {\n try {\n await openCommand(specPath, {\n editor: options.editor,\n });\n } catch (error) {\n console.error('\\x1b[31mError:\\x1b[0m', error instanceof Error ? error.message : String(error));\n process.exit(1);\n }\n });\n\n// search command\nprogram\n .command('search <query>')\n .description('Full-text search with metadata filters')\n .option('--status <status>', 'Filter by status')\n .option('--tag <tag>', 'Filter by tag')\n .option('--priority <priority>', 'Filter by priority')\n .option('--assignee <name>', 'Filter by assignee')\n .option('--field <name=value...>', 'Filter by custom field (can specify multiple)')\n .action(async (query: string, options: {\n status?: SpecStatus;\n tag?: string;\n priority?: SpecPriority;\n assignee?: string;\n field?: string[];\n }) => {\n // Parse custom field filters from --field options\n const customFields = parseCustomFieldOptions(options.field);\n \n await searchCommand(query, {\n status: options.status,\n tag: options.tag,\n priority: options.priority,\n assignee: options.assignee,\n customFields: Object.keys(customFields).length > 0 ? customFields : undefined,\n });\n });\n\n// stats command\nprogram\n .command('stats')\n .description('Show aggregate statistics (default: simplified view)')\n .option('--tag <tag>', 'Filter by tag')\n .option('--assignee <name>', 'Filter by assignee')\n .option('--full', 'Show full detailed analytics (all sections)')\n .option('--timeline', 'Show only timeline section')\n .option('--velocity', 'Show only velocity section')\n .option('--json', 'Output as JSON')\n .action(async (options: {\n tag?: string;\n assignee?: string;\n full?: boolean;\n timeline?: boolean;\n velocity?: boolean;\n json?: boolean;\n }) => {\n await statsCommand(options);\n });\n\n// templates command and subcommands\nconst templatesCmd = program\n .command('templates')\n .description('Manage spec templates');\n\ntemplatesCmd\n .command('list')\n .description('List available templates')\n .action(async () => {\n await listTemplates();\n });\n\ntemplatesCmd\n .command('show <name>')\n .description('Show template content')\n .action(async (name: string) => {\n await showTemplate(name);\n });\n\ntemplatesCmd\n .command('add <name> <file>')\n .description('Register a template')\n .action(async (name: string, file: string) => {\n await addTemplate(name, file);\n });\n\ntemplatesCmd\n .command('remove <name>')\n .description('Unregister a template')\n .action(async (name: string) => {\n await removeTemplate(name);\n });\n\ntemplatesCmd\n .command('copy <source> <target>')\n .description('Copy a template to create a new one')\n .action(async (source: string, target: string) => {\n await copyTemplate(source, target);\n });\n\n// Default action for templates (list)\ntemplatesCmd\n .action(async () => {\n await listTemplates();\n });\n\n// timeline command\nprogram\n .command('timeline')\n .description('Show creation/completion over time')\n .option('--days <n>', 'Show last N days (default: 30)', parseInt)\n .option('--by-tag', 'Group by tag')\n .option('--by-assignee', 'Group by assignee')\n .action(async (options: {\n days?: number;\n byTag?: boolean;\n byAssignee?: boolean;\n }) => {\n await timelineCommand(options);\n });\n\n// update command\nprogram\n .command('update <spec>')\n .description('Update spec metadata')\n .option('--status <status>', 'Set status (planned, in-progress, complete, archived)')\n .option('--priority <priority>', 'Set priority (low, medium, high, critical)')\n .option('--tags <tags>', 'Set tags (comma-separated)')\n .option('--assignee <name>', 'Set assignee')\n .option('--field <name=value...>', 'Set custom field (can specify multiple)')\n .action(async (specPath: string, options: {\n status?: SpecStatus;\n priority?: SpecPriority;\n tags?: string;\n assignee?: string;\n field?: string[];\n }) => {\n // Parse custom fields from --field options\n const customFields = parseCustomFieldOptions(options.field);\n \n const updates: {\n status?: SpecStatus;\n priority?: SpecPriority;\n tags?: string[];\n assignee?: string;\n customFields?: Record<string, unknown>;\n } = {\n status: options.status,\n priority: options.priority,\n tags: options.tags ? options.tags.split(',').map(t => t.trim()) : undefined,\n assignee: options.assignee,\n customFields: Object.keys(customFields).length > 0 ? customFields : undefined,\n };\n \n // Filter out undefined values\n Object.keys(updates).forEach(key => {\n if (updates[key as keyof typeof updates] === undefined) {\n delete updates[key as keyof typeof updates];\n }\n });\n \n if (Object.keys(updates).length === 0) {\n console.error('Error: At least one update option required (--status, --priority, --tags, --assignee, --field)');\n process.exit(1);\n }\n \n await updateSpec(specPath, updates);\n });\n\n// view command (primary viewer)\nprogram\n .command('view <spec>')\n .description('View spec content (supports sub-specs like \"045/DESIGN.md\")')\n .option('--raw', 'Output raw markdown (for piping/scripting)')\n .option('--json', 'Output as JSON')\n .option('--no-color', 'Disable colors')\n .action(async (specPath: string, options: {\n raw?: boolean;\n json?: boolean;\n color?: boolean;\n }) => {\n try {\n await viewCommand(specPath, {\n raw: options.raw,\n json: options.json,\n noColor: options.color === false,\n });\n } catch (error) {\n console.error('\\x1b[31mError:\\x1b[0m', error instanceof Error ? error.message : String(error));\n process.exit(1);\n }\n });\n\n// migrate command\nprogram\n .command('migrate <input-path>')\n .description('Migrate specs from other SDD tools (ADR, RFC, OpenSpec, spec-kit, etc.)')\n .option('--with <provider>', 'AI-assisted migration (copilot, claude, gemini)')\n .option('--dry-run', 'Preview without making changes')\n .option('--batch-size <n>', 'Process N docs at a time', parseInt)\n .option('--skip-validation', \"Don't validate after migration\")\n .option('--backfill', 'Auto-run backfill after migration')\n .action(async (inputPath: string, options: {\n with?: string;\n dryRun?: boolean;\n batchSize?: number;\n skipValidation?: boolean;\n backfill?: boolean;\n }) => {\n // Validate AI provider if specified\n if (options.with && !['copilot', 'claude', 'gemini'].includes(options.with)) {\n console.error('\\x1b[31m❌ Error:\\x1b[0m Invalid AI provider. Use: copilot, claude, or gemini');\n process.exit(1);\n }\n \n await migrateCommand(inputPath, {\n aiProvider: options.with as 'copilot' | 'claude' | 'gemini' | undefined,\n dryRun: options.dryRun,\n batchSize: options.batchSize,\n skipValidation: options.skipValidation,\n backfill: options.backfill,\n });\n });\n\n// mcp command\nprogram\n .command('mcp')\n .description('Start MCP server for AI assistants (Claude Desktop, Cline, etc.)')\n .action(async () => {\n await mcpCommand();\n });\n\n// Parse and execute\nprogram.parse();\n","/**\n * Parse custom fields from CLI --field options\n * @param fieldOptions Array of \"name=value\" strings\n * @returns Record of parsed field names and values\n */\nexport function parseCustomFieldOptions(fieldOptions?: string[]): Record<string, unknown> {\n const customFields: Record<string, unknown> = {};\n \n if (!fieldOptions) {\n return customFields;\n }\n \n for (const field of fieldOptions) {\n const [key, ...valueParts] = field.split('=');\n if (key && valueParts.length > 0) {\n const value = valueParts.join('='); // Handle values with '=' in them\n customFields[key.trim()] = value.trim();\n }\n }\n \n return customFields;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;;;ACKjB,SAAS,wBAAwB,cAAkD;AACxF,QAAM,eAAwC,CAAC;AAE/C,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AAEA,aAAW,SAAS,cAAc;AAChC,UAAM,CAAC,KAAK,GAAG,UAAU,IAAI,MAAM,MAAM,GAAG;AAC5C,QAAI,OAAO,WAAW,SAAS,GAAG;AAChC,YAAM,QAAQ,WAAW,KAAK,GAAG;AACjC,mBAAa,IAAI,KAAK,CAAC,IAAI,MAAM,KAAK;AAAA,IACxC;AAAA,EACF;AAEA,SAAO;AACT;;;ADSA,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,WAAW,EAChB,YAAY,2BAA2B,EACvC,QAAQ,OAAO;AAGlB,QAAQ,YAAY,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAQ,KAAK,EACb,YAAY,kEAAkE,EAC9E,OAAO,YAAY;AAClB,QAAM,WAAW;AACnB,CAAC;AAGH,QAAQ,MAAM;","names":[]}
|
package/dist/mcp-server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lean-spec",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Lightweight spec methodology for AI-powered development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "tsup",
|
|
11
|
-
"dev": "tsup --watch",
|
|
12
|
-
"typecheck": "tsc --noEmit",
|
|
13
|
-
"format": "prettier --write .",
|
|
14
|
-
"test": "pnpm test:run",
|
|
15
|
-
"test:ui": "vitest --ui",
|
|
16
|
-
"test:run": "vitest run",
|
|
17
|
-
"test:coverage": "vitest run --coverage",
|
|
18
|
-
"docs:dev": "pnpm -F docs-site start",
|
|
19
|
-
"docs:build": "pnpm -F docs-site build",
|
|
20
|
-
"docs:serve": "pnpm -F docs-site serve"
|
|
7
|
+
"lean-spec": "./bin/lean-spec.js"
|
|
21
8
|
},
|
|
22
9
|
"keywords": [
|
|
23
10
|
"spec",
|
|
@@ -84,5 +71,18 @@
|
|
|
84
71
|
},
|
|
85
72
|
"engines": {
|
|
86
73
|
"node": ">=18"
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"build": "tsup",
|
|
77
|
+
"dev": "tsup --watch",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
79
|
+
"format": "prettier --write .",
|
|
80
|
+
"test": "pnpm test:run",
|
|
81
|
+
"test:ui": "vitest --ui",
|
|
82
|
+
"test:run": "vitest run",
|
|
83
|
+
"test:coverage": "vitest run --coverage",
|
|
84
|
+
"docs:dev": "pnpm -F docs-site start",
|
|
85
|
+
"docs:build": "pnpm -F docs-site build",
|
|
86
|
+
"docs:serve": "pnpm -F docs-site serve"
|
|
87
87
|
}
|
|
88
|
-
}
|
|
88
|
+
}
|
|
@@ -22,4 +22,4 @@ Balance governance with agility. Required checks without bureaucracy. Lean princ
|
|
|
22
22
|
|
|
23
23
|
1. Customize AGENTS.md with your security requirements
|
|
24
24
|
2. Update approval workflows for your org
|
|
25
|
-
3. Create first spec: `
|
|
25
|
+
3. Create first spec: `lean-spec create my-feature`
|
|
@@ -15,12 +15,12 @@ Enterprise-grade development with security and compliance requirements.
|
|
|
15
15
|
|
|
16
16
|
Before starting work, understand project context and dependencies:
|
|
17
17
|
|
|
18
|
-
- `
|
|
19
|
-
- `
|
|
20
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
18
|
+
- `lean-spec stats` - See work distribution across specs
|
|
19
|
+
- `lean-spec board` - View specs organized by status
|
|
20
|
+
- `lean-spec list --tag=<tag>` - Find specs by tag (e.g., `--tag=security`)
|
|
21
|
+
- `lean-spec search "<query>"` - Full-text search across specs
|
|
22
|
+
- `lean-spec deps <spec>` - Check dependencies before starting work
|
|
23
|
+
- `lean-spec gantt` - View project timeline and milestones
|
|
24
24
|
|
|
25
25
|
These commands help you understand what exists, what's in progress, and what depends on what.
|
|
26
26
|
|
|
@@ -56,7 +56,7 @@ depends_on:
|
|
|
56
56
|
|
|
57
57
|
**Update with:**
|
|
58
58
|
```bash
|
|
59
|
-
|
|
59
|
+
lean-spec update <spec> --status in-progress --assignee yourname
|
|
60
60
|
# or edit frontmatter directly
|
|
61
61
|
```
|
|
62
62
|
|
|
@@ -89,7 +89,7 @@ Optional for:
|
|
|
89
89
|
|
|
90
90
|
## Approval Workflow
|
|
91
91
|
|
|
92
|
-
1. **Discover context** - Run `
|
|
92
|
+
1. **Discover context** - Run `lean-spec stats`, `lean-spec board`, `lean-spec deps`
|
|
93
93
|
2. **Create spec** - Include all required frontmatter fields
|
|
94
94
|
3. **Technical review** - Assign reviewer in frontmatter
|
|
95
95
|
4. **Security team review** - For security/compliance-tagged specs
|
|
@@ -100,14 +100,14 @@ Optional for:
|
|
|
100
100
|
|
|
101
101
|
## Workflow
|
|
102
102
|
|
|
103
|
-
1. **Discover context** - Run `
|
|
104
|
-
2. **Search existing specs** - Use `
|
|
105
|
-
3. **Check dependencies** - Run `
|
|
103
|
+
1. **Discover context** - Run `lean-spec stats`, `lean-spec board`, or `lean-spec gantt`
|
|
104
|
+
2. **Search existing specs** - Use `lean-spec search` or `lean-spec list --tag=<relevant>`
|
|
105
|
+
3. **Check dependencies** - Run `lean-spec deps <spec>` to understand dependencies
|
|
106
106
|
4. **Create or update spec** - Add complete frontmatter with compliance tags
|
|
107
107
|
5. **Get reviews** - Assign reviewer, tag for security review if needed
|
|
108
108
|
6. **Implement changes** - Keep spec in sync, update status appropriately
|
|
109
109
|
7. **Update status** - Mark progress through workflow states
|
|
110
|
-
8. **Archive when done** - `
|
|
110
|
+
8. **Archive when done** - `lean-spec archive <spec>` after completion
|
|
111
111
|
|
|
112
112
|
## Quality Standards
|
|
113
113
|
|
|
@@ -27,10 +27,10 @@ Skip specs for:
|
|
|
27
27
|
|
|
28
28
|
Before starting work, understand project context:
|
|
29
29
|
|
|
30
|
-
- `
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
33
|
-
- `
|
|
30
|
+
- `lean-spec stats` - See work distribution
|
|
31
|
+
- `lean-spec board` - View specs by status
|
|
32
|
+
- `lean-spec search "<query>"` - Find relevant work
|
|
33
|
+
- `lean-spec list` - List all specs
|
|
34
34
|
|
|
35
35
|
These help you understand what exists and what's in progress.
|
|
36
36
|
|
|
@@ -52,16 +52,16 @@ created: YYYY-MM-DD
|
|
|
52
52
|
|
|
53
53
|
**Update status with:**
|
|
54
54
|
```bash
|
|
55
|
-
|
|
55
|
+
lean-spec update <spec> --status in-progress
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
## Workflow
|
|
59
59
|
|
|
60
|
-
1. **Check existing work** - Run `
|
|
60
|
+
1. **Check existing work** - Run `lean-spec board` or `lean-spec search`
|
|
61
61
|
2. **Create or update spec** - Add frontmatter with `status` and `created`
|
|
62
62
|
3. **Implement changes** - Keep spec in sync as you learn
|
|
63
63
|
4. **Update status** - Mark progress: `draft` → `in-progress` → `complete`
|
|
64
|
-
5. **Archive when done** - `
|
|
64
|
+
5. **Archive when done** - `lean-spec archive <spec>` moves to archive
|
|
65
65
|
|
|
66
66
|
## Quality Standards
|
|
67
67
|
|
|
@@ -27,11 +27,11 @@ Skip specs for:
|
|
|
27
27
|
|
|
28
28
|
Before starting work, understand project context:
|
|
29
29
|
|
|
30
|
-
- `
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
33
|
-
- `
|
|
34
|
-
- `
|
|
30
|
+
- `lean-spec stats` - See work distribution across specs
|
|
31
|
+
- `lean-spec board` - View specs organized by status
|
|
32
|
+
- `lean-spec list --tag=<tag>` - Find specs by tag (e.g., `--tag=api`)
|
|
33
|
+
- `lean-spec search "<query>"` - Full-text search across specs
|
|
34
|
+
- `lean-spec deps <spec>` - Check dependencies before starting work
|
|
35
35
|
|
|
36
36
|
These commands help you understand what exists, what's in progress, and what depends on what.
|
|
37
37
|
|
|
@@ -57,19 +57,19 @@ assignee: username # for team coordination
|
|
|
57
57
|
|
|
58
58
|
**Update status with:**
|
|
59
59
|
```bash
|
|
60
|
-
|
|
60
|
+
lean-spec update <spec> --status in-progress --assignee yourname
|
|
61
61
|
# or edit frontmatter directly
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Workflow
|
|
65
65
|
|
|
66
|
-
1. **Discover context** - Run `
|
|
67
|
-
2. **Search existing specs** - Use `
|
|
68
|
-
3. **Check dependencies** - Run `
|
|
66
|
+
1. **Discover context** - Run `lean-spec stats` or `lean-spec board` to see current state
|
|
67
|
+
2. **Search existing specs** - Use `lean-spec search` or `lean-spec list` to find relevant work
|
|
68
|
+
3. **Check dependencies** - Run `lean-spec deps <spec>` if working on existing spec
|
|
69
69
|
4. **Create or update spec** - Add frontmatter with required fields and helpful metadata
|
|
70
70
|
5. **Implement changes** - Keep spec in sync as you learn
|
|
71
71
|
6. **Update status** - Mark progress: `draft` → `in-progress` → `complete`
|
|
72
|
-
7. **Archive when done** - `
|
|
72
|
+
7. **Archive when done** - `lean-spec archive <spec>` moves to archive
|
|
73
73
|
|
|
74
74
|
## Quality Standards
|
|
75
75
|
|